Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
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 (309)
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/ConditionalExpression.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.Token; /** * AST node representing the ternary operator. Node type is * {@link Token#HOOK}. * * <pre><i>ConditionalExpression</i> : * LogicalORExpression * LogicalORExpression ? AssignmentExpression * : AssignmentExpression * * <i>ConditionalExpressionNoIn</i> : * LogicalORExpressionNoIn * LogicalORExpressionNoIn ? AssignmentExpression * : AssignmentExpressionNoIn</pre> */ public class ConditionalExpression extends AstNode { private AstNode testExpression; private AstNode trueExpression; private AstNode falseExpression; private int questionMarkPosition = -1; private int colonPosition = -1; { type = Token.HOOK; } public ConditionalExpression() { } public ConditionalExpression(int pos) { super(pos); } public ConditionalExpression(int pos, int len) { super(pos, len); } /** * Returns test expression */ public AstNode getTestExpression() { return testExpression; } /** * Sets test expression, and sets its parent. * @param testExpression test expression * @throws IllegalArgumentException if testExpression is {@code null} */ public void setTestExpression(AstNode testExpression) { assertNotNull(testExpression); this.testExpression = testExpression; testExpression.setParent(this); } /** * Returns expression to evaluate if test is true */ public AstNode getTrueExpression() { return trueExpression; } /** * Sets expression to evaluate if test is true, and * sets its parent to this node. * @param trueExpression expression to evaluate if test is true * @throws IllegalArgumentException if expression is {@code null} */ public void setTrueExpression(AstNode trueExpression) { assertNotNull(trueExpression); this.trueExpression = trueExpression; trueExpression.setParent(this); } /** * Returns expression to evaluate if test is false */ public AstNode getFalseExpression() { return falseExpression; } /** * Sets expression to evaluate if test is false, and sets its * parent to this node. * @param falseExpression expression to evaluate if test is false * @throws IllegalArgumentException if {@code falseExpression} * is {@code null} */ public void setFalseExpression(AstNode falseExpression) { assertNotNull(falseExpression); this.falseExpression = falseExpression; falseExpression.setParent(this); } /** * Returns position of ? token */ public int getQuestionMarkPosition() { return questionMarkPosition; } /** * Sets position of ? token * @param questionMarkPosition position of ? token */ public void setQuestionMarkPosition(int questionMarkPosition) { this.questionMarkPosition = questionMarkPosition; } /** * Returns position of : token */ public int getColonPosition() { return colonPosition; } /** * Sets position of : token * @param colonPosition position of : token */ public void setColonPosition(int colonPosition) { this.colonPosition = colonPosition; } @Override public boolean hasSideEffects() { if (testExpression == null || trueExpression == null || falseExpression == null) codeBug(); return trueExpression.hasSideEffects() && falseExpression.hasSideEffects(); } @Override public String toSource(int depth) { StringBuilder sb = new StringBuilder(); sb.append(makeIndent(depth)); sb.append(testExpression.toSource(depth)); sb.append(" ? "); sb.append(trueExpression.toSource(0)); sb.append(" : "); sb.append(falseExpression.toSource(0)); return sb.toString(); } /** * Visits this node, then the test-expression, the true-expression, * and the false-expression. */ @Override public void visit(NodeVisitor v) { if (v.visit(this)) { testExpression.visit(v); trueExpression.visit(v); falseExpression.visit(v); } } }
⏎ org/mozilla/javascript/ast/ConditionalExpression.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, 35368👍, 1💬
Popular Posts:
iText is an ideal library for developers looking to enhance web- and other applications with dynamic...
JLayer is a library that decodes/plays/converts MPEG 1/2/2.5 Layer 1/2/3 (i.e. MP3) in real time for...
What Is commons-io-2.11.jar? commons-io-2.11.jar is the JAR file for Commons IO 2.5, which is a libr...
What Is poi-5.2.3.jar? poi-5.2.3.jar is one of the JAR files for Apache POI 5.2.3, which provides an...
What Is poi-scratchpad-5.2.3.jar ?poi-scratchpad-5.2.3.jar is one of the JAR files for Apache POI 5....