djrieger / mjplusplus

A compiler for the MiniJava language
http://djrieger.github.io/mjplusplus/doc/doxygen/html/
6 stars 1 forks source link

main methods not counted #41

Closed ratefuchs closed 9 years ago

ratefuchs commented 9 years ago

we need to report an error if we have zero or multiple mains.

djrieger commented 9 years ago

Multiple mains are already accounted for when checking for duplicate method names in ast::MethodDeclaration::collectDefinition. Reporting zero mains should be easy once MethodTable is usable.

ratefuchs commented 9 years ago

Multiple mains in one method is already an error, but it is also forbidden to have multiple mains in the whole program.