/** * P2'' * * This is the relational new operator; not just 'new', but new with context, so: "a.new InnerClass(params)". It is grouped with P2, but for some reason has higher precedence * in all java parsers, and so we give it its own little precedence group here. */ Rule dotNewExpressionChaining() { return Sequence( level1ExpressionChaining().label("head"), set(), ZeroOrMore(Sequence( Sequence( Ch('.'), group.basics.optWS(), String("new"), group.basics.testLexBreak(), group.basics.optWS()), group.types.typeArguments().label("constructorTypeArgs"), group.basics.identifier().label("innerClassName"), group.types.typeArguments().label("classTypeArgs"), group.structures.methodArguments().label("methodArguments"), Optional(group.structures.typeBody()).label("classBody"), set(actions.createQualifiedConstructorInvocation(value("constructorTypeArgs"), node("innerClassName"), node("classTypeArgs"), value("methodArguments"), value("classBody"))))), set(actions.createChainOfQualifiedConstructorInvocations(node("head"), nodes("ZeroOrMore/Sequence")))); }
/** * P2'' * * This is the relational new operator; not just 'new', but new with context, so: "a.new InnerClass(params)". It is grouped with P2, but for some reason has higher precedence * in all java parsers, and so we give it its own little precedence group here. */ Rule dotNewExpressionChaining() { return Sequence( level1ExpressionChaining().label("head"), set(), ZeroOrMore(Sequence( Sequence( Ch('.'), group.basics.optWS(), String("new"), group.basics.testLexBreak(), group.basics.optWS()), group.types.typeArguments().label("constructorTypeArgs"), group.basics.identifier().label("innerClassName"), group.types.typeArguments().label("classTypeArgs"), group.structures.methodArguments().label("methodArguments"), Optional(group.structures.typeBody()).label("classBody"), set(actions.createQualifiedConstructorInvocation(value("constructorTypeArgs"), node("innerClassName"), node("classTypeArgs"), value("methodArguments"), value("classBody"))))), set(actions.createChainOfQualifiedConstructorInvocations(node("head"), nodes("ZeroOrMore/Sequence")))); }
/** * P2'' * * This is the relational new operator; not just 'new', but new with context, so: "a.new InnerClass(params)". It is grouped with P2, but for some reason has higher precedence * in all java parsers, and so we give it its own little precedence group here. */ Rule dotNewExpressionChaining() { return Sequence( level1ExpressionChaining().label("head"), set(), ZeroOrMore(Sequence( Sequence( Ch('.'), group.basics.optWS(), String("new"), group.basics.testLexBreak(), group.basics.optWS()), group.types.typeArguments().label("constructorTypeArgs"), group.basics.identifier().label("innerClassName"), group.types.typeArguments().label("classTypeArgs"), group.structures.methodArguments().label("methodArguments"), Optional(group.structures.typeBody()).label("classBody"), set(actions.createQualifiedConstructorInvocation(value("constructorTypeArgs"), node("innerClassName"), node("classTypeArgs"), value("methodArguments"), value("classBody"))))), set(actions.createChainOfQualifiedConstructorInvocations(node("head"), nodes("ZeroOrMore/Sequence")))); }