A program generation apparatus for generating light-weight class files for each
terminal apparatus by linking class files. The program generation apparatus includes:
a storage unit for prestoring the class files for each terminal apparatus, where
each class defines (a) dependent variables unique to each terminal apparatus and
(b) non-dependent variables common to all the terminal apparatuses, each variable
is identified by a variable name, and each class file includes a variable name
for each variable; an assignment unit for assigning an offset number to each variable
defined in the class files so that the same offset numbers are assigned to non-dependent
variables having the same variable names; and a generation unit for generating
the light-weight class files for each terminal apparatus by replacing each variable
name in each class file with an offset number assigned by the assignment unit.