Class: Rley::Syntax::Literal

Inherits:
Terminal show all
Defined in:
lib/rley/syntax/literal.rb

Overview

A literal is terminal symbol that matches a lexical pattern

Instance Attribute Summary collapse

Attributes inherited from GrmSymbol

#generative, #name

Instance Method Summary collapse

Methods inherited from Terminal

#nullable?, #terminal?, #to_s

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

#patternObject (readonly)

The exact text representation of the word.



10
11
12
# File 'lib/rley/syntax/literal.rb', line 10

def pattern
  @pattern
end