Previous | Table of Contents | Next |
The syntax for a constant declaration is:
(27) <const_dcl> ::= “const? <const_type> <identifier> “=? <const_exp>
(28) <const_type> ::= <integer_type> | <char_type> | <wide_char_type> | <boolean_type> | <floating_pt_type> | <string_type> | <wide_string_type> | <fixed_pt_const_type> | <scoped_name> | <octet_type>
(29) <const_exp> ::= <or_expr>
(30) <or_expr> ::= <xor_expr> | <or_expr> “|? <xor_expr>
(31) <xor_expr> ::= <and_expr> | <xor_expr> “^? <and_expr>
(32) <and_expr> ::= <shift_expr> | <and_expr> “&? <shift_expr>
(33) <shift_expr> ::= <add_expr> | <shift_expr> “>>? <add_expr> | <shift_expr> “<<? <add_expr>
(34) <add_expr> ::= <mult_expr> | <add_expr> “+? <mult_expr> | <add_expr> “-? <mult_expr>
(35) <mult_expr> ::= <unary_expr> | <mult_expr> “*? <unary_expr> | <mult_expr> “/? <unary_expr> | <mult_expr> “%? <unary_expr>
(36) <unary_expr> ::= <unary_operator> <primary_expr> | <primary_expr>
(37) <unary_operator> ::= “-?| “+?| “~?
(38) <primary_expr> ::= <scoped_name>| <literal>| “(? <const_exp> “)?
(39) <literal> ::= <integer_literal> | <string_literal> | <wide_string_literal> | <character_literal> | <wide_character_literal> | <fixed_pt_literal> | <floating_pt_literal> | <boolean_literal>
(40) <boolean_literal> ::= “TRUE?| “FALSE?
(41) <positive_int_const> ::= <const_exp>