Completing the Jzero language definition
In the previous chapter, we listed the requirements for the language that will be implemented in this book, and the previous section elaborated on some of its design considerations. For reference purposes, this section will describe additional details regarding the Jzero language. If you find any discrepancies between this section and our Jzero compiler, then they are bugs. Programming language designers use more precise formal tools to define various aspects of a language; notations for describing lexical and syntax rules will be presented in the next two chapters. This section will describe the language in layman's terms.
A Jzero program consists of a single class in a single file. This class may consist of multiple methods and variables, but all of them are static
. A Jzero program starts by executing a static method called main()
, which is required. The kinds of statements that are allowed in Jzero are assignment statements, if statements...