From 419e76265ecbdf65e960e0624be006d31ed1e191 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Fri, 8 May 2020 18:28:19 +0200 Subject: Update solver language grammar First version, still needs TokenSource and Linker to work. --- .../language/solverLanguage/AggregationOp.java | 317 +++++++++++++++++++++ 1 file changed, 317 insertions(+) create mode 100644 Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/AggregationOp.java (limited to 'Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/AggregationOp.java') diff --git a/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/AggregationOp.java b/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/AggregationOp.java new file mode 100644 index 00000000..1a0664ed --- /dev/null +++ b/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/AggregationOp.java @@ -0,0 +1,317 @@ +/** + * generated by Xtext 2.21.0 + */ +package org.eclipse.viatra.solver.language.solverLanguage; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Aggregation Op', + * and utility methods for working with them. + * + * @see org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage#getAggregationOp() + * @model + * @generated + */ +public enum AggregationOp implements Enumerator +{ + /** + * The 'ONLY' literal object. + * + * + * @see #ONLY_VALUE + * @generated + * @ordered + */ + ONLY(0, "ONLY", "only"), + + /** + * The 'SUM' literal object. + * + * + * @see #SUM_VALUE + * @generated + * @ordered + */ + SUM(1, "SUM", "sum"), + + /** + * The 'PROD' literal object. + * + * + * @see #PROD_VALUE + * @generated + * @ordered + */ + PROD(2, "PROD", "prod"), + + /** + * The 'AVG' literal object. + * + * + * @see #AVG_VALUE + * @generated + * @ordered + */ + AVG(3, "AVG", "avg"), + + /** + * The 'MIN' literal object. + * + * + * @see #MIN_VALUE + * @generated + * @ordered + */ + MIN(4, "MIN", "min"), + + /** + * The 'MAX' literal object. + * + * + * @see #MAX_VALUE + * @generated + * @ordered + */ + MAX(5, "MAX", "max"); + + /** + * The 'ONLY' literal value. + * + * + * @see #ONLY + * @model literal="only" + * @generated + * @ordered + */ + public static final int ONLY_VALUE = 0; + + /** + * The 'SUM' literal value. + * + * + * @see #SUM + * @model literal="sum" + * @generated + * @ordered + */ + public static final int SUM_VALUE = 1; + + /** + * The 'PROD' literal value. + * + * + * @see #PROD + * @model literal="prod" + * @generated + * @ordered + */ + public static final int PROD_VALUE = 2; + + /** + * The 'AVG' literal value. + * + * + * @see #AVG + * @model literal="avg" + * @generated + * @ordered + */ + public static final int AVG_VALUE = 3; + + /** + * The 'MIN' literal value. + * + * + * @see #MIN + * @model literal="min" + * @generated + * @ordered + */ + public static final int MIN_VALUE = 4; + + /** + * The 'MAX' literal value. + * + * + * @see #MAX + * @model literal="max" + * @generated + * @ordered + */ + public static final int MAX_VALUE = 5; + + /** + * An array of all the 'Aggregation Op' enumerators. + * + * + * @generated + */ + private static final AggregationOp[] VALUES_ARRAY = + new AggregationOp[] + { + ONLY, + SUM, + PROD, + AVG, + MIN, + MAX, + }; + + /** + * A public read-only list of all the 'Aggregation Op' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Aggregation Op' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static AggregationOp get(String literal) + { + for (int i = 0; i < VALUES_ARRAY.length; ++i) + { + AggregationOp result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) + { + return result; + } + } + return null; + } + + /** + * Returns the 'Aggregation Op' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static AggregationOp getByName(String name) + { + for (int i = 0; i < VALUES_ARRAY.length; ++i) + { + AggregationOp result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) + { + return result; + } + } + return null; + } + + /** + * Returns the 'Aggregation Op' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static AggregationOp get(int value) + { + switch (value) + { + case ONLY_VALUE: return ONLY; + case SUM_VALUE: return SUM; + case PROD_VALUE: return PROD; + case AVG_VALUE: return AVG; + case MIN_VALUE: return MIN; + case MAX_VALUE: return MAX; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private AggregationOp(int value, String name, String literal) + { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + @Override + public int getValue() + { + return value; + } + + /** + * + * + * @generated + */ + @Override + public String getName() + { + return name; + } + + /** + * + * + * @generated + */ + @Override + public String getLiteral() + { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() + { + return literal; + } + +} //AggregationOp -- cgit v1.2.3-70-g09d2