source: default/trunk/de.ugoe.cs.swe.bnftools.ebnf.samples/trunk/tplan/tplan-v1.2.1.bnf @ 5

Last change on this file since 5 was 5, checked in by zeiss, 14 years ago
File size: 7.1 KB
Line 
1grammar tplan/bnf;
2
3// BNF grammar for TSS & TP language (TPLan)
4// Version: 2.6
5// Date: 08.10.2007
6// Author: ETSI CTI
7// TSS header
8tss_header ::= KWD_tss DELIM ext_tss_id [ tss_title ] [ tss_version ] [ tss_date ] [ tss_author ] [ { user_tss_header } ] tss_body;
9tss_title ::= KWD_title DELIM qstring;
10tss_version ::= KWD_version DELIM numeric [ { DOT numeric } ];
11tss_date ::= KWD_date DELIM '[0-9][0-9]' DOT '[0-9][0-9]' DOT '[0-9][0-9][0-9][0-9]' | '[0-9][0-9]' F_SLASH '[0-9][0-9]' F_SLASH '[0-9][0-9][0-9][0-9]' | '[0-9][0-9]' DASH '[0-9][0-9]' DASH '[0-9][0-9][0-9][0-9]';
12tss_author ::= KWD_author DELIM qstring;
13user_tss_header ::= { header_id | TSS_header_KWDS } DELIM ( user_header_list | qstring );
14user_header_list ::= extended_id [ { SEPARATOR extended_id } ];
15
16// TSS body
17tss_body ::= [ { xrefs } ] [ { definitions } ] { group | tp };
18
19// References and definitions
20xrefs ::= KWD_xref ext_xref_id L_BRACE extended_id [ { SEPARATOR extended_id } ] R_BRACE;
21definitions ::= KWD_def ( define_word | define_header | define_event | define_entity | define_unit | define_value | define_condition | define_context ) [ qstring ] | includes;
22includes ::= "#include" qstring;
23define_word ::= KWD_word word_id [ { SEPARATOR word_id } ];
24define_header ::= KWD_header header_id [ { SEPARATOR header_id } ];
25define_event ::= KWD_event event_id [ field_list ] [ { SEPARATOR event_id [ field_list ] } ];
26field_list ::= L_BRACE field_id | value_id [ { SEPARATOR field_id | value_id } ] R_BRACE;
27
28// STATIC SEMANTICS 1: field_id shall be unique in the field list
29define_entity ::= KWD_entity entity_id [ { SEPARATOR entity_id } ];
30define_unit ::= KWD_unit unit_id [ { SEPARATOR unit_id } ];
31define_value ::= KWD_value value_id [ field_list ] [ { SEPARATOR value_id [ field_list ] } ];
32define_condition ::= KWD_condition condition_id [ { SEPARATOR condition_id } ];
33define_context ::= KWD_context L_BRACE { context } R_BRACE;
34context ::= [ L_BRACKET ] context_id [ R_BRACKET ];
35
36// STATIC SEMANTICS 2: If used, each and every L_BRACKET shall be paired with a corresponding
37// Grouping
38group ::= group_header [ group_objective ] [ { group | tp } ] [ group_num ] [ qstring ]
39group_header ::= KWD_group [ group_num ] [ qstring ];
40group_objective ::= KWD_objective DELIM [ qstring ];
41tp ::= ( tp_header tp_body ) | includes;
42
43// TP Header
44tp_header ::= tp_identifier [ summary ] [ req_ref ] [ role ] [ config_ref ] [ tc_or_td_ref ] [ { user_tp_header } ];
45tp_identifier ::= KWD_TP KWD_id DELIM ext_TP_id;
46summary ::= KWD_tp_summary DELIM [ qstring ];
47req_ref ::= KWD_req KWD_ref DELIM [ cat_ref_list ];
48role ::= KWD_role DELIM [ role_ref_list ];
49config_ref ::= KWD_config DELIM [ ext_CF_id ];
50tc_or_td_ref ::= tc_ref | td_ref;
51tc_ref ::= KWD_TC KWD_ref DELIM ext_TC_id;
52td_ref ::= KWD_TD KWD_ref DELIM ext_TD_id;
53cat_ref_list ::= ext_RQ_id [ { SEPARATOR ext_RQ_id } ];
54role_ref_list ::= role_id [ { SEPARATOR role_id } ];
55user_tp_header ::= { TPLan_Hid | TP_header_KWDS } DELIM ( user_header_list | qstring );
56
57// TP body
58tp_body ::= [ preconditions ] KWD_ensure KWD_that begin_tp { [ stimuli ] responses } end_tp;
59preconditions ::= KWD_precondition begin_conditions [ precondition [ { KWD_logical precondition } ] ] end_conditions;
60precondition ::= [ test_object ] mixed_text;
61stimuli ::= KWD_stimulus begin_stimuli [ stimulus [ { KWD_logical stimulus } ] ] end_stimuli;
62stimulus ::= [ test_object ] mixed_text;
63responses ::= KWD_response begin_responses [ response [ { KWD_logical response } ] ] end_responses;
64response ::= [ test_object ] mixed_text;
65TPLan_word ::= predefined_words | num_id | TPLan_id;
66test_object ::= TPLan_Eid | KWD_IUT | KWD_TESTER;
67mixed_text ::= TPLan_word | qstring | ( mixed_text mixed_text ) | ( L_PAREN mixed_text R_PAREN );
68
69// TPLan identifiers
70// STATIC SEMANTICS 2: no identifier of any kind shall be the same as any   
71// other predefined or user-defined TPLan keyword or identifier
72// TSS and TP related identifiers
73ext_tss_id ::= extended_id;
74ext_xref_id ::= extended_id;
75ext_RQ_id ::= extended_id;
76ext_CF_id ::= extended_id;
77ext_TC_id ::= extended_id;
78ext_TD_id ::= extended_id;
79ext_TP_id ::= extended_id;
80role_id ::= extended_id;
81
82// Header identifiers
83header_id ::= extended_id;
84TPLan_Hid ::= extended_id;
85
86// Test entity identifiers
87entity_id ::= extended_id;
88TPLan_Eid ::= extended_id;
89
90// Event (Message) and field identifiers)
91field_id ::= extended_id;
92event_id ::= extended_id;
93
94// Unit identifiers
95value_id ::= extended_id;
96
97// Value identifiers
98unit_id ::= extended_id;
99
100// Word identifiers
101word_id ::= extended_id;
102TPLan_id ::= extended_id;
103
104// Condition identifiers
105condition_id ::= extended_id;
106extended_id ::= '[a-zA-Z0-9|._&%$*@%?></\#!-]+';
107context_id ::= [ "~" ] extended_id
108
109// Numbering
110group_num ::= numeric [ { DOT numeric } ];
111numeric ::= '[0-9]+';
112num_id ::= '[0-9.eE]+';
113
114// STATIC SEMANTICS 3: Table 1 of this present document shows alternative forms of 
115// case sensitivity for the TPLan keywords. 
116// For simplicity the keywords shown in this BNF correspond to the 
117// left-hand column of Table 1. The alternatives in column 2 are assumed.
118// TSS header keywords
119TSS_header_KWDS ::= KWD_author | KWD_date | KWD_title | KWD_tss | KWD_version;
120KWD_author ::= "author";
121KWD_date ::= "date";
122KWD_title ::= "title";
123KWD_tss ::= "TSS";
124KWD_version ::= "version";
125
126// Reference and definition keywords
127KWD_xref ::= "xref";
128KWD_condition ::= "condition";
129KWD_context ::= "context";
130KWD_def ::= "def";
131KWD_entity ::= "entity";
132KWD_event ::= "event";
133KWD_header ::= "header";
134KWD_value ::= "value";
135KWD_unit ::= "unit";
136KWD_word ::= "word";
137
138// Group keywords
139KWD_end ::= "end";
140KWD_group ::= "group";
141KWD_objective ::= "objective";
142
143//TP header keywords
144TP_header_KWDS ::= KWD_config | KWD_id | KWD_ref | KWD_role | KWD_req | KWD_tp_summary | KWD_TC | KWD_TD | KWD_TP;
145KWD_config ::= "config";
146KWD_id ::= "id";
147KWD_ref ::= "ref";
148KWD_role ::= "role";
149KWD_req ::= "RQ";
150KWD_tp_summary ::= "summary";
151KWD_TC ::= "TC";
152KWD_TD ::= "TD";
153KWD_TP ::= "TP";
154
155//TP body (structure) keywords
156KWD_ensure ::= "ensure";
157KWD_that ::= "that";
158KWD_response ::= "then";
159KWD_stimulus ::= "when";
160KWD_precondition ::= "with";
161KWD_logical ::= "and" | "or" | "and not" | "or not";
162
163//Test entity keywords
164KWD_IUT ::= "IUT";
165KWD_TESTER ::= "TESTER";
166
167//Predefined words
168predefined_words ::=
169
170// glue words
171"a" | "an" | "as" | "in" | "is" | "no" | "of" | "the"
172
173// logical words
174| "and" | "not" | "or"
175
176// stimulus and response words
177| "receives" | "sends"
178
179// data-related words
180| "containing" | "indicating"
181
182//direction words
183| "from" | "to"
184
185// time- or order-related words
186| "after" | "before" | "unorderd" | "within";
187
188// Begin/End symbols
189begin_stimuli ::= L_BRACE;
190end_stimuli ::= R_BRACE;
191begin_conditions ::= L_BRACE;
192end_conditions ::= R_BRACE;
193begin_responses ::= L_BRACE;
194end_responses ::= R_BRACE;
195begin_tp ::= L_BRACE;
196end_tp ::= R_BRACE;
197
198// Delimiters, separators etc.
199DASH ::= "-";
200DELIM ::= ":";
201DOT ::= ".";
202F_SLASH ::= "/";
203L_BRACE ::= "{";
204R_BRACE ::= "}";
205L_BRACKET ::= "[";
206R_BRACKET ::= "]";
207L_PAREN ::= "(";
208R_PAREN ::= ")";
209LT ::= "<";
210RT ::= ">";
211SEPARATOR ::= ",";
212U_SCORE ::= "_";
213qstring ::= //"'" *("'") "'"; // meaning unclear
214
Note: See TracBrowser for help on using the repository browser.