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

Akim Demaille <[email protected]>
Newsgroups gmane.comp.parsers.bison.general
Message-ID <[email protected]>
hi!

> Le 8 févr. 2019 à 12:39, Peng Yu <[email protected]> a écrit :
> 
> On Thu, Feb 7, 2019 at 11:49 PM Akim Demaille <[email protected]> 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.


_______________________________________________
[email protected] https://lists.gnu.org/mailman/listinfo/help-bison
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.