If a left paren is encountered, examine the type of the preceding symbol. If this is a numeric or a letter, generate a null operator instead and handle it as a normal operator. Otherwise stack this.
If an op is encountered, examine the preceding symbol. Diagnose an error if it is an operator or paren and this cannot be monadic; but if this can be monadic, introduce a null op. If the preceding symbol is not an operator, examine the symbol before it. If that has lower precedence, stack this. If it has equal or greater precedence, generate it if it has greater precedence, otherwise stack this.
If a numeric is encountered, examine the preceding symbol. Diagnose an error unless it is an operator. Otherwise stack the numeric.
If a letter is encountered, examine the type of the preceding symbol. If this is a numeric or a letter, generate a null operator instead and handle it as a normal operator. Otherwise stack this.
If space is encountered, bypass it.
If a bad character is encountered, diagnose it and end the parse.
If a right paren is encountered, insist that a numeric, letter, or right paren precede. If this is so, unstack the prior operators in precedence groups, and insist that the left parenthesis eventually found matches this.
The parse is readily adaptable to a larger set of operators, including comparison, Boolean, and conditional operators, also set membership. The following conventions are proposed. We allow the operators
=,~=,<,>,<=,>=; &,|,~,^,- (which is the same as <=),