Skip to content

Commit

Permalink
+ Type checking for operators and operands for the new FrontEnd.
Browse files Browse the repository at this point in the history
  + Arithmetic operations  
  + Logical operations
  + Relations
+ Fix for type checking of assignment and equality equation statements . 
  

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@14128 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
mahge committed Nov 28, 2012
1 parent 073e9c4 commit e6dce00
Show file tree
Hide file tree
Showing 3 changed files with 809 additions and 19 deletions.
46 changes: 46 additions & 0 deletions Compiler/FrontEnd/DAEDump.mo
Expand Up @@ -237,6 +237,52 @@ algorithm
end matchcontinue;
end dumpOperatorString;

public function dumpOperatorSymbol "
Author bz printOperator
Dump operator to a string."
input DAE.Operator op;
output String str;
algorithm
str := matchcontinue(op)
local
Absyn.Path p;
DAE.Type ty;
case(DAE.ADD(_)) then " + ";
case(DAE.SUB(_)) then " - ";
case(DAE.MUL(_)) then " * ";
case(DAE.DIV(_)) then " / ";
case(DAE.POW(_)) then " ^ ";
case(DAE.UMINUS(_)) then " - ";
case(DAE.UMINUS_ARR(_)) then " - ";
case(DAE.ADD_ARR(_)) then " + ";
case(DAE.SUB_ARR(_)) then " - ";
case(DAE.MUL_ARR(_)) then " * ";
case(DAE.DIV_ARR(_)) then " / ";
case(DAE.MUL_ARRAY_SCALAR(_)) then " * ";
case(DAE.ADD_ARRAY_SCALAR(_)) then " .+ ";
case(DAE.SUB_SCALAR_ARRAY(_)) then " .- ";
case(DAE.MUL_SCALAR_PRODUCT(_)) then " * ";
case(DAE.MUL_MATRIX_PRODUCT(_)) then " * ";
case(DAE.DIV_ARRAY_SCALAR(_)) then " / ";
case(DAE.DIV_SCALAR_ARRAY(_)) then " / ";
case(DAE.POW_ARRAY_SCALAR(_)) then " ^ ";
case(DAE.POW_SCALAR_ARRAY(_)) then " ^ ";
case(DAE.POW_ARR(_)) then " ^ ";
case(DAE.POW_ARR2(_)) then " .^ ";
case(DAE.OR(_)) then " or ";
case(DAE.AND(_)) then " and ";
case(DAE.NOT(_)) then " not ";
case(DAE.LESSEQ(_)) then " <= ";
case(DAE.GREATER(_)) then " > ";
case(DAE.GREATEREQ(_)) then " >= ";
case(DAE.LESS(_)) then " < ";
case(DAE.EQUAL(_)) then " == ";
case(DAE.NEQUAL(_)) then " <> ";
case(DAE.USERDEFINED(p)) then " Userdefined:" +& Absyn.pathString(p) +& " ";
case(_) then " --UNDEFINED-- ";
end matchcontinue;
end dumpOperatorSymbol;

public function dump2str "
printDAEString daeString "
input DAE.DAElist inDAElist;
Expand Down

0 comments on commit e6dce00

Please sign in to comment.