class Calyx::Syntax::Terminal

A type of production rule that terminates with a resulting string atom.

Public Class Methods

new(atom) click to toggle source

Construct a terminal node with the given value.

@param [#to_s] atom

# File lib/calyx/syntax/terminal.rb, line 8
def initialize(atom)
  @atom = atom
end

Public Instance Methods

evaluate(options) click to toggle source

Evaluate the terminal by returning its identity directly.

@param [Calyx::Options] options @return [Array]

# File lib/calyx/syntax/terminal.rb, line 16
def evaluate(options)
  [:atom, @atom]
end