Skip to content

Instantly share code, notes, and snippets.

@Philhil
Last active March 15, 2017 22:46
Show Gist options
  • Save Philhil/401b69084cea274ce5f9d3dc32ae4d4e to your computer and use it in GitHub Desktop.
Save Philhil/401b69084cea274ce5f9d3dc32ae4d4e to your computer and use it in GitHub Desktop.
%option noyywrap
%{
#include "grammar.tab.h"
%}
INT [0-9]
VARLEX [n-z]{INT}*
FUNCLEX [a-m]{INT}*
PRAEDIKATLEX [A-Z]{INT}*
%%
{VARLEX} {
return VAR;
}
{FUNCLEX} {
return FUNC;
}
{PRAEDIKATLEX} {
return PRAEDIKAT;
}
"->" {
return ARROW;
}
"&" {
return UND;
}
"," {
return KOMMA;
}
true {
return TRUE;
}
false {
return FALSE;
}
"(" {
return KLAMMERO;
}
")" {
return KLAMMERC;
}
\n|\r\n {
return NEWLINE;
}
" " {
/* Skip */
}
. {
printf("Do not know: %s\n", yytext);
}
%%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment