1 /*
2  * Copyright © 2019 Dynare Team
3  *
4  * This file is part of Dynare.
5  *
6  * Dynare is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Dynare is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef _FORWARDDECLARATIONSANDENUMS_HH
21 #define _FORWARDDECLARATIONSANDENUMS_HH
22 
23 #include <memory>
24 
25 using namespace std;
26 
27 namespace macro
28 {
29   // For Expressions.hh
30   class BaseType;
31   using BaseTypePtr = shared_ptr<BaseType>;
32   class Bool;
33   using BoolPtr = shared_ptr<Bool>;
34   class Real;
35   using RealPtr = shared_ptr<Real>;
36   class String;
37   using StringPtr = shared_ptr<String>;
38   class Tuple;
39   using TuplePtr = shared_ptr<Tuple>;
40   class Array;
41   using ArrayPtr = shared_ptr<Array>;
42   class Range;
43   using RangePtr = shared_ptr<Range>;
44 
45   // For Environment.hh
46   class Expression;
47   using ExpressionPtr = shared_ptr<Expression>;
48   class Variable;
49   using VariablePtr = shared_ptr<Variable>;
50   class Function;
51   using FunctionPtr = shared_ptr<Function>;
52 
53   // For Parser.yy
54   class Directive;
55   using DirectivePtr = shared_ptr<Directive>;
56   class Eval;
57   using EvalPtr = shared_ptr<Eval>;
58 
59   // For Directives.cc
60   class Driver;
61 
62   namespace codes
63   {
64     enum class BaseType
65       {
66        Bool,
67        Real,
68        String,
69        Array,
70        Range,
71        Tuple
72       };
73 
74     enum class UnaryOp
75       {
76        cast_bool,
77        cast_real,
78        cast_string,
79        cast_tuple,
80        cast_array,
81        logical_not,
82        unary_minus,
83        unary_plus,
84        length,
85        isempty,
86        isboolean,
87        isreal,
88        isstring,
89        istuple,
90        isarray,
91        exp,
92        ln,
93        log10,
94        sin,
95        cos,
96        tan,
97        asin,
98        acos,
99        atan,
100        sqrt,
101        cbrt,
102        sign,
103        floor,
104        ceil,
105        trunc,
106        sum,
107        erf,
108        erfc,
109        gamma,
110        lgamma,
111        round,
112        normpdf,
113        normcdf,
114        defined
115       };
116 
117     enum class BinaryOp
118       {
119        plus,
120        minus,
121        times,
122        divide,
123        power,
124        equal_equal,
125        not_equal,
126        less,
127        greater,
128        less_equal,
129        greater_equal,
130        logical_and,
131        logical_or,
132        in,
133        set_union,
134        set_intersection,
135        max,
136        min,
137        mod
138       };
139 
140     enum class TrinaryOp
141       {
142        normpdf,
143        normcdf
144       };
145   }
146 }
147 
148 #endif
149