aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LuaSL_LSL_tree.h1
-rw-r--r--LuaSL/src/LuaSL_lexer.l17
2 files changed, 3 insertions, 15 deletions
diff --git a/LuaSL/src/LuaSL_LSL_tree.h b/LuaSL/src/LuaSL_LSL_tree.h
index 4676171..3fc436e 100644
--- a/LuaSL/src/LuaSL_LSL_tree.h
+++ b/LuaSL/src/LuaSL_LSL_tree.h
@@ -87,6 +87,7 @@ struct _LSL_Leaf
87 float vectorValue[3]; 87 float vectorValue[3];
88 float rotationValue[4]; 88 float rotationValue[4];
89 89
90 LSL_Identifier *identifierValue;
90 LSL_Identifier *variableValue; 91 LSL_Identifier *variableValue;
91 92
92 char *labelValue; 93 char *labelValue;
diff --git a/LuaSL/src/LuaSL_lexer.l b/LuaSL/src/LuaSL_lexer.l
index aaba74a..d81eb29 100644
--- a/LuaSL/src/LuaSL_lexer.l
+++ b/LuaSL/src/LuaSL_lexer.l
@@ -4,7 +4,6 @@
4#include "LuaSL_LSL_tree.h" 4#include "LuaSL_LSL_tree.h"
5#include <stdio.h> 5#include <stdio.h>
6 6
7void comment(yyscan_t yyscanner);
8int common(YYSTYPE *lval, char *text, boolean checkIgnorable, int type); 7int common(YYSTYPE *lval, char *text, boolean checkIgnorable, int type);
9 8
10%} 9%}
@@ -93,7 +92,7 @@ IDENTIFIER [[:alpha:]](_|[[:alpha:]]|[[:digit:]])*
93"state" %{ return common(yylval, yytext, TRUE, LSL_STATE_CHANGE); %} 92"state" %{ return common(yylval, yytext, TRUE, LSL_STATE_CHANGE); %}
94"while" %{ return common(yylval, yytext, TRUE, LSL_WHILE); %} 93"while" %{ return common(yylval, yytext, TRUE, LSL_WHILE); %}
95 94
96{IDENTIFIER} %{ /* yylval->value.nameValue = strdup(yytext); */ common(yylval, yytext, TRUE, LSL_IDENTIFIER); %} 95{IDENTIFIER} %{ /* yylval->value.identifierValue = strdup(yytext); */ common(yylval, yytext, TRUE, LSL_IDENTIFIER); %}
97 96
98 /* Other symbols. */ 97 /* Other symbols. */
99"@" %{ return common(yylval, yytext, TRUE, LSL_LABEL); %} 98"@" %{ return common(yylval, yytext, TRUE, LSL_LABEL); %}
@@ -108,19 +107,6 @@ IDENTIFIER [[:alpha:]](_|[[:alpha:]]|[[:digit:]])*
108 107
109%% 108%%
110 109
111void comment(yyscan_t yyscanner)
112{
113 char c, prev = 0;
114
115 while ((c = input(yyscanner)) != 0) /* (EOF maps to 0) */
116 {
117 if (c == '/' && prev == '*')
118 return;
119 prev = c;
120 }
121 yyerror("unterminated comment");
122}
123
124static char *ignorableText = NULL; 110static char *ignorableText = NULL;
125static int column = 0; 111static int column = 0;
126static int line = 0; 112static int line = 0;
@@ -182,6 +168,7 @@ int yywrap(yyscan_t yyscanner)
182 #ifndef LL_WINDOWS 168 #ifndef LL_WINDOWS
183 // Get gcc to stop complaining about lack of use of yyunput and input. 169 // Get gcc to stop complaining about lack of use of yyunput and input.
184 (void) yyunput; 170 (void) yyunput;
171 (void) input;
185 #endif 172 #endif
186#endif 173#endif
187// TODO - If we are getting files from stdin, or multiple -f arguments, we should loop through them and return 0. Return 1 when there are no more files. 174// TODO - If we are getting files from stdin, or multiple -f arguments, we should loop through them and return 0. Return 1 when there are no more files.