Next: Primitive types
Up: Type Analysis
Previous: void
Types and type identifiers
Java distinguishes primitive types, class and interface types, and array
types.
Primitive types are language-defined and named by keywords.
Class and interface types are program-defined and named by type names.
Array types are anonymous, and can only be denoted by using brackets.
Types and type identifiers[14]
:
ATTR Type: DefTableKey;
RULE: Type ::= PrimitiveType COMPUTE
Type.Type=PrimitiveType.Type;
END;
PrimitiveType[16]
RULE: Type ::= TypeName COMPUTE
Type.Type=TypeName.Type;
END;
Class and interface types[17]
RULE: Type ::= ArrayType COMPUTE
Type.Type=ArrayType.Type;
END;
Array types[28]
RULE: Type ::= 'void' COMPUTE
Type.Type=voidType;
END;
This macro is invoked in definition 2.
Chapter 4 showed how each type name and typed entity name had its
Key attribute set to the appropriate definition table key.
Thus the Typing module should be instantiated without a referto
parameter:
Instantiate required modules[15]
:
$/Type/Typing.gnrc :inst
This macro is defined in definitions 15, 26, 38, and 44.
This macro is invoked in definition 1.
Subsections
Next: Primitive types
Up: Type Analysis
Previous: void
2008-09-11