Kiwi Script
KiwiScript Interpreter
 All Data Structures Files Functions Variables Typedefs Enumerations Macros
KSLex.h
Go to the documentation of this file.
1 
8 #ifndef KSLEX_H
9 #define KSLEX_H
10 
11 #include <KiwiEngine/KiwiEngine.h>
12 #include "KSForwarders.h"
13 
17 struct KSParserState {
19  struct CNResource * resource ;
21  struct KEFile * inputFile ;
23  struct KEReservedWordTable * reservedWordTable ;
25  struct KEFrame * parsedFrame ;
26 } ;
27 
29 #define YYSTYPE struct KEToken
30 
32 typedef void * ks_scan_t ;
33 
35 #define YY_EXTRA_TYPE struct KSParserState *
36 
37 #define YY_DECL int ks_lex(YYSTYPE * yylval_param, ks_scan_t yyscanner, struct KSParserState * pstate)
38 
39 #define YYLEX_PARAM scanner, pstate
40 
48 int
49 ks_lex(YYSTYPE * lval, ks_scan_t yyscanner, struct KSParserState * pstate) ;
50 
51 /* These functions are defined in the lex file */
52 
58 int
59 ks_lex_init(ks_scan_t * scanner) ;
60 
67 ks_get_extra (ks_scan_t scanner) ;
68 
74 void
75 ks_set_extra (YY_EXTRA_TYPE user_defined , ks_scan_t scanner);
76 
82 int
83 ks_lex_destroy (ks_scan_t scanner );
84 
91 void
92 ks_error(struct KSParserState * pstate, ks_scan_t scanner, const char * msg) ;
93 
94 #endif /* KSLEX_H */
struct KEFile * inputFile
Definition: KSLex.h:21
int ks_lex(YYSTYPE *lval, ks_scan_t yyscanner, struct KSParserState *pstate)
Main lex function to get next token.
#define YYSTYPE
Definition: KSLex.h:29
void * ks_scan_t
Definition: KSLex.h:32
#define YY_EXTRA_TYPE
Definition: KSLex.h:35
int ks_lex_destroy(ks_scan_t scanner)
Release the context of lex scanner.
struct CNResource * resource
Definition: KSLex.h:19
struct KEReservedWordTable * reservedWordTable
Definition: KSLex.h:23
void ks_set_extra(YY_EXTRA_TYPE user_defined, ks_scan_t scanner)
Set user defined information to the scanner.
void ks_error(struct KSParserState *pstate, ks_scan_t scanner, const char *msg)
Output parser error.
YY_EXTRA_TYPE ks_get_extra(ks_scan_t scanner)
Get user defined information from the scanner.
Forward declarations for the KiwiScript.
Resource to parse the program.
Definition: KSLex.h:17
struct KEFrame * parsedFrame
Definition: KSLex.h:25
int ks_lex_init(ks_scan_t *scanner)
Initialize the scanner DB for lex.