"Primitives as Objects" (PAO) extension. Primitive types (e.g.,
int
, float
, etc.) may be used as subtypes
of Object
.
To implement this functionality, this extension has the following key
components:
- The package {@link pao.parse pao.parse}
modifies the grammar to allow primitive types to occur in
instanceof
expressions.
- The package {@link pao.ast pao.ast} provides
factories to create appropriate extension and delegate objects for the
AST nodes.
- The package {@link pao.extension pao.extension}
provides appropriate extension and delegate objects for the AST nodes.
- The package {@link pao.types pao.types}
modifies the type system to allow primitives to be used as subtypes
of
Object
.
- The package {@link pao.visit pao.visit}
adds a new pass
{@link pao.visit.PaoBoxer pao.visit.PaoBoxer}
to add boxing and unboxing code to allow primitive values to be
treated as objects at runtime.
- The package {@link pao.runtime pao.runtime}
provides the runtime support classes needed by PAO. These classes are
used at runtime to box primitive values. These classes must be on the
classpath when running programs compiled with the PAO compiler.
- Finally, the class {@link pao.ExtensionInfo ExtensionInfo}
provides information about this extension to the Polyglot compiler.