Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Is AST a compiler independent tool?

Yes and no...

The same nodes are generally used to construct the tree, but some compilers have different language features, and so may be associated with different parsers, which may generate a different structure and add new node types (or extend ones that already existed).

Furthermore, macro definitions often change when moving to platform to platform, and if there is conditionally compiled code, then the structure will be different.

Assuming that the same parser is used on "vanilla" C or C++ code without conditional compilation, then for all intents and purposes, the AST will be the same.

===========================
Chris Recoskie
Team Lead, IBM CDT and RDT
IBM Toronto
Inactive hide details for wang yu <wangyumi@xxxxxxxxx>wang yu <wangyumi@xxxxxxxxx>


          wang yu <wangyumi@xxxxxxxxx>
          Sent by: cdt-dev-bounces@xxxxxxxxxxx

          04/23/2009 01:50 AM

          Please respond to
          "CDT General developers list." <cdt-dev@xxxxxxxxxxx>

To

cdt-dev@xxxxxxxxxxx

cc


Subject

[cdt-dev] Is AST a compiler independent tool?

Hello,
If my understanding is correct, AST is a compiler independent tool
which means its layout or structure is exactly identical no matter
which OS platform or compiler is used, right?

Regard,
Yu Wang
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

GIF image

GIF image

GIF image


Back to the top