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

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

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

Parser.propertyName介绍

[英]Check if :: follows name in which case it becomes a qualified name.
[中]检查::是否跟随name,在这种情况下,它将成为限定名。

代码示例

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

pn = propertyName(pn, s, memberTypeFlags);
pn = propertyName(pn, "*", memberTypeFlags);
break;

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

pn = propertyName(pn, s, memberTypeFlags);
pn = propertyName(pn, "*", memberTypeFlags);
break;

代码示例来源:origin: com.yahoo/yuicompressor

pn = propertyName(pn, s, memberTypeFlags);
pn = propertyName(pn, "*", memberTypeFlags);
break;

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

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: geogebra/geogebra

ref = propertyName(-1, "throw", memberTypeFlags);
break;
ref = propertyName(-1, ts.getString(), memberTypeFlags);
break;
ref = propertyName(-1, "*", memberTypeFlags);
break;
  if (name != null) {
    saveNameTokenData(ts.tokenBeg, name, ts.lineno);
    ref = propertyName(-1, name, memberTypeFlags);
    break;

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

ref = propertyName(-1, "throw", memberTypeFlags);
break;
ref = propertyName(-1, ts.getString(), memberTypeFlags);
break;
ref = propertyName(-1, "*", memberTypeFlags);
break;
  if (name != null) {
    saveNameTokenData(ts.tokenBeg, name, ts.lineno);
    ref = propertyName(-1, name, memberTypeFlags);
    break;

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

ref = propertyName(-1, "throw", memberTypeFlags);
break;
ref = propertyName(-1, ts.getString(), memberTypeFlags);
break;
ref = propertyName(-1, "*", memberTypeFlags);
break;
  if (name != null) {
    saveNameTokenData(ts.tokenBeg, name, ts.lineno);
    ref = propertyName(-1, name, memberTypeFlags);
    break;

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

ref = propertyName(-1, "throw", memberTypeFlags);
break;
ref = propertyName(-1, ts.getString(), memberTypeFlags);
break;
ref = propertyName(-1, "*", memberTypeFlags);
break;
  if (name != null) {
    saveNameTokenData(ts.tokenBeg, name, ts.lineno);
    ref = propertyName(-1, name, memberTypeFlags);
    break;

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

pn = propertyName(pn, "throw", memberTypeFlags);
break;
s = ts.getString();
decompiler.addName(s);
pn = propertyName(pn, s, memberTypeFlags);
break;
pn = propertyName(pn, "*", memberTypeFlags);
break;

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

s = ts.getString();
decompiler.addName(s);
pn = propertyName(pn, s, memberTypeFlags);
break;
pn = propertyName(pn, "*", memberTypeFlags);
break;

代码示例来源:origin: com.yahoo/yuicompressor

s = ts.getString();
decompiler.addName(s);
pn = propertyName(pn, s, memberTypeFlags);
break;
pn = propertyName(pn, "*", memberTypeFlags);
break;

代码示例来源:origin: com.yahoo/yuicompressor

pn = propertyName(null, name, 0);
} else {
  pn = nf.createName(name);

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

pn = propertyName(null, name, 0);
} else {
  pn = nf.createName(name);

相关文章

Parser类方法