Hello,
"Chenjun Hou" [email protected] wrote:
First, what should happen if divide by zero occurs, are we expected to do static analysis at compile time, throw an error at run time, or is it UB?
The focus of the project is not on designing and fully implementing a mini-language - it's 'only' about performing a quite mechanical syntactic translation from one language to another (C11), compiling, and then executing the program. The goals of the project are to encourage you to learn, and then assess your understanding of some core concepts listed on the project's description. In short, it's about C and operating-systems, not language design.
So, there's no need to worry about the division-by-zero cases - implement something if you wish (full static analysis will near impossible without execute the program at compile-time), but division-by-zero won't be tested.
Second, in example 5 a function call is done using printsum 12 6
, without any brackets or separators in the function call, whilst all other examples use function(args)
as the syntax. Should we be able to parse both?
Thanks; corrected.
Also, with respect to command line arguments, should our program check if the number of arguments passed to the program is sufficient and print to stderr like follows
This is the 2nd point of the 'Project requirements'.