BNF Question

BCS ao at pathlink.com
Mon Sep 3 07:52:55 PDT 2007


Reply to Jascha,

> This one isn't actually a problem. But you will find that there are
> more tricky ambiguities. For example:
> 
> void main()
> {
> foo.bar.baz;
> }
> "foo.bar.baz" could be a type,
> "foo.bar" could be a type and ".baz" a property,
> "foo" could be an object, "bar" a member, and "baz" a member of that,
> resulting in 3 different syntax trees:
> BasicType
> IdentifierList
> or
> PrimaryExpression
> BasicType . Identifier
> or
> PostfixExpression
> PostfixExpression . PrimaryExpression
> The differences are only semantical.
> 
>

Oouch!

I think I'll look at handling dot chains as "Identifier . DotChain" and figure 
out what it is at semantic time.




More information about the Digitalmars-d-learn mailing list