next up previous
Next: Productions from 8.4: Method Up: Productions from 8: Class Previous: Productions from 8.1: Class

Productions from 8.3: Field Declarations

Declarations of fields and local variables have the same form, and the published grammar uses the same set of rules for both. The scope rules for fields are completely different from those for local variables, however, so it makes sense to distinguish their declarations syntactically.

Productions from 8.3: Field Declarations[45]:

FieldDeclaration:
  Modifiers Type FieldDeclarators ';' .

FieldDeclarators:
  FieldDeclarator /
  FieldDeclarators ',' FieldDeclarator .

FieldDeclarator:
  FieldDeclaratorId /
  FieldDeclaratorId '=' Initializer .

FieldDeclaratorId:
  FieldIdDef /
  FieldDeclaratorId '[' ']' .

FieldIdDef:
  Identifier .

Initializer:
  Expression /
  ArrayInitializer .
This macro is invoked in definition 38.



2008-09-11