Package org.mozilla.javascript

Examples of org.mozilla.javascript.Node$Target


        gen.setNotBefore(new Date(System.currentTimeMillis() - 50000));
        gen.setNotAfter(new Date(System.currentTimeMillis() + 50000));
        gen.setSerialNumber(BigInteger.valueOf(1));
        gen.setSignatureAlgorithm("SHA1WithRSAEncryption");

        Target targetName = new Target(Target.targetName, new GeneralName(GeneralName.dNSName,
            "www.test.com"));

        Target targetGroup = new Target(Target.targetGroup, new GeneralName(
            GeneralName.directoryName, "o=Test, ou=Test"));
        Target[] targets = new Target[2];
        targets[0] = targetName;
        targets[1] = targetGroup;
        TargetInformation targetInformation = new TargetInformation(targets);
View Full Code Here


        gen.setNotBefore(new Date(System.currentTimeMillis() - 50000));
        gen.setNotAfter(new Date(System.currentTimeMillis() + 50000));
        gen.setSerialNumber(BigInteger.ONE);
        gen.setSignatureAlgorithm("SHA1WithRSAEncryption");

        Target targetName = new Target(Target.targetName, new GeneralName(GeneralName.dNSName,
            "www.test.com"));

        Target targetGroup = new Target(Target.targetGroup, new GeneralName(
            GeneralName.directoryName, "o=Test, ou=Test"));
        Target[] targets = new Target[2];
        targets[0] = targetName;
        targets[1] = targetGroup;
        TargetInformation targetInformation = new TargetInformation(targets);
View Full Code Here

        throw new WinkAstException("OBJECTLIT Node: props and childs count are not equal");
      }
    }

    for (final Node c : nodeChilds) {
      Node cidentified = c;
      if (c.getType() == Token.FUNCTION) {
        final int fnIndex = c.getExistingIntProp(Node.FUNCTION_PROP);
        cidentified = scope.getAsScriptOrFn().getFunctionNode(fnIndex);
      }
View Full Code Here

    boolean isFirst = true;
    while (true) {
      int i = 0;
      for (Node childNode = node.getFirstChild(); childNode != null; childNode = childNode
          .getNext()) {
        Node valueNode = childNode.getFirstChild();
        IdentifierExpression id = (IdentifierExpression) addExpression(
            childNode, root, scope);
        if (valueNode != null) {
          IExpression value = addExpression(valueNode, root, scope);
          BinaryExpression assignment = new BinaryExpression(node.getLineno(),
View Full Code Here

   *          语句子节点生存域
   */
  public BlockStatement(Node node, ScriptOrFnNode root, Scope scope) {
    super(node);

    Node childNode = node.getFirstChild();
    while (childNode != null) {
      IStatement statement = addStatement(childNode, root, scope);
      statements.add(statement);
      childNode = statement.getNext();
    }
View Full Code Here

   * @param scope
   *          语句子节点生存域
   */
  public SwitchStatement(Node node, ScriptOrFnNode root, Scope scope) {
    super(node);
    Node child = node.getFirstChild();

    target = addExpression(child, root, scope);

    while ((child = child.getNext()) != null) {
      CaseItem item = new CaseItem();
      item.value = addExpression(child.getFirstChild(), root, scope);
      items.add(item);
    }

    node = node.getNext();

    for (CaseItem item : items) {
      node = node.getNext().getNext();
      item.statement = addStatement(node, root, scope);
    }

    if (items.size() > 0) {
      CaseItem item = items.get(items.size() - 1);
      if (item.statement instanceof BlockStatement) {
        StatementList statements = ((BlockStatement) item.statement)
            .getStatementList();
        IStatement statement = statements.get(statements.size() - 1);
        if (statement instanceof ControlStatement
            && ((ControlStatement) statement).getType() == Token.BREAK) {
          statements.remove(statements.size() - 1);
        }
      }
    }

    Node nextNode = node.getNext().getNext();
    if (nextNode != null) {
      node = nextNode.getNext();
      if (node.getType() == Token.TARGET && nextNode.getType() == Token.BLOCK) {
        CaseItem item = new CaseItem();
        item.statement = addStatement(nextNode, root, scope);
        items.add(item);
        nextNode = node.getNext();
      }
View Full Code Here

   */
  public IfStatement(Node node, ScriptOrFnNode root, Scope scope) {
    super(node);
    checkExpression = addExpression(node.getFirstChild(), root, scope);

    Node nextNode = node.getNext();
    if (nextNode.getType() != Token.GOTO && nextNode.getType() != Token.TARGET) {
      trueStatement = addStatement(nextNode, root, scope);
      if (trueStatement instanceof EmptyStatement) {
        trueStatement = null;
      }
      nextNode = nextNode.getNext();
    }

    if (nextNode.getType() == Token.GOTO) {
      nextNode = nextNode.getNext().getNext();
      falseStatement = addStatement(nextNode, root, scope);
      if (falseStatement instanceof EmptyStatement) {
        falseStatement = null;
      }
      nextNode = nextNode.getNext();
    }

    setNext(nextNode.getNext());

    if (trueStatement == null && falseStatement != null) {
      checkExpression = new UnaryExpression(node.getLineno(), Token.NOT,
          checkExpression);
      trueStatement = falseStatement;
View Full Code Here

      name = scope.addIdentifier(fnNode.getFunctionName());
    }

    node = fnNode.getFirstChild().getFirstChild();
    if (node.getType() == Token.EXPR_VOID) {
      Node firstChild = node.getFirstChild();
      if (firstChild.getType() == Token.SETNAME
          && firstChild.getLastChild().getType() == Token.THISFN) {
        node = node.getNext();
      }
    }
    while (node != null) {
      IStatement statement = Utils.createStatement(node, fnNode, fnScope);
View Full Code Here

   */
  public CallExpression(Node node, ScriptOrFnNode root, Scope scope) {
    super(node.getLineno());
    tokenType = node.getType();

    Node child = node.getFirstChild();
    caller = addExpression(child, root, scope);
    while ((child = child.getNext()) != null) {
      params.add(addExpression(child, root, scope));
    }
  }
View Full Code Here

    if (tokenType == Token.TYPEOFNAME) {
      tokenType = Token.TYPEOF;
      target = new IdentifierExpression(node, root, scope);
      target.setParent(this);
    } else {
      Node firstChild = node.getFirstChild();
      if (tokenType == Token.DELPROP) {
        if (firstChild.getType() == Token.BINDNAME) {
          target = new IdentifierExpression(firstChild.getLineno(), firstChild
              .getString());
          target.setParent(this);
          return;
        }

        node = firstChild.getNext();
        if (node.getType() == Token.STRING) {
          member = scope.addConstant(node.getString(), true);
        } else {
          memberExpression = addExpression(node, root, scope);
        }
View Full Code Here

TOP

Related Classes of org.mozilla.javascript.Node$Target

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.