X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=idl%2Fmain.c;h=b132bbd3813f6e97029103abe845ace2305138f7;hp=c4664be36b45d426523d69d9487a0bfb0f0520ea;hb=69008ba2a7733358974c8985caa2e5bcb1182fe1;hpb=c6d07b29eac45a9dc6f121b6a636ff32bc7609a3 diff --git a/idl/main.c b/idl/main.c index c4664be..b132bbd 100644 --- a/idl/main.c +++ b/idl/main.c @@ -2,8 +2,6 @@ #include #include -#include "main.h" - static int TRACE; static void loop(PSI_Lexer *L, void *P) @@ -32,8 +30,8 @@ static void loop(PSI_Lexer *L, void *P) int main(int argc, char *argv[]) { PSI_Lexer L; + PSI_Parser P; PSI_Validator V; - void *P = PSI_ParserAlloc(malloc); TRACE = !!getenv("TRACE"); @@ -41,8 +39,12 @@ int main(int argc, char *argv[]) perror("Failed to init lexer"); return 1; } + if (!PSI_ParserInit(&P)) { + perror("Failer to init parser"); + return 1; + } - loop(&L, P); + while (PSI_ParserParse(&p, &L)); PSI_ParserFree(P, free);