Java Reference
In-Depth Information
c. Implement the enforcement of those rules that have not been implemented in j-- but that
one can.
Exercise 4.4. Write an attribute grammar expressing the type rules for each of the state-
ments in j--.
statement ::= block
j if parExpression statement [ else statement]
j while parExpression statement
j return [expression] ;
j ;
j statementExpression ;
Exercise 4.5. Write an attribute grammar expressing the semantics of expressions in j--,
that is, for productions from statementExpression through literal. See Appendix B for the
j-- syntax specification.
Implementation of analysis for new functionality is left for Chapter 5.
 
Search WWH ::




Custom Search