main: /^\s*\Z/ | input_line | EOL: /\s*\Z/ input_line: opcode_8031 | # # The opcode code list. Reverse these two to fix, or RET/RETI ordering to break. # opcode_8031: opcode_ret EOL | opcode_reti EOL opcode_ret: OP_RET { print "Got ret!\n" } opcode_reti: OP_RETI { print "Got reti!\n" } # # 8031 opcodes # OP_RET: 'ret' OP_RETI: 'reti'