# (calc.info)Precedence in Syntax Tables

Next: Advanced Syntax Patterns Prev: Syntax Table Basics Up: Syntax Tables
Enter node , (file) or (file)node
```
8.8.8.2 Precedence
..................

Different operators are generally assigned different "precedences".  By
default, an operator defined by a rule like

# foo # := foo(#1,#2)

will have an extremely low precedence, so that `2*3+4 foo 5 == 6' will
be parsed as `(2*3+4) foo (5 == 6)'.  To change the precedence of an
operator, use the notation `#/P' in place of `#', where P is an integer
precedence level.  For example, 185 lies between the precedences for
`+' and `*', so if we change this rule to

#/185 foo #/186 := foo(#1,#2)

then `2+3 foo 4*5' will be parsed as `2+(3 foo (4*5))'.  Also, because
we've given the righthand expression slightly higher precedence, our
new operator will be left-associative: `1 foo 2 foo 3' will be parsed
as `(1 foo 2) foo 3'.  By raising the precedence of the lefthand
expression instead, we can create a right-associative operator.

Note: Composition Basics, for a table of precedences of the
standard Calc operators.  For the precedences of operators in other
language modes, look in the Calc source file `calc-lang.el'.

```

automatically generated by info2www version 1.2.2.9