public bool GetTypeForObject(ISymbolTable symbolTable, string nameObject, out CoolType coolType) { var result = symbolTable.IsDefObject(nameObject, out var info); if (!result) { coolType = new NullType(); return(false); } GetTypeDefinition(info.Type, symbolTable, out coolType); coolType = coolType ?? new NullType(); return(true); }
public void AddType(ISymbolTable symbolTable) { symbolTable.IsDefObject("_self", out var info); Types.Add(info.Type, new CoolType(info.Type, symbolTable)); }