1 | grammar 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
|
---|
8 | tss_header ::= KWD_tss DELIM ext_tss_id [ tss_title ] [ tss_version ] [ tss_date ] [ tss_author ] [ { user_tss_header } ] tss_body; |
---|
9 | tss_title ::= KWD_title DELIM qstring; |
---|
10 | tss_version ::= KWD_version DELIM numeric [ { DOT numeric } ]; |
---|
11 | tss_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]'; |
---|
12 | tss_author ::= KWD_author DELIM qstring; |
---|
13 | user_tss_header ::= { header_id | TSS_header_KWDS } DELIM ( user_header_list | qstring ); |
---|
14 | user_header_list ::= extended_id [ { SEPARATOR extended_id } ]; |
---|
15 | |
---|
16 | // TSS body
|
---|
17 | tss_body ::= [ { xrefs } ] [ { definitions } ] { group | tp }; |
---|
18 | |
---|
19 | // References and definitions
|
---|
20 | xrefs ::= KWD_xref ext_xref_id L_BRACE extended_id [ { SEPARATOR extended_id } ] R_BRACE; |
---|
21 | definitions ::= KWD_def ( define_word | define_header | define_event | define_entity | define_unit | define_value | define_condition | define_context ) [ qstring ] | includes; |
---|
22 | includes ::= "#include" qstring; |
---|
23 | define_word ::= KWD_word word_id [ { SEPARATOR word_id } ]; |
---|
24 | define_header ::= KWD_header header_id [ { SEPARATOR header_id } ]; |
---|
25 | define_event ::= KWD_event event_id [ field_list ] [ { SEPARATOR event_id [ field_list ] } ]; |
---|
26 | field_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
|
---|
29 | define_entity ::= KWD_entity entity_id [ { SEPARATOR entity_id } ]; |
---|
30 | define_unit ::= KWD_unit unit_id [ { SEPARATOR unit_id } ]; |
---|
31 | define_value ::= KWD_value value_id [ field_list ] [ { SEPARATOR value_id [ field_list ] } ]; |
---|
32 | define_condition ::= KWD_condition condition_id [ { SEPARATOR condition_id } ]; |
---|
33 | define_context ::= KWD_context L_BRACE { context } R_BRACE; |
---|
34 | context ::= [ 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
|
---|
38 | group ::= group_header [ group_objective ] [ { group | tp } ] [ group_num ] [ qstring ] |
---|
39 | group_header ::= KWD_group [ group_num ] [ qstring ]; |
---|
40 | group_objective ::= KWD_objective DELIM [ qstring ]; |
---|
41 | tp ::= ( tp_header tp_body ) | includes; |
---|
42 | |
---|
43 | // TP Header
|
---|
44 | tp_header ::= tp_identifier [ summary ] [ req_ref ] [ role ] [ config_ref ] [ tc_or_td_ref ] [ { user_tp_header } ]; |
---|
45 | tp_identifier ::= KWD_TP KWD_id DELIM ext_TP_id; |
---|
46 | summary ::= KWD_tp_summary DELIM [ qstring ]; |
---|
47 | req_ref ::= KWD_req KWD_ref DELIM [ cat_ref_list ]; |
---|
48 | role ::= KWD_role DELIM [ role_ref_list ]; |
---|
49 | config_ref ::= KWD_config DELIM [ ext_CF_id ]; |
---|
50 | tc_or_td_ref ::= tc_ref | td_ref; |
---|
51 | tc_ref ::= KWD_TC KWD_ref DELIM ext_TC_id; |
---|
52 | td_ref ::= KWD_TD KWD_ref DELIM ext_TD_id; |
---|
53 | cat_ref_list ::= ext_RQ_id [ { SEPARATOR ext_RQ_id } ]; |
---|
54 | role_ref_list ::= role_id [ { SEPARATOR role_id } ]; |
---|
55 | user_tp_header ::= { TPLan_Hid | TP_header_KWDS } DELIM ( user_header_list | qstring ); |
---|
56 | |
---|
57 | // TP body
|
---|
58 | tp_body ::= [ preconditions ] KWD_ensure KWD_that begin_tp { [ stimuli ] responses } end_tp; |
---|
59 | preconditions ::= KWD_precondition begin_conditions [ precondition [ { KWD_logical precondition } ] ] end_conditions; |
---|
60 | precondition ::= [ test_object ] mixed_text; |
---|
61 | stimuli ::= KWD_stimulus begin_stimuli [ stimulus [ { KWD_logical stimulus } ] ] end_stimuli; |
---|
62 | stimulus ::= [ test_object ] mixed_text; |
---|
63 | responses ::= KWD_response begin_responses [ response [ { KWD_logical response } ] ] end_responses; |
---|
64 | response ::= [ test_object ] mixed_text; |
---|
65 | TPLan_word ::= predefined_words | num_id | TPLan_id; |
---|
66 | test_object ::= TPLan_Eid | KWD_IUT | KWD_TESTER; |
---|
67 | mixed_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
|
---|
73 | ext_tss_id ::= extended_id; |
---|
74 | ext_xref_id ::= extended_id; |
---|
75 | ext_RQ_id ::= extended_id; |
---|
76 | ext_CF_id ::= extended_id; |
---|
77 | ext_TC_id ::= extended_id; |
---|
78 | ext_TD_id ::= extended_id; |
---|
79 | ext_TP_id ::= extended_id; |
---|
80 | role_id ::= extended_id; |
---|
81 | |
---|
82 | // Header identifiers
|
---|
83 | header_id ::= extended_id; |
---|
84 | TPLan_Hid ::= extended_id; |
---|
85 | |
---|
86 | // Test entity identifiers
|
---|
87 | entity_id ::= extended_id; |
---|
88 | TPLan_Eid ::= extended_id; |
---|
89 | |
---|
90 | // Event (Message) and field identifiers)
|
---|
91 | field_id ::= extended_id; |
---|
92 | event_id ::= extended_id; |
---|
93 | |
---|
94 | // Unit identifiers
|
---|
95 | value_id ::= extended_id; |
---|
96 | |
---|
97 | // Value identifiers
|
---|
98 | unit_id ::= extended_id; |
---|
99 | |
---|
100 | // Word identifiers
|
---|
101 | word_id ::= extended_id; |
---|
102 | TPLan_id ::= extended_id; |
---|
103 | |
---|
104 | // Condition identifiers
|
---|
105 | condition_id ::= extended_id; |
---|
106 | extended_id ::= '[a-zA-Z0-9|._&%$*@%?></\#!-]+'; |
---|
107 | context_id ::= [ "~" ] extended_id |
---|
108 | |
---|
109 | // Numbering
|
---|
110 | group_num ::= numeric [ { DOT numeric } ]; |
---|
111 | numeric ::= '[0-9]+'; |
---|
112 | num_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
|
---|
119 | TSS_header_KWDS ::= KWD_author | KWD_date | KWD_title | KWD_tss | KWD_version; |
---|
120 | KWD_author ::= "author"; |
---|
121 | KWD_date ::= "date"; |
---|
122 | KWD_title ::= "title"; |
---|
123 | KWD_tss ::= "TSS"; |
---|
124 | KWD_version ::= "version"; |
---|
125 | |
---|
126 | // Reference and definition keywords
|
---|
127 | KWD_xref ::= "xref"; |
---|
128 | KWD_condition ::= "condition"; |
---|
129 | KWD_context ::= "context"; |
---|
130 | KWD_def ::= "def"; |
---|
131 | KWD_entity ::= "entity"; |
---|
132 | KWD_event ::= "event"; |
---|
133 | KWD_header ::= "header"; |
---|
134 | KWD_value ::= "value"; |
---|
135 | KWD_unit ::= "unit"; |
---|
136 | KWD_word ::= "word"; |
---|
137 | |
---|
138 | // Group keywords
|
---|
139 | KWD_end ::= "end"; |
---|
140 | KWD_group ::= "group"; |
---|
141 | KWD_objective ::= "objective"; |
---|
142 | |
---|
143 | //TP header keywords
|
---|
144 | TP_header_KWDS ::= KWD_config | KWD_id | KWD_ref | KWD_role | KWD_req | KWD_tp_summary | KWD_TC | KWD_TD | KWD_TP; |
---|
145 | KWD_config ::= "config"; |
---|
146 | KWD_id ::= "id"; |
---|
147 | KWD_ref ::= "ref"; |
---|
148 | KWD_role ::= "role"; |
---|
149 | KWD_req ::= "RQ"; |
---|
150 | KWD_tp_summary ::= "summary"; |
---|
151 | KWD_TC ::= "TC"; |
---|
152 | KWD_TD ::= "TD"; |
---|
153 | KWD_TP ::= "TP"; |
---|
154 | |
---|
155 | //TP body (structure) keywords
|
---|
156 | KWD_ensure ::= "ensure"; |
---|
157 | KWD_that ::= "that"; |
---|
158 | KWD_response ::= "then"; |
---|
159 | KWD_stimulus ::= "when"; |
---|
160 | KWD_precondition ::= "with"; |
---|
161 | KWD_logical ::= "and" | "or" | "and not" | "or not"; |
---|
162 | |
---|
163 | //Test entity keywords
|
---|
164 | KWD_IUT ::= "IUT"; |
---|
165 | KWD_TESTER ::= "TESTER"; |
---|
166 | |
---|
167 | //Predefined words
|
---|
168 | predefined_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
|
---|
189 | begin_stimuli ::= L_BRACE; |
---|
190 | end_stimuli ::= R_BRACE; |
---|
191 | begin_conditions ::= L_BRACE; |
---|
192 | end_conditions ::= R_BRACE; |
---|
193 | begin_responses ::= L_BRACE; |
---|
194 | end_responses ::= R_BRACE; |
---|
195 | begin_tp ::= L_BRACE; |
---|
196 | end_tp ::= R_BRACE; |
---|
197 | |
---|
198 | // Delimiters, separators etc.
|
---|
199 | DASH ::= "-"; |
---|
200 | DELIM ::= ":"; |
---|
201 | DOT ::= "."; |
---|
202 | F_SLASH ::= "/"; |
---|
203 | L_BRACE ::= "{"; |
---|
204 | R_BRACE ::= "}"; |
---|
205 | L_BRACKET ::= "["; |
---|
206 | R_BRACKET ::= "]"; |
---|
207 | L_PAREN ::= "("; |
---|
208 | R_PAREN ::= ")"; |
---|
209 | LT ::= "<"; |
---|
210 | RT ::= ">"; |
---|
211 | SEPARATOR ::= ","; |
---|
212 | U_SCORE ::= "_"; |
---|
213 | qstring ::= //"'" *("'") "'"; // meaning unclear
|
---|
214 |
|
---|