From 751539f294fca0d039ccb748776c280e20cd9eab Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Sun, 8 Jun 2014 20:10:08 -0400 Subject: [PATCH] Previous "repeat" fix required extra lookahead (leading to assert-fails). Fixed, at the cost of an antlr warning that's safe to ignore for now. --- src/parser/smt2/Smt2.g | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g index 8fa047885..c857f3905 100644 --- a/src/parser/smt2/Smt2.g +++ b/src/parser/smt2/Smt2.g @@ -1206,7 +1206,7 @@ indexedFunctionName[CVC4::Expr& op] ( 'extract' n1=INTEGER_LITERAL n2=INTEGER_LITERAL { op = MK_CONST(BitVectorExtract(AntlrInput::tokenToUnsigned($n1), AntlrInput::tokenToUnsigned($n2))); } - | ('repeat')=>'repeat' n=INTEGER_LITERAL + | 'repeat' n=INTEGER_LITERAL { op = MK_CONST(BitVectorRepeat(AntlrInput::tokenToUnsigned($n))); } | 'zero_extend' n=INTEGER_LITERAL { op = MK_CONST(BitVectorZeroExtend(AntlrInput::tokenToUnsigned($n))); } @@ -1535,13 +1535,17 @@ symbolList[std::vector& names, symbol[std::string& id, CVC4::parser::DeclarationCheck check, CVC4::parser::SymbolType type] - : s=( SIMPLE_SYMBOL | 'repeat' ) - { id = AntlrInput::tokenText($s); + : SIMPLE_SYMBOL + { id = AntlrInput::tokenText($SIMPLE_SYMBOL); if(!PARSER_STATE->isAbstractValue(id)) { // if an abstract value, SmtEngine handles declaration PARSER_STATE->checkDeclaration(id, check, type); } } + | 'repeat' + { id = "repeat"; + PARSER_STATE->checkDeclaration(id, check, type); + } | QUOTED_SYMBOL { id = AntlrInput::tokenText($QUOTED_SYMBOL); /* strip off the quotes */ -- 2.30.2