Commit fd6e25ff authored by Jaime Arias's avatar Jaime Arias
Browse files

Add lexer file

parent 25aa1f98
%{
/************* INCLUDES AND EXTERNALS *************************************/
#include <stdio.h>
#include <string.h>
#include "RdPMonteur.tab.h"
%}
%%
"(" { return('('); }
")" { return(')'); }
"{" { return('{'); }
"}" { return('}'); }
":" { return(':'); }
";" { return(';'); }
"<."[ ]*".>" { return(TOKEN);}
"<." { return('['); }
".>" { return(']'); }
"<" { return(INHIBITOR); }
"#trans" { return(TRANS);}
"#place" { return(PLACE);}
"#queue" { return(QUEUE);}
"#endtr" { return(ENDTR);}
"reset" { return(RESET);}
"loss" { return(LOSS);}
mk/[ ]*"(" { return(MK);}
cp/[ ]*"(" { return(CP);}
^in { return(IN);}
^out { return(OUT);}
[0-9]+ { sscanf(yytext,"%d",&yylval.i); return(ENTIER);}
[a-zA-Z_][a-zA-Z0-9_]* { yylval.s=strdup(yytext); return(VARIABLE);}
[ \t\n] {}
%%
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment