org.mozilla.javascript.Node.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 JavaScript  
字(4.1k)|赞(0)|评价(0)|浏览(273)

本文整理了Java中org.mozilla.javascript.Node.<init>()方法的一些代码示例,展示了Node.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.<init>()方法的具体详情如下:
包路径:org.mozilla.javascript.Node
类名称:Node
方法名:<init>

Node.<init>介绍

暂无

代码示例

代码示例来源:origin: rhino/js

  1. /**
  2. * Return
  3. */
  4. Node createReturn(Node expr, int lineno)
  5. {
  6. return expr == null
  7. ? new Node(Token.RETURN, lineno)
  8. : new Node(Token.RETURN, expr, lineno);
  9. }

代码示例来源:origin: rhino/js

  1. /**
  2. * Leaf
  3. */
  4. Node createLeaf(int nodeType)
  5. {
  6. return new Node(nodeType);
  7. }

代码示例来源:origin: rhino/js

  1. /**
  2. * Debugger
  3. */
  4. Node createDebugger(int lineno)
  5. {
  6. return new Node(Token.DEBUGGER, lineno);
  7. }

代码示例来源:origin: rhino/js

  1. /**
  2. * Throw
  3. */
  4. Node createThrow(Node expr, int lineno)
  5. {
  6. return new Node(Token.THROW, expr, lineno);
  7. }

代码示例来源:origin: com.sun.phobos/phobos-rhino

  1. /**
  2. * Leaf
  3. */
  4. Node createLeaf(int nodeType)
  5. {
  6. return new Node(nodeType);
  7. }

代码示例来源:origin: com.sun.phobos/phobos-rhino

  1. /**
  2. * Throw
  3. */
  4. Node createThrow(Node expr, int lineno)
  5. {
  6. return new Node(Token.THROW, expr, lineno);
  7. }

代码示例来源:origin: rhino/js

  1. Node createVariables(int token, int lineno)
  2. {
  3. return new Node(token, lineno);
  4. }

代码示例来源:origin: rhino/js

  1. /**
  2. * DOTQUERY
  3. */
  4. public Node createDotQuery (Node obj, Node body, int lineno)
  5. {
  6. setRequiresActivation();
  7. Node result = new Node(Token.DOTQUERY, obj, body, lineno);
  8. return result;
  9. }

代码示例来源:origin: rhino/js

  1. Node createCondExpr(Node cond, Node ifTrue, Node ifFalse)
  2. {
  3. int condStatus = isAlwaysDefinedBoolean(cond);
  4. if (condStatus == ALWAYS_TRUE_BOOLEAN) {
  5. return ifTrue;
  6. } else if (condStatus == ALWAYS_FALSE_BOOLEAN) {
  7. return ifFalse;
  8. }
  9. return new Node(Token.HOOK, cond, ifTrue, ifFalse);
  10. }

代码示例来源:origin: rhino/js

  1. Node createExprStatement(Node expr, int lineno)
  2. {
  3. int type;
  4. if (parser.insideFunction()) {
  5. type = Token.EXPR_VOID;
  6. } else {
  7. type = Token.EXPR_RESULT;
  8. }
  9. return new Node(type, expr, lineno);
  10. }

代码示例来源:origin: rhino/js

  1. /**
  2. * Regular expressions
  3. */
  4. Node createRegExp(int regexpIndex)
  5. {
  6. Node n = new Node(Token.REGEXP);
  7. n.putIntProp(Node.REGEXP_PROP, regexpIndex);
  8. return n;
  9. }

代码示例来源:origin: io.apigee/rhino

  1. private Node createCondExpr(Node cond, Node ifTrue, Node ifFalse) {
  2. int condStatus = isAlwaysDefinedBoolean(cond);
  3. if (condStatus == ALWAYS_TRUE_BOOLEAN) {
  4. return ifTrue;
  5. } else if (condStatus == ALWAYS_FALSE_BOOLEAN) {
  6. return ifFalse;
  7. }
  8. return new Node(Token.HOOK, cond, ifTrue, ifFalse);
  9. }

代码示例来源:origin: geogebra/geogebra

  1. private Node createCondExpr(Node cond, Node ifTrue, Node ifFalse) {
  2. int condStatus = isAlwaysDefinedBoolean(cond);
  3. if (condStatus == ALWAYS_TRUE_BOOLEAN) {
  4. return ifTrue;
  5. } else if (condStatus == ALWAYS_FALSE_BOOLEAN) {
  6. return ifFalse;
  7. }
  8. return new Node(Token.HOOK, cond, ifTrue, ifFalse);
  9. }

代码示例来源:origin: rhino/js

  1. Node createYield(Node child, int lineno)
  2. {
  3. if (!parser.insideFunction()) {
  4. parser.reportError("msg.bad.yield");
  5. }
  6. setRequiresActivation();
  7. setIsGenerator();
  8. if (child != null)
  9. return new Node(Token.YIELD, child, lineno);
  10. else
  11. return new Node(Token.YIELD, lineno);
  12. }

代码示例来源:origin: rhino/js

  1. Node createUseLocal(Node localBlock)
  2. {
  3. if (Token.LOCAL_BLOCK != localBlock.getType()) throw Kit.codeBug();
  4. Node result = new Node(Token.LOCAL_LOAD);
  5. result.putProp(Node.LOCAL_BLOCK_PROP, localBlock);
  6. return result;
  7. }

代码示例来源:origin: com.github.tntim96/rhino

  1. private Node createUseLocal(Node localBlock) {
  2. if (Token.LOCAL_BLOCK != localBlock.getType()) throw Kit.codeBug();
  3. Node result = new Node(Token.LOCAL_LOAD);
  4. result.putProp(Node.LOCAL_BLOCK_PROP, localBlock);
  5. return result;
  6. }

代码示例来源:origin: geogebra/geogebra

  1. private Node transformYield(Yield node) {
  2. decompiler.addToken(Token.YIELD);
  3. Node kid = node.getValue() == null ? null : transform(node.getValue());
  4. if (kid != null)
  5. return new Node(Token.YIELD, kid, node.getLineno());
  6. else
  7. return new Node(Token.YIELD, node.getLineno());
  8. }

代码示例来源:origin: geogebra/geogebra

  1. private Node transformThrow(ThrowStatement node) {
  2. decompiler.addToken(Token.THROW);
  3. Node value = transform(node.getExpression());
  4. decompiler.addEOL(Token.SEMI);
  5. return new Node(Token.THROW, value, node.getLineno());
  6. }

代码示例来源:origin: ro.isdc.wro4j/rhino

  1. private Node transformExprStmt(ExpressionStatement node) {
  2. Node expr = transform(node.getExpression());
  3. decompiler.addEOL(Token.SEMI);
  4. return new Node(node.getType(), expr, node.getLineno());
  5. }

代码示例来源:origin: geogebra/geogebra

  1. private Node transformExprStmt(ExpressionStatement node) {
  2. Node expr = transform(node.getExpression());
  3. decompiler.addEOL(Token.SEMI);
  4. return new Node(node.getType(), expr, node.getLineno());
  5. }

相关文章