Class: FExpr::Evaluator
- Inherits:
-
Object
- Object
- FExpr::Evaluator
- Defined in:
- lib/fexpr/base.rb
Defined Under Namespace
Classes: Node, NumNode, OpNode
Instance Method Summary collapse
-
#eval ⇒ Object
Void -> String.
-
#initialize(argv) ⇒ Evaluator
constructor
A new instance of Evaluator.
Constructor Details
#initialize(argv) ⇒ Evaluator
Returns a new instance of Evaluator.
5 6 7 8 9 |
# File 'lib/fexpr/base.rb', line 5 def initialize(argv) @argv = argv @node_stack = [] @opt_trace = false end |
Instance Method Details
#eval ⇒ Object
Void -> String
12 13 14 15 16 17 18 |
# File 'lib/fexpr/base.rb', line 12 def eval @toks = Array.new @argv @tok = nil next_token expr evaluate.to_s end |