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

Get rid from CompoundName in SimpleReference #6

Open
someilay opened this issue Jun 16, 2022 · 0 comments
Open

Get rid from CompoundName in SimpleReference #6

someilay opened this issue Jun 16, 2022 · 0 comments

Comments

@someilay
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant