aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LuaSL_lexer.l24
1 files changed, 12 insertions, 12 deletions
diff --git a/LuaSL/src/LuaSL_lexer.l b/LuaSL/src/LuaSL_lexer.l
index 333489a..c805659 100644
--- a/LuaSL/src/LuaSL_lexer.l
+++ b/LuaSL/src/LuaSL_lexer.l
@@ -21,10 +21,10 @@ INTEGER ({DECIMAL}+)|(0[xX]{HEX}+)
21EXPONANT [eE][+-]?{DECIMAL}+ 21EXPONANT [eE][+-]?{DECIMAL}+
22 /* Floats can be "0." or".0", but "." is not valid. At least in OpenSim. A single dot should be caught by the LSL_Dot rule first anyway.*/ 22 /* Floats can be "0." or".0", but "." is not valid. At least in OpenSim. A single dot should be caught by the LSL_Dot rule first anyway.*/
23FLOAT {DECIMAL}*"."{DECIMAL}*{EXPONANT}?[fF]? 23FLOAT {DECIMAL}*"."{DECIMAL}*{EXPONANT}?[fF]?
24IDENTIFIER [[:alpha:]](_|[[:alpha:]]|[[:digit:]])*
24CHAR '(\\.|[^\\'\n])+' 25CHAR '(\\.|[^\\'\n])+'
25KEY \"{HEX}{8}-{HEX}{4}-{HEX}{4}-{HEX}{4}-{HEX}{12}\" 26KEY \"{HEX}{8}-{HEX}{4}-{HEX}{4}-{HEX}{4}-{HEX}{12}\"
26STRING \"(\\.|[^\\"\n])*\" 27STRING \"(\\.|[^\\"\n])*\"
27IDENTIFIER [[:alpha:]](_|[[:alpha:]]|[[:digit:]])*
28 28
29%% 29%%
30 30
@@ -72,11 +72,11 @@ IDENTIFIER [[:alpha:]](_|[[:alpha:]]|[[:digit:]])*
72"++" { return common(yylval, yytext, yyextra, TRUE, LSL_INCREMENT_PRE); } 72"++" { return common(yylval, yytext, yyextra, TRUE, LSL_INCREMENT_PRE); }
73"," { return common(yylval, yytext, yyextra, TRUE, LSL_COMMA); } 73"," { return common(yylval, yytext, yyextra, TRUE, LSL_COMMA); }
74 74
75 /* Types. */ 75 /* Other symbols. */
76{INTEGER} %{ yylval->value.integerValue = atoi(yytext); return common(yylval, yytext, yyextra, TRUE, LSL_INTEGER); %} 76"@" %{ return common(yylval, yytext, yyextra, TRUE, LSL_LABEL); %}
77{FLOAT} %{ yylval->value.floatValue = atof(yytext); return common(yylval, yytext, yyextra, TRUE, LSL_FLOAT); %} 77"{" %{ return common(yylval, yytext, yyextra, TRUE, LSL_BLOCK_OPEN); %}
78{KEY} %{ yylval->value.stringValue = strdup(yytext); return common(yylval, yytext, yyextra, TRUE, LSL_KEY); %} 78"}" %{ return common(yylval, yytext, yyextra, TRUE, LSL_BLOCK_CLOSE); %}
79{STRING} %{ yylval->value.stringValue = strdup(yytext); return common(yylval, yytext, yyextra, TRUE, LSL_STRING); %} 79";" %{ return common(yylval, yytext, yyextra, TRUE, LSL_STATEMENT); %}
80 80
81 /* Type keywords. */ 81 /* Type keywords. */
82"float" %{ return common(yylval, yytext, yyextra, TRUE, LSL_TYPE_FLOAT); %} 82"float" %{ return common(yylval, yytext, yyextra, TRUE, LSL_TYPE_FLOAT); %}
@@ -98,13 +98,13 @@ IDENTIFIER [[:alpha:]](_|[[:alpha:]]|[[:digit:]])*
98"state" %{ return common(yylval, yytext, yyextra, TRUE, LSL_STATE_CHANGE); %} 98"state" %{ return common(yylval, yytext, yyextra, TRUE, LSL_STATE_CHANGE); %}
99"while" %{ return common(yylval, yytext, yyextra, TRUE, LSL_WHILE); %} 99"while" %{ return common(yylval, yytext, yyextra, TRUE, LSL_WHILE); %}
100 100
101{IDENTIFIER} %{ /* yylval->value.identifierValue = strdup(yytext); */ common(yylval, yytext, yyextra, TRUE, LSL_IDENTIFIER); %} 101{IDENTIFIER} %{ yylval->value.stringValue = strdup(yytext); return common(yylval, yytext, yyextra, TRUE, LSL_IDENTIFIER); %}
102 102
103 /* Other symbols. */ 103 /* Types. */
104"@" %{ return common(yylval, yytext, yyextra, TRUE, LSL_LABEL); %} 104{INTEGER} %{ yylval->value.integerValue = atoi(yytext); return common(yylval, yytext, yyextra, TRUE, LSL_INTEGER); %}
105"{" %{ return common(yylval, yytext, yyextra, TRUE, LSL_BLOCK_OPEN); %} 105{FLOAT} %{ yylval->value.floatValue = atof(yytext); return common(yylval, yytext, yyextra, TRUE, LSL_FLOAT); %}
106"}" %{ return common(yylval, yytext, yyextra, TRUE, LSL_BLOCK_CLOSE); %} 106{KEY} %{ yylval->value.stringValue = strdup(yytext); return common(yylval, yytext, yyextra, TRUE, LSL_KEY); %}
107";" %{ return common(yylval, yytext, yyextra, TRUE, LSL_STATEMENT); %} 107{STRING} %{ yylval->value.stringValue = strdup(yytext); return common(yylval, yytext, yyextra, TRUE, LSL_STRING); %}
108 108
109<<EOF>> { return common(yylval, yytext, yyextra, TRUE, LSL_SCRIPT); } 109<<EOF>> { return common(yylval, yytext, yyextra, TRUE, LSL_SCRIPT); }
110 110