Hello!
I have a few questions about expressions- best set up with a few excerpts from the project document. In section 4 of project requirements the following is said:
"your program will not be tested with any invalid expressions, so you do not need to validate the syntax of expressions."
Though, it is also said that:
"a function must have been defined before it is called in an expression"
"variables do not need to be defined before being used in an expression, and are automatically initialised to the (real) value 0.0"
So, may I take it that there DOES need to be validation of expressions? How far does this not testing with invalid expressions go? If there truly was no invalid expressions and thus no need to syntax check the expressions, the automatic initialisation of variables would not matter and no invalid functions would appear.
Here is my set of questions:
- Does each function called in an expression need to be checked for having the correct number of parameters?
- More generally in a function call, does the function need to be checked for having the correct number of parameters?
In regards to variables not needing to be defined before calling- do these variables count towards the total number of identifiers, and can they be assigned to afterwards without increasing the number of identifiers?
Additionally, do function parameters and local variables count towards the grand total number of identifiers?
Thank you.