Task:
1. split Exp.mo in
   1 ComponentReference.mo 
   2 Expression.mo
   3 ExpressionDump.mo      - dump, print, convert to string 
   4 ExpressionSolve.mo     from 11530 to 11805
   5 ExpressionSimplify.mo  from 8310  to 11524
   
2. own file for DAELow dataypes called BackendDAE 
3. rename DAELow into BackendDAE

4. split DAELow into 
    1 BackendEquation.mo
	2 BackendAlgorithm.mo
	3 BackendVariables.mo
	4 BackendDAETransform.mo  containing lower2, lowerEqn, lowerAlg, lowerMultiDimEqn ....
	5 BackendDump.mo
	6 BackendDAEUtil.mo    - testBackendDAE  
	- 
5. remove DAE.CREF_IDENT("bla",...) into ComponentReference.makeCrefIdent("bla",...)
          DAE.CREF_QUAL("blub",..) into ComponentReference.makeCrefQual(cref_Ident,"blub",...) and 
   add this functions to ComponentReference.mo

6. sort all import in alphabetic order   
   
7. don't unparse unless debug flag is on
   
8. improve RML Warning Pedantic Messages 

9. move all stuff that does not generate the SimCode structure from SimCode.mo to BackendDAE*.mo
  
10 check if replace bintree with hvl tree has advantages  -> maybe not because there is only one treeGet call
  
11. split SimCodeC.tpl file into 
     0 SimCodeC.tpl  - call all the other functions of the other files
     1 SimCodeCUtil.tpl
     2 SimCodeCFunctions.tpl
     3 SimCodeCModel.tpl
     4 SimCodeCMakeFile.tpl
     5 SimCodeCInitFile.tpl	 
   
   
 
 
1# copy all functions dealing with ComponentRefs to ComponentReference.mo

puplic
  makeCrefQual
  crefToPath
  pathToCref
  unelabCref
  toExpCref
  crefToStr
  crefStr
  crefModelicaStr
  printComponentRefOptStr
  printComponentRefStr
  printComponentRef2Str
  debugPrintComponentRefTypeStr 
  crefLastPath
  crefLastIdent
  crefLastCref 
  crefType 
  crefLastType 
  crefSubs 
  crefLastSubs 
  crefFirstCref
  crefTypeConsiderSubs 
  crefNameType 
  crefLastIdentEqual
  crefFirstCrefEqual
  crefFirstCrefLastCrefEqual
  crefSortFunc 
  crefContainedIn
  crefPrefixOf
  crefNotPrefixOf 
  crefEqual
  crefEqualStringCompare
  crefEqualNoStringCompare
  crefEqualReturn
  crefIsIdent
  isRecord 
  crefIsFirstArrayElt
  crefHaveSubs 
  crefHasScalarSubscripts 
  containWholeDim 
  crefPrependIdent 
  crefAddPrefix 
  prependStringCref
  joinCrefs
  subscriptCref
  crefSetLastSubs 
  crefSetLastType 
  replaceCrefSliceSub 
  stripCrefIdentSliceSubs 
  crefStripSubs 
  crefStripPrefix
  crefStripLastIdent
  crefStripLastSubs
  crefStripFirstIdent
  crefStripLastSubsStringified
  stringifyComponentRef
  printComponentRef

protected
  toExpCrefSubs
  containWholeDim2 
  containWholeDim3 
  replaceSliceSub 
  removeSliceSubs 
  printComponentRef2 
 
 
#4.3 copy all functions for lowering into BackendDAETransform.mo

puplic
  lowerAlgorithmInputsOutputs
  findZeroCrossings 
  zeroCrossingsEquations

protected
  lowerVar
  lowerKnownVar
  lowerVarkind
  lowerKnownVarkind
  lowerType
  lowerExtObjVar
  lowerExtObjVarkind
  lowerEqn
  lowerArrEqn
  lowerComplexEqn
  lowerWhenEqn
  lowerWhenEqn2
  lowerTupleAssignment
  lowerTupleEquation
  lowerMultidimeqns
  lowerMultidimeqns2
  lowerMultidimeqn
  lowerMultidimeqn2
  lowerAlgorithms
  lowerAlgorithms2
  lowerAlgorithm
  lowerAlgorithm2
  lowerStatementInputsOutputs
  lowerElseAlgorithmInputsOutputs
  processDelayExpressions
  transformDelayExpressions
  transformDelayExpression
  hasNoStates
  addDummyState
  detectImplicitDiscrete
  sortEqn
  extractAlgebraicAndDifferentialEqn
  isAlgebraic 
  expandDerOperator
  expandDerOperatorEqns
  expandDerOperatorEqn
  expandDerOperatorWhenEqn
  expandDerOperatorAlgs
  expandDerOperatorAlg
  expandDerOperatorStmts
  expandDerOperatorStmt
  expandDerOperatorElseBranch
  expandDerOperatorArrEqns
  expandDerOperatorArrEqn
  expandDerExps
  expandDerExp
  updateStatesVars
  zeroCrossingEquations
  mergeZeroCrossings
  mergeZeroCrossing 
  sameZeroCrossing 
  differentZeroCrossing 
  findZeroCrossings2 
  findZeroCrossings3
  collectZeroCrossings 
  makeZeroCrossing
  makeZeroCrossings
  makeWhenClauses
  mergeClauses
  getWhenEquationFromVariable
  extendRecordEqns 
  isStateOrAlgvar
  extendAlgorithm 
  mergeVars
  checkAssertCondition 
  whenEquationsIndices 
  whenEquationsIndices2
  
#4.5 copy utility functions to BackendDAEUtil.mo

puplic
  printcheckBackendDAEWithErrorMsg"function: 
  checkBackendDAE 
  states
  statesExp
  emptyVars
  emptyAliasVariables
  equationList 
  listEquation 
  varList
  listVar
  vararrayList
  isDiscreteEquation
  isDiscreteExp 
  isVarDiscrete 
  bintreeToList 
  statesAndVarsExp
  isLoopDependent
  devectorizeArrayVar
  explodeArrayVars
  equationNth 
  equationSize 
  isInput

protected
  traversecheckBackendDAEExp
  statesExpMatrix
  equationList2 
  vararrayList2
  isKindDiscrete 
  bintreeToList2 
  bintreeToListOpt 
  statesEqns 
  statesAndVarsMatrixExp
  isLoopDependentHelper
  rangeIntExprs
  generateArrayElements
  simplifySubscripts
  simplifySubscript
  