Class: Treetop::Runtime::SyntaxNode
- Inherits:
-
Object
- Object
- Treetop::Runtime::SyntaxNode
- Defined in:
- lib/origen_verilog/node.rb
Instance Method Summary collapse
Instance Method Details
#elements_to_ast(elmnts = elements) ⇒ Object
100 101 102 103 104 105 106 107 108 |
# File 'lib/origen_verilog/node.rb', line 100 def elements_to_ast(elmnts = elements) elmnts.map do |e| if e.respond_to?(:to_ast) e.to_ast elsif e.nonterminal? && !e.elements.empty? elements_to_ast(e.elements) end end.compact.flatten end |
#file ⇒ Object
110 111 112 |
# File 'lib/origen_verilog/node.rb', line 110 def file Treetop.origen_verilog_parser.file end |
#n(type, *children) ⇒ Object
91 92 93 94 95 96 97 98 |
# File 'lib/origen_verilog/node.rb', line 91 def n(type, *children) properties = children.pop if children.last.is_a?(Hash) properties ||= {} properties[:input] ||= input properties[:interval] ||= interval properties[:file] ||= file Treetop.origen_verilog_parser.node.new(type, children, properties || {}) end |