123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458 |
- /**
- */
- package org.yakindu.base.expressions.expressions;
- import java.util.Arrays;
- import java.util.Collections;
- import java.util.List;
- import org.eclipse.emf.common.util.Enumerator;
- /**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Assignment Operator</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- * @see org.yakindu.base.expressions.expressions.ExpressionsPackage#getAssignmentOperator()
- * @model
- * @generated
- */
- public enum AssignmentOperator implements Enumerator {
- /**
- * The '<em><b>Assign</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ASSIGN_VALUE
- * @generated
- * @ordered
- */
- ASSIGN(0, "assign", "="),
- /**
- * The '<em><b>Mult Assign</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #MULT_ASSIGN_VALUE
- * @generated
- * @ordered
- */
- MULT_ASSIGN(1, "multAssign", "*="),
- /**
- * The '<em><b>Div Assign</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #DIV_ASSIGN_VALUE
- * @generated
- * @ordered
- */
- DIV_ASSIGN(2, "divAssign", "/="),
- /**
- * The '<em><b>Mod Assign</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #MOD_ASSIGN_VALUE
- * @generated
- * @ordered
- */
- MOD_ASSIGN(3, "modAssign", "%="),
- /**
- * The '<em><b>Add Assign</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ADD_ASSIGN_VALUE
- * @generated
- * @ordered
- */
- ADD_ASSIGN(4, "addAssign", "+="),
- /**
- * The '<em><b>Sub Assign</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SUB_ASSIGN_VALUE
- * @generated
- * @ordered
- */
- SUB_ASSIGN(5, "subAssign", "-="),
- /**
- * The '<em><b>Left Shift Assign</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #LEFT_SHIFT_ASSIGN_VALUE
- * @generated
- * @ordered
- */
- LEFT_SHIFT_ASSIGN(6, "leftShiftAssign", "<<="),
- /**
- * The '<em><b>Right Shift Assign</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #RIGHT_SHIFT_ASSIGN_VALUE
- * @generated
- * @ordered
- */
- RIGHT_SHIFT_ASSIGN(7, "rightShiftAssign", ">>="),
- /**
- * The '<em><b>And Assign</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #AND_ASSIGN_VALUE
- * @generated
- * @ordered
- */
- AND_ASSIGN(8, "andAssign", "&="),
- /**
- * The '<em><b>Xor Assign</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #XOR_ASSIGN_VALUE
- * @generated
- * @ordered
- */
- XOR_ASSIGN(9, "xorAssign", "^="),
- /**
- * The '<em><b>Or Assign</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #OR_ASSIGN_VALUE
- * @generated
- * @ordered
- */
- OR_ASSIGN(10, "orAssign", "|=");
- /**
- * The '<em><b>Assign</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>Assign</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ASSIGN
- * @model name="assign" literal="="
- * @generated
- * @ordered
- */
- public static final int ASSIGN_VALUE = 0;
- /**
- * The '<em><b>Mult Assign</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>Mult Assign</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #MULT_ASSIGN
- * @model name="multAssign" literal="*="
- * @generated
- * @ordered
- */
- public static final int MULT_ASSIGN_VALUE = 1;
- /**
- * The '<em><b>Div Assign</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>Div Assign</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #DIV_ASSIGN
- * @model name="divAssign" literal="/="
- * @generated
- * @ordered
- */
- public static final int DIV_ASSIGN_VALUE = 2;
- /**
- * The '<em><b>Mod Assign</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>Mod Assign</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #MOD_ASSIGN
- * @model name="modAssign" literal="%="
- * @generated
- * @ordered
- */
- public static final int MOD_ASSIGN_VALUE = 3;
- /**
- * The '<em><b>Add Assign</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>Add Assign</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ADD_ASSIGN
- * @model name="addAssign" literal="+="
- * @generated
- * @ordered
- */
- public static final int ADD_ASSIGN_VALUE = 4;
- /**
- * The '<em><b>Sub Assign</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>Sub Assign</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SUB_ASSIGN
- * @model name="subAssign" literal="-="
- * @generated
- * @ordered
- */
- public static final int SUB_ASSIGN_VALUE = 5;
- /**
- * The '<em><b>Left Shift Assign</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>Left Shift Assign</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #LEFT_SHIFT_ASSIGN
- * @model name="leftShiftAssign" literal="<<="
- * @generated
- * @ordered
- */
- public static final int LEFT_SHIFT_ASSIGN_VALUE = 6;
- /**
- * The '<em><b>Right Shift Assign</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>Right Shift Assign</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #RIGHT_SHIFT_ASSIGN
- * @model name="rightShiftAssign" literal=">>="
- * @generated
- * @ordered
- */
- public static final int RIGHT_SHIFT_ASSIGN_VALUE = 7;
- /**
- * The '<em><b>And Assign</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>And Assign</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #AND_ASSIGN
- * @model name="andAssign" literal="&="
- * @generated
- * @ordered
- */
- public static final int AND_ASSIGN_VALUE = 8;
- /**
- * The '<em><b>Xor Assign</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>Xor Assign</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #XOR_ASSIGN
- * @model name="xorAssign" literal="^="
- * @generated
- * @ordered
- */
- public static final int XOR_ASSIGN_VALUE = 9;
- /**
- * The '<em><b>Or Assign</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>Or Assign</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #OR_ASSIGN
- * @model name="orAssign" literal="|="
- * @generated
- * @ordered
- */
- public static final int OR_ASSIGN_VALUE = 10;
- /**
- * An array of all the '<em><b>Assignment Operator</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final AssignmentOperator[] VALUES_ARRAY =
- new AssignmentOperator[] {
- ASSIGN,
- MULT_ASSIGN,
- DIV_ASSIGN,
- MOD_ASSIGN,
- ADD_ASSIGN,
- SUB_ASSIGN,
- LEFT_SHIFT_ASSIGN,
- RIGHT_SHIFT_ASSIGN,
- AND_ASSIGN,
- XOR_ASSIGN,
- OR_ASSIGN,
- };
- /**
- * A public read-only list of all the '<em><b>Assignment Operator</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<AssignmentOperator> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
- /**
- * Returns the '<em><b>Assignment Operator</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param literal the literal.
- * @return the matching enumerator or <code>null</code>.
- * @generated
- */
- public static AssignmentOperator get(String literal) {
- for (int i = 0; i < VALUES_ARRAY.length; ++i) {
- AssignmentOperator result = VALUES_ARRAY[i];
- if (result.toString().equals(literal)) {
- return result;
- }
- }
- return null;
- }
- /**
- * Returns the '<em><b>Assignment Operator</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param name the name.
- * @return the matching enumerator or <code>null</code>.
- * @generated
- */
- public static AssignmentOperator getByName(String name) {
- for (int i = 0; i < VALUES_ARRAY.length; ++i) {
- AssignmentOperator result = VALUES_ARRAY[i];
- if (result.getName().equals(name)) {
- return result;
- }
- }
- return null;
- }
- /**
- * Returns the '<em><b>Assignment Operator</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the integer value.
- * @return the matching enumerator or <code>null</code>.
- * @generated
- */
- public static AssignmentOperator get(int value) {
- switch (value) {
- case ASSIGN_VALUE: return ASSIGN;
- case MULT_ASSIGN_VALUE: return MULT_ASSIGN;
- case DIV_ASSIGN_VALUE: return DIV_ASSIGN;
- case MOD_ASSIGN_VALUE: return MOD_ASSIGN;
- case ADD_ASSIGN_VALUE: return ADD_ASSIGN;
- case SUB_ASSIGN_VALUE: return SUB_ASSIGN;
- case LEFT_SHIFT_ASSIGN_VALUE: return LEFT_SHIFT_ASSIGN;
- case RIGHT_SHIFT_ASSIGN_VALUE: return RIGHT_SHIFT_ASSIGN;
- case AND_ASSIGN_VALUE: return AND_ASSIGN;
- case XOR_ASSIGN_VALUE: return XOR_ASSIGN;
- case OR_ASSIGN_VALUE: return OR_ASSIGN;
- }
- return null;
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private AssignmentOperator(int value, String name, String literal) {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue() {
- return value;
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName() {
- return name;
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral() {
- return literal;
- }
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString() {
- return literal;
- }
-
- } //AssignmentOperator
|