示例#1
0
 public virtual void VisitTypeRef(BoundTypeRef x)
 {
     if (x != null)
     {
         Accept(x.TypeExpression);
     }
 }
示例#2
0
 internal static ImmutableArray <BoundTypeRef> Flattern(BoundTypeRef tref)
 {
     if (tref is BoundMultipleTypeRef mtref)
     {
         return(mtref.BoundTypes);
     }
     else
     {
         return(ImmutableArray.Create(tref));
     }
 }
示例#3
0
        BoundTypeRef BindTypeRef(AST.TypeRef tref)
        {
            var bound = new BoundTypeRef(tref);

            if (tref is AST.IndirectTypeRef)
            {
                bound.TypeExpression = BindExpression(((AST.IndirectTypeRef)tref).ClassNameVar);
            }

            return(bound);
        }
示例#4
0
 public BoundNewEx(BoundTypeRef tref, ImmutableArray <BoundArgument> arguments)
     : base(arguments)
 {
     _typeref = tref;
 }
示例#5
0
 public BoundStaticFunctionCall(BoundTypeRef typeRef, BoundRoutineName name, ImmutableArray <BoundArgument> arguments) : base(arguments)
 {
     _typeRef = typeRef;
     _name    = name;
 }
示例#6
0
 public static BoundFieldRef CreateClassConst(BoundTypeRef parent, BoundVariableName name) => new BoundFieldRef()
 {
     _parentType = parent, _fieldName = name, _type = FieldType.ClassConstant
 };
示例#7
0
 public static BoundFieldRef CreateStaticField(BoundTypeRef parent, BoundVariableName name) => new BoundFieldRef()
 {
     _parentType = parent, _fieldName = name, _type = FieldType.StaticField
 };
 public virtual TResult VisitTypeRef(BoundTypeRef x) => DefaultVisitType(x);
 protected virtual TResult DefaultVisitType(BoundTypeRef x) => default;
示例#10
0
        public override void VisitTypeRef(BoundTypeRef tref)
        {
            if (tref == null)
                return;

            if (tref.TypeRef is INamedTypeRef)
            {
                var qname = ((INamedTypeRef)tref.TypeRef).ClassName;
                if (qname.IsReservedClassName)
                {
                    if (qname.IsSelfClassName)
                    {
                        tref.ResolvedType = TypeCtx.ContainingType ?? new MissingMetadataTypeSymbol(qname.ToString(), 0, false);
                    }
                    else if (qname.IsParentClassName)
                    {
                        tref.ResolvedType = TypeCtx.ContainingType?.BaseType ?? new MissingMetadataTypeSymbol(qname.ToString(), 0, false);
                    }
                    else if (qname.IsStaticClassName)
                    {
                        this.Routine.Flags |= RoutineFlags.UsesLateStatic;

                        throw new NotImplementedException("Late static bound type.");
                    }
                }
                else
                {
                    tref.ResolvedType = (TypeSymbol)_model.GetType(qname);
                }
            }

            Accept(tref.TypeExpression);
        }
示例#11
0
 public ITypeSymbol EmitLoadTypeInfo(CodeGenerator cg, bool throwOnError = false) => BoundTypeRef.EmitLoadPhpTypeInfo(cg, _symbol);
示例#12
0
 public BoundIndirectStFieldPlace(BoundTypeRef typeref, BoundVariableName fldname, BoundFieldRef boundref)
 {
     _type = typeref;
     _name = fldname;
     _boundref = boundref;
 }
示例#13
0
 public virtual void VisitTypeRef(BoundTypeRef x)
 {
     Accept(x.TypeExpression);
 }
示例#14
0
 public override BoundOperation VisitTypeRef(BoundTypeRef x)
 {
     // TODO
     return(default);
 public virtual TResult VisitTypeRef(BoundTypeRef x) => DefaultVisitOperation(x);
示例#16
0
 internal virtual TResult VisitTypeRef(BoundTypeRef x) => DefaultVisitOperation(x);
示例#17
0
        public BoundTypeRef BindTypeRef(AST.TypeRef tref)
        {
            var bound = new BoundTypeRef(tref);

            if (tref is AST.IndirectTypeRef)
            {
                bound.TypeExpression = BindExpression(((AST.IndirectTypeRef)tref).ClassNameVar);
            }

            return bound;
        }