From 1c21929692bf5b6c063c3faaba9da90d04b2e332 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 5 Jun 2009 10:09:13 +0000 Subject: Support the extended query command syntax. - There are two optional lists following the constraints and the query expression. The first is a list of expressions to give values for and the second is a list of arrays to provide values for. - Update ExprPPrinter to accept extra arguments to print these arguments. - Add Parser support. - Add more ArrayDecl support. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@72938 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/expr/Parser.h | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'include/expr') diff --git a/include/expr/Parser.h b/include/expr/Parser.h index 08ec66aa..5caf0027 100644 --- a/include/expr/Parser.h +++ b/include/expr/Parser.h @@ -70,8 +70,8 @@ namespace expr { /// ArrayDecl - Array declarations. /// /// For example: - /// array obj : 32 -> 8 = symbolic - /// array obj[32] : 32 -> 8 = { ... } + /// array obj[] : w32 -> w8 = symbolic + /// array obj[32] : w32 -> w8 = { ... } class ArrayDecl : public Decl { public: /// Name - The name of this array. @@ -86,20 +86,25 @@ namespace expr { /// Range - The width of array contents. const unsigned Range; - + + /// Root - The root array object defined by this decl. + const Array *Root; + /// Contents - The initial contents of the array. The array is /// symbolic if no contents are specified. The contained /// expressions are guaranteed to be constants. const std::vector Contents; public: - template ArrayDecl(const Identifier *_Name, unsigned _Size, unsigned _Domain, unsigned _Range, - InputIterator ContentsBegin=InputIterator(), - InputIterator ContentsEnd=InputIterator()) - : Name(_Name), Size(_Size), Domain(_Domain), Range(_Range), - Contents(ContentsBegin, ContentsEnd) {} + const Array *_Root) + : Decl(ArrayDeclKind), Name(_Name), + Size(_Size), Domain(_Domain), Range(_Range), + Root(_Root) { + } + + virtual void dump(); static bool classof(const Decl *D) { return D->getKind() == Decl::ArrayDeclKind; @@ -182,16 +187,19 @@ namespace expr { /// Objects - Symbolic arrays whose initial contents should be /// given if the query is invalid. - const std::vector Objects; + const std::vector Objects; public: - template - QueryCommand(InputIterator ConstraintsBegin, - InputIterator ConstraintsEnd, - ExprHandle _Query) + QueryCommand(const std::vector &_Constraints, + ExprHandle _Query, + const std::vector &_Values, + const std::vector &_Objects + ) : CommandDecl(QueryCommandDeclKind), - Constraints(ConstraintsBegin, ConstraintsEnd), - Query(_Query) {} + Constraints(_Constraints), + Query(_Query), + Values(_Values), + Objects(_Objects) {} virtual void dump(); -- cgit 1.4.1