DRAFT: Syntax of OO-Extension for VRML

(as of May 23 1997)


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.
<classdef> -> "CLASS" <name> "IMPLEMENTS" <name>* 
              "[" <property>* "]" 
              <classbody>

<classbody> -> "{" "}"
             | "{" <node> (<node>|<route>)* "}"
We need the first case for standard nodes. There we don't specify their implementation, but the interfaces they satisfy.
<classdef> -> "EXTERNCLASS" <name> "IMPLEMENTS" <name>* 
              "[" <if_property>* "]"  <url> 
<interfacedef> -> "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> 

<path> -> ("SELF"|"SUPER"|<definedname>| <functionname> "(" <path>* ")" ) 
          ("." <simplepath> ("[" <integer> "]"))* 

<simplepath> -> <fieldname>
              | <eventname>
              | <functionname> "(" <path>* ")" 

A path starts with a function call, SELF, SUPER or the name of a DEF'ed node. It is followed by fieldnames, eventnames or function calls. For field f which is of MF-type we can select the i-th element with f[i]. For example SELF.chidren[4].translation would be a valid path.
<route> -> "ROUTE" <path> "TO" <path>

<value> -> .... (all those values allowed in VRML 2.0)
         | "IS" <path>
Functions are defined with the keyword FUN and have to have an explicit result type:
<functiondef> -> "FUN" <typename> <functionname> 
                 "[" (<typename> <variablename>)* "]"
                 "{" (<typename> <variablename> ";")*
                     <functionbody>
                 "}"

<functionbody> -> ... (body of a JavaScript/VRMLScript function) 
 

This page is maintained by Stephan Diehl ( diehl@cs.uni-sb.de)
Last updated May 23 1997