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

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

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

Node.getType介绍

暂无

代码示例

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

  1. private static boolean isArithmeticNode(Node node)
  2. {
  3. int type = node.getType();
  4. return (type == Token.SUB)
  5. || (type == Token.MOD)
  6. || (type == Token.DIV)
  7. || (type == Token.MUL);
  8. }

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

  1. private static boolean isArithmeticNode(Node node)
  2. {
  3. int type = node.getType();
  4. return (type == Token.SUB)
  5. || (type == Token.MOD)
  6. || (type == Token.DIV)
  7. || (type == Token.MUL);
  8. }

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

  1. private static boolean isArithmeticNode(Node node)
  2. {
  3. int type = node.getType();
  4. return (type == Token.SUB)
  5. || (type == Token.MOD)
  6. || (type == Token.DIV)
  7. || (type == Token.MUL);
  8. }

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

  1. private int nodeIsDirectCallParameter(Node node)
  2. {
  3. if (node.getType() == Token.GETVAR
  4. && inDirectCallFunction && !itsForcedObjectParameters)
  5. {
  6. int varIndex = fnCurrent.getVarIndex(node);
  7. if (fnCurrent.isParameter(varIndex)) {
  8. return varRegisters[varIndex];
  9. }
  10. }
  11. return -1;
  12. }

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

  1. private int nodeIsDirectCallParameter(Node node)
  2. {
  3. if (node.getType() == Token.GETVAR
  4. && inDirectCallFunction && !itsForcedObjectParameters)
  5. {
  6. int varIndex = fnCurrent.getVarIndex(node);
  7. if (fnCurrent.isParameter(varIndex)) {
  8. return varRegisters[varIndex];
  9. }
  10. }
  11. return -1;
  12. }

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

  1. private void markDCPNumberContext(Node n)
  2. {
  3. if (inDirectCallFunction && n.getType() == Token.GETVAR) {
  4. int varIndex = theFunction.getVarIndex(n);
  5. if (theFunction.isParameter(varIndex)) {
  6. parameterUsedInNumberContext = true;
  7. }
  8. }
  9. }

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

  1. private void markDCPNumberContext(Node n)
  2. {
  3. if (inDirectCallFunction && n.getType() == Token.GETVAR) {
  4. int varIndex = theFunction.getVarIndex(n);
  5. if (theFunction.isParameter(varIndex)) {
  6. parameterUsedInNumberContext = true;
  7. }
  8. }
  9. }

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

  1. private int nodeIsDirectCallParameter(Node node)
  2. {
  3. if (node.getType() == Token.GETVAR
  4. && inDirectCallFunction && !itsForcedObjectParameters)
  5. {
  6. int varIndex = fnCurrent.getVarIndex(node);
  7. if (fnCurrent.isParameter(varIndex)) {
  8. return varRegisters[varIndex];
  9. }
  10. }
  11. return -1;
  12. }

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

  1. private void markDCPNumberContext(Node n)
  2. {
  3. if (inDirectCallFunction && n.getType() == Token.GETVAR) {
  4. int varIndex = theFunction.getVarIndex(n);
  5. if (theFunction.isParameter(varIndex)) {
  6. parameterUsedInNumberContext = true;
  7. }
  8. }
  9. }

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

  1. private boolean convertParameter(Node n)
  2. {
  3. if (inDirectCallFunction && n.getType() == Token.GETVAR) {
  4. int varIndex = theFunction.getVarIndex(n);
  5. if (theFunction.isParameter(varIndex)) {
  6. n.removeProp(Node.ISNUMBER_PROP);
  7. return true;
  8. }
  9. }
  10. return false;
  11. }

代码示例来源: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: geogebra/geogebra

  1. private boolean convertParameter(Node n)
  2. {
  3. if (inDirectCallFunction && n.getType() == Token.GETVAR) {
  4. int varIndex = theFunction.getVarIndex(n);
  5. if (theFunction.isParameter(varIndex)) {
  6. n.removeProp(Node.ISNUMBER_PROP);
  7. return true;
  8. }
  9. }
  10. return false;
  11. }

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

  1. public void setDefault(Node defaultTarget)
  2. {
  3. if (type != Token.SWITCH) codeBug();
  4. if (defaultTarget.getType() != Token.TARGET) codeBug();
  5. if (target2 != null) codeBug(); //only once
  6. target2 = defaultTarget;
  7. }

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

  1. public void setFinally(Node finallyTarget)
  2. {
  3. if (type != Token.TRY) codeBug();
  4. if (finallyTarget.getType() != Token.TARGET) codeBug();
  5. if (target2 != null) codeBug(); //only once
  6. target2 = finallyTarget;
  7. }

代码示例来源:origin: wala/WALA

  1. private static boolean isPrimitiveCreation(WalkContext context, NewExpression n) {
  2. Node target = getNewTarget(n);
  3. return isPrologueScript(context) && n.getType() == Token.NEW && target.getType() == Token.NAME
  4. && target.getString().equals("Primitives");
  5. }

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

  1. /**
  2. * Continue (possibly labeled)
  3. */
  4. Node createContinue(Node loop, int lineno)
  5. {
  6. if (loop.getType() != Token.LOOP) Kit.codeBug();
  7. Node.Jump n = new Node.Jump(Token.CONTINUE, lineno);
  8. n.setJumpStatement((Node.Jump)loop);
  9. return n;
  10. }

代码示例来源:origin: ro.isdc.wro4j/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: com.github.tntim96/rhino

  1. private boolean convertParameter(Node n)
  2. {
  3. if (inDirectCallFunction && n.getType() == Token.GETVAR) {
  4. int varIndex = theFunction.getVarIndex(n);
  5. if (theFunction.isParameter(varIndex)) {
  6. n.removeProp(Node.ISNUMBER_PROP);
  7. return true;
  8. }
  9. }
  10. return false;
  11. }

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

  1. public void setContinue(Node continueTarget)
  2. {
  3. if (type != Token.LOOP) codeBug();
  4. if (continueTarget.getType() != Token.TARGET) codeBug();
  5. if (target2 != null) codeBug(); //only once
  6. target2 = continueTarget;
  7. }

代码示例来源:origin: wala/WALA

  1. /**
  2. * is n a call to "primitive" within our synthetic modeling code?
  3. */
  4. private static boolean isPrimitiveCall(WalkContext context, FunctionCall n) {
  5. return isPrologueScript(context) && n.getType() == Token.CALL && getCallTarget(n).getType() == Token.NAME
  6. && getCallTarget(n).getString().equals("primitive");
  7. }

相关文章