Example #1
0
        public string ReplaceAll([NotNull] ParserRuleContext context)
        {
            GetReplacements(context);

            var newSource = source;

            while (Replacements.Count > 0)
            {
                var replacement = Replacements.Pop();
                newSource = replacement.Replace(newSource);
            }
            return(newSource);
        }
Example #2
0
        public string ReplaceRemaining([NotNull] ParserRuleContext context)
        {
            justCompoundStatements = false;
            GetReplacements(context);

            var newSource = source;

            while (Replacements.Count > 0)
            {
                var replacement = Replacements.Pop();
                newSource = replacement.Replace(newSource);
            }
            return(newSource);
        }