Improve error in CVC parser in presence of unrecognized command name.
authorMorgan Deters <mdeters@cs.nyu.edu>
Fri, 3 Oct 2014 17:22:45 +0000 (13:22 -0400)
committerMorgan Deters <mdeters@cs.nyu.edu>
Fri, 3 Oct 2014 17:22:45 +0000 (13:22 -0400)
src/parser/cvc/Cvc.g

index 0a440f2990ea92b0a0093a0c3f3e896a9cdcf32e..347759c9aa7910a5bb516d2b3bd5506f762bbff6 100644 (file)
@@ -635,6 +635,13 @@ command returns [CVC4::Command* cmd = NULL]
         cmd = new EmptyCommand();
       }
     }
+  | IDENTIFIER SEMICOLON
+    { std::stringstream ss;
+      ss << "Unrecognized command `"
+         << AntlrInput::tokenText($IDENTIFIER)
+         << "'";
+      PARSER_STATE->parseError(ss.str());
+    }
   ;
 
 typeOrVarLetDecl[CVC4::parser::DeclarationCheck check]