The last two methods in the class ASTFactory do not have an output. Are they even needed for task one? What exactly is their pupose if we cant use them directly? My idea would be a dictionary-like implementation for both (functionDefinitions and external declarations) including inserts and lookups. Would it be neccessaryto implement things like this? If yes are we able to implement them later (after first deadline) and still use them like this post suggests?
They are absolutely necessary for the first task!
What gets created in these two methods is not returned to the parser, instead, you have to store it.
It probably makes sense to store a list of them in your Implementation of the ASTFactory.
All code that is read by the compiler will end up as either an ExternalDeclaration or as part of a FunctionDefinition, so if you do not store these, you will not actually store any part of the AST!
Does the compiler call these functions sometime during parsing and lexing? Because all other methods are tested using their output. It would only be necessary to store the AST for the other tasks. so i assume the answer to this:
Ah, I see what you mean now…
I guess it is true that the tests do not have access to these, so you could get points for the AST without implementing them. However, I would highly recommend that you do.
As for your other question: You are allowed to make changes to the AST after Friday, only the points will be fixed (so you can’t get any more points by fixing bugs).
It’s actually quite likely that you will have to make changes.