class CLTK::Lexers::EBNF

Overview

The EBNF lexer is used by the CLTK::CFG class.

Defined in:

cltk/lexers/ebnf.cr

Constructors

Instance Method Summary

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

def self.new #

The EBNF lexer is used by the CLTK::CFG class.


[View source]

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]


[View source]
def lex_file(file_name) #

Lexes a file using the encapsulated environment.

@param [String] file_name File to be lexed.

@return [Array]


[View source]