本文整理了Java中org.mozilla.javascript.Parser.saveNameTokenData()
方法的一些代码示例,展示了Parser.saveNameTokenData()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parser.saveNameTokenData()
方法的具体详情如下:
包路径:org.mozilla.javascript.Parser
类名称:Parser
方法名:saveNameTokenData
暂无
代码示例来源:origin: com.github.tntim96/rhino
/**
* Xml attribute expression:<p>
* {@code @attr}, {@code @ns::attr}, {@code @ns::*}, {@code @ns::*},
* {@code @*}, {@code @*::attr}, {@code @*::*}, {@code @ns::[expr]},
* {@code @*::[expr]}, {@code @[expr]} <p>
* Called if we peeked an '@' token.
*/
private AstNode attributeAccess()
throws IOException
{
int tt = nextToken(), atPos = ts.tokenBeg;
switch (tt) {
// handles: @name, @ns::name, @ns::*, @ns::[expr]
case Token.NAME:
return propertyName(atPos, ts.getString(), 0);
// handles: @*, @*::name, @*::*, @*::[expr]
case Token.MUL:
saveNameTokenData(ts.tokenBeg, "*", ts.lineno);
return propertyName(atPos, "*", 0);
// handles @[expr]
case Token.LB:
return xmlElemRef(atPos, null, -1);
default:
reportError("msg.no.name.after.xmlAttr");
return makeErrorNode();
}
}
代码示例来源:origin: geogebra/geogebra
/**
* Xml attribute expression:<p>
* {@code @attr}, {@code @ns::attr}, {@code @ns::*}, {@code @ns::*},
* {@code @*}, {@code @*::attr}, {@code @*::*}, {@code @ns::[expr]},
* {@code @*::[expr]}, {@code @[expr]} <p>
* Called if we peeked an '@' token.
*/
private AstNode attributeAccess()
throws IOException
{
int tt = nextToken(), atPos = ts.tokenBeg;
switch (tt) {
// handles: @name, @ns::name, @ns::*, @ns::[expr]
case Token.NAME:
return propertyName(atPos, ts.getString(), 0);
// handles: @*, @*::name, @*::*, @*::[expr]
case Token.MUL:
saveNameTokenData(ts.tokenBeg, "*", ts.lineno);
return propertyName(atPos, "*", 0);
// handles @[expr]
case Token.LB:
return xmlElemRef(atPos, null, -1);
default:
reportError("msg.no.name.after.xmlAttr");
return makeErrorNode();
}
}
代码示例来源:origin: io.apigee/rhino
/**
* Xml attribute expression:<p>
* {@code @attr}, {@code @ns::attr}, {@code @ns::*}, {@code @ns::*},
* {@code @*}, {@code @*::attr}, {@code @*::*}, {@code @ns::[expr]},
* {@code @*::[expr]}, {@code @[expr]} <p>
* Called if we peeked an '@' token.
*/
private AstNode attributeAccess()
throws IOException
{
int tt = nextToken(), atPos = ts.tokenBeg;
switch (tt) {
// handles: @name, @ns::name, @ns::*, @ns::[expr]
case Token.NAME:
return propertyName(atPos, ts.getString(), 0);
// handles: @*, @*::name, @*::*, @*::[expr]
case Token.MUL:
saveNameTokenData(ts.tokenBeg, "*", ts.lineno);
return propertyName(atPos, "*", 0);
// handles @[expr]
case Token.LB:
return xmlElemRef(atPos, null, -1);
default:
reportError("msg.no.name.after.xmlAttr");
return makeErrorNode();
}
}
代码示例来源:origin: ro.isdc.wro4j/rhino
/**
* Xml attribute expression:<p>
* {@code @attr}, {@code @ns::attr}, {@code @ns::*}, {@code @ns::*},
* {@code @*}, {@code @*::attr}, {@code @*::*}, {@code @ns::[expr]},
* {@code @*::[expr]}, {@code @[expr]} <p>
* Called if we peeked an '@' token.
*/
private AstNode attributeAccess()
throws IOException
{
int tt = nextToken(), atPos = ts.tokenBeg;
switch (tt) {
// handles: @name, @ns::name, @ns::*, @ns::[expr]
case Token.NAME:
return propertyName(atPos, ts.getString(), 0);
// handles: @*, @*::name, @*::*, @*::[expr]
case Token.MUL:
saveNameTokenData(ts.tokenBeg, "*", ts.lineno);
return propertyName(atPos, "*", 0);
// handles @[expr]
case Token.LB:
return xmlElemRef(atPos, null, -1);
default:
reportError("msg.no.name.after.xmlAttr");
return makeErrorNode();
}
}
代码示例来源:origin: geogebra/geogebra
private AstNode name(int ttFlagged, int tt) throws IOException {
String nameString = ts.getString();
int namePos = ts.tokenBeg, nameLineno = ts.lineno;
if (0 != (ttFlagged & TI_CHECK_LABEL) && peekToken() == Token.COLON) {
// Do not consume colon. It is used as an unwind indicator
// to return to statementHelper.
Label label = new Label(namePos, ts.tokenEnd - namePos);
label.setName(nameString);
label.setLineno(ts.lineno);
return label;
}
// Not a label. Unfortunately peeking the next token to check for
// a colon has biffed ts.tokenBeg, ts.tokenEnd. We store the name's
// bounds in instance vars and createNameNode uses them.
saveNameTokenData(namePos, nameString, nameLineno);
if (compilerEnv.isXmlAvailable()) {
return propertyName(-1, nameString, 0);
} else {
return createNameNode(true, Token.NAME);
}
}
代码示例来源:origin: ro.isdc.wro4j/rhino
private AstNode name(int ttFlagged, int tt) throws IOException {
String nameString = ts.getString();
int namePos = ts.tokenBeg, nameLineno = ts.lineno;
if (0 != (ttFlagged & TI_CHECK_LABEL) && peekToken() == Token.COLON) {
// Do not consume colon. It is used as an unwind indicator
// to return to statementHelper.
Label label = new Label(namePos, ts.tokenEnd - namePos);
label.setName(nameString);
label.setLineno(ts.lineno);
return label;
}
// Not a label. Unfortunately peeking the next token to check for
// a colon has biffed ts.tokenBeg, ts.tokenEnd. We store the name's
// bounds in instance vars and createNameNode uses them.
saveNameTokenData(namePos, nameString, nameLineno);
if (compilerEnv.isXmlAvailable()) {
return propertyName(-1, nameString, 0);
} else {
return createNameNode(true, Token.NAME);
}
}
代码示例来源:origin: io.apigee/rhino
private AstNode name(int ttFlagged, int tt) throws IOException {
String nameString = ts.getString();
int namePos = ts.tokenBeg, nameLineno = ts.lineno;
if (0 != (ttFlagged & TI_CHECK_LABEL) && peekToken() == Token.COLON) {
// Do not consume colon. It is used as an unwind indicator
// to return to statementHelper.
Label label = new Label(namePos, ts.tokenEnd - namePos);
label.setName(nameString);
label.setLineno(ts.lineno);
return label;
}
// Not a label. Unfortunately peeking the next token to check for
// a colon has biffed ts.tokenBeg, ts.tokenEnd. We store the name's
// bounds in instance vars and createNameNode uses them.
saveNameTokenData(namePos, nameString, nameLineno);
if (compilerEnv.isXmlAvailable()) {
return propertyName(-1, nameString, 0);
} else {
return createNameNode(true, Token.NAME);
}
}
代码示例来源:origin: com.github.tntim96/rhino
private AstNode name(int ttFlagged, int tt) throws IOException {
String nameString = ts.getString();
int namePos = ts.tokenBeg, nameLineno = ts.lineno;
if (0 != (ttFlagged & TI_CHECK_LABEL) && peekToken() == Token.COLON) {
// Do not consume colon. It is used as an unwind indicator
// to return to statementHelper.
Label label = new Label(namePos, ts.tokenEnd - namePos);
label.setName(nameString);
label.setLineno(ts.lineno);
return label;
}
// Not a label. Unfortunately peeking the next token to check for
// a colon has biffed ts.tokenBeg, ts.tokenEnd. We store the name's
// bounds in instance vars and createNameNode uses them.
saveNameTokenData(namePos, nameString, nameLineno);
if (compilerEnv.isXmlAvailable()) {
return propertyName(-1, nameString, 0);
} else {
return createNameNode(true, Token.NAME);
}
}
代码示例来源:origin: geogebra/geogebra
case Token.THROW:
saveNameTokenData(ts.tokenBeg, "throw", ts.lineno);
ref = propertyName(-1, "throw", memberTypeFlags);
break;
saveNameTokenData(ts.tokenBeg, "*", ts.lineno);
ref = propertyName(-1, "*", memberTypeFlags);
break;
saveNameTokenData(ts.tokenBeg, name, ts.lineno);
ref = propertyName(-1, name, memberTypeFlags);
break;
代码示例来源:origin: ro.isdc.wro4j/rhino
case Token.THROW:
saveNameTokenData(ts.tokenBeg, "throw", ts.lineno);
ref = propertyName(-1, "throw", memberTypeFlags);
break;
saveNameTokenData(ts.tokenBeg, "*", ts.lineno);
ref = propertyName(-1, "*", memberTypeFlags);
break;
saveNameTokenData(ts.tokenBeg, name, ts.lineno);
ref = propertyName(-1, name, memberTypeFlags);
break;
代码示例来源:origin: com.github.tntim96/rhino
case Token.THROW:
saveNameTokenData(ts.tokenBeg, "throw", ts.lineno);
ref = propertyName(-1, "throw", memberTypeFlags);
break;
saveNameTokenData(ts.tokenBeg, "*", ts.lineno);
ref = propertyName(-1, "*", memberTypeFlags);
break;
saveNameTokenData(ts.tokenBeg, name, ts.lineno);
ref = propertyName(-1, name, memberTypeFlags);
break;
代码示例来源:origin: io.apigee/rhino
case Token.THROW:
saveNameTokenData(ts.tokenBeg, "throw", ts.lineno);
ref = propertyName(-1, "throw", memberTypeFlags);
break;
saveNameTokenData(ts.tokenBeg, "*", ts.lineno);
ref = propertyName(-1, "*", memberTypeFlags);
break;
saveNameTokenData(ts.tokenBeg, name, ts.lineno);
ref = propertyName(-1, name, memberTypeFlags);
break;
代码示例来源:origin: io.apigee/rhino
saveNameTokenData(ts.tokenBeg, "*", ts.lineno);
name = createNameNode(false, -1);
break;
代码示例来源:origin: geogebra/geogebra
saveNameTokenData(ts.tokenBeg, "*", ts.lineno);
name = createNameNode(false, -1);
break;
代码示例来源:origin: ro.isdc.wro4j/rhino
saveNameTokenData(ts.tokenBeg, "*", ts.lineno);
name = createNameNode(false, -1);
break;
代码示例来源:origin: com.github.tntim96/rhino
saveNameTokenData(ts.tokenBeg, "*", ts.lineno);
name = createNameNode(false, -1);
break;
内容来源于网络,如有侵权,请联系作者删除!