libsapling  0.8.0
terminal.h
Go to the documentation of this file.
1 #ifndef _LIBSAPLING_TERMINAL_H_
2 #define _LIBSAPLING_TERMINAL_H_
3 
10 typedef struct terminal *terminal_t;
11 
20 terminal_t new_terminal(int id, const char *lexeme);
21 
26 void delete_terminal(terminal_t ref);
27 
32 int terminal__id(terminal_t ref);
33 
38 const char *terminal__lexeme(terminal_t ref);
39 
40 #endif
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.
void delete_terminal(terminal_t ref)
Frees the memory previously allocated on the heap for a terminal with new_terminal.
terminal_t new_terminal(int id, const char *lexeme)
Allocates a new terminal on the heap.