Disambiguate an expression.
(dimb-expr expr table) → (mv erp new-expr new-table)
If an expression is an identifier, we look it up in the table to see whether it should be re-classified as an enumeration constant.
A constant or string literal is left unchanged; there is nothing to disambiguate. If the constant is an enumeration constant, we could check that the identifier is in the table and has the kind of enumeration constant. However, the parser never generates enumeration constants, so there is no need to do that.
We recursively disambiguate sub-expressions, and other sub-entities (e.g. generic associations, type names), following the recursive structure of the types.
We call a separate function to disambiguate
an ambiguous
An ambiguous cast or call is described in detail in expr:
refer to that documentation to understand how it is disambiguated here;
recall that it has the form
The other kinds of ambiguous cast or binary expressions
are described in detail in expr:
refer to that documentation to understand how it is disambiguated here;
recall that is has the form
For cast and binary expressions, after disambiguating their sub-constructs, we use dimb-make/adjust-expr-cast and dimb-make/adjust-expr-binary for the reasons explained in the documentation of those functions. These two kinds of expressions are the only ones needing this treatment, because the only change in priorities that may be caused by disambiguation is for cast and binary expressions.