Re: Supporting multiple input syntaxes

antispam@math.uni.wroc.pl
Tue, 23 Feb 2021 23:28:16 +0000 (UTC)

          From comp.compilers

Related articles
[9 earlier articles]
Re: Supporting multiple input syntaxes mijoryx@yahoo.com.dmarc.email (luser droog) (2020-08-20)
Re: Supporting multiple input syntaxes gah4@u.washington.edu (gah4) (2020-08-23)
Re: Supporting multiple input syntaxes mijoryx@yahoo.com.dmarc.email (luser droog) (2020-08-23)
Re: Supporting multiple input syntaxes mijoryx@yahoo.com.dmarc.email (luser droog) (2020-08-23)
Re: Supporting multiple input syntaxes antispam@math.uni.wroc.pl (2021-02-11)
Re: Supporting multiple input syntaxes elronnd@elronnd.net (Elijah Stone) (2021-02-17)
Re: Supporting multiple input syntaxes antispam@math.uni.wroc.pl (2021-02-23)
Re: Supporting multiple input syntaxes ltcmelo@gmail.com (ltc...@gmail.com) (2021-03-14)
Re: Supporting multiple input syntaxes rockbrentwood@gmail.com (Rock Brentwood) (2021-03-14)
| List of all articles for this month |
From: antispam@math.uni.wroc.pl
Newsgroups: comp.compilers
Date: Tue, 23 Feb 2021 23:28:16 +0000 (UTC)
Organization: Politechnika Wroclawska
References: 20-08-002 21-02-004 21-02-005
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="74196"; mail-complaints-to="abuse@iecc.com"
Keywords: parse
Posted-Date: 23 Feb 2021 20:47:52 EST

Elijah Stone <elronnd@elronnd.net> wrote:
> On Thu, 11 Feb 2021, antispam@math.uni.wroc.pl wrote:
>
> > My impression is that variation in Pascal dialects is larger than in C
> > dialects, so case for unified parser in C IMHO
>
> Pascal is more fragmented, but it's also much easier to parse than C. I
> think it's a wash.


I did a C parser, it was not hard at all. I in C (like in standard
Pascal) there are conflicts, but that conflicts can be resolved
easily using semantic info. Alternativly, for C one can use 2
token lookahead. Turbo Pascal folks introduced "interesting"
difficulty with caret constants. Frank Heckenbach worked out
how to handle them and his analysis indicates that correct
handling of Turbo Pascal needs IIRC 6 tokens of lookahead.


Note that for both Pascal and C, with 1 token of lokahead
semantic info is available when needed to disambiguate
parsing, once you have more than 1 token of lokahead
semantic info is sometimes too late and in effect paser
must work purely syntactically.


> (I also think the whole idea is horrifying and ought not to be pursued;
> but.)


What you mean by "whole idea"? Do you think that creating
compiler that can correctly handle multiple dialects (Pascal
or other language) is wrong?


--
                                                            Waldek Hebisch


Post a followup to this message

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