Files
jq/c/lexer.l
T

27 lines
581 B
Plaintext

%{
#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; }
"def" { return DEF; }
"."|"="|";"|"["|"]"|","|":"|"("|")"|"{"|"}"|"|"|"+"|"\$" { return yytext[0];}
[[:digit:]]+ { yylval->num = atoi(yytext); return NUMBER;}
[[:alnum:]]+ { yylval->str = strdup(yytext); return IDENT;}
[ \n\t]+ {}
%%
/* perhaps these should be calls... */
/*
"true" { return TRUE; }
"false" { return FALSE; }
"null" { return NULL; }
*/