summaryrefslogtreecommitdiff
path: root/lexer.l
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-07-01 08:06:06 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-07-01 08:06:06 (GMT)
commit27ecd0b1d0bf0114b465beeb4db482f0f1f87c52 (patch)
treefbf5c869321f15b75b6f5c1c2299b5f5fd960e18 /lexer.l
parentb7ca4bfdb38b8caf153f6d93b1d3959f8ffd53ca (diff)
Clifford Wolf:
Another cleanup in expression handling git-svn-id: http://svn.clifford.at/openscad/trunk@43 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'lexer.l')
-rw-r--r--lexer.l27
1 files changed, 8 insertions, 19 deletions
diff --git a/lexer.l b/lexer.l
index dd35aa1..4ec72b7 100644
--- a/lexer.l
+++ b/lexer.l
@@ -55,29 +55,18 @@ extern const char *parser_input_buffer;
"$"?[a-zA-Z0-9_]+ { parserlval.text = strdup(yytext); return TOK_ID; }
\"[^"]*\" { parserlval.text = strdup(yytext); return TOK_STRING; }
-"." return '.';
-"," return ',';
-";" return ';';
-"?" return '?';
-":" return ':';
-"=" return '=';
-"*" return '*';
-"/" return '/';
-"%" return '%';
-"+" return '+';
-"-" return '-';
-"(" return '(';
-")" return ')';
-"{" return '{';
-"}" return '}';
-"[" return '[';
-"]" return ']';
-
[\n\r\t ]
\/\/[^\n]*\n
"/*" BEGIN(comment);
<comment>"*/" BEGIN(INITIAL);
<comment>.|\n
-. { fprintf(stderr, "Unrecognized input character in line %d: %s\n", lexerget_lineno(), yytext); exit(1); }
+"<=" return LE;
+">=" return GE;
+"==" return EQ;
+"!=" return NE;
+"&&" return AND;
+"||" return OR;
+
+. { return yytext[0]; }
contact: Jan Huwald // Impressum