org.antlr.v4.runtime.Parser.setBuildParseTree()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(168)

本文整理了Java中org.antlr.v4.runtime.Parser.setBuildParseTree()方法的一些代码示例,展示了Parser.setBuildParseTree()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parser.setBuildParseTree()方法的具体详情如下:
包路径:org.antlr.v4.runtime.Parser
类名称:Parser
方法名:setBuildParseTree

Parser.setBuildParseTree介绍

[英]Track the ParserRuleContext objects during the parse and hook them up using the ParserRuleContext#children list so that it forms a parse tree. The ParserRuleContext returned from the start rule represents the root of the parse tree.

Note that if we are not building parse trees, rule contexts only point upwards. When a rule exits, it returns the context but that gets garbage collected if nobody holds a reference. It points upwards but nobody points at it.

When we build parse trees, we are adding all of these contexts to ParserRuleContext#children list. Contexts are then not candidates for garbage collection.
[中]

代码示例

代码示例来源:origin: com.github.julianthome/inmemantlr-api

parser.addErrorListener(el);
parser.getInterpreter().setPredictionMode(PredictionMode.LL_EXACT_AMBIG_DETECTION);
parser.setBuildParseTree(true);
parser.setTokenStream(tokens);

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

parser.setBuildParseTree(true);

代码示例来源:origin: uk.co.nichesolutions/antlr4

parser.setBuildParseTree(true);

代码示例来源:origin: io.virtdata/virtdata-lib-realer

parser.setBuildParseTree(true);

代码示例来源:origin: org.antlr/antlr4

parser.setBuildParseTree(true);

代码示例来源:origin: com.tunnelvisionlabs/antlr4

parser.setBuildParseTree(true);

代码示例来源:origin: antlr/codebuff

doc.parser.setBuildParseTree(true);

相关文章