Skip to content
This repository was archived by the owner on Nov 17, 2022. It is now read-only.
This repository was archived by the owner on Nov 17, 2022. It is now read-only.

Get rid from CompoundName in SimpleReference #6

Description

@someilay

I suggest to remove CompoundName from SimpleReference and replace it by String:

...
// Structure
public CompoundName compoundName; --> public String name;
...

It is more convenient because any compound name can be decomposited to SimpleReference and FieldAccess. Moreover, it helps to avoid ambiguity of parsing.

Example:

a.b.c()

Now we can build AST for this code in two ways:

  1. MethodInvocation[qualifier = SimpleReference[compoundName="a.b"], name = "c"]
  2. MethodInvocation[qualifier = FieldAccess[identifier = "b", expression = SimpleReference[compoundName="a"]], name="c"]

Second way it is more natural and close to grammatics. Also it seems to be more general.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions