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

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

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

Parser.pushScope介绍

暂无

代码示例

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

private void enterLoop(Loop loop) {
  if (loopSet == null)
    loopSet = new ArrayList<Loop>();
  loopSet.add(loop);
  if (loopAndSwitchSet == null)
    loopAndSwitchSet = new ArrayList<Jump>();
  loopAndSwitchSet.add(loop);
  pushScope(loop);
  if (currentLabel != null) {
    currentLabel.setStatement(loop);
    currentLabel.getFirstLabel().setLoop(loop);
    // This is the only time during parsing that we set a node's parent
    // before parsing the children.  In order for the child node offsets
    // to be correct, we adjust the loop's reported position back to an
    // absolute source offset, and restore it when we call exitLoop().
    loop.setRelative(-currentLabel.getPosition());
  }
}

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

private void enterLoop(Loop loop) {
  if (loopSet == null)
    loopSet = new ArrayList<Loop>();
  loopSet.add(loop);
  if (loopAndSwitchSet == null)
    loopAndSwitchSet = new ArrayList<Jump>();
  loopAndSwitchSet.add(loop);
  pushScope(loop);
  if (currentLabel != null) {
    currentLabel.setStatement(loop);
    currentLabel.getFirstLabel().setLoop(loop);
    // This is the only time during parsing that we set a node's parent
    // before parsing the children.  In order for the child node offsets
    // to be correct, we adjust the loop's reported position back to an
    // absolute source offset, and restore it when we call exitLoop().
    loop.setRelative(-currentLabel.getPosition());
  }
}

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

private void enterLoop(Loop loop) {
  if (loopSet == null)
    loopSet = new ArrayList<Loop>();
  loopSet.add(loop);
  if (loopAndSwitchSet == null)
    loopAndSwitchSet = new ArrayList<Jump>();
  loopAndSwitchSet.add(loop);
  pushScope(loop);
  if (currentLabel != null) {
    currentLabel.setStatement(loop);
    currentLabel.getFirstLabel().setLoop(loop);
    // This is the only time during parsing that we set a node's parent
    // before parsing the children.  In order for the child node offsets
    // to be correct, we adjust the loop's reported position back to an
    // absolute source offset, and restore it when we call exitLoop().
    loop.setRelative(-currentLabel.getPosition());
  }
}

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

private void enterLoop(Loop loop) {
  if (loopSet == null)
    loopSet = new ArrayList<Loop>();
  loopSet.add(loop);
  if (loopAndSwitchSet == null)
    loopAndSwitchSet = new ArrayList<Jump>();
  loopAndSwitchSet.add(loop);
  pushScope(loop);
  if (currentLabel != null) {
    currentLabel.setStatement(loop);
    currentLabel.getFirstLabel().setLoop(loop);
    // This is the only time during parsing that we set a node's parent
    // before parsing the children.  In order for the child node offsets
    // to be correct, we adjust the loop's reported position back to an
    // absolute source offset, and restore it when we call exitLoop().
    loop.setRelative(-currentLabel.getPosition());
  }
}

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

private Node enterLoop(Node loopLabel, boolean doPushScope)
{
  Node loop = nf.createLoopNode(loopLabel, ts.getLineno());
  if (loopSet == null) {
    loopSet = new ObjArray();
    if (loopAndSwitchSet == null) {
      loopAndSwitchSet = new ObjArray();
    }
  }
  loopSet.push(loop);
  loopAndSwitchSet.push(loop);
  if (doPushScope) {
    pushScope(loop);
  }
  return loop;
}

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

private AstNode block()
  throws IOException
{
  if (currentToken != Token.LC) codeBug();
  consumeToken();
  int pos = ts.tokenBeg;
  Scope block = new Scope(pos);
  block.setLineno(ts.lineno);
  pushScope(block);
  try {
    statements(block);
    mustMatchToken(Token.RC, "msg.no.brace.block");
    block.setLength(ts.tokenEnd - pos);
    return block;
  } finally {
    popScope();
  }
}

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

private AstNode block()
  throws IOException
{
  if (currentToken != Token.LC) codeBug();
  consumeToken();
  int pos = ts.tokenBeg;
  Scope block = new Scope(pos);
  block.setLineno(ts.lineno);
  pushScope(block);
  try {
    statements(block);
    mustMatchToken(Token.RC, "msg.no.brace.block");
    block.setLength(ts.tokenEnd - pos);
    return block;
  } finally {
    popScope();
  }
}

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

private AstNode block()
  throws IOException
{
  if (currentToken != Token.LC) codeBug();
  consumeToken();
  int pos = ts.tokenBeg;
  Scope block = new Scope(pos);
  block.setLineno(ts.lineno);
  pushScope(block);
  try {
    statements(block);
    mustMatchToken(Token.RC, "msg.no.brace.block");
    block.setLength(ts.tokenEnd - pos);
    return block;
  } finally {
    popScope();
  }
}

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

private AstNode block()
  throws IOException
{
  if (currentToken != Token.LC) codeBug();
  consumeToken();
  int pos = ts.tokenBeg;
  Scope block = new Scope(pos);
  block.setLineno(ts.lineno);
  pushScope(block);
  try {
    statements(block);
    mustMatchToken(Token.RC, "msg.no.brace.block");
    block.setLength(ts.tokenEnd - pos);
    return block;
  } finally {
    popScope();
  }
}

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

createName(Token.NAME, tempName, right)));
try {
  pushScope(result);
  defineSymbol(Token.LET, tempName, true);
} finally {

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

createName(Token.NAME, tempName, right)));
try {
  pushScope(result);
  defineSymbol(Token.LET, tempName, true);
} finally {

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

createName(Token.NAME, tempName, right)));
try {
  pushScope(result);
  defineSymbol(Token.LET, tempName, true);
} finally {

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

decompiler.addToken(Token.LP);
Node result = nf.createScopeNode(Token.LET, ts.getLineno());
pushScope(result);
try {
   Node vars = variables(false, Token.LET);

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

GeneratorExpressionLoop pn = new GeneratorExpressionLoop(pos);
pushScope(pn);
try {
  if (mustMatchToken(Token.LP, "msg.no.paren.for")) {

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

GeneratorExpressionLoop pn = new GeneratorExpressionLoop(pos);
pushScope(pn);
try {
  if (mustMatchToken(Token.LP, "msg.no.paren.for")) {

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

GeneratorExpressionLoop pn = new GeneratorExpressionLoop(pos);
pushScope(pn);
try {
  if (mustMatchToken(Token.LP, "msg.no.paren.for")) {

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

if (mustMatchToken(Token.LP, "msg.no.paren.after.let"))
  pn.setLp(ts.tokenBeg - pos);
pushScope(pn);
try {
  VariableDeclaration vars = variables(Token.LET, ts.tokenBeg, isStatement);

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

if (mustMatchToken(Token.LP, "msg.no.paren.after.let"))
  pn.setLp(ts.tokenBeg - pos);
pushScope(pn);
try {
  VariableDeclaration vars = variables(Token.LET, ts.tokenBeg, isStatement);

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

if (mustMatchToken(Token.LP, "msg.no.paren.after.let"))
  pn.setLp(ts.tokenBeg - pos);
pushScope(pn);
try {
  VariableDeclaration vars = variables(Token.LET, ts.tokenBeg, isStatement);

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

if (mustMatchToken(Token.LP, "msg.no.paren.after.let"))
  pn.setLp(ts.tokenBeg - pos);
pushScope(pn);
try {
  VariableDeclaration vars = variables(Token.LET, ts.tokenBeg, isStatement);

相关文章

微信公众号

Parser类方法