<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>CVC3: parser_temp.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.4 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">CVC3 <span id="projectnumber">2.4.1</span></div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <div class="title">parser_temp.h</div> </div> </div> <div class="contents"> <a href="parser__temp_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*****************************************************************************/</span><span class="comment"></span> <a name="l00002"></a>00002 <span class="comment">/*!</span> <a name="l00003"></a>00003 <span class="comment"> * \file parser_temp.h</span> <a name="l00004"></a>00004 <span class="comment"> *</span> <a name="l00005"></a>00005 <span class="comment"> * Author: Sergey Berezin</span> <a name="l00006"></a>00006 <span class="comment"> *</span> <a name="l00007"></a>00007 <span class="comment"> * Created: Wed Feb 5 17:53:02 2003</span> <a name="l00008"></a>00008 <span class="comment"> *</span> <a name="l00009"></a>00009 <span class="comment"> * <hr></span> <a name="l00010"></a>00010 <span class="comment"> *</span> <a name="l00011"></a>00011 <span class="comment"> * License to use, copy, modify, sell and/or distribute this software</span> <a name="l00012"></a>00012 <span class="comment"> * and its documentation for any purpose is hereby granted without</span> <a name="l00013"></a>00013 <span class="comment"> * royalty, subject to the terms and conditions defined in the \ref</span> <a name="l00014"></a>00014 <span class="comment"> * LICENSE file provided with this distribution.</span> <a name="l00015"></a>00015 <span class="comment"> *</span> <a name="l00016"></a>00016 <span class="comment"> * <hr></span> <a name="l00017"></a>00017 <span class="comment"> *</span> <a name="l00018"></a>00018 <span class="comment"> * A class used to communicate with the actual parser. No one else</span> <a name="l00019"></a>00019 <span class="comment"> * should use it.</span> <a name="l00020"></a>00020 <span class="comment"> */</span> <a name="l00021"></a>00021 <span class="comment">/*****************************************************************************/</span> <a name="l00022"></a>00022 <a name="l00023"></a>00023 <span class="preprocessor">#ifndef _cvc3__parser_temp_h_</span> <a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define _cvc3__parser_temp_h_</span> <a name="l00025"></a>00025 <span class="preprocessor"></span> <a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="expr_8h.html" title="Definition of the API to expression package. See class Expr for details.">expr.h</a>"</span> <a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="exception_8h.html">exception.h</a>"</span> <a name="l00028"></a>00028 <a name="l00029"></a>00029 <span class="keyword">namespace </span>CVC3 { <a name="l00030"></a>00030 <a name="l00031"></a>00031 <span class="keyword">class </span>ValidityChecker; <a name="l00032"></a>00032 <span class="keyword">class </span>Translator; <a name="l00033"></a>00033 <a name="l00034"></a><a class="code" href="classCVC3_1_1ParserTemp.html">00034</a> <span class="keyword">class </span><a class="code" href="classCVC3_1_1ParserTemp.html">ParserTemp</a> { <a name="l00035"></a>00035 <span class="keyword">private</span>: <a name="l00036"></a>00036 <span class="comment">// Counter for uniqueID of bound variables</span> <a name="l00037"></a><a class="code" href="classCVC3_1_1ParserTemp.html#affc386fea3fca8495f4fa916465d71e9">00037</a> <span class="keywordtype">int</span> <a class="code" href="classCVC3_1_1ParserTemp.html#affc386fea3fca8495f4fa916465d71e9">d_uid</a>; <a name="l00038"></a>00038 <span class="comment">// The main prompt when running interactive</span> <a name="l00039"></a><a class="code" href="classCVC3_1_1ParserTemp.html#a6f2f69f077ddf2750043886497a7072c">00039</a> std::string <a class="code" href="classCVC3_1_1ParserTemp.html#a6f2f69f077ddf2750043886497a7072c">prompt1</a>; <a name="l00040"></a>00040 <span class="comment">// The interactive prompt in the middle of a multi-line command</span> <a name="l00041"></a><a class="code" href="classCVC3_1_1ParserTemp.html#a556acdd98994e1cbe523b6ce1f032f32">00041</a> std::string <a class="code" href="classCVC3_1_1ParserTemp.html#a556acdd98994e1cbe523b6ce1f032f32">prompt2</a>; <a name="l00042"></a>00042 <span class="comment">// The currently used prompt</span> <a name="l00043"></a><a class="code" href="classCVC3_1_1ParserTemp.html#a501c2cbc9842027cbfcc63ae2e3fa0c6">00043</a> std::string <a class="code" href="classCVC3_1_1ParserTemp.html#a501c2cbc9842027cbfcc63ae2e3fa0c6">prompt</a>; <a name="l00044"></a>00044 <span class="keyword">public</span>: <a name="l00045"></a><a class="code" href="classCVC3_1_1ParserTemp.html#a3fe21c38ed0bc9fa07899519471beae0">00045</a> <a class="code" href="classCVC3_1_1ValidityChecker.html" title="Generic API for a validity checker.">ValidityChecker</a>* <a class="code" href="classCVC3_1_1ParserTemp.html#a3fe21c38ed0bc9fa07899519471beae0">vc</a>; <a name="l00046"></a><a class="code" href="classCVC3_1_1ParserTemp.html#a0f512493d6511600cf6f7617653fe246">00046</a> <a class="code" href="classCVC3_1_1Translator.html">Translator</a>* <a class="code" href="classCVC3_1_1ParserTemp.html#a0f512493d6511600cf6f7617653fe246">translator</a>; <a name="l00047"></a><a class="code" href="classCVC3_1_1ParserTemp.html#a4035b1afd63d5bdc521d62d43a56734d">00047</a> std::istream* <a class="code" href="classCVC3_1_1ParserTemp.html#a4035b1afd63d5bdc521d62d43a56734d">is</a>; <a name="l00048"></a>00048 <span class="comment">// The current input line</span> <a name="l00049"></a><a class="code" href="classCVC3_1_1ParserTemp.html#a700bbc729118e7972f83c8183f7dab06">00049</a> <span class="keywordtype">int</span> <a class="code" href="classCVC3_1_1ParserTemp.html#a700bbc729118e7972f83c8183f7dab06">lineNum</a>; <a name="l00050"></a>00050 <span class="comment">// File name</span> <a name="l00051"></a><a class="code" href="classCVC3_1_1ParserTemp.html#a9cce2ec3b7bf37752154594e67ec37c1">00051</a> std::string <a class="code" href="classCVC3_1_1ParserTemp.html#a9cce2ec3b7bf37752154594e67ec37c1">fileName</a>; <a name="l00052"></a>00052 <span class="comment">// The last parsed Expr</span> <a name="l00053"></a><a class="code" href="classCVC3_1_1ParserTemp.html#ab7736ab68f3946e8c70f979cbd1de038">00053</a> <a class="code" href="classCVC3_1_1Expr.html" title="Data structure of expressions in CVC3.">Expr</a> <a class="code" href="classCVC3_1_1ParserTemp.html#ab7736ab68f3946e8c70f979cbd1de038">expr</a>; <a name="l00054"></a>00054 <span class="comment">// Whether we are done or not</span> <a name="l00055"></a><a class="code" href="classCVC3_1_1ParserTemp.html#a2989dc98533700f0a601bcb4a0231d6d">00055</a> <span class="keywordtype">bool</span> <a class="code" href="classCVC3_1_1ParserTemp.html#a2989dc98533700f0a601bcb4a0231d6d">done</a>; <a name="l00056"></a>00056 <span class="comment">// Whether we are running interactive</span> <a name="l00057"></a><a class="code" href="classCVC3_1_1ParserTemp.html#a74c07d2da5dc7513057edd8e8e38eeaa">00057</a> <span class="keywordtype">bool</span> <a class="code" href="classCVC3_1_1ParserTemp.html#a74c07d2da5dc7513057edd8e8e38eeaa">interactive</a>; <a name="l00058"></a>00058 <span class="comment">// Whether arrays are enabled for smt-lib format</span> <a name="l00059"></a><a class="code" href="classCVC3_1_1ParserTemp.html#aeee6e1586d7baf9423c184ea5a52f00b">00059</a> <span class="keywordtype">bool</span> <a class="code" href="classCVC3_1_1ParserTemp.html#aeee6e1586d7baf9423c184ea5a52f00b">arrFlag</a>; <a name="l00060"></a>00060 <span class="comment">// Whether bit-vectors are enabled for smt-lib format</span> <a name="l00061"></a><a class="code" href="classCVC3_1_1ParserTemp.html#ac93954db196e1e220b78652dd1f2a20d">00061</a> <span class="keywordtype">bool</span> <a class="code" href="classCVC3_1_1ParserTemp.html#ac93954db196e1e220b78652dd1f2a20d">bvFlag</a>; <a name="l00062"></a>00062 <span class="comment">// Size of bit-vectors for smt-lib format</span> <a name="l00063"></a><a class="code" href="classCVC3_1_1ParserTemp.html#add5fa337db252de9240e61f58e439c7a">00063</a> <span class="keywordtype">int</span> <a class="code" href="classCVC3_1_1ParserTemp.html#add5fa337db252de9240e61f58e439c7a">bvSize</a>; <a name="l00064"></a>00064 <span class="comment">// Did we encounter a formula query (smtlib)</span> <a name="l00065"></a><a class="code" href="classCVC3_1_1ParserTemp.html#afca8ccc3760ebfd851ca55d681a86377">00065</a> <span class="keywordtype">bool</span> <a class="code" href="classCVC3_1_1ParserTemp.html#afca8ccc3760ebfd851ca55d681a86377">queryParsed</a>; <a name="l00066"></a>00066 <span class="comment">// Default constructor</span> <a name="l00067"></a><a class="code" href="classCVC3_1_1ParserTemp.html#a9505c869876d3c969f28ae5a74e99d86">00067</a> <a class="code" href="classCVC3_1_1ParserTemp.html#a9505c869876d3c969f28ae5a74e99d86">ParserTemp</a>() : <a class="code" href="classCVC3_1_1ParserTemp.html#affc386fea3fca8495f4fa916465d71e9">d_uid</a>(0), <a class="code" href="classCVC3_1_1ParserTemp.html#a6f2f69f077ddf2750043886497a7072c">prompt1</a>(<span class="stringliteral">"CVC> "</span>), <a class="code" href="classCVC3_1_1ParserTemp.html#a556acdd98994e1cbe523b6ce1f032f32">prompt2</a>(<span class="stringliteral">"- "</span>), <a name="l00068"></a>00068 <a class="code" href="classCVC3_1_1ParserTemp.html#a501c2cbc9842027cbfcc63ae2e3fa0c6">prompt</a>(<span class="stringliteral">"CVC> "</span>), <a class="code" href="classCVC3_1_1ParserTemp.html#a700bbc729118e7972f83c8183f7dab06">lineNum</a>(1), <a class="code" href="classCVC3_1_1ParserTemp.html#a2989dc98533700f0a601bcb4a0231d6d">done</a>(false), <a class="code" href="classCVC3_1_1ParserTemp.html#aeee6e1586d7baf9423c184ea5a52f00b">arrFlag</a>(false), <a class="code" href="classCVC3_1_1ParserTemp.html#afca8ccc3760ebfd851ca55d681a86377">queryParsed</a>(false) { } <a name="l00069"></a>00069 <span class="comment">// Parser error handling (implemented in parser.cpp)</span> <a name="l00070"></a>00070 <span class="keywordtype">int</span> <a class="code" href="classCVC3_1_1ParserTemp.html#a52693980c07ac741d49e39be4c2c38d1">error</a>(<span class="keyword">const</span> std::string& s); <a name="l00071"></a>00071 <span class="comment">// Get the next uniqueID as a string</span> <a name="l00072"></a><a class="code" href="classCVC3_1_1ParserTemp.html#ac58b842291d5311156374fcdcbc1e400">00072</a> std::string <a class="code" href="classCVC3_1_1ParserTemp.html#ac58b842291d5311156374fcdcbc1e400">uniqueID</a>() { <a name="l00073"></a>00073 std::ostringstream ss; <a name="l00074"></a>00074 ss << <a class="code" href="classCVC3_1_1ParserTemp.html#affc386fea3fca8495f4fa916465d71e9">d_uid</a>++; <a name="l00075"></a>00075 <span class="keywordflow">return</span> ss.str(); <a name="l00076"></a>00076 } <a name="l00077"></a>00077 <span class="comment">// Get the current prompt</span> <a name="l00078"></a><a class="code" href="classCVC3_1_1ParserTemp.html#ae57c95423f9a9714ea7ee611ab569ae6">00078</a> std::string <a class="code" href="classCVC3_1_1ParserTemp.html#ae57c95423f9a9714ea7ee611ab569ae6">getPrompt</a>() { <span class="keywordflow">return</span> <a class="code" href="classCVC3_1_1ParserTemp.html#a501c2cbc9842027cbfcc63ae2e3fa0c6">prompt</a>; } <a name="l00079"></a>00079 <span class="comment">// Set the prompt to the main one</span> <a name="l00080"></a><a class="code" href="classCVC3_1_1ParserTemp.html#a8b382f5e0c8cbf63f56c80792799d38f">00080</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1ParserTemp.html#a8b382f5e0c8cbf63f56c80792799d38f">setPrompt1</a>() { <a class="code" href="classCVC3_1_1ParserTemp.html#a501c2cbc9842027cbfcc63ae2e3fa0c6">prompt</a> = <a class="code" href="classCVC3_1_1ParserTemp.html#a6f2f69f077ddf2750043886497a7072c">prompt1</a>; } <a name="l00081"></a>00081 <span class="comment">// Set the prompt to the secondary one</span> <a name="l00082"></a><a class="code" href="classCVC3_1_1ParserTemp.html#a613d63001dcc7cc6e8a0000b6e623856">00082</a> <span class="keywordtype">void</span> <a class="code" href="classCVC3_1_1ParserTemp.html#a613d63001dcc7cc6e8a0000b6e623856">setPrompt2</a>() { <a class="code" href="classCVC3_1_1ParserTemp.html#a501c2cbc9842027cbfcc63ae2e3fa0c6">prompt</a> = <a class="code" href="classCVC3_1_1ParserTemp.html#a556acdd98994e1cbe523b6ce1f032f32">prompt2</a>; } <a name="l00083"></a>00083 }; <a name="l00084"></a>00084 <a name="l00085"></a>00085 } <span class="comment">// end of namespace CVC3</span> <a name="l00086"></a>00086 <a name="l00087"></a>00087 <span class="preprocessor">#endif</span> </pre></div></div> </div> <hr class="footer"/><address class="footer"><small>Generated on Wed Sep 7 2011 for CVC3 by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address> </body> </html>