* Parses the switch statement
*/
private Statement parseSwitch()
throws IOException
{
Location location = getLocation();
boolean oldTop = _isTop;
_isTop = false;
String label = pushSwitchLabel();
try {
expect('(');
Expr test = parseExpr();
expect(')');
boolean isAlternate = false;
int token = parseToken();
if (token == ':')
isAlternate = true;
else if (token == '{')
isAlternate = false;
else {
_peekToken = token;
expect('{');
}
ArrayList<Expr[]> caseList = new ArrayList<Expr[]>();
ArrayList<BlockStatement> blockList = new ArrayList<BlockStatement>();
ArrayList<Integer> fallThroughList = new ArrayList<Integer>();
BlockStatement defaultBlock = null;
while ((token = parseToken()) == CASE || token == DEFAULT) {
Location caseLocation = getLocation();
ArrayList<Expr> valueList = new ArrayList<Expr>();
boolean isDefault = false;
while (token == CASE || token == DEFAULT) {