next up previous
Next: Productions from 15: Expressions Up: Phrase Structure Previous: Productions from 10: Arrays

Productions from 14: Blocks and Statements

Productions from 14: Blocks and Statements[51]:

Block:
  '{' StatementsOpt '}' .

Statements:
  BlockStatements .

StatementsOpt:
  / BlockStatements .

BlockStatements:
  BlockStatement /
  BlockStatements BlockStatement .

BlockStatement:
  LocalVariableDeclarationStatement /
  Statement /
  TypeDeclaration .

LocalVariableDeclarationStatement:
  LocalVariableDeclaration ';' .

LocalVariableDeclaration:
  ['final'] Type VariableDeclarators .

VariableDeclarators:
  VariableDeclarator /
  VariableDeclarators ',' VariableDeclarator .

VariableDeclarator:
  VariableDeclaratorId /
  VariableDeclaratorId '=' Initializer .

VariableDeclaratorId:
  VariableIdDef /
  VariableDeclaratorId '[' ']' .

VariableIdDef:
  Identifier .

Statement:
  StatementWithoutTrailingSubstatement /
  LabeledStatement /
  IfThenStatement /
  IfThenElseStatement /
  WhileStatement /
  ForStatement .

StatementNoShortIf:
  StatementWithoutTrailingSubstatement /
  LabeledStatementNoShortIf /
  IfThenElseStatementNoShortIf /
  WhileStatementNoShortIf /
  ForStatementNoShortIf .

StatementWithoutTrailingSubstatement:
  Block /
  EmptyStatement /
  ExpressionStatement /
  SwitchStatement /
  DoStatement /
  BreakStatement /
  ContinueStatement /
  ReturnStatement /
  SynchronizedStatement /
  ThrowStatement /
  TryStatement /
  AssertStatement .

EmptyStatement:
    ';' .

LabeledStatement:
  Identifier ':' Statement .

LabeledStatementNoShortIf:
  Identifier ':' StatementNoShortIf .

ExpressionStatement:
  StatementExpression ';' .

StatementExpression:
  Assignment /
  PreIncrementExpression /
  PreDecrementExpression /
  PostIncrementExpression /
  PostDecrementExpression /
  MethodInvocation /
  ClassInstanceCreationExpression .

IfThenStatement:
  'if' '(' Expression ')' Statement .

IfThenElseStatement:
  'if' '(' Expression ')' StatementNoShortIf 'else' Statement .

IfThenElseStatementNoShortIf:
  'if' '(' Expression ')' StatementNoShortIf 'else' StatementNoShortIf .

SwitchStatement:
  'switch' '(' Expression ')' SwitchBlock .

SwitchBlock:
  '{' [SwitchBlockStatements] [SwitchLabels] '}' .

SwitchBlockStatements:
  SwitchBlockStatement /
  SwitchBlockStatements SwitchBlockStatement .

SwitchBlockStatement:
  SwitchLabels Statements .

SwitchLabels:
  SwitchLabel /
  SwitchLabels SwitchLabel .

SwitchLabel:
  'case' ConstantExpression ':' /
  'default' ':' .

WhileStatement:
  'while' '(' Expression ')' Statement .

WhileStatementNoShortIf:
  'while' '(' Expression ')' StatementNoShortIf .

DoStatement:
  'do' Statement 'while' '(' Expression ')' ';' .

ForStatement:
  'for' '(' ForInit ';' ForTest ';' ForUpdate ')'
    Statement .

ForStatementNoShortIf:
  'for' '(' ForInit ';' ForTest ';' ForUpdate ')'
    StatementNoShortIf .

ForInit:
  ExpressionList /
  LocalVariableDeclaration .

ForTest:
  / Expression .

ForUpdate:
  ExpressionList .

ExpressionList: / StatementExpressionList .

StatementExpressionList:
  StatementExpression /
  StatementExpressionList ',' StatementExpression .

BreakStatement:
  'break' [Identifier] ';' .

ContinueStatement:
  'continue' [Identifier] ';' .

ReturnStatement:
  'return' [Expression] ';' .

ThrowStatement:
  'throw' Expression ';' .

SynchronizedStatement:
  'synchronized' '(' Expression ')' Block .

TryStatement:
  'try' Block Catches .

Catches:
  CatchList /
  CatchesOpt Finally .

CatchesOpt:
  / CatchList .

CatchList:
  CatchClause /
  CatchList CatchClause .

CatchClause:
  'catch' '(' FormalParameter ')' Block .

Finally:
  'finally' Block .

AssertStatement:
  'assert' Expression ';' /
  'assert' Expression ':' Expression ';' .
This macro is invoked in definition 38.


next up previous
Next: Productions from 15: Expressions Up: Phrase Structure Previous: Productions from 10: Arrays
2008-09-11