next up previous
Next: Procedure and function declarations Up: Type Analysis Previous: Type definitions


Variable declarations

A declaration is used to associated a type with an identifier, and that type becomes the value of the Type attribute of the identifier use. Thus the Typing module provides computational roles for both the defining occurrence and the applied occurrence of a typed identifier. These roles must be inherited by appropriate AST nodes:

Variable declarations[28]:
TREE SYMBOL VrblIds  INHERITS TypedDefinition END;
TREE SYMBOL FrmlIds  INHERITS TypedDefinition END;

TREE SYMBOL VblIdDef INHERITS TypedDefId      END;

RULE: Decl ::= TypIdDef '=' type     COMPUTE
  TypIdDef.Type=type.Type;
END;

RULE: Decl ::= VrblIds  ':' type     COMPUTE
  VrblIds.Type=type.Type;
END;

This macro is defined in definitions 28.
This macro is invoked in definition 1.



2008-08-29