prima-gencls1
Class interface compiler for prima core modules
Usage
gencls --h
--inc
--tml
-O
-I<name>
--depend
--sayparent
filename.cls
Basic scalar data types
The types
are:
int
Bool
Handle
double
char *
string (
C
declaration
is
char
[256]
)
long
short
char
Color
U8
Derived data types
The syntax
for
a
new
data
types
definition
is
as
follows:
Namespace section
Syntax:
The object
namespace
syntax
includes
variables
and
properties
as
well
as
functions
(
called
methods
in
the
object
syntax
).
The
general
object
namespace
syntax
is
Within an
object
namespace
the
inheritance
syntax
can
be
used:
object <Class
ID>
(
<Parent
class
ID>)
or a
bare
root
object
description
(
with
no
ancestor
)
object <Class
ID>
Functions
Syntax:
Examples:
int package_func1(
int
a,
int
b
=
1)
=>
c_func_2;
Point package_func2(
Struc
*
x, ...
);
method void
object_func3(
HV
*
profile);
Point package_func2(
Struc
*
x, ...
);
The function
syntax
has
several
convenience
additions:
Methods
method void
a(
int
x)
for an
object
class
Object
is
reflected
in
C
as
Methods are
accessible
in
C
code
by
the
direct
name
dereferencing
of
a
"Handle
self"
as
a
corresponding
structure:
A method
can
have
one
of
six
prefixes
that
govern
C
code
generation:
Properties
property char
*
name
has C
counterpart
The syntax
for
multi-parameter
property
is
property long
pixel(
int
x,
int
y);
and C
code
Instance variables
int x;
List list;
struct int
x
s;
#
illegal
declaration
Variables are
accessible
in
C
code
by
direct
name
dereferencing
of
a
"Handle
self"
as
a
corresponding
structure:
Overview
Creates headers with C macros and structures for Prima core module object definitions.
Arguments
gencls accepts the following arguments:
- --h
-
Generates .h file ( with declarations to be included in one or more files )
- --inc
-
Generates .inc file ( with declarations to be included in only file )
- -O
-
Turns optimizing algorithm for .inc files on. Algorithm is based on an assumption, that some functions are declared identically, therefore the code piece that handles the parameter and result conversion can be shared. With
"-O"flag on, a thunk body is replaced to a call to a function, which name is made up from all method parameters plus result. Actual function is not written in .inc file, but in .tml file. All duplicate declarations from a set of .tml files can be removed and the reminder written to one file by tmlink utility.
- --tml
-
Generates .tml file. Turns
"-O"automatically on.
- -Idirname
-
Adds a directory to a search path, where the utility searches for .cls files. Can be specified several times.
- --depend
-
Prints out dependencies for a given file.
- --sayparent
-
Prints out the immediate parent of a class inside given file.
Releases
4 releases since Debian 5.0 (Lenny); the text changed 3 times.