Package scriptingLanguage.errors

Examples of scriptingLanguage.errors.VariableNotFoundException


    try {
      //Type checking is done by Java for this one
      return ((JavaClass<?>) ((AbstractMethodClass) getType()).getReturnType()).eval(getSource().invoke(this.container instanceof Class<?> ? null : this.container, arguments));
    }
    catch (ClassCastException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
      throw new VariableNotFoundException(getDeclared().getInterpreter().evalFunctionName(getSource().getName(), args) + " is not defined in the current frame.");
    }
  }
View Full Code Here


    if (parameters.length > 0) {
      for (AbstractClass<?> clazz : parameters)
        name = name + clazz.getName() + ", ";
      name = name.substring(0, name.length() - 2);
    }
    throw new VariableNotFoundException("No methods that match " + name + "} exist in objects with the type, " + getSource().getName());
  }
View Full Code Here

    if (p.length > 0) {
      for (AbstractClass<?> clazz : p)
        name = name + clazz.getName() + ", ";
      name = name.substring(0, name.length() - 2);
    }
    throw new VariableNotFoundException("No methods that match " + name + "} exist in objects with the type, " + getSource().getName());
  }
View Full Code Here

        //If source is an instance of Class<?>, then this is a static class reference.
        data = method.invoke(getSource() instanceof Class<?> ? null : getSource(), arguments);
      }
      catch (ClassCastException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
        e.printStackTrace();
        throw new VariableNotFoundException(frame.getInterpreter().evalFunctionName(name, args) + " is not defined in the current frame.");
      }
    }
    else
      try {
        Class<?> source = (Class<?>) (getSource() instanceof Class<?> ? getSource() : getSource().getClass());
        Field field = source.getField(name);
        data = field.get(getSource() instanceof Class<?> ? null : getSource());
      }
      catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
        throw new VariableNotFoundException(name + " is not defined in the current frame.");
      }
    if (data == null)
      return new Token();
    AbstractClass<?> output = determineType(data, frame);
    return new Token(output instanceof JavaClass ? new JavaObject<Object>((JavaClass<Object>) output, data) :
View Full Code Here

        }
        if (closest > -1)
          return frame.variables.get(closestKey).getY();
      } while ((frame = frame.previous) != null);
    }
    throw new VariableNotFoundException(variable + " is not defined in the current frame.");
  }
View Full Code Here

      }
      throw new InvalidAssignmentException("Cannot assign a value of the type, " + ((Variable<?>) value.getCar()).getType() + ", to the type " + pair.getX());
    }
    else if (previous != null && !(previous instanceof RootFrame))
      return previous.writeVariable(variable, value, false); //Cannot be a first assignment
    throw new VariableNotFoundException(variable + " has not been declared in this frame or scope.");
  }
View Full Code Here

TOP

Related Classes of scriptingLanguage.errors.VariableNotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.