%{
    #include <stdio.h>
    #include <stdlib.h>
    void yyerror(const char *s);
}%

%token DIGIT INVALID

%% 
start   :   DIGIT { printf("Valid input\n"); }
        |   INVALID { printf("Invalid input\n"); }
        ;

%% 

int main() {
    yyparse();
    return 0;
}

void yyerror(const char *s) {
    printf("Syntax Error: %s\n", s);
}