Files
jq/c/lexer.l
T

27 lines
637 B
Plaintext
Raw Normal View History

2012-08-16 01:00:30 +01:00
%{
#include "compile.h"
#include "parser.tab.h" /* Generated by bison. */
%}
%option noyywrap nounput noinput nodefault
%option reentrant
%option bison-bridge bison-locations
%%
"==" { return EQ; }
"as" { return AS; }
2012-08-21 18:14:13 +01:00
"def" { return DEF; }
2012-08-27 10:11:55 +01:00
"|=" { return SETPIPE; }
2012-08-16 01:00:30 +01:00
"."|"="|";"|"["|"]"|","|":"|"("|")"|"{"|"}"|"|"|"+"|"\$" { return yytext[0];}
[[:digit:]]+ { yylval->literal = jv_number((double)atoi(yytext)); return LITERAL;}
[[:alnum:]]+ { yylval->literal = jv_string(yytext); return IDENT;}
2012-08-16 01:00:30 +01:00
[ \n\t]+ {}
%%
/* perhaps these should be calls... */
/*
"true" { return TRUE; }
"false" { return FALSE; }
"null" { return NULL; }
*/