-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add hashed labels to expression rule in JavaParser #4310
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
(compilationUnit (importDeclaration import (qualifiedName (identifier java) . (identifier util) . (identifier regex) . (identifier Pattern) . (identifier CharPredicate)) ;) (typeDeclaration (classOrInterfaceModifier public) (classDeclaration class (identifier ExpressionOrder) (classBody { (classBodyDeclaration (modifier (classOrInterfaceModifier public)) (modifier (classOrInterfaceModifier static)) (memberDeclaration (methodDeclaration (typeTypeOrVoid void) (identifier main) (formalParameters ( (formalParameterList (formalParameter (typeType (classOrInterfaceType (typeIdentifier String)) [ ]) (variableDeclaratorId (identifier args)))) )) (methodBody (block { (blockStatement (localVariableDeclaration (typeType (classOrInterfaceType (typeIdentifier Charpredicate))) (variableDeclarators (variableDeclarator (variableDeclaratorId (identifier a)) = (variableInitializer (expression (methodCall (identifier func) (arguments ( (expressionList (expression (primary (literal "a"))) , (expression (primary (literal true)))) )))))))) ;) }))))) (classBodyDeclaration (modifier (classOrInterfaceModifier public)) (modifier (classOrInterfaceModifier static)) (memberDeclaration (methodDeclaration (typeTypeOrVoid (typeType (classOrInterfaceType (typeIdentifier CharPredicate)))) (identifier func) (formalParameters ( (formalParameterList (formalParameter (typeType (classOrInterfaceType (typeIdentifier String))) (variableDeclaratorId (identifier name))) , (formalParameter (typeType (primitiveType boolean)) (variableDeclaratorId (identifier caseIns)))) )) (methodBody (block { (blockStatement (statement return (expression (expression (primary (identifier caseIns))) ? (expression (lambdaExpression (lambdaParameters (identifier c)) -> (lambdaBody (expression (expression (expression (expression (primary (identifier Character))) . (methodCall (identifier isUpperCase) (arguments ( (expressionList (expression (primary (identifier c)))) )))) || (expression (expression (primary (identifier Character))) . (methodCall (identifier isLowerCase) (arguments ( (expressionList (expression (primary (identifier c)))) ))))) || (expression (expression (primary (identifier Character))) . (methodCall (identifier isTitleCase) (arguments ( (expressionList (expression (primary (identifier c)))) )))))))) : (expression (expression (primary (identifier Character))) :: (identifier isUpperCase))) ;)) (blockStatement (statement ;)) }))))) (classBodyDeclaration (memberDeclaration (methodDeclaration (typeTypeOrVoid void) (identifier forEachRemaining) (formalParameters ( (formalParameterList (formalParameter (typeType (classOrInterfaceType (typeIdentifier Consumer) (typeArguments < (typeArgument ? super (typeType (classOrInterfaceType (typeIdentifier Double)))) >))) (variableDeclaratorId (identifier action)))) )) (methodBody (block { (blockStatement (statement (expression (methodCall (identifier forEachRemaining) (arguments ( (expressionList (expression ( (typeType (classOrInterfaceType (typeIdentifier DoubleConsumer))) ) (expression (expression (primary (identifier action))) :: (identifier accept)))) )))) ;)) }))))) })))) | ||
(compilationUnit (importDeclaration import (qualifiedName (identifier java) . (identifier util) . (identifier regex) . (identifier Pattern) . (identifier CharPredicate)) ;) (typeDeclaration (classOrInterfaceModifier public) (classDeclaration class (identifier ExpressionOrder) (classBody { (classBodyDeclaration (modifier (classOrInterfaceModifier public)) (modifier (classOrInterfaceModifier static)) (memberDeclaration (methodDeclaration (typeTypeOrVoid void) (identifier main) (formalParameters ( (formalParameterList (formalParameter (typeType (classOrInterfaceType (typeIdentifier String)) [ ]) (variableDeclaratorId (identifier args)))) )) (methodBody (block { (blockStatement (localVariableDeclaration (typeType (classOrInterfaceType (typeIdentifier Charpredicate))) (variableDeclarators (variableDeclarator (variableDeclaratorId (identifier a)) = (variableInitializer (expression (methodCall (identifier func) (arguments ( (expressionList (expression (primary (literal "a"))) , (expression (primary (literal true)))) )))))))) ;) }))))) (classBodyDeclaration (modifier (classOrInterfaceModifier public)) (modifier (classOrInterfaceModifier static)) (memberDeclaration (methodDeclaration (typeTypeOrVoid (typeType (classOrInterfaceType (typeIdentifier CharPredicate)))) (identifier func) (formalParameters ( (formalParameterList (formalParameter (typeType (classOrInterfaceType (typeIdentifier String))) (variableDeclaratorId (identifier name))) , (formalParameter (typeType (primitiveType boolean)) (variableDeclaratorId (identifier caseIns)))) )) (methodBody (block { (blockStatement (statement return (expression (expression (primary (identifier caseIns))) ? (expression (lambdaExpression (lambdaParameters (identifier c)) -> (lambdaBody (expression (expression (expression (expression (primary (identifier Character))) . (methodCall (identifier isUpperCase) (arguments ( (expressionList (expression (primary (identifier c)))) )))) || (expression (expression (primary (identifier Character))) . (methodCall (identifier isLowerCase) (arguments ( (expressionList (expression (primary (identifier c)))) ))))) || (expression (expression (primary (identifier Character))) . (methodCall (identifier isTitleCase) (arguments ( (expressionList (expression (primary (identifier c)))) )))))))) : (expression (expression (primary (identifier Character))) :: (identifier isUpperCase))) ;)) (blockStatement (statement ;)) }))))) (classBodyDeclaration (memberDeclaration (methodDeclaration (typeTypeOrVoid void) (identifier forEachRemaining) (formalParameters ( (formalParameterList (formalParameter (typeType (classOrInterfaceType (typeIdentifier Consumer) (typeArguments < (typeArgument ? super (typeType (classOrInterfaceType (typeIdentifier Double)))) >))) (variableDeclaratorId (identifier action)))) )) (methodBody (block { (blockStatement (statement (expression (methodCall (identifier forEachRemaining) (arguments ( (expressionList (expression ( (typeType (classOrInterfaceType (typeIdentifier DoubleConsumer))) ) (expression (expression (primary (identifier action))) :: (identifier accept)))) )))) ;)) }))))) }))) <EOF>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
(compilationUnit (importDeclaration import (qualifiedName (identifier java) . (identifier util) . (identifier ArrayList)) ;) (typeDeclaration (classOrInterfaceModifier public) (classDeclaration class (identifier GenericConstructor) (classBody { (classBodyDeclaration (modifier (classOrInterfaceModifier public)) (modifier (classOrInterfaceModifier static)) (memberDeclaration (methodDeclaration (typeTypeOrVoid void) (identifier main) (formalParameters ( (formalParameterList (formalParameter (typeType (classOrInterfaceType (typeIdentifier String)) [ ]) (variableDeclaratorId (identifier args)))) )) (methodBody (block { (blockStatement (localVariableDeclaration (typeType (classOrInterfaceType (typeIdentifier ArrayList) (typeArguments < (typeArgument (typeType (classOrInterfaceType (typeIdentifier Integer)))) >))) (variableDeclarators (variableDeclarator (variableDeclaratorId (identifier myList)) = (variableInitializer (expression new (creator (createdName (identifier ArrayList) (typeArgumentsOrDiamond < >)) (classCreatorRest (arguments ( ))))))))) ;) }))))) })))) | ||
(compilationUnit (importDeclaration import (qualifiedName (identifier java) . (identifier util) . (identifier ArrayList)) ;) (typeDeclaration (classOrInterfaceModifier public) (classDeclaration class (identifier GenericConstructor) (classBody { (classBodyDeclaration (modifier (classOrInterfaceModifier public)) (modifier (classOrInterfaceModifier static)) (memberDeclaration (methodDeclaration (typeTypeOrVoid void) (identifier main) (formalParameters ( (formalParameterList (formalParameter (typeType (classOrInterfaceType (typeIdentifier String)) [ ]) (variableDeclaratorId (identifier args)))) )) (methodBody (block { (blockStatement (localVariableDeclaration (typeType (classOrInterfaceType (typeIdentifier ArrayList) (typeArguments < (typeArgument (typeType (classOrInterfaceType (typeIdentifier Integer)))) >))) (variableDeclarators (variableDeclarator (variableDeclaratorId (identifier myList)) = (variableInitializer (expression new (creator (createdName (identifier ArrayList) (typeArgumentsOrDiamond < >)) (classCreatorRest (arguments ( ))))))))) ;) }))))) }))) <EOF>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
(compilationUnit (importDeclaration import (qualifiedName (identifier java) . (identifier util) . (identifier ArrayList)) ;) (typeDeclaration (classOrInterfaceModifier public) (classDeclaration class (identifier LocalVariableDeclaration) (classBody { (classBodyDeclaration (modifier (classOrInterfaceModifier public)) (modifier (classOrInterfaceModifier static)) (memberDeclaration (methodDeclaration (typeTypeOrVoid void) (identifier main) (formalParameters ( (formalParameterList (formalParameter (typeType (classOrInterfaceType (typeIdentifier String)) [ ]) (variableDeclaratorId (identifier args)))) )) (methodBody (block { (blockStatement (localVariableDeclaration (typeType (classOrInterfaceType (typeIdentifier ArrayList) (typeArguments < (typeArgument (typeType (classOrInterfaceType (typeIdentifier Integer)))) >))) (variableDeclarators (variableDeclarator (variableDeclaratorId (identifier myList)) = (variableInitializer (expression new (creator (createdName (identifier ArrayList) (typeArgumentsOrDiamond (typeArguments < (typeArgument (typeType (classOrInterfaceType (typeIdentifier Integer)))) >))) (classCreatorRest (arguments ( ))))))))) ;) (blockStatement (statement (expression (expression (primary (identifier myList))) . (methodCall (identifier add) (arguments ( (expressionList (expression (primary (literal (integerLiteral 2))))) )))) ;)) (blockStatement (localVariableDeclaration var (identifier myVal) = (expression (expression (primary (identifier myList))) . (methodCall (identifier get) (arguments ( (expressionList (expression (primary (literal (integerLiteral 0))))) ))))) ;) }))))) })))) | ||
(compilationUnit (importDeclaration import (qualifiedName (identifier java) . (identifier util) . (identifier ArrayList)) ;) (typeDeclaration (classOrInterfaceModifier public) (classDeclaration class (identifier LocalVariableDeclaration) (classBody { (classBodyDeclaration (modifier (classOrInterfaceModifier public)) (modifier (classOrInterfaceModifier static)) (memberDeclaration (methodDeclaration (typeTypeOrVoid void) (identifier main) (formalParameters ( (formalParameterList (formalParameter (typeType (classOrInterfaceType (typeIdentifier String)) [ ]) (variableDeclaratorId (identifier args)))) )) (methodBody (block { (blockStatement (localVariableDeclaration (typeType (classOrInterfaceType (typeIdentifier ArrayList) (typeArguments < (typeArgument (typeType (classOrInterfaceType (typeIdentifier Integer)))) >))) (variableDeclarators (variableDeclarator (variableDeclaratorId (identifier myList)) = (variableInitializer (expression new (creator (createdName (identifier ArrayList) (typeArgumentsOrDiamond (typeArguments < (typeArgument (typeType (classOrInterfaceType (typeIdentifier Integer)))) >))) (classCreatorRest (arguments ( ))))))))) ;) (blockStatement (statement (expression (expression (primary (identifier myList))) . (methodCall (identifier add) (arguments ( (expressionList (expression (primary (literal (integerLiteral 2))))) )))) ;)) (blockStatement (localVariableDeclaration var (identifier myVal) = (expression (expression (primary (identifier myList))) . (methodCall (identifier get) (arguments ( (expressionList (expression (primary (literal (integerLiteral 0))))) ))))) ;) }))))) }))) <EOF>) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Malformed start rules, where EOF is not on all alts, and more generally, an ATN that does not exit with EOF, will need to be detected. kaby76/g4-scripts#5