class CLTK::CFG
Defined in:
cltk/cfg.crcltk/cfg/item.cr
cltk/cfg/production.cr
Class Method Summary
Instance Method Summary
-
#add_production(production)
Adds production to the appropriate internal data structures.
- #build_list_production(name : String, list_elements : String | Array(String), separator = "")
- #build_nonempty_list_production(name : String, list_elements : String | Array(String), separator = "")
- #build_optional_production(name : String, opt_symbol : String)
- #callback(&callback : Symbol, Symbol, Production, Array(Int32) -> Nil)
- #clause(expression : Symbol | String)
- #curr_lhs : String?
- #curr_lhs=(curr_lhs : Nil | String)
- #first_set(sentence : String | Array(String)) : Array(String)
- #follow_set(sym0 : String, seen_lh_sides = [] of String) : Array(String)
- #get_list_production(name, list_elements : String | Array(String), separator = "")
- #get_nonempty_list_production(name : String, list_elements : String | Array(String), separator = "")
- #get_optional_production(name : String, list_elements : String | Array(String))
-
#next_id
@return [Integer] ID for the next production to be defined.
- #nonterms
- #production(symbol : Symbol | String, expression : String | Nil = nil, &)
- #production(symbol : Symbol | String, expression : String | Nil = nil)
- #productions_id : Hash(Int32, CLTK::CFG::Production)
- #productions_sym : Hash(String, Array(CLTK::CFG::Production))
- #start_symbol : String
-
#symbols
@return [Array
] All symbols used in the grammar's definition. - #terms
- #with_curr_lhs(symbol, &)
Instance methods inherited from class Object
in?(collection : Array | Set)
in?
Class Method Detail
Instance Method Detail
def add_production(production)
#
Adds production to the appropriate internal data structures.
@param [Production] production The production to add to the grammar.
@return [void]
def build_list_production(name : String, list_elements : String | Array(String), separator = "")
#
def build_nonempty_list_production(name : String, list_elements : String | Array(String), separator = "")
#
def get_list_production(name, list_elements : String | Array(String), separator = "")
#
def get_nonempty_list_production(name : String, list_elements : String | Array(String), separator = "")
#