hey,currently i am working on lex and yacc and i m posting a piece of code and the problem with this code is that the code is executing in the bottom up direction and therefore dis is not working properly
behaviour_seq : BEHAVIOUR_SEQ sequence
;
end : END NEWLINE {printf("ENDexecuted");}
;
opcode: LD1 NEWLINE opcode {printf("exec1");}
|LD2 NEWLINE opcode {printf("exec2");
|LD4 NEWLINE opcode { printf("exec4");}
|LD8 NEWLINE opcode {printf("exec8");
|LD16 NEWLINE opcode {printf("exec16");
|LD32 NEWLINE opcode {printf("exec32");
|LD64 NEWLINE opcode {printf("exec64");
|LD128 NEWLINE opcode {printf("exec128");}
|
;
eom: EOM NEWLINE sequence {printf("EOMexecuted");}
;
sequence: opcode
|eom
|end
;
and the file for this code is
$BEHAVIOUR_SEQ LD16
EOM
END
n this the code is executing as end and then eom and then the opcode...can anybody help me in executing it the right way
behaviour_seq : BEHAVIOUR_SEQ sequence
;
end : END NEWLINE {printf("ENDexecuted");}
;
opcode: LD1 NEWLINE opcode {printf("exec1");}
|LD2 NEWLINE opcode {printf("exec2");
|LD4 NEWLINE opcode { printf("exec4");}
|LD8 NEWLINE opcode {printf("exec8");
|LD16 NEWLINE opcode {printf("exec16");
|LD32 NEWLINE opcode {printf("exec32");
|LD64 NEWLINE opcode {printf("exec64");
|LD128 NEWLINE opcode {printf("exec128");}
|
;
eom: EOM NEWLINE sequence {printf("EOMexecuted");}
;
sequence: opcode
|eom
|end
;
and the file for this code is
$BEHAVIOUR_SEQ LD16
EOM
END
n this the code is executing as end and then eom and then the opcode...can anybody help me in executing it the right way
