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

x33g5p2x  于2022-01-26 转载在 JavaScript  
字(3.7k)|赞(0)|评价(0)|浏览(452)

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

Parser.xmlElemRef介绍

[英]Parse the [expr] portion of an xml element reference, e.g. @::[expr], or ns::[expr].
[中]解析xml元素引用的[expr]部分,例如@
:[expr]或ns::[expr]。

代码示例

代码示例来源: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: io.apigee/rhino

return xmlElemRef(atPos, ns, colonPos);

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

return xmlElemRef(atPos, ns, colonPos);

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

return xmlElemRef(atPos, ns, colonPos);

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

return xmlElemRef(atPos, ns, colonPos);

相关文章

Parser类方法