The reason you are having such a hard time finding a definition of precedence of those operators for JavaScript is that:
- Precedence only comes into play when using infix notation. Since you mention the shunting yard algorithm I take you intend to use infix notation.
- Each language can define it's own precedence and since you are creating a DSL, you create the precedence, but it must be consistent.
- Those names are really prefix function names and infix is more common with symbols for operators than names. You should be using operators and not function names:
and &
or |
implies →
equals (biconditional) ↔
not !
xor ⊕
nor ⊽
nand ⊼ - When parsing you convert infix to prefix or postfix, so the operators symbols should change to function names if you are building an intermediate form such as an AST.
- You didn't mention associativity which you will need for NOT.
From "Foundations of Computer Science" by Jeffrey D. Ullman
Associativity and Precedence of Logical Operators
The order of precedence we shall use is
1. NOT (highest)
2. NAND
3. NOR
4. AND
5. OR
6. IMPLIES
7. BICONDITIONAL(lowest)
From Mathematica
NOT
AND
NAND
XOR
OR
NOR
EQUIVALENT
IMPLIES