public While_Trad(Expresion_Trad condition, Sentence_Trad sentences, int ct)
     : base(0, 0, "While")
 {
     this.condition = condition;
     this.sentences = sentences;
     this.cant_tabs = ct;
 }
Example #2
0
 public Arithmetic_Trad(Expresion_Trad l, Expresion_Trad ri, String t)
     : base("Arithmetic")
 {
     this.right = ri;
     this.left  = l;
     this.type  = t;
 }
 public Assignation_Trad(string id, Expresion_Trad value, int ct) :
     base(0, 0, "Assignation")
 {
     this.id        = id;
     this.value     = value;
     this.cant_tabs = ct;
 }
Example #4
0
        public Assignation_Trad VAR_ASSIGNATE(ParseTreeNode actual, int cant_tabs)
        {
            //VAR_ASSIGNATE.Rule = IDENTIFIER + DOS_PUNTOS + EQUALS + LOGIC_EXPRESION + PUNTO_COMA;
            var identifier = actual.ChildNodes[0].Token.Text;

            Expresion_Trad exp = null;


            var encontrado = false;

            for (int i = 0; i < actual.ChildNodes[3].ChildNodes.Count; i++)
            {
                var a = actual.ChildNodes[3].ChildNodes[i];
                if (a.Term.ToString().Equals("CALL_FUNCTION_PROCEDURE"))
                {
                    encontrado = true;
                    break;
                }
            }
            //SOLO ES UNA EXPRESION
            if (!encontrado)
            {
                exp = (new ExpressionTraduccion()).getExpresion(actual.ChildNodes[3]);

                return(new Assignation_Trad(identifier, exp, cant_tabs));
            }
            //ES UNA LLAMADA
            else
            {
                var llamada_funcion = (new Call_Exp_Traduccion()).CALLFUNCTION(actual.ChildNodes[3].ChildNodes[0]);
                return(new Assignation_Trad(identifier, llamada_funcion, cant_tabs));
            }
        }
Example #5
0
 public Arrays_Trad(string id, Expresion_Trad inf, Expresion_Trad sup, string dt, ArrayList elems)
 {
     this.id        = id;
     this.inf       = inf;
     this.sup       = sup;
     this.elementos = elems;
     this.dataType  = (dt);
 }
 public Switch_Trad(Expresion_Trad condicion, ArrayList cases, Case_Trad else_case, int ct) :
     base(0, 0, "Case")
 {
     this.condicion = condicion;
     this.cases     = cases;
     this.else_case = else_case;
     this.cant_tabs = ct;
 }
Example #7
0
 public Logical_Trad(Expresion_Trad l, Expresion_Trad r, string t, int ro, int c)
     : base("Logical")
 {
     this.left   = l;
     this.right  = r;
     this.type   = t;
     this.row    = ro;
     this.column = c;
 }
 public Case_Trad(Expresion_Trad condition, Sentence_Trad code, int ct)
     : base(0, 0, "Case")
 {
     this.condition = condition;
     this.sentence  = code;
     this.isNull    = false;
     this.isElse    = false;
     this.cant_tabs = ct;
 }
Example #9
0
 public If_Trad(Expresion_Trad condition, Instruction_Trad sentences, Instruction_Trad elif, int ct)
     : base(0, 0, "IF")
 {
     this.condition = condition;
     this.sentences = sentences;
     this.elif      = elif;
     this.IsNull    = false;
     this.cant_tabs = ct;
 }
Example #10
0
 //CONSTRUCTOR PARA VARIABLES
 public Declaration_Trad(string id, String dataType, Expresion_Trad ex, bool ic, int ct, bool refe)
     : base(0, 0, "Declaration")
 {
     this.id         = id;
     this.type       = dataType;
     this.value      = ex;
     this.isConst    = ic;
     this.cant_tabs  = ct;
     this.referencia = refe;
 }
Example #11
0
 public For_Trad(string initId, Expresion_Trad inicializacion, Expresion_Trad actualizacion,
                 Instruction_Trad sentence, string dir, int ct)
     : base(0, 0, "For")
 {
     this.initId         = initId;
     this.inicializacion = inicializacion;
     this.actualizacion  = actualizacion;
     this.sentence       = sentence;
     this.direccion      = dir;
     this.cant_tabs      = ct;
 }
Example #12
0
 public Relational_Trad(Expresion_Trad left, Expresion_Trad right, string type)
 {
     this.left  = left;
     this.right = right;
     this.type  = type;
 }