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