Extended C Syntax


This syntax is an extension of the Standard C syntax and uses the same notation as the C Standard. Symbols are shown in italics, and those defined in the C Standard are also shown in bold face. Undefined terminals are shown in typewriter face.

external-declaration:
function-definition
declaration
class-declaration
method-implementation
class-definition

class-declaration:
class-methods-declaration class-members-declaration

class-methods-declaration:
DCL_METHODS ( Class—name , base—name , constructor—parameters ) method—listopt END_METHODS

constructor-parameters:
method-parameters

method-list:
method-declaration method-listopt

method-declaration:
DCL_METHOD ( method-name , method-parameters , method-return-type )
DCL_ABSTRACT ( method-name , method-parameters , method-return-type )
REDCL_METHOD ( method-name , method-parameters , method-return-type )

class-members-declaration:
DCL_MEMBERS ( class-name , base-name ) member-listopt END_MEMBERS

member-list:
struct-declaration-list

method-implementation:
METHOD (method-specififier) method-body END_METHOD
CONSTRUCTOR ( class-name , method-parameters ) constructor-body END_CONSTRUCTOR
DESTRUCTOR ( class-name ) method-body END_DESTRUCTOR

method-specififier:
class-name , method-name , method-parameters , method-return-type

method-parameters:
( parameter-type-list )

method-return-type:
declaration-specifiersopt

constructor-body:
CONSTRUCT ( base-name , constructor-arguments ) method-body

method-body:
declaration-listopt statement-listopt

class-definition:
DEF_CLASS ( class-name , base-name ) method-definition-list END_CLASS

method-definition-list:
method-definition
method-definition method-definition-list

method-definition:
DEF_METHOD ( base-name , method-name );
DEF_ABSTRACT ( base-name , method-name );
REOEF_METHOD ( base-name , class-name , method-name );

declaration:
declaration-specifiers init-declarator-listopt
PUSH ( object-pointer, class-name , constructor-arguments );

primary-expression:
identifier
constant
string
( expression )
USE ( class-name )
SEND ( object-pointer , base-name , method-name , method-arguments )
CALL ( object-pointer , class-name , base-name , method-name , method-arguments )
NEW ( class-name , constructor-arguments )
DELETE ( object-pointer )
POP ( object-pointer )
IS_A ( object-pointer , class-name )
CLASS_NAME ( object-pointer )

constructor-arguments:
method-arguments

method-arguments:
( argument-expression-list )

base-name:
class-name
Object

class-name:
identifier

object-pointer:
identifier

method-name:
identifier