help-bison
[Top][All Lists]
Advanced

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

Re: can i rewrite yyparse() based on ACTION and GOTO tables extracted fr


From: Akim Demaille
Subject: Re: can i rewrite yyparse() based on ACTION and GOTO tables extracted from XML output?
Date: Wed, 20 Oct 2021 06:01:43 +0200

Hi Levin,

> Le 14 oct. 2021 à 12:30, elite liu <eligere.liu@gmail.com> a écrit :
> 
> Hi Guys:
> 
> Because of customization necessaries, i want to rewrite yyparse() based on
> ACTION and GOTO tables -- a more straightforward way, just like the classic
> compiler book does, and ignore error recovery.
> bison is more complex due to efficient consideration.

Could you be more specific about what you'd like to change?  Also,
what's the problem with error recovery?  It should not come in your
way, it's fairly independent.


> I notice  bison can dump XML-format output. In XML output file, symbols
> both terminals and nonterminals, rules are record.  shifts, reduce , and
> goto actions, conflicts are fully listed.
> But i don't know whether the information are complete enough to create a
> big ACTION table and GOTO table based on xml extraction, where conflicts
> are solved like precedence,  %nonassoc, and %right and %prec can be well
> treated from the table guided actions.  I try to store ACTION table and
> GOTO table using std::map. Efficiency is not a focus.

I very much doubt that it's enough to build a parser, and I have no intention
to make it complete enough to this end.  The point of xml output is only
helping the (human) user to understand the parser.  It's just a structured
y.output.

However Bison features "skeletons": the backend are written in m4, failry
independent from the bison executable.  Have a look at data/skeletons/yacc.c
for instance.

Cheers.


reply via email to

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