Class: Electr::RootRule

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

Overview

Starting point for the rules.

TODO Is this really needed?

Instance Method Summary collapse

Methods inherited from BaseRule

#initialize

Constructor Details

This class inherits a constructor from Electr::BaseRule

Instance Method Details

#applyObject



8
9
10
11
12
13
14
# File 'lib/electr/parser/rules/root_rule.rb', line 8

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