注释国王参考手册/表达式
此页面正在建设中。
-
name ::= direct_name | indexed_component | slice | selected_component | attribute_reference | type_conversion | function_call | character_literal | qualified_expression direct_name ::= identifier | operator_symbol prefix ::= name
-
-
-
indexed_component ::= sequence_component | map_component sequence_component ::= prefix [expression] map_component ::= prefix (expression)
-
-
-
slice ::= prefix [discrete_range] discrete_range ::= discrete_subtype_indication | range_specification
-
-
-
selected_component ::= prefix . selector_name selector_name ::= identifier | character_literal | operator_symbol
-
-
-
attribute_reference ::= prefix'attribute_designator attribute_designator ::= identifier [actual_parameter_part] | delta | digits range_attribute_reference ::= prefix'range_attribute_designator range_attribute_designator ::= range
-
属性函数可以有多个参数,这些参数不必是静态的。例如,对数值类型使用‘Image’属性函数,并包含宽度、基数等参数。
-> 我也想知道关于 Ada 的情况。我想属性函数只是通过标识符作为函数名进行解引用,然后应用函数签名。(PP)
它可能应该为
标识符 [实际参数部分]
已更改。(PP)
-
aggregate ::= record_aggregate | map_aggregate | sequence_aggregate | set_aggregate
-
-
-
record_aggregate ::= record_subtype_mark'(record_component_association_list) record_component_association_list ::= record_component_association {, record_component_association} | null record_component_association ::= component_choice_list => expression | component_choice_list => <> component_choice_list ::= component_selector_name {| component_selector_name} | others
-
-
-
map_aggregate ::= map_subtype_mark'(null_map_aggregate | named_map_aggregate) null_map_aggregate ::= null named_map_aggregate ::= map_element_association_list map_element_association_list ::= map_element_association {, map_element_association} map_element_association ::= key_choice_list => expression | key_choice_list => <> | iterated_element_association key_choice_list ::= key_choice {| key_choice} key_choice ::= key_expression | discrete_range iterated_element_association ::= for loop_parameter_specification[ use key_expression] => expression | for iterator_specification[ use key_expression] => expression
-
-
-
sequence_aggregate ::= sequence_subtype_mark'[ positional_sequence_aggregate [named_sequence_aggregate] | null_sequence_aggregate | named_sequence_aggregate ] positional_sequence_aggregate ::= expression {, expression} null_sequence_aggregate ::= null named_sequence_aggregate ::= sequence_component_association_list sequence_component_association_list ::= sequence_component_association {, sequence_component_association} sequence_component_association ::= discrete_choice_list => expression | discrete_choice_list => <>
-
others 只能用于有界序列。我不记得它是否属于离散选择列表,但它应该允许在有界序列的命名关联中使用。
-> 我不明白如何定义一个有界序列。有什么例子吗? (PP)
我决定消除有界序列
允许单个值的聚合ː S'[7]
named_sequence_aggregate 似乎有两个相同的选项 (JC)
已更改。(PP)
-
set_aggregate ::= set_subtype_mark'{ positional_set_aggregate | null_set_aggregate | all_set_aggregate } positional_set_aggregate ::= expression {, expression} null_set_aggregate ::= null all_set_aggregate ::= all
all 只有在宇宙类型为离散且有限时才允许。
实际上,others 对集合聚合没有意义。抱歉
允许单个值的聚合ː S'̪7ˈ(JC)
已更改。(PP)
-
expression ::= relation {and relation} | relation {and then relation} | relation {or relation} | relation {or else relation} | relation {xor relation} choice_expression ::= choice_relation {and choice_relation} | choice_relation {or choice_relation} | choice_relation {xor choice_relation} | choice_relation {and then choice_relation} | choice_relation {or else choice_relation} choice_relation ::= simple_expression [relational_operator simple_expression] relation ::= simple_expression [relational_operator simple_expression] | tested_simple_expression [not] in membership_choice_list membership_choice_list ::= membership_choice {| membership_choice} membership_choice ::= choice_simple_expression | range | subtype_mark simple_expression ::= term {binary_adding_operator term} term ::= factor {multiplying_operator factor} factor ::= [unary_adding_operator] primary [^ [unary_adding_operator] primary] | not primary | \ primary primary ::= numeric_literal | null | string_literal | aggregate | name | (expression) | (conditional_expression) | (quantified_expression) | (declare_expression)
-
请记住,King 允许一元运算符在不使用括号的情况下紧随二元运算符ː 10.0 ^ -9。我认为这些规则不允许这样做。
-> 已更改。 (PP)
似乎 A * -B 仍然不行 (JC)
分解
因子 乘法运算符 因子
因子 -> 主项 -> A
乘法运算符 -> *
因子 -> 一元加法运算符 主项 -> -B
正确吗? (PP)
-
logical_operator ::= and | or | xor relational_operator ::= = | /= | < | <= | > | >= binary_adding_operator ::= + | - | & unary_adding_operator ::= + | - multiplying_operator ::= * | / | mod | rem exponentiation_operator ::= ^ highest_precedence_operator ::= ^ | not | \ | unary_adding_operator
-
一元运算符,包括 not,具有最高优先级,以允许一元运算符在不使用括号的情况下紧随二元运算符。不要忘记 "\" 一元运算符。
-> 已更改。 (PP)
所有一元运算符都具有最高优先级。你需要类似于
二元加法运算符
乘法运算符
指数运算符 ::= ^
最高优先级运算符
所有一元运算符都是最高优先级运算符的一部分 (JC)
-
conditional_expression ::= if_expression | case_expression if_expression ::= if condition then dependent_expression {else_if condition then dependent_expression} else dependent_expression condition ::= boolean_expression case_expression ::= case selecting_expression is case_expression_alternative {, case_expression_alternative} case_expression_alternative ::= when discrete_choice_list => dependent_expression
-
-
-
quantified_expression ::= for quantifier loop_parameter_specification => predicate | for quantifier iterator_specification => predicate quantifier ::= all | some predicate ::= boolean_expression
-
-
-
declare_expression ::= declare declare_declaration {declare_declaration} begin body_expression
-
声明表达式的声明仅限于常量和子类型。据我回忆,你已经在其他地方处理了这个问题。
添加注释。(PP)
不包括子类型 (JC)
已更改。(PP)
-
type_conversion ::= subtype_mark (expression)
-
-
-
qualified_expression ::= subtype_mark'(expression)
-
-
-
function_call ::= function_name | function_prefix actual_parameter_part
-
-