Exemple #1
0
 public virtual void VisitTypeRef(BoundTypeRef x)
 {
     if (x != null)
     {
         Accept(x.TypeExpression);
     }
 }
 internal static ImmutableArray <BoundTypeRef> Flattern(BoundTypeRef tref)
 {
     if (tref is BoundMultipleTypeRef mtref)
     {
         return(mtref.BoundTypes);
     }
     else
     {
         return(ImmutableArray.Create(tref));
     }
 }
Exemple #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);
        }
Exemple #4
0
 public BoundNewEx(BoundTypeRef tref, ImmutableArray <BoundArgument> arguments)
     : base(arguments)
 {
     _typeref = tref;
 }
Exemple #5
0
 public BoundStaticFunctionCall(BoundTypeRef typeRef, BoundRoutineName name, ImmutableArray <BoundArgument> arguments) : base(arguments)
 {
     _typeRef = typeRef;
     _name    = name;
 }
Exemple #6
0
 public static BoundFieldRef CreateClassConst(BoundTypeRef parent, BoundVariableName name) => new BoundFieldRef()
 {
     _parentType = parent, _fieldName = name, _type = FieldType.ClassConstant
 };
Exemple #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;
        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);
        }
Exemple #11
0
 public ITypeSymbol EmitLoadTypeInfo(CodeGenerator cg, bool throwOnError = false) => BoundTypeRef.EmitLoadPhpTypeInfo(cg, _symbol);
Exemple #12
0
 public BoundIndirectStFieldPlace(BoundTypeRef typeref, BoundVariableName fldname, BoundFieldRef boundref)
 {
     _type = typeref;
     _name = fldname;
     _boundref = boundref;
 }
 public virtual void VisitTypeRef(BoundTypeRef x)
 {
     Accept(x.TypeExpression);
 }
Exemple #14
0
 public override BoundOperation VisitTypeRef(BoundTypeRef x)
 {
     // TODO
     return(default);
 public virtual TResult VisitTypeRef(BoundTypeRef x) => DefaultVisitOperation(x);
 internal virtual TResult VisitTypeRef(BoundTypeRef x) => DefaultVisitOperation(x);
Exemple #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;
        }