libsapling  0.8.0
Typedefs | Functions
goto_table.h File Reference

Parser goto table implementation. More...

#include "libsapling/dm/graph.h"
#include "libsapling/cc/parser/grammar.h"

Go to the source code of this file.

Typedefs

typedef struct goto_table * goto_table_t
 

Functions

goto_table_t goto_table__build (grammar_t g, node_t *C)
 Builds the goto table. More...
 
int goto_table__get_state (goto_table_t tbl, grammar_t g, int state, int sym)
 Returns the state to go to after reducing a production. More...
 
goto_table_t new_goto_table (grammar_t g, node_t *C)
 Allocates memory for a goto table on the heap. More...
 
void goto_table__set_state (goto_table_t tbl, grammar_t g, int state, int sym, int go_to_state)
 Sets the state to go to after reducing a production. More...
 

Detailed Description

Parser goto table implementation.

Function Documentation

◆ goto_table__build()

goto_table_t goto_table__build ( grammar_t  g,
node_t *  C 
)

Builds the goto table.

Parameters
gA grammar
CA set of sets of LR(0) item

◆ goto_table__get_state()

int goto_table__get_state ( goto_table_t  tbl,
grammar_t  g,
int  state,
int  sym 
)

Returns the state to go to after reducing a production.

Parameters
tblThe goto table
gThe grammar that was used to build the table
stateThe state
symThe nonterminal symbol

◆ goto_table__set_state()

void goto_table__set_state ( goto_table_t  tbl,
grammar_t  g,
int  state,
int  sym,
int  go_to_state 
)

Sets the state to go to after reducing a production.

Parameters
tblThe goto table
gThe grammar that was used to build the table
stateThe state
symThe nonterminal symbol
Attention
This method was written for testing purposes.

◆ new_goto_table()

goto_table_t new_goto_table ( grammar_t  g,
node_t *  C 
)

Allocates memory for a goto table on the heap.

Parameters
gA grammar
CA set of sets of LR(0) item
Attention
This method was written for testing purposes.