class Calyx::Syntax::NonTerminal
A type of production rule that represents a non-terminal expansion, linking one rule to another.
Public Class Methods
new(symbol, registry)
click to toggle source
Construct a non-terminal node, given the symbol to lookup and the registry to look it up in.
@param [Symbol] symbol @param [Calyx::Registry] registry
# File lib/calyx/syntax/non_terminal.rb, line 11 def initialize(symbol, registry) @symbol = symbol.to_sym @registry = registry end
Public Instance Methods
evaluate(options)
click to toggle source
Evaluate the non-terminal, using the registry to handle the expansion.
@param [Calyx::Options] options @return [Array]
# File lib/calyx/syntax/non_terminal.rb, line 20 def evaluate(options) [@symbol, @registry.expand(@symbol).evaluate(options)] end