Package: org.apache.groovy.parser.antlr4

## [Java] Class SemanticPredicates

- org.apache.groovy.parser.antlr4.SemanticPredicates

-     public class SemanticPredicates
      extends Object

  Some semantic predicates for altering the behaviour of the lexer and parser

- - ### Methods Summary

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

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public static boolean isFollowedBy(CharStream cs, char chars)

      Check whether the next character is one of the specified characters.

    - #### public static boolean isFollowedByJavaLetterInGString(CharStream cs)

      Check whether the next character is a valid Java identifier part or a left curly brace (for GString expressions).

    - #### public static boolean isFollowedByWhiteSpaces(CharStream cs)

      Check whether the next characters are only white spaces until the end of line or end of file.

    - #### 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

    - #### public static boolean isInvalidLocalVariableDeclaration(TokenStream ts)

      Distinguish between local variable declaration and method call, e.g. `a b`

    - #### public static boolean isInvalidMethodDeclaration(TokenStream ts)

      Distinguish between method declaration and method call/constructor declaration