/** Block = "{" BlockStatements "}" */ JCBlock block(int pos, long flags) { accept(LBRACE); List<JCStatement> stats = blockStatements(); JCBlock t = F.at(pos).Block(flags, stats); while (S.token() == CASE || S.token() == DEFAULT) { syntaxError("orphaned", keywords.token2string(S.token())); switchBlockStatementGroups(); } // the Block node has a field "endpos" for first char of last token, which is // usually but not necessarily the last char of the last token. t.endpos = S.pos(); accept(RBRACE); return toP(t); }
/** Block = "{" BlockStatements "}" */ JCBlock block(int pos, long flags) { accept(LBRACE); List<JCStatement> stats = blockStatements(); JCBlock t = F.at(pos).Block(flags, stats); while (S.token() == CASE || S.token() == DEFAULT) { syntaxError("orphaned", keywords.token2string(S.token())); switchBlockStatementGroups(); } // the Block node has a field "endpos" for first char of last token, which is // usually but not necessarily the last char of the last token. t.endpos = S.pos(); accept(RBRACE); return toP(t); }
JCExpression pat = expression(); accept(COLON); List<JCStatement> stats = blockStatements(); JCCase c = F.at(pos).Case(pat, stats); if (stats.isEmpty()) S.nextToken(); accept(COLON); List<JCStatement> stats = blockStatements(); JCCase c = F.at(pos).Case(null, stats); if (stats.isEmpty())
JCExpression pat = expression(); accept(COLON); List<JCStatement> stats = blockStatements(); JCCase c = F.at(pos).Case(pat, stats); if (stats.isEmpty()) S.nextToken(); accept(COLON); List<JCStatement> stats = blockStatements(); JCCase c = F.at(pos).Case(null, stats); if (stats.isEmpty())