1 package kawa.lang; 2 import gnu.expr.*; 3 import java.util.Vector ; 4 5 6 7 public class PatternScope extends LetExp 8 { 9 PatternScope previousSyntax; 10 11 14 public Vector pattern_names; 15 16 22 public StringBuffer patternNesting; 23 24 public Declaration matchArray; 26 27 public PatternScope () 28 { 29 super(null); 30 } 31 32 public static PatternScope push (Translator tr) 33 { 34 PatternScope newScope = new PatternScope(); 35 PatternScope oldScope = tr.patternScope; 36 newScope.previousSyntax = oldScope; 37 tr.patternScope = newScope; 38 if (oldScope == null) 39 { 40 newScope.pattern_names = new Vector (); 41 newScope.patternNesting = new StringBuffer (); 42 } 43 else 44 { 45 newScope.pattern_names = (Vector ) oldScope.pattern_names.clone(); 46 newScope.patternNesting 47 = new StringBuffer (oldScope.patternNesting.toString()); 48 } 49 newScope.outer = tr.currentScope(); 50 return newScope; 51 } 52 53 public static void pop (Translator tr) 54 { 55 tr.patternScope = tr.patternScope.previousSyntax; 56 } 57 58 64 65 } 66 | Popular Tags |