Create Methods for AST


I just realized that I initialized the ASTFactory in the getAstFactory of the compiler class. I guess it will make my create-methods not work, since getAstFactory will always yield something new and empty. So basically I’m in the situation where I didn’t implement the create methods, which saves information. I would like to know if it may affect my AST results.

Thanks in advance for responses

Are you refering to createExternalDeclaration and createFunctionDefinition?

If so, you might be in luck! Since these methods do not return anything, they are not tested for the AST exercise (How would such a test even look like?)

Otherwise, it still should not be an issue. All we test is that the returned classes have the right toString(), which they likely have, since that does not require “state”.

If you think you need to change your ASTFactory now, you are of course free to do so. However, the number of points you will get for the AST part is now frozen (well, you can’t see the points yet, but you know what I mean). Your changed ASTFactory implementation will of course be used for testing the other parts once they are done.

exactly !! Thanks for the response :grin: