public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* Problem with keyword parsing for gas
@ 2002-12-17 18:03 Nick Kelsey
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Kelsey @ 2002-12-17 18:03 UTC (permalink / raw)
  To: cgen

Hi guys,

A change was made to cgen in mid 2001 that affects keyword parsing....

opcodes/cgen-asm.c (early 2001): cgen_parse_keyword:

  /* Now allow letters, digits, and _.  */
  while (((p - start) < (int) sizeof (buf))
  && (isalnum ((unsigned char) *p) || *p == '_'))
    ++p;

This would correctly treat <keyword>_temp as a non keyword.

The new code reads as follows:

  /* Allow letters, digits, and any special characters.  */
  while (((p - start) < (int) sizeof (buf))
  && *p
  && (ISALNUM (*p) || strchr (keyword_table->nonalpha_chars, *p)))
    ++p;

This does not treat an underscore as a symbol character and gas barfs on a
symbol that starts <keyword>underscore.

Possible solutions that spring to mind... Add an explicit check for
underscore to the while statement, or add an underscore to nonalpha_chars.

Adding an underscore to nonalpha_chars is easy as it is global and
pre-initialized...

CGEN_KEYWORD xxx_cgen_opval_register_names =
{
  & xxx_cgen_opval_register_names_entries[0],
  121,
  0, 0, 0, 0, "_"
};

However this is generated code so there are bigger implications.

I am completly open to suggestions and implications as to the best way to
fix this without breaking other ports.

Thanks

Nick



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-12-18 19:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redirect-4850146@silicondust.com>
2002-12-18 11:42 ` Problem with keyword parsing for gas Nick Kelsey
2002-12-17 18:03 Nick Kelsey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).