io.github.danielnaczo.python3parser.model.expr.ExpressionsList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of python3parser Show documentation
Show all versions of python3parser Show documentation
A Java-based Python3-Parser.
package io.github.danielnaczo.python3parser.model.expr;
import java.util.List;
import java.util.Objects;
import io.github.danielnaczo.python3parser.visitors.basic.Python3ASTVisitor;
//e.g.:
// expression, expression, expression
public class ExpressionsList extends Expression{
static int PRECEDENCE = 0;
public int getPrecedence() {
return PRECEDENCE;
}
List expressions;
public ExpressionsList(List expressions) {
this.expressions = expressions;
setParents();
}
private void setParents() {
if (expressions != null) {
for (Expression expr : expressions) {
if (expr != null) expr.setParent(this);
}
}
}
public List getExpressions() {
return expressions;
}
public void setExpressions(List expressions) {
this.expressions = expressions;
}
public R accept(Python3ASTVisitor visitor, P param) {
return visitor.visitExpressionList(this, param);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ExpressionsList)) return false;
ExpressionsList that = (ExpressionsList) o;
return Objects.equals(expressions, that.expressions);
}
@Override
public int hashCode() {
return Objects.hash(expressions);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy