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/Symbol.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;
/**
* Represents a symbol-table entry.
*/
public class Symbol {
// One of Token.FUNCTION, Token.LP (for parameters), Token.VAR,
// Token.LET, or Token.CONST
private int declType;
private int index = -1;
private String name;
private Node node;
private Scope containingTable;
public Symbol() {
}
/**
* Constructs a new Symbol with a specific name and declaration type
* @param declType {@link Token#FUNCTION}, {@link Token#LP}
* (for params), {@link Token#VAR}, {@link Token#LET} or {@link Token#CONST}
*/
public Symbol(int declType, String name) {
setName(name);
setDeclType(declType);
}
/**
* Returns symbol declaration type
*/
public int getDeclType() {
return declType;
}
/**
* Sets symbol declaration type
*/
public void setDeclType(int declType) {
if (!(declType == Token.FUNCTION
|| declType == Token.LP
|| declType == Token.VAR
|| declType == Token.LET
|| declType == Token.CONST))
throw new IllegalArgumentException("Invalid declType: " + declType);
this.declType = declType;
}
/**
* Returns symbol name
*/
public String getName() {
return name;
}
/**
* Sets symbol name
*/
public void setName(String name) {
this.name = name;
}
/**
* Returns the node associated with this identifier
*/
public Node getNode() {
return node;
}
/**
* Returns symbol's index in its scope
*/
public int getIndex() {
return index;
}
/**
* Sets symbol's index in its scope
*/
public void setIndex(int index) {
this.index = index;
}
/**
* Sets the node associated with this identifier
*/
public void setNode(Node node) {
this.node = node;
}
/**
* Returns the Scope in which this symbol is entered
*/
public Scope getContainingTable() {
return containingTable;
}
/**
* Sets this symbol's Scope
*/
public void setContainingTable(Scope containingTable) {
this.containingTable = containingTable;
}
public String getDeclTypeName() {
return Token.typeToName(declType);
}
@Override
public String toString() {
StringBuilder result = new StringBuilder();
result.append("Symbol (");
result.append(getDeclTypeName());
result.append(") name=");
result.append(name);
if (node != null) {
result.append(" line=");
result.append(node.getLineno());
}
return result.toString();
}
}
⏎ org/mozilla/javascript/ast/Symbol.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, ≈173🔥, 1💬
Popular Posts:
JDK 17 jdk.incubator.foreign.jm odis the JMOD file for JDK 17 HTTP Server module. JDK 17 Incubator F...
Apache BCEL Source Code Files are inside the Apache BCEL source package file like bcel-6.5.0-src.zip...
JDK 11 jdk.jfr.jmod is the JMOD file for JDK 11 JFR module. JDK 11 JFR module compiled class files a...
JDK 11 java.xml.crypto.jmod is the JMOD file for JDK 11 XML (eXtensible Markup Language) Crypto modu...
This package is the backport of java.util.concurrent API, introduced in Java 5.0 and further refined...