コード例 #1
0
        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);
        }
コード例 #2
0
 public void AddType(ISymbolTable symbolTable)
 {
     symbolTable.IsDefObject("_self", out var info);
     Types.Add(info.Type, new CoolType(info.Type, symbolTable));
 }