Ejemplo n.º 1
0
        public itemValor opDiferenciacion(String ambito, elementoEntorno elem)
        {
            IgualQue dif = new IgualQue(hijo1, hijo2, tabla, signo);

            itemValor retorno = dif.opIgualacion(ambito, elem);

            if (retorno.isTypeBooleano())
            {
                if (retorno.getBooleano())
                {
                    retorno.setValue(false);
                    return(retorno);
                }
                else
                {
                    retorno.setValue(true);
                    return(retorno);
                }
            }
            else
            {
                tabla.tablaErrores.insertErrorSemantic("No se recibió un booleano en" + ambito, signo);
                return(retorno);
            }
        }
Ejemplo n.º 2
0
        public itemValor opMayorIgualQue(String ambito, elementoEntorno elem)
        {
            IgualQue igualQue = new IgualQue(hijo1, hijo2, tabla, signo);

            itemValor retorno = igualQue.opIgualacion(ambito, elem);

            if (retorno.isTypeBooleano())
            {
                if (retorno.getBooleano())
                {
                    retorno.setValue(true);
                    return(retorno);
                }
                else
                {
                    MayorQue  mayorQue = new MayorQue(hijo1, hijo2, tabla, signo);
                    itemValor temp1    = mayorQue.opMayorQue(ambito, elem);
                    if (temp1.isTypeBooleano())
                    {
                        if (temp1.getBooleano())
                        {
                            retorno.setValue(true);
                            return(retorno);
                        }
                        else
                        {
                            retorno.setValue(false);
                            return(retorno);
                        }
                    }
                    else
                    {
                        tabla.tablaErrores.insertErrorSemantic("No se recibió un booleano en" + ambito, signo);
                        return(retorno);
                    }
                }
            }
            else
            {
                tabla.tablaErrores.insertErrorSemantic("No se recibió un booleano en" + ambito, signo);
                return(retorno);
            }
        }