next up previous
Next: Type definitions Up: Type Analysis Previous: Pointer types


Constant definitions

Constant definitions[25]:
CHAIN ConstDepend: VOID;

CLASS SYMBOL RootType COMPUTE
  CHAINSTART HEAD.ConstDepend = "yes";
END;

TREE SYMBOL ConIdDef  INHERITS TypedDefId      END;
TREE SYMBOL ConIdUse  INHERITS TypedUseId, ChkTypedUseId      END;
TREE SYMBOL Enumerate INHERITS TypedDefinition END;

RULE: Decl ::= ConIdDef '=' constant COMPUTE
  ConIdDef.Type=constant.Type;
  Decl.ConstDepend = ConIdDef.TypeIsSet <- constant.ConstDepend;
END;

SYMBOL ConIdUse COMPUTE
  SYNT.TypeIsSet=THIS.ConstDepend;
END;
This macro is defined in definitions 25 and 26.
This macro is invoked in definition 1.

Constant definitions[26]:
RULE: Literal ::= character_string COMPUTE
  Literal.Type=
    IF(EQ(strlen(StringTable(character_string)),3),charType,
    IF(strcmp(StringTable(character_string),"''''"),stringType,
    charType));
END;

RULE: constant ::= csign integer_constant COMPUTE
  constant.Type=intType;
END;

RULE: constant ::= csign real_constant COMPUTE
  constant.Type=realType;
END;

RULE: constant ::= csign ConIdUse COMPUTE
  constant.Type=ConIdUse.Type;
END;

RULE: constant ::= integer_constant COMPUTE
  constant.Type=intType;
END;

RULE: constant ::= real_constant COMPUTE
  constant.Type=realType;
END;

RULE: constant ::= ConIdUse COMPUTE
  constant.Type=ConIdUse.Type;
END;

RULE: constant ::= Literal COMPUTE
  constant.Type=Literal.Type;
END;
This macro is defined in definitions 25 and 26.
This macro is invoked in definition 1.


next up previous
Next: Type definitions Up: Type Analysis Previous: Pointer types
2008-08-29