Removed a few unnecessary pointer casts.

This commit is contained in:
Mike Lischke 2016-04-06 15:12:47 +02:00
parent d1b59ca5af
commit 3d17066e0c
3 changed files with 5 additions and 5 deletions

View File

@ -61,7 +61,7 @@ std::vector<misc::IntervalSet> LL1Analyzer::getDecisionLookahead(ATNState *s) co
std::set<ATNConfig*> lookBusy;
antlrcpp::BitSet callRuleStack;
_LOOK(s->transition(alt)->target, nullptr, std::dynamic_pointer_cast<PredictionContext>(PredictionContext::EMPTY),
_LOOK(s->transition(alt)->target, nullptr, PredictionContext::EMPTY,
look[alt], lookBusy, callRuleStack, seeThruPreds, false);
// Wipe out lookahead for this alternative if we found nothing

View File

@ -316,7 +316,7 @@ atn::ATNConfigSet *LexerATNSimulator::computeStartState(CharStream *input, ATNSt
ATNConfigSet *configs = new OrderedATNConfigSet();
for (size_t i = 0; i < p->getNumberOfTransitions(); i++) {
ATNState *target = p->transition(i)->target;
LexerATNConfig *c = new LexerATNConfig(target, (int)(i + 1), std::dynamic_pointer_cast<PredictionContext>(initialContext));
LexerATNConfig *c = new LexerATNConfig(target, (int)(i + 1), initialContext);
closure(input, c, configs, false, false);
}
return configs;
@ -342,7 +342,7 @@ bool LexerATNSimulator::closure(CharStream *input, LexerATNConfig *config, ATNCo
configs->add(config);
return true;
} else {
configs->add(new LexerATNConfig(config, config->state, std::dynamic_pointer_cast<PredictionContext>(PredictionContext::EMPTY)));
configs->add(new LexerATNConfig(config, config->state, PredictionContext::EMPTY));
currentAltReachedAcceptState = true;
}
}

View File

@ -882,7 +882,7 @@ atn::ATNConfig *ParserATNSimulator::precedenceTransition(ATNConfig *config, Prec
}
} else {
std::shared_ptr<SemanticContext::AND> newSemCtx = std::make_shared<SemanticContext::AND>(config->semanticContext, predicate);
c = new ATNConfig(config, pt->target, std::dynamic_pointer_cast<SemanticContext>(newSemCtx));
c = new ATNConfig(config, pt->target, newSemCtx);
}
} else {
c = new ATNConfig(config, pt->target);
@ -919,7 +919,7 @@ atn::ATNConfig *ParserATNSimulator::predTransition(ATNConfig *config, PredicateT
}
} else {
std::shared_ptr<SemanticContext::AND> newSemCtx = std::make_shared<SemanticContext::AND>(config->semanticContext, predicate);
c = new ATNConfig(config, pt->target, std::dynamic_pointer_cast<SemanticContext>(newSemCtx));
c = new ATNConfig(config, pt->target, newSemCtx);
}
} else {
c = new ATNConfig(config, pt->target);