Package org.apache.groovy.parser.antlr4
Class SemanticPredicates
java.lang.Object
org.apache.groovy.parser.antlr4.SemanticPredicates
public class SemanticPredicates
extends java.lang.Object
Some semantic predicates for altering the behaviour of the lexer and parser
- 
Constructor SummaryConstructors Constructor Description SemanticPredicates()
- 
Method SummaryModifier and Type Method Description static booleanisFollowedBy(org.antlr.v4.runtime.CharStream cs, char... chars)static booleanisFollowedByJavaLetterInGString(org.antlr.v4.runtime.CharStream cs)static booleanisFollowedByWhiteSpaces(org.antlr.v4.runtime.CharStream cs)static booleanisFollowingArgumentsOrClosure(GroovyParser.ExpressionContext context)Check whether following a method name of command expression.static booleanisInvalidLocalVariableDeclaration(org.antlr.v4.runtime.TokenStream ts)Distinguish between local variable declaration and method call, e.g.static booleanisInvalidMethodDeclaration(org.antlr.v4.runtime.TokenStream ts)Distinguish between method declaration and method call/constructor declarationMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- 
Constructor Details- 
SemanticPredicatespublic SemanticPredicates()
 
- 
- 
Method Details- 
isFollowedByWhiteSpacespublic static boolean isFollowedByWhiteSpaces(org.antlr.v4.runtime.CharStream cs)
- 
isFollowedBypublic static boolean isFollowedBy(org.antlr.v4.runtime.CharStream cs, char... chars)
- 
isFollowedByJavaLetterInGStringpublic static boolean isFollowedByJavaLetterInGString(org.antlr.v4.runtime.CharStream cs)
- 
isFollowingArgumentsOrClosureCheck whether following a method name of command expression. Method name should not end with "2: arguments" and "3: closure"- Parameters:
- context- the preceding expression
 
- 
isInvalidMethodDeclarationpublic static boolean isInvalidMethodDeclaration(org.antlr.v4.runtime.TokenStream ts)Distinguish between method declaration and method call/constructor declaration
- 
isInvalidLocalVariableDeclarationpublic static boolean isInvalidLocalVariableDeclaration(org.antlr.v4.runtime.TokenStream ts)Distinguish between local variable declaration and method call, e.g. `a b`
 
-