Syntax

Stephan Diehl (diehl@cs.uni-sb.de)
Tue, 06 May 1997 17:44:03 +0200

Here is the a draft of the syntax I suggest for the OO-extensions.
This draft deals with classes, interfaces and paths. I hope the
yacc-like meta-notation is not too hard to read.

<class> -> CLASS <name> IMPLEMENTS <name>* [ <property>* ] { }
| <class> -> CLASS <name> IMPLEMENTS <name>* [ <property>* ]
{ <node> (<node>|<route>)* }

We need the first case for standard nodes. There we don't specify
their implementation, but the interfaces they satisfy. In the second
case the first element in the body of the class definition must
be a node. It's type will be the superclass of this class.

<interface> -> INTERFACE <name> EXTENDS <name>* [ <if_property>* ]

<property> -> eventIn <type> <name> (IS <name>)
| eventOut <type> <name> (IS <name>)
| field <name> <type> <value>
| exposedField <type> <name> <value>

<if_property> -> eventIn <type> <name>
| eventOut <type> <name>
| field <name> <type>
| exposedField <type> <name>

The latest contributions of Sungwoo and Jean-Francis on this
suggested paths to extend VRML. Here is the kind of "paths"
I would suggest as a compromise.
It is more powerful than what Sungwoo suggested, but less
expressive than general constraints. So it should be not too
hard to implement this extension:

<path> -> (SELF.|SUPER.|<name>.)
(<name>([<integer>]).)*(<name>([<integer>]))

<route> -> ROUTE <path> TO <path>

<value> -> ... (all VRML 2.0 values)
| <path>

A path starts with SELF, SUPER or the name of a DEF'ed node. It
is followed by at least one fieldname. For field f which is
of MF-type we can select the i-th element with f[i]. For
exampe SELF.children[4].translation would be a valid path.

The problem with MF-types is, if we do not specify a child
explicitly as above but just write
SELF.children.translation
Does this mean all translation fields of all elements in SELF.children.
This is possible if we put a value there, but not if
we use it, we would have to somehow combine the different
values (append,join,merge) and what about
SELF.children.children.translation (any suggestions ???)

Cheers
-- Stephan

---------------------------------------------------------------
Dr. Stephan Diehl Tel.: ++49-681/302-3915
EMAIL: diehl@cs.uni-sb.de WWW: http://www.rw.cdl.uni-saarland.de/private/diehl
---------------------------------------------------------------
There is no place like $HOME
---------------------------------------------------------------