Stitching
Stitching
- The pass should search the model and find all of its substitutions (regex: {1:(?:\d-\d|[A-Z])(?::[prs])?}, with # being the pass number.
- The master index i and the substitution counter subcount should both be reset to 0
- For each substitution marker...
- Create a new Substitution object, storing all of the valid values in order, and the end-of-column behavior (rule). The object must be able to be looked up by its substitution.
- Increment the substitution counter subcount.
- Using regex, replace each relevant substitution marker with the appropriate replacements, probably using something like substitute("{1:A:r}", i). Resolving the index i to the proper value following rules must take place inside of the substitution object itself.
- Check each substitution object (probably with something like status("{1:A:r}") for completion Use return codes, such as 0=not done, 1=done, 2=done, force stop. Decrement subcount for each return 1, and drop to 0 upon encountering any return 2.
- Once subcount == 0, the pass is done. For each pre-result, repeat for the next pass from step 1.
NOTE: If there are still valid substitution markers, but none for a given pass, skip to the next. Don't require the user to always have the pass numbers in order. Mistakes happen - be nice.
Tags
None
Subscribers
None
- Last Author
- jcmcdonald
- Last Edited
- Apr 22 2016, 7:17 PM