> It slightly helps integration but the main problem is still present:
> the AST changes frequently.

Not a problem, it's part of the game :-)
Like LLVM / CLang, the AST changes frequently, and it's the swiss army of C/C++ 
parsers / formatters / etc.
There is an attempts at having a reduced API that they maintain stable 
(libclang if I remember correctly),
but everybody doing serious stuff uses the AST.

> Creating a lib isn't very hard to do.  But I doubt that this will 
> generate a lot of interest compared to a JSON/XML output.

It think it would.
- embedded parser = less burden for users of resulting tools
- if it compiles, then it works (99% of chances, but it alleviates testing)
- developers can stick to a version of the AST and hence of the parser, no 
problem
  Update to newer lib version when very much needed, e.g. support for new VHDL 
standard, etc
- faster ?
- no burden about maintaining XML/JSON dumpers and parsers

Also quoting your latest message:

> If you look at disp_vhdl, this module is able to reprint vhdl sources from 
> the AST.

GHDL can also reprint VHDL? So much icing on the cake :-]
Then with a generic lib anyone can reuse, how could the GHDL project be more 
universal than that? ;-)
We've suffered too much all these years trying to build up toy and ugly and 
unreusable stuff each time we needed to do something with VHDL.
I have a dream that one day there is a lib!
Nobody will have any excuse using re-developped parser, standard-locked, 
non-standard compliant, for synthesis tool suites.

The real problem becomes maintaining headers for C/C++...
But this could be done only for major changes of the AST, should be doable?

Regards,
Adrien


_______________________________________________
Ghdl-discuss mailing list
Ghdl-discuss@gna.org
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to