class

Pegasus::Language::LanguageData

Inherits JSON::Serializable / Reference / Object

The complete data class, built to be all the information needed to construct a parser generator.

Constructors

new(pull : JSON::PullParser)
Source
new(language_definition)

Creates a new language data object.

Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

items

The items in the language. Used for reducing / building up trees once a reduce action is performed.

Source
lex_final_table

The table that maps a state ID to a token ID, used to recognize that a match has occured.

Source
lex_skip_table

Table for tokens that should be skipped.

Source
lex_state_table

The state table for the lexer, which is used for transitions of the Nfa::Nfa during tokenizing.

Source
max_terminal

The highest terminal ID, used for correctly accessing the tables indexed by both terminal and nonterminal IDs.

Source
nonterminals

The nonterminals, and their original names.

Source
parse_action_table

Action table indexed by the state and the lookahead item. Used to determine what the parser should do in each state.

Source
parse_final_table

The table that maps a nonterminal ID to recognize when parsing can stop.

Source
parse_state_table

Transition table for the LALR parser automaton, indexed by terminal and nonterminal IDs.

Source
terminals

The terminals, and their original names / regular expressions.

Source