diff --git a/runtime/Cpp/CMakeLists.txt b/runtime/Cpp/CMakeLists.txt index d54367bba..65e704516 100644 --- a/runtime/Cpp/CMakeLists.txt +++ b/runtime/Cpp/CMakeLists.txt @@ -28,6 +28,10 @@ if(CMAKE_VERSION VERSION_EQUAL "3.0.0" OR CMAKE_POLICY(SET CMP0026 OLD) CMAKE_POLICY(SET CMP0045 OLD) CMAKE_POLICY(SET CMP0042 OLD) +endif() + +if(CMAKE_VERSION VERSION_EQUAL "3.3.0" OR + CMAKE_VERSION VERSION_GREATER "3.3.0") CMAKE_POLICY(SET CMP0059 OLD) endif() diff --git a/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp b/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp index 18c698169..23f1a8d24 100755 --- a/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp +++ b/runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp @@ -510,7 +510,7 @@ std::unique_ptr ParserATNSimulator::computeReachSet(ATNConfigSet * } } - if (t == Token::EOF) { + if (t == IntStream::EOF) { /* After consuming EOF no additional input is possible, so we are * only interested in configurations which reached the end of the * decision rule (local context) or end of the start rule (full @@ -528,7 +528,7 @@ std::unique_ptr ParserATNSimulator::computeReachSet(ATNConfigSet * * already guaranteed to meet this condition whether or not it's * required. */ - ATNConfigSet * temp = removeAllConfigsNotInRuleStopState(reach.get(), reach == intermediate); + ATNConfigSet *temp = removeAllConfigsNotInRuleStopState(reach.get(), *reach == *intermediate); if (temp != reach.get()) reach.reset(temp); // We got a new set, so use that. } @@ -954,7 +954,7 @@ bool ParserATNSimulator::canDropLoopEntryEdgeInLeftRecursiveRule(ATNConfig *conf // left-recursion elimination. For efficiency, also check if // the context has an empty stack case. If so, it would mean // global FOLLOW so we can't perform optimization - if ( p->getStateType() != ATNState::STAR_LOOP_ENTRY || + if (p->getStateType() != ATNState::STAR_LOOP_ENTRY || !((StarLoopEntryState *)p)->isPrecedenceDecision || // Are we the special loop entry/exit state? config->context->isEmpty() || // If SLL wildcard config->context->hasEmptyPath())