generated headers
[m6w6/ext-psi] / idl / main.c
index fe49647bf49b398229c3f48c3ac0aa19bd2ce2f8..c4664be36b45d426523d69d9487a0bfb0f0520ea 100644 (file)
@@ -1,8 +1,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include "lexer.h"
-#include "parser.h"
+
+#include "main.h"
 
 static int TRACE;
 
@@ -32,6 +32,7 @@ static void loop(PSI_Lexer *L, void *P)
 int main(int argc, char *argv[])
 {
        PSI_Lexer L;
+       PSI_Validator V;
        void *P = PSI_ParserAlloc(malloc);
 
        TRACE = !!getenv("TRACE");
@@ -44,7 +45,18 @@ int main(int argc, char *argv[])
        loop(&L, P);
 
        PSI_ParserFree(P, free);
+
+       if (!PSI_ValidatorInit(&V, &L)) {
+               perror("Failed to init validator");
+               return 2;
+       }
+
        PSI_LexerDtor(&L);
 
+       if (PSI_ValidatorValidate(&V)) {
+               printf("Whoa! VALID.\n");
+       }
+       PSI_ValidatorDtor(&V);
+
        return 0;
 }