fork download
  1. %{
  2. #include <stdio.h>
  3. %}
  4.  
  5. %%
  6.  
  7. [ \t\n]+ /* Ignore whitespace */
  8. "//".* /* Ignore single-line comments */
  9. "/*"([^*]|[\r\n]|"*"[^/])*"*/" /* Ignore multi-line comments */
  10.  
  11. . { printf("%s", yytext); } /* Print everything else */
  12.  
  13. %%
  14.  
  15. int main() {
  16. yylex();
  17. return 0;
  18. }
Success #stdin #stdout #stderr 0.02s 6972KB
stdin
int a=10
stdout
Standard output is empty
stderr
ERROR: /home/Ex3hVP/prog:2:1: Syntax error: Operator expected
ERROR: /home/Ex3hVP/prog:18:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit