Package com.caucho.quercus

Examples of com.caucho.quercus.Location


  {
    ArrayList<String> trace = new ArrayList<String>();

    for (int i = _callStackTop - 1; i >= 0; i--) {
      String entry;
      Location location = _callStack[i].getLocation();
      String loc;

      if (location != null && location.getFileName() != null) {
        loc = (" (at " + location.getFileName()
               + ":" + location.getLineNumber() + ")");
      }
      else
        loc = "";
     
      if (_callThisStack[i] != null
View Full Code Here


  /*
   * Throws an error for this uncaught exception.
   */
  private void uncaughtExceptionError(QuercusLanguageException e)
  {
    Location location = e.getLocation(this);
    String type = e.getValue().getClassName();
    String message = e.getMessage(this);
   
    error(location,
          L.l("Uncaught exception of type '{0}' with message '{1}'", type, message));
View Full Code Here

    StringValue messageV = createStringOld(message);
    Value []args = { messageV };

    Value value = cls.callNew(this, args);
   
    Location location = getLocation();
   
    value.putField(this, "file", createStringOld(location.getFileName()));
    value.putField(this, "line", LongValue.create(location.getLineNumber()));
    value.putField(this, "trace", ErrorModule.debug_backtrace(this));

    return value;
  }
View Full Code Here

   */
  public Expr createCall(QuercusParser parser,
                         String name,
                         ArrayList<Expr> args)
  {
    Location loc = parser.getLocation();
   
    if ("isset".equals(name) && args.size() == 1)
      return new FunIssetExpr(args.get(0));
    else if ("get_called_class".equals(name) && args.size() == 0)
      return new FunGetCalledClassExpr(loc);
View Full Code Here

  /*
   * Throws an error for this uncaught exception.
   */
  private void uncaughtExceptionError(Env env, QuercusLanguageException e)
  {
    Location location = e.getLocation(env);
    String type = e.getValue().getClassName();
    String message = e.getMessage(env);
   
    env.error(location,
              L.l("Uncaught exception of type '{0}' with message '{1}'", type, message));
View Full Code Here

   
    _function = getFactory().createFunctionInfo(_quercus, globalClass, "eval");
    // XXX: need param or better function name for non-global?
    _function.setGlobal(false);

    Location location = getLocation();

    ArrayList<Statement> stmtList = parseStatementList();

    return new QuercusProgram(_quercus, _sourceFile,
                              _globalScope.getFunctionMap(),
View Full Code Here

  {
    _isTop = true;

    ArrayList<Statement> statements = new ArrayList<Statement>();

    Location location = getLocation();

    int token = parsePhpText();

    if (_lexeme.length() > 0)
      statements.add(_factory.createText(location, _lexeme));
View Full Code Here

    throws IOException
  {
    ArrayList<Statement> statementList = new ArrayList<Statement>();

    while (true) {
      Location location = getLocation();

      int token = parseToken();

      switch (token) {
      case -1:
        return statementList;

      case ';':
        break;

      case ECHO:
        parseEcho(statementList);
        break;

      case PRINT:
        statementList.add(parsePrint());
        break;

      case UNSET:
        parseUnset(statementList);
        break;

      case ABSTRACT:
      case FINAL:
        {
          _peekToken = token;

          int modifiers = 0;
          do {
            token = parseToken();

            switch (token) {
            case ABSTRACT:
              modifiers |= M_ABSTRACT;
              break;
            case FINAL:
              modifiers |= M_FINAL;
              break;
            case CLASS:
              statementList.add(parseClassDefinition(modifiers));
              break;
            default:
              throw error(L.l("expected 'class' at {0}",
                              tokenName(token)));
            }
          } while (token != CLASS);
        }
        break;

      case FUNCTION:
        {
          Location functionLocation = getLocation();

          Function fun = parseFunctionDefinition(M_STATIC);

          if (! _isTop) {
            statementList.add(_factory.createFunctionDef(functionLocation, fun));
View Full Code Here

  }

  private Statement parseStatement()
    throws IOException
  {
    Location location = getLocation();

    int token = parseToken();

    switch (token) {
    case ';':
View Full Code Here

    throws IOException
  {
    switch (token) {
    case ECHO:
      {
        Location location = getLocation();

        ArrayList<Statement> statementList = new ArrayList<Statement>();
        parseEcho(statementList);

        return _factory.createBlock(location, statementList);
View Full Code Here

TOP

Related Classes of com.caucho.quercus.Location

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.