Class: Rley::Syntax::MatchClosest
- Inherits:
-
Object
- Object
- Rley::Syntax::MatchClosest
- Defined in:
- lib/rley/syntax/match_closest.rb
Overview
A constraint that indicates that a given rhs member must match the closest given terminal symbol in that rhs
Instance Attribute Summary collapse
-
#closest_symb ⇒ String
readonly
Name of closest preceding symbol to pair.
-
#entries ⇒ NilClass, Array<Parser::ParseEntry>
Set of entries with closest symbol.
-
#idx_symbol ⇒ Integer
readonly
Index of constrained symbol to match.
Instance Method Summary collapse
-
#initialize(aSymbolSeq, idxSymbol, nameClosest) ⇒ MatchClosest
constructor
A new instance of MatchClosest.
Constructor Details
#initialize(aSymbolSeq, idxSymbol, nameClosest) ⇒ MatchClosest
Returns a new instance of MatchClosest.
20 21 22 23 |
# File 'lib/rley/syntax/match_closest.rb', line 20 def initialize(aSymbolSeq, idxSymbol, nameClosest) @idx_symbol = valid_idx_symbol(idxSymbol, aSymbolSeq) @closest_symb = valid_name_closest(nameClosest) end |
Instance Attribute Details
#closest_symb ⇒ String (readonly)
Returns name of closest preceding symbol to pair.
12 13 14 |
# File 'lib/rley/syntax/match_closest.rb', line 12 def closest_symb @closest_symb end |
#entries ⇒ NilClass, Array<Parser::ParseEntry>
Returns set of entries with closest symbol.
15 16 17 |
# File 'lib/rley/syntax/match_closest.rb', line 15 def entries @entries end |
#idx_symbol ⇒ Integer (readonly)
Returns index of constrained symbol to match.
9 10 11 |
# File 'lib/rley/syntax/match_closest.rb', line 9 def idx_symbol @idx_symbol end |