def p_selectStmt(t): """selectStmt : R_SELECT selectParams whereCl""" if t[3] == None: t[0] = instruction.SelectOnlyParams(t[2].params, t[2].params[0].row, t[2].params[0].row) else: t[0] = instruction.Select(t[2].params, t[3], df.dataTable, t[2].row, t[2].column)
def p_selectStmt_2(t): """selectStmt : R_SELECT selectParams fromCl whereCl groupByCl limitCl""" t[0] = instruction.Select( t[2].params, t[3], t[4], t[5][0], t[5][1], t[6], False, t.slice[1].lineno, t.slice[1].lexpos, ) repGrammar.append(t.slice)
def p_selectStmt_1(t): """selectStmt : R_SELECT R_DISTINCT selectParams fromCl whereCl groupByCl orderByCl limitCl""" t[0] = instruction.Select( t[3].params, t[4], t[5], t[6][0], t[6][1], t[8], True, t[7], t.slice[1].lineno, t.slice[1].lexpos, ) repGrammar.append(t.slice)
def p_selectStmt_2(t): """selectStmt : R_SELECT selectParams fromCl whereCl""" t[0] = instruction.Select(t[2].params, t[3], t[4], t.slice[1].lineno, t.slice[1].lexpos)