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

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

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

Parser.pushScope介绍

暂无

代码示例

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

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

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

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

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

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

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

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

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

  1. private Node enterLoop(Node loopLabel, boolean doPushScope)
  2. {
  3. Node loop = nf.createLoopNode(loopLabel, ts.getLineno());
  4. if (loopSet == null) {
  5. loopSet = new ObjArray();
  6. if (loopAndSwitchSet == null) {
  7. loopAndSwitchSet = new ObjArray();
  8. }
  9. }
  10. loopSet.push(loop);
  11. loopAndSwitchSet.push(loop);
  12. if (doPushScope) {
  13. pushScope(loop);
  14. }
  15. return loop;
  16. }

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

  1. private AstNode block()
  2. throws IOException
  3. {
  4. if (currentToken != Token.LC) codeBug();
  5. consumeToken();
  6. int pos = ts.tokenBeg;
  7. Scope block = new Scope(pos);
  8. block.setLineno(ts.lineno);
  9. pushScope(block);
  10. try {
  11. statements(block);
  12. mustMatchToken(Token.RC, "msg.no.brace.block");
  13. block.setLength(ts.tokenEnd - pos);
  14. return block;
  15. } finally {
  16. popScope();
  17. }
  18. }

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

  1. private AstNode block()
  2. throws IOException
  3. {
  4. if (currentToken != Token.LC) codeBug();
  5. consumeToken();
  6. int pos = ts.tokenBeg;
  7. Scope block = new Scope(pos);
  8. block.setLineno(ts.lineno);
  9. pushScope(block);
  10. try {
  11. statements(block);
  12. mustMatchToken(Token.RC, "msg.no.brace.block");
  13. block.setLength(ts.tokenEnd - pos);
  14. return block;
  15. } finally {
  16. popScope();
  17. }
  18. }

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

  1. private AstNode block()
  2. throws IOException
  3. {
  4. if (currentToken != Token.LC) codeBug();
  5. consumeToken();
  6. int pos = ts.tokenBeg;
  7. Scope block = new Scope(pos);
  8. block.setLineno(ts.lineno);
  9. pushScope(block);
  10. try {
  11. statements(block);
  12. mustMatchToken(Token.RC, "msg.no.brace.block");
  13. block.setLength(ts.tokenEnd - pos);
  14. return block;
  15. } finally {
  16. popScope();
  17. }
  18. }

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

  1. private AstNode block()
  2. throws IOException
  3. {
  4. if (currentToken != Token.LC) codeBug();
  5. consumeToken();
  6. int pos = ts.tokenBeg;
  7. Scope block = new Scope(pos);
  8. block.setLineno(ts.lineno);
  9. pushScope(block);
  10. try {
  11. statements(block);
  12. mustMatchToken(Token.RC, "msg.no.brace.block");
  13. block.setLength(ts.tokenEnd - pos);
  14. return block;
  15. } finally {
  16. popScope();
  17. }
  18. }

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

  1. createName(Token.NAME, tempName, right)));
  2. try {
  3. pushScope(result);
  4. defineSymbol(Token.LET, tempName, true);
  5. } finally {

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

  1. createName(Token.NAME, tempName, right)));
  2. try {
  3. pushScope(result);
  4. defineSymbol(Token.LET, tempName, true);
  5. } finally {

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

  1. createName(Token.NAME, tempName, right)));
  2. try {
  3. pushScope(result);
  4. defineSymbol(Token.LET, tempName, true);
  5. } finally {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

相关文章

Parser类方法