aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-16 05:34:57 +1000
committerDavid Walter Seikel2012-01-16 05:34:57 +1000
commit38d7ca1178a258c32af93a20dc559ad30941cdf3 (patch)
tree635da22a08a35472e7b3168a3276f9c56a0c535c /LuaSL
parentMissed a debug ifdef. (diff)
downloadSledjHamr-38d7ca1178a258c32af93a20dc559ad30941cdf3.zip
SledjHamr-38d7ca1178a258c32af93a20dc559ad30941cdf3.tar.gz
SledjHamr-38d7ca1178a258c32af93a20dc559ad30941cdf3.tar.bz2
SledjHamr-38d7ca1178a258c32af93a20dc559ad30941cdf3.tar.xz
Make sure identifiers get, er, identified.
Diffstat (limited to 'LuaSL')
-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