function createRoot() {
	var inOr = [];
	var process = createSeqment();
	var initial = true;
	return function(token) {
		switch(token.type) {
			case "or":
				inOr.push(initial);
				return "(";
			case "comma":
				if(inOr.length) {
					initial = inOr[inOr.length - 1]
					return "|";
				} else {
					return process({
						type: "string",
						value: ","
					}, initial);
				}
			case "closing-or":
				if(inOr.length === 0)
					throw new Error("Unmatched '}'");
				inOr.pop();
				return ")";
			case "end":
				if(inOr.length)
					throw new Error("Unmatched '{'");
				return process(token, initial);
			default:
				var result = process(token, initial);
				initial = false;
				return result;
		}
	};
}
/ /.+/
	// ^* \./.+ (concord special)
	// ? [^\\\/]
	// [!...] [^...]
	// [^...] [^...]
	// / [\\\/]
	// {...,...} (...|...)
	// ?(...|...) (...|...)?
	// +(...|...) (...|...)+
	// *(...|...) (...|...)*
	// @(...|...) (...|...)
	if(/^\(.+\)$/.test(glob)) {
		// allow to pass an RegExp in brackets
		return new RegExp(glob.substr(1, glob.length - 2));
	}
	var tokens = tokenize(glob);
	var process = createRoot();
	var regExpStr = tokens.map(process).join("");
	return new RegExp("^" + regExpStr + "$");
}

var SIMPLE_TOKENS = {
	"@(": "one",
	"?(": "zero-one",
	"+(": "one-many",
	"*(": "zero-many",
	"|": "seqment-sep",
	"/*