home *** CD-ROM | disk | FTP | other *** search
- import java.io.ByteArrayOutputStream;
- import java.io.PrintStream;
-
- public class JScriptExpressionStack extends JSbxStack {
- public final JSbxValue PopValue() throws JSbxException {
- return ((JSbxVector)this).GetSize() == 0 ? null : this.GetJSbxValue((JSbxBase)((JSbxStack)this).Pop());
- }
-
- public final JSbxValue PeekValue() throws JSbxException {
- return ((JSbxVector)this).GetSize() == 0 ? null : this.GetJSbxValue((JSbxBase)((JSbxStack)this).Peek());
- }
-
- public final void PushValue(JSbxValue var1) throws JSbxException {
- ((JSbxStack)this).Push(var1);
- }
-
- public final JSbxProperty PopProperty() throws JSbxException {
- return ((JSbxVector)this).GetSize() == 0 ? null : this.GetJSbxProperty((JSbxBase)((JSbxStack)this).Pop());
- }
-
- public final JSbxProperty PeekProperty() throws JSbxException {
- return ((JSbxVector)this).GetSize() == 0 ? null : this.GetJSbxProperty((JSbxBase)((JSbxStack)this).Peek());
- }
-
- public final void PushProperty(JSbxProperty var1) throws JSbxException {
- ((JSbxStack)this).Push(var1);
- }
-
- private final JSbxProperty GetJSbxProperty(JSbxBase var1) throws JSbxException {
- return var1 instanceof JSbxProperty ? (JSbxProperty)var1 : null;
- }
-
- private final JSbxValue GetJSbxValue(JSbxBase var1) throws JSbxException {
- if (var1 instanceof JSbxProperty) {
- JSbxProperty var2 = (JSbxProperty)var1;
- JSbxValue var3 = new JSbxValue();
- var2.Get(var3);
- return var3;
- } else {
- return (JSbxValue)var1;
- }
- }
-
- public final String DEBUG_GetInfoString() {
- if (((JSbxVector)this).GetSize() == 0) {
- return new String("\tEMPTY");
- } else {
- ByteArrayOutputStream var1 = new ByteArrayOutputStream();
- PrintStream var2 = new PrintStream(var1);
- var2.println("\tTOP");
-
- try {
- for(int var3 = ((JSbxVector)this).GetSize() - 1; var3 >= 0; --var3) {
- var2.print(var3 + ".\t");
- JSbxBase var4 = (JSbxBase)((JSbxVector)this).Get(var3);
- if (var4 != null) {
- var4.Dump(var2, 0, 0);
- }
- }
- } catch (JSbxException var5) {
- }
-
- return var1.toString();
- }
- }
- }
-