qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Cleber Rosa" <crosa@redhat.com>
Subject: [PATCH] decodetree: Allow 'dot' in opcode names
Date: Tue, 12 Jan 2021 19:41:56 +0100	[thread overview]
Message-ID: <20210112184156.2014305-1-f4bug@amsat.org> (raw)

Some ISA use a dot in their opcodes. Allow the decodetree
script to process them. The dot is replaced by an underscore
in the generated code.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 scripts/decodetree.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/decodetree.py b/scripts/decodetree.py
index 47aa9caf6d1..b7572589e64 100644
--- a/scripts/decodetree.py
+++ b/scripts/decodetree.py
@@ -49,7 +49,7 @@
 re_arg_ident = '&[a-zA-Z0-9_]*'
 re_fld_ident = '%[a-zA-Z0-9_]*'
 re_fmt_ident = '@[a-zA-Z0-9_]*'
-re_pat_ident = '[a-zA-Z0-9_]*'
+re_pat_ident = '[a-zA-Z0-9_.]*'
 
 def error_with_file(file, lineno, *args):
     """Print an error message from file:line and args and exit."""
@@ -1082,6 +1082,7 @@ def parse_file(f, parent_pat):
         elif re.fullmatch(re_fmt_ident, name):
             parse_generic(start_lineno, None, name[1:], toks)
         elif re.fullmatch(re_pat_ident, name):
+            name = name.replace('.', '_')
             parse_generic(start_lineno, parent_pat, name, toks)
         else:
             error(lineno, 'invalid token "{0}"'.format(name))
-- 
2.26.2



             reply	other threads:[~2021-01-12 19:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 18:41 Philippe Mathieu-Daudé [this message]
2021-01-12 20:44 ` [PATCH] decodetree: Allow 'dot' in opcode names Richard Henderson
2021-01-12 22:15   ` Philippe Mathieu-Daudé
2021-01-12 22:28     ` Eduardo Habkost
2021-01-12 22:46       ` Philippe Mathieu-Daudé
2021-01-12 21:05 ` Eduardo Habkost
2021-01-12 22:19   ` Philippe Mathieu-Daudé
2021-01-12 22:30     ` Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210112184156.2014305-1-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).