public static RuleType getRuleType(String str) throws ParserException {
		for (RuleType ruleType : RuleType.values()) {
			switch (ruleType) {
			case LITERAL_VARIABLE_SET:
				if (str.startsWith(ruleType.symbol)) return ruleType;
				break;
			default:
				// skip all characters before the rule label
				int loc = str.indexOf(DflTheoryConst.RULE_LABEL_SEPARATOR);
				if (loc < 0) loc = 0;
				// return ruleType if the rule symbol appears in the rule body
				if (str.indexOf(ruleType.symbol, loc) >= 0) return ruleType;
			}
		}
		throw new ParserException(ErrorMessage.RULE_UNRECOGNIZED_RULE_TYPE, new Object[] { str });
	}