本文整理了Java中org.mozilla.javascript.Node.setType()
方法的一些代码示例,展示了Node.setType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.setType()
方法的具体详情如下:
包路径:org.mozilla.javascript.Node
类名称:Node
方法名:setType
[英]Sets the node type and returns this node.
[中]设置节点类型并返回此节点。
代码示例来源:origin: com.github.tntim96/rhino
protected Node createName(int type, String name, Node child) {
Node result = createName(name);
result.setType(type);
if (child != null)
result.addChildToBack(child);
return result;
}
代码示例来源:origin: rhino/js
private Node createName(int type, String name, Node child)
{
Node result = createName(name);
result.setType(type);
if (child != null)
result.addChildToBack(child);
return result;
}
代码示例来源:origin: ro.isdc.wro4j/rhino
protected Node createName(int type, String name, Node child) {
Node result = createName(name);
result.setType(type);
if (child != null)
result.addChildToBack(child);
return result;
}
代码示例来源:origin: geogebra/geogebra
protected Node createName(int type, String name, Node child) {
Node result = createName(name);
result.setType(type);
if (child != null)
result.addChildToBack(child);
return result;
}
代码示例来源:origin: io.apigee/rhino
protected Node createName(int type, String name, Node child) {
Node result = createName(name);
result.setType(type);
if (child != null)
result.addChildToBack(child);
return result;
}
代码示例来源:origin: io.apigee/rhino
private Node makeReference(Node node) {
int type = node.getType();
switch (type) {
case Token.NAME:
case Token.GETPROP:
case Token.GETELEM:
case Token.GET_REF:
return node;
case Token.CALL:
node.setType(Token.REF_CALL);
return new Node(Token.GET_REF, node);
}
// Signal caller to report error
return null;
}
代码示例来源:origin: ro.isdc.wro4j/rhino
private Node makeReference(Node node) {
int type = node.getType();
switch (type) {
case Token.NAME:
case Token.GETPROP:
case Token.GETELEM:
case Token.GET_REF:
return node;
case Token.CALL:
node.setType(Token.REF_CALL);
return new Node(Token.GET_REF, node);
}
// Signal caller to report error
return null;
}
代码示例来源:origin: rhino/js
private Node makeReference(Node node)
{
int type = node.getType();
switch (type) {
case Token.NAME:
case Token.GETPROP:
case Token.GETELEM:
case Token.GET_REF:
return node;
case Token.CALL:
node.setType(Token.REF_CALL);
return new Node(Token.GET_REF, node);
}
// Signal caller to report error
return null;
}
代码示例来源:origin: com.github.tntim96/rhino
private Node makeReference(Node node) {
int type = node.getType();
switch (type) {
case Token.NAME:
case Token.GETPROP:
case Token.GETELEM:
case Token.GET_REF:
return node;
case Token.CALL:
node.setType(Token.REF_CALL);
return new Node(Token.GET_REF, node);
}
// Signal caller to report error
return null;
}
代码示例来源:origin: geogebra/geogebra
private Node makeReference(Node node) {
int type = node.getType();
switch (type) {
case Token.NAME:
case Token.GETPROP:
case Token.GETELEM:
case Token.GET_REF:
return node;
case Token.CALL:
node.setType(Token.REF_CALL);
return new Node(Token.GET_REF, node);
}
// Signal caller to report error
return null;
}
代码示例来源:origin: com.sun.phobos/phobos-rhino
private Node makeReference(Node node)
{
int type = node.getType();
switch (type) {
case Token.NAME:
case Token.GETPROP:
case Token.GETELEM:
case Token.GET_REF:
return node;
case Token.CALL:
node.setType(Token.REF_CALL);
return new Node(Token.GET_REF, node);
}
// Signal caller to report error
return null;
}
代码示例来源:origin: io.apigee/rhino
((Name) left).getIdentifier());
left.setType(Token.BINDNAME);
return new Node(Token.SETNAME, left, right);
id.setType(Token.STRING);
} else {
type = Token.SETELEM;
代码示例来源:origin: ro.isdc.wro4j/rhino
((Name) left).getIdentifier());
left.setType(Token.BINDNAME);
return new Node(Token.SETNAME, left, right);
id.setType(Token.STRING);
} else {
type = Token.SETELEM;
代码示例来源:origin: geogebra/geogebra
((Name) left).getIdentifier());
left.setType(Token.BINDNAME);
return new Node(Token.SETNAME, left, right);
id.setType(Token.STRING);
} else {
type = Token.SETELEM;
代码示例来源:origin: com.github.tntim96/rhino
((Name) left).getIdentifier());
left.setType(Token.BINDNAME);
return new Node(Token.SETNAME, left, right);
id.setType(Token.STRING);
} else {
type = Token.SETELEM;
代码示例来源:origin: com.sun.phobos/phobos-rhino
private Node simpleAssignment(Node left, Node right)
{
int nodeType = left.getType();
switch (nodeType) {
case Token.NAME:
left.setType(Token.BINDNAME);
return new Node(Token.SETNAME, left, right);
case Token.GETPROP:
case Token.GETELEM: {
Node obj = left.getFirstChild();
Node id = left.getLastChild();
int type;
if (nodeType == Token.GETPROP) {
type = Token.SETPROP;
} else {
type = Token.SETELEM;
}
return new Node(type, obj, id, right);
}
case Token.GET_REF: {
Node ref = left.getFirstChild();
checkMutableReference(ref);
return new Node(Token.SET_REF, ref, right);
}
}
throw Kit.codeBug();
}
代码示例来源:origin: rhino/js
private Node simpleAssignment(Node left, Node right)
{
int nodeType = left.getType();
switch (nodeType) {
case Token.NAME:
left.setType(Token.BINDNAME);
return new Node(Token.SETNAME, left, right);
case Token.GETPROP:
case Token.GETELEM: {
Node obj = left.getFirstChild();
Node id = left.getLastChild();
int type;
if (nodeType == Token.GETPROP) {
type = Token.SETPROP;
} else {
type = Token.SETELEM;
}
return new Node(type, obj, id, right);
}
case Token.GET_REF: {
Node ref = left.getFirstChild();
checkMutableReference(ref);
return new Node(Token.SET_REF, ref, right);
}
}
throw Kit.codeBug();
}
代码示例来源:origin: geogebra/geogebra
child.setType(Token.BINDNAME);
Node left = child;
Node right = Node.newString(child.getString());
child.setType(Token.TYPEOFNAME);
return child;
child.setType(type);
return child;
代码示例来源:origin: rhino/js
} else {
result.setType(Token.LETEXPR);
nf.addChildToBack(result, expr(false));
if (isStatement) {
代码示例来源:origin: org.odlabs.wiquery/wiquery-compressor
result.setType(Token1.LETEXPR);
nf.addChildToBack(result, expr(false));
if (isStatement)
内容来源于网络,如有侵权,请联系作者删除!