fork download
  1. %{
  2. char name[30];
  3. %}
  4.  
  5. %%
  6. [\n] { printf("Hello %s\n",name); return 1; }
  7. %%
  8.  
  9. void main(){
  10. char ch;
  11. do{
  12. printf("Enter your name: ");
  13. scanf("%s", name);
  14. yylex();
  15. printf("Enter y to continue: ");
  16. scanf("%c",&ch);
  17. }while(ch=='y');
  18. }
  19.  
Success #stdin #stdout #stderr 0.02s 6880KB
stdin
sajid
stdout
Standard output is empty
stderr
ERROR: /home/waRTrt/prog:18:1: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit