Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/opcodes/cgen-asm.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* CGEN generic assembler support code.
    22
    3    Copyright 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
     3   Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
    44
    55   This file is part of the GNU Binutils and GDB, the GNU debugger.
     
    2121#include "sysdep.h"
    2222#include <stdio.h>
    23 #include <ctype.h>
    2423#include "ansidecl.h"
    2524#include "libiberty.h"
     25#include "safe-ctype.h"
    2626#include "bfd.h"
    2727#include "symcat.h"
    2828#include "opcode/cgen.h"
    2929#include "opintl.h"
     30
     31static CGEN_INSN_LIST *  hash_insn_array      PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, int, int, CGEN_INSN_LIST **, CGEN_INSN_LIST *));
     32static CGEN_INSN_LIST *  hash_insn_list       PARAMS ((CGEN_CPU_DESC, const CGEN_INSN_LIST *, CGEN_INSN_LIST **, CGEN_INSN_LIST *));
     33static void              build_asm_hash_table PARAMS ((CGEN_CPU_DESC));
    3034
    3135/* Set the cgen_parse_operand_fn callback.  */
     
    209213  const char *p,*start;
    210214
     215  if (keyword_table->name_hash_table == NULL)
     216    (void) cgen_keyword_search_init (keyword_table, NULL);
     217
    211218  p = start = *strp;
    212219
    213   /* Allow any first character.
    214      Note that this allows recognizing ",a" for the annul flag in sparc
    215      even though "," is subsequently not a valid keyword char.  */
     220  /* Allow any first character.  This is to make life easier for
     221     the fairly common case of suffixes, eg. 'ld.b.w', where the first
     222     character of the suffix ('.') is special.  */
    216223  if (*p)
    217224    ++p;
    218 
    219   /* Now allow letters, digits, and _.  */
     225 
     226  /* Allow letters, digits, and any special characters.  */
    220227  while (((p - start) < (int) sizeof (buf))
    221          && (isalnum ((unsigned char) *p) || *p == '_'))
     228         && *p
     229         && (ISALNUM (*p)
     230             || *p == '_'
     231             || strchr (keyword_table->nonalpha_chars, *p)))
    222232    ++p;
    223233
    224234  if (p - start >= (int) sizeof (buf))
    225     return _("unrecognized keyword/register name");
    226 
    227   memcpy (buf, start, p - start);
    228   buf[p - start] = 0;
     235    {
     236      /* All non-empty CGEN keywords can fit into BUF.  The only thing
     237         we can match here is the empty keyword.  */
     238      buf[0] = 0;
     239    }
     240  else
     241    {
     242      memcpy (buf, start, p - start);
     243      buf[p - start] = 0;
     244    }
    229245
    230246  ke = cgen_keyword_lookup_name (keyword_table, buf);
Note: See TracChangeset for help on using the changeset viewer.