MakeUnion() 공개 정적인 메소드

public static MakeUnion ( ISet bs ) : DataType
bs ISet
리턴 DataType
예제 #1
0
        public DataType GetAttrType(AttributeAccess a, DataType targetType)
        {
            ISet <Binding> bs = targetType.Table.LookupAttribute(a.FieldName.Name);

            if (bs == null)
            {
                analyzer.putProblem(a.FieldName, "attribute not found in type: " + targetType);
                DataType t = DataType.Unknown;
                t.Table.Path = targetType.Table.ExtendPath(analyzer, a.FieldName.Name);
                return(t);
            }
            else
            {
                analyzer.addRef(a, targetType, bs);
                return(State.MakeUnion(bs));
            }
        }
예제 #2
0
        public DataType VisitIdentifier(Identifier id)
        {
            ISet <Binding> b = scope.Lookup(id.Name);

            if (b != null)
            {
                analyzer.putRef(id, b);
                analyzer.Resolved.Add(id);
                analyzer.unresolved.Remove(id);
                return(State.MakeUnion(b));
            }
            else if (id.Name == "True" || id.Name == "False")
            {
                return(DataType.Bool);
            }
            else
            {
                analyzer.putProblem(id, "unbound variable " + id.Name);
                analyzer.unresolved.Add(id);
                DataType t = DataType.Unknown;
                t.Table.Path = scope.extendPath(analyzer, id.Name);
                return(t);
            }
        }