class Pegasus::Language::LanguageData

Overview

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

Included Modules

Defined in:

pegasus/json.cr
pegasus/language_def.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(language_definition) #

Creates a new language data object.


[View source]

Instance Method Detail

def items : Array(Pegasus::Pda::Item) #

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


[View source]
def lex_final_table : Array(Int64) #

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


[View source]
def lex_skip_table : Array(Bool) #

Table for tokens that should be skipped.


[View source]
def lex_state_table : Array(Array(Int64)) #

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


[View source]
def max_terminal : Int64 #

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


[View source]
def nonterminals : Hash(String, Pegasus::Elements::NonterminalId) #

The nonterminals, and their original names.


[View source]
def parse_action_table : Array(Array(Int64)) #

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


[View source]
def parse_final_table : Array(Bool) #

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


[View source]
def parse_state_table : Array(Array(Int64)) #

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


[View source]
def terminals : Hash(String, Pegasus::Elements::TerminalId) #

The terminals, and their original names / regular expressions.


[View source]