How to create AST for typechecking

for typechecking I want to create my AST in the checkSemantics function with parseTranslationUnit. How do I get the inputName I need to create the lexer?

The compiler class does have a field ASTFactory. At the phase of semantic checking, the AST is already created. All you need to do is to get it somehow and check the semantic for each declaration. Remember that the program comprise multiple global declaration.

1 Like

Thank you!

Note that it does not by default, but that it makes a lot of sense to create such a field.

1 Like