libsapling
0.8.0
|
Terminal implementation. More...
Go to the source code of this file.
Typedefs | |
typedef struct terminal * | terminal_t |
Functions | |
terminal_t | new_terminal (int id, const char *lexeme) |
Allocates a new terminal on the heap. More... | |
void | delete_terminal (terminal_t ref) |
Frees the memory previously allocated on the heap for a terminal with new_terminal. | |
int | terminal__id (terminal_t ref) |
Returns the terminal's grammar symbol identifier. More... | |
const char * | terminal__lexeme (terminal_t ref) |
Returns the terminal's associated lexeme. More... | |
Terminal implementation.
terminal_t new_terminal | ( | int | id, |
const char * | lexeme | ||
) |
Allocates a new terminal on the heap.
id | The terminal's grammar symbol identifier. |
lexeme | The terminal's associated lexeme. |
int terminal__id | ( | terminal_t | ref | ) |
Returns the terminal's grammar symbol identifier.
const char* terminal__lexeme | ( | terminal_t | ref | ) |
Returns the terminal's associated lexeme.