User friendly compiler-compiler tools

fjh@cs.mu.OZ.AU
Sat, 14 Oct 1995 06:38:20 GMT

          From comp.compilers

Related articles
User friendly compiler-compiler tools faase@cs.utwente.nl (1995-09-18)
Re: User friendly compiler-compiler tools anton@complang.tuwien.ac.at (1995-10-02)
User friendly compiler-compiler tools fjh@cs.mu.OZ.AU (1995-10-14)
Re: User friendly compiler-compiler tools [comp.compilers #7671] anton@complang.tuwien.ac.at (1995-10-23)
Re: User friendly compiler-compiler tools fjh@cs.mu.OZ.AU (Fergus Henderson) (1995-11-09)
| List of all articles for this month |
Newsgroups: comp.compilers
From: fjh@cs.mu.OZ.AU
Keywords: tools, parse
Organization: Compilers Central
References: 95-10-043
Date: Sat, 14 Oct 1995 06:38:20 GMT

M. Anton Ertl <anton@mips.complang.tuwien.ac.at> writes:


> So, when you design your next programming language, use a simple
> expression grammar like
>
> expr: expr1 op expr1
> | op expr1
> ;
>
> expr1: ( expr )
> | base_case
> ;
>
> If you think it's necessary, add a few rules for implicit
> parenthesizing; when in doubt, require explicit parenthesizing.


Current operator-precedence parser generator tools such as yacc make
this unnecessarily difficult, because they require a total ordering of
operator precedences. Future such tools should allow a partial ordering.
Expressions such as `e1 op1 e2 op2 e3' should be rejected with a syntax
error ("ambiguous expression, please insert explicit parentheses")
if `op1' and `op2' are unordered in the operator precedence partial ordering.
(Does anyone know of any existing operator-precedence parser generator tools
that allow a partial ordering?)


--
Fergus Henderson
fjh@cs.mu.oz.au
http://www.cs.mu.oz.au/~fjh
PGP: finger fjh@128.250.37.3
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.