public SemanticAtom Visit(NewObject n) { var t = new UtilizedType(n.Name, n.Location); AddToGlobalUtilization(t, null); return(null); }
public SemanticAtom Visit(MainClass n) { var method = new ClassMethod("main", null, n.MainMethodBody.Location); CurrentMethod = method; _localPosition = 0; var argsType = new UtilizedType(Primitive.StringArray.Name, n.Location); var argsArg = new MethodArgument(n.ArgsName, argsType, method.DeclarationLocation); AddToGlobalUtilization(argsType, s => { argsArg.RealizedType = s; }); method.Arguments.Add(argsArg.Name, argsArg); method.RealizedReturnType = Primitive.Void; method.AstReturnType = null; BlockStack = new Stack <ClassMethodBlock>(); method.MethodBody = n.MainMethodBody.Accept(this) as ClassMethodBlock; var c = new Class(n.Name, null, n.Location) { IsMainClass = true }; c.Methods.Add("main", method); AddToTypeTable(c); return(c); }
public SemanticAtom Visit(NewArray n) { var t = new UtilizedType(Primitive.IntArray.Name, n.Location); AddToGlobalUtilization(t, null); return(null); }
public SemanticAtom Visit(Cast n) { var utilizedType = new UtilizedType(n.TypeNameToCast, n.Location); AddToGlobalUtilization(utilizedType, s => { n.RealizedTypeToCast = s; }); n.Expression.Accept(this); return(null); }
public SemanticAtom Visit(Instanceof n) { var utilizedType = new UtilizedType(n.TypeNameToCheck, n.Location); AddToGlobalUtilization(utilizedType, s => { n.RealizedTypeToCheck = s; }); n.LeftExpression.Accept(this); return(null); }
private void AddToGlobalUtilization(UtilizedType utilizedType, Action <SemanticType> realizationAction) { Globals.TypeUtilization.Add(new UtilizationPointerTuple(utilizedType, realizationAction)); }
public SemanticAtom Visit(Custom n) { var t = new UtilizedType(n.Name, n.Location); return(t); }
public SemanticAtom Visit(AstString n) { var t = new UtilizedType(Primitive.String.Name, n.Location); return(t); }
public SemanticAtom Visit(Int n) { var t = new UtilizedType(Primitive.Int.Name, n.Location); return(t); }
public SemanticAtom Visit(AstBoolean n) { var t = new UtilizedType(Primitive.Boolean.Name, n.Location); return(t); }
public SemanticAtom Visit(ClassExtension n) { var t = new UtilizedType(n.Name, n.Location); return(t); }
public UtilizationPointerTuple(UtilizedType utilizedType, Action <SemanticType> realizationAction) : base(utilizedType, realizationAction) { }