1 //------------------------------------------------------------------------------
2 // <copyright file="TemplateBaseAction.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // <owner current="true" primary="true">Microsoft</owner>
6 //------------------------------------------------------------------------------
8 namespace System.Xml.Xsl.XsltOld {
9 using Res = System.Xml.Utils.Res;
11 using System.Diagnostics;
12 using System.Collections;
14 using System.Xml.XPath;
15 using System.Globalization;
17 // RootAction and TemplateActions have a litle in common -- they are responsible for variable allocation
18 // TemplateBaseAction -- implenemts this shared behavior
20 internal abstract class TemplateBaseAction : ContainerAction {
21 protected int variableCount; // space to allocate on frame for variables
22 private int variableFreeSlot; // compile time counter responsiable for variable placement logic
24 public int AllocateVariableSlot() {
25 // Variable placement logic. Optimized
26 int thisSlot = this.variableFreeSlot;
27 this.variableFreeSlot ++;
28 if(this.variableCount < this.variableFreeSlot) {
29 this.variableCount = this.variableFreeSlot;
34 public void ReleaseVariableSlots(int n) {
35 // This code does optimisation of variable placement. Comented out for this version
36 // Reuse of the variable disable the check that variable was assigned before the actual use
37 // this check has to be done in compile time n future.
38 // this.variableFreeSlot -= n;