#include <string.h>
#include "lexer.h"
#include "parser.h"
+#include "validator.h"
static int TRACE;
int main(int argc, char *argv[])
{
PSI_Lexer L;
+ PSI_Validator V;
void *P = PSI_ParserAlloc(malloc);
TRACE = !!getenv("TRACE");
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;
}