Compiler


Files

file  instmacro.h

Data Structures

struct  AnonType
struct  BitList
struct  TableC
struct  TableF
union  TableUnion
struct  Case
struct  ChildListEntry
struct  ChildDescR
struct  ChildDescI
struct  ChildDescS
union  ChildDescUnion
struct  ChildDesc
struct  DimStruct
struct  ExprReal
struct  SatisfiedExpr
union  ExprUnion
struct  Expr
struct  Range
union  SetUnion
struct  Set
union  NameUnion
struct  Name
struct  ExtCallNode
struct  GlassBoxExternalFunc
struct  BBoxInterp
struct  BlackBoxExternalFunc
struct  MethodExternalFunc
struct  ExternalFunc
union  for_union_t
struct  for_var_t
struct  fraction
struct  FreeStore
struct  Func
struct  Instance
struct  NameNode
union  InstanceNameUnion
struct  InstanceName
struct  RealInstance
struct  IntegerInstance
struct  BooleanInstance
struct  SetInstance
struct  SymbolInstance
struct  CommonAtomInstance
struct  RealAtomInstance
struct  IntegerAtomInstance
struct  BooleanAtomInstance
struct  SetAtomInstance
struct  SymbolAtomInstance
struct  CommonConstantInstance
struct  RealConstantInstance
struct  IntegerConstantInstance
struct  BooleanConstantInstance
struct  SymbolConstantInstance
struct  RelationInstance
struct  LogRelInstance
struct  PendInstance
struct  ModelInstance
struct  WhenInstance
struct  ArrayChild
struct  ArrayInstance
struct  SimulationInstance
struct  GlobalDummyInstance
struct  Interval
struct  HierarchyNode
struct  LogRelBVar
struct  LogRelBoolean
struct  LogRelInteger
struct  LogRelSatisfied
struct  LogRelUnary
struct  LogRelBinary
struct  logrel_term
union  LogRelTermUnion
struct  TokenLogRel
struct  logrelation
struct  NoteTmp
struct  argItem
struct  parpendingentry
struct  pending_t
struct  InitProcedure
struct  anywatch
struct  namewatch
struct  procwatch
struct  statwatch
struct  varswatch
struct  typewatch
struct  procDebug
struct  procFrame
struct  SearchEntry
struct  BlackBoxCache
struct  BlackBoxData
struct  RXNameData
struct  RelationReal
struct  RelationInteger
struct  RelationRealConst
struct  RelationIntegerConst
struct  RelationVar
struct  RelationFunc
struct  RelationUnary
struct  RelationBinary
struct  RelationNary
struct  relation_term
union  RelationTermUnion
struct  SharedRelation
struct  TokenRelation
struct  OpCodeRelation
struct  GlassBoxRelation
struct  BlackBoxRelation
union  RelationUnion
union  doublong
struct  relation
struct  set_t
struct  WhenList
struct  SelectList
struct  SwitchList
struct  StateRUN
struct  StateFIX
struct  StateASSERT
struct  StateIF
struct  StateCOND
struct  StateWHEN
struct  StateFNAME
struct  StateSELECT
struct  StateSWITCH
struct  StateIS
struct  CompoundAlias
struct  StateAlias
struct  StateARE
struct  StateAssign
struct  StateCall
struct  StateRelation
struct  StateLogicalRel
struct  StateExternalMethod
struct  StateExternalRelation
struct  StateExternalBlackBox
struct  StateExternalGlassBox
struct  StateExternal
struct  StateReference
struct  StateFlow
struct  StateFOR
struct  StateWhile
union  StateUnion
struct  Statement
struct  StatementList
struct  ConstantTypeDesc
struct  AtomTypeDesc
struct  IndexType
struct  ArrayDesc
struct  ModelArgs
struct  TypeDescription
struct  Units
struct  UnitDefinition
struct  real_value_t
union  value_union
struct  value_t
struct  visitmapinfo
struct  VariableList

Defines

#define FuncGetLnmEpsilon()   (g_lnm_epsilon)
#define AMSTAT   0
#define ATDEBUG   0
#define INSTANCES_PER_AT   2
#define ANONEXPECTED   200
#define ANONTABLESIZE   1024
#define Asc_GetAnonType(atl, n)   ((struct AnonType *)gl_fetch((atl),(n)))
#define Asc_GetAnonCount(atl, n)   gl_length(Asc_GetAnonType((atl),(n))->instances)
#define Asc_GetAnonTypeInstance(at, c)   (struct Instance *)gl_fetch((at)->instances,(c))
#define CAC(acp)   ((struct ArrayChild *)(acp))
#define MALLOCPOOLAC   CAC(pool_get_element(g_array_child_pool))
#define FREEPOOLAC(ac)   pool_free_element(g_array_child_pool,(ac))
#define BLength(bl)   BLengthF(bl)
#define BCS(sbc)   BraceCharString(sbc)
#define BCLANG(sbc)   BraceCharLang(sbc)
#define BCL(sbc)   BraceCharLen(sbc)
#define IS_BINTOKEN_COMPILE
#define NULL   0
#define BinTokenGRADIENT   0
#define BinTokenRESIDUAL   1
#define GetCaseValues(c)   GetCaseValuesF(c)
#define GetCaseReferences(c)   GetCaseReferencesF(c)
#define GetCaseStatus(c)   GetCaseStatusF(c)
#define CheckInstance(a, b)   CheckInstanceLevel((a),(b),5)
#define AliasingOrigin(ori)
#define ParametricOrigin(ori)   ((ori) >= origin_PALI && (ori) <= origin_PWB)
#define ChildVisible(cl, n)   ((ChildGetBooleans((cl),(n)) & CBF_VISIBLE)!=0)
#define ChildSupported(cl, n)   ((ChildGetBooleans((cl),(n)) & CBF_SUPPORTED)!=0)
#define ChildPassed(cl, n)   ((ChildGetBooleans((cl),(n)) & CBF_PASSED) !=0)
#define ChildHide(cl, n)   ChildSetBoolean((cl),(n),CBF_VISIBLE,0)
#define ChildShow(cl, n)   ChildSetBoolean((cl),(n),CBF_VISIBLE,1)
#define NUM_FUNDTYPES   5
#define ICDESC(x)   CDescInit(&(x))
#define ICDESCPTR(y)   CDescInit(y)
#define AssignChildArrayElement(a, n, e)   AssignChildArrayElementF((a),(n),(e))
#define GetChildArrayElement(a, n)   GetChildArrayElementF((a),(n))
#define ChildDescType(e)   ChildDescTypeF(e)
#define ValueAssigned(e)   ValueAssignedF(e)
#define IntegerDefault(e)   IntegerDefaultF(e)
#define BooleanDefault(e)   BooleanDefaultF(e)
#define SetDefault(e)   SetDefaultF(e)
#define SetIsIntegerSet(e)   SetIsIntegerSetF(e)
#define SymbolDefault(e)   SymbolDefaultF(e)
#define RealDefaultValue(e)   RealDefaultValueF(e)
#define RealDimensions(e)   RealDimensionsF(e)
#define CmpParents   CmpRealPtrs
#define CmpRelations   CmpRealPtrs
#define CmpLogRelations   CmpRealPtrs
#define CmpWhens   CmpRealPtrs
#define TIMECOMPILER   0
#define CHECK_SYMBOL_USE   1
#define SCP(s)   ((CONST char *)(s))
#define SCLEN(s)   (*(int *)(((char *)s)-sizeof(int)))
#define BASE_REAL_NAME   "real"
#define BASE_INTEGER_NAME   "integer"
#define BASE_SYMBOL_NAME   "symbol"
#define BASE_BOOLEAN_NAME   "boolean"
#define BASE_SET_NAME   "set"
#define BASE_CON_REAL_NAME   "real_constant"
#define BASE_CON_INTEGER_NAME   "integer_constant"
#define BASE_CON_BOOLEAN_NAME   "boolean_constant"
#define BASE_CON_SYMBOL_NAME   "symbol_constant"
#define BASE_REL_NAME   "relation"
#define BASE_LOGREL_NAME   "logic_relation"
#define BASE_WHEN_NAME   "when"
#define BASE_EXT_NAME   "EXTERNAL_MODEL"
#define BASE_UNSELECTED   "unSELECTed_part"
#define NUM_DIMENS   10
#define D_MASS   0
#define D_QUANTITY   1
#define D_LENGTH   2
#define D_TIME   3
#define D_TEMPERATURE   4
#define D_CURRENCY   5
#define D_ELECTRIC_CURRENT   6
#define D_LUMINOUS_INTENSITY   7
#define D_PLANE_ANGLE   8
#define D_SOLID_ANGLE   9
#define DIM_WILD   0x1
#define GetDimFraction(d, i)   ((d).f[i])
#define GetDimPower(d, i)   (int)(Denominator((d).f[i])==1 ? Numerator((d).f[i]) : 0)
#define SetDimFraction(d, i, frac)   ( (d).f[(i)] = (frac) )
#define MESSYTHRESH   10
#define NUM_EXPR_ENUMS   44
#define TOK_SCALAR_LOW   e_zero
#define TOK_SCALAR_HIGH   e_var
#define TOK_CONSTANT_LOW   e_zero
#define TOK_CONSTANT_HIGH   e_int
#define TOK_XARY_LOW   e_uminus
#define TOK_XARY_HIGH   e_ipower
#define TOK_BINARY_LOW   e_plus
#define TOK_BINARY_HIGH   e_ipower
#define TOK_UNARY_LOW   e_uminus
#define TOK_UNARY_HIGH   e_func
#define TOK_REAL_REL_LOW   e_zero
#define TOK_REAL_REL_HIGH   e_ipower
#define TOK_REL_TYPE_LOW   e_glassbox
#define TOK_REL_TYPE_HIGH   e_token
#define MAXINTREAL   100000
#define NextExpr(e)   NextExprF(e)
#define ExprType(e)   ExprTypeF(e)
#define ExprName(e)   ExprNameF(e)
#define ExprFunc(e)   ExprFuncF(e)
#define ExprIValue(e)   ExprIValueF(e)
#define ExprRValue(e)   ExprRValueF(e)
#define ExprRDimensions(e)   ExprRDimensionsF(e)
#define SatisfiedExprName(e)   SatisfiedExprNameF(e)
#define SatisfiedExprRValue(e)   SatisfiedExprRValueF(e)
#define SatisfiedExprRDimensions(e)   SatisfiedExprRDimensionsF(e)
#define ExprBValue(e)   ExprBValueF(e)
#define ExprSValue(e)   ExprSValueF(e)
#define ExprSymValue(e)   ExprSymValueF(e)
#define ExprQStrValue(e)   ExprQStrValueF(e)
#define ExprBuiltinSet(e)   ExprBuiltinSetF(e)
#define K_TERM(i)   ((Term *)(i))
#define ShutDownDerivatives()   PrepareDerivatives(0,0,0)
#define ExternalCallExtFunc(ext)   ExternalCallExtFuncF(ext)
#define ExternalCallArgList(ext)   ExternalCallArgListF(ext)
#define ExternalCallVarIndex(ext)   ExternalCallVarIndexF(ext)
#define ExternalCallNodeStamp(ext)   ExternalCallNodeStampF(ext)
#define FINDEBUG   0
#define GetDeclarativeContext()   g_DeclarativeContext
#define SetDeclarativeContext(n)   g_DeclarativeContext = (n)
#define EVALDEBUG   0
#define GetEvaluationContext()   GetEvaluationContextF()
#define GetEvaluationForTable()   GetEvaluationForTableF()
#define SetEvaluationContext(i)   SetEvaluationContextF(i)
#define SetEvaluationForTable(ft)   SetEvaluationForTableF(ft)
#define for_table_t   gl_list_t
#define FRACPART   short
#define FRACMAX   SHRT_MAX
#define Numerator(f)   ((f).numerator)
#define Denominator(f)   ((f).denominator)
#define F_ERF_COEF   1.1283791670955130
#define F_LOG10_COEF   0.4342944819032518
#define F_PI   3.1415926535897932385E0
#define F_PI_HALF   1.5707963267948966192E0
#define F_LIM_EXP   709.78
#define F_LIM_CUBE   5.6438030941223618e101
#define F_LIM_SQR   1.0e154
#define FuncSetLnmEpsilon(e)   (e>(double)0.0 ? g_lnm_epsilon=e : FPRINTF(ASCERR,"bad lnm eps"))
#define ascnint(a)   ascnintF(a)
#define dhold2   dhold
#define INITSTACKLIMIT   40
#define IREAL   0x1
#define IINT   0x2
#define IBOOL   0x4
#define ISYM   0x8
#define ISET   0x10
#define IARR   0x20
#define IENUM   0x40
#define IFUND   0x80
#define ICONS   0x100
#define IATOM   0x200
#define ICOMP   0x400
#define IMOD   0x800
#define IRELN   0x1000
#define ILRELN   0x2000
#define IWHEN   0x4000
#define IAUTO   0x8000
#define IDUMB   0x10000
#define ICHILDLESS   (IFUND | ICONS | IWHEN | IDUMB)
#define IERRINST
#define ASC_ENUM_DECLS(D, X)
#define InstanceNameType(in)   ((in).t)
#define InstanceNameStr(in)   ((in).u.name)
#define InstanceIntIndex(in)   ((in).u.index)
#define InstanceStrIndex(in)   ((in).u.name)
#define SetInstanceNameType(in, type)   ((in).t) = (type)
#define SetInstanceNameStrPtr(in, str)   ((in).u.name) = (str)
#define SetInstanceNameStrIndex(in, str)   ((in).u.name) = (str)
#define SetInstanceNameIntIndex(in, int_index)   ((in).u.index) = (int_index)
#define LONGCHILDREN   0
#define SOL_ASSIGNED   0x1
#define SOL_FIXED   0x2
#define SOL_INACTIVELB   0x4
#define SOL_INACTIVEUB   0x8
#define SOL_ODESTATE   0x10
#define SOL_ODEOBSERVE   0x20
#define SOL_ISZERO   0x40
#define SOL_INTEGER   0x80
#define SOL_RELAXEDINT   0x100
#define SOL_INTERVAL   0x200
#define SOL_COMPLEX   0x400
#define SOL_DOMAIN   0x800
#define SOL_ODEINDEP   0x1000
#define SOL_NODOF   0x2000
#define SOL_PARAMETRIC   0x4000
#define SOL_INTENSIVE   0x8000
#define SOL_NONBASIC   0x10000
#define SOL_TIGHTLB   0x100000
#define SOL_TIGHTUB   0x200000
#define SOL_NOELIG   0x400000
#define NORELS   0x0
#define GBOXRELS   0x1
#define BBOXRELS   0x2
#define TOKRELS   0x4
#define ALLRELS   (GBOXRELS | BBOXRELS | TOKRELS)
#define EXTRELS   (GBOXRELS | BBOXRELS)
#define Instantiate(a, b, c, d)   NewInstantiate((a),(b),(c),(d))
#define ReInstantiate(a)   NewReInstantiate(a)
#define AVG_CONSTANT_PARENTS   2L
#define AVG_ICONSTANT_PARENTS   20L
#define AVG_PARENTS   2L
#define AVG_CASES   2L
#define AVG_WHEN   2L
#define AVG_RELATIONS   7L
#define AVG_LOGRELS   7L
#define AVG_ARY_CHILDREN   7L
#define UNDEFAULTEDREAL   0.0
#define MAX_EXTRELATIONS   50
#define INST(i)   ((struct Instance *)(i))
#define SIM_INST(i)   ((struct SimulationInstance *)(i))
#define RELN_INST(i)   ((struct RelationInstance *)(i))
#define LRELN_INST(i)   ((struct LogRelInstance *)(i))
#define ARY_INST(i)   ((struct ArrayInstance *)(i))
#define MOD_INST(i)   ((struct ModelInstance *)(i))
#define W_INST(i)   ((struct WhenInstance *)(i))
#define R_INST(i)   ((struct RealInstance *)(i))
#define I_INST(i)   ((struct IntegerInstance *)(i))
#define B_INST(i)   ((struct BooleanInstance *)(i))
#define S_INST(i)   ((struct SetInstance *)(i))
#define SYM_INST(i)   ((struct SymbolInstance *)(i))
#define CI_INST(i)   ((struct CommonConstantInstance *)(i))
#define RC_INST(i)   ((struct RealConstantInstance *)(i))
#define IC_INST(i)   ((struct IntegerConstantInstance *)(i))
#define BC_INST(i)   ((struct BooleanConstantInstance *)(i))
#define SYMC_INST(i)   ((struct SymbolConstantInstance *)(i))
#define CA_INST(i)   ((struct CommonAtomInstance *)(i))
#define RA_INST(i)   ((struct RealAtomInstance *)(i))
#define BA_INST(i)   ((struct BooleanAtomInstance *)(i))
#define IA_INST(i)   ((struct IntegerAtomInstance *)(i))
#define SA_INST(i)   ((struct SetAtomInstance *)(i))
#define SYMA_INST(i)   ((struct SymbolAtomInstance *)(i))
#define SOL_INST(i)   ((struct SolverAtomInstance *)(i))
#define D_INST(i)   ((struct GlobalDummyInstance *)(i))
#define CIASS(i)   (CI_INST(i)->vflag & ci_ASSIGNED)
#define BCV(i)   ((BC_INST(i)->vflag & ci_BVAL) == ci_BVAL)
#define R_PARENT(i)   INST((unsigned long)i-(unsigned long)R_INST(i)->parent_offset)
#define I_PARENT(i)   INST((unsigned long)i-(unsigned long)I_INST(i)->parent_offset)
#define B_PARENT(i)   INST((unsigned long)i-(unsigned long)B_INST(i)->parent_offset)
#define S_PARENT(i)   INST((unsigned long)i-(unsigned long)S_INST(i)->parent_offset)
#define SYM_PARENT(i)   INST((unsigned long)i-(unsigned long)SYM_INST(i)->parent_offset)
#define NextHighestEven(ivalue)   (((ivalue) & 1) ? ((ivalue)+1) : (ivalue))
#define CHILD_ADR(iptr, type, c)   ((struct Instance **)((unsigned long)iptr+(unsigned long)sizeof(type))+c)
#define SIM_CHILD(i, c)   CHILD_ADR(i,struct SimulationInstance,c)
#define MOD_CHILD(i, c)   CHILD_ADR(i,struct ModelInstance,c)
#define RA_CHILD(i, c)   CHILD_ADR(i,struct RealAtomInstance,c)
#define BA_CHILD(i, c)   CHILD_ADR(i,struct BooleanAtomInstance,c)
#define IA_CHILD(i, c)   CHILD_ADR(i,struct IntegerAtomInstance,c)
#define SA_CHILD(i, c)   CHILD_ADR(i,struct SetAtomInstance,c)
#define SYMA_CHILD(i, c)   CHILD_ADR(i,struct SymbolAtomInstance,c)
#define REL_CHILD(i, c)   CHILD_ADR(i,struct RelationInstance,c)
#define LREL_CHILD(i, c)   CHILD_ADR(i,struct LogRelInstance,c)
#define CLIST(in, type)   (struct Instance **)((unsigned long)(in)+sizeof(type))
#define BASE_ADDR(in, num, type)   INST((CLIST(in,type)) + NextHighestEven(num))
#define NotAtom(i)   NotAtomF(i)
#define InstanceKind(i)   InstanceKindF(i)
#define IsConstantInstance(i)   ((i)->t & ICONS)
#define IsFundamentalInstance(i)   ((i)->t & IFUND)
#define IsAtomicInstance(i)   ((i)->t & IATOM)
#define IsCompoundInstance(i)   ((i)->t & ICOMP)
#define IsArrayInstance(i)   ((i)->t & IARR)
#define IsChildlessInstance(i)   ((i)->t & ICHILDLESS)
#define InstanceUniversal(i)   (GetUniversalFlag(InstanceTypeDesc(i)) != 0)
#define Inf(i)   ((i).low)
#define Sup(i)   ((i).high)
#define LOGA_TERM(i)   ((struct logrel_term *)(i))
#define LOGBV_TERM(i)   ((struct LogRelBVar *)(i))
#define LOGBC_TERM(i)   ((struct LogRelBoolean *)(i))
#define LOGI_TERM(i)   ((struct LogRelInteger *)(i))
#define LOGS_TERM(i)   ((struct LogRelSatisfied *)(i))
#define LOGB_TERM(i)   ((struct LogRelBinary *)(i))
#define LOGU_TERM(i)   ((struct LogRelUnary *)(i))
#define LOGUNION_TERM(i)   ((union LogRelTermUnion *)(i))
#define LOGTERM_ALLOC   LOGA_TERM(ascmalloc(sizeof(union LogRelTermUnion)))
#define NewLogRelTerm(r, p, l)   NewLogRelTermF((r),(p),(l))
#define LogRelSideTerm(rs, p)   LogRelSideTermF((rs),(p))
#define LogRelTermType(rtp)   LogRelTermTypeF(rtp)
#define LogTermUniLeft(t)   ( ((struct LogRelUnary *)t) -> left)
#define LogTermBinLeft(t)   ( ((struct LogRelBinary *)t) -> left)
#define LogTermBinRight(t)   ( ((struct LogRelBinary *)t) -> right)
#define LogRelCalcResidual(i, r)   LogRelCalcResidualPostfix(i,r,0,NULL)
#define Infix_Log_LhsSide(lr)   ((lr)->token.lhs_term)
#define Infix_Log_RhsSide(lr)   ((lr)->token.rhs_term)
#define Postfix_Log_LhsSide(lr)   ((lr)->token.lhs)
#define Postfix_Log_RhsSide(lr)   ((lr)->token.rhs)
#define MOD_FILE_EXTS   6
#define MOD_OLD_CODE   ".asc"
#define MOD_OLD_LIBRARY   ".lib"
#define MOD_NEW_CODE   ".a4c"
#define MOD_NEW_LIBRARY   ".a4l"
#define MOD_NEW_UNITS   ".a4u"
#define MOD_CATCHALL   ""
#define Asc_CurrentModule()   Asc_CurrentModuleF()
#define Asc_ModulesEqual(m1, m2)   ((m1)==(m2))
#define CreateIdName(s)   CreateIdNameF((s),NAMEBIT_IDTY)
#define CreateSystemIdName(s)   CreateIdNameF((s),NAMEBIT_IDTY|NAMEBIT_AUTO)
#define NextName(n)   NextNameF(n)
#define NameId(n)   NameIdF(n)
#define NameAuto(n)   NameAutoF(n)
#define NameIdPtr(n)   NameIdPtrF(n)
#define NameSetPtr(n)   NameSetPtrF(n)
#define NOTESWILD   ((symchar *)0x11)
#define NOTESWILDLIST   ((struct gl_list_t *)0x11)
#define NUMLISTUSESPOOL   TRUE
#define ASC_CLIENTDATA_DECLARED
#define ASC_OK   0
#define ASC_ERROR   1
#define ASC_RETURN   2
#define ASC_BREAK   3
#define ASC_CONTINUE   4
#define Asc_argItemKind(aip)   ((aip)->kind)
#define Asc_argItemDepth(aip)   ((aip)->depth)
#define Asc_argItemInstance(aip)   ((aip)->u.i)
#define Asc_argItemDoublePtr(aip)   ((aip)->u.dptr)
#define Asc_argItemLongPtr(aip)   ((aip)->u.liptr)
#define Asc_argItemDouble(aip)   ((aip)->u.dval)
#define Asc_argItemLongVal(aip)   ((aip)->u.lival)
#define Asc_argItemIntVal(aip)   ((aip)->u.ival)
#define Asc_argItemBoolVal(aip)   ((aip)->u.bval)
#define Asc_argItemStringVal(aip)   ((aip)->u.cval)
#define Asc_argItemNameString(aip)   ((aip)->u.nval)
#define Asc_argItemTypeName(aip)   ((aip)->u.nval)
#define Asc_argItemFileString(aip)   ((aip)->u.fval)
#define Asc_argItemListValue(aip)   ((aip)->u.lval)
#define PendingInstance(pt)   PendingInstanceF(pt)
#define ProcName(p)   ProcNameF(p)
#define