print();
    public Tree intSwitchToTree() {    	print();    	int ncases = numCases(root.and);    	Tree matchError = cf.ThrowMatchError(selector.pos, typeOf(resultVar));    	// without a case, we return a match error if there is no default case    	if (ncases == 0)    		return defaultBody(root.and, matchError);    	// for one case we use a normal if-then-else instruction    	else if (ncases == 1) {    		switch (root.and.or) {    			case ConstantPat(Object value):    				return cf.If(    					cf.Equals(selector,    						make.Literal(root.and.or.pos, value).setType(root.and.or.type)),    					bodyToTree(root.and.or.and),    					defaultBody(root.and, matchError)).    						setType(typeOf(resultVar));    			default:    				return generalSwitchToTree();    		}		}    	// if we have more than 2 cases than use a switch statement    	switch (root.and) {    		case Header(_, Header next):    			TagBodyPair mappings = null;    			Tree defaultBody = null;    			PatternNode patNode = root.and;    			while (patNode != null) {    				PatternNode node = patNode.or;    				while (node != null) {    					switch (node) {    						case DefaultPat():    							if (defaultBody != null)    								throw new ApplicationError();    							defaultBody = bodyToTree(node.and);                				node = node.or;                				break;               				case ConstantPat(Object value):               					mappings = insert(               						((Integer)value).intValue(),               						bodyToTree(node.and),               						mappings);								node = node.or;								break;            				default:            					throw new ApplicationError(node.toString());    					}    				}    				patNode = patNode.next();    			}    			if (defaultBody == null)    				defaultBody = cf.ThrowMatchError(selector.pos, typeOf(resultVar));    			if (mappings == null) {    				return cf.Switch(selector, new int[0], new Tree[0], defaultBody).setType(typeOf(resultVar));    			} else {    				int n = mappings.length();    				int[] tags = new int[n];    				Tree[] bodies = new Tree[n];    				n = 0;    				while (mappings != null) {    					tags[n] = mappings.tag;    					bodies[n++] = mappings.body;    					mappings = mappings.next;    				}    				return cf.Switch(selector, tags, bodies, defaultBody).setType(typeOf(resultVar));;    			}            default:            	throw new ApplicationError();    	}    }