fe49647bf49b398229c3f48c3ac0aa19bd2ce2f8
9 static void loop(PSI_Lexer
*L
, void *P
)
15 PSI_ParserTrace(stdout
, "> ");
18 while (-1 != (t
= PSI_LexerScan(L
))) {
19 if (!(T
= PSI_TokenAlloc(L
, t
))) {
24 printf("# Token: <%s>(%d)\n", T
->text
, t
);
27 PSI_Parser(P
, t
, T
, L
);
29 PSI_Parser(P
, 0, T
, L
);
32 int main(int argc
, char *argv
[])
35 void *P
= PSI_ParserAlloc(malloc
);
37 TRACE
= !!getenv("TRACE");
39 if (!PSI_LexerInit(&L
, argv
[1])) {
40 perror("Failed to init lexer");
46 PSI_ParserFree(P
, free
);