fork download
  1. %{
  2. #include "y.tab.h"
  3. extern intyylval;
  4. %}
  5. [0-7]+{(yylval = atoi("yytext")
  6. return number;}
  7. \n return 0;
  8. %%
  9. %{
  10. #include<stdio.h>
  11. int t,r,n,x;
  12. %}
  13. %tokens number;
  14. %%
  15. state:number{($x=1;
  16. t=1;
  17. r=0;
  18. while(x!=0){
  19. r=x%s;
  20. n=n+r*10;
  21. t=t*10;
  22. n=n/8;
  23. }
  24. printf("%d",n)
  25. }
  26. %%
  27. void yyerror(char*s){
  28. printf("error");
  29. }
  30. int main(void){
  31. return yyparse();
  32. }
  33.  
  34.  
  35.  
Success #stdin #stdout #stderr 0.03s 6876KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: /home/bWtITI/prog:34:0: Syntax error: Unexpected end of file
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit