Ejemplo n.º 1
0
 public override Type GetTLType(PackagesContext packagesContext)
 {
     if (packagesContext == null)
     {
         return(new Type(this.Identifier.Symbol, null, TypeCategory.Class));
     }
     return(packagesContext.GetTLType(this.Identifier.Symbol));
 }
        protected override Expression[] OnGetExpressions(PackagesContext packagesContext, IContext expContext)
        {
            var c = packagesContext.GetClass(this.Identifier.Symbol);

            if (c == null)
            {
                throw new SyntaxException(string.Format("Cannot resolve symbol {0}", this.Identifier.Symbol), this.Identifier.Line, this.Identifier.Column);
            }
            return(this.GetExpressionsWithValue(packagesContext.GetTLType(this.Identifier.Symbol)));
        }
        protected override Expression[] OnGetExpressions(PackagesContext packagesContext, IContext expContext)
        {
            var tlType = this.Type.Symbol.GetTLType(packagesContext);

            if (!tlType.IsDecidedType())
            {
                var type = packagesContext.GetTLType(tlType.Name);
                tlType.PackageName = type.PackageName;
                tlType.Name        = type.Name;
            }

            return(this.GetExpressionsWithValue(tlType));
        }
Ejemplo n.º 4
0
 public virtual void ClarifyType(PackagesContext packagesContext)
 {
     if (!this.IsDecidedType())
     {
         var type = packagesContext.GetTLType(this.Name);
         if (type == null)
         {
             throw new UnknowTypeException(string.Format("Cannot find type '{0}' in {1}", this.Name, packagesContext.Class.ClassFullName));
         }
         this.PackageName = type.PackageName;
         this.Name        = type.Name;
     }
 }
Ejemplo n.º 5
0
        protected override Expression[] OnGetExpressions(PackagesContext packagesContext, IContext expContext)
        {
            var symbol = this.Identifier.Symbol;
            var t      = packagesContext.GetTLType(symbol);

            if (t != null)
            {
                return(this.GetExpressionsWithClass(t));
            }
            var contextElement = expContext.GetElementInParent(symbol, expContext);

            if (contextElement != null)
            {
                return(this.GetExpressionsWithValue(contextElement.Type));
            }
            throw new SyntaxException(string.Format("Cannot resolve symbol '{0}'", this.Identifier.Symbol), this.Identifier.Line, this.Identifier.Column);
        }