All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.danielnaczo.python3parser.model.expr.ExpressionsList Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
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