Exemplo n.º 1
0
        protected CodegenProperty(
            Type returnType,
            string returnTypeName,
            Type generator,
            CodegenSymbolProvider optionalSymbolProvider,
            CodegenScope env)
        {
            if (generator == null) {
                throw new ArgumentException("Invalid null generator");
            }

            ReturnType = returnType;
            ReturnTypeName = returnTypeName;
            OptionalSymbolProvider = optionalSymbolProvider;
            Block = new CodegenBlock(); // no return from the property block
            GetterStatement = new Getter(Block);
            SetterStatement = new Getter(Block);
            GetterBlock = new CodegenBlock(GetterStatement);
            SetterBlock = new CodegenBlock(SetterStatement);
            if (env.IsDebug) {
                AdditionalDebugInfo = GetGeneratorDetail(generator);
            }
            else {
                AdditionalDebugInfo = generator.GetSimpleName();
            }
        }
Exemplo n.º 2
0
 public static CodegenMethod MakeParentNode(
     Type returnType,
     Type generator,
     CodegenSymbolProvider symbolProvider,
     CodegenScope env)
 {
     return MakeParentNode(returnType.FullName, generator, symbolProvider, env);
 }
Exemplo n.º 3
0
        public static CodegenProperty MakePropertyNode(
            Type returnType,
            Type generator,
            CodegenScope env)
        {
            if (returnType == null) {
                throw new ArgumentException("Invalid null return type");
            }

            return new CodegenProperty(returnType, null, generator, CodegenSymbolProviderEmpty.INSTANCE, env);
        }
Exemplo n.º 4
0
        public CodegenProperty MakeChild(
            string returnType,
            Type generator,
            CodegenScope env)
        {
            if (returnType == null) {
                throw new ArgumentException("Invalid null return type");
            }

            return AddChild(new CodegenProperty(null, returnType, generator, null, env));
        }
Exemplo n.º 5
0
        public CodegenMethod MakeChild(
            Type returnType,
            Type generator,
            CodegenScope env)
        {
            if (returnType == null) {
                throw new ArgumentException("Invalid null return type");
            }

            return AddChild(new CodegenMethod(returnType, null, generator, null, env));
        }
Exemplo n.º 6
0
        public CodegenProperty MakeChildWithScope(
            Type returnType,
            Type generator,
            CodegenSymbolProvider symbolProvider,
            CodegenScope env)
        {
            if (returnType == null) {
                throw new ArgumentException("Invalid null return type");
            }

            return AddChild(new CodegenProperty(returnType, null, generator, symbolProvider, env));
        }
Exemplo n.º 7
0
        public static CodegenProperty MakePropertyNode(
            string returnTypeName,
            Type generator,
            CodegenSymbolProvider symbolProvider,
            CodegenScope env)
        {
            if (returnTypeName == null) {
                throw new ArgumentException("Invalid null return type");
            }

            if (symbolProvider == null) {
                throw new ArgumentException("No symbol provider");
            }

            return new CodegenProperty(null, returnTypeName, generator, symbolProvider, env);
        }
Exemplo n.º 8
0
        public static CodegenMethod MakeMethod(
            Type returnType,
            Type generator,
            CodegenSymbolProvider symbolProvider,
            CodegenScope env)
        {
            if (returnType == null) {
                throw new ArgumentException("Invalid null return type");
            }

            if (symbolProvider == null) {
                throw new ArgumentException("No symbol provider");
            }

            return new CodegenMethod(returnType, null, generator, symbolProvider, env);
        }
Exemplo n.º 9
0
        protected CodegenMethod(
            Type returnType,
            string returnTypeName,
            Type generator,
            CodegenSymbolProvider optionalSymbolProvider,
            CodegenScope env)
        {
            if (generator == null) {
                throw new ArgumentException("Invalid null generator");
            }

            ReturnType = returnType;
            ReturnTypeName = returnTypeName;
            OptionalSymbolProvider = optionalSymbolProvider;
            Block = new CodegenBlock(this);
            if (env.IsDebug) {
                AdditionalDebugInfo = GetGeneratorDetail(generator);
            }
            else {
                AdditionalDebugInfo = generator.GetSimpleName();
            }
        }
Exemplo n.º 10
0
 public static CodegenProperty MakePropertyNode<T>(
     Type generator,
     CodegenScope env)
 {
     return MakePropertyNode(typeof(T), generator, env);
 }
Exemplo n.º 11
0
 public static CodegenMethod MakeParentNode<T>(
     Type generator,
     CodegenScope env)
 {
     return MakeMethod(typeof(T), generator, env);
 }