Re: Are compiler developers light-years ahead of other software development?

Kaz Kylheku <480-992-1380@kylheku.com>
Sun, 23 Jan 2022 06:17:36 -0000 (UTC)

          From comp.compilers

Related articles
| List of all articles for this month |
From: Kaz Kylheku <480-992-1380@kylheku.com>
Newsgroups: comp.compilers
Date: Sun, 23 Jan 2022 06:17:36 -0000 (UTC)
Organization: A noiseless patient Spider
References: 22-01-059 22-01-083 22-01-090 22-01-096
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="43826"; mail-complaints-to="abuse@iecc.com"
Keywords: yacc, practice
Posted-Date: 23 Jan 2022 15:07:32 EST

On 2022-01-22, Ian Lance Taylor <ianlancetaylor@gmail.com> wrote:
> In my experience bison/yacc parsers are really good for knowing the exact
> language that you are parsing.


In my experience, you can easily know what language you're processing
with Yacc is if you avoid its /ad hoc/ features for suppressing conflict
messages. Namely:


- %left, %right and %nonassoc declarations for tokens.


- %prec in rules.


Otherwise, you're likely going to be relying on your regression test
cases to inform you what language you're parsing.


The exception is that %left, %right are readily understood if they are
only used for the operator tokens in the productions for a binary
operator expression grammar (that likely being their motivating use case).


--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal


Post a followup to this message

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