示例#1
0
        public override void CacheForProcessing()
        {
            if (functionTemplateTypes != null && functionTemplateTypes != "")
            {
                List <string> lCleanBody = new List <string>();
                foreach (var lLine in functionBody)
                {
                    lCleanBody.Add(CleanConcatination(lLine));
                }
                functionBody = lCleanBody;
                if (functionTemplateTypes != null && functionTemplateTypes != "")
                {
                    functionTemplateTypes = CleanConcatination(functionTemplateTypes);
                }

                if (functionReturnPreQualifiers != null)
                {
                    functionReturnPreQualifiers = CleanConcatination(functionReturnPreQualifiers);
                }
                if (functionReturnTypes != null)
                {
                    functionReturnTypes = CleanConcatination(functionReturnTypes);
                }
                if (functionPostQualifiers != null)
                {
                    functionPostQualifiers = CleanConcatination(functionPostQualifiers);
                }
                if (functionNamespace != null)
                {
                    functionNamespace = CleanConcatination(functionNamespace);
                }
                if (functionName != null)
                {
                    functionName = CleanConcatination(functionName);
                }
                if (functionParameters != null)
                {
                    functionParameters = CleanConcatination(functionParameters);
                }

                Regex lRemoveTemplateTypes = new Regex("(?:<|,)(?:\\s*" + TemplateInstantiationPlugin.NameIdentRegex() + "\\s+)(" + TemplateInstantiationPlugin.TypeIdent() + "\\s*)" + TemplateInstantiationPlugin.DefaultValue() + "?");
                //Regex lRemoveTemplateTypes = new Regex("(?:<|,)(?:\\s*[a-zA-Z0-9_]+\\s+)([a-zA-Z_][a-zA-Z0-9_]*)");
                MatchCollection lMatches = lRemoveTemplateTypes.Matches(functionTemplateTypes);
                instanceTypeblock = "<";
                foreach (Match lMatch in lMatches)
                {
                    instanceTypeblock += lMatch.Groups[1].Value + ",";
                }
                instanceTypeblock  = instanceTypeblock.Remove(instanceTypeblock.Length - 1, 1);
                instanceTypeblock += ">";
            }
            else
            {
                instanceTypeblock = null;
            }
        }
示例#2
0
        public static string FunctionDeclarationRegex()
        {
            string lDeclaration = "^" + TemplateInstantiationPlugin.TemplateDeclaration() + "?" + PreQualifiersRegex() + "?\\s*(" + TemplateInstantiationPlugin.TypeIdentReturn() + ")(" + TemplateInstantiationPlugin.NamespaceDeclaration() + ")(" + TemplateInstantiationPlugin.NameIdentRegex() + ")\\(([^)]*)\\)" + PostQualifiersRegex() + "?";

            return(lDeclaration);
        }