def p_updateStmt(t): """updateStmt : R_UPDATE fromBody R_SET updateCols whereCl""" fc = instruction.FromClause([t[2][0]], [t[2][1]], t.slice[1].lineno, t.slice[1].lexpos) t[0] = instruction.Update(fc, t[4], t[5], t.slice[1].lineno, t.slice[1].lexpos) repGrammar.append(t.slice)
def p_fromClause(t): """ fromCl : R_FROM tableExp """ tables = [] aliases = [] for i in range(len(t[2])): tables.append(t[2][i][0]) aliases.append(t[2][i][1]) t[0] = instruction.FromClause(tables, aliases, t.slice[1].lineno, t.slice[1].lexpos) repGrammar.append(t.slice)