Class: Zenlish::Lex::Literal

Inherits:
Rley::Lexical::Token
  • Object
show all
Defined in:
lib/zenlish/lex/literal.rb

Overview

An occurrence of a grammar terminal symbol that occurs in the input text.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(literalText, aLexeme, aPosition) ⇒ Literal

initialize(theLexeme, aTerminal, aPosition) ⇒ Token

Parameters:

  • literalText (String)

    the portion of input text that represents an occurence of the lexeme.

  • aLexeme (Lex::Lexeme)

    the lexeme matched by the literal text.

  • aPosition (Integer)

    the position of the literal in the input.



14
15
16
17
# File 'lib/zenlish/lex/literal.rb', line 14

def initialize(literalText, aLexeme, aPosition)
  super(literalText, aLexeme.wclass.name, aPosition)
  @zlexeme = aLexeme
end

Instance Attribute Details

#zlexemeObject (readonly)

Returns the value of attribute zlexeme.



7
8
9
# File 'lib/zenlish/lex/literal.rb', line 7

def zlexeme
  @zlexeme
end