class Pegasus::Language::LanguageData
- Pegasus::Language::LanguageData
- Reference
- Object
Overview
The complete data class, built to be all the information needed to construct a parser generator.
Included Modules
- JSON::Serializable
Defined in:
pegasus/json.crpegasus/language_def.cr
Constructors
- .new(pull : JSON::PullParser)
-
.new(language_definition)
Creates a new language data object.
Instance Method Summary
-
#items : Array(Pda::Item)
The items in the language.
-
#lex_final_table : Array(Int64)
The table that maps a state ID to a token ID, used to recognize that a match has occured.
-
#lex_skip_table : Array(Bool)
Table for tokens that should be skipped.
-
#lex_state_table : Array(Array(Int64))
The state table for the lexer, which is used for transitions of the
Nfa::Nfa
during tokenizing. -
#max_terminal : Int64
The highest terminal ID, used for correctly accessing the tables indexed by both terminal and nonterminal IDs.
-
#nonterminals : Hash(String, Elements::NonterminalId)
The nonterminals, and their original names.
-
#parse_action_table : Array(Array(Int64))
Action table indexed by the state and the lookahead item.
-
#parse_final_table : Array(Bool)
The table that maps a nonterminal ID to recognize when parsing can stop.
-
#parse_state_table : Array(Array(Int64))
Transition table for the LALR parser automaton, indexed by terminal and nonterminal IDs.
-
#terminals : Hash(String, Elements::TerminalId)
The terminals, and their original names / regular expressions.
Constructor Detail
Instance Method Detail
The items in the language. Used for reducing / building up trees once a reduce action is performed.
The table that maps a state ID to a token ID, used to recognize that a match has occured.
The state table for the lexer, which is used for transitions
of the Nfa::Nfa
during tokenizing.
The highest terminal ID, used for correctly accessing the tables indexed by both terminal and nonterminal IDs.
The nonterminals, and their original names.
Action table indexed by the state and the lookahead item. Used to determine what the parser should do in each state.
The table that maps a nonterminal ID to recognize when parsing can stop.
Transition table for the LALR parser automaton, indexed by terminal and nonterminal IDs.
The terminals, and their original names / regular expressions.