Permalink
Browse files

metaprogramming module node

  • Loading branch information...
1 parent 411d05c commit e32912a59b7b266094d748656c0f10534149daf4 @tenderlove committed Aug 13, 2008
Showing with 4 additions and 17 deletions.
  1. +3 −1 lib/yacc.y
  2. +0 −1 lib/zomg.rb
  3. +0 −14 lib/zomg/idl/nodes/module.rb
  4. +1 −1 lib/zomg/idl/nodes/node.rb
View
@@ -134,7 +134,9 @@ definition
/*3*/
module
: T_MODULE T_IDENTIFIER T_LEFT_CURLY_BRACKET
- definitions T_RIGHT_CURLY_BRACKET { result = Module.new(val[1], val[3]) }
+ definitions T_RIGHT_CURLY_BRACKET {
+ result = Module.new(val[3], :name => val[1])
+ }
;
/*4*/
View
@@ -5,7 +5,6 @@
%w{
node
specification
- module
interface
operation
parameter
@@ -1,14 +0,0 @@
-module ZOMG
- module IDL
- module Nodes
- class Module < Node
- attr_accessor :name
- alias :definitions :children
- def initialize(name, children)
- super(children)
- @name = name
- end
- end
- end
- end
-end
@@ -39,7 +39,7 @@ def to_ruby
FloatingPointLiteral BooleanLiteral Context StringLiteral
WideStringLiteral WideCharacterLiteral UnaryMinus Object
UnaryPlus WString String Case Enum Exception ValueBoxDcl
- Struct ScopedName
+ Struct ScopedName Module
}.each { |type| const_set(type.to_sym, Class.new(Node)) }
end
end

0 comments on commit e32912a

Please sign in to comment.