Re: A minimal LL(1) parser generator ?

"Fred J. Scipione" <FredJScipione@alum.RPI.edu>
Sat, 25 Jan 2020 15:27:52 -0500

          From comp.compilers

Related articles
[13 earlier articles]
Re: A minimal LL(1) parser generator ? carlglassberg@gmail.com (2020-01-05)
Re: A minimal LL(1) parser generator ? carlglassberg@gmail.com (2020-01-05)
Re: A minimal LL(1) parser generator ? anton@mips.complang.tuwien.ac.at (2020-01-22)
Re: A minimal LL(1) parser generator ? anton@mips.complang.tuwien.ac.at (2020-01-22)
Re: A minimal LL(1) parser generator ? carlglassberg@gmail.com (2020-01-23)
Re: A minimal LL(1) parser generator ? anton@mips.complang.tuwien.ac.at (2020-01-25)
Re: A minimal LL(1) parser generator ? FredJScipione@alum.RPI.edu (Fred J. Scipione) (2020-01-25)
| List of all articles for this month |
From: "Fred J. Scipione" <FredJScipione@alum.RPI.edu>
Newsgroups: comp.compilers
Date: Sat, 25 Jan 2020 15:27:52 -0500
Organization: Compilers Central
References: 19-12-016 20-01-005 20-01-027
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="7618"; mail-complaints-to="abuse@iecc.com"
Keywords: parse, LL(1)
Posted-Date: 25 Jan 2020 15:43:06 EST

In article 20-01-027, anton@mips.complang.tuwien.ac.at
says...
>
> rockbrentwood@gmail.com writes:
> >On Sunday, December 22, 2019 at 10:17:44 AM UTC-6, Andy wrote:
> >> ANTLR has even LL(*) but is too complicated. I am searching maximal
> >> simple and elegant generator which generates function call like
> >> written by hand.
> >
> >A large set of parsers are lined up in the parser generator comparison on
> >Wikipedia here
> >https://en.wikipedia.org/wiki/Comparison_of_parser_generators
> >
> >The question of who in the list does bona fide code synthesis (as opposed to
> >cookie-cutter code generation) is not directly addressed, as far as I can see.
> >But the items can be reviewed individually.
>
> It's unclear to me what you mean with those two terms. "Like written
> by hand" is somewhat clearer in that I don't write code manually that
....<snipped>...


To the original poster: For "like written by hand" you might look at
RDP (recursive descent parser generator) -
<http://www.cs.rhul.ac.uk/research/languages/projects/rdp.html>


RDP provides sources for the generator and support libraries for lexing
and parsing. Sources are in ANSI C and produce parsers in ANSI C
(including the RDP parser, of course).


The authors have not been looking for collaborators, but I have found
the project easy to modify for my personal 'improvements'. They include
some extensions to the RDP grammar and producing 'switch' statements and
custom 'for', 'while', and 'do ... while' loops where possible in place
of the authors generic 'if ... else' chains and
'while(1)... if() break;' constructs. I also made the generated calls
to library function uses macros, so that it would be easier to use
custom replacements where additional functionality was needed (e.g.
filters on symbol table searching). The results are much closer to
"like written by hand".


One drawback to the RDP generated code that you might want to improve
is a way to give the generated symbol sets meaningful names in place
of the current auto-generated generic names (RDP001[], RDP002[], etc.).


Post a followup to this message

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