help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it always possible to make a non-reentrant parser reentrant?


From: Akim Demaille
Subject: Re: Is it always possible to make a non-reentrant parser reentrant?
Date: Tue, 12 Feb 2019 17:38:43 +0100

hi!

> Le 8 févr. 2019 à 12:39, Peng Yu <address@hidden> a écrit :
> 
> On Thu, Feb 7, 2019 at 11:49 PM Akim Demaille <address@hidden> wrote:
> 
>> I'm a bit confused here: did you really mean "another parser", or did
>> you mean "another scanner"?  If you do mean "another parser", I'm not
>> sure how you would coordinate the several layers.
> 
> 
> Probably it should be another scanner. I only has a vague idea and I don’t
> know what will the implementation details.

I have not studied carefully how the heretics are parsed, so I might
have said naive things.

> I’d like to know what is the best way to structure the parsing code. Given
> a lot of code of bash started 30 years ago, I’d expect at least some part
> of the code is not the  best according to today’s standard. I’d like to
> know anything that can improve it.

For a start, I don't understand why so much of the code is written
in K&R.  I find this amazing.  Besides, it uses a parser generator
that has dropped K&R for ages.  So honestly, if you are cleaning
up bash, I would first move its C to 1990.

Then in the grammar, I would also use the literal string aliases:
IMHO the grammar file is much easier to read, and the error messages
are expected to be nicer too.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]