This repository has been archived by the owner on Jan 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
iso-10303-14-raw.bnf
240 lines (238 loc) · 14.4 KB
/
iso-10303-14-raw.bnf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
;; N178 2002-03-22 (no numbers)
;; Added support for local var assignments in map select
DEPENDENT_MAP = 'dependent_map' .
EACH = 'each' .
ELSIF = 'elsif' .
END_DEPENDENT_MAP = 'end_dependent_map' .
END_MAP = 'end_map' .
END_SCHEMA_MAP = 'end_schema_map' .
END_SCHEMA_VIEW = 'end_schema_view' .
END_VIEW = 'end_view' .
EXTENT = 'extent' .
IDENTIFIED_BY = 'identified_by' .
INDEXING = 'indexing' .
MAP = 'map' .
ORDERED_BY = 'ordered_by' .
PARTITION = 'partition' .
SCHEMA_MAP = 'schema_map' .
SCHEMA_VIEW = 'schema_view' .
SOURCE = 'source' .
TARGET = 'target' .
VIEW = 'view' .
digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' .
letter = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' .
simple_id = letter { letter | digit | '_' } .
partition_ref = partition_id .
schema_map_ref = schema_map_id .
schema_view_ref = schema_view_id .
source_schema_ref = schema_ref .
target_schema_ref = schema_ref .
view_attribute_ref = view_attribute_id .
view_ref = view_id .
abstract_supertype_declaration = ABSTRACT SUPERTYPE [ subtype_constraint ] .
actual_parameter_list = '(' parameter { ',' parameter } ')' .
add_like_op = '+' | '-' | OR | XOR .
aggregate_initializer = '[' [ element { ',' element } ] ']' .
aggregate_source = simple_expression .
aggregate_type = AGGREGATE [ ':' type_label ] OF parameter_type .
aggregation_types = array_type | bag_type | list_type | set_type .
algorithm_head = { declaration } [ constant_decl ] [ local_decl ] .
array_type = ARRAY bound_spec OF [ OPTIONAL ] [ UNIQUE ] base_type .
assignment_stmt = general_ref { qualifier } ':=' expression ';' .
backward_path_qualifier = '<-' [ attribute_ref ] path_condition .
bag_type = BAG [ bound_spec ] OF base_type .
base_type = aggregation_types | simple_types | named_types .
binary_type = BINARY [ width_spec ] .
binding_header = [ PARTITION partition_id ';' ] [ from_clause ] [ local_decl ] [ where_clause ] [ identified_by_clause ] [ ordered_by_clause ] .
boolean_type = BOOLEAN .
bound_1 = numeric_expression .
bound_2 = numeric_expression .
bound_spec = '[' bound_1 ':' bound_2 ']' .
built_in_constant = CONST_E | PI | SELF | '?' .
built_in_function = ABS | ACOS | ASIN | ATAN | BLENGTH | COS | EXISTS | EXTENT | EXP | FORMAT | HIBOUND | HIINDEX | LENGTH | LOBOUND | LOINDEX | LOG | LOG2 | LOG10 | NVL | ODD | ROLESOF | SIN | SIZEOF | SQRT | TAN | TYPEOF | USEDIN | VALUE | VALUE_IN | VALUE_UNIQUE .
built_in_procedure = INSERT | REMOVE .
case_action = case_label { ',' case_label } ':' stmt .
case_expr = CASE selector OF { case_expr_action } [ OTHERWISE ':' expression ] END_CASE .
case_expr_action = case_label { ',' case_label } ':' expression ';' .
case_label = expression .
case_stmt = CASE selector OF { case_action } [ OTHERWISE ':' stmt ] END_CASE ';' .
compound_stmt = BEGIN stmt { stmt } END ';' .
constant_body = constant_id ':' base_type ':=' expression ';' .
constant_decl = CONSTANT constant_body { constant_body } END_CONSTANT ';' .
constant_factor = built_in_constant | constant_ref .
constant_id = simple_id .
declaration = function_decl | procedure_decl .
dependent_map_decl = DEPENDENT_MAP map_id AS target_parameter ';' { target_parameter ';' } [ map_subtype_of_clause ] dep_map_partition { dep_map_partition } END_DEPENDENT_MAP ';' .
dep_binding_decl = dep_from_clause [ where_clause ] [ ordered_by_clause ] .
dep_from_clause = FROM dep_source_parameter ';' { dep_source_parameter ';' } .
dep_map_decl_body = dep_binding_decl map_project_clause .
dep_map_partition = [ PARTITION partition_id ':' ] dep_map_decl_body .
dep_source_parameter = source_parameter_id { ',' source_parameter_id } ':' ( simple_types | type_reference ) .
domain_rule = [ label ':' ] logical_expression .
element = expression [ ':' repetition ] .
entity_constructor = entity_reference '(' [ expression { ',' expression } ] ')' .
entity_id = simple_id .
entity_instantiation_loop = FOR instantiation_loop_control ';' map_project_clause .
entity_reference = [ ( source_schema_ref | target_schema_ref | schema_ref ) '.' ] entity_ref .
enumeration_reference = [ type_reference '.' ] enumeration_ref .
escape_stmt = ESCAPE ';' .
expression = simple_expression [ rel_op_extended simple_expression ] .
expression_or_wild = expression | '_' .
extent_reference = source_entity_reference | view_reference .
factor = simple_factor [ '**' simple_factor ] .
foreach_expr = EACH variable_id IN expression [ where_clause ] RETURN expression .
forloop_expr = repeat_control RETURN expression .
formal_parameter = parameter_id { ',' parameter_id } ':' parameter_type .
forward_path_qualifier = '::' attribute_ref [ path_condition ] .
for_expr = FOR ( foreach_expr | forloop_expr ) .
from_clause = FROM source_parameter ';' { source_parameter ';' } .
function_call = ( built_in_function | function_ref ) [ actual_parameter_list ] .
function_decl = function_head [ algorithm_head ] stmt { stmt } END_FUNCTION ';' .
function_head = FUNCTION function_id [ '(' formal_parameter { ';' formal_parameter } ')' ] ':' parameter_type ';' .
function_id = simple_id .
generalized_types = aggregate_type | general_aggregation_types | generic_type .
general_aggregation_types = general_array_type | general_bag_type | general_list_type | general_set_type .
general_array_type = ARRAY [ bound_spec ] OF [ OPTIONAL ] [ UNIQUE ] parameter_type .
general_attribute_qualifier = '.' ( attribute_ref | view_attribute_ref ) .
general_bag_type = BAG [ bound_spec ] OF parameter_type .
general_list_type = LIST [ bound_spec ] OF [ UNIQUE ] parameter_type .
general_or_map_call = general_ref [ '@' map_call ] .
general_ref = parameter_ref | variable_ref .
general_schema_alias_id = schema_id | schema_map_id | schema_view_id .
general_schema_ref = schema_ref | schema_map_ref | schema_view_ref .
general_set_type = SET [ bound_spec ] OF parameter_type .
generic_type = GENERIC [ ':' type_label ] .
group_qualifier = '\' entity_ref .
identified_by_clause = IDENTIFIED_BY id_parameter ';' { id_parameter ';' } .
id_parameter = [ id_parameter_id ':' ] expression .
id_parameter_id = parameter_id .
if_expr = IF logical_expression THEN expression { ELSIF logical_expression expression } [ ELSE expression ] END_IF .
if_stmt = IF logical_expression THEN stmt { stmt } [ ELSE stmt { stmt } ] END_IF ';' .
increment = numeric_expression .
increment_control = variable_id ':=' bound_1 TO bound_2 [ BY increment ] .
index = numeric_expression .
index_1 = index .
index_2 = index .
index_qualifier = '[' index_1 [ ':' index_2 ] ']' .
instantiation_foreach_control = EACH variable_id IN source_attribute_reference INDEXING variable_id .
instantiation_loop_control = instantiation_foreach_control | repeat_control .
integer_type = INTEGER .
interval = '{' interval_low interval_op interval_item interval_op interval_high '}' .
interval_high = simple_expression .
interval_item = simple_expression .
interval_low = simple_expression .
interval_op = '<' | '<=' .
label = simple_id .
list_type = LIST [ bound_spec ] OF [ UNIQUE ] base_type .
literal = binary_literal | integer_literal | logical_literal | real_literal | string_literal .
local_decl = LOCAL local_variable { local_variable } END_LOCAL ';' .
local_variable = variable_id { ',' variable_id } ':' parameter_type [ ':=' expression ] ';' .
logical_expression = expression .
logical_literal = FALSE | TRUE | UNKNOWN .
logical_type = LOGICAL .
map_attribute_declaration = [ target_parameter_ref [ index_qualifier ] [ group_qualifier ] '.' ] attribute_ref [ index_qualifier ] ':=' expression ';' .
map_call = map_ref [ partition_qualification ] '(' expression_or_wild { ',' expression_or_wild } ')' .
map_decl = MAP map_id AS target_parameter ';' { target_parameter ';' } ( map_subtype_of_clause subtype_binding_header map_decl_body ) | ( binding_header map_decl_body { binding_header map_decl_body } ) END_MAP ';' .
map_decl_body = ( entity_instantiation_loop { entity_instantiation_loop } ) | map_project_clause | ( RETURN expression ';' ) .
map_id = simple_id .
map_local_assignment = variable_ref { ( '.' attribute_ref ) | group_qualifier | index_qualifier } ':=' expression ';' .
map_project_clause = SELECT map_select_item { map_select_item } .
map_ref = map_id .
map_reference = [ schema_map_ref '.' ] map_ref .
map_select_item = map_attribute_declaration | map_local_assignment .
map_subtype_of_clause = SUBTYPE OF '(' map_reference ')' ';' .
multiplication_like_op = '*' | '/' | DIV | MOD | AND | '||' .
named_types = entity_reference | type_reference | view_reference .
null_stmt = ';' .
number_type = NUMBER .
numeric_expression = simple_expression .
one_of = ONEOF '(' supertype_expression { ',' supertype_expression } ')' .
ordered_by_clause = ORDERED_BY expression { ',' expression } ';' .
parameter = expression .
parameter_id = simple_id .
parameter_type = generalized_types | named_types | simple_types .
partition_id = simple_id .
partition_qualification = '\' partition_ref .
path_condition = '{' extent_reference [ '|' logical_expression ] '}' .
path_qualifier = forward_path_qualifier | backward_path_qualifier .
population = entity_reference .
precision_spec = numeric_expression .
primary = literal | ( qualifiable_factor { qualifier } ) .
procedure_call_stmt = ( built_in_procedure | procedure_ref ) [ actual_parameter_list ] ';' .
procedure_decl = procedure_head [ algorithm_head ] { stmt } END_PROCEDURE ';' .
procedure_head = PROCEDURE procedure_id [ '(' [ VAR ] formal_parameter { ';' [ VAR ] formal_parameter } ')' ] ';' .
procedure_id = simple_id .
qualifiable_factor = attribute_ref | constant_factor | function_call | general_or_map_call | population | view_attribute_ref | view_call .
qualifier = general_attribute_qualifier | group_qualifier | index_qualifier | path_qualifier .
query_expression = QUERY '(' variable_id '<*' aggregate_source '|' logical_expression ')' .
real_type = REAL [ '(' precision_spec ')' ] .
reference_clause = REFERENCE FROM schema_ref_or_rename [ '(' resource_or_rename { ',' resource_or_rename } ')' ] [ AS ( SOURCE | TARGET ) ] ';' .
rel_op = '<' | '>' | '<=' | '>=' | '<>' | '=' | ':<>:' | ':=:' .
rel_op_extended = rel_op | IN | LIKE .
rename_id = constant_id | entity_id | function_id | procedure_id | type_id .
repeat_control = [ increment_control ] [ while_control ] [ until_control ] .
repeat_stmt = REPEAT repeat_control ';' stmt { stmt } END_REPEAT ';' .
repetition = numeric_expression .
resource_or_rename = resource_ref [ AS rename_id ] .
resource_ref = constant_ref | entity_ref | function_ref | procedure_ref | type_ref | view_ref | map_ref .
return_stmt = RETURN [ '(' expression ')' ] ';' .
rule_decl = rule_head [ algorithm_head ] { stmt } where_clause END_RULE ';' .
rule_head = RULE rule_id FOR '(' entity_ref { ',' entity_ref } ')' ';' .
rule_id = simple_id .
schema_id = simple_id .
schema_map_body_element = function_decl | procedure_decl | view_decl | map_decl | dependent_map_decl | rule_decl .
schema_map_body_element_list = schema_map_body_element { schema_map_body_element } .
schema_map_decl = SCHEMA_MAP schema_map_id ';' reference_clause { reference_clause } [ constant_decl ] schema_map_body_element_list END_SCHEMA_MAP ';' .
schema_map_id = simple_id .
schema_ref_or_rename = [ general_schema_alias_id ':' ] general_schema_ref .
schema_view_body_element = function_decl | procedure_decl | view_decl | rule_decl .
schema_view_body_element_list = schema_view_body_element { schema_view_body_element } .
schema_view_decl = SCHEMA_VIEW schema_view_id ';' { reference_clause } [ constant_decl ] schema_view_body_element_list END_SCHEMA_VIEW ';' .
schema_view_id = simple_id .
selector = expression .
set_type = SET [ bound_spec ] OF base_type .
simple_expression = term { add_like_op term } .
simple_factor = aggregate_initializer | entity_constructor | enumeration_reference | interval | query_expression | ( [ unary_op ] ( '(' expression ')' | primary ) ) | case_expr | for_expr | if_expr .
simple_types = binary_type | boolean_type | integer_type | logical_type | number_type | real_type | string_type .
skip_stmt = SKIP ';' .
source_attribute_reference = parameter_ref '.' ( attribute_ref | view_attribute_ref ) .
source_entity_reference = entity_reference .
source_parameter = source_parameter_id ':' extent_reference .
source_parameter_id = parameter_id .
stmt = assignment_stmt | case_stmt | compound_stmt | escape_stmt | if_stmt | null_stmt | procedure_call_stmt | repeat_stmt | return_stmt | skip_stmt .
string_literal = simple_string_literal | encoded_string_literal .
string_type = STRING [ width_spec ] .
subsuper = [ supertype_constraint ] [ subtype_declaration ] .
subtype_binding_header = [ PARTITION partition_id ';' ] where_clause .
subtype_constraint = OF '(' supertype_expression ')' .
subtype_declaration = SUBTYPE OF '(' view_ref { ',' view_ref } ')' .
supertype_constraint = abstract_supertype_declaration | supertype_rule .
supertype_expression = supertype_factor { ANDOR supertype_factor } .
supertype_factor = supertype_term { AND supertype_term } .
supertype_rule = SUPERTYPE [ subtype_constraint ] .
supertype_term = view_ref | one_of | '(' supertype_expression ')' .
syntax_x = schema_map_decl | schema_view_decl .
target_entity_reference = entity_reference { '&' entity_reference } .
target_parameter = target_parameter_id { ',' target_parameter_id } ':' [ AGGREGATE [ bound_spec ] OF ] target_entity_reference .
target_parameter_id = parameter_id .
target_parameter_ref = target_parameter_id .
term = factor { multiplication_like_op factor } .
type_id = simple_id .
type_label = type_label_id | type_label_ref .
type_label_id = simple_id .
type_reference = [ schema_ref '.' ] type_ref .
unary_op = '+' | '-' | NOT .
until_control = UNTIL logical_expression .
variable_id = simple_id .
view_attribute_decl = view_attribute_id ':' [ OPTIONAL ] [ source_schema_ref '.' ] base_type ':=' expression ';' .
view_attribute_id = simple_id .
view_attr_decl_stmt_list = view_attribute_decl { view_attribute_decl } .
view_call = view_reference [ partition_qualification ] '(' [ expression_or_wild { ',' expression_or_wild } ] ')' .
view_decl = VIEW view_id [ ':' base_type ] subsuper ';' ( subtype_binding_header view_project_clause { subtype_binding_header view_project_clause } ) | ( binding_header view_project_clause { binding_header view_project_clause } ) END_VIEW ';' .
view_id = simple_id .
view_project_clause = ( SELECT view_attr_decl_stmt_list ) | ( RETURN expression ) .
view_reference = [ ( schema_map_ref | schema_view_ref ) '.' ] view_ref .
where_clause = WHERE domain_rule ';' { domain_rule ';' } .
while_control = WHILE logical_expression .
width = numeric_expression .
width_spec = '(' width ')' [ FIXED ] .