Package org.apache.groovy.parser.antlr4

# Class SemanticPredicates

java.lang.Object
org.apache.groovy.parser.antlr4.SemanticPredicates

public class SemanticPredicates extends Object
Some semantic predicates for altering the behaviour of the lexer and parser

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SemanticPredicates()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static boolean`
  `isFollowedBy(org.antlr.v4.runtime.CharStream cs, char... chars)`
  Check whether the next character is one of the specified characters.
  `static boolean`
  `isFollowedByJavaLetterInGString(org.antlr.v4.runtime.CharStream cs)`
  Check whether the next character is a valid Java identifier part or a left curly brace (for GString expressions).
  `static boolean`
  `isFollowedByWhiteSpaces(org.antlr.v4.runtime.CharStream cs)`
  Check whether the next characters are only white spaces until the end of line or end of file.
  `static boolean`
  `isFollowingArgumentsOrClosure(GroovyParser.ExpressionContext context)`
  Check whether following a method name of command expression.
  `static boolean`
  `isInvalidLocalVariableDeclaration(org.antlr.v4.runtime.TokenStream ts)`
  Distinguish between local variable declaration and method call, e.g.
  `static boolean`
  `isInvalidMethodDeclaration(org.antlr.v4.runtime.TokenStream ts)`
  Distinguish between method declaration and method call/constructor declaration

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### SemanticPredicates

    public SemanticPredicates()

- ## Method Details

  - ### isFollowedByWhiteSpaces

    public static boolean isFollowedByWhiteSpaces(org.antlr.v4.runtime.CharStream cs)
    Check whether the next characters are only white spaces until the end of line or end of file.

  - ### isFollowedBy

    public static boolean isFollowedBy(org.antlr.v4.runtime.CharStream cs, char... chars)
    Check whether the next character is one of the specified characters.

  - ### isFollowedByJavaLetterInGString

    public static boolean isFollowedByJavaLetterInGString(org.antlr.v4.runtime.CharStream cs)
    Check whether the next character is a valid Java identifier part or a left curly brace (for GString expressions).

  - ### isFollowingArgumentsOrClosure

    public static boolean isFollowingArgumentsOrClosure(GroovyParser.ExpressionContext context)
    Check whether following a method name of command expression. Method name should not end with "2: arguments" and "3: closure"
    Parameters:
      `context` - the preceding expression

  - ### isInvalidMethodDeclaration

    public static boolean isInvalidMethodDeclaration(org.antlr.v4.runtime.TokenStream ts)
    Distinguish between method declaration and method call/constructor declaration

  - ### isInvalidLocalVariableDeclaration

    public static boolean isInvalidLocalVariableDeclaration(org.antlr.v4.runtime.TokenStream ts)
    Distinguish between local variable declaration and method call, e.g. `a b`