withParseTreeNode

fun <T : Node> T.withParseTreeNode(parseTree: ParserRuleContext?, source: Source? = null): T

Set the origin of the AST node as a ParseTreeOrigin, providing the parseTree is not null. If the parseTree is null, no operation is performed.