fork download
  1. %{
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. %}
  5.  
  6. %%option noyywrap
  7. [a-zA-Z_][a-zA-Z_0-9]* {cout<<"Valid Identifier!! "<<endl;}
  8. [ \t\n\r]+ {}
  9. . {cout<<"Invalid Identifier!! "<<endl;}
  10. %%
  11. int main()
  12. {
  13. cout<<"Enter: ";
  14. string s;
  15. getline(cin,s);
  16. stringstream ss(s);
  17. yyin = ss.rdbuf();
  18. return 0;
  19. }
Success #stdin #stdout #stderr 0.02s 6916KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/tlfFGJ/prog:2:1: Syntax error: Operator expected
ERROR: /home/tlfFGJ/prog:19:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit