From mboxrd@z Thu Jan 1 00:00:00 1970 From: fche@redhat.com (Frank Ch. Eigler) To: cgen@sources.redhat.com Subject: Re: escaping in syntax strings Date: Mon, 26 Mar 2001 08:49:00 -0000 Message-id: References: <20010326081015.D13900@redhat.com> X-SW-Source: 2001-q1/msg00210.html I wrote: : [...] : By the way, why do you need a "$" in the syntax string? Are you : confusing register name keywords or hexadecimal constants with : the markers that actually belong into the syntax strings? I just found what Ben was talking about. It seems that some instructions in the assembly language for his target includes dummy operands that make explicit the implicit (not-encoded) operands. For example, given a register keyword set such as "$0 .. $7", there are some instructions which are hard-wired to use only $0 as an input or output, in addition to other inputs/outputs. Rather than leave the $0 implicit, this assembly language expects the programmer to specify it. Say, compare $0,$2,$3 instead of compare $2,$3 So, Ben is trying to implement this in the assembler by including the literal string "$0" in the syntax bytes of the instruction. This is not too bad, though a possibly better way would be to associate a synthetic cgen operand with that slot, and to give it a parser that accepts only "$0", and emits a helpful error message for anything else. - FChE