4. The computer-implemented method of claim 3 , wherein a DoPattern in the grammar can be nested inside another DoPattern, which is translated to Java™ or C# as an inner class nested inside the inner class modeling the outer DoPattern, so that the inner DoPattern's pre-list and post-list statements have access not only to the variables of their own pre-list and post-list but also to the variables scoped to the outer DoPattern.
3. The computer-implemented method of claim 2 , wherein the translator module for a DoPattern grammar in the script generates a subclass of DoPatternImpl with the body, prelist, and postlist functions rendering the 3 components of a specific DoPattern in a script, such that this subclass is defined as an inner class of the scoping point of the DoPattern in the script and the member variables of the concrete inner DoPattern class model the variables local to the DoPattern pre-list and post-list statements, and such that the pre-list and post-list statements have access because they are members of an inner class to variables at all scoping points external to the DoPattern.