Ejemplo n.º 1
0
        public void Accept(CIL_SetAttr setAttr)
        {
            var type = setAttr.Instance.Type;

            var attr = Clases[type].GetAttribute(setAttr.Attr);
            int indx = Clases[type].AllAttributes().IndexOf(attr);

            int pos = 12 + (indx * 4);

            Text += "\t lw $v0, " + CurrentScope.VarInStack[setAttr.Instance.Value] + "($fp) \n";

            if (int.TryParse(setAttr.Value, out int n))
            {
                Text += "\t li $a0, " + n + " \n";
            }
            else
            {
                Text += "\t lw $a0, " + CurrentScope.VarInStack[setAttr.Value] + "($fp) \n";
            }

            Text += "\t sw $a0, " + pos + "($v0) \n";
        }
Ejemplo n.º 2
0
 public void Accept(CIL_SetAttr setAttr)
 {
     throw new System.NotImplementedException();
 }