fork download
  1. Code:
  2. %{
  3. #include <stdio.h>
  4. %}
  5.  
  6. %%
  7.  
  8. [a-zA-Z_][a-zA-Z0-9_]* { printf("Valid Identifier: %s\n", yytext); }
  9. .|\n { /* Ignore all other characters */ }
  10.  
  11. %%
  12.  
  13. int main() {
  14. printf("Enter input (Ctrl+D to end):\n");
  15. yylex();
  16. return 0;
  17. }
  18.  
  19. int yywrap() {
  20. return 1;
  21. }
Success #stdin #stdout #stderr 0.02s 6896KB
stdin
int count=2
stdout
Standard output is empty
stderr
ERROR: /home/luinb2/prog:21:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit