io.deephaven.lang.generated.ChunkerBinaryExpression Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deephaven-open-api-lang-parser Show documentation
Show all versions of deephaven-open-api-lang-parser Show documentation
The 'open-api-lang-parser' project
/* Generated By:JJTree: Do not edit this line. ChunkerBinaryExpression.java Version 7.0 */
/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=true,VISITOR=true,TRACK_TOKENS=true,NODE_PREFIX=Chunker,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package io.deephaven.lang.generated;
import io.deephaven.lang.api.HasScope;
import io.deephaven.lang.api.IsScope;
import java.util.List;
import static java.util.Collections.singletonList;
public
class ChunkerBinaryExpression extends ScopedNode {
private Node left;
private Token joiner;
private Node right;
public ChunkerBinaryExpression(int id) {
super(id);
}
public ChunkerBinaryExpression(Chunker p, int id) {
super(p, id);
}
@Override
public Node rescope(List scope) {
super.rescope(scope);
// This can get called on malformed source where left is _not_ an IsScope.
// For example, if an unclosed string is on the left, and a .someMethod() afterwards.
if (left instanceof IsScope && joiner.image.equals(".") && right instanceof HasScope) {
right.addScope(singletonList((IsScope) left));
return right;
}
return this;
}
@Override
public void setScope(List scopes) {
assert null == ((HasScope)left).getScope() || ((HasScope) left).getScope().isEmpty();
left.addScope(scopes);
}
/** Accept the visitor. **/
public Object jjtAccept(ChunkerVisitor visitor, Object data) {
return
visitor.visitChunkerBinaryExpression(this, data);
}
public void setLeft(Node left) {
left.maybeDetach();
this.left = left;
assert this.right == null;
this.firstToken = left.jjtGetFirstToken();
left.jjtSetParent(this);
jjtInsertChild(left, 0);
}
public Node getLeft() {
return left;
}
public void setJoiner(Token joiner) {
this.joiner = joiner;
}
public Token getJoiner() {
return joiner;
}
public void setRight(Node right) {
right.maybeDetach();
this.right = right;
assert this.left != null;
this.lastToken = right.jjtGetLastToken();
right.jjtSetParent(this);
jjtAddChild(right, jjtGetNumChildren());
}
public Node getRight() {
return right;
}
}
/* JavaCC - OriginalChecksum=4e45dea0f4d154edc73a7ad71b584299 (do not edit this line) */