BVSLE_TOK = 'BVSLE';
BVSGE_TOK = 'BVSGE';
+ // Strings
+
+ STRING_TOK = 'STRING';
+ SCONCAT_TOK = 'SCONCAT';
+
// these are parsed by special NUMBER_OR_RANGEOP rule, below
DECIMAL_LITERAL;
INTEGER_LITERAL;
t = EXPR_MANAGER->mkBitVectorType(k);
}
+ /* string type */
+ | STRING_TOK { t = EXPR_MANAGER->stringType(); }
+
/* basic types */
| BOOLEAN_TOK { t = EXPR_MANAGER->booleanType(); }
| REAL_TOK { t = EXPR_MANAGER->realType(); }
{ f = MK_EXPR(CVC4::kind::BITVECTOR_IS_INTEGER, f); }
*/
+ | stringTerm[f]
+ ;
+
+stringTerm[CVC4::Expr& f]
+@init {
+ Expr f2;
+ std::string s;
+ std::vector<Expr> args;
+}
+ /* String prefix operators */
+ : SCONCAT_TOK LPAREN formula[f] { args.push_back(f); }
+ ( COMMA formula[f2] { args.push_back(f2); } )+ RPAREN
+ { f = MK_EXPR(CVC4::kind::STRING_CONCAT, args); }
+
+ /* string literal */
+ | str[s]
+ { f = MK_CONST(CVC4::String(s)); }
+
| simpleTerm[f]
;