summaryrefslogtreecommitdiff
path: root/obcl/lex.l
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-05-24 07:29:40 +0000
committerDana Jansens <danakj@orodu.net>2003-05-24 07:29:40 +0000
commitd61b48a2ef2c315818a322ae84385228f4438dd3 (patch)
tree3821969a827f1e323500993036e427f361e308ae /obcl/lex.l
parentb1fe0dbbc2ef4472ac8893d9b3b20e9cb149af6d (diff)
remove obcl. shrimpx may work on this in the future but we are not usnig it now.
Diffstat (limited to 'obcl/lex.l')
-rw-r--r--obcl/lex.l86
1 files changed, 0 insertions, 86 deletions
diff --git a/obcl/lex.l b/obcl/lex.l
deleted file mode 100644
index 33a3c61a..00000000
--- a/obcl/lex.l
+++ /dev/null
@@ -1,86 +0,0 @@
-%{
-#include "obcl.h"
-#include "parse.h"
-%}
-
-%option yylineno
-
-DGT [0-9]
-ID [a-zA-Z_][a-zA-Z_\.\-0-9]*
-
-
- /* string bummy */
-%x str
-%%
-
- char str_buf[1024];
- char *str_buf_ptr;
- int str_char;
-
- /* begin a string */
-[\"\'] {
- str_buf_ptr = str_buf;
- str_char = yytext[0];
- BEGIN(str);
- }
-
- /* end a string */
-<str>[\"\'] {
- if (yytext[0] == str_char) {
- BEGIN(INITIAL);
- *str_buf_ptr = '\0';
- yylval.string = g_strdup(str_buf);
- return TOK_STRING;
- } else {
- *str_buf_ptr++ = yytext[0];
- }
- }
-
- /* can't have newlines in strings */
-<str>\n {
- printf("Error: Unterminated string constant.\n");
- BEGIN(INITIAL);
- }
-
- /* handle \" and \' */
-<str>"\\"[\"\'] {
- if (yytext[1] == str_char)
- *str_buf_ptr++ = yytext[1];
- else {
- *str_buf_ptr++ = yytext[0];
- *str_buf_ptr++ = yytext[1];
- }
- }
-
- /* eat valid string contents */
-<str>[^\\\n\'\"]+ {
- char *yptr = yytext;
- while (*yptr) {
- *str_buf_ptr++ = *yptr++;
- }
- }
-
- /* numberz */
-{DGT}+ {
- yylval.num = atof(yytext);
- return TOK_NUM;
- }
-
- /* real numbers */
-{DGT}+"."{DGT}* {
- yylval.num = atof(yytext);
- return TOK_NUM;
- }
-
- /* identifiers -- names without spaces and other crap in them */
-{ID} {
- yylval.string = g_strdup(yytext);
- return TOK_ID;
- }
-
- /* skip comments */
-"#".*\n ;
- /* skip other whitespace */
-[ \n\t]+ ;
-. { return yytext[0]; }
-%%