Skip to content
Snippets Groups Projects
Select Git revision
  • 78874a01d3040f7841bda72e0efd8b30dbe4f974
  • master default protected
  • pac_composite_target_mce
  • ramsey_k_order
  • 4.6
  • occbin
  • uop
  • rework_pac
  • aux_vars_fix
  • created_preprocessor_repo
10 results

SymbolList.hh

Blame
  • Forked from Dynare / preprocessor
    Source project has a limited visibility.
    ExprNode.hh 49.58 KiB
    /*
     * Copyright (C) 2007-2011 Dynare Team
     *
     * This file is part of Dynare.
     *
     * Dynare is free software: you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation, either version 3 of the License, or
     * (at your option) any later version.
     *
     * Dynare is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
     */
    
    #ifndef _EXPR_NODE_HH
    #define _EXPR_NODE_HH
    
    using namespace std;
    
    #include <set>
    #include <map>
    #include <vector>
    #include <ostream>
    
    #include "SymbolTable.hh"
    #include "CodeInterpreter.hh"
    #include "ExternalFunctionsTable.hh"
    
    class DataTree;
    class VariableNode;
    class BinaryOpNode;
    
    typedef class ExprNode *expr_t;
    
    struct Model_Block;
    
    struct ExprNodeLess;
    
    //! Type for set of temporary terms
    /*! They are ordered by index number thanks to ExprNodeLess */
    typedef set<expr_t, ExprNodeLess> temporary_terms_t;
    
    //! set of temporary terms used in a block
    typedef set<int> temporary_terms_inuse_t;
    
    typedef map<int, int> map_idx_t;
    
    //! Type for evaluation contexts
    /*! The key is a symbol id. Lags are assumed to be null */
    typedef map<int, double> eval_context_t;
    
    //! Type for tracking first/second derivative functions that have already been written as temporary terms
    typedef map<pair<int, vector<expr_t> >, int> deriv_node_temp_terms_t;
    
    //! Possible types of output when writing ExprNode(s)
    enum ExprNodeOutputType
      {
        oMatlabStaticModel,                           //!< Matlab code, static model
        oMatlabDynamicModel,                          //!< Matlab code, dynamic model
        oMatlabStaticModelSparse,                     //!< Matlab code, static block decomposed model
        oMatlabDynamicModelSparse,                    //!< Matlab code, dynamic block decomposed model
        oCDynamicModel,                               //!< C code, dynamic model
        oMatlabOutsideModel,                          //!< Matlab code, outside model block (for example in initval)
        oLatexStaticModel,                            //!< LaTeX code, static model
        oLatexDynamicModel,                           //!< LaTeX code, dynamic model