A primary is a limited kind of expression that can be used in the left hand side of an assignment (5.2), or in an invocation statement (8.1) or a store statement (8.2). The syntax of primaries rules out expressions that would be ambiguous in these situations, namely, expressions that begin with a left parenthesis and expressions that use infix and prefix operators at the top level.
Primaries are defined as follows:
<primary> -> <simple_expr>
| <primary> "." <idn>
| <primary> "." <method_idn>
| <simple_invoc>
| <primary> "[" <expr> "]"
<simple_expr> -> <literal>
| <idn> [<actual_parms>]
| self
| <method_idn>
| <tagged_type_desig> "{" <field_inits> "}"
| <type_designator> "{" [<ivar_inits>] "}"
| bind "(" <expr> <bind_args> ")"
<simple_invoc> -> <primary> "(" [ <args> ] ")"
Here are some examples:
(a[x]) % not legal -- starts with (
x + y % not legal -- infix notation at top level
a[x+y] % legal (for a: array[int] and x, y: int)
p(x) % legal (for p: proc(int) and x: int)