decodetree: Move semantic propagation into classes
commit08561fc1283568d9892033f98651010a18d8f108
authorRichard Henderson <richard.henderson@linaro.org>
Sun, 17 May 2020 17:14:11 +0000 (17 10:14 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Mon, 8 Jun 2020 17:36:47 +0000 (8 10:36 -0700)
tree67431768a032b0ccf22d2f82728855c4e6bd9866
parentb44b3449a08818f0eb25b93faaf535e9c9a85e50
decodetree: Move semantic propagation into classes

Create ExcMultiPattern to hold an set of non-overlapping patterns.
The body of build_tree, prop_format become member functions on this
class.  Add minimal member functions to Pattern and MultiPattern
to allow recusion through the tree.

Move the bulk of build_incmulti_pattern to prop_masks and prop_width
in MultiPattern, since we will need this for both kinds of containers.
Only perform prop_width for variablewidth.

Remove global patterns variable, and pass down container object into
parse_file from main.

No functional change in all of this.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
scripts/decodetree.py