class Rley::Syntax::SymbolSeq
A symbol sequence is a suite of grammar symbols
Attributes
@return [Array<GrmSymbol>] The sequence of symbols
Public Class Methods
Source
# File lib/rley/syntax/symbol_seq.rb, line 18 def initialize(theSymbols) @members = theSymbols.dup end
Create a sequence of grammar symbols (as in right-hand side of a production rule). @param theSymbols [Array<GrmSymbol>] An array of symbols.
Public Instance Methods
Source
# File lib/rley/syntax/symbol_seq.rb, line 25 def ==(other) return true if equal?(other) case other when SymbolSeq then result = other.members == members when Array then result = other == members else msg = "Cannot compare a SymbolSeq with a #{other.class}" raise StandardError, msg end result end
Equality operator. @param other [SymbolSeq|Array] @return [Boolean]
Source
# File lib/rley/syntax/symbol_seq.rb, line 42 def inspect result = +"#<#{self.class.name}:#{object_id}" symbol_names = members.map(&:name) result << " @members=#{symbol_names}>" result end
Returns a string containing a human-readable representation of the sequence of symbols. @return [String]