Parse Strings

[…], the obvious way to parse strings (i.e. recover their trees) is, for each association problem, to associate to the left unless this yields semantic nonsense.

Unfortunately, nonsense testing requires looking up the types r_A and a_B and verifying the existence of a coercion from r_A to a_B. For translation this is not serious, but for interpretation it might slow things down significantly. Fortunately, there is an efficient solution that uses operator precedence functions.

[…] assignment of integers to the argument positions […]

~

PRATT, Vaughan R., 1973. Top down operator precedence. In: Proceedings of the 1st annual ACM SIGACT-SIGPLAN symposium on Principles of programming languages. 1973. p. 41–51, p. 45.