@Override
	public void visitSwitch(XTreeSwitch _switch) {
		XCodeGen code = getCode(_switch);
		XJumpTarget _break = new XJumpTarget();
		this.scope = new XScope(this.scope, true, _break, null, labels, 0);
		labels = null;
		visit(_switch.statement).setupAndGet(this, code);
		XInstSwitch s = new XInstSwitch(_switch.position.position.line);
		code.addInstruction(s);
		for (XTreeCase _case : _switch.cases) {
			XJumpTarget jumpTo = new XJumpTarget();
			code.addInstruction(_switch, jumpTo);
			if (_case.key instanceof XTreeConstant) {
				XTreeConstant c = (XTreeConstant) _case.key;
				if (!s.putIfNonExist(c.value, jumpTo)) {
					addDiagnostic(_case.key, "case.duplicated.key", c.value);
				}
			} else if (_case.key == null) {
				if (s._default == null) {
					s._default = jumpTo;
				} else {
					addDiagnostic(_case.key, "case.duplicated.default");
				}
			} else {
				addDiagnostic(_case.key, "case.key.no.constant");
			}
			visit(_case, _case.block).asStatement(this, code);
		}
		if (s._default == null) {
			s._default = _break;
		}
		code.addInstructionB(_switch, XOpcode.POP, this.scope.getLocalsCount());
		code.addInstruction(_switch, _break);
		this.scope = this.scope.getParent();
	}