CS 445 HW#4
Due: Monday November 4 11:59pm
Perform the rest of semantic analysis for VGo. This shall consist
of the following items. Please turnin via bblearn an electronic copy of your
whole project in a .zip. Please create your .zip file in such a way that it
unpacks into the current directory, rather than a subdirectory.
Note: if you haven't already, add -Wall to your makefile compile rules,
and for maximum credit, turn in a solution that compiles with no warnings
when -Wall warnings have been turned on.
- Types
- Support the VGo base types: int, float64, rune, string, bool and void.
Support arrays, maps, and structs
- Type Checking
- Require and check types everywhere at compile-time.
- Check that function call signatures match
- Check that operators' operands are compatible
- Operators
- The semantic rules for operators are all nearly the same; at the
semantic analysis phase we will support at least
the operators =, +, -, *, /, subscript ([ ]) and dot ( . ).
Support the boolean/relational operators <, > && || and !.
- Built-ins
- You should insert into the global symbol table the names of
built-in packages fmt, math/rand and within them, the built-in
VGo functions such as Println.
- Nesting
- Expressions will generally get combined to form larger expressions.
This includes nested calls as parameters to other calls, chains of
dot operators for structs, etc.
Notes:
- your executable should be named "VGo"
- your program should accept and process an arbitrary
number of source filenames on the command line, treating
them as one big program with a shared global name space.
- write out the name of each file to standard out when you open it
- do NOT write out the tree, or other debugging information, by default;
you may add command line options to print that info if you want.
- error messages should be written to standard error not stdout
- if ANY file has a lexical error,
your process exit status should return 1,
for a syntax error 2, for a semantic error 3, and for no errors,
return 0.