MicroModelicaCCompiler
4.5.3
|
#include <string>
#include <ast/ast_types.hpp>
#include <ast/ast_builder.hpp>
#include <ast/expression.hpp>
#include <ast/statement.hpp>
#include <ast/equation.hpp>
#include <ir/index.hpp>
#include <ir/event.hpp>
#include "util_types.hpp"
Go to the source code of this file.
Classes | |
class | AST_Expression_Traverse |
class | AST_Expression_Visitor< R > |
class | AST_Statement_Visitor< F, R, V > |
class | AST_Expression_Fold< R > |
class | AST_Visitor |
class | EqualExp |
class | IsConstant |
class | ReplaceExp |
class | ReplaceBoolean |
class | WhenEqualityTrasforms |
class | PreChange |
class | FindReference |
class | ReplaceReference |
Macros | |
#define | IS_CREF(X) ((X)->expressionType() == EXPCOMPREF) |
#define | IS_UMINUS(X) ((X)->expressionType() == EXPUMINUS) |
#define | IS_UMINUS_VAR(X) (IS_UMINUS(X) && IS_CREF((X)->getAsUMinus()->exp())) |
#define | UMINUS_EXP(X) ((X)->getAsUMinus()->exp()) |
#define | CREF_NAME(X) (IS_UMINUS(X) ? *(UMINUS_EXP(X)->getAsComponentReference()->names()->front()) : *((X)->getAsComponentReference()->names()->front())) |
#define | IS_VAR(X) ((IS_CREF(X) || IS_UMINUS_VAR(X)) && (!IS_PARAMETER(X))) |
#define | IS_ZERO_REAL(X) ((X)->expressionType() == EXPREAL && (X)->getAsReal()->val() == 0.0) |
#define | IS_ZERO_INT(X) ((X)->expressionType() == EXPINTEGER && (X)->getAsInteger()->val() == 0) |
#define | IS_ZERO(X) (IS_ZERO_REAL(X) || IS_ZERO_INT(X)) |
#define | IS_ADD(X) ((X)->expressionType() == EXPBINOP && (X)->getAsBinOp()->binopType() == BINOPADD) |
#define | LEFT_EXP(X) ((X)->getAsBinOp()->left()) |
#define | RIGHT_EXP(X) ((X)->getAsBinOp()->right()) |
#define | IS_SUB(X) ((X)->expressionType() == EXPBINOP && (X)->getAsBinOp()->binopType() == BINOPSUB) |
#define | IS_SUM_(X) (IS_SUB(X) || IS_ADD(X)) |
#define | IS_SUM_OF_VARS(X) (IS_SUM_(X) && (IS_VAR((X)->getAsBinOp()->left()) && IS_VAR((X)->getAsBinOp()->right()))) |
#define | IS_STATE(X) (_varSymbolTable->lookup(CREF_NAME(X)) != nullptr && _varSymbolTable->lookup(CREF_NAME(X))->isState()) |
#define | IS_PARAMETER(X) |
#define | IS_RELOP(X) ((X)->expressionType() == EXPBINOP && (X)->getAsBinOp()->binopType() >= BINOPLOWER && (X)->getAsBinOp()->binopType() <= BINOPGREATEREQ) |
#define | IS_BNOT(X) ((X)->expressionType() == EXPBOOLEANNOT) |
#define | _VAR(v) newAST_Expression_ComponentReferenceExp(v) |
#define | GREATER(l, r) newAST_Expression_BinOp(l, r, BINOPGREATER) |
#define | LOWER(l, r) newAST_Expression_BinOp(l, r, BINOPLOWER) |
#define | ADD(l, r) newAST_Expression_BinOp(l, r, BINOPADD) |
#define | MULT(l, r) newAST_Expression_BinOp(l, r, BINOPMULT) |
#define | SUB(l, r) newAST_Expression_BinOp(l, r, BINOPSUB) |
#define | I(n) newAST_Expression_Integer(n) |
#define | _R(n) newAST_Expression_Real(n) |
#define | _PA(e) newAST_Expression_OutputExpressions(e) |
#define | UMENOS(e) SUB(I(1), e) |
#define | UNARYM(e) newAST_Expression_UnaryMinus(e) |
#define | GREATEREQ(l, r) newAST_Expression_BinOp(l, r, BINOPGREATEREQ) |
#define | LOWEREQ(l, r) newAST_Expression_BinOp(l, r, BINOPLOWERWQ) |
#define | EQUAL(l, r) newAST_Expression_BinOp(l, r, BINOPCOMPEQ) |
#define _PA | ( | e | ) | newAST_Expression_OutputExpressions(e) |
Definition at line 65 of file ast_util.hpp.
#define _R | ( | n | ) | newAST_Expression_Real(n) |
Definition at line 64 of file ast_util.hpp.
#define _VAR | ( | v | ) | newAST_Expression_ComponentReferenceExp(v) |
Definition at line 57 of file ast_util.hpp.
#define ADD | ( | l, | |
r | |||
) | newAST_Expression_BinOp(l, r, BINOPADD) |
Definition at line 60 of file ast_util.hpp.
#define CREF_NAME | ( | X | ) | (IS_UMINUS(X) ? *(UMINUS_EXP(X)->getAsComponentReference()->names()->front()) : *((X)->getAsComponentReference()->names()->front())) |
Definition at line 37 of file ast_util.hpp.
#define EQUAL | ( | l, | |
r | |||
) | newAST_Expression_BinOp(l, r, BINOPCOMPEQ) |
Definition at line 70 of file ast_util.hpp.
#define GREATER | ( | l, | |
r | |||
) | newAST_Expression_BinOp(l, r, BINOPGREATER) |
Definition at line 58 of file ast_util.hpp.
#define GREATEREQ | ( | l, | |
r | |||
) | newAST_Expression_BinOp(l, r, BINOPGREATEREQ) |
Definition at line 68 of file ast_util.hpp.
#define I | ( | n | ) | newAST_Expression_Integer(n) |
Definition at line 63 of file ast_util.hpp.
#define IS_ADD | ( | X | ) | ((X)->expressionType() == EXPBINOP && (X)->getAsBinOp()->binopType() == BINOPADD) |
Definition at line 43 of file ast_util.hpp.
#define IS_BNOT | ( | X | ) | ((X)->expressionType() == EXPBOOLEANNOT) |
Definition at line 56 of file ast_util.hpp.
#define IS_CREF | ( | X | ) | ((X)->expressionType() == EXPCOMPREF) |
Definition at line 33 of file ast_util.hpp.
#define IS_PARAMETER | ( | X | ) |
Definition at line 50 of file ast_util.hpp.
#define IS_RELOP | ( | X | ) | ((X)->expressionType() == EXPBINOP && (X)->getAsBinOp()->binopType() >= BINOPLOWER && (X)->getAsBinOp()->binopType() <= BINOPGREATEREQ) |
Definition at line 54 of file ast_util.hpp.
#define IS_STATE | ( | X | ) | (_varSymbolTable->lookup(CREF_NAME(X)) != nullptr && _varSymbolTable->lookup(CREF_NAME(X))->isState()) |
Definition at line 49 of file ast_util.hpp.
#define IS_SUB | ( | X | ) | ((X)->expressionType() == EXPBINOP && (X)->getAsBinOp()->binopType() == BINOPSUB) |
Definition at line 46 of file ast_util.hpp.
Definition at line 47 of file ast_util.hpp.
#define IS_SUM_OF_VARS | ( | X | ) | (IS_SUM_(X) && (IS_VAR((X)->getAsBinOp()->left()) && IS_VAR((X)->getAsBinOp()->right()))) |
Definition at line 48 of file ast_util.hpp.
#define IS_UMINUS | ( | X | ) | ((X)->expressionType() == EXPUMINUS) |
Definition at line 34 of file ast_util.hpp.
Definition at line 35 of file ast_util.hpp.
#define IS_VAR | ( | X | ) | ((IS_CREF(X) || IS_UMINUS_VAR(X)) && (!IS_PARAMETER(X))) |
Definition at line 39 of file ast_util.hpp.
#define IS_ZERO | ( | X | ) | (IS_ZERO_REAL(X) || IS_ZERO_INT(X)) |
Definition at line 42 of file ast_util.hpp.
#define IS_ZERO_INT | ( | X | ) | ((X)->expressionType() == EXPINTEGER && (X)->getAsInteger()->val() == 0) |
Definition at line 41 of file ast_util.hpp.
#define IS_ZERO_REAL | ( | X | ) | ((X)->expressionType() == EXPREAL && (X)->getAsReal()->val() == 0.0) |
Definition at line 40 of file ast_util.hpp.
#define LEFT_EXP | ( | X | ) | ((X)->getAsBinOp()->left()) |
Definition at line 44 of file ast_util.hpp.
#define LOWER | ( | l, | |
r | |||
) | newAST_Expression_BinOp(l, r, BINOPLOWER) |
Definition at line 59 of file ast_util.hpp.
#define LOWEREQ | ( | l, | |
r | |||
) | newAST_Expression_BinOp(l, r, BINOPLOWERWQ) |
Definition at line 69 of file ast_util.hpp.
#define MULT | ( | l, | |
r | |||
) | newAST_Expression_BinOp(l, r, BINOPMULT) |
Definition at line 61 of file ast_util.hpp.
#define RIGHT_EXP | ( | X | ) | ((X)->getAsBinOp()->right()) |
Definition at line 45 of file ast_util.hpp.
#define SUB | ( | l, | |
r | |||
) | newAST_Expression_BinOp(l, r, BINOPSUB) |
Definition at line 62 of file ast_util.hpp.
Definition at line 66 of file ast_util.hpp.
#define UMINUS_EXP | ( | X | ) | ((X)->getAsUMinus()->exp()) |
Definition at line 36 of file ast_util.hpp.
#define UNARYM | ( | e | ) | newAST_Expression_UnaryMinus(e) |
Definition at line 67 of file ast_util.hpp.