001/*
002 * Copyright (c) 2012-2018 Institut National des Sciences Appliquées de Lyon (INSA Lyon) and others
003 *
004 * This program and the accompanying materials are made available under the
005 * terms of the Eclipse Public License 2.0 which is available at
006 * http://www.eclipse.org/legal/epl-2.0.
007 *
008 * SPDX-License-Identifier: EPL-2.0
009 */
010
011package org.eclipse.golo.compiler.parser;
012
013import java.util.ArrayList;
014import java.util.List;
015
016public class ASTAdditiveExpression extends GoloASTNode {
017
018  private final List<String> operators = new ArrayList<>();
019
020  public ASTAdditiveExpression(int id) {
021    super(id);
022  }
023
024  public ASTAdditiveExpression(GoloParser p, int id) {
025    super(p, id);
026  }
027
028  @Override
029  public Object jjtAccept(GoloParserVisitor visitor, Object data) {
030    return visitor.visit(this, data);
031  }
032
033  public List<String> getOperators() {
034    return operators;
035  }
036
037  public void addOperator(String symbol) {
038    operators.add(symbol);
039  }
040
041  @Override
042  public String toString() {
043    return String.format("ASTAdditiveExpression{operators=%s}", operators);
044  }
045}