Hi Hui,

You probably know this part already, but every subclass of the AST node Symbol will have a "name" and a "cname" field, where "name" represents the name given at the Chapel level and "cname" is what will be used in the generated code. The "name" field only gets modified for instantiated generic types or for certain of our run time types at function resolution.

Starting relatively early in compilation, though, there will be many Symbols introduced that were not present in the user's code (and of course we parse all the library modules at the same time as the user modules). I believe we don't insert any new symbols within user code until the passes after checkParsed, so gathering the symbol names at that pass is your best bet.

You could filter the symbols you check through based on if their defining module is a user module (sym->getModule()->modTag == MOD_USER). For user-defined modules themselves, you would need to check their modTag directly instead of the modTag of their parent.

Hope this helps,
Lydia


On 04/06/2017 07:08 PM, Hui Zhang wrote:
Hello,

Since the names of user code variables in the generated code will be changed or removed, I'm trying to get all the user code real names (including variable name, variable type and function name). Could anyone familiar with the compiler give me a clue of where to start? I'm guessing somewhere after 'parser' ?

Thanks

--
Best regards


Hui Zhang


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to