/* Use lookahead=2 */ Smt2Input::Smt2Input(AntlrInputStream& inputStream, InputLanguage lang) : AntlrInput(inputStream, 2) { pANTLR3_INPUT_STREAM input = inputStream.getAntlr3InputStream(); assert( input != NULL ); d_pSmt2Lexer = Smt2LexerNew(input); if( d_pSmt2Lexer == NULL ) { throw ParserException("Failed to create SMT2 lexer."); } setAntlr3Lexer( d_pSmt2Lexer->pLexer ); pANTLR3_COMMON_TOKEN_STREAM tokenStream = getTokenStream(); assert( tokenStream != NULL ); d_pSmt2Parser = Smt2ParserNew(tokenStream); if( d_pSmt2Parser == NULL ) { throw ParserException("Failed to create SMT2 parser."); } setAntlr3Parser(d_pSmt2Parser->pParser); setLanguage(lang); }
AntlrInput::AntlrInput(AntlrInputStream& inputStream, unsigned int lookahead) : Input(inputStream), d_lookahead(lookahead), d_lexer(NULL), d_parser(NULL), d_antlr3InputStream( inputStream.getAntlr3InputStream() ), d_tokenBuffer(NULL) { }
/* Use lookahead=3 */ CvcInput::CvcInput(AntlrInputStream& inputStream) : AntlrInput(inputStream,6) { pANTLR3_INPUT_STREAM input = inputStream.getAntlr3InputStream(); assert( input != NULL ); d_pCvcLexer = CvcLexerNew(input); if( d_pCvcLexer == NULL ) { throw ParserException("Failed to create CVC lexer."); } setAntlr3Lexer( d_pCvcLexer->pLexer ); pANTLR3_COMMON_TOKEN_STREAM tokenStream = getTokenStream(); assert( tokenStream != NULL ); d_pCvcParser = CvcParserNew(tokenStream); if( d_pCvcParser == NULL ) { throw ParserException("Failed to create CVC parser."); } setAntlr3Parser(d_pCvcParser->pParser); }