Class: Electr::RootRule

Inherits:
BaseRule show all
Defined in:
lib/electr/parser/rules/root_rule.rb

Instance Method Summary collapse

Methods inherited from BaseRule

#initialize

Constructor Details

This class inherits a constructor from Electr::BaseRule

Instance Method Details

#apply!Object



5
6
7
8
9
10
11
# File 'lib/electr/parser/rules/root_rule.rb', line 5

def apply!
  root_node = RootAST.new
  while more_units?
    ExpressionRule.new(@units, root_node).apply!
  end
  @ast_node.add_child(root_node)
end