main.c 358 B

123456789101112131415161718192021222324
  1. #include <stdio.h>
  2. /* this file should work in both c and c++ */
  3. extern int yyparse();
  4. int yyerror (char const *a)
  5. {
  6. printf("yyerror: (%s)\n", a);
  7. return 1;
  8. }
  9. int main(int argc, char *argv[])
  10. {
  11. int yy;
  12. yy = yyparse();
  13. if (yy != 0)
  14. {
  15. printf("Syntax or parse error %i. Aborting.\n", yy);
  16. return 1;
  17. }
  18. else{
  19. printf("Success.\n");
  20. }
  21. return 0;
  22. }