public ArgumentInfo(string type, string name)
        {
            CodeGenerationUtility.CheckNullOrWhitespaceArgument(type, nameof(type));
            CodeGenerationUtility.CheckValidIdentifierArgument(name, nameof(name));

            Type = type.Trim();
            Name = name;
        }
        public MethodCallCodeGenerator(ILanguageAbstraction languageAbstraction, string name, params string[] parameters)
        {
            if (languageAbstraction == null)
            {
                throw new ArgumentNullException(nameof(languageAbstraction));
            }

            CodeGenerationUtility.CheckValidIdentifierArgument(name, nameof(name));

            Language = languageAbstraction;

            this.name       = name;
            this.parameters = parameters;
        }
Пример #3
0
        private void Initialization(ILanguageAbstraction languageAbstraction, AccessModifier accessModifier, string[] additionalModifiers, string type, string name)
        {
            if (languageAbstraction == null)
            {
                throw new ArgumentNullException(nameof(languageAbstraction));
            }

            CodeGenerationUtility.CheckNullOrWhitespaceArgument(type, nameof(type));
            CodeGenerationUtility.CheckValidIdentifierArgument(name, nameof(name));

            Language = languageAbstraction;

            this.accessModifier      = accessModifier;
            this.additionalModifiers = additionalModifiers;
            this.type = type.Trim();
            this.name = name;
        }
        public MethodDeclarationCodeGenerator(ILanguageAbstraction languageAbstraction, AccessModifier accessModifier, bool isStatic, string[] additionalModifiers, string returnType, string name, ArgumentInfo[] arguments, ScopeCodeGenerator bodyGenerator)
        {
            if (languageAbstraction == null)
            {
                throw new ArgumentNullException(nameof(languageAbstraction));
            }
            CodeGenerationUtility.CheckValidIdentifierArgument(name, nameof(name));

            Language = languageAbstraction;

            this.accessModifier      = accessModifier;
            this.isStatic            = isStatic;
            this.additionalModifiers = additionalModifiers;
            if (string.IsNullOrWhiteSpace(returnType) == false)
            {
                this.returnType = returnType.Trim();
            }
            this.name          = name;
            this.arguments     = arguments;
            this.bodyGenerator = bodyGenerator;
        }