summaryrefslogtreecommitdiff
path: root/lisp.l
diff options
context:
space:
mode:
Diffstat (limited to 'lisp.l')
-rw-r--r--lisp.l14
1 files changed, 7 insertions, 7 deletions
diff --git a/lisp.l b/lisp.l
index 7a9eece..5ad5c57 100644
--- a/lisp.l
+++ b/lisp.l
@@ -7,14 +7,14 @@ int tcnt = 0;
%}
%%
-[[:space:]]+ { printf("%d: WHITESPACE\n", tcnt); /*ignore whitespace*/}
-"(" { printf("%d: LPAREN\n", ++tcnt); return LPAREN; }
-")" { printf("%d: RPAREN\n", ++tcnt); return RPAREN; }
-"\." { printf("%d: DOT\n", ++tcnt); return DOT; }
+[[:space:]]+ { /*ignore whitespace*/}
+"(" { return LPAREN; }
+")" { return RPAREN; }
+"\." { return DOT; }
[+-]?([0-9]+|([0-9]*\.[0-9]+))([eE][-+]?[0-9]+)? {
yylval.dval = atof(yytext);
- printf("%d: NUMBER: %f\n", ++tcnt, yylval.dval);
+
return NUMBER;
}
@@ -27,13 +27,13 @@ int tcnt = 0;
str[len] = '\0';
yylval.strval = str;
- printf("%d: STRING: \"%s\"\n", ++tcnt, yylval.strval);
+
return STRING;
}
[^[:space:]\"().]+ {
yylval.strval = strdup(yytext);
- printf("%d: SYMBOL: %s\n", ++tcnt, yylval.strval);
+
return SYMBOL;
}
. ; // do nothing