Esempio n. 1
0
        public bool Validate(CodeGenerationOptions opt, GenericParameterDefinitionList type_params, CodeGeneratorContext context)
        {
            Symbol = opt.SymbolTable.Lookup(TypeName, type_params);

            if (Symbol == null || !Symbol.Validate(opt, type_params, context))
            {
                Report.Warning(0, Report.WarningField + 0, "unexpected field type {0} {1}.", TypeName, context.ContextString);
                return(false);
            }

            if (!string.IsNullOrEmpty(Value) && Symbol != null && Symbol.FullName == "char" && !Value.StartsWith("(char)"))
            {
                Value = "(char)" + Value;
            }

            SetParameters = new ParameterList {
                SetterParameter,
            };

            if (!SetParameters.Validate(opt, type_params, context))
            {
                throw new NotSupportedException(
                          string.Format("Unable to generate setter parameter list {0}", context.ContextString));
            }

            return(true);
        }
Esempio n. 2
0
        protected virtual bool OnValidate(CodeGenerationOptions opt, GenericParameterDefinitionList type_params)
        {
            var tpl = GenericParameterDefinitionList.Merge(type_params, GenericArguments);

            if (!parms.Validate(opt, tpl))
            {
                return(false);
            }
            if (Parameters.Count > 14)
            {
                Report.Warning(0, Report.WarningMethodBase + 0, "More than 16 parameters were found, which goes beyond the maximum number of parameters. ({0})", opt.ContextString);
                return(false);
            }
            return(true);
        }
Esempio n. 3
0
		public bool Validate (CodeGenerationOptions opt, GenericParameterDefinitionList type_params)
		{
			symbol = SymbolTable.Lookup (TypeName, type_params);
			
			if (symbol == null || !symbol.Validate (opt, type_params)) {
				Report.Warning (0, Report.WarningField + 0, "unexpected field type {0} {1}.", TypeName, opt.ContextString);
				return false;
			}

			setParameters = new ParameterList () {
				SetterParameter,
			};
			if (!setParameters.Validate (opt, type_params))
				throw new NotSupportedException (
					string.Format ("Unable to generate setter parameter list {0}", opt.ContextString));

			return true;
		}