Reject native extended ASCII characters. It requires user to use escaped sequence...
authorTianyi Liang <tianyi-liang@uiowa.edu>
Tue, 13 May 2014 20:22:38 +0000 (15:22 -0500)
committerTianyi Liang <tianyi-liang@uiowa.edu>
Tue, 13 May 2014 20:22:38 +0000 (15:22 -0500)
src/parser/smt2/Smt2.g

index 8dcebc5ee0b568d5020e2252d538815fc048baf1..b3761dfbd0a6bc78c3ba6eee02b72592e272c3cb 100644 (file)
@@ -1263,6 +1263,11 @@ str[std::string& s, bool fsmtlib]
     { s = AntlrInput::tokenText($STRING_LITERAL);
       /* strip off the quotes */
       s = s.substr(1, s.size() - 2);
+         for(size_t i=0; i<s.size(); i++) {
+               if((unsigned)s[i] > 127) {
+                       PARSER_STATE->parseError("Extended characters are not part of SMT-LIB, and they must be encoded as esacped sequences");
+               }
+         }
       if(fsmtlib) {
         /* handle SMT-LIB standard escapes '\\' and '\"' */
         char* p_orig = strdup(s.c_str());