001 package org.extendj.ast; 002 003 import java.util.HashSet; 004 import java.io.File; 005 import java.util.Set; 006 import java.util.Collections; 007 import java.util.Collection; 008 import java.util.ArrayList; 009 import beaver.*; 010 import java.util.*; 011 import java.io.ByteArrayOutputStream; 012 import java.io.PrintStream; 013 import java.lang.reflect.InvocationTargetException; 014 import java.lang.reflect.Method; 015 import org.jastadd.util.*; 016 import java.util.zip.*; 017 import java.io.*; 018 import org.jastadd.util.PrettyPrintable; 019 import org.jastadd.util.PrettyPrinter; 020 import java.io.FileNotFoundException; 021 import java.io.BufferedInputStream; 022 import java.io.DataInputStream; 023 /** 024 * @ast class 025 * @declaredat ASTNode$State:4 026 */ 027 public class ASTNode$State extends java.lang.Object { 028 029 030 /** 031 * @apilevel internal 032 */ 033 public boolean INTERMEDIATE_VALUE = false; 034 035 036 037 /** 038 * @apilevel internal 039 */ 040 public boolean IN_CIRCLE = false; 041 042 043 044 /** 045 * @apilevel internal 046 */ 047 public int CIRCLE_INDEX = 1; 048 049 050 051 /** 052 * @apilevel internal 053 */ 054 public boolean CHANGE = false; 055 056 057 058 /** 059 * @apilevel internal 060 */ 061 public boolean RESET_CYCLE = false; 062 063 064 065 /** 066 * @apilevel internal 067 */ 068 static public class CircularValue { 069 Object value; 070 int visited = -1; 071 } 072 073 074 /** 075 * @apilevel internal 076 */ 077 public static final int REWRITE_CHANGE = 1; 078 079 080 081 /** 082 * @apilevel internal 083 */ 084 public static final int REWRITE_NOCHANGE = 2; 085 086 087 088 /** 089 * @apilevel internal 090 */ 091 public static final int REWRITE_INTERRUPT = 3; 092 093 094 095 public int boundariesCrossed = 0; 096 097 098 099 // state code 100 private int[] stack; 101 102 103 104 private int pos; 105 106 107 108 public ASTNode$State() { 109 stack = new int[64]; 110 pos = 0; 111 } 112 113 114 115 private void ensureSize(int size) { 116 if (size < stack.length) 117 return; 118 int[] newStack = new int[stack.length * 2]; 119 System.arraycopy(stack, 0, newStack, 0, stack.length); 120 stack = newStack; 121 } 122 123 124 125 public void push(int i) { 126 ensureSize(pos+1); 127 stack[pos++] = i; 128 } 129 130 131 132 public int pop() { 133 return stack[--pos]; 134 } 135 136 137 138 public int peek() { 139 return stack[pos-1]; 140 } 141 142 public void reset() { 143 IN_CIRCLE = false; 144 CIRCLE_INDEX = 1; 145 CHANGE = false; 146 boundariesCrossed = 0; 147 148 } 149 150 151 }