This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
Re: escaping in syntax strings
- To: cgen at sources dot redhat dot com
- Subject: Re: escaping in syntax strings
- From: fche at redhat dot com (Frank Ch. Eigler)
- Date: 26 Mar 2001 11:49:08 -0500
- References: <20010326081015.D13900@redhat.com><o5wv9c1ojl.fsf.cygnus.local.cgen@toenail.toronto.redhat.com>
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