aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_lexer.l
blob: 478e62c40ac21fa76ed2329808d29620dcbc3e9a (plain)
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
34
35
36
37
38
39
40
%{

#define excludeLexer
#include "LuaSL_LSL_tree.h"

%}

%option reentrant noyywrap never-interactive nounistd
%option bison-bridge

SPACE       [ \r\n\t]*
NUMBER      [0-9]+
NAME        [a-zA-Z][a-zA-Z0-9]*

%%

{SPACE}         { /* Skip blanks. */ }
{NUMBER}        { yylval->integerValue = atoi(yytext); return LSL_INTEGER; }
{NAME}          { /* yylval->nameValue=strdup(yytext); return LSL_NAME; */ }

"*"             { return LSL_MULTIPLY; }
"+"             { return LSL_ADD; }
"("             { return LSL_PARENTHESIS_OPEN; }
")"             { return LSL_PARENTHESIS_CLOSE; }
.               { /* This should return an "unknown character" error */  }

%%

int XXyywrap()
{
#ifdef FLEX_SCANNER
    #ifndef LL_WINDOWS
	// get gcc to stop complaining about lack of use of yyunput
	(void) yyunput;
	(void) input;
    #endif
#endif
	return(1);
}