Previous "repeat" fix required extra lookahead (leading to assert-fails). Fixed...
authorMorgan Deters <mdeters@cs.nyu.edu>
Mon, 9 Jun 2014 00:10:08 +0000 (20:10 -0400)
committerMorgan Deters <mdeters@cs.nyu.edu>
Mon, 9 Jun 2014 00:10:08 +0000 (20:10 -0400)
src/parser/smt2/Smt2.g

index 8fa047885973ffc805ef989087eee8529c71c6e3..c857f3905d42368ecf8eceb1e1d1d8b24728e2ee 100644 (file)
@@ -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<std::string>& 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 */