Kiwi Script
KiwiScript Interpreter
|
Lexical analyzer for Kiwi Assember. More...
Go to the source code of this file.
Data Structures | |
struct | KSParserState |
Resource to parse the program. More... | |
Macros | |
#define | YYSTYPE struct KEToken |
#define | YY_EXTRA_TYPE struct KSParserState * |
#define | YY_DECL int ks_lex(YYSTYPE * yylval_param, ks_scan_t yyscanner, struct KSParserState * pstate) |
#define | YYLEX_PARAM scanner, pstate |
Typedefs | |
typedef void * | ks_scan_t |
Functions | |
int | ks_lex (YYSTYPE *lval, ks_scan_t yyscanner, struct KSParserState *pstate) |
Main lex function to get next token. More... | |
int | ks_lex_init (ks_scan_t *scanner) |
Initialize the scanner DB for lex. More... | |
YY_EXTRA_TYPE | ks_get_extra (ks_scan_t scanner) |
Get user defined information from the scanner. More... | |
void | ks_set_extra (YY_EXTRA_TYPE user_defined, ks_scan_t scanner) |
Set user defined information to the scanner. More... | |
int | ks_lex_destroy (ks_scan_t scanner) |
Release the context of lex scanner. More... | |
void | ks_error (struct KSParserState *pstate, ks_scan_t scanner, const char *msg) |
Output parser error. More... | |
Lexical analyzer for Kiwi Assember.
#define YY_DECL int ks_lex(YYSTYPE * yylval_param, ks_scan_t yyscanner, struct KSParserState * pstate) |
Declaration of ks_lex (yylex) function
#define YY_EXTRA_TYPE struct KSParserState * |
Additional parameter in the parser
#define YYLEX_PARAM scanner, pstate |
Definition of parameters of ks_lex (yylex) function
#define YYSTYPE struct KEToken |
Define type of token
typedef void* ks_scan_t |
Type of scanner
void ks_error | ( | struct KSParserState * | pstate, |
ks_scan_t | scanner, | ||
const char * | msg | ||
) |
Output parser error.
pstate | Parser resource |
scanner | Lex scanner |
msg | Parser error message |
YY_EXTRA_TYPE ks_get_extra | ( | ks_scan_t | scanner | ) |
Get user defined information from the scanner.
scanner | Source scanner |
int ks_lex | ( | YYSTYPE * | lval, |
ks_scan_t | yyscanner, | ||
struct KSParserState * | pstate | ||
) |
Main lex function to get next token.
lval | Next token |
yyscanner | Scanner lex info |
pstate | Scanner resource |
int ks_lex_destroy | ( | ks_scan_t | scanner | ) |
Release the context of lex scanner.
scanner | Destination scanner |
int ks_lex_init | ( | ks_scan_t * | scanner | ) |
Initialize the scanner DB for lex.
scanner | Destination scanner |
void ks_set_extra | ( | YY_EXTRA_TYPE | user_defined, |
ks_scan_t | scanner | ||
) |
Set user defined information to the scanner.
user_defined | Source user defined info |
scanner | Destination scanner |