bsh

16:33:17.830 INFO  jd.cli.Main - Decompiling bsh.jar
package bsh;

import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;

class BSHAllocationExpression
  extends SimpleNode
{
  private static int innerClassCount = 0;
  
  BSHAllocationExpression(int paramInt)
  {
    super(paramInt);
  }
  
  public Object eval(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    SimpleNode localSimpleNode1 = (SimpleNode)jjtGetChild(0);
    SimpleNode localSimpleNode2 = (SimpleNode)jjtGetChild(1);
    if ((localSimpleNode1 instanceof BSHAmbiguousName))
    {
      BSHAmbiguousName localBSHAmbiguousName = (BSHAmbiguousName)localSimpleNode1;
      if ((localSimpleNode2 instanceof BSHArguments)) {
        return objectAllocation(localBSHAmbiguousName, (BSHArguments)localSimpleNode2, paramCallStack, paramInterpreter);
      }
      return objectArrayAllocation(localBSHAmbiguousName, (BSHArrayDimensions)localSimpleNode2, paramCallStack, paramInterpreter);
    }
    return primitiveArrayAllocation((BSHPrimitiveType)localSimpleNode1, (BSHArrayDimensions)localSimpleNode2, paramCallStack, paramInterpreter);
  }
  
  private Object objectAllocation(BSHAmbiguousName paramBSHAmbiguousName, BSHArguments paramBSHArguments, CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    NameSpace localNameSpace = paramCallStack.top();
    Object[] arrayOfObject = paramBSHArguments.getArguments(paramCallStack, paramInterpreter);
    if (arrayOfObject == null) {
      throw new EvalError("Null args in new.", this, paramCallStack);
    }
    Object localObject = paramBSHAmbiguousName.toObject(paramCallStack, paramInterpreter, false);
    localObject = paramBSHAmbiguousName.toObject(paramCallStack, paramInterpreter, true);
    Class localClass = null;
    if ((localObject instanceof ClassIdentifier)) {
      localClass = ((ClassIdentifier)localObject).getTargetClass();
    } else {
      throw new EvalError("Unknown class: " + text, this, paramCallStack);
    }
    int i = jjtGetNumChildren() > 2 ? 1 : 0;
    if (i != 0)
    {
      BSHBlock localBSHBlock = (BSHBlock)jjtGetChild(2);
      if (localClass.isInterface()) {
        return constructWithInterfaceBody(localClass, arrayOfObject, localBSHBlock, paramCallStack, paramInterpreter);
      }
      return constructWithClassBody(localClass, arrayOfObject, localBSHBlock, paramCallStack, paramInterpreter);
    }
    return constructObject(localClass, arrayOfObject, paramCallStack);
  }
  
  private Object constructObject(Class paramClass, Object[] paramArrayOfObject, CallStack paramCallStack)
    throws EvalError
  {
    Object localObject;
    try
    {
      localObject = Reflect.constructObject(paramClass, paramArrayOfObject);
    }
    catch (ReflectError localReflectError)
    {
      throw new EvalError("Constructor error: " + localReflectError.getMessage(), this, paramCallStack);
    }
    catch (InvocationTargetException localInvocationTargetException)
    {
      Interpreter.debug("The constructor threw an exception:\n\t" + localInvocationTargetException.getTargetException());
      throw new TargetError("Object constructor", localInvocationTargetException.getTargetException(), this, paramCallStack, true);
    }
    String str = paramClass.getName();
    if (str.indexOf("$") == -1) {
      return localObject;
    }
    This localThis = paramCallStack.top().getThis(null);
    NameSpace localNameSpace = Name.getClassNameSpace(localThis.getNameSpace());
    if ((localNameSpace != null) && (str.startsWith(localNameSpace.getName() + "$"))) {
      try
      {
        ClassGenerator.getClassGenerator().setInstanceNameSpaceParent(localObject, str, localNameSpace);
      }
      catch (UtilEvalError localUtilEvalError)
      {
        throw localUtilEvalError.toEvalError(this, paramCallStack);
      }
    }
    return localObject;
  }
  
  private Object constructWithClassBody(Class paramClass, Object[] paramArrayOfObject, BSHBlock paramBSHBlock, CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    String str = paramCallStack.top().getName() + "$" + ++innerClassCount;
    Modifiers localModifiers = new Modifiers();
    localModifiers.addModifier(0, "public");
    Class localClass;
    try
    {
      localClass = ClassGenerator.getClassGenerator().generateClass(str, localModifiers, null, paramClass, paramBSHBlock, false, paramCallStack, paramInterpreter);
    }
    catch (UtilEvalError localUtilEvalError)
    {
      throw localUtilEvalError.toEvalError(this, paramCallStack);
    }
    try
    {
      return Reflect.constructObject(localClass, paramArrayOfObject);
    }
    catch (Exception localException1)
    {
      Exception localException2;
      if ((localException1 instanceof InvocationTargetException)) {
        localException2 = (Exception)((InvocationTargetException)localException1).getTargetException();
      }
      throw new EvalError("Error constructing inner class instance: " + localException2, this, paramCallStack);
    }
  }
  
  private Object constructWithInterfaceBody(Class paramClass, Object[] paramArrayOfObject, BSHBlock paramBSHBlock, CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    NameSpace localNameSpace1 = paramCallStack.top();
    NameSpace localNameSpace2 = new NameSpace(localNameSpace1, "AnonymousBlock");
    paramCallStack.push(localNameSpace2);
    paramBSHBlock.eval(paramCallStack, paramInterpreter, true);
    paramCallStack.pop();
    localNameSpace2.importStatic(paramClass);
    try
    {
      return localNameSpace2.getThis(paramInterpreter).getInterface(paramClass);
    }
    catch (UtilEvalError localUtilEvalError)
    {
      throw localUtilEvalError.toEvalError(this, paramCallStack);
    }
  }
  
  private Object objectArrayAllocation(BSHAmbiguousName paramBSHAmbiguousName, BSHArrayDimensions paramBSHArrayDimensions, CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    NameSpace localNameSpace = paramCallStack.top();
    Class localClass = paramBSHAmbiguousName.toClass(paramCallStack, paramInterpreter);
    if (localClass == null) {
      throw new EvalError("Class " + paramBSHAmbiguousName.getName(localNameSpace) + " not found.", this, paramCallStack);
    }
    return arrayAllocation(paramBSHArrayDimensions, localClass, paramCallStack, paramInterpreter);
  }
  
  private Object primitiveArrayAllocation(BSHPrimitiveType paramBSHPrimitiveType, BSHArrayDimensions paramBSHArrayDimensions, CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    Class localClass = paramBSHPrimitiveType.getType();
    return arrayAllocation(paramBSHArrayDimensions, localClass, paramCallStack, paramInterpreter);
  }
  
  private Object arrayAllocation(BSHArrayDimensions paramBSHArrayDimensions, Class paramClass, CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    Object localObject = paramBSHArrayDimensions.eval(paramClass, paramCallStack, paramInterpreter);
    if (localObject != Primitive.VOID) {
      return localObject;
    }
    return arrayNewInstance(paramClass, paramBSHArrayDimensions, paramCallStack);
  }
  
  private Object arrayNewInstance(Class paramClass, BSHArrayDimensions paramBSHArrayDimensions, CallStack paramCallStack)
    throws EvalError
  {
    if (numUndefinedDims > 0)
    {
      Object localObject = Array.newInstance(paramClass, new int[numUndefinedDims]);
      paramClass = localObject.getClass();
    }
    try
    {
      return Array.newInstance(paramClass, definedDimensions);
    }
    catch (NegativeArraySizeException localNegativeArraySizeException)
    {
      throw new TargetError(localNegativeArraySizeException, this, paramCallStack);
    }
    catch (Exception localException)
    {
      throw new EvalError("Can't construct primitive array: " + localException.getMessage(), this, paramCallStack);
    }
  }
}

/* Location:
 * Qualified Name:     bsh.BSHAllocationExpression
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package bsh;

class BSHAmbiguousName
  extends SimpleNode
{
  public String text;
  
  BSHAmbiguousName(int paramInt)
  {
    super(paramInt);
  }
  
  public Name getName(NameSpace paramNameSpace)
  {
    return paramNameSpace.getNameResolver(text);
  }
  
  public Object toObject(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    return toObject(paramCallStack, paramInterpreter, false);
  }
  
  Object toObject(CallStack paramCallStack, Interpreter paramInterpreter, boolean paramBoolean)
    throws EvalError
  {
    try
    {
      return getName(paramCallStack.top()).toObject(paramCallStack, paramInterpreter, paramBoolean);
    }
    catch (UtilEvalError localUtilEvalError)
    {
      throw localUtilEvalError.toEvalError(this, paramCallStack);
    }
  }
  
  public Class toClass(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    try
    {
      return getName(paramCallStack.top()).toClass();
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      throw new EvalError(localClassNotFoundException.getMessage(), this, paramCallStack);
    }
    catch (UtilEvalError localUtilEvalError)
    {
      throw localUtilEvalError.toEvalError(this, paramCallStack);
    }
  }
  
  public LHS toLHS(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    try
    {
      return getName(paramCallStack.top()).toLHS(paramCallStack, paramInterpreter);
    }
    catch (UtilEvalError localUtilEvalError)
    {
      throw localUtilEvalError.toEvalError(this, paramCallStack);
    }
  }
  
  public Object eval(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    throw new InterpreterError("Don't know how to eval an ambiguous name!  Use toObject() if you want an object.");
  }
  
  public String toString()
  {
    return "AmbigousName: " + text;
  }
}

/* Location:
 * Qualified Name:     bsh.BSHAmbiguousName
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package bsh;

class BSHArguments
  extends SimpleNode
{
  BSHArguments(int paramInt)
  {
    super(paramInt);
  }
  
  public Object[] getArguments(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    Object[] arrayOfObject = new Object[jjtGetNumChildren()];
    for (int i = 0; i < arrayOfObject.length; i++)
    {
      arrayOfObject[i] = ((SimpleNode)jjtGetChild(i)).eval(paramCallStack, paramInterpreter);
      if (arrayOfObject[i] == Primitive.VOID) {
        throw new EvalError("Undefined argument: " + ((SimpleNode)jjtGetChild(i)).getText(), this, paramCallStack);
      }
    }
    return arrayOfObject;
  }
}

/* Location:
 * Qualified Name:     bsh.BSHArguments
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package bsh;

import java.lang.reflect.Array;

class BSHArrayDimensions
  extends SimpleNode
{
  public Class baseType;
  public int numDefinedDims;
  public int numUndefinedDims;
  public int[] definedDimensions;
  
  BSHArrayDimensions(int paramInt)
  {
    super(paramInt);
  }
  
  public void addDefinedDimension()
  {
    numDefinedDims += 1;
  }
  
  public void addUndefinedDimension()
  {
    numUndefinedDims += 1;
  }
  
  public Object eval(Class paramClass, CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    if (Interpreter.DEBUG) {
      Interpreter.debug("array base type = " + paramClass);
    }
    baseType = paramClass;
    return eval(paramCallStack, paramInterpreter);
  }
  
  public Object eval(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    SimpleNode localSimpleNode = (SimpleNode)jjtGetChild(0);
    Object localObject2;
    if ((localSimpleNode instanceof BSHArrayInitializer))
    {
      if (baseType == null) {
        throw new EvalError("Internal Array Eval err:  unknown base type", this, paramCallStack);
      }
      Object localObject1 = ((BSHArrayInitializer)localSimpleNode).eval(baseType, numUndefinedDims, paramCallStack, paramInterpreter);
      localObject2 = localObject1.getClass();
      int j = Reflect.getArrayDimensions((Class)localObject2);
      definedDimensions = new int[j];
      if (definedDimensions.length != numUndefinedDims) {
        throw new EvalError("Incompatible initializer. Allocation calls for a " + numUndefinedDims + " dimensional array, but initializer is a " + j + " dimensional array", this, paramCallStack);
      }
      Object localObject3 = localObject1;
      for (int k = 0; k < definedDimensions.length; k++)
      {
        definedDimensions[k] = Array.getLength(localObject3);
        if (definedDimensions[k] > 0) {
          localObject3 = Array.get(localObject3, 0);
        }
      }
      return localObject1;
    }
    definedDimensions = new int[numDefinedDims];
    for (int i = 0; i < numDefinedDims; i++) {
      try
      {
        localObject2 = ((SimpleNode)jjtGetChild(i)).eval(paramCallStack, paramInterpreter);
        definedDimensions[i] = ((Primitive)localObject2).intValue();
      }
      catch (Exception localException)
      {
        throw new EvalError("Array index: " + i + " does not evaluate to an integer", this, paramCallStack);
      }
    }
    return Primitive.VOID;
  }
}

/* Location:
 * Qualified Name:     bsh.BSHArrayDimensions
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package bsh;

import java.lang.reflect.Array;

class BSHArrayInitializer
  extends SimpleNode
{
  BSHArrayInitializer(int paramInt)
  {
    super(paramInt);
  }
  
  public Object eval(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    throw new EvalError("Array initializer has no base type.", this, paramCallStack);
  }
  
  public Object eval(Class paramClass, int paramInt, CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    int i = jjtGetNumChildren();
    int[] arrayOfInt = new int[paramInt];
    arrayOfInt[0] = i;
    Object localObject1 = Array.newInstance(paramClass, arrayOfInt);
    for (int j = 0; j < i; j++)
    {
      SimpleNode localSimpleNode = (SimpleNode)jjtGetChild(j);
      Object localObject2;
      if ((localSimpleNode instanceof BSHArrayInitializer))
      {
        if (paramInt < 2) {
          throw new EvalError("Invalid Location for Intializer, position: " + j, this, paramCallStack);
        }
        localObject2 = ((BSHArrayInitializer)localSimpleNode).eval(paramClass, paramInt - 1, paramCallStack, paramInterpreter);
      }
      else
      {
        localObject2 = localSimpleNode.eval(paramCallStack, paramInterpreter);
      }
      if (localObject2 == Primitive.VOID) {
        throw new EvalError("Void in array initializer, position" + j, this, paramCallStack);
      }
      Object localObject3;
      if ((localObject2 instanceof Primitive))
      {
        Primitive localPrimitive = (Primitive)localObject2;
        if (paramClass.isPrimitive()) {
          try
          {
            localPrimitive = localPrimitive.castToType(paramClass, 0);
          }
          catch (UtilEvalError localUtilEvalError)
          {
            localUtilEvalError.printStackTrace();
            Interpreter.debug("error:" + localUtilEvalError);
            throwTypeError(paramClass, localPrimitive, j, paramCallStack);
          }
        }
        localObject3 = localPrimitive.getValue();
      }
      else
      {
        localObject3 = localObject2;
      }
      try
      {
        Array.set(localObject1, j, localObject3);
      }
      catch (IllegalArgumentException localIllegalArgumentException)
      {
        Interpreter.debug("illegal arg" + localIllegalArgumentException);
        throwTypeError(paramClass, localObject2, j, paramCallStack);
      }
      catch (ArrayStoreException localArrayStoreException)
      {
        Interpreter.debug("arraystore" + localArrayStoreException);
        throwTypeError(paramClass, localObject2, j, paramCallStack);
      }
    }
    return localObject1;
  }
  
  private void throwTypeError(Class paramClass, Object paramObject, int paramInt, CallStack paramCallStack)
    throws EvalError
  {
    String str;
    if ((paramObject instanceof Primitive)) {
      str = ((Primitive)paramObject).getType().getName();
    } else {
      str = Reflect.normalizeClassName(paramObject.getClass());
    }
    throw new EvalError("Incompatible type: " + str + " in initializer of array type: " + paramClass + " at position: " + paramInt, this, paramCallStack);
  }
}

/* Location:
 * Qualified Name:     bsh.BSHArrayInitializer
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package bsh;

class BSHAssignment
  extends SimpleNode
  implements ParserConstants
{
  public int operator;
  
  BSHAssignment(int paramInt)
  {
    super(paramInt);
  }
  
  public Object eval(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    BSHPrimaryExpression localBSHPrimaryExpression = (BSHPrimaryExpression)jjtGetChild(0);
    if (localBSHPrimaryExpression == null) {
      throw new InterpreterError("Error, null LHSnode");
    }
    boolean bool = paramInterpreter.getStrictJava();
    LHS localLHS = localBSHPrimaryExpression.toLHS(paramCallStack, paramInterpreter);
    if (localLHS == null) {
      throw new InterpreterError("Error, null LHS");
    }
    Object localObject1 = null;
    if (operator != 81) {
      try
      {
        localObject1 = localLHS.getValue();
      }
      catch (UtilEvalError localUtilEvalError1)
      {
        throw localUtilEvalError1.toEvalError(this, paramCallStack);
      }
    }
    SimpleNode localSimpleNode = (SimpleNode)jjtGetChild(1);
    Object localObject2 = localSimpleNode.eval(paramCallStack, paramInterpreter);
    if (localObject2 == Primitive.VOID) {
      throw new EvalError("Void assignment.", this, paramCallStack);
    }
    try
    {
      switch (operator)
      {
      case 81: 
        return localLHS.assign(localObject2, bool);
      case 118: 
        return localLHS.assign(operation(localObject1, localObject2, 102), bool);
      case 119: 
        return localLHS.assign(operation(localObject1, localObject2, 103), bool);
      case 120: 
        return localLHS.assign(operation(localObject1, localObject2, 104), bool);
      case 121: 
        return localLHS.assign(operation(localObject1, localObject2, 105), bool);
      case 122: 
      case 123: 
        return localLHS.assign(operation(localObject1, localObject2, 106), bool);
      case 124: 
      case 125: 
        return localLHS.assign(operation(localObject1, localObject2, 108), bool);
      case 126: 
        return localLHS.assign(operation(localObject1, localObject2, 110), bool);
      case 127: 
        return localLHS.assign(operation(localObject1, localObject2, 111), bool);
      case 128: 
      case 129: 
        return localLHS.assign(operation(localObject1, localObject2, 112), bool);
      case 130: 
      case 131: 
        return localLHS.assign(operation(localObject1, localObject2, 114), bool);
      case 132: 
      case 133: 
        return localLHS.assign(operation(localObject1, localObject2, 116), bool);
      }
      throw new InterpreterError("unimplemented operator in assignment BSH");
    }
    catch (UtilEvalError localUtilEvalError2)
    {
      throw localUtilEvalError2.toEvalError(this, paramCallStack);
    }
  }
  
  private Object operation(Object paramObject1, Object paramObject2, int paramInt)
    throws UtilEvalError
  {
    if (((paramObject1 instanceof String)) && (paramObject2 != Primitive.VOID))
    {
      if (paramInt != 102) {
        throw new UtilEvalError("Use of non + operator with String LHS");
      }
      return (String)paramObject1 + paramObject2;
    }
    if (((paramObject1 instanceof Primitive)) || ((paramObject2 instanceof Primitive)))
    {
      if ((paramObject1 == Primitive.VOID) || (paramObject2 == Primitive.VOID)) {
        throw new UtilEvalError("Illegal use of undefined object or 'void' literal");
      }
      if ((paramObject1 == Primitive.NULL) || (paramObject2 == Primitive.NULL)) {
        throw new UtilEvalError("Illegal use of null object or 'null' literal");
      }
    }
    if ((((paramObject1 instanceof Boolean)) || ((paramObject1 instanceof Character)) || ((paramObject1 instanceof Number)) || ((paramObject1 instanceof Primitive))) && (((paramObject2 instanceof Boolean)) || ((paramObject2 instanceof Character)) || ((paramObject2 instanceof Number)) || ((paramObject2 instanceof Primitive)))) {
      return Primitive.binaryOperation(paramObject1, paramObject2, paramInt);
    }
    throw new UtilEvalError("Non primitive value in operator: " + paramObject1.getClass() + " " + tokenImage[paramInt] + " " + paramObject2.getClass());
  }
}

/* Location:
 * Qualified Name:     bsh.BSHAssignment
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package bsh;

class BSHBinaryExpression
  extends SimpleNode
  implements ParserConstants
{
  public int kind;
  
  BSHBinaryExpression(int paramInt)
  {
    super(paramInt);
  }
  
  public Object eval(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    Object localObject1 = ((SimpleNode)jjtGetChild(0)).eval(paramCallStack, paramInterpreter);
    Object localObject2;
    if (kind == 35)
    {
      if (localObject1 == Primitive.NULL) {
        return new Primitive(false);
      }
      localObject2 = ((BSHType)jjtGetChild(1)).getType(paramCallStack, paramInterpreter);
      if ((localObject1 instanceof Primitive))
      {
        if (localObject2 == Primitive.class) {
          return new Primitive(true);
        }
        return new Primitive(false);
      }
      boolean bool2 = Types.isJavaAssignable((Class)localObject2, localObject1.getClass());
      return new Primitive(bool2);
    }
    if ((kind == 98) || (kind == 99))
    {
      localObject2 = localObject1;
      if (isPrimitiveValue(localObject1)) {
        localObject2 = ((Primitive)localObject1).getValue();
      }
      if (((localObject2 instanceof Boolean)) && (!((Boolean)localObject2).booleanValue())) {
        return new Primitive(false);
      }
    }
    if ((kind == 96) || (kind == 97))
    {
      localObject2 = localObject1;
      if (isPrimitiveValue(localObject1)) {
        localObject2 = ((Primitive)localObject1).getValue();
      }
      if (((localObject2 instanceof Boolean)) && (((Boolean)localObject2).booleanValue() == true)) {
        return new Primitive(true);
      }
    }
    boolean bool1 = isWrapper(localObject1);
    Object localObject3 = ((SimpleNode)jjtGetChild(1)).eval(paramCallStack, paramInterpreter);
    boolean bool3 = isWrapper(localObject3);
    if (((bool1) || (isPrimitiveValue(localObject1))) && ((bool3) || (isPrimitiveValue(localObject3))) && ((!bool1) || (!bool3) || (kind != 90))) {
      try
      {
        return Primitive.binaryOperation(localObject1, localObject3, kind);
      }
      catch (UtilEvalError localUtilEvalError)
      {
        throw localUtilEvalError.toEvalError(this, paramCallStack);
      }
    }
    switch (kind)
    {
    case 90: 
      return new Primitive(localObject1 == localObject3);
    case 95: 
      return new Primitive(localObject1 != localObject3);
    case 102: 
      if (((localObject1 instanceof String)) || ((localObject3 instanceof String))) {
        return localObject1.toString() + localObject3.toString();
      }
      break;
    }
    if (((localObject1 instanceof Primitive)) || ((localObject3 instanceof Primitive)))
    {
      if ((localObject1 == Primitive.VOID) || (localObject3 == Primitive.VOID)) {
        throw new EvalError("illegal use of undefined variable, class, or 'void' literal", this, paramCallStack);
      }
      if ((localObject1 == Primitive.NULL) || (localObject3 == Primitive.NULL)) {
        throw new EvalError("illegal use of null value or 'null' literal", this, paramCallStack);
      }
    }
    throw new EvalError("Operator: '" + tokenImage[kind] + "' inappropriate for objects", this, paramCallStack);
  }
  
  private boolean isPrimitiveValue(Object paramObject)
  {
    return ((paramObject instanceof Primitive)) && (paramObject != Primitive.VOID) && (paramObject != Primitive.NULL);
  }
  
  private boolean isWrapper(Object paramObject)
  {
    return ((paramObject instanceof Boolean)) || ((paramObject instanceof Character)) || ((paramObject instanceof Number));
  }
}

/* Location:
 * Qualified Name:     bsh.BSHBinaryExpression
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package bsh;

public abstract interface BSHBlock$NodeFilter
{
  public abstract boolean isVisible(SimpleNode paramSimpleNode);
}

/* Location:
 * Qualified Name:     bsh.BSHBlock.NodeFilter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package bsh;

class BSHBlock
  extends SimpleNode
{
  public boolean isSynchronized = false;
  
  BSHBlock(int paramInt)
  {
    super(paramInt);
  }
  
  public Object eval(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    return eval(paramCallStack, paramInterpreter, false);
  }
  
  public Object eval(CallStack paramCallStack, Interpreter paramInterpreter, boolean paramBoolean)
    throws EvalError
  {
    Object localObject1 = null;
    Object localObject2;
    if (isSynchronized)
    {
      localObject2 = (SimpleNode)jjtGetChild(0);
      localObject1 = ((SimpleNode)localObject2).eval(paramCallStack, paramInterpreter);
    }
    if (isSynchronized) {
      synchronized (localObject1)
      {
        localObject2 = evalBlock(paramCallStack, paramInterpreter, paramBoolean, null);
      }
    } else {
      localObject2 = evalBlock(paramCallStack, paramInterpreter, paramBoolean, null);
    }
    return localObject2;
  }
  
  Object evalBlock(CallStack paramCallStack, Interpreter paramInterpreter, boolean paramBoolean, NodeFilter paramNodeFilter)
    throws EvalError
  {
    Object localObject1 = Primitive.VOID;
    NameSpace localNameSpace = null;
    if (!paramBoolean)
    {
      localNameSpace = paramCallStack.top();
      BlockNameSpace localBlockNameSpace = new BlockNameSpace(localNameSpace);
      paramCallStack.swap(localBlockNameSpace);
    }
    int i = isSynchronized ? 1 : 0;
    int j = jjtGetNumChildren();
    try
    {
      SimpleNode localSimpleNode;
      for (int k = i; k < j; k++)
      {
        localSimpleNode = (SimpleNode)jjtGetChild(k);
        if (((paramNodeFilter == null) || (paramNodeFilter.isVisible(localSimpleNode))) && ((localSimpleNode instanceof BSHClassDeclaration))) {
          localSimpleNode.eval(paramCallStack, paramInterpreter);
        }
      }
      for (k = i; k < j; k++)
      {
        localSimpleNode = (SimpleNode)jjtGetChild(k);
        if ((!(localSimpleNode instanceof BSHClassDeclaration)) && ((paramNodeFilter == null) || (paramNodeFilter.isVisible(localSimpleNode))))
        {
          localObject1 = localSimpleNode.eval(paramCallStack, paramInterpreter);
          if ((localObject1 instanceof ReturnControl)) {
            break;
          }
        }
      }
    }
    finally
    {
      if (!paramBoolean) {
        paramCallStack.swap(localNameSpace);
      }
    }
    return localObject1;
  }
  
  public static abstract interface NodeFilter
  {
    public abstract boolean isVisible(SimpleNode paramSimpleNode);
  }
}

/* Location:
 * Qualified Name:     bsh.BSHBlock
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package bsh;

class BSHCastExpression
  extends SimpleNode
{
  public BSHCastExpression(int paramInt)
  {
    super(paramInt);
  }
  
  public Object eval(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    NameSpace localNameSpace = paramCallStack.top();
    Class localClass1 = ((BSHType)jjtGetChild(0)).getType(paramCallStack, paramInterpreter);
    SimpleNode localSimpleNode = (SimpleNode)jjtGetChild(1);
    Object localObject = localSimpleNode.eval(paramCallStack, paramInterpreter);
    Class localClass2 = localObject.getClass();
    try
    {
      return Types.castObject(localObject, localClass1, 0);
    }
    catch (UtilEvalError localUtilEvalError)
    {
      throw localUtilEvalError.toEvalError(this, paramCallStack);
    }
  }
}

/* Location:
 * Qualified Name:     bsh.BSHCastExpression
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package bsh;

class BSHClassDeclaration
  extends SimpleNode
{
  static final String CLASSINITNAME = "_bshClassInit";
  String name;
  Modifiers modifiers;
  int numInterfaces;
  boolean extend;
  boolean isInterface;
  
  BSHClassDeclaration(int paramInt)
  {
    super(paramInt);
  }
  
  public Object eval(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    int i = 0;
    Class localClass = null;
    if (extend)
    {
      localObject = (BSHAmbiguousName)jjtGetChild(i++);
      localClass = ((BSHAmbiguousName)localObject).toClass(paramCallStack, paramInterpreter);
    }
    Object localObject = new Class[numInterfaces];
    for (int j = 0; j < numInterfaces; j++)
    {
      BSHAmbiguousName localBSHAmbiguousName = (BSHAmbiguousName)jjtGetChild(i++);
      localObject[j] = localBSHAmbiguousName.toClass(paramCallStack, paramInterpreter);
      if (!localObject[j].isInterface()) {
        throw new EvalError("Type: " + text + " is not an interface!", this, paramCallStack);
      }
    }
    BSHBlock localBSHBlock;
    if (i < jjtGetNumChildren()) {
      localBSHBlock = (BSHBlock)jjtGetChild(i);
    } else {
      localBSHBlock = new BSHBlock(25);
    }
    try
    {
      return ClassGenerator.getClassGenerator().generateClass(name, modifiers, (Class[])localObject, localClass, localBSHBlock, isInterface, paramCallStack, paramInterpreter);
    }
    catch (UtilEvalError localUtilEvalError)
    {
      throw localUtilEvalError.toEvalError(this, paramCallStack);
    }
  }
  
  public String toString()
  {
    return "ClassDeclaration: " + name;
  }
}

/* Location:
 * Qualified Name:     bsh.BSHClassDeclaration
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package bsh;

class BSHEnhancedForStatement
  extends SimpleNode
  implements ParserConstants
{
  String varName;
  
  BSHEnhancedForStatement(int paramInt)
  {
    super(paramInt);
  }
  
  public Object eval(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    Class localClass = null;
    SimpleNode localSimpleNode2 = null;
    NameSpace localNameSpace = paramCallStack.top();
    SimpleNode localSimpleNode3 = (SimpleNode)jjtGetChild(0);
    int i = jjtGetNumChildren();
    SimpleNode localSimpleNode1;
    if ((localSimpleNode3 instanceof BSHType))
    {
      localClass = ((BSHType)localSimpleNode3).getType(paramCallStack, paramInterpreter);
      localSimpleNode1 = (SimpleNode)jjtGetChild(1);
      if (i > 2) {
        localSimpleNode2 = (SimpleNode)jjtGetChild(2);
      }
    }
    else
    {
      localSimpleNode1 = localSimpleNode3;
      if (i > 1) {
        localSimpleNode2 = (SimpleNode)jjtGetChild(1);
      }
    }
    BlockNameSpace localBlockNameSpace = new BlockNameSpace(localNameSpace);
    paramCallStack.swap(localBlockNameSpace);
    Object localObject1 = localSimpleNode1.eval(paramCallStack, paramInterpreter);
    if (localObject1 == Primitive.NULL) {
      throw new EvalError("The collection, array, map, iterator, or enumeration portion of a for statement cannot be null.", this, paramCallStack);
    }
    CollectionManager localCollectionManager = CollectionManager.getCollectionManager();
    if (!localCollectionManager.isBshIterable(localObject1)) {
      throw new EvalError("Can't iterate over type: " + localObject1.getClass(), this, paramCallStack);
    }
    BshIterator localBshIterator = localCollectionManager.getBshIterator(localObject1);
    Object localObject2 = Primitive.VOID;
    while (localBshIterator.hasNext())
    {
      try
      {
        if (localClass != null) {
          localBlockNameSpace.setTypedVariable(varName, localClass, localBshIterator.next(), false);
        } else {
          localBlockNameSpace.setVariable(varName, localBshIterator.next(), false);
        }
      }
      catch (UtilEvalError localUtilEvalError)
      {
        throw localUtilEvalError.toEvalError("for loop iterator variable:" + varName, this, paramCallStack);
      }
      int j = 0;
      if (localSimpleNode2 != null)
      {
        Object localObject3 = localSimpleNode2.eval(paramCallStack, paramInterpreter);
        if ((localObject3 instanceof ReturnControl)) {
          switch (kind)
          {
          case 46: 
            localObject2 = localObject3;
            j = 1;
            break;
          case 19: 
            break;
          case 12: 
            j = 1;
          }
        }
      }
      if (j != 0) {
        break;
      }
    }
    paramCallStack.swap(localNameSpace);
    return localObject2;
  }
}

/* Location:
 * Qualified Name:     bsh.BSHEnhancedForStatement
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package bsh;

class BSHForStatement
  extends SimpleNode
  implements ParserConstants
{
  public boolean hasForInit;
  public boolean hasExpression;
  public boolean hasForUpdate;
  private SimpleNode forInit;
  private SimpleNode expression;
  private SimpleNode forUpdate;
  private SimpleNode statement;
  private boolean parsed;
  
  BSHForStatement(int paramInt)
  {
    super(paramInt);
  }
  
  public Object eval(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    int i = 0;
    if (hasForInit) {
      forInit = ((SimpleNode)jjtGetChild(i++));
    }
    if (hasExpression) {
      expression = ((SimpleNode)jjtGetChild(i++));
    }
    if (hasForUpdate) {
      forUpdate = ((SimpleNode)jjtGetChild(i++));
    }
    if (i < jjtGetNumChildren()) {
      statement = ((SimpleNode)jjtGetChild(i));
    }
    NameSpace localNameSpace = paramCallStack.top();
    BlockNameSpace localBlockNameSpace = new BlockNameSpace(localNameSpace);
    paramCallStack.swap(localBlockNameSpace);
    if (hasForInit) {
      forInit.eval(paramCallStack, paramInterpreter);
    }
    Object localObject1 = Primitive.VOID;
    for (;;)
    {
      if (hasExpression)
      {
        bool = BSHIfStatement.evaluateCondition(expression, paramCallStack, paramInterpreter);
        if (!bool) {
          break;
        }
      }
      boolean bool = false;
      if (statement != null)
      {
        Object localObject2 = statement.eval(paramCallStack, paramInterpreter);
        if ((localObject2 instanceof ReturnControl)) {
          switch (kind)
          {
          case 46: 
            localObject1 = localObject2;
            bool = true;
            break;
          case 19: 
            break;
          case 12: 
            bool = true;
          }
        }
      }
      if (bool) {
        break;
      }
      if (hasForUpdate) {
        forUpdate.eval(paramCallStack, paramInterpreter);
      }
    }
    paramCallStack.swap(localNameSpace);
    return localObject1;
  }
}

/* Location:
 * Qualified Name:     bsh.BSHForStatement
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package bsh;

public class BSHFormalComment
  extends SimpleNode
{
  public String text;
  
  public BSHFormalComment(int paramInt)
  {
    super(paramInt);
  }
}

/* Location:
 * Qualified Name:     bsh.BSHFormalComment
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package bsh;

class BSHFormalParameter
  extends SimpleNode
{
  public static final Class UNTYPED = null;
  public String name;
  public Class type;
  
  BSHFormalParameter(int paramInt)
  {
    super(paramInt);
  }
  
  public String getTypeDescriptor(CallStack paramCallStack, Interpreter paramInterpreter, String paramString)
  {
    if (jjtGetNumChildren() > 0) {
      return ((BSHType)jjtGetChild(0)).getTypeDescriptor(paramCallStack, paramInterpreter, paramString);
    }
    return "Ljava/lang/Object;";
  }
  
  public Object eval(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    if (jjtGetNumChildren() > 0) {
      type = ((BSHType)jjtGetChild(0)).getType(paramCallStack, paramInterpreter);
    } else {
      type = UNTYPED;
    }
    return type;
  }
}

/* Location:
 * Qualified Name:     bsh.BSHFormalParameter
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package bsh;

class BSHFormalParameters
  extends SimpleNode
{
  private String[] paramNames;
  Class[] paramTypes;
  int numArgs;
  String[] typeDescriptors;
  
  BSHFormalParameters(int paramInt)
  {
    super(paramInt);
  }
  
  void insureParsed()
  {
    if (paramNames != null) {
      return;
    }
    numArgs = jjtGetNumChildren();
    String[] arrayOfString = new String[numArgs];
    for (int i = 0; i < numArgs; i++)
    {
      BSHFormalParameter localBSHFormalParameter = (BSHFormalParameter)jjtGetChild(i);
      arrayOfString[i] = name;
    }
    paramNames = arrayOfString;
  }
  
  public String[] getParamNames()
  {
    insureParsed();
    return paramNames;
  }
  
  public String[] getTypeDescriptors(CallStack paramCallStack, Interpreter paramInterpreter, String paramString)
  {
    if (typeDescriptors != null) {
      return typeDescriptors;
    }
    insureParsed();
    String[] arrayOfString = new String[numArgs];
    for (int i = 0; i < numArgs; i++)
    {
      BSHFormalParameter localBSHFormalParameter = (BSHFormalParameter)jjtGetChild(i);
      arrayOfString[i] = localBSHFormalParameter.getTypeDescriptor(paramCallStack, paramInterpreter, paramString);
    }
    typeDescriptors = arrayOfString;
    return arrayOfString;
  }
  
  public Object eval(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    if (paramTypes != null) {
      return paramTypes;
    }
    insureParsed();
    Class[] arrayOfClass = new Class[numArgs];
    for (int i = 0; i < numArgs; i++)
    {
      BSHFormalParameter localBSHFormalParameter = (BSHFormalParameter)jjtGetChild(i);
      arrayOfClass[i] = ((Class)localBSHFormalParameter.eval(paramCallStack, paramInterpreter));
    }
    paramTypes = arrayOfClass;
    return arrayOfClass;
  }
}

/* Location:
 * Qualified Name:     bsh.BSHFormalParameters
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package bsh;

class BSHIfStatement
  extends SimpleNode
{
  BSHIfStatement(int paramInt)
  {
    super(paramInt);
  }
  
  public Object eval(CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    Object localObject = null;
    if (evaluateCondition((SimpleNode)jjtGetChild(0), paramCallStack, paramInterpreter)) {
      localObject = ((SimpleNode)jjtGetChild(1)).eval(paramCallStack, paramInterpreter);
    } else if (jjtGetNumChildren() > 2) {
      localObject = ((SimpleNode)jjtGetChild(2)).eval(paramCallStack, paramInterpreter);
    }
    if ((localObject instanceof ReturnControl)) {
      return localObject;
    }
    return Primitive.VOID;
  }
  
  public static boolean evaluateCondition(SimpleNode paramSimpleNode, CallStack paramCallStack, Interpreter paramInterpreter)
    throws EvalError
  {
    Object localObject = paramSimpleNode.eval(paramCallStack, paramInterpreter);
    if ((localObject instanceof Primitive))
    {
      if (localObject == Primitive.VOID) {
        throw new EvalError("Condition evaluates to void type", paramSimpleNode, paramCallStack);
      }
      localObject = ((Primitive)localObject).getValue();
    }
    if ((localObject instanceof Boolean)) {
      return ((Boolean)localObject).booleanValue();
    }
    throw new EvalError("Condition must evaluate to a Boolean or boolean.", paramSimpleNode, paramCallStack);
  }
}

/* Location:
 * Qualified Name:     bsh.BSHIfStatement
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package bsh;

class BSHImportDeclaration
  exten
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd