Lines Matching full:rewrites
83 * rewrites from a single pass over the input. Just name the instruction
108 /** <summary>What index into rewrites List are we?</summary> */
307 IList<RewriteOperation> rewrites = GetProgram( programName );
308 op.instructionIndex = rewrites.Count;
309 rewrites.Add( op );
339 IList<RewriteOperation> rewrites = GetProgram( programName );
340 op.instructionIndex = rewrites.Count;
341 rewrites.Add( op );
454 rewrites;
455 if ( !programs.TryGetValue( programName, out rewrites ) )
456 rewrites = null;
464 if ( rewrites == null || rewrites.Count == 0 )
471 IDictionary<int, RewriteOperation> indexToOp = ReduceToSingleOperationPerIndex( rewrites );
565 protected virtual IDictionary<int, RewriteOperation> ReduceToSingleOperationPerIndex( IList<RewriteOperation> rewrites )
567 //System.out.println("rewrites="+rewrites);
570 for ( int i = 0; i < rewrites.Count; i++ )
572 RewriteOperation op = rewrites[i];
577 ReplaceOp rop = (ReplaceOp)rewrites[i];
579 var inserts = GetKindOfOps( rewrites, typeof( InsertBeforeOp ), i );
587 rewrites[iop.instructionIndex] = null;
593 rewrites[iop.instructionIndex] = null;
597 var prevReplaces = GetKindOfOps( rewrites, typeof( ReplaceOp ), i );
604 rewrites[prevRop.instructionIndex] = null;
617 rewrites[prevRop.instructionIndex] = null; // kill first delete
631 for ( int i = 0; i < rewrites.Count; i++ )
633 RewriteOperation op = (RewriteOperation)rewrites[i];
638 InsertBeforeOp iop = (InsertBeforeOp)rewrites[i];
640 var prevInserts = GetKindOfOps( rewrites, typeof( InsertBeforeOp ), i );
650 rewrites[prevIop.instructionIndex] = null;
654 var prevReplaces = GetKindOfOps( rewrites, typeof( ReplaceOp ), i );
661 rewrites[i] = null; // delete current insert
671 // System.out.println("rewrites after="+rewrites);
673 for ( int i = 0; i < rewrites.Count; i++ )
675 RewriteOperation op = (RewriteOperation)rewrites[i];
694 protected virtual IList<RewriteOperation> GetKindOfOps( IList<RewriteOperation> rewrites, Type kind )
696 return GetKindOfOps( rewrites, kind, rewrites.Count );
700 protected virtual IList<RewriteOperation> GetKindOfOps( IList<RewriteOperation> rewrites, Type kind, int before )
703 for ( int i = 0; i < before && i < rewrites.Count; i++ )
705 RewriteOperation op = rewrites[i];