00001 00002 /* 00003 | Author: Michael Schmidt; modified by Steffi Scherzinger; 00004 | Gunnar Jehl 00005 | 00006 | ************************* SOFTWARE LICENSE AGREEMENT *********************** 00007 | This source code is published under the BSD License. 00008 | 00009 | See file 'LICENSE.txt' that comes with this distribution or 00010 | http://dbis.informatik.uni-freiburg.de/index.php?project=GCX/license.php 00011 | for the full license agreement. 00012 | 00013 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00014 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00015 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00016 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00017 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00018 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00019 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00020 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00021 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00022 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00023 | POSSIBILITY OF SUCH DAMAGE. 00024 | **************************************************************************** 00025 */ 00026 00041 #ifndef EXECUTOR_H 00042 #define EXECUTOR_H 00043 00044 #include "cmdline.h" 00045 #include "streammanager.h" 00046 #include "inputstream.h" 00047 #include "outputstream.h" 00048 #include "fileinputstream.h" 00049 #include "fileoutputstream.h" 00050 #include "nullinputstream.h" 00051 #include "nulloutputstream.h" 00052 #include "socketinputstream.h" 00053 #include "socketoutputstream.h" 00054 #include "stdininputstream.h" 00055 #include "stdoutoutputstream.h" 00056 #include "exception.h" 00057 #include "iostreamexception.h" 00058 #include "parseexception.h" 00059 #include "runtimeexception.h" 00060 #include "invalidcastexception.h" 00061 #include "pathenvironment.h" 00062 #include "buffer.h" 00063 #include "streampreprocessor.h" 00064 #include "fsamap.h" 00065 #include "docexpression.h" 00066 #include "sequenceexpression.h" 00067 #include "forexpression.h" 00068 #include "varstepexpression.h" 00069 #include "passiveprojectiontree.h" 00070 00082 class Executor { 00083 00084 public: 00089 Executor(CmdLine * _cmd); 00090 00094 virtual ~ Executor(); 00095 00104 void start(); 00105 00106 private: 00112 void initStreams(); 00113 00119 void parseQuery(); 00120 00127 void optimizeQuery(); 00128 00137 void collectQueryInformation(); 00138 00144 void buildVariableTree(); 00145 00151 void buildDependencies(); 00152 00158 void buildProjectionTree(); 00159 00167 void buildSignOffQuery(); 00168 00176 void insertSignOffs(vector < SignOffExpression * >&signoffs); 00177 00183 void initProjectionDFA(); 00184 00192 void initStreamParser(); 00193 00202 void preprocessStream(); 00203 00212 void evalQuery(); 00213 00222 void finalDebugPrint(bool sppmode); 00223 00228 OutputStream *debug_ostream; 00229 00234 OutputStream *eval_ostream; 00235 00241 Expression *query; 00242 00247 Buffer *buffer; 00248 00253 FSAMap *fsamap; 00254 00259 ParVarMap *parvarmap; 00260 00265 PathEnvironment *penv; 00266 00271 VariableTree *vt; 00272 00277 vector < DependencySet * >*depset; 00278 00283 ProjectionTree *pt; 00284 00289 PassiveProjectionTree *ppt; 00290 00295 ProjectionDFA *pdfa; 00296 00301 CmdLine *cmd; 00302 }; 00303 00304 #endif // EXECUTOR_H