fork download
  1.  
  2. %{
  3. #include <stdio.h>
  4. %}
  5. %%
  6. BEGIN {
  7. printf("This is executed at the beginning of the Lex program.\n");
  8. }
  9. [0-9]+ printf("Number: %s\n", yytext);
  10. [a-zA-Z]+ printf("Word: %s\n", yytext);
  11. . printf("Other: %s\n", yytext);
  12. %%
  13. int main() {
  14. yylex();
  15. return 0;
  16. }
Success #stdin #stdout #stderr 0.03s 6796KB
stdin
122 hello
stdout
Standard output is empty
stderr
ERROR: /home/9nFa9U/prog:3:1: Syntax error: Operator expected
ERROR: /home/9nFa9U/prog:16:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit