@Override
public ParseInfo getParseInfo() {
ParserATNSimulator interp = getInterpreter();
if (interp instanceof ProfilingATNSimulator) {
return new ParseInfo((ProfilingATNSimulator)interp);
}
return null;
}
java类org.antlr.v4.runtime.atn.ParserATNSimulator的实例源码
Parser.java 文件源码
项目:Scratch-ApuC
阅读 21
收藏 0
点赞 0
评论 0
Parser.java 文件源码
项目:Scratch-ApuC
阅读 21
收藏 0
点赞 0
评论 0
/**
* @since 4.3
*/
public void setProfile(boolean profile) {
ParserATNSimulator interp = getInterpreter();
if ( profile ) {
if (!(interp instanceof ProfilingATNSimulator)) {
setInterpreter(new ProfilingATNSimulator(this));
}
}
else if (interp instanceof ProfilingATNSimulator) {
setInterpreter(new ParserATNSimulator(this, getATN(), interp.decisionToDFA, interp.getSharedContextCache()));
}
}
ParserInterpreter.java 文件源码
项目:Scratch-ApuC
阅读 16
收藏 0
点赞 0
评论 0
public ParserInterpreter(String grammarFileName, Collection<String> tokenNames,
Collection<String> ruleNames, ATN atn, TokenStream input)
{
super(input);
this.grammarFileName = grammarFileName;
this.atn = atn;
this.tokenNames = tokenNames.toArray(new String[tokenNames.size()]);
this.ruleNames = ruleNames.toArray(new String[ruleNames.size()]);
this.decisionToDFA = new DFA[atn.getNumberOfDecisions()];
for (int i = 0; i < decisionToDFA.length; i++) {
decisionToDFA[i] = new DFA(atn.getDecisionState(i), i);
}
// identify the ATN states where pushNewRecursionContext must be called
this.pushRecursionContextStates = new BitSet(atn.states.size());
for (ATNState state : atn.states) {
if (!(state instanceof StarLoopEntryState)) {
continue;
}
if (((StarLoopEntryState)state).precedenceRuleDecision) {
this.pushRecursionContextStates.set(state.stateNumber);
}
}
// get atn simulator that knows how to do predictions
setInterpreter(new ParserATNSimulator(this, atn,
decisionToDFA,
sharedContextCache));
}
CParser.java 文件源码
项目:BEAST
阅读 28
收藏 0
点赞 0
评论 0
public CParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
FWPolicyParser.java 文件源码
项目:oscm-app
阅读 23
收藏 0
点赞 0
评论 0
public FWPolicyParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this, _ATN, _decisionToDFA,
_sharedContextCache);
}
SqlGrammarParser.java 文件源码
项目:coherence-sql
阅读 26
收藏 0
点赞 0
评论 0
public SqlGrammarParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
FWPolicyParser.java 文件源码
项目:oscm
阅读 22
收藏 0
点赞 0
评论 0
public FWPolicyParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this, _ATN, _decisionToDFA,
_sharedContextCache);
}
CypherParser.java 文件源码
项目:cyp2sql
阅读 19
收藏 0
点赞 0
评论 0
public CypherParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
ExpressionEditorParser.java 文件源码
项目:Hydrograph
阅读 22
收藏 0
点赞 0
评论 0
public ExpressionEditorParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
ExprParser.java 文件源码
项目:Expr3
阅读 19
收藏 0
点赞 0
评论 0
public ExprParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
Verilog2001Parser.java 文件源码
项目:netlist-graph
阅读 24
收藏 0
点赞 0
评论 0
public Verilog2001Parser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
ObjCParser.java 文件源码
项目:Objc2Lua
阅读 21
收藏 0
点赞 0
评论 0
public ObjCParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
HelloParser.java 文件源码
项目:KeepTry
阅读 21
收藏 0
点赞 0
评论 0
public HelloParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
AccountingParser.java 文件源码
项目:dsl
阅读 20
收藏 0
点赞 0
评论 0
public AccountingParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
FWPolicyParser.java 文件源码
项目:development
阅读 35
收藏 0
点赞 0
评论 0
public FWPolicyParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this, _ATN, _decisionToDFA,
_sharedContextCache);
}
EditorConfigParser.java 文件源码
项目:netbeans-editorconfig-editor
阅读 19
收藏 0
点赞 0
评论 0
public EditorConfigParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
GroovyLangParser.java 文件源码
项目:groovy
阅读 23
收藏 0
点赞 0
评论 0
public GroovyLangParser(TokenStream input) {
super(input);
this.setInterpreter(new ParserATNSimulator(this, new AtnManager(this).getATN()));
}
SkinnyParser.java 文件源码
项目:SkinnyAssembler
阅读 18
收藏 0
点赞 0
评论 0
public SkinnyParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
tlvParser.java 文件源码
项目:Oscar
阅读 24
收藏 0
点赞 0
评论 0
public tlvParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
ByteRegexParser.java 文件源码
项目:htools
阅读 18
收藏 0
点赞 0
评论 0
public ByteRegexParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
SoqlParser.java 文件源码
项目:components
阅读 21
收藏 0
点赞 0
评论 0
public SoqlParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
removeErrorListeners();
addErrorListener(new SoqlErrorListener());
}
CliParser.java 文件源码
项目:oap
阅读 16
收藏 0
点赞 0
评论 0
public CliParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
QuestionnaireParser.java 文件源码
项目:poly-ql
阅读 20
收藏 0
点赞 0
评论 0
public QuestionnaireParser( TokenStream input )
{
super( input );
_interp = new ParserATNSimulator( this, _ATN, _decisionToDFA, _sharedContextCache );
}
QLParser.java 文件源码
项目:poly-ql
阅读 20
收藏 0
点赞 0
评论 0
public QLParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
GoParserFactory.java 文件源码
项目:goworks
阅读 23
收藏 0
点赞 0
评论 0
protected void configureParser(@NonNull Parser parser, @NonNull ParserConfiguration configuration) {
ParserATNSimulator interpreter = parser.getInterpreter();
// common configuration
interpreter.force_global_context = false;
interpreter.always_try_local_context = true;
interpreter.optimize_tail_calls = true;
parser.setBuildParseTree(true);
parser.removeErrorListeners();
switch (configuration) {
case FASTEST:
interpreter.setPredictionMode(PredictionMode.SLL);
interpreter.tail_call_preserves_sll = false;
interpreter.treat_sllk1_conflict_as_ambiguity = true;
parser.setErrorHandler(new BailErrorStrategy());
break;
case SLL:
throw new UnsupportedOperationException("The tail_call_preserves_sll flag cannot change within a single ATN instance.");
//interpreter.setPredictionMode(PredictionMode.SLL);
//interpreter.tail_call_preserves_sll = true;
//interpreter.treat_sllk1_conflict_as_ambiguity = true;
//parser.setErrorHandler(new BailErrorStrategy<Token>());
//break;
case HYBRID:
interpreter.setPredictionMode(PredictionMode.LL);
interpreter.tail_call_preserves_sll = false;
interpreter.treat_sllk1_conflict_as_ambiguity = true;
parser.setErrorHandler(new BailErrorStrategy());
break;
case HYBRID_SLL:
throw new UnsupportedOperationException("The tail_call_preserves_sll flag cannot change within a single ATN instance.");
//interpreter.setPredictionMode(PredictionMode.LL);
//interpreter.tail_call_preserves_sll = true;
//interpreter.treat_sllk1_conflict_as_ambiguity = true;
//parser.setErrorHandler(new BailErrorStrategy<Token>());
//break;
case PRECISE:
interpreter.setPredictionMode(PredictionMode.LL);
interpreter.tail_call_preserves_sll = false;
interpreter.treat_sllk1_conflict_as_ambiguity = false;
parser.setErrorHandler(new DefaultErrorStrategy());
parser.addErrorListener(DescriptiveErrorListener.INSTANCE);
break;
default:
throw new IllegalArgumentException("Invalid configuration.");
}
}
MemoryModelParser.java 文件源码
项目:org.pshdl
阅读 23
收藏 0
点赞 0
评论 0
public MemoryModelParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
PSHDLLang.java 文件源码
项目:org.pshdl
阅读 22
收藏 0
点赞 0
评论 0
public PSHDLLang(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
CommonParser.java 文件源码
项目:SqlParser
阅读 21
收藏 0
点赞 0
评论 0
public CommonParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
CParser.java 文件源码
项目:WHOAMI
阅读 22
收藏 0
点赞 0
评论 0
public CParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
Java8Parser.java 文件源码
项目:WHOAMI
阅读 19
收藏 0
点赞 0
评论 0
public Java8Parser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}