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. --- .../solver/language/solverLanguage/LogicValue.java | 271 +++++++++++++++++++++ 1 file changed, 271 insertions(+) create mode 100644 Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/LogicValue.java (limited to 'Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/LogicValue.java') diff --git a/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/LogicValue.java b/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/LogicValue.java new file mode 100644 index 00000000..61be81f7 --- /dev/null +++ b/Application/org.eclipse.viatra.solver.language/src-gen/org/eclipse/viatra/solver/language/solverLanguage/LogicValue.java @@ -0,0 +1,271 @@ +/** + * 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 '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 'TRUE' literal object. + * + * + * @see #TRUE_VALUE + * @generated + * @ordered + */ + TRUE(0, "TRUE", "true"), + + /** + * The 'FALSE' literal object. + * + * + * @see #FALSE_VALUE + * @generated + * @ordered + */ + FALSE(1, "FALSE", "false"), + + /** + * The 'UNKNOWN' literal object. + * + * + * @see #UNKNOWN_VALUE + * @generated + * @ordered + */ + UNKNOWN(2, "UNKNOWN", "unknown"), + + /** + * The 'ERROR' literal object. + * + * + * @see #ERROR_VALUE + * @generated + * @ordered + */ + ERROR(3, "ERROR", "error"); + + /** + * The 'TRUE' literal value. + * + * + * @see #TRUE + * @model literal="true" + * @generated + * @ordered + */ + public static final int TRUE_VALUE = 0; + + /** + * The 'FALSE' literal value. + * + * + * @see #FALSE + * @model literal="false" + * @generated + * @ordered + */ + public static final int FALSE_VALUE = 1; + + /** + * The 'UNKNOWN' literal value. + * + * + * @see #UNKNOWN + * @model literal="unknown" + * @generated + * @ordered + */ + public static final int UNKNOWN_VALUE = 2; + + /** + * The 'ERROR' literal value. + * + * + * @see #ERROR + * @model literal="error" + * @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[] + { + TRUE, + FALSE, + UNKNOWN, + 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 TRUE_VALUE: return TRUE; + case FALSE_VALUE: return FALSE; + case UNKNOWN_VALUE: return UNKNOWN; + 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 + */ + @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; + } + +} //LogicValue -- cgit v1.2.3-70-g09d2