Permalink
Browse files

metaprogramming the scoped_name node

  • Loading branch information...
1 parent ea324ae commit a6ad673718bc635804d09dea03d08fbb6f4af472 @tenderlove committed Aug 13, 2008
Showing with 3 additions and 17 deletions.
  1. +2 −2 lib/yacc.y
  2. +0 −1 lib/zomg.rb
  3. +1 −1 lib/zomg/idl/nodes/node.rb
  4. +0 −13 lib/zomg/idl/nodes/scoped_name.rb
View
@@ -208,8 +208,8 @@ interface_name
/*12*/
scoped_name
- : T_IDENTIFIER { result = ScopedName.new(val[0]) }
- | T_SCOPE T_IDENTIFIER { result = ScopedName.new(val[0]) }
+ : T_IDENTIFIER { result = ScopedName.new([], :name => val[0]) }
+ | T_SCOPE T_IDENTIFIER { result = ScopedName.new([], :name => val[0]) }
| scoped_name T_SCOPE T_IDENTIFIER
;
View
@@ -16,7 +16,6 @@
array_declarator
typedef
interface_header
- scoped_name
constant
binary
}.each { |node_type|
@@ -39,7 +39,7 @@ def to_ruby
FloatingPointLiteral BooleanLiteral Context StringLiteral
WideStringLiteral WideCharacterLiteral UnaryMinus Object
UnaryPlus WString String Case Enum Exception ValueBoxDcl
- Struct
+ Struct ScopedName
}.each { |type| const_set(type.to_sym, Class.new(Node)) }
end
end
@@ -1,13 +0,0 @@
-module ZOMG
- module IDL
- module Nodes
- class ScopedName < Node
- attr_accessor :name
- def initialize(name, children = [])
- @name = name
- super(children)
- end
- end
- end
- end
-end

0 comments on commit a6ad673

Please sign in to comment.