case_list :
              | CASE expr sep stmt_list_opt case_list
              | CASE expr error stmt_list_opt case_list
              | OTHERWISE stmt_list
19919
def p_case_list(p):
    
    if len(p) == 1:
        p[0] = node.stmt_list()
    elif len(p) == 3:
        assert isinstance(p[2], node.stmt_list)
        p[0] = p[2]
    elif len(p) == 6:
        p[0] = node.if_stmt(
            cond_expr=node.expr(
                op="==", args=node.expr_list([p[2]])),
            then_stmt=p[4],
            else_stmt=p[5])
        p[0].cond_expr.args.append(
            None)  # None will be replaced using backpatch()
    else:
        assert 0
432675
def p_declnamelist(self, p):
        ''
        p[0] = p[1] + (p[3],)
        p.set_lineno(0, p.lineno(1))
573628
def p_exprlt(p):
    
    a = int(p[1]) if p[1].isdigit() else 0
    b = int(p[3]) if p[3].isdigit() else 0

    p[0] = '1' if a < b else '0'
535040
def _case_stmt(self, stmt: Statement, sctx: SchemaContext) -> None:
        """"""
        self._handle_child(CaseNode(), stmt, sctx)
630106
def p_switch_stmt(p):
    

    def backpatch(expr, stmt):
        if isinstance(stmt, node.if_stmt):
            stmt.cond_expr.args[1] = expr
            backpatch(expr, stmt.else_stmt)

    backpatch(p[2], p[4])
    p[0] = p[4]
317134
def p_Case(p):
    '''
    
    '''
    if p[1] == 'case':
        p[0] = Case(p[1], p[2], p[4], p[5])
    else:
        p[0] = Case(p[1], None, p[3], p[4])
588571
def p_const_list(self, p):
        ''' '''
        p[0] = ast.ConstList(list(p[2]), p.lineno(1))
870625
def p_while_stmt(p):
    
    assert isinstance(p[4], node.stmt_list)
    p[0] = node.while_stmt(cond_expr=p[2], stmt_list=p[4])
856896
def p_print_list(p):
    
    p[0] = p[1]
    p[0].eol = (p[3] is not None)

    if p[3] is not None:
        p[0].appendChild(p[3])
394147
Expr atom() {
		Tok tok = peek();
		switch (tok.sym) {
		case LPAREN:
			move();
			Expr expr = expr();
			match(Sym.RPAREN);
			return expr;
		case ID:
			move();
			return new Id(tok.value());
		case STR:
			move();
			return new Const(tok.sym, tok.value());
		case INT:
		case LONG:
		case FLOAT:
		case DOUBLE:
			move();
			return new Const(tok.sym, ((NumTok)tok).getNumberValue());
		case TRUE:
			move();
			return Const.TRUE;
		case FALSE:
			move();
			return Const.FALSE;
		case NULL:
			move();
			return Const.NULL;
		case COMMA:
		case SEMICOLON:
		case QUESTION:	// support "c ?? ? a : b"
		case AND: case OR: case EQUAL: case NOTEQUAL:	// support "a.b ?? && expr"
		case RPAREN:	// support "(a.b ??)"
		case RBRACK:	// support "[start .. end ??]"
		case RBRACE:	// support "{key : value ??}"
		case RANGE:		// support "[start ?? .. end]"
		case COLON:		// support "c ? a ?? : b"
		case EOF:
			return null;
		default :
			throw new ParseException("Expression error: can not match the symbol \"" + tok.value() + "\"", location);
		}
	}
1341084
def select_functions(expr):
    
    body = Group(expr)
    return Group(
        function("timestamp", body, caseless=True)
        | function("ts", body, caseless=True)
        | function("utctimestamp", body, caseless=True)
        | function("utcts", body, caseless=True)
        | function("now", caseless=True)
        | function("utcnow", caseless=True)
    ).setResultsName("function")
735987
public static int listFindNoCase(String list, String value, String delimiter, boolean trim) {
	Array arr = trim ? listToArrayTrim(list, delimiter) : listToArray(list, delimiter);
	int len = arr.size();
	for (int i = 1; i <= len; i++) {
	    if (((String) arr.get(i, "")).equalsIgnoreCase(value)) return i - 1;
	}
	return -1;
    }
373602
def aslist(obj, sep=None, strip=True):
    
    if isinstance(obj, (basestring)):
        lst = obj.split(sep)
        if strip:
            lst = [v.strip() for v in lst]
        return lst
    elif isinstance(obj, (list, tuple)):
        return obj
    elif obj is None:
        return []
    else:
        return [obj]
1167563
def p_arg_list(p):
    
    if len(p) == 2:
        p[0] = node.expr_list([p[1]])
    elif len(p) == 4:
        p[0] = p[1]
        p[0].append(p[3])
    else:
        assert 0
    assert isinstance(p[0], node.expr_list)
493614
def p_encaps_list_string(p):
    ''
    if p[1] == '':
        p[0] = p[2].decode('string_escape')
    else:
        p[0] = ast.BinaryOp('.', p[1], p[2].decode('string_escape'),
                            lineno=p.lineno(2))
1117622
def p_case_clause(self, p):
        """"""
        p[0] = ast.Case(expr=p[2], elements=p[4])
1292615
def p_instance_or(self, p):
        ''
        instancelist = []
        for instance_name, instance_ports, instance_array in p[3]:
            instancelist.append(Instance(p[1], instance_name, instance_ports,
                                         p[2], instance_array, lineno=p.lineno(1)))
        p[0] = InstanceList(p[1], p[2], tuple(
            instancelist), lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))