Difference between revisions of "Documentation/DevGuide/AppendixD/UNOIDL Syntax Specification"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (notice of intent to change.)
(fix errors in method-decl, interface-service-decl, accumulated-service-decl)
 
(One intermediate revision by one other user not shown)
Line 7: Line 7:
 
{{DISPLAYTITLE:Appendix D: UNOIDL Syntax Specification}}  
 
{{DISPLAYTITLE:Appendix D: UNOIDL Syntax Specification}}  
 
{{Download Collection|MediaWiki:Collections/Developer's Guide - UNOIDL Syntax Specification}}
 
{{Download Collection|MediaWiki:Collections/Developer's Guide - UNOIDL Syntax Specification}}
The following listing comprises the language specification for UNOIDL in pseudo [http://cui.unige.ch/db-research/Enseignement/analyseinfo/AboutBNF.html BNF notation].  Note, this specification is a bit out of date.  The changes are fairly minor, but I discovered discrepancies while implementing the grammar checking for NetBeans.
+
The following listing comprises the language specification for UNOIDL in pseudo [http://cui.unige.ch/db-research/Enseignement/analyseinfo/AboutBNF.html BNF notation].   
  
   idl-specification ::= declaration+
+
   idl-specification ::= declaration*
 
    
 
    
 
   declaration ::= enum-decl
 
   declaration ::= enum-decl
Line 45: Line 45:
 
   parametric-member-decl ::= identifier identifier ";"
 
   parametric-member-decl ::= identifier identifier ";"
 
    
 
    
   exception-decl ::= ["published"] "exception" identifier [single-inheritance] "{" struct-member-decl+ "}" ";"
+
   exception-decl ::= ["published"] "exception" identifier [single-inheritance] "{" struct-member-decl* "}" ";"
 
    
 
    
 
   interface-forward-decl ::= ["published"] "interface" identifier ";"
 
   interface-forward-decl ::= ["published"] "interface" identifier ";"
Line 69: Line 69:
 
   exception-spec ::= "raises" "(" name ("," name)* ")"
 
   exception-spec ::= "raises" "(" name ("," name)* ")"
 
    
 
    
   method-decl ::= ["[" "oneway" "]"] type identifier "(" [method-param ("," method-param)*] ")" [exception-spec]
+
   method-decl ::= ["[" "oneway" "]"] type identifier "(" [method-param ("," method-param)*] ")" [exception-spec] ";"
 
    
 
    
 
   method-param ::= "[" direction "]" type identifier
 
   method-param ::= "[" direction "]" type identifier
Line 81: Line 81:
 
   const-decl ::= "const" type identifier "=" expr ";"
 
   const-decl ::= "const" type identifier "=" expr ";"
 
    
 
    
   constants-decl ::= ["published"] "constants" identifier "{" const-decl+ "}" ";"
+
   constants-decl ::= ["published"] "constants" identifier "{" const-decl* "}" ";"
 
    
 
    
   module-decl ::= "module" identifier "{" declaration+ "}" ";"
+
   module-decl ::= "module" identifier "{" declaration* "}" ";"
 
    
 
    
 
   interface-service-decl ::= ["published"] "service" identifier ":" name ["{" constructor-decl* "}"] ";"
 
   interface-service-decl ::= ["published"] "service" identifier ":" name ["{" constructor-decl* "}"] ";"
 
    
 
    
   constructor-decl ::= identifier "(" [constructor-params] ")" [exception-spec]
+
   constructor-decl ::= identifier "(" [constructor-params] ")" [exception-spec] ";"
 
    
 
    
 
   constructor-params ::= rest-param | ctor-param ("," ctor-param)*
 
   constructor-params ::= rest-param | ctor-param ("," ctor-param)*
Line 95: Line 95:
 
   ctor-param ::= "[" "in" "]" type identifier
 
   ctor-param ::= "[" "in" "]" type identifier
 
    
 
    
   accumulated-service-decl ::= ["published"] "service" identifier ":" name"{" service-member-decl+ "}" ";"
+
   accumulated-service-decl ::= ["published"] "service" identifier "{" service-member-decl+ "}" ";"
 
    
 
    
 
   service-member-decl ::= service-inheritance-decl | interface-inheritance-decl | property-decl
 
   service-member-decl ::= service-inheritance-decl | interface-inheritance-decl | property-decl

Latest revision as of 10:09, 3 September 2013



PDF Icon.gif Download as a PDF or ODT


The following listing comprises the language specification for UNOIDL in pseudo BNF notation.

 idl-specification ::= declaration*
 
 declaration ::= enum-decl
              | plain-struct-decl
              | poly-struct-template-decl
              | exception-decl
              | interface-forward-decl
              | interface-decl
              | typedef-decl
              | constant-decl
              | constants-decl
              | module-decl
              | interface-service-decl
              | accumulated-service-decl
              | interface-singleton-decl
              | service-singleton-decl
 
 enum-decl ::= ["published"] "enum" identifier "{" enum-member-decl ("," enum-member-decl)* "}" ";"
 
 enum-member-decl ::= identifier ["=" expr]
 
 plain-struct-decl ::= ["published"] "struct" identifier [single-inheritance] "{" struct-member-decl+ "}" ";"
 
 single-inheritance ::= ":" name
 
 struct-member-decl ::= type identifier ";"
 
 poly-struct-template-decl ::= ["published"] "struct" identifier struct-params 
                              "{" poly-struct-member-decl+ "}" ";"
 
 struct-params ::= "<" identifier ("," identifier)* ">"
 
 poly-struct-member-decl ::= struct-member-decl | parametric-member-decl
 
 parametric-member-decl ::= identifier identifier ";"
 
 exception-decl ::= ["published"] "exception" identifier [single-inheritance] "{" struct-member-decl* "}" ";"
 
 interface-forward-decl ::= ["published"] "interface" identifier ";"
 
 interface-decl ::= ["published"] "interface" identifier [single-inheritance] "{" interface-member-decl* "}" ";"
 
 interface-member-decl ::= interface-inheritance-decl | attribute-decl | method-decl
 
 interface-inheritance-decl ::= ["[" "optional" "]"] "interface" name ";"
 
 attribute-decl ::= attribute-flags type identifier ["{" attribute-access-decl* "}"] ";"
 
 attribute-flags ::= "[" (attribute-flag ",")* "attribute" ("," attribute-flag)* "]"
 
 attribute-flag ::= "bound" | "readonly"
 
 attribute-access-decl ::= attribute-get-decl | attribute-set-decl
 
 attribute-get-decl ::= "get" exception-spec ";"
 
 attribute-set-decl ::= "set" exception-spec ";"
 
 exception-spec ::= "raises" "(" name ("," name)* ")"
 
 method-decl ::= ["[" "oneway" "]"] type identifier "(" [method-param ("," method-param)*] ")" [exception-spec] ";"
 
 method-param ::= "[" direction "]" type identifier
 
 direction ::= "in" | "out" | "inout"
 
 typedef-decl ::= ["published"] "typedef" type identifier ";"
 
 constant-decl ::= ["published"] const-decl
 
 const-decl ::= "const" type identifier "=" expr ";"
 
 constants-decl ::= ["published"] "constants" identifier "{" const-decl* "}" ";"
 
 module-decl ::= "module" identifier "{" declaration* "}" ";"
 
 interface-service-decl ::= ["published"] "service" identifier ":" name ["{" constructor-decl* "}"] ";"
 
 constructor-decl ::= identifier "(" [constructor-params] ")" [exception-spec] ";"
 
 constructor-params ::= rest-param | ctor-param ("," ctor-param)*
 
 rest-param ::= "[" "in" "]" "any" "..." identifier
 
 ctor-param ::= "[" "in" "]" type identifier
 
 accumulated-service-decl ::= ["published"] "service" identifier "{" service-member-decl+ "}" ";"
 
 service-member-decl ::= service-inheritance-decl | interface-inheritance-decl | property-decl
 
 service-inheritance-decl ::= ["[" "optional" "]"] "service" name ";"
 
 property-decl ::= property-flags type identifier ";"
 
 property-flags ::= "[" (property-flag ",")* "property" ("," property-flag)* "]"
 
 property-flag ::= "bound" | "constrained" | "maybeambiguous" | "maybedefault" | "maybevoid" | "optional" | "readonly" | "removable" | "transient"
 
 interface-singleton-decl ::= ["published"] "singleton" identifier ":" name ";"
 
 service-singleton-decl ::= ["published"] "singleton" identifier "{" "service" name ";" "}" ";"
 
 type ::= simple-type | sequence-type | poly-struct-type | name
 
 simple-type ::= "void" | "boolean" | "byte" | "short" | "unsigned" "short" | "long" | "unsigned" "long" | "hyper" | "unsigned" "hyper" | "float" | "double" | "char" | "string" | "type" | "any"
 
 sequence-type ::= "sequence" "<" type ">"
 
 poly-struct-type ::= name "<" type ("," type)* ">"
 
 expr ::= [expr "|"] xor-expr
 
 xor-expr ::= [xor-expr "^"] and-expr
 
 and-expr ::= [and-expr "&"] shift-expr
 
 shift-expr ::= [shift-expr shift-op] add-expr
 
 shift-op ::= "<<" | ">>"
 
 add-expr ::= [add-expr add-op] mult-expr
 
 add-op ::= "+" | "-"
 
 mult-expr ::= [mult-expr mult-op] unary-expr
 
 mult-op ::= "*" | "/" | "%"
 
 unary-expr ::= [unary-op] primary-expr
 
 unary-op ::= "+" | "-" | "~"
 
 primary-expr ::= name | literal | "(" expr ")"
 
 literal ::= boolean-literal | <INTEGER-LITERAL> | <FLOATING-POINT-LITERAL>
 
 boolean-literal ::= "False" | "FALSE" | "True" | "TRUE"
 
 name ::= ["::"] (identifier "::")* identifier
 
 identifier ::= <IDENTIFIER>
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages