fork download
  1. %option noyywrap
  2. %{
  3. #include<stdio.h>
  4. %}
  5. digit [0-9]
  6. letter [A-Za-z]
  7.  
  8. %%
  9. {digit}+ printf("%s is INTEGER\n", yytext);
  10. {digit}+\.{digit}+ printf("%s is REAL\n", yytext);
  11. {letter}({letter}|{digit})* printf("%s is WORD\n", yytext);
  12. %%
  13.  
  14. int main()
  15. {
  16. yylex();
  17. return 0;
  18. }
  19.  
Success #stdin #stdout #stderr 0.03s 6848KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/ME0mIh/prog:18:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit