AssignmentOperator.java 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. /**
  2. */
  3. package org.yakindu.base.expressions.expressions;
  4. import java.util.Arrays;
  5. import java.util.Collections;
  6. import java.util.List;
  7. import org.eclipse.emf.common.util.Enumerator;
  8. /**
  9. * <!-- begin-user-doc -->
  10. * A representation of the literals of the enumeration '<em><b>Assignment Operator</b></em>',
  11. * and utility methods for working with them.
  12. * <!-- end-user-doc -->
  13. * @see org.yakindu.base.expressions.expressions.ExpressionsPackage#getAssignmentOperator()
  14. * @model
  15. * @generated
  16. */
  17. public enum AssignmentOperator implements Enumerator {
  18. /**
  19. * The '<em><b>Assign</b></em>' literal object.
  20. * <!-- begin-user-doc -->
  21. * <!-- end-user-doc -->
  22. * @see #ASSIGN_VALUE
  23. * @generated
  24. * @ordered
  25. */
  26. ASSIGN(0, "assign", "="),
  27. /**
  28. * The '<em><b>Mult Assign</b></em>' literal object.
  29. * <!-- begin-user-doc -->
  30. * <!-- end-user-doc -->
  31. * @see #MULT_ASSIGN_VALUE
  32. * @generated
  33. * @ordered
  34. */
  35. MULT_ASSIGN(1, "multAssign", "*="),
  36. /**
  37. * The '<em><b>Div Assign</b></em>' literal object.
  38. * <!-- begin-user-doc -->
  39. * <!-- end-user-doc -->
  40. * @see #DIV_ASSIGN_VALUE
  41. * @generated
  42. * @ordered
  43. */
  44. DIV_ASSIGN(2, "divAssign", "/="),
  45. /**
  46. * The '<em><b>Mod Assign</b></em>' literal object.
  47. * <!-- begin-user-doc -->
  48. * <!-- end-user-doc -->
  49. * @see #MOD_ASSIGN_VALUE
  50. * @generated
  51. * @ordered
  52. */
  53. MOD_ASSIGN(3, "modAssign", "%="),
  54. /**
  55. * The '<em><b>Add Assign</b></em>' literal object.
  56. * <!-- begin-user-doc -->
  57. * <!-- end-user-doc -->
  58. * @see #ADD_ASSIGN_VALUE
  59. * @generated
  60. * @ordered
  61. */
  62. ADD_ASSIGN(4, "addAssign", "+="),
  63. /**
  64. * The '<em><b>Sub Assign</b></em>' literal object.
  65. * <!-- begin-user-doc -->
  66. * <!-- end-user-doc -->
  67. * @see #SUB_ASSIGN_VALUE
  68. * @generated
  69. * @ordered
  70. */
  71. SUB_ASSIGN(5, "subAssign", "-="),
  72. /**
  73. * The '<em><b>Left Shift Assign</b></em>' literal object.
  74. * <!-- begin-user-doc -->
  75. * <!-- end-user-doc -->
  76. * @see #LEFT_SHIFT_ASSIGN_VALUE
  77. * @generated
  78. * @ordered
  79. */
  80. LEFT_SHIFT_ASSIGN(6, "leftShiftAssign", "<<="),
  81. /**
  82. * The '<em><b>Right Shift Assign</b></em>' literal object.
  83. * <!-- begin-user-doc -->
  84. * <!-- end-user-doc -->
  85. * @see #RIGHT_SHIFT_ASSIGN_VALUE
  86. * @generated
  87. * @ordered
  88. */
  89. RIGHT_SHIFT_ASSIGN(7, "rightShiftAssign", ">>="),
  90. /**
  91. * The '<em><b>And Assign</b></em>' literal object.
  92. * <!-- begin-user-doc -->
  93. * <!-- end-user-doc -->
  94. * @see #AND_ASSIGN_VALUE
  95. * @generated
  96. * @ordered
  97. */
  98. AND_ASSIGN(8, "andAssign", "&="),
  99. /**
  100. * The '<em><b>Xor Assign</b></em>' literal object.
  101. * <!-- begin-user-doc -->
  102. * <!-- end-user-doc -->
  103. * @see #XOR_ASSIGN_VALUE
  104. * @generated
  105. * @ordered
  106. */
  107. XOR_ASSIGN(9, "xorAssign", "^="),
  108. /**
  109. * The '<em><b>Or Assign</b></em>' literal object.
  110. * <!-- begin-user-doc -->
  111. * <!-- end-user-doc -->
  112. * @see #OR_ASSIGN_VALUE
  113. * @generated
  114. * @ordered
  115. */
  116. OR_ASSIGN(10, "orAssign", "|=");
  117. /**
  118. * The '<em><b>Assign</b></em>' literal value.
  119. * <!-- begin-user-doc -->
  120. * <p>
  121. * If the meaning of '<em><b>Assign</b></em>' literal object isn't clear,
  122. * there really should be more of a description here...
  123. * </p>
  124. * <!-- end-user-doc -->
  125. * @see #ASSIGN
  126. * @model name="assign" literal="="
  127. * @generated
  128. * @ordered
  129. */
  130. public static final int ASSIGN_VALUE = 0;
  131. /**
  132. * The '<em><b>Mult Assign</b></em>' literal value.
  133. * <!-- begin-user-doc -->
  134. * <p>
  135. * If the meaning of '<em><b>Mult Assign</b></em>' literal object isn't clear,
  136. * there really should be more of a description here...
  137. * </p>
  138. * <!-- end-user-doc -->
  139. * @see #MULT_ASSIGN
  140. * @model name="multAssign" literal="*="
  141. * @generated
  142. * @ordered
  143. */
  144. public static final int MULT_ASSIGN_VALUE = 1;
  145. /**
  146. * The '<em><b>Div Assign</b></em>' literal value.
  147. * <!-- begin-user-doc -->
  148. * <p>
  149. * If the meaning of '<em><b>Div Assign</b></em>' literal object isn't clear,
  150. * there really should be more of a description here...
  151. * </p>
  152. * <!-- end-user-doc -->
  153. * @see #DIV_ASSIGN
  154. * @model name="divAssign" literal="/="
  155. * @generated
  156. * @ordered
  157. */
  158. public static final int DIV_ASSIGN_VALUE = 2;
  159. /**
  160. * The '<em><b>Mod Assign</b></em>' literal value.
  161. * <!-- begin-user-doc -->
  162. * <p>
  163. * If the meaning of '<em><b>Mod Assign</b></em>' literal object isn't clear,
  164. * there really should be more of a description here...
  165. * </p>
  166. * <!-- end-user-doc -->
  167. * @see #MOD_ASSIGN
  168. * @model name="modAssign" literal="%="
  169. * @generated
  170. * @ordered
  171. */
  172. public static final int MOD_ASSIGN_VALUE = 3;
  173. /**
  174. * The '<em><b>Add Assign</b></em>' literal value.
  175. * <!-- begin-user-doc -->
  176. * <p>
  177. * If the meaning of '<em><b>Add Assign</b></em>' literal object isn't clear,
  178. * there really should be more of a description here...
  179. * </p>
  180. * <!-- end-user-doc -->
  181. * @see #ADD_ASSIGN
  182. * @model name="addAssign" literal="+="
  183. * @generated
  184. * @ordered
  185. */
  186. public static final int ADD_ASSIGN_VALUE = 4;
  187. /**
  188. * The '<em><b>Sub Assign</b></em>' literal value.
  189. * <!-- begin-user-doc -->
  190. * <p>
  191. * If the meaning of '<em><b>Sub Assign</b></em>' literal object isn't clear,
  192. * there really should be more of a description here...
  193. * </p>
  194. * <!-- end-user-doc -->
  195. * @see #SUB_ASSIGN
  196. * @model name="subAssign" literal="-="
  197. * @generated
  198. * @ordered
  199. */
  200. public static final int SUB_ASSIGN_VALUE = 5;
  201. /**
  202. * The '<em><b>Left Shift Assign</b></em>' literal value.
  203. * <!-- begin-user-doc -->
  204. * <p>
  205. * If the meaning of '<em><b>Left Shift Assign</b></em>' literal object isn't clear,
  206. * there really should be more of a description here...
  207. * </p>
  208. * <!-- end-user-doc -->
  209. * @see #LEFT_SHIFT_ASSIGN
  210. * @model name="leftShiftAssign" literal="<<="
  211. * @generated
  212. * @ordered
  213. */
  214. public static final int LEFT_SHIFT_ASSIGN_VALUE = 6;
  215. /**
  216. * The '<em><b>Right Shift Assign</b></em>' literal value.
  217. * <!-- begin-user-doc -->
  218. * <p>
  219. * If the meaning of '<em><b>Right Shift Assign</b></em>' literal object isn't clear,
  220. * there really should be more of a description here...
  221. * </p>
  222. * <!-- end-user-doc -->
  223. * @see #RIGHT_SHIFT_ASSIGN
  224. * @model name="rightShiftAssign" literal=">>="
  225. * @generated
  226. * @ordered
  227. */
  228. public static final int RIGHT_SHIFT_ASSIGN_VALUE = 7;
  229. /**
  230. * The '<em><b>And Assign</b></em>' literal value.
  231. * <!-- begin-user-doc -->
  232. * <p>
  233. * If the meaning of '<em><b>And Assign</b></em>' literal object isn't clear,
  234. * there really should be more of a description here...
  235. * </p>
  236. * <!-- end-user-doc -->
  237. * @see #AND_ASSIGN
  238. * @model name="andAssign" literal="&="
  239. * @generated
  240. * @ordered
  241. */
  242. public static final int AND_ASSIGN_VALUE = 8;
  243. /**
  244. * The '<em><b>Xor Assign</b></em>' literal value.
  245. * <!-- begin-user-doc -->
  246. * <p>
  247. * If the meaning of '<em><b>Xor Assign</b></em>' literal object isn't clear,
  248. * there really should be more of a description here...
  249. * </p>
  250. * <!-- end-user-doc -->
  251. * @see #XOR_ASSIGN
  252. * @model name="xorAssign" literal="^="
  253. * @generated
  254. * @ordered
  255. */
  256. public static final int XOR_ASSIGN_VALUE = 9;
  257. /**
  258. * The '<em><b>Or Assign</b></em>' literal value.
  259. * <!-- begin-user-doc -->
  260. * <p>
  261. * If the meaning of '<em><b>Or Assign</b></em>' literal object isn't clear,
  262. * there really should be more of a description here...
  263. * </p>
  264. * <!-- end-user-doc -->
  265. * @see #OR_ASSIGN
  266. * @model name="orAssign" literal="|="
  267. * @generated
  268. * @ordered
  269. */
  270. public static final int OR_ASSIGN_VALUE = 10;
  271. /**
  272. * An array of all the '<em><b>Assignment Operator</b></em>' enumerators.
  273. * <!-- begin-user-doc -->
  274. * <!-- end-user-doc -->
  275. * @generated
  276. */
  277. private static final AssignmentOperator[] VALUES_ARRAY =
  278. new AssignmentOperator[] {
  279. ASSIGN,
  280. MULT_ASSIGN,
  281. DIV_ASSIGN,
  282. MOD_ASSIGN,
  283. ADD_ASSIGN,
  284. SUB_ASSIGN,
  285. LEFT_SHIFT_ASSIGN,
  286. RIGHT_SHIFT_ASSIGN,
  287. AND_ASSIGN,
  288. XOR_ASSIGN,
  289. OR_ASSIGN,
  290. };
  291. /**
  292. * A public read-only list of all the '<em><b>Assignment Operator</b></em>' enumerators.
  293. * <!-- begin-user-doc -->
  294. * <!-- end-user-doc -->
  295. * @generated
  296. */
  297. public static final List<AssignmentOperator> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
  298. /**
  299. * Returns the '<em><b>Assignment Operator</b></em>' literal with the specified literal value.
  300. * <!-- begin-user-doc -->
  301. * <!-- end-user-doc -->
  302. * @param literal the literal.
  303. * @return the matching enumerator or <code>null</code>.
  304. * @generated
  305. */
  306. public static AssignmentOperator get(String literal) {
  307. for (int i = 0; i < VALUES_ARRAY.length; ++i) {
  308. AssignmentOperator result = VALUES_ARRAY[i];
  309. if (result.toString().equals(literal)) {
  310. return result;
  311. }
  312. }
  313. return null;
  314. }
  315. /**
  316. * Returns the '<em><b>Assignment Operator</b></em>' literal with the specified name.
  317. * <!-- begin-user-doc -->
  318. * <!-- end-user-doc -->
  319. * @param name the name.
  320. * @return the matching enumerator or <code>null</code>.
  321. * @generated
  322. */
  323. public static AssignmentOperator getByName(String name) {
  324. for (int i = 0; i < VALUES_ARRAY.length; ++i) {
  325. AssignmentOperator result = VALUES_ARRAY[i];
  326. if (result.getName().equals(name)) {
  327. return result;
  328. }
  329. }
  330. return null;
  331. }
  332. /**
  333. * Returns the '<em><b>Assignment Operator</b></em>' literal with the specified integer value.
  334. * <!-- begin-user-doc -->
  335. * <!-- end-user-doc -->
  336. * @param value the integer value.
  337. * @return the matching enumerator or <code>null</code>.
  338. * @generated
  339. */
  340. public static AssignmentOperator get(int value) {
  341. switch (value) {
  342. case ASSIGN_VALUE: return ASSIGN;
  343. case MULT_ASSIGN_VALUE: return MULT_ASSIGN;
  344. case DIV_ASSIGN_VALUE: return DIV_ASSIGN;
  345. case MOD_ASSIGN_VALUE: return MOD_ASSIGN;
  346. case ADD_ASSIGN_VALUE: return ADD_ASSIGN;
  347. case SUB_ASSIGN_VALUE: return SUB_ASSIGN;
  348. case LEFT_SHIFT_ASSIGN_VALUE: return LEFT_SHIFT_ASSIGN;
  349. case RIGHT_SHIFT_ASSIGN_VALUE: return RIGHT_SHIFT_ASSIGN;
  350. case AND_ASSIGN_VALUE: return AND_ASSIGN;
  351. case XOR_ASSIGN_VALUE: return XOR_ASSIGN;
  352. case OR_ASSIGN_VALUE: return OR_ASSIGN;
  353. }
  354. return null;
  355. }
  356. /**
  357. * <!-- begin-user-doc -->
  358. * <!-- end-user-doc -->
  359. * @generated
  360. */
  361. private final int value;
  362. /**
  363. * <!-- begin-user-doc -->
  364. * <!-- end-user-doc -->
  365. * @generated
  366. */
  367. private final String name;
  368. /**
  369. * <!-- begin-user-doc -->
  370. * <!-- end-user-doc -->
  371. * @generated
  372. */
  373. private final String literal;
  374. /**
  375. * Only this class can construct instances.
  376. * <!-- begin-user-doc -->
  377. * <!-- end-user-doc -->
  378. * @generated
  379. */
  380. private AssignmentOperator(int value, String name, String literal) {
  381. this.value = value;
  382. this.name = name;
  383. this.literal = literal;
  384. }
  385. /**
  386. * <!-- begin-user-doc -->
  387. * <!-- end-user-doc -->
  388. * @generated
  389. */
  390. public int getValue() {
  391. return value;
  392. }
  393. /**
  394. * <!-- begin-user-doc -->
  395. * <!-- end-user-doc -->
  396. * @generated
  397. */
  398. public String getName() {
  399. return name;
  400. }
  401. /**
  402. * <!-- begin-user-doc -->
  403. * <!-- end-user-doc -->
  404. * @generated
  405. */
  406. public String getLiteral() {
  407. return literal;
  408. }
  409. /**
  410. * Returns the literal value of the enumerator, which is its string representation.
  411. * <!-- begin-user-doc -->
  412. * <!-- end-user-doc -->
  413. * @generated
  414. */
  415. @Override
  416. public String toString() {
  417. return literal;
  418. }
  419. } //AssignmentOperator