Class: MSFLVisitors::AST
- Inherits:
-
Object
- Object
- MSFLVisitors::AST
- Defined in:
- lib/msfl_visitors/ast.rb
Instance Attribute Summary collapse
-
#root ⇒ Object
Returns the value of attribute root.
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
Use this method to walk the AST with a particular visitor.
-
#initialize(msfl) ⇒ AST
constructor
A new instance of AST.
Constructor Details
#initialize(msfl) ⇒ AST
Returns a new instance of AST.
6 7 8 |
# File 'lib/msfl_visitors/ast.rb', line 6 def initialize(msfl) self.root = MSFLVisitors::Parsers::MSFLParser.parse msfl end |
Instance Attribute Details
#root ⇒ Object
Returns the value of attribute root.
4 5 6 |
# File 'lib/msfl_visitors/ast.rb', line 4 def root @root end |
Instance Method Details
#accept(visitor) ⇒ Object
Use this method to walk the AST with a particular visitor
11 12 13 |
# File 'lib/msfl_visitors/ast.rb', line 11 def accept(visitor) root.accept visitor end |