Example #1
0
 public virtual void Replace(string programName, int from, int to, object text)
     {
     if (from > to || from < 0 || to < 0 || to >= tokens.Count)
         {
         throw new ArgumentOutOfRangeException("replace: range invalid: " + from + ".." +
             to + "(size=" + tokens.Count + ")");
         }
     RewriteOperation op = new ReplaceOp(from, to, text, this);
     IList rewrites = GetProgram(programName);
     op.instructionIndex = rewrites.Count;
     rewrites.Add(op);
     }
 public virtual void Replace(string programName, int from, int to, object text)
 {
     if (((from > to) || (from < 0)) || ((to < 0) || (to >= base._tokens.Count)))
     {
         throw new ArgumentException(string.Concat(new object[] { "replace: range invalid: ", from, "..", to, "(size=", base._tokens.Count, ")" }));
     }
     RewriteOperation item = new ReplaceOp(this, from, to, text);
     IList<RewriteOperation> program = this.GetProgram(programName);
     item.instructionIndex = program.Count;
     program.Add(item);
 }