public string Visit(AST_New_Type node) { var s = methodcontext.GenLocal("exp", true); if (node.type.Type == "SELF_TYPE") { var s2 = methodcontext.GenLocal("get_type", true); methodcontext.Staments.Add(new CIL_TypeOf("self", s2)); methodcontext.Staments.Add(new CIL_Allocate(s2, s, true)); } else { methodcontext.Staments.Add(new CIL_Allocate(node.type.Type, s, false)); } return(s); }
public bool Visit(AST_New_Type node) { if (node.type.Type == "SELF_TYPE") { node.MyType = CurrType; return(true); } //if (node.type.Type == "Int" || node.type.Type == "Bool" || node.type.Type == "String") if (!All_Types.ContainsKey(node.type.Type)) { CurrErrorLoger.LogError(node.row, node.col, "El tipo definido no existe"); return(false); } if (!All_Types.ContainsKey(node.type.Type)) { CurrErrorLoger.LogError(node.row, node.col, "Tipo no definido"); return(false); } node.MyType = All_Types[node.type.Type]; return(true); }
public bool Visit(AST_New_Type node) { return(true); }
public bool Visit(AST_New_Type node) { throw new NotImplementedException(); }
public Base_Object_Value Visit(AST_New_Type node) { throw new NotImplementedException(); }