Package com.caucho.quercus

Examples of com.caucho.quercus.Location


    case GEQ:
      return _factory.createGeq(expr, parseShiftExpr());

    case INSTANCEOF:
      Location location = getLocation();

      Expr classNameExpr = parseShiftExpr();

      if (classNameExpr instanceof ConstExpr)
        return _factory.createInstanceOf(expr, classNameExpr.toString());
View Full Code Here


  }

  public Value execute(Env env)
  {
    // php/0d92
    Location oldLocation = env.setLocation(getLocation());

    // php/1a08
    _expr.evalTop(env);

    env.setLocation(oldLocation);
View Full Code Here

        else if (!equals(currentClassName, _lastClassName))
          _location = null;
      }

      if (_location == null)
        _location = new Location(_fileName, _lineNumber, currentClassName, currentFunctionName);

      _lastFunctionName = currentFunctionName;
      _lastClassName = currentClassName;

      return _location;
View Full Code Here

                                  @Optional("0") int code)
  {
    value.putField(env, "message", message);
    value.putField(env, "code", LongValue.create(code));

    Location location = env.getLocation();

    if (location != null) {
      if (location.getFileName() != null)
        value.putField(env, "file", env.createString(location.getFileName()));
      else
        value.putField(env, "file", env.createString("unknown"));

      value.putField(env, "line", LongValue.create(location.getLineNumber()));
    }

    value.putField(env, "trace", ErrorModule.debug_backtrace(env));
    QuercusException e = new QuercusException();
    e.fillInStackTrace();
View Full Code Here

    Value line = _value.getField(env, LINE);
   
    if (file.isNull() || line.isNull())
      return Location.UNKNOWN;
    else
      return new Location(file.toString(), line.toInt(), null, null);
  }
View Full Code Here

  {
    _function = getFactory().createFunctionInfo(_quercus, "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, _quercus.getScriptEncoding()));
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.