Re: Mangling: grammar too permissive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mangling: grammar too permissive



> No, it's needed to be able to substitute for Ktype when we've
> already seen VKtype.

Ah, right.

> > 2. extra alternatives in <encoding-type>: In all cases where an
> >    encoding-type can occur, it always identifies a
> >    bare-function-type; it never is a type or a substitution on its
> >    own. Therefore, I propose to remove the encoding-type, and replace
> >    its two occurences with bare-function-type.
> 
> No, <encoding-type> also encodes a <type> in the case of a vtable,
> where <name> is the <special-name> VT, and <type> is the relevant class
> type.  (Though this could probably be fixed by other rearrangements.)

As I said, I'd prefer the other arrangement. As a matter of fact, I
didn't really grasp the idea that the top-level type could be used to
denote the type for the vtable. So even if this approach is used, the
documentation should be better, e.g. in the VT description

  # <encoding-type> is vtable's class type

Also, a forward references could not hurt:

  <encoding-type> ::= <type>                # for vtables
                  ::= <bare-function-type>  # for functions   
                  ::= <substitution>        # In what cases?

The <substitution> case refers to the substitution section, but
that does not talk about <encoding-type>s at all...

Regards,
Martin