code: public static <T extends ASTNode> T configureAST(T astNode, GroovyParser.GroovyParserRuleContext ctx) {
          Token start = ctx.getStart();
          Token stop = ctx.getStop();
  
          astNode.setLineNumber(start.getLine());
          astNode.setColumnNumber(start.getCharPositionInLine() + 1);
  
          configureEndPosition(astNode, stop);
  
          return astNode;
      }
docs: 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.
  
  @param astNode Node to be modified.
  @param ctx     Context from which information is obtained.
  @return Modified astNode.