def p_createbase2(t): '''createbase2 : CREATE DATABASE IF NOT2 EXIST2 ID | CREATE error DATABASE IF NOT2 EXIST2 ID | CREATE DATABASE error IF NOT2 EXIST2 ID | CREATE DATABASE IF error NOT2 EXIST2 ID ''' t[0] = Declarevar(t[6], "", t.slice[1].lineno, find_column(t.slice[1]), t[2])
def p_createbase(t): '''createbase : CREATE DATABASE ID | CREATE error DATABASE ID | CREATE DATABASE error ID ''' t[0] = Declarevar(t[3], "", t.slice[1].lineno, find_column(t.slice[1]), t[2])
def ejecutar(self, entorno, tree): print("1001 ") simbolo = entorno.get(str(self.id)) #sino esta en la tabla de symbol print("tt6 ") #print("tt6 "+self.value) y = {} # if(not isinstance(self.value,dict)): y = self.value.getValor(entorno, tree) print("tt6zp9 con y= ") print(y) print("tt6z ") if (simbolo == None): print("1002b ") print("1002b symbolline=" + self.line) print("1002b symbolcolumn=" + self.column) declarar = Declarevar(str(self.id), str(y), self.line, self.column, self.type) print("1002k ") declarar.ejecutar(entorno, tree) else: print("1002c ") simbolo.value = value entorno.replacesymbol(simbolo) return False
def ejecutar(self, entorno, tree): simbolo = entorno.get(str(self.id)) y = {} y = self.value.getValor(ent, tree) if (simbolo == None): declarar = Declarevar(str(self.id), y, self.line, self.column, "", self.declared) declarar.ejecutar(entorno, tree) else: simbolo.value = value entorno.replacesymbol(simbolo) return False
def p_expresion(t): 'expresion : ID TIPODATO compl' t[0] = Declarevar(t[1], "", t.slice[1].lineno, find_column(t.slice[1]), t[2])