Includes - actual reference

At the end of the Recent Q&A topic there is some code for listing the include files in a CU. This is returning full path names. I know we can walk through the PROPATH and find a match for the begining of the full path name ... and that should be good enough for most cases, but I'm wondering about cases like AutoEdge where they have a PROPATH which includes both A/B and A/B/C. How would one know if the actual include reference was C/x.i or just x.i?


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
john's picture

org.prorefactor.macrolevel

Or one of each in two different places in the code?!

This topic is by its nature very convoluted. I don't recommend going down this path (leads to insanity) unless you really need to.

Proparse does write to a temporary preprocessor listing file (looks like a cryptic log file) at each step of its preprocessing. It then reads it back in as objects in memory after parsing has been completed.

If you are a glutton for punishment, then see org.prorefactor.macrolevel.ListingParser.java.


tamhas's picture

So, there is nothing in the

So, there is nothing in the node tree to tell me what the original source line looked like?


john's picture

re: original source line

That's correct. The "stupid text tricks" (my words) of include files and preprocessing (include files *are* preprocessing) are not part of a structured syntax tree.


tamhas's picture

Understood ... but if one is

Understood ... but if one is trying to deal with legacy source ... especially source which is full of dead wood that is no longer used ... knowing which files are actually involved in the code is useful.