From 42c58bbeead1dae09c51f47abc8e10dfbb9c3f9f Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Tue, 23 Jun 2020 15:17:00 +0200 Subject: New configuration language parser WIP --- .../solver/language/solverLanguage/LogicValue.java | 250 +++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 Application/org.eclipse.viatra.solver.language.model/src-gen/org/eclipse/viatra/solver/language/solverLanguage/LogicValue.java (limited to 'Application/org.eclipse.viatra.solver.language.model/src-gen/org/eclipse/viatra/solver/language/solverLanguage/LogicValue.java') diff --git a/Application/org.eclipse.viatra.solver.language.model/src-gen/org/eclipse/viatra/solver/language/solverLanguage/LogicValue.java b/Application/org.eclipse.viatra.solver.language.model/src-gen/org/eclipse/viatra/solver/language/solverLanguage/LogicValue.java new file mode 100644 index 00000000..6b6148c0 --- /dev/null +++ b/Application/org.eclipse.viatra.solver.language.model/src-gen/org/eclipse/viatra/solver/language/solverLanguage/LogicValue.java @@ -0,0 +1,250 @@ +/** + */ +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 'Logic Value', + * and utility methods for working with them. + * + * @see org.eclipse.viatra.solver.language.solverLanguage.SolverLanguagePackage#getLogicValue() + * @model + * @generated + */ +public enum LogicValue implements Enumerator { + /** + * The 'UNKNOWN' literal object. + * + * + * @see #UNKNOWN_VALUE + * @generated + * @ordered + */ + UNKNOWN(0, "UNKNOWN", "UNKNOWN"), + + /** + * The 'FALSE' literal object. + * + * + * @see #FALSE_VALUE + * @generated + * @ordered + */ + FALSE(1, "FALSE", "FALSE"), + + /** + * The 'TRUE' literal object. + * + * + * @see #TRUE_VALUE + * @generated + * @ordered + */ + TRUE(2, "TRUE", "TRUE"), + + /** + * The 'ERROR' literal object. + * + * + * @see #ERROR_VALUE + * @generated + * @ordered + */ + ERROR(3, "ERROR", "ERROR"); + + /** + * The 'UNKNOWN' literal value. + * + * + * @see #UNKNOWN + * @model + * @generated + * @ordered + */ + public static final int UNKNOWN_VALUE = 0; + + /** + * The 'FALSE' literal value. + * + * + * @see #FALSE + * @model + * @generated + * @ordered + */ + public static final int FALSE_VALUE = 1; + + /** + * The 'TRUE' literal value. + * + * + * @see #TRUE + * @model + * @generated + * @ordered + */ + public static final int TRUE_VALUE = 2; + + /** + * The 'ERROR' literal value. + * + * + * @see #ERROR + * @model + * @generated + * @ordered + */ + public static final int ERROR_VALUE = 3; + + /** + * An array of all the 'Logic Value' enumerators. + * + * + * @generated + */ + private static final LogicValue[] VALUES_ARRAY = new LogicValue[] { UNKNOWN, FALSE, TRUE, ERROR, }; + + /** + * A public read-only list of all the 'Logic Value' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Logic Value' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static LogicValue get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + LogicValue result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Logic Value' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static LogicValue getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + LogicValue result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Logic Value' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static LogicValue get(int value) { + switch (value) { + case UNKNOWN_VALUE: + return UNKNOWN; + case FALSE_VALUE: + return FALSE; + case TRUE_VALUE: + return TRUE; + case ERROR_VALUE: + return ERROR; + } + 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 LogicValue(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //LogicValue -- cgit v1.2.3-70-g09d2