Class: Rley::Syntax::Literal
- Defined in:
- lib/rley/syntax/literal.rb
Overview
A literal is terminal symbol that matches a lexical pattern
Instance Attribute Summary collapse
-
#pattern ⇒ Object
readonly
The exact text representation of the word.
Attributes inherited from GrmSymbol
Instance Method Summary collapse
-
#initialize(aName, aPattern) ⇒ Literal
constructor
A new instance of Literal.
Methods inherited from Terminal
Methods inherited from GrmSymbol
#generative?, #terminal?, #to_s
Constructor Details
#initialize(aName, aPattern) ⇒ Literal
Returns a new instance of Literal.
12 13 14 15 |
# File 'lib/rley/syntax/literal.rb', line 12 def initialize(aName, aPattern) super(aName) @pattern = aPattern end |
Instance Attribute Details
#pattern ⇒ Object (readonly)
The exact text representation of the word.
10 11 12 |
# File 'lib/rley/syntax/literal.rb', line 10 def pattern @pattern end |