Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
Rhino JavaScript Java Library Source Code
Rhino JavaScript Java Library is an open-source implementation of JavaScript
written entirely in Java.
Rhino JavaScript Java Library Source Code files are provided in binary package (rhino-1.7.14.zip).
You can also browse the source code below:
✍: FYIcenter.com
⏎ org/mozilla/javascript/ast/Jump.java
/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.javascript.ast;
import org.mozilla.javascript.Node;
import org.mozilla.javascript.Token;
/**
* Used for code generation. During codegen, the AST is transformed
* into an Intermediate Representation (IR) in which loops, ifs, switches
* and other control-flow statements are rewritten as labeled jumps.
* If the parser is set to IDE-mode, the resulting AST will not contain
* any instances of this class.
*/
public class Jump extends AstNode {
public Node target;
private Node target2;
private Jump jumpNode;
public Jump() {
type = Token.ERROR;
}
public Jump(int nodeType) {
type = nodeType;
}
public Jump(int type, int lineno) {
this(type);
setLineno(lineno);
}
public Jump(int type, Node child) {
this(type);
addChildToBack(child);
}
public Jump(int type, Node child, int lineno) {
this(type, child);
setLineno(lineno);
}
public Jump getJumpStatement()
{
if (type != Token.BREAK && type != Token.CONTINUE) codeBug();
return jumpNode;
}
public void setJumpStatement(Jump jumpStatement)
{
if (type != Token.BREAK && type != Token.CONTINUE) codeBug();
if (jumpStatement == null) codeBug();
if (this.jumpNode != null) codeBug(); //only once
this.jumpNode = jumpStatement;
}
public Node getDefault()
{
if (type != Token.SWITCH) codeBug();
return target2;
}
public void setDefault(Node defaultTarget)
{
if (type != Token.SWITCH) codeBug();
if (defaultTarget.getType() != Token.TARGET) codeBug();
if (target2 != null) codeBug(); //only once
target2 = defaultTarget;
}
public Node getFinally()
{
if (type != Token.TRY) codeBug();
return target2;
}
public void setFinally(Node finallyTarget)
{
if (type != Token.TRY) codeBug();
if (finallyTarget.getType() != Token.TARGET) codeBug();
if (target2 != null) codeBug(); //only once
target2 = finallyTarget;
}
public Jump getLoop()
{
if (type != Token.LABEL) codeBug();
return jumpNode;
}
public void setLoop(Jump loop)
{
if (type != Token.LABEL) codeBug();
if (loop == null) codeBug();
if (jumpNode != null) codeBug(); //only once
jumpNode = loop;
}
public Node getContinue()
{
if (type != Token.LOOP) codeBug();
return target2;
}
public void setContinue(Node continueTarget)
{
if (type != Token.LOOP) codeBug();
if (continueTarget.getType() != Token.TARGET) codeBug();
if (target2 != null) codeBug(); //only once
target2 = continueTarget;
}
/**
* Jumps are only used directly during code generation, and do
* not support this interface.
* @throws UnsupportedOperationException
*/
@Override
public void visit(NodeVisitor visitor) {
throw new UnsupportedOperationException(this.toString());
}
@Override
public String toSource(int depth) {
throw new UnsupportedOperationException(this.toString());
}
}
⏎ org/mozilla/javascript/ast/Jump.java
Or download all of them as a single archive file:
File name: rhino-1.7.14-sources.jar File size: 1029165 bytes Release date: 2022-01-06 Download
⇒ Example code to Test rhino-runtime-1.7.14.jar
⇐ Download Rhino JavaScript Binary Package
2022-05-03, ≈99🔥, 1💬
Popular Posts:
JRE 5 sunjce_provider.jar is the JAR file for JRE 5 Sun JCE Provider, which provides implementations...
Guava is a suite of core and expanded libraries that include utility classes, google's collections, ...
Where to get the Java source code for Connector/J 8.0 Protocol Impl module? Java source code files f...
Where to find answers to frequently asked questions on Downloading and Using JDK (Java Development K...
maven-settings-builder-3 .8.6.jaris the JAR file for Apache Maven 3.8.6 Settings Builder module. Apa...