-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjsiLexer.h
More file actions
34 lines (28 loc) · 917 Bytes
/
Copy pathjsiLexer.h
File metadata and controls
34 lines (28 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef __JSILEXER_H__
#define __JSILEXER_H__
#define YYSTYPE void *
#ifndef JSI_AMALGAMATION
#include "parser.h"
#include "jsiPstate.h"
#endif
/* Lexer, where input seq provided */
typedef struct Lexer {
enum {
LT_NONE,
LT_FILE, /* read from file */
LT_STRING /* read from a string */
} ltype;
union {
Jsi_Channel fp; /* LT_FILE, where to read */
char *str; /* LT_STRING */
} d;
int last_token; /* last token returned */
int ungot, unch[100];
int cur; /* LT_STRING, current char */
int cur_line; /* current line no. */
int cur_char; /* current column no. */
jsi_Pstate *pstate;
} Lexer;
int yylex (YYSTYPE *yylvalp, YYLTYPE *yyllocp, jsi_Pstate *pstate);
void yyerror(YYLTYPE *yylloc, jsi_Pstate *ps, const char *msg);
#endif /* __JSILEXER_H__ */