Exemple #1
0
/**
 * Looks for the stuff that is allowed to be inside of parentheses
 * either & or | followed by a list, or a terminal symbol.
 */
Exp * in_parens(Dictionary dict)
{
	Exp * e;

	if (is_equal(dict, '&') || (strcmp(token, "and")==0)) {
		if (!link_advance(dict)) {
			return NULL;
		}
		return operator_exp(dict, AND_type);
	} else if (is_equal(dict, '|') || (strcmp(dict->token, "or")==0)) {
		if (!link_advance(dict)) {
			return NULL;
		}
		return operator_exp(dict, OR_type);
	} else {
		return expression(dict);
	}
}
Exemple #2
0
Exp * in_parens(Dictionary dict) {
/* looks for the stuff that is allowed to be inside of parentheses */
/* either & or | followed by a list, or a terminal symbol          */    
    Exp * e;

    if (is_equal(dict, L'&') || (wcscmp(token, L"and")==0)) {
	if (!advance(dict)) {
	    return NULL;
	}
	return operator_exp(dict, AND_type);
    } else if (is_equal(dict, L'|') || (wcscmp(dict->token, L"or")==0)) {
	if (!advance(dict)) {
	    return NULL;
	}
	return operator_exp(dict, OR_type);
    } else {
	return expression(dict);
    }
}