Class: Calyx::Production::Terminal
- Inherits:
-
Object
- Object
- Calyx::Production::Terminal
- Defined in:
- lib/calyx/production/terminal.rb
Overview
A type of production rule that terminates with a resulting string atom.
Instance Method Summary collapse
-
#evaluate(options) ⇒ Array
Evaluate the terminal by returning its identity directly.
-
#initialize(atom) ⇒ Terminal
constructor
Construct a terminal node with the given value.
Constructor Details
#initialize(atom) ⇒ Terminal
Construct a terminal node with the given value.
8 9 10 |
# File 'lib/calyx/production/terminal.rb', line 8 def initialize(atom) @atom = atom end |
Instance Method Details
#evaluate(options) ⇒ Array
Evaluate the terminal by returning its identity directly.
16 17 18 |
# File 'lib/calyx/production/terminal.rb', line 16 def evaluate() [:atom, @atom] end |