fork download
  1. %%writefile program.l
  2. %{
  3. #include <stdio.h>
  4. %}
  5.  
  6. %%
  7. [0-9]+{ printf("Number: %s\n", yytext); }
  8. [a-zA-Z]+{ printf("Word: %s\n", yytext); }
  9. .|\n{ /* ignore other characters */ }
  10. %%
  11.  
  12. int main() {
  13. yylex();
  14. return 0;
  15. }
Success #stdin #stdout #stderr 0.02s 6888KB
stdin
void main()
{ int a= 10;
{

gcc lex.yy.c -lfl -o lexer
stdout
Standard output is empty
stderr
ERROR: /home/SH6VfH/prog:15:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? ERROR: Unknown option (h for help)
   Exception: (3) program ? ERROR: Unknown option (h for help)
   Exception: (3) program ? ERROR: Unknown option (h for help)
   Exception: (3) program ? ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit