diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2014-12-15 16:56:56 +0000 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2014-12-15 16:56:56 +0000 |
commit | 02c305343ba1e25864b77c0381f8bc768927e4a7 (patch) | |
tree | 372844320f2abac1579636198d36ec3a6e7d34eb /wlp/commands.l | |
parent | c1098b321415976df7b6fc77117046b3b515885d (diff) | |
parent | f65b8f618ed0b59f0c2c14321bbfa9de8e802169 (diff) | |
download | pygn-02c305343ba1e25864b77c0381f8bc768927e4a7.tar.gz |
Merge branch 'testsuite' into 'master'
Testsuite
Hopefully this makes my pyg fork presentable.
See merge request !1
Diffstat (limited to 'wlp/commands.l')
-rw-r--r-- | wlp/commands.l | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/wlp/commands.l b/wlp/commands.l new file mode 100644 index 0000000..ab954cf --- /dev/null +++ b/wlp/commands.l @@ -0,0 +1,76 @@ +%{ +/* Lex analyzer for bison grammar */ + +#include "commands.tab.h" +/*#define DEBUG*/ +#include "macro.h" +#include <string.h> +%} + +OWNER "<"[a-zA-Z0-9_.+-]+@[a-zA-Z0-9._-]+">" +VAL ['`"][a-zA-Z0-9@_+.<>() -]+['`"] +VAR [a-zA-Z0-9_<>-]+[:]? + +%option noyywrap + +%% + + + + +{OWNER} { + DBG("OWNER %s\n",yytext); + yylval.text=yytext; + return(OWNERID); + } + + +{VAL} { + DBG("VAL %s\n",yytext); + yylval.text=yytext; + return(VALID); + } + +{VAR} { + DBG("VAR %s\n",yytext); + yylval.text=yytext; + return(VARID); + } + + +"{" | +"}" | +"=" { + yylval.text=yytext; + return(*yytext); + } + + +"#"[^\n]* | +"\n" | +[[:space:]] ; /* comments 'til EOL and strip all spaces and \n */ + + +"." { + DBG("NOTSTR %s\n",yytext); + yylval.text=yytext; + return(ERROR); + } + + +%% + +#include "structs.h" + +extern struct wlp_list_t *list; + +int parse(FILE *file) +{ + struct wlp_node_t *tmp; + int count; + yyin=file; + + DBG("go!\n"); + yyparse(); + DBG("EOF found\n"); +} |