Red Hat Web Application Framework 6.1 Manuale Utente

Pagina di 230
Appendix D.
PDL Syntax
This chapter introduces the syntax for the Persistence Definition Language.
D.1. PDL Grammar
The following is an Extended Backus-Naur Form (EBNF) grammar that defines the current PDL
language. EBNF is a standard notation for formally defining a language that extends BNF (they are
functionally equivalent -- EBNF simply introduces some elements for better readability).
In this grammar, items within angle braces
B
ITEM
C
are terminals (tokens), while
those not within angle brackets are non-terminals. If you are unfamiliar with EBNF,
http://www.garshol.priv.no/download/text/bnf.html is a good starting point.
/** Top level constructs. */
file :=
model <SEMI>
( pdl_import <SEMI> )*
( object_type | association | data_operation )*
<EOF>
model := <MODEL> idpath
pdl_import := <IMPORT> idpath ( <DOT> <STAR> )?
object_type :=
( <VERSIONED> )?
( <QUERY> | <OBJECTTYPE> ) id
( ( <EXTENDS> type |
<CLASS> javaClass <ADAPTER> javaClass |
<RETURNS> <INT> <DOT> <DOT> ( id | <INT> ) ) )?
<LBRACE> ( statement )* <RBRACE>
association :=
<ASSOCIATION> <LBRACE> property <SEMI> property <SEMI>
( property <SEMI> )*
( option_block )?
( event )* <RBRACE>
data_operation :=
<DATA_OPERATION> id <LBRACE> ( option_block )? sql_block <RBRACE>
/** First level constructs. */
statement := ( simple_statement <SEMI> | compound_statement )
simple_statement :=
( property_stmt | object_key | reference_key |
unique_key | aggressive_load | join_stmt )
compound_statement :=
( event | option_block )
/** Simple statements */
property_stmt := property