Include file arguments

Would I be correct in assuming that, if I wanted to capture include file arguments, I would need to process the output of COMPILE LISTING rather than getting anything from Proparse?


Comment viewing options

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

Re: Include file arguments

This info can also be fetched from Proparse, but none of this is trivial.

Proparse writes kind of a log file as it does its preprocessing: prorefactor/temp/listingfile.txt. You could have a look at it. Parse some example code and look at the output listingfile.

Proparse also slurps that listingfile.txt into a non-trivial object graph. You can use ParseUnit.getMacroGraph() to get the top node in that graph. It is not easy to understand. Again the best way to figure it out is to parse some sample code. A utility like "token lister" would be useful here, but I don't think I've written one.

Writing a node lister for that macro graph would be a good exercise if anyone wants to learn and make use of this. The base interface is MacroEvent. It has two subclasses: MacroDef and MacroRef. MacroRef has two subclasses: IncludeRef and NamedMacroRef. This is all in the package org.prorefactor.macrolevel.