Class: Idl::AryAccessSyntaxNode
- Inherits:
-
SyntaxNode
- Object
- Treetop::Runtime::SyntaxNode
- SyntaxNode
- Idl::AryAccessSyntaxNode
- Defined in:
- lib/idlc/ast.rb
Overview
this is not used as an AST node; we use it split chained array accesses
For example, it helps us represent
X[rs1][31:0]
Instance Method Summary collapse
-
#to_ast ⇒ AstNode
fix up left recursion.
Methods inherited from Treetop::Runtime::SyntaxNode
#set_input_file, #set_input_file_unless_already_set, #space?
Instance Method Details
#to_ast ⇒ AstNode
fix up left recursion
2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 |
# File 'lib/idlc/ast.rb', line 2514 def to_ast var = send(:a).to_ast send(:brackets).elements.each do |bracket| var = if bracket.msb.empty? AryElementAccessAst.new(input, interval, var, bracket.lsb.to_ast) else AryRangeAccessAst.new(input, interval, var, bracket.msb.expression.to_ast, bracket.lsb.to_ast) end end var end |