Guest User

Untitled

a guest
Oct 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.64 KB | None | 0 0
  1. {
  2. parserClass="org.nihlus.lace.language.parser.AdaParser"
  3.  
  4. extends="com.intellij.extapi.psi.ASTWrapperPsiElement"
  5.  
  6. psiClassPrefix="Ada"
  7. psiImplClassSuffix="Impl"
  8. psiPackage="org.nihlus.lace.language.psi"
  9. psiImplPackage="org.nihlus.lace.language.psi.Implementation"
  10.  
  11. elementTypeHolderClass="org.nihlus.lace.language.psi.AdaTypes"
  12. elementTypeClass="org.nihlus.lace.language.psi.AdaElementType"
  13. tokenTypeClass="org.nihlus.lace.language.psi.AdaTokenType"
  14.  
  15. tokens =
  16. [
  17. space = 'regexp:\s+'
  18. comment = 'regexp:--.*'
  19.  
  20. NLS ='regexp:[ \t\f]*(\r|\n|\r\n)((\r|\n|\r\n)|([ \t\f])*)*'
  21. LF = 'regexp:(\r|\n|\r\n)+'
  22.  
  23. // Keywords
  24. keyword_separate="separate"
  25. keyword_with="with"
  26. keyword_use="use"
  27. keyword_type="type"
  28. keyword_private="private"
  29. keyword_package="package"
  30. keyword_renames="renames"
  31. keyword_generic="generic"
  32. keyword_procedure="procedure"
  33. keyword_function="function"
  34. keyword_is="is"
  35. keyword_begin="begin"
  36. keyword_end="end"
  37. keyword_keyword_body="body"
  38. keyword_task="task"
  39. keyword_protected="protected"
  40. keyword_entry="entry"
  41. keyword_for="for"
  42. keyword_when="when"
  43. keyword_exception="exception"
  44. keyword_others="others"
  45. keyword_if="if"
  46. keyword_then="then"
  47. keyword_elsif="elsif"
  48. keyword_else="else"
  49. keyword_case="case"
  50. keyword_while="while"
  51. keyword_in="in"
  52. keyword_reverse="reverse"
  53. keyword_loop="loop"
  54. keyword_declare="declare"
  55. keyword_accept="accept"
  56. keyword_do="do"
  57. keyword_select="select"
  58. keyword_or="or"
  59. keyword_abort="abort"
  60. keyword_terminate="terminate"
  61. keyword_null="null"
  62. keyword_exit="exit"
  63. keyword_goto="goto"
  64. keyword_return="return"
  65. keyword_requeue="requeue"
  66. keyword_delay="delay"
  67. keyword_until="until"
  68. keyword_raise="raise"
  69. keyword_new="new"
  70. keyword_abstract="abstract"
  71. keyword_tagged="tagged"
  72. keyword_limited="limited"
  73. keyword_range="range"
  74. keyword_mod="mod"
  75. keyword_digits="digits"
  76. keyword_delta="delta"
  77. keyword_constant="constant"
  78. keyword_subtype="subtype"
  79. keyword_aliased="aliased"
  80. keyword_at="at"
  81. keyword_record="record"
  82. keyword_access="access"
  83. keyword_all="all"
  84. keyword_array="array"
  85. keyword_of="of"
  86. keyword_out="out"
  87.  
  88. and="and"
  89. xor="xor"
  90. not="not"
  91. rem="rem"
  92. abs="abs"
  93.  
  94. equals="="
  95. comma=","
  96. semicolon=";"
  97. fat_arrow="=>"
  98. colon=":"
  99. pipe="|"
  100. dot="."
  101. left_shift="<<"
  102. right_shift=">>"
  103. left_right_pointy_brackets="<>"
  104. assignment=":="
  105. single_quote="'"
  106. dotdot=".."
  107. not_equals="/="
  108. less_than="<"
  109. less_than_or_equal="<="
  110. greater_than=">"
  111. greater_than_or_equal=">="
  112. plus="+"
  113. minus="-"
  114. ampersand="&"
  115. asterisk="*"
  116. division="/"
  117. power="**"
  118. pound="#"
  119. underscore="_"
  120.  
  121. SQBR_L='['
  122. SQBR_R=']'
  123.  
  124. LP='('
  125. RP=')'
  126.  
  127. builtin_attribute_range="Range"
  128. builtin_attribute_access="Access"
  129. builtin_attribute_delta="Delta"
  130. builtin_attribute_digits="Digits"
  131.  
  132. digit = "regexp:\d"
  133. number = "regexp:\d+"
  134. hex_number = "regexp:[a-f0-9]+"
  135. identifier = "regexp:[_a-zA-Z][a-zA-Z0-9_]+"
  136.  
  137. string_literal = 'regexp:".*"'
  138. character_literal = "regexp:'[a-zA-Z ]'"
  139. ]
  140. }
  141.  
  142. compilation_unit ::= context_clause (library_item | subunit)
  143.  
  144. subunit ::= 'separate' "(" parent_unit_name ")" proper_body
  145.  
  146. context_clause ::= { (with_clause | use_clause) }
  147. with_clause ::= 'with' library_unit_name { ',' library_unit_name } ';'
  148. use_clause ::= 'use' ((package_name { ',' package_name }) | ('type' subtype_mark { ',' subtype_mark })) ';'
  149.  
  150. library_item ::= [ 'private' ] library_unit_declaration | library_unit_body | [ 'private' ] library_unit_renaming_declaration
  151. library_unit_renaming_declaration ::= package_renaming_declaration | generic_renaming_declaration | subprogram_renaming_declaration
  152. package_renaming_declaration ::= 'package' defining_program_unit_name 'renames' element_name ';'
  153. generic_renaming_declaration ::= 'generic' ( 'package' | 'procedure' | 'function' ) defining_program_unit_name 'renames' element_name ';'
  154. subprogram_renaming_declaration ::= subprogram_specification 'renames' element_name ';'
  155. library_unit_body ::= subprogram_body | package_body
  156. subprogram_body ::= subprogram_specification 'is' declarative_part 'begin' handled_sequence_of_statements 'end' [ designator ] ';'
  157. designator ::= [ parent_unit_name '.' ] ( identifier | operator_symbol )
  158. declarative_part ::= { (basic_declarative_item | body ) }
  159. body ::= proper_body | body_stub
  160. body_stub ::= subprogram_body_stub | package_body_stub | task_body_stub | protected_body_stub
  161. subprogram_body_stub ::= subprogram_specification 'is' 'separate' ';'
  162. package_body_stub ::= 'package' 'body' defining_identifier 'is' 'separate' ';'
  163. task_body_stub ::= 'task' 'body' defining_identifier 'is' 'separate' ';'
  164. protected_body_stub ::= 'protected' 'body' defining_identifier 'is' 'separate' ';'
  165. proper_body ::= subprogram_body | package_body | task_body | protected_body
  166. task_body ::= 'task' 'body' defining_identifier 'is' declarative_part 'begin' handled_sequence_of_statements 'end' [ task_identifier ] ';'
  167. protected_body ::= 'protected' 'body' defining_identifier 'is' { protected_operation_item } 'end' [ protected_identifier ] ';'
  168. protected_operation_item ::= subprogram_declaration | subprogram_body | entry_body | representation_clause
  169. entry_body ::= 'entry' defining_identifier entry_body_formal_part entry_barrier 'is' declarative_part 'begin' handled_sequence_of_statements 'end' [ entry_identifier ] ';'
  170. entry_body_formal_part ::= [ "(" entry_index_specification ")" ] parameter_profile
  171. entry_index_specification ::= 'for' defining_identifier 'in' discrete_subtype_definition
  172. entry_barrier ::= 'when' condition
  173. package_body ::= 'package' 'body' defining_program_unit_name 'is' declarative_part [ 'begin' handled_sequence_of_statements ] 'end' [ [ parent_unit_name '.' ] identifier ] ';'
  174. handled_sequence_of_statements ::= sequence_of_statements [ 'exception' exception_handler { exception_handler } ]
  175. exception_handler ::= 'when' [ choice_parameter_specification ':' ] exception_choice { '|' exception_choice } '=>' sequence_of_statements
  176. choice_parameter_specification ::= defining_identifier
  177. exception_choice ::= exception_name | 'others'
  178. sequence_of_statements ::= statement { statement }
  179. statement ::= { label } ( simple_statement | compound_statement )
  180. compound_statement ::= if_statement |
  181. case_statement |
  182. loop_statement |
  183. block_statement |
  184. accept_statement |
  185. select_statement
  186. if_statement ::= 'if' condition 'then' sequence_of_statements { 'elsif' condition 'then' sequence_of_statements } [ 'else' sequence_of_statements ] 'end' 'if' ';'
  187. case_statement ::= 'case' expression 'is' case_statement_alternative { case_statement_alternative } 'end' 'case' ';'
  188. case_statement_alternative ::= 'when' discrete_choice_list '=>' sequence_of_statements
  189. loop_statement ::= [ statement_identifier ':' ]
  190. [ ( 'while' condition ) | ( 'for' defining_identifier 'in' [ 'reverse' ] discrete_subtype_definition ) ]
  191. 'loop' sequence_of_statements 'end' 'loop' [ statement_identifier ] ';'
  192. block_statement ::= [ statement_identifier ':' ] [ 'declare' declarative_part ] 'begin' handled_sequence_of_statements 'end' [ statement_identifier ] ';'
  193. accept_statement ::= 'accept' direct_name [ "(" entry_index ")" ] parameter_profile [ 'do' handled_sequence_of_statements 'end' [ entry_identifier ] ] ';'
  194. select_statement ::= selective_accept | timed_entry_call | conditional_entry_call | asynchronous_select
  195. timed_entry_call ::= 'select' entry_call_alternative 'or' delay_alternative 'end' 'select' ';'
  196. entry_call_alternative ::= entry_call_statement [ sequence_of_statements ]
  197. conditional_entry_call ::= 'select' entry_call_alternative 'else' sequence_of_statements 'end' 'select' ';'
  198. asynchronous_select ::= 'select' triggering_alternative 'then' 'abort' abortable_part 'end' 'select' ';'
  199. triggering_alternative ::= triggering_statement [ sequence_of_statements ]
  200. triggering_statement ::= entry_call_statement | delay_statement
  201. abortable_part ::= sequence_of_statements
  202. selective_accept ::= 'select' [ guard ] select_alternative { 'or' [ guard ] select_alternative } [ 'else' sequence_of_statements ] 'end' 'select' ';'
  203. guard ::= 'when' condition '=>'
  204. select_alternative ::= accept_alternative | delay_alternative | terminate_alternative
  205. accept_alternative ::= accept_statement [ sequence_of_statements ]
  206. delay_alternative ::= delay_statement [ sequence_of_statements ]
  207. terminate_alternative ::= 'terminate' ';'
  208. entry_index ::= expression
  209. entry_identifier ::= identifier
  210. simple_statement ::= null_statement |
  211. assignment_statement |
  212. exit_statement |
  213. goto_statement |
  214. procedure_call_statement |
  215. return_statement |
  216. entry_call_statement |
  217. requeue_statement |
  218. delay_statement |
  219. abort_statement |
  220. raise_statement |
  221. code_statement
  222. null_statement ::= 'null' ';'
  223. assignment_statement ::= variable_name value_assignment ';'
  224. exit_statement ::= 'exit' [ loop_name ] [ 'when' condition ] ';'
  225. goto_statement ::= 'goto' label_name ';'
  226. procedure_call_statement ::= ( procedure_name | prefix ) [ actual_parameter_part ] ';'
  227. return_statement ::= 'return' [ expression ] ';'
  228. entry_call_statement ::= entry_name [ actual_parameter_part ] ';'
  229. requeue_statement ::= 'requeue' entry_name [ 'with' 'abort' ] ';'
  230. delay_statement ::= delay_until_statement | delay_relative_statement
  231. delay_until_statement ::= 'delay' 'until' expression ';'
  232. delay_relative_statement ::= 'delay' expression ';'
  233. abort_statement ::= 'abort' task_name { ',' task_name } ';'
  234. raise_statement ::= 'raise' [ exception_name ] ';'
  235. code_statement ::= qualified_expression ';'
  236. exception_name ::= element_name
  237. task_name ::= element_name
  238. label_name ::= element_name
  239. loop_name ::= element_name
  240. condition ::= expression
  241. label ::= '<<' statement_identifier '>>'
  242. statement_identifier ::= direct_name
  243. library_unit_declaration ::= subprogram_declaration | package_declaration | generic_declaration | generic_instantiation
  244. package_declaration ::= package_specification ';'
  245. package_specification ::= 'package' defining_program_unit_name
  246. 'is' { basic_declarative_item } [ 'private' { basic_declarative_item } ]
  247. 'end' [[parent_unit_name '.'] identifier]
  248. basic_declarative_item ::= basic_declaration | representation_clause | use_clause
  249. basic_declaration ::= type_declaration |
  250. subtype_declaration |
  251. object_declaration |
  252. number_declaration |
  253. subprogram_declaration |
  254. abstract_subprogram_declaration |
  255. package_declaration |
  256. renaming_declaration |
  257. exception_declaration |
  258. generic_declaration |
  259. generic_instantiation
  260. generic_instantiation ::= ( 'package' defining_program_unit_name 'is' 'new' package_name [ generic_actual_part ] ';' ) |
  261. ( 'procedure' defining_program_unit_name 'is' 'new' procedure_name [ generic_actual_part ] ';') |
  262. ( 'function' defining_designator 'is' 'new' function_name [ generic_actual_part ] ';' )
  263. generic_declaration ::= 'generic' { generic_formal_parameter_declaration | use_clause } ( subprogram_specification | package_specification ) ';'
  264. generic_formal_parameter_declaration ::= formal_object_declaration | formal_type_declaration | formal_subprogram_declaration | formal_package_declaration
  265. formal_package_declaration ::= 'with' 'package' defining_identifier 'is' 'new' package_name formal_package_actual_part ';'
  266. formal_package_actual_part ::= "(" '<>' ")" | [ generic_actual_part ]
  267. generic_actual_part ::= "(" generic_association { ',' generic_association } ")"
  268. generic_association ::= [ selector_name '=>' ] expression | variable_name | procedure_name | function_name | entry_name | subtype_mark | package_name
  269. variable_name ::= element_name
  270. procedure_name ::= element_name
  271. entry_name ::= element_name
  272. formal_subprogram_declaration ::= 'with' subprogram_specification [ 'is' ( default_name | '<>' ) ] ';'
  273. default_name ::= element_name
  274. formal_object_declaration ::= defining_identifier_list ':' mode subtype_mark [ default_value_assignment ] ';'
  275. formal_type_declaration ::= 'type' defining_identifier [ discriminant_part ] 'is' formal_type_definition ';'
  276. formal_type_definition ::=
  277. formal_private_type_definition |
  278. formal_derived_type_definition |
  279. formal_discrete_type_definition |
  280. formal_signed_integer_type_definition |
  281. formal_modular_type_definition |
  282. formal_floating_point_definition |
  283. formal_ordinary_fixed_point_definition |
  284. formal_decimal_fixed_point_definition |
  285. formal_array_type_definition |
  286. formal_access_type_definition
  287. formal_private_type_definition ::= [[ 'abstract' ] 'tagged' ] [ 'limited' ] 'private'
  288. formal_derived_type_definition ::= [ 'abstract' ] 'new' subtype_mark [ 'with' 'private' ]
  289. formal_discrete_type_definition ::= "(" '<>' ")"
  290. formal_signed_integer_type_definition ::= 'range' '<>'
  291. formal_modular_type_definition ::= 'mod' '<>'
  292. formal_floating_point_definition ::= 'digits' '<>'
  293. formal_ordinary_fixed_point_definition ::= 'delta' '<>'
  294. formal_decimal_fixed_point_definition ::= 'delta' '<>' 'digits' '<>'
  295. formal_array_type_definition ::= array_type_definition
  296. formal_access_type_definition ::= access_type_definition
  297. exception_declaration ::= defining_identifier_list ':' 'exception' ';'
  298. abstract_subprogram_declaration ::= subprogram_specification 'is' 'abstract' ';'
  299. renaming_declaration ::= (
  300. (defining_identifier ':' subtype_mark ) |
  301. ( defining_identifier ':' 'exception') |
  302. ( 'package' defining_program_unit_name ) |
  303. ( subprogram_specification ) |
  304. ( 'generic' ( 'package' | 'procedure' | 'function') defining_program_unit_name )
  305. ) 'renames' element_name ';'
  306. number_declaration ::= defining_identifier_list ':' 'constant' value_assignment ';'
  307. subtype_declaration ::= 'subtype' defining_identifier 'is' subtype_indication ';'
  308. object_declaration ::= ( defining_identifier_list ':' [ 'aliased' ] [ 'constant' ] subtype_indication [ value_assignment ] ';' ) |
  309. ( defining_identifier_list ':' [ 'aliased' ] [ 'constant' ] array_type_definition [ value_assignment ] ';' ) |
  310. single_task_declaration |
  311. single_protected_declaration
  312. private value_assignment ::= ':=' expression
  313. single_task_declaration ::= 'task' defining_identifier [ 'is' task_definition ] ';'
  314. single_protected_declaration ::= 'protected' defining_identifier 'is' protected_definition ';'
  315. type_declaration ::= full_type_declaration |
  316. incomplete_type_declaration |
  317. private_type_declaration |
  318. private_extension_declaration
  319. private_type_declaration ::= 'type' defining_identifier [ discriminant_part ] 'is' [ [ 'abstract' ] 'tagged' ] [ 'limited' ] 'private' ';'
  320. private_extension_declaration ::= 'type' defining_identifier [ discriminant_part ] 'is' [ 'abstract' ] 'new' ancestor_subtype_indication 'with' 'private' ';'
  321. ancestor_subtype_indication ::= subtype_indication
  322. incomplete_type_declaration ::= 'type' defining_identifier [ discriminant_part ] ';'
  323. discriminant_part ::= known_discriminant_part | ( "(" '<>' ")" )
  324. full_type_declaration ::= ( 'type' defining_identifier [known_discriminant_part] 'is' type_definition ';') |
  325. task_type_declaration |
  326. protected_type_declaration
  327. protected_type_declaration ::= 'protected' 'type' defining_identifier [ known_discriminant_part ] 'is' protected_definition ';'
  328. protected_definition ::= { protected_operation_declaration } [ 'private' { protected_element_declaration } ] 'end' [ protected_identifier ]
  329. protected_identifier ::= identifier
  330. protected_operation_declaration ::= subprogram_declaration | entry_declaration | representation_clause
  331. protected_element_declaration ::= protected_operation_declaration | component_declaration
  332. component_declaration ::= defining_identifier_list ':' component_definition [ default_value_assignment ] ';'
  333. private default_value_assignment ::= ':=' default_expression
  334. component_definition ::= [ 'aliased' ] subtype_indication
  335. task_type_declaration ::= 'task' 'type' defining_identifier [ known_discriminant_part ] [ 'is' task_definition ] ';'
  336. task_definition ::= { task_item } [ 'private' { task_item } ] 'end' [ task_identifier ]
  337. task_identifier ::= identifier
  338. task_item ::= entry_declaration | representation_clause
  339. representation_clause ::= attribute_definition_clause |
  340. enumeration_representation_clause |
  341. record_representation_clause |
  342. at_clause
  343. at_clause ::= 'for' direct_name 'use' 'at' expression ';'
  344. record_representation_clause ::= 'for' first_subtype_local_name 'use' 'record' [ mod_clause ] { component_clause } 'end' 'record' ';'
  345. mod_clause ::= 'at' 'mod' static_expression ';'
  346. component_clause ::= local_name 'at' static_expression 'range' first_bit '..' last_bit ';'
  347. last_bit ::= static_simple_expression
  348. first_bit ::= static_simple_expression
  349. static_simple_expression ::= simple_expression;
  350. enumeration_representation_clause ::= 'for' first_subtype_local_name 'use' enumeration_aggregate ';'
  351. first_subtype_local_name ::= direct_name
  352. enumeration_aggregate ::= array_aggregate
  353. attribute_definition_clause ::= 'for' local_name 'single_quote' attribute_designator 'use' expression ';' |
  354. 'for' local_name 'single_quote' attribute_designator 'use' element_name ';'
  355. local_name ::= direct_name | direct_name 'single_quote' attribute_designator | library_unit_name
  356. entry_declaration ::= 'entry' defining_identifier [ "(" discrete_subtype_definition ")" ] parameter_profile ';'
  357. discrete_subtype_definition::= subtype_indication | range
  358. parameter_profile ::= [ formal_part ]
  359. type_definition ::= enumeration_type_definition |
  360. integer_type_definition |
  361. real_type_definition |
  362. array_type_definition |
  363. record_type_definition |
  364. access_type_definition |
  365. derived_type_definition
  366. derived_type_definition ::= [ 'abstract' ] 'new' subtype_indication [ record_extension_part ]
  367. record_extension_part ::= 'with' record_definition
  368. access_type_definition ::= access_to_object_definition | access_to_subprogram_definition
  369. access_to_object_definition ::= 'access' [ 'all' | 'constant' ] subtype_indication
  370. access_to_subprogram_definition ::= ( 'access' [ 'protected' ] 'procedure' parameter_profile ) | ( 'access' [ 'protected' ] 'function' parameter_and_result_profile)
  371. parameter_and_result_profile ::= [ formal_part ] 'return' subtype_mark
  372. record_type_definition ::= [ [ 'abstract' ] 'tagged' ] [ 'limited' ] record_definition
  373. record_definition ::= ( 'record' ( ( component_item { component_item } ) | ( { component_item } variant_part ) | ( 'null' ';' )) 'end' 'record') | ( 'null' 'record' )
  374. component_item ::= component_declaration | representation_clause
  375. variant_part ::= 'case' direct_name 'is' variant { variant } 'end' 'case' ';'
  376. variant ::= 'when' discrete_choice_list '=>' ( component_item { component_item } ) | ( { component_item } variant_part ) | ( 'null' ';' )
  377. array_type_definition ::= unconstrained_array_definition | constrained_array_definition
  378. unconstrained_array_definition ::= 'array' "(" index_subtype_definition { ',' index_subtype_definition } ")" 'of' component_definition
  379. constrained_array_definition ::= 'array' "(" discrete_subtype_definition { ',' discrete_subtype_definition } ")" 'of' component_definition
  380. index_subtype_definition ::= subtype_mark range '<>'
  381. real_type_definition ::= floating_point_definition | ordinary_fixed_point_definition | decimal_fixed_point_definition
  382. floating_point_definition ::= 'digits' expression [ simple_range_definition ]
  383. ordinary_fixed_point_definition ::= 'delta' expression simple_range_definition
  384. private simple_range_definition ::= 'range' simple_expression '..' simple_expression
  385. decimal_fixed_point_definition ::= 'delta' expression 'digits' expression [ simple_range_definition ]
  386. integer_type_definition ::= ( simple_range_definition ) | ( 'mod' expression )
  387. enumeration_type_definition ::= "(" enumeration_literal_specification { ',' enumeration_literal_specification } ")"
  388. enumeration_literal_specification ::= defining_identifier | 'character_literal'
  389. known_discriminant_part ::= "(" discriminant_specification { ';' discriminant_specification } ")"
  390. discriminant_specification ::= defining_identifier_list ':' subtype_mark [ default_value_assignment ] |
  391. defining_identifier_list ':' access_definition [ default_value_assignment]
  392. subprogram_declaration ::= subprogram_specification ';'
  393. subprogram_specification ::= ('procedure' defining_program_unit_name [ formal_part ]) |
  394. ('function' defining_designator [ formal_part ] 'return' subtype_mark)
  395. defining_designator ::= defining_program_unit_name | defining_operator_symbol
  396. defining_operator_symbol ::= operator_symbol
  397. formal_part ::= "(" parameter_specification { ';' parameter_specification } ")"
  398. parameter_specification ::= defining_identifier_list ':' ((mode subtype_mark) | access_definition) [ default_value_assignment]
  399. defining_identifier_list ::= defining_identifier { ',' defining_identifier }
  400. mode ::= ( 'in' 'out' ) | ( 'out' ) | [ 'in' ]
  401. access_definition ::= 'access' subtype_mark
  402. default_expression ::= expression
  403. defining_program_unit_name ::= [ parent_unit_name '.' ] defining_identifier
  404. parent_unit_name ::= element_name
  405. defining_identifier ::= identifier
  406. package_name ::= element_name
  407. library_unit_name ::= element_name
  408. element_name ::= direct_name |
  409. slice |
  410. selected_component |
  411. attribute_reference |
  412. type_conversion |
  413. function_call |
  414. 'character_literal' |
  415. explicit_dereference |
  416. indexed_component
  417.  
  418. function_call ::= (function_name | prefix) [ actual_parameter_part ]
  419. function_name ::= element_name
  420. type_conversion ::= subtype_mark "(" (expression | element_name) ")"
  421. attribute_reference ::= prefix 'single_quote' attribute_designator
  422. selected_component ::= prefix '.' selector_name
  423. slice ::= prefix "(" discrete_range ")"
  424. explicit_dereference ::= element_name '.' 'all'
  425. indexed_component ::= prefix "(" expression { ',' expression } ")"
  426. prefix ::= element_name
  427. subtype_mark ::= element_name
  428.  
  429. attribute_designator ::= (identifier [ "(" expression ")" ]) | 'Access' | 'Delta' | 'Digits'
  430. direct_name ::= identifier | operator_symbol
  431.  
  432. expression ::= relation { 'and' relation } |
  433. relation { 'and' 'then' relation } |
  434. relation { 'or' relation } |
  435. relation { 'or' 'else' relation } |
  436. relation { 'xor' relation }
  437.  
  438. actual_parameter_part ::= "(" parameter_association { ',' parameter_association } ")"
  439. parameter_association ::= [ selector_name '=>' ] ( expression | element_name )
  440.  
  441. relation ::= (simple_expression [( '=' | '/=' | '<' | '<=' | '>' | '>=' ) simple_expression]) |
  442. (simple_expression [ 'not'] 'in' (range | subtype_mark))
  443. simple_expression ::= [('+' '-')] term { ('+' | '-' | '&') term }
  444.  
  445. term ::= factor { ( '*' | '/' | 'mod' | 'rem' ) factor }
  446. factor ::= (primary [ '**' primary]) | ('abs' primary) | ('not' primary)
  447.  
  448. primary ::= numeric_literal |
  449. 'null' |
  450. 'string_literal' |
  451. aggregate |
  452. element_name |
  453. qualified_expression |
  454. allocator |
  455. ("(" expression ")")
  456.  
  457. allocator ::= 'new' (subtype_indication | qualified_expression)
  458. qualified_expression ::= subtype_mark 'single_quote' (( "(" expression ")" ) | aggregate)
  459. aggregate ::= record_aggregate | extension_aggregate | array_aggregate
  460. array_aggregate ::= positional_array_aggregate | named_array_aggregate
  461. positional_array_aggregate ::= ( "(" expression ',' expression { ',' expression } ")") |
  462. ( "(" expression { ',' expression } ',' 'others' '=>' expression ")")
  463. named_array_aggregate ::= "(" array_component_association { ',' array_component_association } ")"
  464. array_component_association ::= discrete_choice_list '=>' expression
  465. discrete_choice_list ::= discrete_choice { '|' discrete_choice }
  466. discrete_choice ::= expression | discrete_range | 'others'
  467. discrete_range ::= subtype_indication | range
  468. subtype_indication ::= subtype_mark [ constraint ]
  469. constraint ::= range_constraint | digits_constraint | delta_constraint | index_constraint | discriminant_constraint
  470. discriminant_constraint ::= "(" discriminant_association { ',' discriminant_association } ")"
  471. discriminant_association ::= [ selector_name { '|' selector_name } '=>' ] expression
  472. index_constraint ::= "(" discrete_range { ',' discrete_range } ")"
  473. delta_constraint ::= 'delta' static_expression [ range_constraint ]
  474. static_expression ::= expression
  475. digits_constraint ::= 'digits' expression [ range_constraint ]
  476. range_constraint ::= 'range' range
  477. range ::= range_attribute_reference | (simple_expression '..' simple_expression)
  478. range_attribute_reference ::= prefix 'single_quote' range_attribute_designator
  479. range_attribute_designator ::= 'Range' [ "(" expression ")" ]
  480. extension_aggregate ::= "(" ancestor_part 'with'
  481. (
  482. (record_component_association { ',' record_component_association}) |
  483. ( 'null' 'record' )
  484. ) ")"
  485. ancestor_part ::= expression | subtype_mark
  486.  
  487. record_aggregate ::= "(" (record_component_association { ',' record_component_association }) | ( 'null' 'record' ) ")"
  488. record_component_association ::= [ component_choice_list '=>' ] expression
  489. component_choice_list ::= (selector_name { '|' selector_name }) | 'others'
  490. selector_name ::= identifier | 'character_literal' | operator_symbol
  491. numeric_literal ::= decimal_literal | based_literal
  492. decimal_literal ::= numeral [ '.' numeral ] [ exponent ]
  493. based_literal ::= base '#' based_numeral [ '.' based_numeral ] '#' [ exponent ]
  494. base ::= numeral
  495. based_numeral ::= extended_digit { [ '_' ] extended_digit }
  496. extended_digit ::= digit | "A" | "B" | "C" | "D" | "E" | "F"
  497. numeral ::= digit { [ '_' ] digit}
  498. exponent ::= ("E" ['+'] numeral) | ("E" ['-'] numeral)
  499. operator_symbol ::= 'string_literal'
Add Comment
Please, Sign In to add comment