init with {: System.err.println("Traduction Brainfuck vers Java (compact)"); :} action code {: BFTrad out=new BFTrad(); :} terminal Integer PTR, VAL; terminal PUTCHAR, GETCHAR, LOOP_IN, LOOP_OUT; nonterminal Axiome, ListeInst, Inst; Axiome ::= {: out.open("out.java","pre_out.java"); :} ListeInst {: out.close("post_out.java"); :} ; ListeInst ::= /* vide */ {: :} | ListeInst Inst {: :} ; Inst ::= PTR:n {: out.println("ptr+="+n+";"); :} | VAL:n {: out.println("bande[ptr]+="+n+";"); :} | PUTCHAR {: out.println("System.out.write(bande,ptr,1);"); :} | GETCHAR {: out.println("System.in.read(bande,ptr,1);"); :} | LOOP_IN {: out.println("while(bande[ptr]!=0) {"); out.indent++; :} ListeInst LOOP_OUT {: out.indent--; out.println("}"); :} ;