class CLTK::Lexers::Calculator
Overview
The Calculator lexer is a simple lexer for use with several of the provided parsers.
Defined in:
cltk/lexers/calculator.crConstructors
-
.new
The Calculator lexer is a simple lexer for use with several of the provided parsers.
Instance Method Summary
-
#lex(string, file_name = nil)
Lexes a string using the encapsulated environment.
-
#lex_file(file_name)
Lexes a file using the encapsulated environment.
Instance methods inherited from class CLTK::Lexer
env
env,
start_state
start_state
Class methods inherited from class CLTK::Lexer
lex(string, file_name = nil, env = @@env.new(@@start_state))
lex,
lex_file(file_name, env = @@env.new(@start_state))
lex_file,
match_first
match_first,
rule(pattern, state = :default, flags = [] of String)
rule,
start(state)
start,
start_state
start_state
Instance methods inherited from class Object
in?(collection : Array | Set)
in?
Constructor Detail
Instance Method Detail
def lex(string, file_name = nil)
#
Lexes a string using the encapsulated environment.
@param [String] string String to be lexed. @param [String] file_name File name used for Token positions.
@return [Array
def lex_file(file_name)
#
Lexes a file using the encapsulated environment.
@param [String] file_name File to be lexed.
@return [Array