Robert <ir*********@gmail.comwrites:
If the goal is to take a 1-dimensional package of text and produce a
tree data structure that is easy to understand and manipulate, and
then write C/C++ code that works with that tree - does lex/yacc suit
that purpose - i.e. kind of like a tree-manufacturing C library? Or is
it for producing a compiler/interpreter the internals of which a new C/
C++ program cannot so easily work with?
It's not lex or yacc that would build such a tree, but the action code
you would add to your grammar file, compiled by yacc, that would have
to do it.
I don't know about yacc, but bison can generate C++ parsers, so you
should be able to put easily C++ code in the actions to build your
tree of objects.
With yacc, if you're restricted to C, you can still call from each
action a C function that could be implemented in C++.
In any case, it's not done automatically by yacc or bison, you will
have to write the grammar and the action code to build the tree.
--
__Pascal Bourguignon__