class Rley::Lexical::Literal
A literal (value) is a token that represents a data value in the parsed language. For instance, in Ruby data values such as strings, numbers, regular expression,… can appear directly in the source code. These are examples of literal values. One responsibility of a tokenizer/lexer is to convert the text representation into a corresponding value in a convenient format for the interpreter/compiler.
Attributes
@return [Object] The value expressed in one of the target datatype.
Public Class Methods
Source
# File lib/rley/lexical/literal.rb, line 22 def initialize(aValue, theLexeme, aTerminal, aPosition = nil) super(theLexeme, aTerminal, aPosition) @value = aValue end
Constructor. @param aValue [Object] value of the token in internal representation @param theLexeme [String] the lexeme (= piece of text from input) @param aTerminal [Syntax::Terminal, String] @param aPosition [Rley::Lexical::Position] line, column position pf token
Calls superclass method