lishunli / projectlombok

Automatically exported from code.google.com/p/projectlombok
0 stars 0 forks source link

Lombok AST: The builtin Lombok parser generates an InvalidInputError for innerclass constructions #415

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a Java file which contains this source:

package foo;
public class X {
  public void X(Y parent) {
    parent.new Z(parent.getW()).v();
  }
}

(this nonsensical source is obviously boiled down from a real world example of 
valid, working code)

2. Attempt to parse this with the builtin Lombok Java parser (new 
lombok.ast.grammar.Source(src).getNodes())

What is the expected output? What do you see instead?

It should succeed (giving me a compilation unit node). Instead I get an empty 
node list and associated ParserProblem objects - with the error message
lombok.ast.libs.org.parboiled.errors.InvalidInputError@246972f1

What version of the product are you using? On what operating system?

Lombok AST 0.2, on OSX 10.6.8.

Please provide any additional information below.

If I modify the source code to call "v" instead of "execute", parsing hangs 
instead of producing an error:

package foo;
public class X {
  public void X(Y parent) {
    parent.new Z(parent.getW()).v();
  }
}

"main" prio=5 tid=103000800 nid=0x100501000 runnable [1004fd000]
   java.lang.Thread.State: RUNNABLE
    at lombok.ast.libs.org.parboiled.RecoveringParseRunner$Handler.match(RecoveringParseRunner.java:219)
    at lombok.ast.libs.org.parboiled.RecordingParseRunner$Handler.match(RecordingParseRunner.java:122)
    at lombok.ast.libs.org.parboiled.MatcherContext.runMatcher(MatcherContext.java:332)
    at lombok.ast.libs.org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)
    at lombok.ast.libs.org.parboiled.RecoveringParseRunner$Handler.match(RecoveringParseRunner.java:230)
    at lombok.ast.libs.org.parboiled.RecordingParseRunner$Handler.match(RecordingParseRunner.java:122)
    at lombok.ast.libs.org.parboiled.MatcherContext.runMatcher(MatcherContext.java:332)
    at lombok.ast.libs.org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)
    at lombok.ast.libs.org.parboiled.RecoveringParseRunner$Handler.match(RecoveringParseRunner.java:230)
    at lombok.ast.libs.org.parboiled.RecordingParseRunner$Handler.match(RecordingParseRunner.java:122)
    at lombok.ast.libs.org.parboiled.MatcherContext.runMatcher(MatcherContext.java:332)
    at lombok.ast.libs.org.parboiled.matchers.ZeroOrMoreMatcher.match(ZeroOrMoreMatcher.java:40)
    at lombok.ast.libs.org.parboiled.RecoveringParseRunner$Handler.match(RecoveringParseRunner.java:230)
(repeating the above 4 lines over and over again)

Original issue reported on code.google.com by tnor...@google.com on 10 Sep 2012 at 7:49