Class PositionConfigureUtils
java.lang.Object
org.apache.groovy.parser.antlr4.util.PositionConfigureUtils
Utilities for configuring node positions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends ASTNode>
TconfigureAST
(T astNode, org.antlr.v4.runtime.Token token) static <T extends ASTNode>
TconfigureAST
(T astNode, org.antlr.v4.runtime.tree.TerminalNode terminalNode) static <T extends ASTNode>
TconfigureAST
(T astNode, GroovyParser.GroovyParserRuleContext ctx) Sets location(lineNumber, colNumber, lastLineNumber, lastColumnNumber) for node using standard context information.static <T extends ASTNode>
TconfigureAST
(T astNode, GroovyParser.GroovyParserRuleContext ctx, ASTNode initialStop) static <T extends ASTNode>
TconfigureAST
(T astNode, ASTNode source) static <T extends ASTNode>
TconfigureAST
(T astNode, ASTNode start, ASTNode stop) static <T extends ASTNode>
voidconfigureEndPosition
(T astNode, org.antlr.v4.runtime.Token token) endPosition
(org.antlr.v4.runtime.Token token)
-
Constructor Details
-
PositionConfigureUtils
public PositionConfigureUtils()
-
-
Method Details
-
configureAST
public static <T extends ASTNode> T configureAST(T astNode, GroovyParser.GroovyParserRuleContext ctx) Sets location(lineNumber, colNumber, lastLineNumber, lastColumnNumber) for node using standard context information. Note: this method is implemented to be closed over ASTNode. It returns same node as it received in arguments.- Parameters:
astNode
- Node to be modified.ctx
- Context from which information is obtained.- Returns:
- Modified astNode.
-
endPosition
-
configureAST
public static <T extends ASTNode> T configureAST(T astNode, org.antlr.v4.runtime.tree.TerminalNode terminalNode) -
configureAST
-
configureAST
-
configureAST
public static <T extends ASTNode> T configureAST(T astNode, GroovyParser.GroovyParserRuleContext ctx, ASTNode initialStop) -
configureEndPosition
public static <T extends ASTNode> void configureEndPosition(T astNode, org.antlr.v4.runtime.Token token) -
configureAST
-