Class: Heist::Scheme::Program
- Inherits:
-
Treetop::Runtime::SyntaxNode
- Object
- Treetop::Runtime::SyntaxNode
- Heist::Scheme::Program
- Defined in:
- lib/heist/parser/nodes.rb
Overview
Program
is the root of the parse tree; parsing any string of Scheme code produces one of these.
Instance Method Summary collapse
-
#convert! ⇒ Object
Converts all the
Treetop
objects in theProgram
to Heist objects and raw Ruby data ready for interpretation using aRuntime
. -
#eval(scope) ⇒ Object
Evaluates all the expressions in the
Program
in order, returning the result of the last expression.
Instance Method Details
#convert! ⇒ Object
Converts all the Treetop
objects in the Program
to Heist objects and raw Ruby data ready for interpretation using a Runtime
.
33 34 35 36 |
# File 'lib/heist/parser/nodes.rb', line 33 def convert! return @data if @data @data = Runtime::Cons.construct(elements[1].elements, true) { |c| c.eval } end |