Permalink
Browse files

metaprogramming the valueboxdcl node

  • Loading branch information...
1 parent 2eaff8a commit e48ffde5b7ff4fa375fcdb3a90c7166463244a86 @tenderlove committed Aug 13, 2008
Showing with 2 additions and 16 deletions.
  1. +1 −1 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/value_box_dcl.rb
View
@@ -230,7 +230,7 @@ value_forward_dcl
/*15*/
value_box_dcl
: T_VALUETYPE T_IDENTIFIER type_spec {
- result = ValueBoxDcl.new(val[1], val[2])
+ result = ValueBoxDcl.new(val[2], :name => val[1])
}
;
View
@@ -20,7 +20,6 @@
scoped_name
constant
binary
- value_box_dcl
}.each { |node_type|
require "zomg/idl/nodes/#{node_type}"
}
@@ -38,7 +38,7 @@ def to_ruby
UnsignedLongLong LongLong Any ForwardDeclaration WChar
FloatingPointLiteral BooleanLiteral Context StringLiteral
WideStringLiteral WideCharacterLiteral UnaryMinus Object
- UnaryPlus WString String Case Enum Exception
+ UnaryPlus WString String Case Enum Exception ValueBoxDcl
}.each { |type| const_set(type.to_sym, Class.new(Node)) }
end
end
@@ -1,13 +0,0 @@
-module ZOMG
- module IDL
- module Nodes
- class ValueBoxDcl < Node
- attr_accessor :name
- def initialize(name, children)
- @name = name
- super(children)
- end
- end
- end
- end
-end

0 comments on commit e48ffde

Please sign in to comment.