fork download
  1. %{ #include <stdio.h> %}
  2. %%
  3. [a-zA-Z_][a-zA-Z0-9_]* { printf("Valid Identifier: %s\n", yytext); }
  4. . { printf("Invalid Identifier: %s\n", yytext); }
  5. \n { return 0; }
  6. %%
  7. int main()
  8. {
  9. printf("Enter an identifier:\n");
  10. yylex();
  11. return 0; }
Success #stdin #stdout #stderr 0.02s 6888KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/JNIabp/prog:3:9: Syntax error: Operator expected
ERROR: /home/JNIabp/prog:11:10: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit