8#include "antlr/NoViableAltException.hpp"
9#include "antlr/String.hpp"
11#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
15ANTLR_USING_NAMESPACE(std)
17NoViableAltException::NoViableAltException(RefAST t)
18 : RecognitionException(
"NoViableAlt",
"<AST>",-1,-1),
23NoViableAltException::NoViableAltException(
25 const ANTLR_USE_NAMESPACE(std)
string& fileName_
26) : RecognitionException(
"NoViableAlt",fileName_,t->getLine(),t->getColumn()),
27 token(t), node(nullASTptr)
31ANTLR_USE_NAMESPACE(std)
string NoViableAltException::getMessage()
const
35 if( token->getType() == Token::EOF_TYPE )
36 return string(
"unexpected end of file");
37 else if( token->getType() == Token::NULL_TREE_LOOKAHEAD )
38 return string(
"unexpected end of tree");
40 return string(
"unexpected token: ")+token->getText();
45 return "unexpected end of subtree";
47 return string(
"unexpected AST node: ")+node->toString();
50#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE