Parser action table implementation.
More...
Go to the source code of this file.
|
typedef struct action_table * | action_table_t |
|
|
enum | { PARSER_ACTION_ERROR
, PARSER_ACTION_SHIFT
, PARSER_ACTION_REDUCE
, PARSER_ACTION_ACCEPT
} |
|
|
action_table_t | action_table__build (grammar_t g, node_t *C) |
| Builds the action table. More...
|
|
int | action_table__get_action (action_table_t tbl, grammar_t g, int state, int sym) |
| Returns the parser action to perform on a particular state and terminal. More...
|
|
int | action_table__get_action_info (action_table_t tbl, grammar_t g, int state, int sym) |
| Returns the parser action information on a particular state and terminal. More...
|
|
action_table_t | new_action_table (grammar_t g, node_t *C) |
| Allocates memory for an action table on the heap. More...
|
|
void | action_table__set_action (action_table_t tbl, grammar_t g, int state, int sym, int action) |
| Sets the parser action to perform on a particular state and terminal. More...
|
|
void | action_table__set_action_info (action_table_t tbl, grammar_t g, int state, int sym, int action_info) |
| Sets the parser action information on a particular state and terminal. More...
|
|
Parser action table implementation.
◆ action_table__build()
action_table_t action_table__build |
( |
grammar_t |
g, |
|
|
node_t * |
C |
|
) |
| |
Builds the action table.
- Parameters
-
g | A grammar |
C | A set of sets of LR(0) item |
◆ action_table__get_action()
int action_table__get_action |
( |
action_table_t |
tbl, |
|
|
grammar_t |
g, |
|
|
int |
state, |
|
|
int |
sym |
|
) |
| |
Returns the parser action to perform on a particular state and terminal.
- Parameters
-
tbl | The action table |
g | The grammar that was used to build the table |
state | The state |
sym | The terminal symbol |
◆ action_table__get_action_info()
int action_table__get_action_info |
( |
action_table_t |
tbl, |
|
|
grammar_t |
g, |
|
|
int |
state, |
|
|
int |
sym |
|
) |
| |
Returns the parser action information on a particular state and terminal.
- Parameters
-
tbl | The action table |
g | The grammar that was used to build the table |
state | The state |
sym | The terminal symbol |
◆ action_table__set_action()
void action_table__set_action |
( |
action_table_t |
tbl, |
|
|
grammar_t |
g, |
|
|
int |
state, |
|
|
int |
sym, |
|
|
int |
action |
|
) |
| |
Sets the parser action to perform on a particular state and terminal.
- Parameters
-
tbl | The action table |
g | The grammar |
state | The state |
sym | The terminal symbol |
action | The action |
- Attention
- This method was written for testing purposes.
◆ action_table__set_action_info()
void action_table__set_action_info |
( |
action_table_t |
tbl, |
|
|
grammar_t |
g, |
|
|
int |
state, |
|
|
int |
sym, |
|
|
int |
action_info |
|
) |
| |
Sets the parser action information on a particular state and terminal.
- Parameters
-
tbl | The action table |
g | The grammar |
state | The state |
sym | The terminal symbol |
action_info | The action information |
- Attention
- This method was written for testing purposes.
◆ new_action_table()
action_table_t new_action_table |
( |
grammar_t |
g, |
|
|
node_t * |
C |
|
) |
| |
Allocates memory for an action table on the heap.
- Parameters
-
g | A grammar |
C | A set of sets of LR(0) item |
- Attention
- This method was written for testing purposes.