6 /* Structure to hold single token. */
9 gchar
* string
; /* Poniter to local copy of token string. */
10 guint start_index
; /* Start index in original stream. */
11 guint end_index
; /* End index in original stream. */
12 LexerTokenType token_type
; /* Type of token. */
15 /* Structure to hold lexer state and all the tokens. */
18 PreLexerState
*prelexer
; /* Pre-lexer state. Pre-lexer is part of lexer. */
19 LexerToken
*tokens
; /* Pointer to the dynamic array of LexerTokens. */
20 guint token_count
; /* Count of tokens in array. */
21 guint next_token
; /* Index of next, to be sent, token. */
22 struct parser_state
*parent
; /* Pointer to the parent parser. */
25 /* Create a new LexerState object and fill the dynamic array with tokens. */
26 LexerState
* l_create_lexer(const gchar
*, struct parser_state
*);
28 /* Destroy LexerState object and free up space. */
29 void l_destroy_lexer(LexerState
*);
31 /* Tokanize complete string. */
32 void l_insert_all_tokens(LexerState
*);
34 /* Return next, to be sent, token. */
35 LexerToken
* l_get_next_token(LexerState
*);
37 /* Roll back one token. */
38 void l_roll_back(LexerState
*);