Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashatalin2009-11-05 18:27:30 -0500
committerashatalin2009-11-05 18:27:30 -0500
commit3a6861849e2af651a04b8eafcc743ac64364b605 (patch)
treebff85bc57449bb2614d2d55e496cf9be279fd123
parent0830c7b0cc3f5cd2c7e3e8e580886756ec22732c (diff)
downloadorg.eclipse.gmf-tooling-OCL_3_0_migration.tar.gz
org.eclipse.gmf-tooling-OCL_3_0_migration.tar.xz
org.eclipse.gmf-tooling-OCL_3_0_migration.zip
Organizing imports, reformatting source code.OCL_3_0_migration
-rw-r--r--plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/parser/XpandLexer.java1414
-rw-r--r--plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/parser/XpandParser.java5464
2 files changed, 3358 insertions, 3520 deletions
diff --git a/plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/parser/XpandLexer.java b/plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/parser/XpandLexer.java
index e7fd95e81..31acadf8e 100644
--- a/plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/parser/XpandLexer.java
+++ b/plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/parser/XpandLexer.java
@@ -12,264 +12,290 @@
*/
package org.eclipse.gmf.internal.xpand.parser;
-import lpg.lpgjavaruntime.*;
import java.util.LinkedList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import lpg.lpgjavaruntime.LexParser;
+import lpg.lpgjavaruntime.LexStream;
+import lpg.lpgjavaruntime.LpgLexStream;
+import lpg.lpgjavaruntime.Monitor;
+import lpg.lpgjavaruntime.ParseTable;
+import lpg.lpgjavaruntime.PrsStream;
+import lpg.lpgjavaruntime.RuleAction;
+
import org.eclipse.gmf.internal.xpand.Activator;
import org.eclipse.gmf.internal.xpand.util.ParserException.ErrorLocationInfo;
-import org.eclipse.ocl.Environment;
-import org.eclipse.ocl.lpg.BasicEnvironment;
-import org.eclipse.ocl.util.OCLUtil;
-import org.eclipse.ocl.parser.OCLKWLexer;
public class XpandLexer extends LpgLexStream implements XpandParsersym, XpandLexersym, RuleAction {
- private static ParseTable prs = new XpandLexerprs();
- private PrsStream prsStream;
- private final LexParser lexParser = new LexParser(this, prs, this);
-
- private XpandKWLexer kwLexer;
-
- public PrsStream getPrsStream() { return prsStream; }
- public int getToken(int i) { return lexParser.getToken(i); }
- public int getRhsFirstTokenIndex(int i) { return lexParser.getFirstToken(i); }
- public int getRhsLastTokenIndex(int i) { return lexParser.getLastToken(i); }
-
- public int getLeftSpan() { return lexParser.getFirstToken(); }
- public int getRightSpan() { return lexParser.getLastToken(); }
-
- public XpandLexer(char[] input_chars, String filename, int tab) {
- super(input_chars, filename, tab);
- }
-
- public XpandLexer(char[] input_chars, String filename) {
- this(input_chars, filename, 4);
- }
-
- public String[] orderedExportedSymbols() { return XpandParsersym.orderedTerminalSymbols; }
- public LexStream getLexStream() { return (LexStream) this; }
-
- public int [] getKeywordKinds() { return kwLexer.getKeywordKinds(); }
-
- public void lexer(PrsStream prsStream) {
- lexer(null, prsStream);
- }
-
- public void lexer(Monitor monitor, PrsStream prsStream) {
- if (getInputChars() == null) {
- throw new NullPointerException("LexStream was not initialized");
- }
-
- this.prsStream = prsStream;
- resetErrors();
-
- prsStream.makeToken(0, 0, 0); // Token list must start with a bad token
-
- lexParser.parseCharacters(monitor); // Lex the input characters
-
- int i = getStreamIndex();
- prsStream.makeToken(i, i, TK_EOF_TOKEN); // and end with the end of file token
- prsStream.setStreamLength(prsStream.getSize());
-
- return;
- }
+ private static ParseTable prs = new XpandLexerprs();
+
+ private PrsStream prsStream;
+
+ private final LexParser lexParser = new LexParser(this, prs, this);
+
+ private XpandKWLexer kwLexer;
+
+ public PrsStream getPrsStream() {
+ return prsStream;
+ }
+
+ public int getToken(int i) {
+ return lexParser.getToken(i);
+ }
+
+ public int getRhsFirstTokenIndex(int i) {
+ return lexParser.getFirstToken(i);
+ }
+
+ public int getRhsLastTokenIndex(int i) {
+ return lexParser.getLastToken(i);
+ }
+
+ public int getLeftSpan() {
+ return lexParser.getFirstToken();
+ }
+
+ public int getRightSpan() {
+ return lexParser.getLastToken();
+ }
+
+ public XpandLexer(char[] input_chars, String filename, int tab) {
+ super(input_chars, filename, tab);
+ }
+
+ public XpandLexer(char[] input_chars, String filename) {
+ this(input_chars, filename, 4);
+ }
+
+ public String[] orderedExportedSymbols() {
+ return XpandParsersym.orderedTerminalSymbols;
+ }
+
+ public LexStream getLexStream() {
+ return (LexStream) this;
+ }
+
+ public int[] getKeywordKinds() {
+ return kwLexer.getKeywordKinds();
+ }
+
+ public void lexer(PrsStream prsStream) {
+ lexer(null, prsStream);
+ }
+
+ public void lexer(Monitor monitor, PrsStream prsStream) {
+ if (getInputChars() == null) {
+ throw new NullPointerException("LexStream was not initialized");
+ }
+
+ this.prsStream = prsStream;
+ resetErrors();
+
+ prsStream.makeToken(0, 0, 0); // Token list must start with a bad token
+
+ lexParser.parseCharacters(monitor); // Lex the input characters
+
+ int i = getStreamIndex();
+ prsStream.makeToken(i, i, TK_EOF_TOKEN); // and end with the end of file
+ // token
+ prsStream.setStreamLength(prsStream.getSize());
+
+ return;
+ }
+
+ @Override
+ public void initialize(char[] content, String filename) {
+ super.initialize(content, filename);
+ if (this.kwLexer == null) {
+ this.kwLexer = new XpandKWLexer(getInputChars(), TK_IDENTIFIER);
+ } else {
+ this.kwLexer.setInputChars(getInputChars());
+ }
+ }
+
+ final void makeToken(int kind) {
+ int startOffset = getLeftSpan(), endOffset = getRightSpan();
+ makeToken(startOffset, endOffset, kind);
+ }
+
+ final void makeComment(int kind) {
+ int startOffset = getLeftSpan(), endOffset = getRightSpan();
+ super.getPrsStream().makeAdjunct(startOffset, endOffset, kind);
+ }
+
+ final void skipToken() {
+ }
+
+ final void checkForKeyWord() {
+ int startOffset = getLeftSpan(), endOffset = getRightSpan(), kwKind = kwLexer.lexer(startOffset, endOffset);
+ makeToken(startOffset, endOffset, kwKind);
+ }
+
+ // aux data for getKind method
+ private final int tokenKind[] = { Char_CtlCharNotWS, // 000 0x00
+ Char_CtlCharNotWS, // 001 0x01
+ Char_CtlCharNotWS, // 002 0x02
+ Char_CtlCharNotWS, // 003 0x03
+ Char_CtlCharNotWS, // 004 0x04
+ Char_CtlCharNotWS, // 005 0x05
+ Char_CtlCharNotWS, // 006 0x06
+ Char_CtlCharNotWS, // 007 0x07
+ Char_CtlCharNotWS, // 008 0x08
+ Char_HT, // 009 0x09
+ Char_LF, // 010 0x0A
+ Char_CtlCharNotWS, // 011 0x0B
+ Char_FF, // 012 0x0C
+ Char_CR, // 013 0x0D
+ Char_CtlCharNotWS, // 014 0x0E
+ Char_CtlCharNotWS, // 015 0x0F
+ Char_CtlCharNotWS, // 016 0x10
+ Char_CtlCharNotWS, // 017 0x11
+ Char_CtlCharNotWS, // 018 0x12
+ Char_CtlCharNotWS, // 019 0x13
+ Char_CtlCharNotWS, // 020 0x14
+ Char_CtlCharNotWS, // 021 0x15
+ Char_CtlCharNotWS, // 022 0x16
+ Char_CtlCharNotWS, // 023 0x17
+ Char_CtlCharNotWS, // 024 0x18
+ Char_CtlCharNotWS, // 025 0x19
+ Char_CtlCharNotWS, // 026 0x1A
+ Char_CtlCharNotWS, // 027 0x1B
+ Char_CtlCharNotWS, // 028 0x1C
+ Char_CtlCharNotWS, // 029 0x1D
+ Char_CtlCharNotWS, // 030 0x1E
+ Char_CtlCharNotWS, // 031 0x1F
+ Char_Space, // 032 0x20
+ Char_Exclamation, // 033 0x21
+ Char_DoubleQuote, // 034 0x22
+ Char_Sharp, // 035 0x23
+ Char_DollarSign, // 036 0x24
+ Char_Percent, // 037 0x25
+ Char_Ampersand, // 038 0x26
+ Char_SingleQuote, // 039 0x27
+ Char_LeftParen, // 040 0x28
+ Char_RightParen, // 041 0x29
+ Char_Star, // 042 0x2A
+ Char_Plus, // 043 0x2B
+ Char_Comma, // 044 0x2C
+ Char_Minus, // 045 0x2D
+ Char_Dot, // 046 0x2E
+ Char_Slash, // 047 0x2F
+ Char_0, // 048 0x30
+ Char_1, // 049 0x31
+ Char_2, // 050 0x32
+ Char_3, // 051 0x33
+ Char_4, // 052 0x34
+ Char_5, // 053 0x35
+ Char_6, // 054 0x36
+ Char_7, // 055 0x37
+ Char_8, // 056 0x38
+ Char_9, // 057 0x39
+ Char_Colon, // 058 0x3A
+ Char_SemiColon, // 059 0x3B
+ Char_LessThan, // 060 0x3C
+ Char_Equal, // 061 0x3D
+ Char_GreaterThan, // 062 0x3E
+ Char_QuestionMark, // 063 0x3F
+ Char_AtSign, // 064 0x40
+ Char_A, // 065 0x41
+ Char_B, // 066 0x42
+ Char_C, // 067 0x43
+ Char_D, // 068 0x44
+ Char_E, // 069 0x45
+ Char_F, // 070 0x46
+ Char_G, // 071 0x47
+ Char_H, // 072 0x48
+ Char_I, // 073 0x49
+ Char_J, // 074 0x4A
+ Char_K, // 075 0x4B
+ Char_L, // 076 0x4C
+ Char_M, // 077 0x4D
+ Char_N, // 078 0x4E
+ Char_O, // 079 0x4F
+ Char_P, // 080 0x50
+ Char_Q, // 081 0x51
+ Char_R, // 082 0x52
+ Char_S, // 083 0x53
+ Char_T, // 084 0x54
+ Char_U, // 085 0x55
+ Char_V, // 086 0x56
+ Char_W, // 087 0x57
+ Char_X, // 088 0x58
+ Char_Y, // 089 0x59
+ Char_Z, // 090 0x5A
+ Char_LeftBracket, // 091 0x5B
+ Char_BackSlash, // 092 0x5C
+ Char_RightBracket, // 093 0x5D
+ Char_Caret, // 094 0x5E
+ Char__, // 095 0x5F
+ Char_BackQuote, // 096 0x60
+ Char_a, // 097 0x61
+ Char_b, // 098 0x62
+ Char_c, // 099 0x63
+ Char_d, // 100 0x64
+ Char_e, // 101 0x65
+ Char_f, // 102 0x66
+ Char_g, // 103 0x67
+ Char_h, // 104 0x68
+ Char_i, // 105 0x69
+ Char_j, // 106 0x6A
+ Char_k, // 107 0x6B
+ Char_l, // 108 0x6C
+ Char_m, // 109 0x6D
+ Char_n, // 110 0x6E
+ Char_o, // 111 0x6F
+ Char_p, // 112 0x70
+ Char_q, // 113 0x71
+ Char_r, // 114 0x72
+ Char_s, // 115 0x73
+ Char_t, // 116 0x74
+ Char_u, // 117 0x75
+ Char_v, // 118 0x76
+ Char_w, // 119 0x77
+ Char_x, // 120 0x78
+ Char_y, // 121 0x79
+ Char_z, // 122 0x7A
+ Char_LeftBrace, // 123 0x7B
+ Char_VerticalBar, // 124 0x7C
+ Char_RightBrace, // 125 0x7D
+ Char_Tilde, // 126 0x7E
+ // [artem] As I understand, there's no need to specify characters
+ // other than those
+ // we'll try to access by index from getKind method (iow, this array
+ // is auxilary
+ // as I indicated in its comment). Thus, there seems to be no reason
+ // to specify
+ // Char_Acute here as it's done in OCL's LexerBasicMap.g
+ Char_AfterASCII, // for all chars in range 128..65534
+ Char_EOF // for '\uffff' or 65535
+ };
+
+ // Classify character at ith location
@Override
- public void initialize(char [] content, String filename) {
- super.initialize(content, filename);
- if (this.kwLexer == null) {
- this.kwLexer = new XpandKWLexer(getInputChars(), TK_IDENTIFIER);
- } else {
- this.kwLexer.setInputChars(getInputChars());
- }
- }
-
- final void makeToken(int kind) {
- int startOffset = getLeftSpan(),
- endOffset = getRightSpan();
- makeToken(startOffset, endOffset, kind);
- }
-
- final void makeComment(int kind) {
- int startOffset = getLeftSpan(),
- endOffset = getRightSpan();
- super.getPrsStream().makeAdjunct(startOffset, endOffset, kind);
- }
-
- final void skipToken() {
- }
-
- final void checkForKeyWord() {
- int startOffset = getLeftSpan(),
- endOffset = getRightSpan(),
- kwKind = kwLexer.lexer(startOffset, endOffset);
- makeToken(startOffset, endOffset, kwKind);
- }
-
- // aux data for getKind method
- private final int tokenKind[] = {
- Char_CtlCharNotWS, // 000 0x00
- Char_CtlCharNotWS, // 001 0x01
- Char_CtlCharNotWS, // 002 0x02
- Char_CtlCharNotWS, // 003 0x03
- Char_CtlCharNotWS, // 004 0x04
- Char_CtlCharNotWS, // 005 0x05
- Char_CtlCharNotWS, // 006 0x06
- Char_CtlCharNotWS, // 007 0x07
- Char_CtlCharNotWS, // 008 0x08
- Char_HT, // 009 0x09
- Char_LF, // 010 0x0A
- Char_CtlCharNotWS, // 011 0x0B
- Char_FF, // 012 0x0C
- Char_CR, // 013 0x0D
- Char_CtlCharNotWS, // 014 0x0E
- Char_CtlCharNotWS, // 015 0x0F
- Char_CtlCharNotWS, // 016 0x10
- Char_CtlCharNotWS, // 017 0x11
- Char_CtlCharNotWS, // 018 0x12
- Char_CtlCharNotWS, // 019 0x13
- Char_CtlCharNotWS, // 020 0x14
- Char_CtlCharNotWS, // 021 0x15
- Char_CtlCharNotWS, // 022 0x16
- Char_CtlCharNotWS, // 023 0x17
- Char_CtlCharNotWS, // 024 0x18
- Char_CtlCharNotWS, // 025 0x19
- Char_CtlCharNotWS, // 026 0x1A
- Char_CtlCharNotWS, // 027 0x1B
- Char_CtlCharNotWS, // 028 0x1C
- Char_CtlCharNotWS, // 029 0x1D
- Char_CtlCharNotWS, // 030 0x1E
- Char_CtlCharNotWS, // 031 0x1F
- Char_Space, // 032 0x20
- Char_Exclamation, // 033 0x21
- Char_DoubleQuote, // 034 0x22
- Char_Sharp, // 035 0x23
- Char_DollarSign, // 036 0x24
- Char_Percent, // 037 0x25
- Char_Ampersand, // 038 0x26
- Char_SingleQuote, // 039 0x27
- Char_LeftParen, // 040 0x28
- Char_RightParen, // 041 0x29
- Char_Star, // 042 0x2A
- Char_Plus, // 043 0x2B
- Char_Comma, // 044 0x2C
- Char_Minus, // 045 0x2D
- Char_Dot, // 046 0x2E
- Char_Slash, // 047 0x2F
- Char_0, // 048 0x30
- Char_1, // 049 0x31
- Char_2, // 050 0x32
- Char_3, // 051 0x33
- Char_4, // 052 0x34
- Char_5, // 053 0x35
- Char_6, // 054 0x36
- Char_7, // 055 0x37
- Char_8, // 056 0x38
- Char_9, // 057 0x39
- Char_Colon, // 058 0x3A
- Char_SemiColon, // 059 0x3B
- Char_LessThan, // 060 0x3C
- Char_Equal, // 061 0x3D
- Char_GreaterThan, // 062 0x3E
- Char_QuestionMark, // 063 0x3F
- Char_AtSign, // 064 0x40
- Char_A, // 065 0x41
- Char_B, // 066 0x42
- Char_C, // 067 0x43
- Char_D, // 068 0x44
- Char_E, // 069 0x45
- Char_F, // 070 0x46
- Char_G, // 071 0x47
- Char_H, // 072 0x48
- Char_I, // 073 0x49
- Char_J, // 074 0x4A
- Char_K, // 075 0x4B
- Char_L, // 076 0x4C
- Char_M, // 077 0x4D
- Char_N, // 078 0x4E
- Char_O, // 079 0x4F
- Char_P, // 080 0x50
- Char_Q, // 081 0x51
- Char_R, // 082 0x52
- Char_S, // 083 0x53
- Char_T, // 084 0x54
- Char_U, // 085 0x55
- Char_V, // 086 0x56
- Char_W, // 087 0x57
- Char_X, // 088 0x58
- Char_Y, // 089 0x59
- Char_Z, // 090 0x5A
- Char_LeftBracket, // 091 0x5B
- Char_BackSlash, // 092 0x5C
- Char_RightBracket, // 093 0x5D
- Char_Caret, // 094 0x5E
- Char__, // 095 0x5F
- Char_BackQuote, // 096 0x60
- Char_a, // 097 0x61
- Char_b, // 098 0x62
- Char_c, // 099 0x63
- Char_d, // 100 0x64
- Char_e, // 101 0x65
- Char_f, // 102 0x66
- Char_g, // 103 0x67
- Char_h, // 104 0x68
- Char_i, // 105 0x69
- Char_j, // 106 0x6A
- Char_k, // 107 0x6B
- Char_l, // 108 0x6C
- Char_m, // 109 0x6D
- Char_n, // 110 0x6E
- Char_o, // 111 0x6F
- Char_p, // 112 0x70
- Char_q, // 113 0x71
- Char_r, // 114 0x72
- Char_s, // 115 0x73
- Char_t, // 116 0x74
- Char_u, // 117 0x75
- Char_v, // 118 0x76
- Char_w, // 119 0x77
- Char_x, // 120 0x78
- Char_y, // 121 0x79
- Char_z, // 122 0x7A
- Char_LeftBrace, // 123 0x7B
- Char_VerticalBar, // 124 0x7C
- Char_RightBrace, // 125 0x7D
- Char_Tilde, // 126 0x7E
- // [artem] As I understand, there's no need to specify characters other than those
- // we'll try to access by index from getKind method (iow, this array is auxilary
- // as I indicated in its comment). Thus, there seems to be no reason to specify
- // Char_Acute here as it's done in OCL's LexerBasicMap.g
- Char_AfterASCII, // for all chars in range 128..65534
- Char_EOF // for '\uffff' or 65535
- };
-
- // Classify character at ith location
- @Override
- public final int getKind(int i) {
- char c = (i >= getStreamLength() ? '\uffff' : getCharValue(i));
- return (c < 128 // ASCII Character
- ? tokenKind[c]
- : c == '\uffff'
- ? Char_EOF
- : getNonAsciiKind(c));
-
- }
-
- private final static int getNonAsciiKind(char c) {
- if (c == '\u00AB') {
- return Char_LG;
- }
- if (c == '\u00BB') {
- return Char_RG;
- }
- if (c == '\u00b4') {
- return Char_Acute; // For OCLLexer
- }
- return Char_AfterASCII;
-
- }
+ public final int getKind(int i) {
+ char c = (i >= getStreamLength() ? '\uffff' : getCharValue(i));
+ return (c < 128 // ASCII Character
+ ? tokenKind[c]
+ : c == '\uffff' ? Char_EOF : getNonAsciiKind(c));
+
+ }
+
+ private final static int getNonAsciiKind(char c) {
+ if (c == '\u00AB') {
+ return Char_LG;
+ }
+ if (c == '\u00BB') {
+ return Char_RG;
+ }
+ if (c == '\u00b4') {
+ return Char_Acute; // For OCLLexer
+ }
+ return Char_AfterASCII;
+
+ }
public ErrorLocationInfo[] getErrors() {
return errors.toArray(new ErrorLocationInfo[errors.size()]);
@@ -298,7 +324,8 @@ public class XpandLexer extends LpgLexStream implements XpandParsersym, XpandLex
public void reportError(int errorCode, String locationInfo, String tokenText) {
try {
Matcher m = Pattern.compile("(?:[^:]+::)*[^:]+:(\\d+):(\\d+):(\\d+):(\\d+):.*").matcher(locationInfo);
- boolean t = m.matches(); // ignore return value, rely on exception if anything wrong
+ boolean t = m.matches(); // ignore return value, rely on exception
+ // if anything wrong
assert t;
final int leftTokenLine = Integer.parseInt(m.group(1));
final int leftTokenColumn = Integer.parseInt(m.group(2));
@@ -318,7 +345,7 @@ public class XpandLexer extends LpgLexStream implements XpandParsersym, XpandLex
final int leftTokenColumn = getColumn(leftToken);
final int rightTokenLine = getEndLine(rightToken);
final int rightTokenColumn = getEndColumn(rightToken);
- final String msg = tokenText + errorMsgText[errorCode] + (locationInfo != null && locationInfo.length() > 0 ? '(' + locationInfo + ')' : "");
+ final String msg = tokenText + errorMsgText[errorCode] + (locationInfo != null && locationInfo.length() > 0 ? '(' + locationInfo + ')' : "");
final int startOffset = leftToken;
final int endOffset = rightToken;
errors.add(new ErrorLocationInfo(msg, leftTokenLine, leftTokenColumn, rightTokenLine, rightTokenColumn, startOffset, endOffset));
@@ -328,449 +355,448 @@ public class XpandLexer extends LpgLexStream implements XpandParsersym, XpandLex
*/
- public void ruleAction( int ruleNumber) {
- switch(ruleNumber) {
-
- //
- // Rule 1: Token ::= Identifier
- //
- case 1: {
- checkForKeyWord();
- break;
- }
-
- //
- // Rule 2: Token ::= EscapedSQ
- //
- case 2: {
- makeToken(TK_STRING_LITERAL);
- break;
- }
-
- //
- // Rule 3: Token ::= SingleQuote SLNotSQ SingleQuote
- //
- case 3: {
- makeToken(TK_STRING_LITERAL);
- break;
- }
-
- //
- // Rule 4: Token ::= Acute SLNotSQOpt Acute
- //
- case 4: {
- makeToken(TK_STRING_LITERAL);
- break;
- }
-
- //
- // Rule 5: Token ::= BackQuote SLNotSQOpt Acute
- //
- case 5: {
- makeToken(TK_STRING_LITERAL);
- break;
- }
-
- //
- // Rule 6: Token ::= IntegerLiteral
- //
- case 6:
- break;
-
- //
- // Rule 7: Token ::= IntegerLiteral DotToken
- //
- case 7:
- break;
-
- //
- // Rule 8: Token ::= IntegerLiteral DotDotToken
- //
- case 8:
- break;
-
- //
- // Rule 9: Token ::= RealLiteral
- //
- case 9: {
- makeToken(TK_REAL_LITERAL);
- break;
- }
-
- //
- // Rule 10: Token ::= SLC
- //
- case 10: {
- makeComment(TK_SINGLE_LINE_COMMENT);
- break;
- }
-
- //
- // Rule 11: Token ::= / * Inside Stars /
- //
- case 11: {
- makeComment(TK_MULTI_LINE_COMMENT);
- break;
- }
-
- //
- // Rule 12: Token ::= WS
- //
- case 12: {
- skipToken();
- break;
- }
-
- //
- // Rule 13: Token ::= +
- //
- case 13: {
- makeToken(TK_PLUS);
- break;
- }
-
- //
- // Rule 14: Token ::= -
- //
- case 14: {
- makeToken(TK_MINUS);
- break;
- }
-
- //
- // Rule 15: Token ::= *
- //
- case 15: {
- makeToken(TK_MULTIPLY);
- break;
- }
-
- //
- // Rule 16: Token ::= /
- //
- case 16: {
- makeToken(TK_DIVIDE);
- break;
- }
-
- //
- // Rule 17: Token ::= (
- //
- case 17: {
- makeToken(TK_LPAREN);
- break;
- }
-
- //
- // Rule 18: Token ::= )
- //
- case 18: {
- makeToken(TK_RPAREN);
- break;
- }
-
- //
- // Rule 19: Token ::= >
- //
- case 19: {
- makeToken(TK_GREATER);
- break;
- }
-
- //
- // Rule 20: Token ::= <
- //
- case 20: {
- makeToken(TK_LESS);
- break;
- }
-
- //
- // Rule 21: Token ::= =
- //
- case 21: {
- makeToken(TK_EQUAL);
- break;
- }
-
- //
- // Rule 22: Token ::= > =
- //
- case 22: {
- makeToken(TK_GREATER_EQUAL);
- break;
- }
-
- //
- // Rule 23: Token ::= < =
- //
- case 23: {
- makeToken(TK_LESS_EQUAL);
- break;
- }
-
- //
- // Rule 24: Token ::= < >
- //
- case 24: {
- makeToken(TK_NOT_EQUAL);
- break;
- }
-
- //
- // Rule 25: Token ::= [
- //
- case 25: {
- makeToken(TK_LBRACKET);
- break;
- }
-
- //
- // Rule 26: Token ::= ]
- //
- case 26: {
- makeToken(TK_RBRACKET);
- break;
- }
-
- //
- // Rule 27: Token ::= {
- //
- case 27: {
- makeToken(TK_LBRACE);
- break;
- }
-
- //
- // Rule 28: Token ::= }
- //
- case 28: {
- makeToken(TK_RBRACE);
- break;
- }
-
- //
- // Rule 29: Token ::= - >
- //
- case 29: {
- makeToken(TK_ARROW);
- break;
- }
-
- //
- // Rule 30: Token ::= |
- //
- case 30: {
- makeToken(TK_BAR);
- break;
- }
-
- //
- // Rule 31: Token ::= ,
- //
- case 31: {
- makeToken(TK_COMMA);
- break;
- }
-
- //
- // Rule 32: Token ::= :
- //
- case 32: {
- makeToken(TK_COLON);
- break;
- }
-
- //
- // Rule 33: Token ::= : :
- //
- case 33: {
- makeToken(TK_COLONCOLON);
- break;
- }
-
- //
- // Rule 34: Token ::= ;
- //
- case 34: {
- makeToken(TK_SEMICOLON);
- break;
- }
-
- //
- // Rule 35: Token ::= DotToken
- //
- case 35:
- break;
-
- //
- // Rule 36: DotToken ::= .
- //
- case 36: {
- makeToken(TK_DOT);
- break;
- }
-
- //
- // Rule 37: Token ::= DotDotToken
- //
- case 37:
- break;
-
- //
- // Rule 38: DotDotToken ::= . .
- //
- case 38: {
- makeToken(TK_DOTDOT);
- break;
- }
-
- //
- // Rule 39: IntegerLiteral ::= Integer
- //
- case 39: {
- makeToken(TK_INTEGER_LITERAL);
- break;
- }
-
- //
- // Rule 264: Token ::= @
- //
- case 264: {
- makeToken(TK_AT);
- break;
- }
-
- //
- // Rule 265: Token ::= ^
- //
- case 265: {
- makeToken(TK_CARET);
- break;
- }
-
- //
- // Rule 266: Token ::= ^ ^
- //
- case 266: {
- makeToken(TK_CARETCARET);
- break;
- }
-
- //
- // Rule 267: Token ::= ?
- //
- case 267: {
- makeToken(TK_QUESTIONMARK);
- break;
- }
-
- //
- // Rule 268: Token ::= : =
- //
- case 268: {
- makeToken(TK_RESET_ASSIGN);
- break;
- }
-
- //
- // Rule 269: Token ::= + =
- //
- case 269: {
- makeToken(TK_ADD_ASSIGN);
- break;
- }
-
- //
- // Rule 270: Token ::= !
- //
- case 270: {
- makeToken(TK_EXCLAMATION_MARK);
- break;
- }
-
- //
- // Rule 271: Token ::= ! =
- //
- case 271: {
- makeToken(TK_NOT_EQUAL_EXEQ);
- break;
- }
-
- //
- // Rule 272: Token ::= < <
- //
- case 272: {
- makeToken(TK_STEREOTYPE_QUALIFIER_OPEN);
- break;
- }
-
- //
- // Rule 273: Token ::= > >
- //
- case 273: {
- makeToken(TK_STEREOTYPE_QUALIFIER_CLOSE);
- break;
- }
-
- //
- // Rule 274: Token ::= . . .
- //
- case 274: {
- makeToken(TK_MULTIPLICITY_RANGE);
- break;
- }
-
- //
- // Rule 275: Token ::= ~
- //
- case 275: {
- makeToken(TK_TILDE_SIGN);
- break;
- }
-
- //
- // Rule 276: Token ::= : : =
- //
- case 276: {
- makeToken(TK_COLONCOLONEQUAL);
- break;
- }
-
- //
- // Rule 284: Token ::= DoubleQuote SLNotDQOpt DoubleQuote
- //
- case 284: {
- makeToken(TK_STRING_LITERAL);
- break;
- }
-
- //
- // Rule 288: Token ::= LG
- //
- case 288: {
- makeToken(TK_LG);
- break;
- }
- //
- // Rule 289: Token ::= RG textAny lgOpt
- //
- case 289: {
- makeToken(TK_TEXT);
- break;
- }
- //
- // Rule 299: Token ::= R E M RG commentAny lgPlus E N D R E M
- //
- case 299: {
- skipToken();
- break;
- }
-
- default:
- break;
- }
- return;
- }
-}
+ public void ruleAction(int ruleNumber) {
+ switch (ruleNumber) {
+
+ //
+ // Rule 1: Token ::= Identifier
+ //
+ case 1: {
+ checkForKeyWord();
+ break;
+ }
+
+ //
+ // Rule 2: Token ::= EscapedSQ
+ //
+ case 2: {
+ makeToken(TK_STRING_LITERAL);
+ break;
+ }
+
+ //
+ // Rule 3: Token ::= SingleQuote SLNotSQ SingleQuote
+ //
+ case 3: {
+ makeToken(TK_STRING_LITERAL);
+ break;
+ }
+
+ //
+ // Rule 4: Token ::= Acute SLNotSQOpt Acute
+ //
+ case 4: {
+ makeToken(TK_STRING_LITERAL);
+ break;
+ }
+
+ //
+ // Rule 5: Token ::= BackQuote SLNotSQOpt Acute
+ //
+ case 5: {
+ makeToken(TK_STRING_LITERAL);
+ break;
+ }
+
+ //
+ // Rule 6: Token ::= IntegerLiteral
+ //
+ case 6:
+ break;
+
+ //
+ // Rule 7: Token ::= IntegerLiteral DotToken
+ //
+ case 7:
+ break;
+
+ //
+ // Rule 8: Token ::= IntegerLiteral DotDotToken
+ //
+ case 8:
+ break;
+
+ //
+ // Rule 9: Token ::= RealLiteral
+ //
+ case 9: {
+ makeToken(TK_REAL_LITERAL);
+ break;
+ }
+
+ //
+ // Rule 10: Token ::= SLC
+ //
+ case 10: {
+ makeComment(TK_SINGLE_LINE_COMMENT);
+ break;
+ }
+
+ //
+ // Rule 11: Token ::= / * Inside Stars /
+ //
+ case 11: {
+ makeComment(TK_MULTI_LINE_COMMENT);
+ break;
+ }
+
+ //
+ // Rule 12: Token ::= WS
+ //
+ case 12: {
+ skipToken();
+ break;
+ }
+
+ //
+ // Rule 13: Token ::= +
+ //
+ case 13: {
+ makeToken(TK_PLUS);
+ break;
+ }
+
+ //
+ // Rule 14: Token ::= -
+ //
+ case 14: {
+ makeToken(TK_MINUS);
+ break;
+ }
+ //
+ // Rule 15: Token ::= *
+ //
+ case 15: {
+ makeToken(TK_MULTIPLY);
+ break;
+ }
+
+ //
+ // Rule 16: Token ::= /
+ //
+ case 16: {
+ makeToken(TK_DIVIDE);
+ break;
+ }
+
+ //
+ // Rule 17: Token ::= (
+ //
+ case 17: {
+ makeToken(TK_LPAREN);
+ break;
+ }
+
+ //
+ // Rule 18: Token ::= )
+ //
+ case 18: {
+ makeToken(TK_RPAREN);
+ break;
+ }
+
+ //
+ // Rule 19: Token ::= >
+ //
+ case 19: {
+ makeToken(TK_GREATER);
+ break;
+ }
+
+ //
+ // Rule 20: Token ::= <
+ //
+ case 20: {
+ makeToken(TK_LESS);
+ break;
+ }
+
+ //
+ // Rule 21: Token ::= =
+ //
+ case 21: {
+ makeToken(TK_EQUAL);
+ break;
+ }
+
+ //
+ // Rule 22: Token ::= > =
+ //
+ case 22: {
+ makeToken(TK_GREATER_EQUAL);
+ break;
+ }
+
+ //
+ // Rule 23: Token ::= < =
+ //
+ case 23: {
+ makeToken(TK_LESS_EQUAL);
+ break;
+ }
+
+ //
+ // Rule 24: Token ::= < >
+ //
+ case 24: {
+ makeToken(TK_NOT_EQUAL);
+ break;
+ }
+
+ //
+ // Rule 25: Token ::= [
+ //
+ case 25: {
+ makeToken(TK_LBRACKET);
+ break;
+ }
+
+ //
+ // Rule 26: Token ::= ]
+ //
+ case 26: {
+ makeToken(TK_RBRACKET);
+ break;
+ }
+
+ //
+ // Rule 27: Token ::= {
+ //
+ case 27: {
+ makeToken(TK_LBRACE);
+ break;
+ }
+
+ //
+ // Rule 28: Token ::= }
+ //
+ case 28: {
+ makeToken(TK_RBRACE);
+ break;
+ }
+
+ //
+ // Rule 29: Token ::= - >
+ //
+ case 29: {
+ makeToken(TK_ARROW);
+ break;
+ }
+
+ //
+ // Rule 30: Token ::= |
+ //
+ case 30: {
+ makeToken(TK_BAR);
+ break;
+ }
+
+ //
+ // Rule 31: Token ::= ,
+ //
+ case 31: {
+ makeToken(TK_COMMA);
+ break;
+ }
+
+ //
+ // Rule 32: Token ::= :
+ //
+ case 32: {
+ makeToken(TK_COLON);
+ break;
+ }
+
+ //
+ // Rule 33: Token ::= : :
+ //
+ case 33: {
+ makeToken(TK_COLONCOLON);
+ break;
+ }
+
+ //
+ // Rule 34: Token ::= ;
+ //
+ case 34: {
+ makeToken(TK_SEMICOLON);
+ break;
+ }
+
+ //
+ // Rule 35: Token ::= DotToken
+ //
+ case 35:
+ break;
+
+ //
+ // Rule 36: DotToken ::= .
+ //
+ case 36: {
+ makeToken(TK_DOT);
+ break;
+ }
+
+ //
+ // Rule 37: Token ::= DotDotToken
+ //
+ case 37:
+ break;
+
+ //
+ // Rule 38: DotDotToken ::= . .
+ //
+ case 38: {
+ makeToken(TK_DOTDOT);
+ break;
+ }
+
+ //
+ // Rule 39: IntegerLiteral ::= Integer
+ //
+ case 39: {
+ makeToken(TK_INTEGER_LITERAL);
+ break;
+ }
+
+ //
+ // Rule 264: Token ::= @
+ //
+ case 264: {
+ makeToken(TK_AT);
+ break;
+ }
+
+ //
+ // Rule 265: Token ::= ^
+ //
+ case 265: {
+ makeToken(TK_CARET);
+ break;
+ }
+
+ //
+ // Rule 266: Token ::= ^ ^
+ //
+ case 266: {
+ makeToken(TK_CARETCARET);
+ break;
+ }
+
+ //
+ // Rule 267: Token ::= ?
+ //
+ case 267: {
+ makeToken(TK_QUESTIONMARK);
+ break;
+ }
+
+ //
+ // Rule 268: Token ::= : =
+ //
+ case 268: {
+ makeToken(TK_RESET_ASSIGN);
+ break;
+ }
+
+ //
+ // Rule 269: Token ::= + =
+ //
+ case 269: {
+ makeToken(TK_ADD_ASSIGN);
+ break;
+ }
+
+ //
+ // Rule 270: Token ::= !
+ //
+ case 270: {
+ makeToken(TK_EXCLAMATION_MARK);
+ break;
+ }
+
+ //
+ // Rule 271: Token ::= ! =
+ //
+ case 271: {
+ makeToken(TK_NOT_EQUAL_EXEQ);
+ break;
+ }
+
+ //
+ // Rule 272: Token ::= < <
+ //
+ case 272: {
+ makeToken(TK_STEREOTYPE_QUALIFIER_OPEN);
+ break;
+ }
+
+ //
+ // Rule 273: Token ::= > >
+ //
+ case 273: {
+ makeToken(TK_STEREOTYPE_QUALIFIER_CLOSE);
+ break;
+ }
+
+ //
+ // Rule 274: Token ::= . . .
+ //
+ case 274: {
+ makeToken(TK_MULTIPLICITY_RANGE);
+ break;
+ }
+
+ //
+ // Rule 275: Token ::= ~
+ //
+ case 275: {
+ makeToken(TK_TILDE_SIGN);
+ break;
+ }
+
+ //
+ // Rule 276: Token ::= : : =
+ //
+ case 276: {
+ makeToken(TK_COLONCOLONEQUAL);
+ break;
+ }
+
+ //
+ // Rule 284: Token ::= DoubleQuote SLNotDQOpt DoubleQuote
+ //
+ case 284: {
+ makeToken(TK_STRING_LITERAL);
+ break;
+ }
+
+ //
+ // Rule 288: Token ::= LG
+ //
+ case 288: {
+ makeToken(TK_LG);
+ break;
+ }
+ //
+ // Rule 289: Token ::= RG textAny lgOpt
+ //
+ case 289: {
+ makeToken(TK_TEXT);
+ break;
+ }
+ //
+ // Rule 299: Token ::= R E M RG commentAny lgPlus E N D R E M
+ //
+ case 299: {
+ skipToken();
+ break;
+ }
+
+ default:
+ break;
+ }
+ return;
+ }
+}
diff --git a/plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/parser/XpandParser.java b/plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/parser/XpandParser.java
index 3060acc25..2cb984337 100644
--- a/plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/parser/XpandParser.java
+++ b/plugins/org.eclipse.gmf.xpand/src/org/eclipse/gmf/internal/xpand/parser/XpandParser.java
@@ -12,191 +12,233 @@
*/
package org.eclipse.gmf.internal.xpand.parser;
-import lpg.lpgjavaruntime.*;
+import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.eclipse.gmf.internal.xpand.Activator;
-import org.eclipse.gmf.internal.xpand.util.ParserException.ErrorLocationInfo;
+import lpg.lpgjavaruntime.BadParseException;
+import lpg.lpgjavaruntime.BadParseSymFileException;
+import lpg.lpgjavaruntime.DeterministicParser;
+import lpg.lpgjavaruntime.DiagnoseParser;
+import lpg.lpgjavaruntime.ErrorToken;
+import lpg.lpgjavaruntime.IToken;
+import lpg.lpgjavaruntime.LexStream;
+import lpg.lpgjavaruntime.Monitor;
+import lpg.lpgjavaruntime.NotDeterministicParseTableException;
+import lpg.lpgjavaruntime.NullExportedSymbolsException;
+import lpg.lpgjavaruntime.NullTerminalSymbolsException;
+import lpg.lpgjavaruntime.ParseErrorCodes;
+import lpg.lpgjavaruntime.ParseTable;
+import lpg.lpgjavaruntime.PrsStream;
+import lpg.lpgjavaruntime.RuleAction;
+import lpg.lpgjavaruntime.TokenStream;
+import lpg.lpgjavaruntime.UndefinedEofSymbolException;
+import lpg.lpgjavaruntime.UnimplementedTerminalsException;
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.gmf.internal.xpand.Activator;
+import org.eclipse.gmf.internal.xpand.ast.Advice;
+import org.eclipse.gmf.internal.xpand.ast.Definition;
+import org.eclipse.gmf.internal.xpand.ast.IfStatement;
+import org.eclipse.gmf.internal.xpand.ast.Template;
import org.eclipse.gmf.internal.xpand.expression.ast.Identifier;
-import org.eclipse.gmf.internal.xpand.ast.*;
-import org.eclipse.ocl.cst.*;
-import java.util.Collections;
-
-import org.eclipse.m2m.internal.qvt.oml.cst.SimpleSignatureCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.ParameterDeclarationCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.DirectionKindEnum;
+import org.eclipse.gmf.internal.xpand.util.ParserException.ErrorLocationInfo;
+import org.eclipse.m2m.internal.qvt.oml.cst.CompleteSignatureCS;
+import org.eclipse.m2m.internal.qvt.oml.cst.DictLiteralExpCS;
+import org.eclipse.m2m.internal.qvt.oml.cst.DictLiteralPartCS;
+import org.eclipse.m2m.internal.qvt.oml.cst.DictionaryTypeCS;
import org.eclipse.m2m.internal.qvt.oml.cst.DirectionKindCS;
+import org.eclipse.m2m.internal.qvt.oml.cst.DirectionKindEnum;
+import org.eclipse.m2m.internal.qvt.oml.cst.ImperativeIterateExpCS;
+import org.eclipse.m2m.internal.qvt.oml.cst.ImperativeOperationCallExpCS;
+import org.eclipse.m2m.internal.qvt.oml.cst.LibraryImportCS;
+import org.eclipse.m2m.internal.qvt.oml.cst.ListLiteralExpCS;
+import org.eclipse.m2m.internal.qvt.oml.cst.ListTypeCS;
+import org.eclipse.m2m.internal.qvt.oml.cst.ParameterDeclarationCS;
+import org.eclipse.m2m.internal.qvt.oml.cst.SimpleSignatureCS;
+import org.eclipse.m2m.internal.qvt.oml.cst.StatementCS;
import org.eclipse.m2m.internal.qvt.oml.cst.TypeSpecCS;
-
-import org.eclipse.ocl.util.OCLStandardLibraryUtil;
-import org.eclipse.ocl.utilities.PredefinedType;
-
-import org.eclipse.emf.common.util.BasicEList;
-import org.eclipse.emf.common.util.EList;
+import org.eclipse.m2m.internal.qvt.oml.cst.temp.TempFactory;
+import org.eclipse.ocl.cst.BooleanLiteralExpCS;
+import org.eclipse.ocl.cst.CSTFactory;
import org.eclipse.ocl.cst.CSTNode;
import org.eclipse.ocl.cst.CallExpCS;
+import org.eclipse.ocl.cst.CollectionLiteralExpCS;
+import org.eclipse.ocl.cst.CollectionLiteralPartCS;
+import org.eclipse.ocl.cst.CollectionRangeCS;
import org.eclipse.ocl.cst.CollectionTypeCS;
import org.eclipse.ocl.cst.CollectionTypeIdentifierEnum;
+import org.eclipse.ocl.cst.DotOrArrowEnum;
+import org.eclipse.ocl.cst.FeatureCallExpCS;
+import org.eclipse.ocl.cst.IfExpCS;
+import org.eclipse.ocl.cst.IntegerLiteralExpCS;
+import org.eclipse.ocl.cst.InvalidLiteralExpCS;
import org.eclipse.ocl.cst.IsMarkedPreCS;
+import org.eclipse.ocl.cst.IterateExpCS;
+import org.eclipse.ocl.cst.IteratorExpCS;
+import org.eclipse.ocl.cst.LetExpCS;
+import org.eclipse.ocl.cst.LiteralExpCS;
+import org.eclipse.ocl.cst.NullLiteralExpCS;
import org.eclipse.ocl.cst.OCLExpressionCS;
import org.eclipse.ocl.cst.OperationCallExpCS;
import org.eclipse.ocl.cst.PathNameCS;
+import org.eclipse.ocl.cst.PrimitiveTypeCS;
+import org.eclipse.ocl.cst.RealLiteralExpCS;
import org.eclipse.ocl.cst.SimpleNameCS;
import org.eclipse.ocl.cst.SimpleTypeEnum;
import org.eclipse.ocl.cst.StringLiteralExpCS;
+import org.eclipse.ocl.cst.TupleLiteralExpCS;
+import org.eclipse.ocl.cst.TupleTypeCS;
import org.eclipse.ocl.cst.TypeCS;
+import org.eclipse.ocl.cst.UnlimitedNaturalLiteralExpCS;
import org.eclipse.ocl.cst.VariableCS;
+import org.eclipse.ocl.cst.VariableExpCS;
+import org.eclipse.ocl.util.OCLStandardLibraryUtil;
+import org.eclipse.ocl.utilities.PredefinedType;
-import lpg.lpgjavaruntime.BadParseException;
-import lpg.lpgjavaruntime.BadParseSymFileException;
-import lpg.lpgjavaruntime.DeterministicParser;
-import lpg.lpgjavaruntime.DiagnoseParser;
-import lpg.lpgjavaruntime.IToken;
-import lpg.lpgjavaruntime.Monitor;
-import lpg.lpgjavaruntime.NotDeterministicParseTableException;
-import lpg.lpgjavaruntime.ParseTable;
-import lpg.lpgjavaruntime.RuleAction;
+public class XpandParser extends PrsStream implements RuleAction {
+ private static ParseTable prs = new XpandParserprs();
-import org.eclipse.ocl.ParserException;
-import lpg.lpgjavaruntime.Token;
-import lpg.lpgjavaruntime.BacktrackingParser;
-import lpg.lpgjavaruntime.PrsStream;
-import lpg.lpgjavaruntime.NotBacktrackParseTableException;
-import lpg.lpgjavaruntime.NullExportedSymbolsException;
-import lpg.lpgjavaruntime.NullTerminalSymbolsException;
-import lpg.lpgjavaruntime.UndefinedEofSymbolException;
-import lpg.lpgjavaruntime.UnimplementedTerminalsException;
-import org.eclipse.m2m.internal.qvt.oml.cst.AssertExpCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.AssignStatementCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.LogExpCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.BlockExpCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.ReturnExpCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.SwitchAltExpCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.temp.ScopedNameCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.temp.TempFactory;
-import org.eclipse.m2m.internal.qvt.oml.cst.ForExpCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.ImperativeIterateExpCS;
+ private DeterministicParser dtParser;
-import org.eclipse.m2m.internal.qvt.oml.cst.CompleteSignatureCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.LibraryImportCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.ListTypeCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.DictLiteralExpCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.DictionaryTypeCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.DictLiteralPartCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.StatementCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.ListLiteralExpCS;
-import org.eclipse.m2m.internal.qvt.oml.cst.ImperativeOperationCallExpCS;
+ public DeterministicParser getParser() {
+ return dtParser;
+ }
-public class XpandParser extends PrsStream implements RuleAction {
- private static ParseTable prs = new XpandParserprs();
- private DeterministicParser dtParser;
-
- public DeterministicParser getParser() { return dtParser; }
- private void setResult(Object object) { dtParser.setSym1(object); }
- public Object getRhsSym(int i) { return dtParser.getSym(i); }
-
- public int getRhsTokenIndex(int i) { return dtParser.getToken(i); }
- public IToken getRhsIToken(int i) { return super.getIToken(getRhsTokenIndex(i)); }
-
- public int getRhsFirstTokenIndex(int i) { return dtParser.getFirstToken(i); }
- public IToken getRhsFirstIToken(int i) { return super.getIToken(getRhsFirstTokenIndex(i)); }
-
- public int getRhsLastTokenIndex(int i) { return dtParser.getLastToken(i); }
- public IToken getRhsLastIToken(int i) { return super.getIToken(getRhsLastTokenIndex(i)); }
-
- public int getLeftSpan() { return dtParser.getFirstToken(); }
- public IToken getLeftIToken() { return super.getIToken(getLeftSpan()); }
-
- public int getRightSpan() { return dtParser.getLastToken(); }
- public IToken getRightIToken() { return super.getIToken(getRightSpan()); }
-
- public int getRhsErrorTokenIndex(int i) {
- int index = dtParser.getToken(i);
- IToken err = super.getIToken(index);
- return (err instanceof ErrorToken ? index : 0);
- }
- public ErrorToken getRhsErrorIToken(int i) {
- int index = dtParser.getToken(i);
- IToken err = super.getIToken(index);
- return (ErrorToken) (err instanceof ErrorToken ? err : null);
- }
-
- public XpandParser(LexStream lexStream) {
- super(lexStream);
- xpandFactory = new XpandFactory(lexStream.getFileName());
-
- try {
- super.remapTerminalSymbols(orderedTerminalSymbols(), XpandParserprs.EOFT_SYMBOL);
- }
- catch(NullExportedSymbolsException e) {
- }
- catch(NullTerminalSymbolsException e) {
- }
- catch(UnimplementedTerminalsException e) {
- java.util.ArrayList<?> unimplemented_symbols = e.getSymbols();
- System.out.println("The Lexer will not scan the following token(s):");
- for (int i = 0; i < unimplemented_symbols.size(); i++)
- {
- Integer id = (Integer) unimplemented_symbols.get(i);
- System.out.println(" " + XpandParsersym.orderedTerminalSymbols[id.intValue()]);
- }
- System.out.println();
- }
- catch(UndefinedEofSymbolException e) {
- throw new Error(new UndefinedEofSymbolException
- ("The Lexer does not implement the Eof symbol " +
- XpandParsersym.orderedTerminalSymbols[XpandParserprs.EOFT_SYMBOL]));
- }
- }
-
- public String[] orderedTerminalSymbols() { return XpandParsersym.orderedTerminalSymbols; }
- public String getTokenKindName(int kind) { return XpandParsersym.orderedTerminalSymbols[kind]; }
- public int getEOFTokenKind() { return XpandParserprs.EOFT_SYMBOL; }
- public PrsStream getParseStream() { return (PrsStream) this; }
-
- public Template parser() {
- return parser(null, 0);
- }
-
- public Template parser(Monitor monitor) {
- return parser(monitor, 0);
- }
-
- public Template parser(int error_repair_count) {
- return parser(null, error_repair_count);
- }
-
- public Template parser(Monitor monitor, int error_repair_count) {
- try {
- resetErrors();
- dtParser = new DeterministicParser(monitor, (TokenStream)this, prs, (RuleAction)this);
- }
- catch (NotDeterministicParseTableException e) {
- throw new Error(new NotDeterministicParseTableException
- ("Regenerate XpandParserprs.java with -NOBACKTRACK option"));
- }
- catch (BadParseSymFileException e) {
- throw new Error(new BadParseSymFileException("Bad Parser Symbol File -- XpandParsersym.java. Regenerate XpandParserprs.java"));
- }
-
- try {
- return (Template) dtParser.parse();
- }
- catch (BadParseException e) {
- reset(e.error_token); // point to error token
-
- DiagnoseParser diagnoseParser = new DiagnoseParser(this, prs);
- diagnoseParser.diagnose(e.error_token);
- }
-
- return null;
- }
+ private void setResult(Object object) {
+ dtParser.setSym1(object);
+ }
+
+ public Object getRhsSym(int i) {
+ return dtParser.getSym(i);
+ }
+
+ public int getRhsTokenIndex(int i) {
+ return dtParser.getToken(i);
+ }
+
+ public IToken getRhsIToken(int i) {
+ return super.getIToken(getRhsTokenIndex(i));
+ }
+
+ public int getRhsFirstTokenIndex(int i) {
+ return dtParser.getFirstToken(i);
+ }
+ public IToken getRhsFirstIToken(int i) {
+ return super.getIToken(getRhsFirstTokenIndex(i));
+ }
+
+ public int getRhsLastTokenIndex(int i) {
+ return dtParser.getLastToken(i);
+ }
+
+ public IToken getRhsLastIToken(int i) {
+ return super.getIToken(getRhsLastTokenIndex(i));
+ }
+
+ public int getLeftSpan() {
+ return dtParser.getFirstToken();
+ }
+
+ public IToken getLeftIToken() {
+ return super.getIToken(getLeftSpan());
+ }
+
+ public int getRightSpan() {
+ return dtParser.getLastToken();
+ }
+
+ public IToken getRightIToken() {
+ return super.getIToken(getRightSpan());
+ }
+
+ public int getRhsErrorTokenIndex(int i) {
+ int index = dtParser.getToken(i);
+ IToken err = super.getIToken(index);
+ return (err instanceof ErrorToken ? index : 0);
+ }
+
+ public ErrorToken getRhsErrorIToken(int i) {
+ int index = dtParser.getToken(i);
+ IToken err = super.getIToken(index);
+ return (ErrorToken) (err instanceof ErrorToken ? err : null);
+ }
+
+ public XpandParser(LexStream lexStream) {
+ super(lexStream);
+ xpandFactory = new XpandFactory(lexStream.getFileName());
+
+ try {
+ super.remapTerminalSymbols(orderedTerminalSymbols(), XpandParserprs.EOFT_SYMBOL);
+ } catch (NullExportedSymbolsException e) {
+ } catch (NullTerminalSymbolsException e) {
+ } catch (UnimplementedTerminalsException e) {
+ java.util.ArrayList<?> unimplemented_symbols = e.getSymbols();
+ System.out.println("The Lexer will not scan the following token(s):");
+ for (int i = 0; i < unimplemented_symbols.size(); i++) {
+ Integer id = (Integer) unimplemented_symbols.get(i);
+ System.out.println(" " + XpandParsersym.orderedTerminalSymbols[id.intValue()]);
+ }
+ System.out.println();
+ } catch (UndefinedEofSymbolException e) {
+ throw new Error(new UndefinedEofSymbolException("The Lexer does not implement the Eof symbol " + XpandParsersym.orderedTerminalSymbols[XpandParserprs.EOFT_SYMBOL]));
+ }
+ }
+
+ public String[] orderedTerminalSymbols() {
+ return XpandParsersym.orderedTerminalSymbols;
+ }
+
+ public String getTokenKindName(int kind) {
+ return XpandParsersym.orderedTerminalSymbols[kind];
+ }
+
+ public int getEOFTokenKind() {
+ return XpandParserprs.EOFT_SYMBOL;
+ }
+
+ public PrsStream getParseStream() {
+ return (PrsStream) this;
+ }
+
+ public Template parser() {
+ return parser(null, 0);
+ }
+
+ public Template parser(Monitor monitor) {
+ return parser(monitor, 0);
+ }
+
+ public Template parser(int error_repair_count) {
+ return parser(null, error_repair_count);
+ }
+
+ public Template parser(Monitor monitor, int error_repair_count) {
+ try {
+ resetErrors();
+ dtParser = new DeterministicParser(monitor, (TokenStream) this, prs, (RuleAction) this);
+ } catch (NotDeterministicParseTableException e) {
+ throw new Error(new NotDeterministicParseTableException("Regenerate XpandParserprs.java with -NOBACKTRACK option"));
+ } catch (BadParseSymFileException e) {
+ throw new Error(new BadParseSymFileException("Bad Parser Symbol File -- XpandParsersym.java. Regenerate XpandParserprs.java"));
+ }
+
+ try {
+ return (Template) dtParser.parse();
+ } catch (BadParseException e) {
+ reset(e.error_token); // point to error token
+
+ DiagnoseParser diagnoseParser = new DiagnoseParser(this, prs);
+ diagnoseParser.diagnose(e.error_token);
+ }
+
+ return null;
+ }
public ErrorLocationInfo[] getErrors() {
return errors.toArray(new ErrorLocationInfo[errors.size()]);
@@ -225,7 +267,8 @@ public class XpandParser extends PrsStream implements RuleAction {
public void reportError(int errorCode, String locationInfo, String tokenText) {
try {
Matcher m = Pattern.compile("(?:[^:]+::)*[^:]+:(\\d+):(\\d+):(\\d+):(\\d+):.*").matcher(locationInfo);
- boolean t = m.matches(); // ignore return value, rely on exception if anything wrong
+ boolean t = m.matches(); // ignore return value, rely on exception
+ // if anything wrong
assert t;
final int leftTokenLine = Integer.parseInt(m.group(1));
final int leftTokenColumn = Integer.parseInt(m.group(2));
@@ -245,7 +288,7 @@ public class XpandParser extends PrsStream implements RuleAction {
final int leftTokenColumn = getColumn(leftToken);
final int rightTokenLine = getEndLine(rightToken);
final int rightTokenColumn = getEndColumn(rightToken);
- final String msg = tokenText + errorMsgText[errorCode] + (locationInfo != null && locationInfo.length() > 0 ? '(' + locationInfo + ')' : "");
+ final String msg = tokenText + errorMsgText[errorCode] + (locationInfo != null && locationInfo.length() > 0 ? '(' + locationInfo + ')' : "");
final int startOffset = getStartOffset(leftToken);
final int endOffset = getEndOffset(rightToken);
errors.add(new ErrorLocationInfo(msg, leftTokenLine, leftTokenColumn, rightTokenLine, rightTokenColumn, startOffset, endOffset));
@@ -253,25 +296,21 @@ public class XpandParser extends PrsStream implements RuleAction {
private final XpandFactory xpandFactory;
-
-
/**
*
* QVT Operational specific part
- *
+ *
*/
-
-
+
@SuppressWarnings("unchecked")
- private static final EList ourEmptyEList = new BasicEList.UnmodifiableEList(0, new Object[0]);
-
-
+ private static final EList ourEmptyEList = new BasicEList.UnmodifiableEList(0, new Object[0]);
+
private void diagnozeErrorToken(int token_index) {
IToken token = getIToken(token_index);
if (token instanceof lpg.lpgjavaruntime.ErrorToken) {
token = ((lpg.lpgjavaruntime.ErrorToken) token).getErrorToken();
}
-
+
reportError(lpg.lpgjavaruntime.ParseErrorCodes.MISPLACED_CODE, "", token.getTokenIndex(), token.getTokenIndex(), //$NON-NLS-1$
"'" + token.toString() + "'"); //$NON-NLS-1$ //$NON-NLS-2$
reset(token.getTokenIndex()); // point to error token
@@ -280,3043 +319,2816 @@ public class XpandParser extends PrsStream implements RuleAction {
dtParser.setSym1(null);
}
-private ImperativeIterateExpCS createImperativeIterateExpCS(
- SimpleNameCS simpleNameCS,
- EList<VariableCS> iterators,
- VariableCS target,
- OCLExpressionCS body,
- OCLExpressionCS condition) {
- ImperativeIterateExpCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createImperativeIterateExpCS();
- result.setSimpleNameCS(simpleNameCS);
- if (iterators.size() > 0) {
- result.setVariable1(iterators.get(0));
- if (iterators.size() > 1) {
- result.setVariable2(iterators.get(1));
- }
- }
- if (target != null) {
- result.setTarget(target);
- }
- result.setBody(body);
- result.setCondition(condition);
- return result;
-}
+ private ImperativeIterateExpCS createImperativeIterateExpCS(SimpleNameCS simpleNameCS, EList<VariableCS> iterators, VariableCS target, OCLExpressionCS body, OCLExpressionCS condition) {
+ ImperativeIterateExpCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createImperativeIterateExpCS();
+ result.setSimpleNameCS(simpleNameCS);
+ if (iterators.size() > 0) {
+ result.setVariable1(iterators.get(0));
+ if (iterators.size() > 1) {
+ result.setVariable2(iterators.get(1));
+ }
+ }
+ if (target != null) {
+ result.setTarget(target);
+ }
+ result.setBody(body);
+ result.setCondition(condition);
+ return result;
+ }
-protected final CSTNode createCompleteSignatureCS(SimpleSignatureCS simpleSignatureCS, EList<ParameterDeclarationCS> resultList) {
- CompleteSignatureCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createCompleteSignatureCS();
- result.setSimpleSignature(simpleSignatureCS);
- result.getResultParams().addAll(resultList);
- return result;
-}
+ protected final CSTNode createCompleteSignatureCS(SimpleSignatureCS simpleSignatureCS, EList<ParameterDeclarationCS> resultList) {
+ CompleteSignatureCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createCompleteSignatureCS();
+ result.setSimpleSignature(simpleSignatureCS);
+ result.getResultParams().addAll(resultList);
+ return result;
+ }
-protected final SimpleSignatureCS createSimpleSignatureCS(EList<ParameterDeclarationCS> paramsCS) {
- SimpleSignatureCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createSimpleSignatureCS();
- result.getParams().addAll(paramsCS);
- return result;
-}
+ protected final SimpleSignatureCS createSimpleSignatureCS(EList<ParameterDeclarationCS> paramsCS) {
+ SimpleSignatureCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createSimpleSignatureCS();
+ result.getParams().addAll(paramsCS);
+ return result;
+ }
-protected final ParameterDeclarationCS createParameterDeclarationCS(DirectionKindCS sym, IToken tokenText, TypeSpecCS typeSpecCS) {
- ParameterDeclarationCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createParameterDeclarationCS();
- SimpleNameCS nameCS = null;
- if (tokenText != null) {
- nameCS = createSimpleNameCS(SimpleTypeEnum.IDENTIFIER_LITERAL, tokenText.toString());
- setOffsets(nameCS, tokenText);
- } else {
- //nameCS = createSimpleNameCS(SimpleTypeEnum.IDENTIFIER_LITERAL, ""); //$NON-NLS-1$
- }
- result.setSimpleNameCS(nameCS);
- result.setTypeSpecCS(typeSpecCS);
- if (sym != null) {
- result.setDirectionKind(sym.getDirectionKind());
- }
- return result;
-}
+ protected final ParameterDeclarationCS createParameterDeclarationCS(DirectionKindCS sym, IToken tokenText, TypeSpecCS typeSpecCS) {
+ ParameterDeclarationCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createParameterDeclarationCS();
+ SimpleNameCS nameCS = null;
+ if (tokenText != null) {
+ nameCS = createSimpleNameCS(SimpleTypeEnum.IDENTIFIER_LITERAL, tokenText.toString());
+ setOffsets(nameCS, tokenText);
+ } else {
+ //nameCS = createSimpleNameCS(SimpleTypeEnum.IDENTIFIER_LITERAL, ""); //$NON-NLS-1$
+ }
+ result.setSimpleNameCS(nameCS);
+ result.setTypeSpecCS(typeSpecCS);
+ if (sym != null) {
+ result.setDirectionKind(sym.getDirectionKind());
+ }
+ return result;
+ }
-protected final CSTNode createLibraryImportCS(PathNameCS sym) {
- LibraryImportCS imp = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createLibraryImportCS();
- imp.setPathNameCS(sym);
- return imp;
-}
+ protected final CSTNode createLibraryImportCS(PathNameCS sym) {
+ LibraryImportCS imp = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createLibraryImportCS();
+ imp.setPathNameCS(sym);
+ return imp;
+ }
-protected final CSTNode createDirectionKindCS(DirectionKindEnum kind) {
- DirectionKindCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createDirectionKindCS();
- result.setDirectionKind(kind);
- return result;
-}
+ protected final CSTNode createDirectionKindCS(DirectionKindEnum kind) {
+ DirectionKindCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createDirectionKindCS();
+ result.setDirectionKind(kind);
+ return result;
+ }
-protected final TypeSpecCS createTypeSpecCS(TypeCS typeCS, IToken extentLocation) {
- TypeSpecCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createTypeSpecCS();
- result.setTypeCS(typeCS);
- setOffsets(result, typeCS);
- if (extentLocation != null) {
- SimpleNameCS nameCS = createSimpleNameCS(SimpleTypeEnum.IDENTIFIER_LITERAL, extentLocation.toString());
- setOffsets(nameCS, extentLocation);
- result.setSimpleNameCS(nameCS);
- result.setEndOffset(extentLocation.getEndOffset());
+ protected final TypeSpecCS createTypeSpecCS(TypeCS typeCS, IToken extentLocation) {
+ TypeSpecCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createTypeSpecCS();
+ result.setTypeCS(typeCS);
+ setOffsets(result, typeCS);
+ if (extentLocation != null) {
+ SimpleNameCS nameCS = createSimpleNameCS(SimpleTypeEnum.IDENTIFIER_LITERAL, extentLocation.toString());
+ setOffsets(nameCS, extentLocation);
+ result.setSimpleNameCS(nameCS);
+ result.setEndOffset(extentLocation.getEndOffset());
+ }
+ return result;
}
- return result;
-}
-private ListTypeCS createListTypeCS(TypeCS typeCS) {
- ListTypeCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createListTypeCS();
- result.setTypeCS(typeCS);
- return result;
-}
+ private ListTypeCS createListTypeCS(TypeCS typeCS) {
+ ListTypeCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createListTypeCS();
+ result.setTypeCS(typeCS);
+ return result;
+ }
-private DictLiteralExpCS createDictLiteralExpCS(EList<DictLiteralPartCS> parts) {
- DictLiteralExpCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createDictLiteralExpCS();
- result.getParts().addAll(parts);
- return result;
-}
+ private DictLiteralExpCS createDictLiteralExpCS(EList<DictLiteralPartCS> parts) {
+ DictLiteralExpCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createDictLiteralExpCS();
+ result.getParts().addAll(parts);
+ return result;
+ }
-private DictionaryTypeCS createDictTypeCS(TypeCS keyTypeCS, TypeCS valueTypeCS) {
- DictionaryTypeCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createDictionaryTypeCS();
- result.setKey(keyTypeCS);
- result.setValue(valueTypeCS);
- return result;
-}
-
-private DictLiteralPartCS createDictLiteralPartCS(LiteralExpCS keyLiteralCS, OCLExpressionCS valueExpCS) {
- DictLiteralPartCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createDictLiteralPartCS();
- result.setKey(keyLiteralCS);
- result.setValue(valueExpCS);
- return result;
-}
+ private DictionaryTypeCS createDictTypeCS(TypeCS keyTypeCS, TypeCS valueTypeCS) {
+ DictionaryTypeCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createDictionaryTypeCS();
+ result.setKey(keyTypeCS);
+ result.setValue(valueTypeCS);
+ return result;
+ }
-private final StatementCS createBreakCS() {
- StatementCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createBreakExpCS();
- return result;
-}
+ private DictLiteralPartCS createDictLiteralPartCS(LiteralExpCS keyLiteralCS, OCLExpressionCS valueExpCS) {
+ DictLiteralPartCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createDictLiteralPartCS();
+ result.setKey(keyLiteralCS);
+ result.setValue(valueExpCS);
+ return result;
+ }
-private final StatementCS createContinueCS() {
- StatementCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createContinueExpCS();
- return result;
-}
+ private final StatementCS createBreakCS() {
+ StatementCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createBreakExpCS();
+ return result;
+ }
-private ListLiteralExpCS createListLiteralExpCS(EList<CollectionLiteralPartCS> collectionLiteralParts) {
- ListLiteralExpCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createListLiteralExpCS();
- result.getCollectionLiteralParts().addAll(collectionLiteralParts);
- return result;
-}
+ private final StatementCS createContinueCS() {
+ StatementCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createContinueExpCS();
+ return result;
+ }
-private boolean isTokenOfType(IToken token, int kind) {
- return (token != null) && (token.getKind() == kind);
-}
+ private ListLiteralExpCS createListLiteralExpCS(EList<CollectionLiteralPartCS> collectionLiteralParts) {
+ ListLiteralExpCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createListLiteralExpCS();
+ result.getCollectionLiteralParts().addAll(collectionLiteralParts);
+ return result;
+ }
-private ImperativeOperationCallExpCS createFeatureFQNOperationCallExpCS(SimpleNameCS moduleName, SimpleNameCS operationName, EList<OCLExpressionCS> arguments) {
- ImperativeOperationCallExpCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createImperativeOperationCallExpCS();
- return setupImperativeOperationCallExpCS(moduleName, operationName, arguments, result);
-}
+ private boolean isTokenOfType(IToken token, int kind) {
+ return (token != null) && (token.getKind() == kind);
+ }
-private OperationCallExpCS createDotOperationCallExpCS(OCLExpressionCS oclExpressionCS, PathNameCS pathNameCs, SimpleNameCS simpleNameCS, IsMarkedPreCS isMarkedPreCS, EList<OCLExpressionCS> arguments) {
- if (pathNameCs != null && pathNameCs.getSimpleNames().size() == 1) {
- ImperativeOperationCallExpCS result = createFeatureFQNOperationCallExpCS(pathNameCs.getSimpleNames().get(0), simpleNameCS, arguments);
+ private ImperativeOperationCallExpCS createFeatureFQNOperationCallExpCS(SimpleNameCS moduleName, SimpleNameCS operationName, EList<OCLExpressionCS> arguments) {
+ ImperativeOperationCallExpCS result = org.eclipse.m2m.internal.qvt.oml.cst.CSTFactory.eINSTANCE.createImperativeOperationCallExpCS();
+ return setupImperativeOperationCallExpCS(moduleName, operationName, arguments, result);
+ }
+
+ private OperationCallExpCS createDotOperationCallExpCS(OCLExpressionCS oclExpressionCS, PathNameCS pathNameCs, SimpleNameCS simpleNameCS, IsMarkedPreCS isMarkedPreCS,
+ EList<OCLExpressionCS> arguments) {
+ if (pathNameCs != null && pathNameCs.getSimpleNames().size() == 1) {
+ ImperativeOperationCallExpCS result = createFeatureFQNOperationCallExpCS(pathNameCs.getSimpleNames().get(0), simpleNameCS, arguments);
+ if (oclExpressionCS != null) {
+ result.setSource(oclExpressionCS);
+ result.setIsAtomic(true);
+ }
+ result.setAccessor(oclExpressionCS != null ? DotOrArrowEnum.DOT_LITERAL : DotOrArrowEnum.NONE_LITERAL);
+ if (isAtPre(isMarkedPreCS)) {
+ result.setIsMarkedPreCS(isMarkedPreCS);
+ }
+ return result;
+ }
+ OperationCallExpCS result = createOperationCallExpCS(oclExpressionCS, DotOrArrowEnum.DOT_LITERAL, pathNameCs, simpleNameCS, isMarkedPreCS, arguments);
if (oclExpressionCS != null) {
- result.setSource(oclExpressionCS);
result.setIsAtomic(true);
}
- result.setAccessor(oclExpressionCS != null ? DotOrArrowEnum.DOT_LITERAL : DotOrArrowEnum.NONE_LITERAL);
- if (isAtPre(isMarkedPreCS)) {
- result.setIsMarkedPreCS(isMarkedPreCS);
- }
return result;
}
- OperationCallExpCS result = createOperationCallExpCS(oclExpressionCS, DotOrArrowEnum.DOT_LITERAL, pathNameCs, simpleNameCS, isMarkedPreCS, arguments);
- if (oclExpressionCS != null) {
- result.setIsAtomic(true);
+
+ private ImperativeOperationCallExpCS setupImperativeOperationCallExpCS(SimpleNameCS moduleName, SimpleNameCS operationName, EList<OCLExpressionCS> arguments, ImperativeOperationCallExpCS result) {
+ result.setModule(moduleName);
+ result.setSimpleNameCS(operationName);
+ result.getArguments().addAll(arguments);
+ return result;
}
- return result;
-}
-private ImperativeOperationCallExpCS setupImperativeOperationCallExpCS(SimpleNameCS moduleName, SimpleNameCS operationName, EList<OCLExpressionCS> arguments, ImperativeOperationCallExpCS result) {
- result.setModule(moduleName);
- result.setSimpleNameCS(operationName);
- result.getArguments().addAll(arguments);
- return result;
-}
+ private OperationCallExpCS createArrowOperationCallExpCS(OCLExpressionCS oclExpressionCS, SimpleNameCS simpleNameCS, IsMarkedPreCS isMarkedPreCS, EList<OCLExpressionCS> arguments) {
+ return createOperationCallExpCS(oclExpressionCS, DotOrArrowEnum.ARROW_LITERAL, null, simpleNameCS, isMarkedPreCS, arguments);
+ }
-private OperationCallExpCS createArrowOperationCallExpCS(OCLExpressionCS oclExpressionCS, SimpleNameCS simpleNameCS, IsMarkedPreCS isMarkedPreCS, EList<OCLExpressionCS> arguments) {
- return createOperationCallExpCS(oclExpressionCS, DotOrArrowEnum.ARROW_LITERAL, null, simpleNameCS, isMarkedPreCS, arguments);
-}
+ private OperationCallExpCS createOperationCallExpCS(OCLExpressionCS oclExpressionCS, DotOrArrowEnum dotOrArrow, PathNameCS pathNameCS, SimpleNameCS simpleNameCS, IsMarkedPreCS isMarkedPreCS,
+ EList<OCLExpressionCS> arguments) {
+ OperationCallExpCS result = CSTFactory.eINSTANCE.createOperationCallExpCS();
+ result.setSource(oclExpressionCS);
+ result.setAccessor(oclExpressionCS != null ? dotOrArrow : DotOrArrowEnum.NONE_LITERAL);
+ result.setPathNameCS((pathNameCS != null) && (pathNameCS.getSimpleNames().size() > 0) ? pathNameCS : null);
+ result.setSimpleNameCS(simpleNameCS);
+ result.getArguments().addAll(arguments);
-private OperationCallExpCS createOperationCallExpCS(OCLExpressionCS oclExpressionCS, DotOrArrowEnum dotOrArrow, PathNameCS pathNameCS, SimpleNameCS simpleNameCS, IsMarkedPreCS isMarkedPreCS, EList<OCLExpressionCS> arguments) {
- OperationCallExpCS result = CSTFactory.eINSTANCE.createOperationCallExpCS();
- result.setSource(oclExpressionCS);
- result.setAccessor(oclExpressionCS != null ? dotOrArrow : DotOrArrowEnum.NONE_LITERAL);
- result.setPathNameCS((pathNameCS != null) && (pathNameCS.getSimpleNames().size() > 0) ? pathNameCS : null);
- result.setSimpleNameCS(simpleNameCS);
- result.getArguments().addAll(arguments);
+ if (isAtPre(isMarkedPreCS)) {
+ result.setIsMarkedPreCS(isMarkedPreCS);
+ }
- if (isAtPre(isMarkedPreCS)) {
- result.setIsMarkedPreCS(isMarkedPreCS);
+ return result;
}
- return result;
-}
-
-private OperationCallExpCS createOperationCallExpCS(OCLExpressionCS oclExpressionCS, SimpleNameCS simpleNameCS, EList<OCLExpressionCS> arguments) {
- return createOperationCallExpCS(oclExpressionCS, null, null, simpleNameCS, null, arguments);
-}
+ private OperationCallExpCS createOperationCallExpCS(OCLExpressionCS oclExpressionCS, SimpleNameCS simpleNameCS, EList<OCLExpressionCS> arguments) {
+ return createOperationCallExpCS(oclExpressionCS, null, null, simpleNameCS, null, arguments);
+ }
-private VariableExpCS createVariableExpCS(
- SimpleNameCS simpleNameCS,
- EList<OCLExpressionCS> arguments,
- IsMarkedPreCS isMarkedPreCS) {
- VariableExpCS result = CSTFactory.eINSTANCE.createVariableExpCS();
- result.setSimpleNameCS(simpleNameCS);
- result.getArguments().addAll(arguments);
- result.setIsMarkedPreCS(isMarkedPreCS);
- return result;
-}
+ private VariableExpCS createVariableExpCS(SimpleNameCS simpleNameCS, EList<OCLExpressionCS> arguments, IsMarkedPreCS isMarkedPreCS) {
+ VariableExpCS result = CSTFactory.eINSTANCE.createVariableExpCS();
+ result.setSimpleNameCS(simpleNameCS);
+ result.getArguments().addAll(arguments);
+ result.setIsMarkedPreCS(isMarkedPreCS);
+ return result;
+ }
-private SimpleNameCS createSimpleNameCS(
- SimpleTypeEnum type,
- String value) {
- SimpleNameCS result = CSTFactory.eINSTANCE.createSimpleNameCS();
- result.setType(type);
- result.setValue(unquote(value));
- return result;
-}
+ private SimpleNameCS createSimpleNameCS(SimpleTypeEnum type, String value) {
+ SimpleNameCS result = CSTFactory.eINSTANCE.createSimpleNameCS();
+ result.setType(type);
+ result.setValue(unquote(value));
+ return result;
+ }
-private PrimitiveTypeCS createPrimitiveTypeCS(
- SimpleTypeEnum type,
- String value) {
- PrimitiveTypeCS result = CSTFactory.eINSTANCE.createPrimitiveTypeCS();
- result.setType(type);
- result.setValue(value);
- return result;
-}
+ private PrimitiveTypeCS createPrimitiveTypeCS(SimpleTypeEnum type, String value) {
+ PrimitiveTypeCS result = CSTFactory.eINSTANCE.createPrimitiveTypeCS();
+ result.setType(type);
+ result.setValue(value);
+ return result;
+ }
-private PathNameCS createPathNameCS(SimpleNameCS name) {
- PathNameCS result = CSTFactory.eINSTANCE.createPathNameCS();
- result.getSimpleNames().add(name);
- return result;
-}
+ private PathNameCS createPathNameCS(SimpleNameCS name) {
+ PathNameCS result = CSTFactory.eINSTANCE.createPathNameCS();
+ result.getSimpleNames().add(name);
+ return result;
+ }
-private PathNameCS extendPathNameCS(PathNameCS path, SimpleNameCS name) {
- path.getSimpleNames().add(name);
- return path;
-}
+ private PathNameCS extendPathNameCS(PathNameCS path, SimpleNameCS name) {
+ path.getSimpleNames().add(name);
+ return path;
+ }
-private SimpleNameCS removeLastSimpleNameCS(PathNameCS path) {
- EList<SimpleNameCS> simpleNames = path.getSimpleNames();
- SimpleNameCS name = simpleNames.remove(simpleNames.size()-1);
- setOffsets(path, path, simpleNames.size() > 0 ? simpleNames.get(simpleNames.size()-1) : path);
- return name;
-}
+ private SimpleNameCS removeLastSimpleNameCS(PathNameCS path) {
+ EList<SimpleNameCS> simpleNames = path.getSimpleNames();
+ SimpleNameCS name = simpleNames.remove(simpleNames.size() - 1);
+ setOffsets(path, path, simpleNames.size() > 0 ? simpleNames.get(simpleNames.size() - 1) : path);
+ return name;
+ }
+ private CollectionLiteralExpCS createCollectionLiteralExpCS(CollectionTypeCS typeCS, EList<CollectionLiteralPartCS> collectionLiteralParts) {
+ CollectionLiteralExpCS result = CSTFactory.eINSTANCE.createCollectionLiteralExpCS();
+ result.setCollectionType(typeCS.getCollectionTypeIdentifier());
+ result.getCollectionLiteralParts().addAll(collectionLiteralParts);
+ return result;
+ }
-private CollectionLiteralExpCS createCollectionLiteralExpCS(CollectionTypeCS typeCS, EList<CollectionLiteralPartCS> collectionLiteralParts) {
- CollectionLiteralExpCS result = CSTFactory.eINSTANCE.createCollectionLiteralExpCS();
- result.setCollectionType(typeCS.getCollectionTypeIdentifier());
- result.getCollectionLiteralParts().addAll(collectionLiteralParts);
- return result;
-}
+ private CollectionLiteralPartCS createCollectionLiteralPartCS(OCLExpressionCS oclExpressionCS) {
+ CollectionLiteralPartCS result = CSTFactory.eINSTANCE.createCollectionLiteralPartCS();
+ result.setExpressionCS(oclExpressionCS);
+ return result;
+ }
-private CollectionLiteralPartCS createCollectionLiteralPartCS(OCLExpressionCS oclExpressionCS) {
- CollectionLiteralPartCS result = CSTFactory.eINSTANCE.createCollectionLiteralPartCS();
- result.setExpressionCS(oclExpressionCS);
- return result;
-}
+ private CollectionRangeCS createCollectionRangeCS(OCLExpressionCS oclExpressionCS, OCLExpressionCS lastOCLExpressionCS) {
+ CollectionRangeCS result = CSTFactory.eINSTANCE.createCollectionRangeCS();
+ result.setExpressionCS(oclExpressionCS);
+ result.setLastExpressionCS(lastOCLExpressionCS);
+ return result;
+ }
-private CollectionRangeCS createCollectionRangeCS(
- OCLExpressionCS oclExpressionCS,
- OCLExpressionCS lastOCLExpressionCS) {
- CollectionRangeCS result = CSTFactory.eINSTANCE.createCollectionRangeCS();
- result.setExpressionCS(oclExpressionCS);
- result.setLastExpressionCS(lastOCLExpressionCS);
- return result;
-}
+ private TupleLiteralExpCS createTupleLiteralExpCS(EList<VariableCS> variables) {
+ TupleLiteralExpCS result = CSTFactory.eINSTANCE.createTupleLiteralExpCS();
+ result.getVariables().addAll(variables);
+ return result;
+ }
-private TupleLiteralExpCS createTupleLiteralExpCS(EList<VariableCS> variables) {
- TupleLiteralExpCS result = CSTFactory.eINSTANCE.createTupleLiteralExpCS();
- result.getVariables().addAll(variables);
- return result;
-}
+ private IntegerLiteralExpCS createIntegerLiteralExpCS(String string) {
+ IntegerLiteralExpCS result = CSTFactory.eINSTANCE.createIntegerLiteralExpCS();
+ result.setSymbol(string);
+ result.setIntegerSymbol(Integer.valueOf(string));
+ return result;
+ }
-private IntegerLiteralExpCS createIntegerLiteralExpCS(String string) {
- IntegerLiteralExpCS result = CSTFactory.eINSTANCE.createIntegerLiteralExpCS();
- result.setSymbol(string);
- result.setIntegerSymbol(Integer.valueOf(string));
- return result;
-}
+ @SuppressWarnings("nls")
+ private UnlimitedNaturalLiteralExpCS createUnlimitedNaturalLiteralExpCS(String string) {
+ UnlimitedNaturalLiteralExpCS result = CSTFactory.eINSTANCE.createUnlimitedNaturalLiteralExpCS();
+ result.setSymbol(string);
+ if ("*".equals(string)) {
+ result.setIntegerSymbol(-1);
+ } else {
+ result.setIntegerSymbol(Integer.valueOf(string));
+ }
+ return result;
+ }
-@SuppressWarnings("nls")
-private UnlimitedNaturalLiteralExpCS createUnlimitedNaturalLiteralExpCS(String string) {
- UnlimitedNaturalLiteralExpCS result = CSTFactory.eINSTANCE.createUnlimitedNaturalLiteralExpCS();
- result.setSymbol(string);
- if ("*".equals(string)) {
- result.setIntegerSymbol(-1);
- } else {
- result.setIntegerSymbol(Integer.valueOf(string));
+ private RealLiteralExpCS createRealLiteralExpCS(String string) {
+ RealLiteralExpCS result = CSTFactory.eINSTANCE.createRealLiteralExpCS();
+ result.setSymbol(string);
+ result.setRealSymbol(Double.valueOf(string));
+ return result;
}
- return result;
-}
-private RealLiteralExpCS createRealLiteralExpCS(String string) {
- RealLiteralExpCS result = CSTFactory.eINSTANCE.createRealLiteralExpCS();
- result.setSymbol(string);
- result.setRealSymbol(Double.valueOf(string));
- return result;
-}
+ private StringLiteralExpCS createStringLiteralExpCS(String string) {
+ StringLiteralExpCS result = CSTFactory.eINSTANCE.createStringLiteralExpCS();
+ result.setSymbol(string);
+ result.setStringSymbol(string);
+ return result;
+ }
-private StringLiteralExpCS createStringLiteralExpCS(String string) {
- StringLiteralExpCS result = CSTFactory.eINSTANCE.createStringLiteralExpCS();
- result.setSymbol(string);
- result.setStringSymbol(string);
- return result;
-}
+ private BooleanLiteralExpCS createBooleanLiteralExpCS(String string) {
+ BooleanLiteralExpCS result = CSTFactory.eINSTANCE.createBooleanLiteralExpCS();
+ result.setSymbol(string);
+ result.setBooleanSymbol(Boolean.valueOf(string));
+ return result;
+ }
-private BooleanLiteralExpCS createBooleanLiteralExpCS(String string) {
- BooleanLiteralExpCS result = CSTFactory.eINSTANCE.createBooleanLiteralExpCS();
- result.setSymbol(string);
- result.setBooleanSymbol(Boolean.valueOf(string));
- return result;
-}
+ private NullLiteralExpCS createNullLiteralExpCS(String string) {
+ NullLiteralExpCS result = CSTFactory.eINSTANCE.createNullLiteralExpCS();
+ result.setValue(string);
+ result.setType(SimpleTypeEnum.KEYWORD_LITERAL);
+ return result;
+ }
-private NullLiteralExpCS createNullLiteralExpCS(String string) {
- NullLiteralExpCS result = CSTFactory.eINSTANCE.createNullLiteralExpCS();
- result.setValue(string);
- result.setType(SimpleTypeEnum.KEYWORD_LITERAL);
- return result;
-}
+ private InvalidLiteralExpCS createInvalidLiteralExpCS(String string) {
+ InvalidLiteralExpCS result = CSTFactory.eINSTANCE.createInvalidLiteralExpCS();
+ result.setValue(string);
+ result.setType(SimpleTypeEnum.KEYWORD_LITERAL);
+ return result;
+ }
-private InvalidLiteralExpCS createInvalidLiteralExpCS(String string) {
- InvalidLiteralExpCS result = CSTFactory.eINSTANCE.createInvalidLiteralExpCS();
- result.setValue(string);
- result.setType(SimpleTypeEnum.KEYWORD_LITERAL);
- return result;
-}
+ protected IteratorExpCS createIteratorExpCS(OCLExpressionCS source, SimpleNameCS simpleNameCS, VariableCS variable1, VariableCS variable2, OCLExpressionCS oclExpressionCS) {
+ IteratorExpCS result = CSTFactory.eINSTANCE.createIteratorExpCS();
+ result.setSource(source);
+ result.setAccessor(DotOrArrowEnum.ARROW_LITERAL);
+ result.setSimpleNameCS(simpleNameCS);
+ result.setVariable1(variable1);
+ result.setVariable2(variable2);
+ result.setBody(oclExpressionCS);
+ return result;
+ }
-protected IteratorExpCS createIteratorExpCS(OCLExpressionCS source, SimpleNameCS simpleNameCS, VariableCS variable1, VariableCS variable2, OCLExpressionCS oclExpressionCS) {
- IteratorExpCS result = CSTFactory.eINSTANCE.createIteratorExpCS();
- result.setSource(source);
- result.setAccessor(DotOrArrowEnum.ARROW_LITERAL);
- result.setSimpleNameCS(simpleNameCS);
- result.setVariable1(variable1);
- result.setVariable2(variable2);
- result.setBody(oclExpressionCS);
- return result;
-}
+ protected IterateExpCS createIterateExpCS(OCLExpressionCS source, SimpleNameCS simpleNameCS, VariableCS variable1, VariableCS variable2, OCLExpressionCS oclExpressionCS) {
+ IterateExpCS result = CSTFactory.eINSTANCE.createIterateExpCS();
+ result.setSource(source);
+ result.setAccessor(DotOrArrowEnum.ARROW_LITERAL);
+ result.setSimpleNameCS(simpleNameCS);
+ result.setVariable1(variable1);
+ result.setVariable2(variable2);
+ result.setBody(oclExpressionCS);
+ return result;
+ }
-protected IterateExpCS createIterateExpCS(OCLExpressionCS source, SimpleNameCS simpleNameCS, VariableCS variable1, VariableCS variable2, OCLExpressionCS oclExpressionCS) {
- IterateExpCS result = CSTFactory.eINSTANCE.createIterateExpCS();
- result.setSource(source);
- result.setAccessor(DotOrArrowEnum.ARROW_LITERAL);
- result.setSimpleNameCS(simpleNameCS);
- result.setVariable1(variable1);
- result.setVariable2(variable2);
- result.setBody(oclExpressionCS);
- return result;
-}
+ private VariableCS createVariableCS(String varName, TypeCS typeCS, OCLExpressionCS oclExpressionCS) {
+ VariableCS result = CSTFactory.eINSTANCE.createVariableCS();
+ result.setName(unquote(varName));
+ result.setTypeCS(typeCS);
+ result.setInitExpression(oclExpressionCS);
+ return result;
+ }
-private VariableCS createVariableCS(
- String varName,
- TypeCS typeCS,
- OCLExpressionCS oclExpressionCS) {
- VariableCS result = CSTFactory.eINSTANCE.createVariableCS();
- result.setName(unquote(varName));
- result.setTypeCS(typeCS);
- result.setInitExpression(oclExpressionCS);
- return result;
-}
+ private VariableCS createVariableCS(SimpleNameCS varName, TypeCS typeCS, OCLExpressionCS oclExpressionCS) {
+ VariableCS result = CSTFactory.eINSTANCE.createVariableCS();
+ result.setName(unquote(varName.getValue()));
+ result.setTypeCS(typeCS);
+ result.setInitExpression(oclExpressionCS);
+ return result;
+ }
-private VariableCS createVariableCS(SimpleNameCS varName, TypeCS typeCS, OCLExpressionCS oclExpressionCS) {
- VariableCS result = CSTFactory.eINSTANCE.createVariableCS();
- result.setName(unquote(varName.getValue()));
- result.setTypeCS(typeCS);
- result.setInitExpression(oclExpressionCS);
- return result;
-}
+ protected CollectionTypeCS createCollectionTypeCS(CollectionTypeIdentifierEnum collectionType, String value) {
+ CollectionTypeCS result = CSTFactory.eINSTANCE.createCollectionTypeCS();
+ result.setType(SimpleTypeEnum.IDENTIFIER_LITERAL);
+ result.setValue(unquote(value));
+ result.setCollectionTypeIdentifier(collectionType);
+ return result;
+ }
-protected CollectionTypeCS createCollectionTypeCS(CollectionTypeIdentifierEnum collectionType, String value) {
- CollectionTypeCS result = CSTFactory.eINSTANCE.createCollectionTypeCS();
- result.setType(SimpleTypeEnum.IDENTIFIER_LITERAL);
- result.setValue(unquote(value));
- result.setCollectionTypeIdentifier(collectionType);
- return result;
-}
+ private TupleTypeCS createTupleTypeCS(EList<VariableCS> variables) {
+ TupleTypeCS result = CSTFactory.eINSTANCE.createTupleTypeCS();
+ result.getVariables().addAll(variables);
+ return result;
+ }
-private TupleTypeCS createTupleTypeCS(EList<VariableCS> variables) {
- TupleTypeCS result = CSTFactory.eINSTANCE.createTupleTypeCS();
- result.getVariables().addAll(variables);
- return result;
-}
+ private FeatureCallExpCS createFeatureCallExpCS(OCLExpressionCS source, PathNameCS pathNameCS, SimpleNameCS simpleNameCS, EList<OCLExpressionCS> arguments, IsMarkedPreCS isMarkedPreCS) {
+ FeatureCallExpCS result = CSTFactory.eINSTANCE.createFeatureCallExpCS();
+ result.setSource(source);
+ result.setAccessor(source != null ? DotOrArrowEnum.DOT_LITERAL : DotOrArrowEnum.NONE_LITERAL);
+ result.setPathNameCS((pathNameCS != null) && (pathNameCS.getSimpleNames().size() > 0) ? pathNameCS : null);
+ result.setSimpleNameCS(simpleNameCS);
+ result.getArguments().addAll(arguments);
-private FeatureCallExpCS createFeatureCallExpCS(OCLExpressionCS source, PathNameCS pathNameCS, SimpleNameCS simpleNameCS, EList<OCLExpressionCS> arguments, IsMarkedPreCS isMarkedPreCS) {
- FeatureCallExpCS result = CSTFactory.eINSTANCE.createFeatureCallExpCS();
- result.setSource(source);
- result.setAccessor(source != null ? DotOrArrowEnum.DOT_LITERAL : DotOrArrowEnum.NONE_LITERAL);
- result.setPathNameCS((pathNameCS != null) && (pathNameCS.getSimpleNames().size() > 0) ? pathNameCS : null);
- result.setSimpleNameCS(simpleNameCS);
- result.getArguments().addAll(arguments);
+ if (isAtPre(isMarkedPreCS)) {
+ result.setIsMarkedPreCS(isMarkedPreCS);
+ }
- if (isAtPre(isMarkedPreCS)) {
- result.setIsMarkedPreCS(isMarkedPreCS);
+ return result;
}
- return result;
-}
-
-private LetExpCS createLetExpCS(
- EList<VariableCS> variables,
- OCLExpressionCS oclExpressionCS) {
- LetExpCS result = CSTFactory.eINSTANCE.createLetExpCS();
- result.getVariables().addAll(variables);
- result.setInExpression(oclExpressionCS);
- return result;
-}
+ private LetExpCS createLetExpCS(EList<VariableCS> variables, OCLExpressionCS oclExpressionCS) {
+ LetExpCS result = CSTFactory.eINSTANCE.createLetExpCS();
+ result.getVariables().addAll(variables);
+ result.setInExpression(oclExpressionCS);
+ return result;
+ }
-private IfExpCS createIfExpCS(
- OCLExpressionCS condition,
- OCLExpressionCS thenExpression,
- OCLExpressionCS elseExpression) {
- IfExpCS result = CSTFactory.eINSTANCE.createIfExpCS();
- result.setCondition(condition);
- result.setThenExpression(thenExpression);
- result.setElseExpression(elseExpression);
- return result;
-}
+ private IfExpCS createIfExpCS(OCLExpressionCS condition, OCLExpressionCS thenExpression, OCLExpressionCS elseExpression) {
+ IfExpCS result = CSTFactory.eINSTANCE.createIfExpCS();
+ result.setCondition(condition);
+ result.setThenExpression(thenExpression);
+ result.setElseExpression(elseExpression);
+ return result;
+ }
-private String unescape(IToken stringLiteral) {
- String rawString = stringLiteral.toString();
- int rawStringLength = rawString.length();
- if (rawStringLength <= 2) {
- return ""; //$NON-NLS-1$
- }
- StringBuilder unescapedStringBuilder = null;
- boolean isBackslashEscapeProcessingUsed = true; //getEnvironment().isEnabled(ParsingOptions.USE_BACKSLASH_ESCAPE_PROCESSING);
- boolean isNonStdSQEscapingUsed = false;
- int n = rawStringLength - 1;
- for (int i = 1; i < n; i++) {
- char ch = rawString.charAt(i);
- if ((isBackslashEscapeProcessingUsed && (ch == '\\'))
- || ((ch == '\'') && isNonStdSQSupported())) {
- if (unescapedStringBuilder == null) {
- unescapedStringBuilder = new StringBuilder(rawString
- .substring(1, i));
- }
- i++;
- if (i >= n) {
- reportError(
- ParseErrorCodes.INVALID_CODE,
- "", stringLiteral.getTokenIndex(), stringLiteral.getTokenIndex(), //$NON-NLS-1$
- "String literal not properly closed");
- }
- char nextCh = rawString.charAt(i);
- if (ch == '\\') {
- switch (nextCh) {
- case 'b' :
+ private String unescape(IToken stringLiteral) {
+ String rawString = stringLiteral.toString();
+ int rawStringLength = rawString.length();
+ if (rawStringLength <= 2) {
+ return ""; //$NON-NLS-1$
+ }
+ StringBuilder unescapedStringBuilder = null;
+ boolean isBackslashEscapeProcessingUsed = true; // getEnvironment().isEnabled(ParsingOptions.USE_BACKSLASH_ESCAPE_PROCESSING);
+ boolean isNonStdSQEscapingUsed = false;
+ int n = rawStringLength - 1;
+ for (int i = 1; i < n; i++) {
+ char ch = rawString.charAt(i);
+ if ((isBackslashEscapeProcessingUsed && (ch == '\\')) || ((ch == '\'') && isNonStdSQSupported())) {
+ if (unescapedStringBuilder == null) {
+ unescapedStringBuilder = new StringBuilder(rawString.substring(1, i));
+ }
+ i++;
+ if (i >= n) {
+ reportError(ParseErrorCodes.INVALID_CODE, "", stringLiteral.getTokenIndex(), stringLiteral.getTokenIndex(), //$NON-NLS-1$
+ "String literal not properly closed");
+ }
+ char nextCh = rawString.charAt(i);
+ if (ch == '\\') {
+ switch (nextCh) {
+ case 'b':
unescapedStringBuilder.append('\b');
break;
- case 't' :
+ case 't':
unescapedStringBuilder.append('\t');
break;
- case 'n' :
+ case 'n':
unescapedStringBuilder.append('\n');
break;
- case 'f' :
+ case 'f':
unescapedStringBuilder.append('\f');
break;
- case 'r' :
+ case 'r':
unescapedStringBuilder.append('\r');
break;
- case '\"' :
+ case '\"':
unescapedStringBuilder.append('\"');
break;
- case '\'' :
+ case '\'':
unescapedStringBuilder.append('\'');
break;
- case '\\' :
+ case '\\':
unescapedStringBuilder.append('\\');
break;
- default :
+ default:
// octal escape check
int unescapedChar = -1;
if ((nextCh >= '\u0030') && (nextCh <= '\u0037')) { // octal
- // digit
- unescapedChar = Character
- .getNumericValue(nextCh);
+ // digit
+ unescapedChar = Character.getNumericValue(nextCh);
if (i + 1 < n) {
char tmpCh = rawString.charAt(i + 1);
- if ((tmpCh >= '\u0030')
- && (tmpCh <= '\u0037')) { // octal digit
- unescapedChar = 8 * unescapedChar
- + Character.getNumericValue(tmpCh);
+ if ((tmpCh >= '\u0030') && (tmpCh <= '\u0037')) { // octal
+ // digit
+ unescapedChar = 8 * unescapedChar + Character.getNumericValue(tmpCh);
i++;
if (i + 1 < n) {
tmpCh = rawString.charAt(i + 1);
- if ((tmpCh >= '\u0030')
- && (tmpCh <= '\u0037') // octal
- // digit
- && (nextCh <= '\u0033')) { // most-significant
- // digit
- // in
- // range
- // 0..2
- unescapedChar = 8
- * unescapedChar
- + Character
- .getNumericValue(tmpCh);
+ if ((tmpCh >= '\u0030') && (tmpCh <= '\u0037') // octal
+ // digit
+ && (nextCh <= '\u0033')) { // most-significant
+ // digit
+ // in
+ // range
+ // 0..2
+ unescapedChar = 8 * unescapedChar + Character.getNumericValue(tmpCh);
i++;
}
}
}
}
- unescapedStringBuilder
- .append((char) unescapedChar);
+ unescapedStringBuilder.append((char) unescapedChar);
}
if (unescapedChar < 0) {
- reportError(
- ParseErrorCodes.INVALID_CODE,
- "", stringLiteral.getTokenIndex(), stringLiteral.getTokenIndex(), //$NON-NLS-1$
- "Invalid escape sequence (valid ones are \\b \\t \\n \\f \\r \\\" \\\' \\\\)");
+ reportError(ParseErrorCodes.INVALID_CODE, "", stringLiteral.getTokenIndex(), stringLiteral.getTokenIndex(), //$NON-NLS-1$
+ "Invalid escape sequence (valid ones are \\b \\t \\n \\f \\r \\\" \\\' \\\\)");
}
break;
+ }
+ } else { // non-std '' escaping
+ unescapedStringBuilder.append('\'');
+ isNonStdSQEscapingUsed = true;
+ assert nextCh == '\'' : "Unexpected escape sequence in string literal: " + rawString; //$NON-NLS-1$
}
- } else { // non-std '' escaping
- unescapedStringBuilder.append('\'');
- isNonStdSQEscapingUsed = true;
- assert nextCh == '\'' : "Unexpected escape sequence in string literal: " + rawString; //$NON-NLS-1$
+ } else if (unescapedStringBuilder != null) {
+ unescapedStringBuilder.append(ch);
}
- } else if (unescapedStringBuilder != null) {
- unescapedStringBuilder.append(ch);
- }
- }
- if (isNonStdSQEscapingUsed) {
-// Should not be called - isNonStdSQSupported returns false
-
-// // check settings for using non-standard closure iterator
-// ProblemHandler.Severity sev = getEnvironment().getValue(
-// ProblemOption.STRING_SINGLE_QUOTE_ESCAPE);
-// if ((sev != null) && (sev != ProblemHandler.Severity.OK)) {
-// getEnvironment().problem(
-// sev,
-// ProblemHandler.Phase.PARSER,
-// OCLMessages.bind(OCLMessages.NonStd_SQuote_Escape_,
-// stringLiteral), "STRING_LITERAL", //$NON-NLS-1$
-// null);
-// }
- }
- return (unescapedStringBuilder == null)
- ? rawString.substring(1, n)
- : unescapedStringBuilder.toString();
-}
+ }
+ if (isNonStdSQEscapingUsed) {
+ // Should not be called - isNonStdSQSupported returns false
+
+ // // check settings for using non-standard closure iterator
+ // ProblemHandler.Severity sev = getEnvironment().getValue(
+ // ProblemOption.STRING_SINGLE_QUOTE_ESCAPE);
+ // if ((sev != null) && (sev != ProblemHandler.Severity.OK)) {
+ // getEnvironment().problem(
+ // sev,
+ // ProblemHandler.Phase.PARSER,
+ // OCLMessages.bind(OCLMessages.NonStd_SQuote_Escape_,
+ // stringLiteral), "STRING_LITERAL", //$NON-NLS-1$
+ // null);
+ // }
+ }
+ return (unescapedStringBuilder == null) ? rawString.substring(1, n) : unescapedStringBuilder.toString();
+ }
-private boolean isNonStdSQSupported() {
- return false;
-}
+ private boolean isNonStdSQSupported() {
+ return false;
+ }
-/**
- * Sets the start and end offsets of the given <code>CSTNode</code>
- * to the start and end offsets of the given <code>IToken</code>
- *
- * @param cstNode <code>CSTNode</code> to set offsets
- * @param startEnd <code>IToken</code> to retrieve offsets from
- */
-private void setOffsets(CSTNode cstNode, IToken startEnd) {
- cstNode.setStartOffset(startEnd.getStartOffset());
- cstNode.setEndOffset(startEnd.getEndOffset());
-}
+ /**
+ * Sets the start and end offsets of the given <code>CSTNode</code> to the
+ * start and end offsets of the given <code>IToken</code>
+ *
+ * @param cstNode
+ * <code>CSTNode</code> to set offsets
+ * @param startEnd
+ * <code>IToken</code> to retrieve offsets from
+ */
+ private void setOffsets(CSTNode cstNode, IToken startEnd) {
+ cstNode.setStartOffset(startEnd.getStartOffset());
+ cstNode.setEndOffset(startEnd.getEndOffset());
+ }
-/**
- * Sets the start and end offsets of the given <code>CSTNode</code>
- * to the start and end offsets of the 2nd given <code>CSTNode</code>
- *
- * @param cstNode <code>CSTNode</code> to set offsets
- * @param startEnd <code>CSTNode</code> to retrieve offsets from
- */
-private void setOffsets(CSTNode cstNode, CSTNode startEnd) {
- cstNode.setStartOffset(startEnd.getStartOffset());
- cstNode.setEndOffset(startEnd.getEndOffset());
-}
+ /**
+ * Sets the start and end offsets of the given <code>CSTNode</code> to the
+ * start and end offsets of the 2nd given <code>CSTNode</code>
+ *
+ * @param cstNode
+ * <code>CSTNode</code> to set offsets
+ * @param startEnd
+ * <code>CSTNode</code> to retrieve offsets from
+ */
+ private void setOffsets(CSTNode cstNode, CSTNode startEnd) {
+ cstNode.setStartOffset(startEnd.getStartOffset());
+ cstNode.setEndOffset(startEnd.getEndOffset());
+ }
-/**
- * Sets the start and end offsets of the given <code>CSTNode</code>
- * to the start offset of the 2nd given <code>CSTNode</code> and the
- * end offset of the 3rd given <code>CSTNode</code>
- *
- * @param cstNode <code>CSTNode</code> to set offsets
- * @param start <code>CSTNode</code> to retrieve start offset from
- * @param end <code>CSTNode</code> to retrieve end offset from
- */
-private void setOffsets(CSTNode cstNode, CSTNode start, CSTNode end) {
- cstNode.setStartOffset(start.getStartOffset());
- cstNode.setEndOffset(end.getEndOffset());
-}
+ /**
+ * Sets the start and end offsets of the given <code>CSTNode</code> to the
+ * start offset of the 2nd given <code>CSTNode</code> and the end offset of
+ * the 3rd given <code>CSTNode</code>
+ *
+ * @param cstNode
+ * <code>CSTNode</code> to set offsets
+ * @param start
+ * <code>CSTNode</code> to retrieve start offset from
+ * @param end
+ * <code>CSTNode</code> to retrieve end offset from
+ */
+ private void setOffsets(CSTNode cstNode, CSTNode start, CSTNode end) {
+ cstNode.setStartOffset(start.getStartOffset());
+ cstNode.setEndOffset(end.getEndOffset());
+ }
-/**
- * Sets the start and end offsets of the given <code>CSTNode</code>
- * to the start offset of the 2nd given <code>CSTNode</code> and the
- * end offset of the given <code>IToken</code>
- *
- * @param cstNode <code>CSTNode</code> to set offsets
- * @param start <code>CSTNode</code> to retrieve start offset from
- * @param end <code>IToken</code> to retrieve end offset from
- */
-private void setOffsets(CSTNode cstNode, CSTNode start, IToken end) {
- cstNode.setStartOffset(start.getStartOffset());
- cstNode.setEndOffset(end.getEndOffset());
-}
+ /**
+ * Sets the start and end offsets of the given <code>CSTNode</code> to the
+ * start offset of the 2nd given <code>CSTNode</code> and the end offset of
+ * the given <code>IToken</code>
+ *
+ * @param cstNode
+ * <code>CSTNode</code> to set offsets
+ * @param start
+ * <code>CSTNode</code> to retrieve start offset from
+ * @param end
+ * <code>IToken</code> to retrieve end offset from
+ */
+ private void setOffsets(CSTNode cstNode, CSTNode start, IToken end) {
+ cstNode.setStartOffset(start.getStartOffset());
+ cstNode.setEndOffset(end.getEndOffset());
+ }
-/**
- * Sets the start and end offsets of the given <code>CSTNode</code>
- * to the start offset of the given <code>IToken</code> and the
- * end offset of the 2nd given <code>CSTNode</code>
- *
- * @param cstNode <code>CSTNode</code> to set offsets
- * @param start <code>IToken</code> to retrieve start offset from
- * @param end <code>CSTNode</code> to retrieve end offset from
- */
-private void setOffsets(CSTNode cstNode, IToken start, CSTNode end) {
- cstNode.setStartOffset(start.getStartOffset());
- cstNode.setEndOffset(end.getEndOffset());
-}
+ /**
+ * Sets the start and end offsets of the given <code>CSTNode</code> to the
+ * start offset of the given <code>IToken</code> and the end offset of the
+ * 2nd given <code>CSTNode</code>
+ *
+ * @param cstNode
+ * <code>CSTNode</code> to set offsets
+ * @param start
+ * <code>IToken</code> to retrieve start offset from
+ * @param end
+ * <code>CSTNode</code> to retrieve end offset from
+ */
+ private void setOffsets(CSTNode cstNode, IToken start, CSTNode end) {
+ cstNode.setStartOffset(start.getStartOffset());
+ cstNode.setEndOffset(end.getEndOffset());
+ }
-/**
- * Sets the start and end offsets of the given <code>CSTNode</code>
- * to the start offset of the 1std given <code>IToken</code> and the
- * end offset of the 2nd given <code>IToken</code>
- *
- * @param cstNode <code>CSTNode</code> to set offsets
- * @param start <code>IToken</code> to retrieve start offset from
- * @param end <code>IToken</code> to retrieve end offset from
- */
-private void setOffsets(CSTNode cstNode, IToken start, IToken end) {
- cstNode.setStartOffset(start.getStartOffset());
- cstNode.setEndOffset(end.getEndOffset());
-}
+ /**
+ * Sets the start and end offsets of the given <code>CSTNode</code> to the
+ * start offset of the 1std given <code>IToken</code> and the end offset of
+ * the 2nd given <code>IToken</code>
+ *
+ * @param cstNode
+ * <code>CSTNode</code> to set offsets
+ * @param start
+ * <code>IToken</code> to retrieve start offset from
+ * @param end
+ * <code>IToken</code> to retrieve end offset from
+ */
+ private void setOffsets(CSTNode cstNode, IToken start, IToken end) {
+ cstNode.setStartOffset(start.getStartOffset());
+ cstNode.setEndOffset(end.getEndOffset());
+ }
-/**
- * Removes the "s surrounding a quoted string, if any.
- *
- * @param quoted a possibly quoted string
- * @return <code>quoted</code> without the surrounding quotes, or just
- * <code>quoted</code> verbatim if there were none
- */
-private String unquote(String quoted) {
- String result = quoted;
+ /**
+ * Removes the "s surrounding a quoted string, if any.
+ *
+ * @param quoted
+ * a possibly quoted string
+ * @return <code>quoted</code> without the surrounding quotes, or just
+ * <code>quoted</code> verbatim if there were none
+ */
+ private String unquote(String quoted) {
+ String result = quoted;
+
+ if ((result != null) && (result.length() > 1)) {
+ int max = result.length() - 1;
- if ((result != null) && (result.length() > 1)) {
- int max = result.length() - 1;
+ if ((result.charAt(0) == '"') && (quoted.charAt(max) == '"')) {
+ result = result.substring(1, max);
+ }
- if ((result.charAt(0) == '"') && (quoted.charAt(max) == '"')) {
- result = result.substring(1, max);
+ // this is a regexp, so the backslash needs to be
+ // re-escaped, thus "\\" is rendered in a Java
+ // string literal as "\\\\"
+ result = result.replaceAll("\\\\\"", "\""); //$NON-NLS-2$//$NON-NLS-1$
+ /*
+ * [artem] removed extra error handling fon non-spec escape
+ * processing
+ */
}
-
- // this is a regexp, so the backslash needs to be
- // re-escaped, thus "\\" is rendered in a Java
- // string literal as "\\\\"
- result = result.replaceAll("\\\\\"", "\""); //$NON-NLS-2$//$NON-NLS-1$
- /*
- * [artem] removed extra error handling fon non-spec escape processing
- */
- }
- return result;
-}
+ return result;
+ }
-private boolean isAtPre(IsMarkedPreCS atPreCS) {
- return atPreCS != null;
-}
+ private boolean isAtPre(IsMarkedPreCS atPreCS) {
+ return atPreCS != null;
+ }
@SuppressWarnings("unchecked")
public void ruleAction(int ruleNumber) {
switch (ruleNumber) {
-
+ //
+ // Rule 31: binaryKeywordCS ::= binaryKeyword
+ //
+ case 31:
+
//
- // Rule 31: binaryKeywordCS ::= binaryKeyword
+ // Rule 32: unaryKeywordCS ::= unaryKeyword
//
- case 31:
-
+ case 32:
+
//
- // Rule 32: unaryKeywordCS ::= unaryKeyword
+ // Rule 33: reservedPunctuationCS ::= reservedPunctuation
//
- case 32:
-
+ case 33: {
+
+ SimpleNameCS result = createSimpleNameCS(SimpleTypeEnum.KEYWORD_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 33: reservedPunctuationCS ::= reservedPunctuation
+ // Rule 34: iterateNameCS ::= iterateIdentifier
//
- case 33: {
-
- SimpleNameCS result = createSimpleNameCS(
- SimpleTypeEnum.KEYWORD_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 34:
+
//
- // Rule 34: iterateNameCS ::= iterateIdentifier
+ // Rule 35: iteratorNameCS ::= iteratorIdentifier
//
- case 34:
-
+ case 35:
+
//
- // Rule 35: iteratorNameCS ::= iteratorIdentifier
+ // Rule 36: simpleIdentifierCS ::= otherIdentifier
//
- case 35:
-
+ case 36: {
+
+ CSTNode result = createSimpleNameCS(SimpleTypeEnum.IDENTIFIER_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 36: simpleIdentifierCS ::= otherIdentifier
+ // Rule 38: simpleIdentifierCS ::= self
//
- case 36: {
-
- CSTNode result = createSimpleNameCS(
- SimpleTypeEnum.IDENTIFIER_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 38: {
+
+ CSTNode result = createSimpleNameCS(SimpleTypeEnum.SELF_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 38: simpleIdentifierCS ::= self
+ // Rule 51: pathNameCS ::= notReservedSimpleNameCS
//
- case 38: {
-
- CSTNode result = createSimpleNameCS(
- SimpleTypeEnum.SELF_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 51: {
+
+ SimpleNameCS simpleName = (SimpleNameCS) dtParser.getSym(1);
+ PathNameCS result = createPathNameCS(simpleName);
+ setOffsets(result, simpleName);
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 51: pathNameCS ::= notReservedSimpleNameCS
+ // Rule 53: qualifiedPathNameCS ::= pathNameCS ::
+ // notReservedSimpleNameCS
//
- case 51: {
-
- SimpleNameCS simpleName = (SimpleNameCS)dtParser.getSym(1);
- PathNameCS result = createPathNameCS(simpleName);
- setOffsets(result, simpleName);
- dtParser.setSym1(result);
- break;
- }
-
+ case 53: {
+
+ PathNameCS result = (PathNameCS) dtParser.getSym(1);
+ SimpleNameCS simpleName = (SimpleNameCS) dtParser.getSym(3);
+ result = extendPathNameCS(result, simpleName);
+ setOffsets(result, result, simpleName);
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 53: qualifiedPathNameCS ::= pathNameCS :: notReservedSimpleNameCS
+ // Rule 54: primitiveTypeCS ::= Boolean
//
- case 53: {
-
- PathNameCS result = (PathNameCS)dtParser.getSym(1);
- SimpleNameCS simpleName = (SimpleNameCS)dtParser.getSym(3);
- result = extendPathNameCS(result, simpleName);
- setOffsets(result, result, simpleName);
- dtParser.setSym1(result);
- break;
- }
-
+ case 54: {
+
+ CSTNode result = createPrimitiveTypeCS(SimpleTypeEnum.BOOLEAN_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 54: primitiveTypeCS ::= Boolean
+ // Rule 55: primitiveTypeCS ::= Integer
//
- case 54: {
-
- CSTNode result = createPrimitiveTypeCS(
- SimpleTypeEnum.BOOLEAN_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 55: {
+
+ CSTNode result = createPrimitiveTypeCS(SimpleTypeEnum.INTEGER_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 55: primitiveTypeCS ::= Integer
+ // Rule 56: primitiveTypeCS ::= Real
//
- case 55: {
-
- CSTNode result = createPrimitiveTypeCS(
- SimpleTypeEnum.INTEGER_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 56: {
+
+ CSTNode result = createPrimitiveTypeCS(SimpleTypeEnum.REAL_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 56: primitiveTypeCS ::= Real
+ // Rule 57: primitiveTypeCS ::= String
//
- case 56: {
-
- CSTNode result = createPrimitiveTypeCS(
- SimpleTypeEnum.REAL_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 57: {
+
+ CSTNode result = createPrimitiveTypeCS(SimpleTypeEnum.STRING_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 57: primitiveTypeCS ::= String
+ // Rule 58: primitiveTypeCS ::= UnlimitedNatural
//
- case 57: {
-
- CSTNode result = createPrimitiveTypeCS(
- SimpleTypeEnum.STRING_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 58: {
+
+ CSTNode result = createPrimitiveTypeCS(SimpleTypeEnum.UNLIMITED_NATURAL_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 58: primitiveTypeCS ::= UnlimitedNatural
+ // Rule 59: primitiveTypeCS ::= OclAny
//
- case 58: {
-
- CSTNode result = createPrimitiveTypeCS(
- SimpleTypeEnum.UNLIMITED_NATURAL_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 59: {
+
+ CSTNode result = createPrimitiveTypeCS(SimpleTypeEnum.OCL_ANY_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 59: primitiveTypeCS ::= OclAny
+ // Rule 60: primitiveTypeCS ::= OclInvalid
//
- case 59: {
-
- CSTNode result = createPrimitiveTypeCS(
- SimpleTypeEnum.OCL_ANY_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 60: {
+
+ CSTNode result = createPrimitiveTypeCS(SimpleTypeEnum.OCL_INVALID_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 60: primitiveTypeCS ::= OclInvalid
+ // Rule 61: primitiveTypeCS ::= OclVoid
//
- case 60: {
-
- CSTNode result = createPrimitiveTypeCS(
- SimpleTypeEnum.OCL_INVALID_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 61: {
+
+ CSTNode result = createPrimitiveTypeCS(SimpleTypeEnum.OCL_VOID_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 61: primitiveTypeCS ::= OclVoid
+ // Rule 62: CollectionTypeIdentifierCS ::= Bag
//
- case 61: {
-
- CSTNode result = createPrimitiveTypeCS(
- SimpleTypeEnum.OCL_VOID_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 62: {
+
+ SimpleNameCS result = createCollectionTypeCS(CollectionTypeIdentifierEnum.BAG_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 62: CollectionTypeIdentifierCS ::= Bag
+ // Rule 63: CollectionTypeIdentifierCS ::= Collection
//
- case 62: {
-
- SimpleNameCS result = createCollectionTypeCS(
- CollectionTypeIdentifierEnum.BAG_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 63: {
+
+ SimpleNameCS result = createCollectionTypeCS(CollectionTypeIdentifierEnum.COLLECTION_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 63: CollectionTypeIdentifierCS ::= Collection
+ // Rule 64: CollectionTypeIdentifierCS ::= OrderedSet
//
- case 63: {
-
- SimpleNameCS result = createCollectionTypeCS(
- CollectionTypeIdentifierEnum.COLLECTION_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 64: {
+
+ SimpleNameCS result = createCollectionTypeCS(CollectionTypeIdentifierEnum.ORDERED_SET_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 64: CollectionTypeIdentifierCS ::= OrderedSet
+ // Rule 65: CollectionTypeIdentifierCS ::= Sequence
//
- case 64: {
-
- SimpleNameCS result = createCollectionTypeCS(
- CollectionTypeIdentifierEnum.ORDERED_SET_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 65: {
+
+ SimpleNameCS result = createCollectionTypeCS(CollectionTypeIdentifierEnum.SEQUENCE_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 65: CollectionTypeIdentifierCS ::= Sequence
+ // Rule 66: CollectionTypeIdentifierCS ::= Set
//
- case 65: {
-
- SimpleNameCS result = createCollectionTypeCS(
- CollectionTypeIdentifierEnum.SEQUENCE_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 66: {
+
+ SimpleNameCS result = createCollectionTypeCS(CollectionTypeIdentifierEnum.SET_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 66: CollectionTypeIdentifierCS ::= Set
+ // Rule 67: collectionTypeCS ::= CollectionTypeIdentifierCS ( typeCS
+ // )
//
- case 66: {
-
- SimpleNameCS result = createCollectionTypeCS(
- CollectionTypeIdentifierEnum.SET_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 67: {
+
+ CollectionTypeCS result = (CollectionTypeCS) dtParser.getSym(1);
+ result.setTypeCS((TypeCS) dtParser.getSym(3));
+ setOffsets(result, result, getIToken(dtParser.getToken(4)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 67: collectionTypeCS ::= CollectionTypeIdentifierCS ( typeCS )
+ // Rule 68: tupleTypeCS ::= Tuple ( variableDeclarationListCSopt )
//
- case 67: {
-
- CollectionTypeCS result = (CollectionTypeCS)dtParser.getSym(1);
- result.setTypeCS((TypeCS)dtParser.getSym(3));
- setOffsets(result, result, getIToken(dtParser.getToken(4)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 68: {
+
+ CSTNode result = createTupleTypeCS((EList) dtParser.getSym(3));
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 68: tupleTypeCS ::= Tuple ( variableDeclarationListCSopt )
+ // Rule 69: typeCS ::= notReservedSimpleNameCS
//
- case 68: {
-
- CSTNode result = createTupleTypeCS((EList)dtParser.getSym(3));
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
- dtParser.setSym1(result);
- break;
+ case 69: {
+
+ CSTNode result = (CSTNode) dtParser.getSym(1);
+ if (!(result instanceof TypeCS)) {
+ PathNameCS pathNameCS = createPathNameCS((SimpleNameCS) result);
+ setOffsets(pathNameCS, result);
+ result = pathNameCS;
}
-
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 69: typeCS ::= notReservedSimpleNameCS
+ // Rule 77: typedVariableCS ::= BooleanLiteralExpCS : typeCS
//
- case 69: {
-
- CSTNode result = (CSTNode)dtParser.getSym(1);
- if (!(result instanceof TypeCS)) {
- PathNameCS pathNameCS = createPathNameCS((SimpleNameCS)result);
- setOffsets(pathNameCS, result);
- result = pathNameCS;
- }
- dtParser.setSym1(result);
- break;
- }
-
+ case 77:
+
//
- // Rule 77: typedVariableCS ::= BooleanLiteralExpCS : typeCS
+ // Rule 78: typedVariableCS ::= InvalidLiteralExpCS : typeCS
//
- case 77:
-
+ case 78:
+
//
- // Rule 78: typedVariableCS ::= InvalidLiteralExpCS : typeCS
+ // Rule 79: typedVariableCS ::= NullLiteralExpCS : typeCS
//
- case 78:
-
+ case 79:
+
//
- // Rule 79: typedVariableCS ::= NullLiteralExpCS : typeCS
+ // Rule 80: typedVariableCS ::= notLiteralNorReservedSimpleNameCS :
+ // typeCS
//
- case 79:
-
+ case 80: {
+
+ SimpleNameCS name = (SimpleNameCS) dtParser.getSym(1);
+ TypeCS type = (TypeCS) dtParser.getSym(3);
+ VariableCS result = createVariableCS(name, type, null);
+ setOffsets(result, name, type);
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 80: typedVariableCS ::= notLiteralNorReservedSimpleNameCS : typeCS
+ // Rule 81: VariableDeclarationCS ::= variableNameCS
//
- case 80: {
-
- SimpleNameCS name = (SimpleNameCS)dtParser.getSym(1);
- TypeCS type = (TypeCS)dtParser.getSym(3);
- VariableCS result = createVariableCS(name, type, null);
- setOffsets(result, name, type);
- dtParser.setSym1(result);
- break;
- }
-
+ case 81: {
+
+ SimpleNameCS name = (SimpleNameCS) dtParser.getSym(1);
+ CSTNode result = createVariableCS(name, null, null);
+ setOffsets(result, name);
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 81: VariableDeclarationCS ::= variableNameCS
+ // Rule 83: VariableDeclarationCS ::= typedVariableCS =
+ // OclExpressionCS
//
- case 81: {
-
- SimpleNameCS name = (SimpleNameCS)dtParser.getSym(1);
- CSTNode result = createVariableCS(name, null, null);
- setOffsets(result, name);
- dtParser.setSym1(result);
- break;
- }
-
+ case 83: {
+
+ VariableCS result = (VariableCS) dtParser.getSym(1);
+ OCLExpressionCS initExpression = (OCLExpressionCS) dtParser.getSym(3);
+ result.setInitExpression(initExpression);
+ setOffsets(result, result, initExpression);
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 83: VariableDeclarationCS ::= typedVariableCS = OclExpressionCS
+ // Rule 84: variableDeclarationListCS ::= VariableDeclarationCS
//
- case 83: {
-
- VariableCS result = (VariableCS)dtParser.getSym(1);
- OCLExpressionCS initExpression = (OCLExpressionCS)dtParser.getSym(3);
- result.setInitExpression(initExpression);
- setOffsets(result, result, initExpression);
- dtParser.setSym1(result);
- break;
- }
-
+ case 84: {
+
+ EList result = new BasicEList();
+ result.add(dtParser.getSym(1));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 84: variableDeclarationListCS ::= VariableDeclarationCS
+ // Rule 85: variableDeclarationListCS ::= variableDeclarationListCS
+ // , VariableDeclarationCS
//
- case 84: {
-
- EList result = new BasicEList();
- result.add(dtParser.getSym(1));
- dtParser.setSym1(result);
- break;
- }
-
+ case 85: {
+
+ EList result = (EList) dtParser.getSym(1);
+ result.add(dtParser.getSym(3));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 85: variableDeclarationListCS ::= variableDeclarationListCS , VariableDeclarationCS
+ // Rule 86: variableDeclarationListCSopt ::= $Empty
//
- case 85: {
-
- EList result = (EList)dtParser.getSym(1);
- result.add(dtParser.getSym(3));
- dtParser.setSym1(result);
- break;
- }
-
+ case 86:
+ dtParser.setSym1(new BasicEList());
+ break;
+
+ //
+ // Rule 88: BooleanLiteralExpCS ::= false
+ //
+ case 88: {
+
+ CSTNode result = createBooleanLiteralExpCS(getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 86: variableDeclarationListCSopt ::= $Empty
+ // Rule 89: BooleanLiteralExpCS ::= true
//
- case 86:
- dtParser.setSym1(new BasicEList());
- break;
-
+ case 89: {
+
+ CSTNode result = createBooleanLiteralExpCS(getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 88: BooleanLiteralExpCS ::= false
+ // Rule 90: IntegerLiteralExpCS ::= INTEGER_LITERAL
//
- case 88: {
-
- CSTNode result = createBooleanLiteralExpCS(getTokenText(dtParser.getToken(1)));
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 90: {
+
+ CSTNode result = createIntegerLiteralExpCS(getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 89: BooleanLiteralExpCS ::= true
+ // Rule 91: InvalidLiteralExpCS ::= invalid
//
- case 89: {
-
- CSTNode result = createBooleanLiteralExpCS(getTokenText(dtParser.getToken(1)));
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 91: {
+
+ CSTNode result = createInvalidLiteralExpCS(getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 90: IntegerLiteralExpCS ::= INTEGER_LITERAL
+ // Rule 92: NullLiteralExpCS ::= null
//
- case 90: {
-
- CSTNode result = createIntegerLiteralExpCS(getTokenText(dtParser.getToken(1)));
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 92: {
+
+ CSTNode result = createNullLiteralExpCS(getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 91: InvalidLiteralExpCS ::= invalid
+ // Rule 93: RealLiteralExpCS ::= REAL_LITERAL
//
- case 91: {
-
- CSTNode result = createInvalidLiteralExpCS(getTokenText(dtParser.getToken(1)));
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 93: {
+
+ CSTNode result = createRealLiteralExpCS(getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 92: NullLiteralExpCS ::= null
+ // Rule 94: StringLiteralExpCS ::= STRING_LITERAL
//
- case 92: {
-
- CSTNode result = createNullLiteralExpCS(getTokenText(dtParser.getToken(1)));
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 94: {
+
+ IToken literalToken = getIToken(dtParser.getToken(1));
+ StringLiteralExpCS result = createStringLiteralExpCS(literalToken.toString());
+ result.setUnescapedStringSymbol(unescape(literalToken));
+ setOffsets(result, literalToken);
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 93: RealLiteralExpCS ::= REAL_LITERAL
+ // Rule 95: UnlimitedNaturalLiteralExpCS ::= *
//
- case 93: {
-
- CSTNode result = createRealLiteralExpCS(getTokenText(dtParser.getToken(1)));
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 95: {
+
+ CSTNode result = createUnlimitedNaturalLiteralExpCS(getTokenText(dtParser.getToken(1)));
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 94: StringLiteralExpCS ::= STRING_LITERAL
+ // Rule 101: CollectionLiteralExpCS ::= CollectionTypeIdentifierCS {
+ // CollectionLiteralPartsCSopt }
//
- case 94: {
-
- IToken literalToken = getIToken(dtParser.getToken(1));
- StringLiteralExpCS result = createStringLiteralExpCS(literalToken.toString());
- result.setUnescapedStringSymbol(unescape(literalToken));
- setOffsets(result, literalToken);
- dtParser.setSym1(result);
- break;
- }
-
+ case 101: {
+
+ CollectionTypeCS typeCS = (CollectionTypeCS) dtParser.getSym(1);
+ CSTNode result = createCollectionLiteralExpCS(typeCS, (EList) dtParser.getSym(3));
+ setOffsets(result, typeCS, getIToken(dtParser.getToken(4)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 95: UnlimitedNaturalLiteralExpCS ::= *
+ // Rule 102: CollectionRangeCS ::= OclExpressionCS ..
+ // OclExpressionCS
//
- case 95: {
-
- CSTNode result = createUnlimitedNaturalLiteralExpCS(getTokenText(dtParser.getToken(1)));
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 101: CollectionLiteralExpCS ::= CollectionTypeIdentifierCS { CollectionLiteralPartsCSopt }
- //
- case 101: {
-
- CollectionTypeCS typeCS = (CollectionTypeCS)dtParser.getSym(1);
- CSTNode result = createCollectionLiteralExpCS(
- typeCS,
- (EList)dtParser.getSym(3)
- );
- setOffsets(result, typeCS, getIToken(dtParser.getToken(4)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 102: {
+
+ CSTNode result = createCollectionRangeCS((OCLExpressionCS) dtParser.getSym(1), (OCLExpressionCS) dtParser.getSym(3));
+ setOffsets(result, (CSTNode) dtParser.getSym(1), (CSTNode) dtParser.getSym(3));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 102: CollectionRangeCS ::= OclExpressionCS .. OclExpressionCS
+ // Rule 104: CollectionLiteralPartCS ::= OclExpressionCS
//
- case 102: {
-
- CSTNode result = createCollectionRangeCS(
- (OCLExpressionCS)dtParser.getSym(1),
- (OCLExpressionCS)dtParser.getSym(3)
- );
- setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
- dtParser.setSym1(result);
- break;
- }
-
+ case 104: {
+
+ CSTNode result = createCollectionLiteralPartCS((OCLExpressionCS) dtParser.getSym(1));
+ setOffsets(result, (CSTNode) dtParser.getSym(1));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 104: CollectionLiteralPartCS ::= OclExpressionCS
+ // Rule 105: CollectionLiteralPartsCS ::= CollectionLiteralPartCS
//
- case 104: {
-
- CSTNode result = createCollectionLiteralPartCS(
- (OCLExpressionCS)dtParser.getSym(1)
- );
- setOffsets(result, (CSTNode)dtParser.getSym(1));
- dtParser.setSym1(result);
- break;
- }
-
+ case 105: {
+
+ EList result = new BasicEList();
+ result.add(dtParser.getSym(1));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 105: CollectionLiteralPartsCS ::= CollectionLiteralPartCS
+ // Rule 106: CollectionLiteralPartsCS ::= CollectionLiteralPartsCS ,
+ // CollectionLiteralPartCS
//
- case 105: {
-
- EList result = new BasicEList();
- result.add(dtParser.getSym(1));
- dtParser.setSym1(result);
- break;
- }
-
+ case 106: {
+
+ EList result = (EList) dtParser.getSym(1);
+ result.add(dtParser.getSym(3));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 106: CollectionLiteralPartsCS ::= CollectionLiteralPartsCS , CollectionLiteralPartCS
+ // Rule 107: CollectionLiteralPartsCSopt ::= $Empty
//
- case 106: {
-
- EList result = (EList)dtParser.getSym(1);
- result.add(dtParser.getSym(3));
- dtParser.setSym1(result);
- break;
- }
-
+ case 107:
+ dtParser.setSym1(new BasicEList());
+ break;
+
+ //
+ // Rule 109: TupleLiteralExpCS ::= Tuple { TupleLiteralPartsCS }
+ //
+ case 109: {
+
+ CSTNode result = createTupleLiteralExpCS((EList) dtParser.getSym(3));
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 107: CollectionLiteralPartsCSopt ::= $Empty
+ // Rule 110: TupleLiteralPartCS ::= variableNameCS = OclExpressionCS
//
- case 107:
- dtParser.setSym1(new BasicEList());
- break;
-
+ case 110: {
+
+ SimpleNameCS name = (SimpleNameCS) dtParser.getSym(1);
+ OCLExpressionCS initExpression = (OCLExpressionCS) dtParser.getSym(3);
+ VariableCS result = createVariableCS(name, null, initExpression);
+ setOffsets(result, name, initExpression);
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 109: TupleLiteralExpCS ::= Tuple { TupleLiteralPartsCS }
+ // Rule 111: TupleLiteralPartCS ::= typedVariableCS =
+ // OclExpressionCS
//
- case 109: {
-
- CSTNode result = createTupleLiteralExpCS((EList)dtParser.getSym(3));
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 111: {
+
+ VariableCS result = (VariableCS) dtParser.getSym(1);
+ OCLExpressionCS initExpression = (OCLExpressionCS) dtParser.getSym(3);
+ result.setInitExpression(initExpression);
+ setOffsets(result, result, initExpression);
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 110: TupleLiteralPartCS ::= variableNameCS = OclExpressionCS
+ // Rule 112: TupleLiteralPartsCS ::= TupleLiteralPartCS
//
- case 110: {
-
- SimpleNameCS name = (SimpleNameCS)dtParser.getSym(1);
- OCLExpressionCS initExpression = (OCLExpressionCS)dtParser.getSym(3);
- VariableCS result = createVariableCS(name, null, initExpression);
- setOffsets(result, name, initExpression);
- dtParser.setSym1(result);
- break;
- }
-
+ case 112: {
+
+ EList result = new BasicEList();
+ result.add(dtParser.getSym(1));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 111: TupleLiteralPartCS ::= typedVariableCS = OclExpressionCS
+ // Rule 113: TupleLiteralPartsCS ::= TupleLiteralPartsCS ,
+ // TupleLiteralPartCS
//
- case 111: {
-
- VariableCS result = (VariableCS)dtParser.getSym(1);
- OCLExpressionCS initExpression = (OCLExpressionCS)dtParser.getSym(3);
- result.setInitExpression(initExpression);
- setOffsets(result, result, initExpression);
- dtParser.setSym1(result);
- break;
- }
-
+ case 113: {
+
+ EList result = (EList) dtParser.getSym(1);
+ result.add(dtParser.getSym(3));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 112: TupleLiteralPartsCS ::= TupleLiteralPartCS
+ // Rule 119: OperationCallExpCS ::= primaryExpCS ->
+ // notIteratorNorReservedSimpleNameCS isMarkedPreCSopt (
+ // argumentsCSopt )
//
- case 112: {
-
- EList result = new BasicEList();
- result.add(dtParser.getSym(1));
- dtParser.setSym1(result);
- break;
- }
-
+ case 119: {
+
+ OCLExpressionCS source = (OCLExpressionCS) dtParser.getSym(1);
+ CSTNode result = createArrowOperationCallExpCS(source, (SimpleNameCS) dtParser.getSym(3), (IsMarkedPreCS) dtParser.getSym(4), (EList) dtParser.getSym(6));
+ setOffsets(result, source, getIToken(dtParser.getToken(7)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 113: TupleLiteralPartsCS ::= TupleLiteralPartsCS , TupleLiteralPartCS
+ // Rule 120: OperationCallExpCS ::= primaryExpCS . binaryKeywordCS
+ // isMarkedPreCSopt ( argumentsCSopt )
//
- case 113: {
-
- EList result = (EList)dtParser.getSym(1);
- result.add(dtParser.getSym(3));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 119: OperationCallExpCS ::= primaryExpCS -> notIteratorNorReservedSimpleNameCS isMarkedPreCSopt ( argumentsCSopt )
- //
- case 119: {
-
- OCLExpressionCS source = (OCLExpressionCS)dtParser.getSym(1);
- CSTNode result = createArrowOperationCallExpCS(
- source,
- (SimpleNameCS)dtParser.getSym(3),
- (IsMarkedPreCS)dtParser.getSym(4),
- (EList)dtParser.getSym(6)
- );
- setOffsets(result, source, getIToken(dtParser.getToken(7)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 120:
+
//
- // Rule 120: OperationCallExpCS ::= primaryExpCS . binaryKeywordCS isMarkedPreCSopt ( argumentsCSopt )
+ // Rule 121: OperationCallExpCS ::= primaryExpCS . unaryKeywordCS
+ // isMarkedPreCSopt ( argumentsCSopt )
//
- case 120:
-
+ case 121:
+
//
- // Rule 121: OperationCallExpCS ::= primaryExpCS . unaryKeywordCS isMarkedPreCSopt ( argumentsCSopt )
+ // Rule 122: OperationCallExpCS ::= primaryExpCS .
+ // reservedPunctuationCS isMarkedPreCSopt ( argumentsCSopt )
//
- case 121:
-
+ case 122:
+
//
- // Rule 122: OperationCallExpCS ::= primaryExpCS . reservedPunctuationCS isMarkedPreCSopt ( argumentsCSopt )
+ // Rule 123: OperationCallExpCS ::= primaryExpCS .
+ // notReservedSimpleNameCS isMarkedPreCSopt ( argumentsCSopt )
//
- case 122:
-
+ case 123: {
+
+ OCLExpressionCS source = (OCLExpressionCS) dtParser.getSym(1);
+ CSTNode result = createDotOperationCallExpCS(source, null, (SimpleNameCS) dtParser.getSym(3), (IsMarkedPreCS) dtParser.getSym(4), (EList) dtParser.getSym(6));
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(7)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 123: OperationCallExpCS ::= primaryExpCS . notReservedSimpleNameCS isMarkedPreCSopt ( argumentsCSopt )
+ // Rule 124: OperationCallExpCS ::= literalSimpleNameCS
+ // isMarkedPreCSopt ( argumentsCSopt )
//
- case 123: {
-
- OCLExpressionCS source = (OCLExpressionCS)dtParser.getSym(1);
- CSTNode result = createDotOperationCallExpCS(
- source,
- null,
- (SimpleNameCS)dtParser.getSym(3),
- (IsMarkedPreCS)dtParser.getSym(4),
- (EList)dtParser.getSym(6)
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(7)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 124:
+
//
- // Rule 124: OperationCallExpCS ::= literalSimpleNameCS isMarkedPreCSopt ( argumentsCSopt )
+ // Rule 125: OperationCallExpCS ::=
+ // notLiteralNorReservedSimpleNameCS isMarkedPreCSopt (
+ // argumentsCSopt )
//
- case 124:
-
+ case 125: {
+
+ CSTNode result = createDotOperationCallExpCS(null, null, (SimpleNameCS) dtParser.getSym(1), (IsMarkedPreCS) dtParser.getSym(2), (EList) dtParser.getSym(4));
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(5)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 125: OperationCallExpCS ::= notLiteralNorReservedSimpleNameCS isMarkedPreCSopt ( argumentsCSopt )
+ // Rule 126: OperationCallExpCS ::= qualifiedPathNameCS (
+ // argumentsCSopt )
//
- case 125: {
-
- CSTNode result = createDotOperationCallExpCS(
- null,
- null,
- (SimpleNameCS)dtParser.getSym(1),
- (IsMarkedPreCS)dtParser.getSym(2),
- (EList)dtParser.getSym(4)
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(5)));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 126: OperationCallExpCS ::= qualifiedPathNameCS ( argumentsCSopt )
- //
- case 126: {
-
- PathNameCS pathNameCS = (PathNameCS)dtParser.getSym(1);
- SimpleNameCS simpleNameCS = removeLastSimpleNameCS(pathNameCS);
- OperationCallExpCS result = createDotOperationCallExpCS(
- null,
- pathNameCS,
- simpleNameCS,
- null,
- (EList)dtParser.getSym(3)
- );
- setOffsets(result, pathNameCS, getIToken(dtParser.getToken(4)));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 127: OperationCallExpCS ::= primaryExpCS . qualifiedPathNameCS isMarkedPreCSopt ( argumentsCSopt )
- //
- case 127: {
-
- PathNameCS pathNameCS = (PathNameCS)dtParser.getSym(3);
- SimpleNameCS simpleNameCS = removeLastSimpleNameCS(pathNameCS);
- OCLExpressionCS source = (OCLExpressionCS)dtParser.getSym(1);
- CallExpCS result = createDotOperationCallExpCS(
- source,
- pathNameCS,
- simpleNameCS,
- (IsMarkedPreCS)dtParser.getSym(4),
- (EList)dtParser.getSym(6)
- );
- setOffsets(result, source, getIToken(dtParser.getToken(7)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 126: {
+
+ PathNameCS pathNameCS = (PathNameCS) dtParser.getSym(1);
+ SimpleNameCS simpleNameCS = removeLastSimpleNameCS(pathNameCS);
+ OperationCallExpCS result = createDotOperationCallExpCS(null, pathNameCS, simpleNameCS, null, (EList) dtParser.getSym(3));
+ setOffsets(result, pathNameCS, getIToken(dtParser.getToken(4)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 128: argumentsCS ::= OclExpressionCS
+ // Rule 127: OperationCallExpCS ::= primaryExpCS .
+ // qualifiedPathNameCS isMarkedPreCSopt ( argumentsCSopt )
//
- case 128: {
-
- EList result = new BasicEList();
- result.add(dtParser.getSym(1));
- dtParser.setSym1(result);
- break;
- }
-
+ case 127: {
+
+ PathNameCS pathNameCS = (PathNameCS) dtParser.getSym(3);
+ SimpleNameCS simpleNameCS = removeLastSimpleNameCS(pathNameCS);
+ OCLExpressionCS source = (OCLExpressionCS) dtParser.getSym(1);
+ CallExpCS result = createDotOperationCallExpCS(source, pathNameCS, simpleNameCS, (IsMarkedPreCS) dtParser.getSym(4), (EList) dtParser.getSym(6));
+ setOffsets(result, source, getIToken(dtParser.getToken(7)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 129: argumentsCS ::= argumentsCS , OclExpressionCS
+ // Rule 128: argumentsCS ::= OclExpressionCS
//
- case 129: {
-
- EList result = (EList)dtParser.getSym(1);
- result.add(dtParser.getSym(3));
- dtParser.setSym1(result);
- break;
- }
-
+ case 128: {
+
+ EList result = new BasicEList();
+ result.add(dtParser.getSym(1));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 130: argumentsCSopt ::= $Empty
+ // Rule 129: argumentsCS ::= argumentsCS , OclExpressionCS
//
- case 130:
- dtParser.setSym1(new BasicEList());
- break;
-
+ case 129: {
+
+ EList result = (EList) dtParser.getSym(1);
+ result.add(dtParser.getSym(3));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 132: isMarkedPreCSopt ::= $Empty
+ // Rule 130: argumentsCSopt ::= $Empty
//
- case 132: {
-
- dtParser.setSym1(null);
- break;
- }
-
- //
- // Rule 133: PropertyCallExpCS ::= primaryExpCS . notReservedSimpleNameCS isMarkedPreCSopt
- //
- case 133: {
-
- OCLExpressionCS source = (OCLExpressionCS)dtParser.getSym(1);
- SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(3);
- IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)dtParser.getSym(4);
- CSTNode result = createFeatureCallExpCS(
- source,
- null,
- simpleNameCS,
- new BasicEList(),
- isMarkedPreCS
- );
- if (isMarkedPreCS != null) {
- setOffsets(result, source, isMarkedPreCS);
- } else {
- setOffsets(result, source, simpleNameCS);
- }
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 134: PropertyCallExpCS ::= primaryExpCS . qualifiedPathNameCS isMarkedPreCSopt
- //
- case 134: {
-
- OCLExpressionCS source = (OCLExpressionCS)dtParser.getSym(1);
- PathNameCS pathNameCS = (PathNameCS)dtParser.getSym(3);
- SimpleNameCS simpleNameCS = removeLastSimpleNameCS(pathNameCS);
- IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)dtParser.getSym(4);
- CSTNode result = createFeatureCallExpCS(
- source,
- pathNameCS,
- simpleNameCS,
- new BasicEList(),
- isMarkedPreCS
- );
- if (isMarkedPreCS != null) {
- setOffsets(result, source, isMarkedPreCS);
- } else {
- setOffsets(result, source, simpleNameCS);
- }
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 135: PropertyCallExpCS ::= qualifiedPathNameCS isMarkedPreCSopt
- //
- case 135: {
-
- PathNameCS pathNameCS = (PathNameCS)dtParser.getSym(1);
- SimpleNameCS simpleNameCS = removeLastSimpleNameCS(pathNameCS);
- IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)dtParser.getSym(2);
- CSTNode result = createFeatureCallExpCS(
- null,
- pathNameCS,
- simpleNameCS,
- new BasicEList(),
- isMarkedPreCS
- );
- if (isMarkedPreCS != null) {
- setOffsets(result, pathNameCS, isMarkedPreCS);
- } else {
- setOffsets(result, pathNameCS, simpleNameCS);
- }
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 136: AssociationClassCallExpCS ::= notLiteralNorReservedSimpleNameCS isMarkedPreCSopt
- //
- case 136: {
-
- IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)dtParser.getSym(2);
- CSTNode result = createVariableExpCS(
- (SimpleNameCS)dtParser.getSym(1),
- new BasicEList(),
- isMarkedPreCS
- );
- if (isMarkedPreCS != null) {
- setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(2));
- } else {
- setOffsets(result, (CSTNode)dtParser.getSym(1));
- }
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 140: IterateExpCS ::= primaryExpCS -> iterateNameCS ( VariableDeclarationCS | OclExpressionCS )
- //
- case 140: {
-
- OCLExpressionCS source = (OCLExpressionCS)dtParser.getSym(1);
- SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(3);
- CSTNode result = createIterateExpCS(
- source,
- simpleNameCS,
- (VariableCS)dtParser.getSym(5),
- null,
- (OCLExpressionCS)dtParser.getSym(7)
- );
- setOffsets(result, source, getIToken(dtParser.getToken(8)));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 141: IterateExpCS ::= primaryExpCS -> iterateNameCS ( VariableDeclarationCS ; VariableDeclarationCS | OclExpressionCS )
- //
- case 141: {
-
- OCLExpressionCS source = (OCLExpressionCS)dtParser.getSym(1);
- SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(3);
- CSTNode result = createIterateExpCS(
- source,
- simpleNameCS,
- (VariableCS)dtParser.getSym(5),
- (VariableCS)dtParser.getSym(7),
- (OCLExpressionCS)dtParser.getSym(9)
- );
- setOffsets(result, source, getIToken(dtParser.getToken(10)));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 142: IteratorExpCS ::= primaryExpCS -> iteratorNameCS ( OclExpressionCS )
- //
- case 142: {
-
- OCLExpressionCS source = (OCLExpressionCS)dtParser.getSym(1);
- SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(3);
- CSTNode result = createIteratorExpCS(
- source,
- simpleNameCS,
- null,
- null,
- (OCLExpressionCS)dtParser.getSym(5)
- );
- setOffsets(result, source, getIToken(dtParser.getToken(6)));
- dtParser.setSym1(result);
- break;
+ case 130:
+ dtParser.setSym1(new BasicEList());
+ break;
+
+ //
+ // Rule 132: isMarkedPreCSopt ::= $Empty
+ //
+ case 132: {
+
+ dtParser.setSym1(null);
+ break;
+ }
+
+ //
+ // Rule 133: PropertyCallExpCS ::= primaryExpCS .
+ // notReservedSimpleNameCS isMarkedPreCSopt
+ //
+ case 133: {
+
+ OCLExpressionCS source = (OCLExpressionCS) dtParser.getSym(1);
+ SimpleNameCS simpleNameCS = (SimpleNameCS) dtParser.getSym(3);
+ IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS) dtParser.getSym(4);
+ CSTNode result = createFeatureCallExpCS(source, null, simpleNameCS, new BasicEList(), isMarkedPreCS);
+ if (isMarkedPreCS != null) {
+ setOffsets(result, source, isMarkedPreCS);
+ } else {
+ setOffsets(result, source, simpleNameCS);
}
-
- //
- // Rule 143: IteratorExpCS ::= primaryExpCS -> iteratorNameCS ( VariableDeclarationCS | OclExpressionCS )
- //
- case 143: {
-
- OCLExpressionCS source = (OCLExpressionCS)dtParser.getSym(1);
- SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(3);
- CSTNode result = createIteratorExpCS(
- source,
- simpleNameCS,
- (VariableCS)dtParser.getSym(5),
- null,
- (OCLExpressionCS)dtParser.getSym(7)
- );
- setOffsets(result, source, getIToken(dtParser.getToken(8)));
- dtParser.setSym1(result);
- break;
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 134: PropertyCallExpCS ::= primaryExpCS .
+ // qualifiedPathNameCS isMarkedPreCSopt
+ //
+ case 134: {
+
+ OCLExpressionCS source = (OCLExpressionCS) dtParser.getSym(1);
+ PathNameCS pathNameCS = (PathNameCS) dtParser.getSym(3);
+ SimpleNameCS simpleNameCS = removeLastSimpleNameCS(pathNameCS);
+ IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS) dtParser.getSym(4);
+ CSTNode result = createFeatureCallExpCS(source, pathNameCS, simpleNameCS, new BasicEList(), isMarkedPreCS);
+ if (isMarkedPreCS != null) {
+ setOffsets(result, source, isMarkedPreCS);
+ } else {
+ setOffsets(result, source, simpleNameCS);
}
-
- //
- // Rule 144: IteratorExpCS ::= primaryExpCS -> iteratorNameCS ( VariableDeclarationCS , VariableDeclarationCS | OclExpressionCS )
- //
- case 144: {
-
- OCLExpressionCS source = (OCLExpressionCS)dtParser.getSym(1);
- SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(3);
- CSTNode result = createIteratorExpCS(
- source,
- simpleNameCS,
- (VariableCS)dtParser.getSym(5),
- (VariableCS)dtParser.getSym(7),
- (OCLExpressionCS)dtParser.getSym(9)
- );
- setOffsets(result, source, getIToken(dtParser.getToken(10)));
- dtParser.setSym1(result);
- break;
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 135: PropertyCallExpCS ::= qualifiedPathNameCS
+ // isMarkedPreCSopt
+ //
+ case 135: {
+
+ PathNameCS pathNameCS = (PathNameCS) dtParser.getSym(1);
+ SimpleNameCS simpleNameCS = removeLastSimpleNameCS(pathNameCS);
+ IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS) dtParser.getSym(2);
+ CSTNode result = createFeatureCallExpCS(null, pathNameCS, simpleNameCS, new BasicEList(), isMarkedPreCS);
+ if (isMarkedPreCS != null) {
+ setOffsets(result, pathNameCS, isMarkedPreCS);
+ } else {
+ setOffsets(result, pathNameCS, simpleNameCS);
}
-
- //
- // Rule 149: LetExpCS ::= let variableDeclarationListCS in OclExpressionCS
- //
- case 149: {
-
- OCLExpressionCS expr = (OCLExpressionCS)dtParser.getSym(4);
- CSTNode result = createLetExpCS(
- (EList)dtParser.getSym(2),
- expr
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), expr);
- dtParser.setSym1(result);
- break;
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 136: AssociationClassCallExpCS ::=
+ // notLiteralNorReservedSimpleNameCS isMarkedPreCSopt
+ //
+ case 136: {
+
+ IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS) dtParser.getSym(2);
+ CSTNode result = createVariableExpCS((SimpleNameCS) dtParser.getSym(1), new BasicEList(), isMarkedPreCS);
+ if (isMarkedPreCS != null) {
+ setOffsets(result, (CSTNode) dtParser.getSym(1), (CSTNode) dtParser.getSym(2));
+ } else {
+ setOffsets(result, (CSTNode) dtParser.getSym(1));
}
-
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 154: impliesExpCS ::= impliesExpCS implies xorExpCS
+ // Rule 140: IterateExpCS ::= primaryExpCS -> iterateNameCS (
+ // VariableDeclarationCS | OclExpressionCS )
//
- case 154:
-
+ case 140: {
+
+ OCLExpressionCS source = (OCLExpressionCS) dtParser.getSym(1);
+ SimpleNameCS simpleNameCS = (SimpleNameCS) dtParser.getSym(3);
+ CSTNode result = createIterateExpCS(source, simpleNameCS, (VariableCS) dtParser.getSym(5), null, (OCLExpressionCS) dtParser.getSym(7));
+ setOffsets(result, source, getIToken(dtParser.getToken(8)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 155: impliesLetCS ::= impliesExpCS implies xorLetCS
+ // Rule 141: IterateExpCS ::= primaryExpCS -> iterateNameCS (
+ // VariableDeclarationCS ; VariableDeclarationCS | OclExpressionCS )
//
- case 155:
-
+ case 141: {
+
+ OCLExpressionCS source = (OCLExpressionCS) dtParser.getSym(1);
+ SimpleNameCS simpleNameCS = (SimpleNameCS) dtParser.getSym(3);
+ CSTNode result = createIterateExpCS(source, simpleNameCS, (VariableCS) dtParser.getSym(5), (VariableCS) dtParser.getSym(7), (OCLExpressionCS) dtParser.getSym(9));
+ setOffsets(result, source, getIToken(dtParser.getToken(10)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 158: xorExpCS ::= xorExpCS xor orExpCS
+ // Rule 142: IteratorExpCS ::= primaryExpCS -> iteratorNameCS (
+ // OclExpressionCS )
//
- case 158:
-
+ case 142: {
+
+ OCLExpressionCS source = (OCLExpressionCS) dtParser.getSym(1);
+ SimpleNameCS simpleNameCS = (SimpleNameCS) dtParser.getSym(3);
+ CSTNode result = createIteratorExpCS(source, simpleNameCS, null, null, (OCLExpressionCS) dtParser.getSym(5));
+ setOffsets(result, source, getIToken(dtParser.getToken(6)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 159: xorLetCS ::= xorExpCS xor orLetCS
+ // Rule 143: IteratorExpCS ::= primaryExpCS -> iteratorNameCS (
+ // VariableDeclarationCS | OclExpressionCS )
//
- case 159:
-
+ case 143: {
+
+ OCLExpressionCS source = (OCLExpressionCS) dtParser.getSym(1);
+ SimpleNameCS simpleNameCS = (SimpleNameCS) dtParser.getSym(3);
+ CSTNode result = createIteratorExpCS(source, simpleNameCS, (VariableCS) dtParser.getSym(5), null, (OCLExpressionCS) dtParser.getSym(7));
+ setOffsets(result, source, getIToken(dtParser.getToken(8)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 162: orExpCS ::= orExpCS or andExpCS
+ // Rule 144: IteratorExpCS ::= primaryExpCS -> iteratorNameCS (
+ // VariableDeclarationCS , VariableDeclarationCS | OclExpressionCS )
//
- case 162:
-
+ case 144: {
+
+ OCLExpressionCS source = (OCLExpressionCS) dtParser.getSym(1);
+ SimpleNameCS simpleNameCS = (SimpleNameCS) dtParser.getSym(3);
+ CSTNode result = createIteratorExpCS(source, simpleNameCS, (VariableCS) dtParser.getSym(5), (VariableCS) dtParser.getSym(7), (OCLExpressionCS) dtParser.getSym(9));
+ setOffsets(result, source, getIToken(dtParser.getToken(10)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 163: orLetCS ::= orExpCS or andLetCS
+ // Rule 149: LetExpCS ::= let variableDeclarationListCS in
+ // OclExpressionCS
//
- case 163:
-
+ case 149: {
+
+ OCLExpressionCS expr = (OCLExpressionCS) dtParser.getSym(4);
+ CSTNode result = createLetExpCS((EList) dtParser.getSym(2), expr);
+ setOffsets(result, getIToken(dtParser.getToken(1)), expr);
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 166: andExpCS ::= andExpCS and equalityExpCS
+ // Rule 154: impliesExpCS ::= impliesExpCS implies xorExpCS
//
- case 166:
-
+ case 154:
+
//
- // Rule 167: andLetCS ::= andExpCS and equalityLetCS
+ // Rule 155: impliesLetCS ::= impliesExpCS implies xorLetCS
//
- case 167:
-
+ case 155:
+
//
- // Rule 170: equalityExpCS ::= equalityExpCS = relationalExpCS
+ // Rule 158: xorExpCS ::= xorExpCS xor orExpCS
//
- case 170:
-
+ case 158:
+
//
- // Rule 171: equalityLetCS ::= equalityExpCS = relationalLetCS
+ // Rule 159: xorLetCS ::= xorExpCS xor orLetCS
//
- case 171:
-
+ case 159:
+
//
- // Rule 172: equalityExpCS ::= equalityExpCS <> relationalExpCS
+ // Rule 162: orExpCS ::= orExpCS or andExpCS
//
- case 172:
-
+ case 162:
+
//
- // Rule 173: equalityLetCS ::= equalityExpCS <> relationalLetCS
+ // Rule 163: orLetCS ::= orExpCS or andLetCS
//
- case 173:
-
+ case 163:
+
//
- // Rule 176: relationalExpCS ::= relationalExpCS > additiveExpCS
+ // Rule 166: andExpCS ::= andExpCS and equalityExpCS
//
- case 176:
-
+ case 166:
+
//
- // Rule 177: relationalLetCS ::= relationalExpCS > additiveLetCS
+ // Rule 167: andLetCS ::= andExpCS and equalityLetCS
//
- case 177:
-
+ case 167:
+
//
- // Rule 178: relationalExpCS ::= relationalExpCS < additiveExpCS
+ // Rule 170: equalityExpCS ::= equalityExpCS = relationalExpCS
//
- case 178:
-
+ case 170:
+
//
- // Rule 179: relationalLetCS ::= relationalExpCS < additiveLetCS
+ // Rule 171: equalityLetCS ::= equalityExpCS = relationalLetCS
//
- case 179:
-
+ case 171:
+
//
- // Rule 180: relationalExpCS ::= relationalExpCS >= additiveExpCS
+ // Rule 172: equalityExpCS ::= equalityExpCS <> relationalExpCS
//
- case 180:
-
+ case 172:
+
//
- // Rule 181: relationalLetCS ::= relationalExpCS >= additiveLetCS
+ // Rule 173: equalityLetCS ::= equalityExpCS <> relationalLetCS
//
- case 181:
-
+ case 173:
+
//
- // Rule 182: relationalExpCS ::= relationalExpCS <= additiveExpCS
+ // Rule 176: relationalExpCS ::= relationalExpCS > additiveExpCS
//
- case 182:
-
+ case 176:
+
//
- // Rule 183: relationalLetCS ::= relationalExpCS <= additiveLetCS
+ // Rule 177: relationalLetCS ::= relationalExpCS > additiveLetCS
//
- case 183:
-
+ case 177:
+
//
- // Rule 186: additiveExpCS ::= additiveExpCS + multiplicativeExpCS
+ // Rule 178: relationalExpCS ::= relationalExpCS < additiveExpCS
//
- case 186:
-
+ case 178:
+
//
- // Rule 187: additiveLetCS ::= additiveExpCS + multiplicativeLetCS
+ // Rule 179: relationalLetCS ::= relationalExpCS < additiveLetCS
//
- case 187:
-
+ case 179:
+
//
- // Rule 188: additiveExpCS ::= additiveExpCS - multiplicativeExpCS
+ // Rule 180: relationalExpCS ::= relationalExpCS >= additiveExpCS
//
- case 188:
-
+ case 180:
+
//
- // Rule 189: additiveLetCS ::= additiveExpCS - multiplicativeLetCS
+ // Rule 181: relationalLetCS ::= relationalExpCS >= additiveLetCS
//
- case 189:
-
+ case 181:
+
//
- // Rule 192: multiplicativeExpCS ::= multiplicativeExpCS * unaryExpCS
+ // Rule 182: relationalExpCS ::= relationalExpCS <= additiveExpCS
//
- case 192:
-
+ case 182:
+
//
- // Rule 193: multiplicativeLetCS ::= multiplicativeExpCS * unaryLetCS
+ // Rule 183: relationalLetCS ::= relationalExpCS <= additiveLetCS
//
- case 193:
-
+ case 183:
+
//
- // Rule 194: multiplicativeExpCS ::= multiplicativeExpCS / unaryExpCS
+ // Rule 186: additiveExpCS ::= additiveExpCS + multiplicativeExpCS
//
- case 194:
-
+ case 186:
+
//
- // Rule 195: multiplicativeLetCS ::= multiplicativeExpCS / unaryLetCS
+ // Rule 187: additiveLetCS ::= additiveExpCS + multiplicativeLetCS
//
- case 195: {
-
- SimpleNameCS simpleNameCS = createSimpleNameCS(
- SimpleTypeEnum.STRING_LITERAL,
- getTokenText(dtParser.getToken(2))
- );
- setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
- OCLExpressionCS left = (OCLExpressionCS)dtParser.getSym(1);
- OCLExpressionCS right = (OCLExpressionCS)dtParser.getSym(3);
- EList args = new BasicEList();
- args.add(right);
- CSTNode result = createOperationCallExpCS(
- left,
- simpleNameCS,
- args
- );
- setOffsets(result, left, right);
- dtParser.setSym1(result);
- break;
- }
-
+ case 187:
+
//
- // Rule 198: unaryExpCS ::= - unaryExpCS
+ // Rule 188: additiveExpCS ::= additiveExpCS - multiplicativeExpCS
//
- case 198:
-
+ case 188:
+
//
- // Rule 199: unaryLetCS ::= - unaryLetCS
+ // Rule 189: additiveLetCS ::= additiveExpCS - multiplicativeLetCS
//
- case 199:
-
+ case 189:
+
//
- // Rule 200: unaryExpCS ::= not unaryExpCS
+ // Rule 192: multiplicativeExpCS ::= multiplicativeExpCS *
+ // unaryExpCS
//
- case 200:
-
+ case 192:
+
//
- // Rule 201: unaryLetCS ::= not unaryLetCS
+ // Rule 193: multiplicativeLetCS ::= multiplicativeExpCS *
+ // unaryLetCS
//
- case 201: {
-
- SimpleNameCS simpleNameCS = createSimpleNameCS(
- SimpleTypeEnum.STRING_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(simpleNameCS, getIToken(dtParser.getToken(1)));
- OCLExpressionCS expr = (OCLExpressionCS)dtParser.getSym(2);
- CSTNode result = createOperationCallExpCS(
- expr,
- simpleNameCS,
- new BasicEList()
- );
- setOffsets(result, simpleNameCS, expr);
- dtParser.setSym1(result);
- break;
- }
-
+ case 193:
+
//
- // Rule 205: primaryExpCS ::= ( OclExpressionCS )
+ // Rule 194: multiplicativeExpCS ::= multiplicativeExpCS /
+ // unaryExpCS
//
- case 205: {
-
- CSTNode result = (CSTNode)dtParser.getSym(2);
- if (result instanceof OperationCallExpCS) {
- ((OperationCallExpCS)result).setIsAtomic(true);
- }
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 208: declarator1 ::= IDENTIFIER : typeCS
- //
- case 208: {
-
- CSTNode result = createVariableCS(
- getTokenText(dtParser.getToken(1)),
- (TypeCS)dtParser.getSym(3),
- null
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(3));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 209: declarator1 ::= IDENTIFIER : typeCS = OclExpressionCS
- //
- case 209: {
-
- CSTNode result = createVariableCS(
- getTokenText(dtParser.getToken(1)),
- (TypeCS)dtParser.getSym(3),
- (OCLExpressionCS)dtParser.getSym(5)
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(5));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 210: declarator1 ::= IDENTIFIER : typeCS := OclExpressionCS
- //
- case 210: {
-
- CSTNode result = createVariableCS(
- getTokenText(dtParser.getToken(1)),
- (TypeCS)dtParser.getSym(3),
- (OCLExpressionCS)dtParser.getSym(5)
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(5));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 211: declarator2 ::= IDENTIFIER := OclExpressionCS
- //
- case 211: {
-
- CSTNode result = createVariableCS(
- getTokenText(dtParser.getToken(1)),
- null,
- (OCLExpressionCS)dtParser.getSym(3)
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(3));
- dtParser.setSym1(result);
- break;
- }
-
+ case 194:
+
//
- // Rule 212: letExpSubCS3 ::= variableNameCS = OclExpressionCS
+ // Rule 195: multiplicativeLetCS ::= multiplicativeExpCS /
+ // unaryLetCS
//
- case 212: {
-
- SimpleNameCS name = (SimpleNameCS)dtParser.getSym(1);
- OCLExpressionCS initExpression = (OCLExpressionCS)dtParser.getSym(3);
- VariableCS variableCS = createVariableCS(name, null, initExpression);
- setOffsets(variableCS, name, initExpression);
+ case 195: {
+
+ SimpleNameCS simpleNameCS = createSimpleNameCS(SimpleTypeEnum.STRING_LITERAL, getTokenText(dtParser.getToken(2)));
+ setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
+ OCLExpressionCS left = (OCLExpressionCS) dtParser.getSym(1);
+ OCLExpressionCS right = (OCLExpressionCS) dtParser.getSym(3);
+ EList args = new BasicEList();
+ args.add(right);
+ CSTNode result = createOperationCallExpCS(left, simpleNameCS, args);
+ setOffsets(result, left, right);
+ dtParser.setSym1(result);
+ break;
+ }
- EList result = new BasicEList();
- result.add(variableCS);
- dtParser.setSym1(result);
- break;
- }
-
//
- // Rule 213: letExpSubCS3 ::= letExpSubCS3 , TupleLiteralPartCS
+ // Rule 198: unaryExpCS ::= - unaryExpCS
//
- case 213: {
-
- EList result = (EList)dtParser.getSym(1);
- result.add(dtParser.getSym(3));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 214: LetExpCS ::= let letExpSubCS3 in OclExpressionCS
- //
- case 214: {
-
- EList variables = (EList)dtParser.getSym(2);
- CSTNode result = createLetExpCS(
- variables,
- (OCLExpressionCS)dtParser.getSym(4)
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(4));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 215: LetExpCS ::= let letExpSubCS3 in qvtErrorToken
- //
- case 215: {
-
- EList variables = (EList)dtParser.getSym(2);
- CSTNode result = createLetExpCS(
- variables,
- createSimpleNameCS(SimpleTypeEnum.IDENTIFIER_LITERAL, "") //$NON-NLS-1$
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 198:
+
//
- // Rule 216: CallExpCS ::= . qvtErrorToken
+ // Rule 199: unaryLetCS ::= - unaryLetCS
//
- case 216: {
-
- CallExpCS result = TempFactory.eINSTANCE.createErrorCallExpCS();
- result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 199:
+
//
- // Rule 217: CallExpCS ::= -> qvtErrorToken
+ // Rule 200: unaryExpCS ::= not unaryExpCS
//
- case 217: {
-
- CallExpCS result = TempFactory.eINSTANCE.createErrorCallExpCS();
- result.setAccessor(DotOrArrowEnum.ARROW_LITERAL);
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 218: argumentsCS ::= qvtErrorToken
- //
- case 218:
- dtParser.setSym1(new BasicEList());
- break;
-
- //
- // Rule 220: IteratorExpCS ::= primaryExpCS -> iteratorNameCS ( qvtErrorToken
- //
- case 220: {
-
- OCLExpressionCS source = (OCLExpressionCS)dtParser.getSym(1);
- SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(3);
- CSTNode result = createIteratorExpCS(
- source,
- simpleNameCS,
- null,
- null,
- null
- );
- setOffsets(result, source, getIToken(dtParser.getToken(4)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 200:
+
//
- // Rule 221: qvtErrorToken ::= ERROR_TOKEN
+ // Rule 201: unaryLetCS ::= not unaryLetCS
//
- case 221: {
-
- diagnozeErrorToken(dtParser.getToken(1));
- break;
- }
-
- //
- // Rule 222: equalityExpCS ::= equalityExpCS != relationalExpCS
- //
- case 222:
-
- //
- // Rule 223: equalityLetCS ::= equalityExpCS != relationalLetCS
- //
- case 223: {
-
- SimpleNameCS simpleNameCS = createSimpleNameCS(
- SimpleTypeEnum.STRING_LITERAL,
- OCLStandardLibraryUtil.getOperationName(PredefinedType.NOT_EQUAL)
- );
- setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
- EList args = new BasicEList();
- args.add(dtParser.getSym(3));
- CSTNode result = createOperationCallExpCS(
- (OCLExpressionCS)dtParser.getSym(1),
- simpleNameCS,
- args
- );
- setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 224: StringLiteralExpCS ::= StringLiteralExpCS STRING_LITERAL
- //
- case 224: {
-
- IToken literalToken = getIToken(dtParser.getToken(2));
- StringLiteralExpCS result = (StringLiteralExpCS) dtParser.getSym(1);
- result.setSymbol(result.getSymbol() + literalToken.toString());
- result.setStringSymbol(result.getStringSymbol() + literalToken.toString());
- result.setUnescapedStringSymbol(result.getUnescapedStringSymbol() + unescape(literalToken));
- int tokenLine = literalToken.getLine();
- setOffsets(result, result, literalToken);
- IToken prevToken = getParseStream().getTokenAt(literalToken.getTokenIndex() - 1);
- int prevTokenLine = prevToken.getLine();
- if (prevTokenLine == tokenLine) {
- reportError(lpg.lpgjavaruntime.ParseErrorCodes.INVALID_CODE, "", prevToken.getTokenIndex(), literalToken.getTokenIndex(), "Multiline string literals must be located in different lines!"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- dtParser.setSym1(result);
- break;
- }
-
+ case 201: {
+
+ SimpleNameCS simpleNameCS = createSimpleNameCS(SimpleTypeEnum.STRING_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(simpleNameCS, getIToken(dtParser.getToken(1)));
+ OCLExpressionCS expr = (OCLExpressionCS) dtParser.getSym(2);
+ CSTNode result = createOperationCallExpCS(expr, simpleNameCS, new BasicEList());
+ setOffsets(result, simpleNameCS, expr);
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 226: listTypeCS ::= List ( typeCS )
+ // Rule 205: primaryExpCS ::= ( OclExpressionCS )
//
- case 226: {
-
- CSTNode result = createListTypeCS(
- (TypeCS)dtParser.getSym(3)
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
- dtParser.setSym1(result);
- break;
+ case 205: {
+
+ CSTNode result = (CSTNode) dtParser.getSym(2);
+ if (result instanceof OperationCallExpCS) {
+ ((OperationCallExpCS) result).setIsAtomic(true);
}
-
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 227: listLiteralCS ::= List { CollectionLiteralPartsCSopt }
+ // Rule 208: declarator1 ::= IDENTIFIER : typeCS
//
- case 227: {
-
- CSTNode result = createListLiteralExpCS((EList)dtParser.getSym(3));
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 208: {
+
+ CSTNode result = createVariableCS(getTokenText(dtParser.getToken(1)), (TypeCS) dtParser.getSym(3), null);
+ setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode) dtParser.getSym(3));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 229: dictTypeCS ::= Dict ( typeCS , typeCS )
+ // Rule 209: declarator1 ::= IDENTIFIER : typeCS = OclExpressionCS
//
- case 229: {
-
- CSTNode result = createDictTypeCS((TypeCS)dtParser.getSym(3), (TypeCS)dtParser.getSym(5));
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(6)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 209: {
+
+ CSTNode result = createVariableCS(getTokenText(dtParser.getToken(1)), (TypeCS) dtParser.getSym(3), (OCLExpressionCS) dtParser.getSym(5));
+ setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode) dtParser.getSym(5));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 230: dictLiteralCS ::= Dict { dictLiteralPartListCSopt }
+ // Rule 210: declarator1 ::= IDENTIFIER : typeCS := OclExpressionCS
//
- case 230: {
-
- CSTNode result = createDictLiteralExpCS((EList<DictLiteralPartCS>)dtParser.getSym(3));
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 210: {
+
+ CSTNode result = createVariableCS(getTokenText(dtParser.getToken(1)), (TypeCS) dtParser.getSym(3), (OCLExpressionCS) dtParser.getSym(5));
+ setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode) dtParser.getSym(5));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 235: dictLiteralPartCS ::= literalSimpleCS = OclExpressionCS
+ // Rule 211: declarator2 ::= IDENTIFIER := OclExpressionCS
//
- case 235: {
-
- CSTNode result = createDictLiteralPartCS((LiteralExpCS)dtParser.getSym(1), (OCLExpressionCS)dtParser.getSym(3));
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
- dtParser.setSym1(result);
- break;
- }
-
+ case 211: {
+
+ CSTNode result = createVariableCS(getTokenText(dtParser.getToken(1)), null, (OCLExpressionCS) dtParser.getSym(3));
+ setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode) dtParser.getSym(3));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 237: dictLiteralPartListCSopt ::= $Empty
+ // Rule 212: letExpSubCS3 ::= variableNameCS = OclExpressionCS
//
- case 237:
- dtParser.setSym1(new BasicEList());
- break;
-
+ case 212: {
+
+ SimpleNameCS name = (SimpleNameCS) dtParser.getSym(1);
+ OCLExpressionCS initExpression = (OCLExpressionCS) dtParser.getSym(3);
+ VariableCS variableCS = createVariableCS(name, null, initExpression);
+ setOffsets(variableCS, name, initExpression);
+
+ EList result = new BasicEList();
+ result.add(variableCS);
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 238: dictLiteralPartListCS ::= dictLiteralPartCS
+ // Rule 213: letExpSubCS3 ::= letExpSubCS3 , TupleLiteralPartCS
//
- case 238: {
-
- EList result = new BasicEList();
- result.add(dtParser.getSym(1));
- dtParser.setSym1(result);
- break;
- }
-
+ case 213: {
+
+ EList result = (EList) dtParser.getSym(1);
+ result.add(dtParser.getSym(3));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 239: dictLiteralPartListCS ::= dictLiteralPartListCS , dictLiteralPartCS
+ // Rule 214: LetExpCS ::= let letExpSubCS3 in OclExpressionCS
//
- case 239: {
-
- EList result = (EList)dtParser.getSym(1);
- result.add(dtParser.getSym(3));
- dtParser.setSym1(result);
- break;
- }
-
+ case 214: {
+
+ EList variables = (EList) dtParser.getSym(2);
+ CSTNode result = createLetExpCS(variables, (OCLExpressionCS) dtParser.getSym(4));
+ setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode) dtParser.getSym(4));
+ dtParser.setSym1(result);
+ break;
+ }
+
//
- // Rule 240: dictLiteralPartListCS ::= dictLiteralPartListCS qvtErrorToken
+ // Rule 215: LetExpCS ::= let letExpSubCS3 in qvtErrorToken
//
- case 240: {
-
- EList result = (EList)dtParser.getSym(1);
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 242: IfExpCS ::= if OclExpressionCS then ifExpBodyCS else ifExpBodyCS endif
- //
- case 242: {
-
- CSTNode result = createIfExpCS(
- (OCLExpressionCS)dtParser.getSym(2),
- (OCLExpressionCS)dtParser.getSym(4),
- (OCLExpressionCS)dtParser.getSym(6)
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(7)));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 243: IfExpCS ::= if OclExpressionCS then ifExpBodyCS endif
- //
- case 243: {
-
- CSTNode result = createIfExpCS(
- (OCLExpressionCS)dtParser.getSym(2),
- (OCLExpressionCS)dtParser.getSym(4),
- null
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(5)));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 244: IfExpCS ::= if OclExpressionCS then ifExpBodyCS else ifExpBodyCS qvtErrorToken
- //
- case 244: {
-
- CSTNode result = createIfExpCS(
- (OCLExpressionCS)dtParser.getSym(2),
- (OCLExpressionCS)dtParser.getSym(4),
- (OCLExpressionCS)dtParser.getSym(6)
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(6));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 245: IfExpCS ::= if OclExpressionCS then ifExpBodyCS else qvtErrorToken
- //
- case 245: {
-
- CSTNode result = createIfExpCS(
- (OCLExpressionCS)dtParser.getSym(2),
- (OCLExpressionCS)dtParser.getSym(4),
- null
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(5)));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 246: IfExpCS ::= if OclExpressionCS then ifExpBodyCS qvtErrorToken
- //
- case 246: {
-
- CSTNode result = createIfExpCS(
- (OCLExpressionCS)dtParser.getSym(2),
- (OCLExpressionCS)dtParser.getSym(4),
- null
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(4));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 247: IfExpCS ::= if OclExpressionCS then qvtErrorToken
- //
- case 247: {
-
- CSTNode result = createIfExpCS(
- (OCLExpressionCS)dtParser.getSym(2),
- null,
- null
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 248: IfExpCS ::= if OclExpressionCS qvtErrorToken
- //
- case 248: {
-
- CSTNode result = createIfExpCS(
- (OCLExpressionCS)dtParser.getSym(2),
- null,
- null
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(2));
- dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 249: IfExpCS ::= if qvtErrorToken
- //
- case 249: {
-
- OCLExpressionCS invalidCondition = createInvalidLiteralExpCS(""); //$NON-NLS-1$
- invalidCondition.setStartOffset(getIToken(dtParser.getToken(1)).getEndOffset());
- invalidCondition.setEndOffset(getIToken(dtParser.getToken(1)).getEndOffset());
- CSTNode result = createIfExpCS(
- invalidCondition,
- null,
- null
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
+ case 215: {
+
+ EList variables = (EList) dtParser.getSym(2);
+ CSTNode result = createLetExpCS(variables, createSimpleNameCS(SimpleTypeEnum.IDENTIFIER_LITERAL, "") //$NON-NLS-1$
+ );
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 216: CallExpCS ::= . qvtErrorToken
+ //
+ case 216: {
+
+ CallExpCS result = TempFactory.eINSTANCE.createErrorCallExpCS();
+ result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 217: CallExpCS ::= -> qvtErrorToken
+ //
+ case 217: {
+
+ CallExpCS result = TempFactory.eINSTANCE.createErrorCallExpCS();
+ result.setAccessor(DotOrArrowEnum.ARROW_LITERAL);
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 218: argumentsCS ::= qvtErrorToken
+ //
+ case 218:
+ dtParser.setSym1(new BasicEList());
+ break;
+
+ //
+ // Rule 220: IteratorExpCS ::= primaryExpCS -> iteratorNameCS (
+ // qvtErrorToken
+ //
+ case 220: {
+
+ OCLExpressionCS source = (OCLExpressionCS) dtParser.getSym(1);
+ SimpleNameCS simpleNameCS = (SimpleNameCS) dtParser.getSym(3);
+ CSTNode result = createIteratorExpCS(source, simpleNameCS, null, null, null);
+ setOffsets(result, source, getIToken(dtParser.getToken(4)));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 221: qvtErrorToken ::= ERROR_TOKEN
+ //
+ case 221: {
+
+ diagnozeErrorToken(dtParser.getToken(1));
+ break;
+ }
+
+ //
+ // Rule 222: equalityExpCS ::= equalityExpCS != relationalExpCS
+ //
+ case 222:
+
+ //
+ // Rule 223: equalityLetCS ::= equalityExpCS != relationalLetCS
+ //
+ case 223: {
+
+ SimpleNameCS simpleNameCS = createSimpleNameCS(SimpleTypeEnum.STRING_LITERAL, OCLStandardLibraryUtil.getOperationName(PredefinedType.NOT_EQUAL));
+ setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
+ EList args = new BasicEList();
+ args.add(dtParser.getSym(3));
+ CSTNode result = createOperationCallExpCS((OCLExpressionCS) dtParser.getSym(1), simpleNameCS, args);
+ setOffsets(result, (CSTNode) dtParser.getSym(1), (CSTNode) dtParser.getSym(3));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 224: StringLiteralExpCS ::= StringLiteralExpCS
+ // STRING_LITERAL
+ //
+ case 224: {
+
+ IToken literalToken = getIToken(dtParser.getToken(2));
+ StringLiteralExpCS result = (StringLiteralExpCS) dtParser.getSym(1);
+ result.setSymbol(result.getSymbol() + literalToken.toString());
+ result.setStringSymbol(result.getStringSymbol() + literalToken.toString());
+ result.setUnescapedStringSymbol(result.getUnescapedStringSymbol() + unescape(literalToken));
+ int tokenLine = literalToken.getLine();
+ setOffsets(result, result, literalToken);
+ IToken prevToken = getParseStream().getTokenAt(literalToken.getTokenIndex() - 1);
+ int prevTokenLine = prevToken.getLine();
+ if (prevTokenLine == tokenLine) {
+ reportError(lpg.lpgjavaruntime.ParseErrorCodes.INVALID_CODE,
+ "", prevToken.getTokenIndex(), literalToken.getTokenIndex(), "Multiline string literals must be located in different lines!"); //$NON-NLS-1$ //$NON-NLS-2$
}
-
- //
- // Rule 250: IterateExpCS ::= primaryExpCS -> imperativeIterateExpCS
- //
- case 250: {
-
- OCLExpressionCS source = (OCLExpressionCS)dtParser.getSym(1);
- ImperativeIterateExpCS iterateExpCS = (ImperativeIterateExpCS) dtParser.getSym(3);
- iterateExpCS.setSource(source);
- setOffsets(iterateExpCS, source, iterateExpCS);
- dtParser.setSym1(iterateExpCS);
- break;
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 226: listTypeCS ::= List ( typeCS )
+ //
+ case 226: {
+
+ CSTNode result = createListTypeCS((TypeCS) dtParser.getSym(3));
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 227: listLiteralCS ::= List { CollectionLiteralPartsCSopt }
+ //
+ case 227: {
+
+ CSTNode result = createListLiteralExpCS((EList) dtParser.getSym(3));
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 229: dictTypeCS ::= Dict ( typeCS , typeCS )
+ //
+ case 229: {
+
+ CSTNode result = createDictTypeCS((TypeCS) dtParser.getSym(3), (TypeCS) dtParser.getSym(5));
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(6)));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 230: dictLiteralCS ::= Dict { dictLiteralPartListCSopt }
+ //
+ case 230: {
+
+ CSTNode result = createDictLiteralExpCS((EList<DictLiteralPartCS>) dtParser.getSym(3));
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 235: dictLiteralPartCS ::= literalSimpleCS = OclExpressionCS
+ //
+ case 235: {
+
+ CSTNode result = createDictLiteralPartCS((LiteralExpCS) dtParser.getSym(1), (OCLExpressionCS) dtParser.getSym(3));
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 237: dictLiteralPartListCSopt ::= $Empty
+ //
+ case 237:
+ dtParser.setSym1(new BasicEList());
+ break;
+
+ //
+ // Rule 238: dictLiteralPartListCS ::= dictLiteralPartCS
+ //
+ case 238: {
+
+ EList result = new BasicEList();
+ result.add(dtParser.getSym(1));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 239: dictLiteralPartListCS ::= dictLiteralPartListCS ,
+ // dictLiteralPartCS
+ //
+ case 239: {
+
+ EList result = (EList) dtParser.getSym(1);
+ result.add(dtParser.getSym(3));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 240: dictLiteralPartListCS ::= dictLiteralPartListCS
+ // qvtErrorToken
+ //
+ case 240: {
+
+ EList result = (EList) dtParser.getSym(1);
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 242: IfExpCS ::= if OclExpressionCS then ifExpBodyCS else
+ // ifExpBodyCS endif
+ //
+ case 242: {
+
+ CSTNode result = createIfExpCS((OCLExpressionCS) dtParser.getSym(2), (OCLExpressionCS) dtParser.getSym(4), (OCLExpressionCS) dtParser.getSym(6));
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(7)));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 243: IfExpCS ::= if OclExpressionCS then ifExpBodyCS endif
+ //
+ case 243: {
+
+ CSTNode result = createIfExpCS((OCLExpressionCS) dtParser.getSym(2), (OCLExpressionCS) dtParser.getSym(4), null);
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(5)));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 244: IfExpCS ::= if OclExpressionCS then ifExpBodyCS else
+ // ifExpBodyCS qvtErrorToken
+ //
+ case 244: {
+
+ CSTNode result = createIfExpCS((OCLExpressionCS) dtParser.getSym(2), (OCLExpressionCS) dtParser.getSym(4), (OCLExpressionCS) dtParser.getSym(6));
+ setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode) dtParser.getSym(6));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 245: IfExpCS ::= if OclExpressionCS then ifExpBodyCS else
+ // qvtErrorToken
+ //
+ case 245: {
+
+ CSTNode result = createIfExpCS((OCLExpressionCS) dtParser.getSym(2), (OCLExpressionCS) dtParser.getSym(4), null);
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(5)));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 246: IfExpCS ::= if OclExpressionCS then ifExpBodyCS
+ // qvtErrorToken
+ //
+ case 246: {
+
+ CSTNode result = createIfExpCS((OCLExpressionCS) dtParser.getSym(2), (OCLExpressionCS) dtParser.getSym(4), null);
+ setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode) dtParser.getSym(4));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 247: IfExpCS ::= if OclExpressionCS then qvtErrorToken
+ //
+ case 247: {
+
+ CSTNode result = createIfExpCS((OCLExpressionCS) dtParser.getSym(2), null, null);
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 248: IfExpCS ::= if OclExpressionCS qvtErrorToken
+ //
+ case 248: {
+
+ CSTNode result = createIfExpCS((OCLExpressionCS) dtParser.getSym(2), null, null);
+ setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode) dtParser.getSym(2));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 249: IfExpCS ::= if qvtErrorToken
+ //
+ case 249: {
+
+ OCLExpressionCS invalidCondition = createInvalidLiteralExpCS(""); //$NON-NLS-1$
+ invalidCondition.setStartOffset(getIToken(dtParser.getToken(1)).getEndOffset());
+ invalidCondition.setEndOffset(getIToken(dtParser.getToken(1)).getEndOffset());
+ CSTNode result = createIfExpCS(invalidCondition, null, null);
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 250: IterateExpCS ::= primaryExpCS -> imperativeIterateExpCS
+ //
+ case 250: {
+
+ OCLExpressionCS source = (OCLExpressionCS) dtParser.getSym(1);
+ ImperativeIterateExpCS iterateExpCS = (ImperativeIterateExpCS) dtParser.getSym(3);
+ iterateExpCS.setSource(source);
+ setOffsets(iterateExpCS, source, iterateExpCS);
+ dtParser.setSym1(iterateExpCS);
+ break;
+ }
+
+ //
+ // Rule 259: imperativeIterateExpCS ::=
+ // imperativeIteratorExpCSToken12 ( imperativeIterContents12 )
+ //
+ case 259:
+
+ //
+ // Rule 260: imperativeIterateExpCS ::=
+ // imperativeIteratorExpCSToken3 ( imperativeIterContents3 )
+ //
+ case 260: {
+
+ String opCode = getTokenText(dtParser.getToken(1));
+ SimpleNameCS simpleNameCS = createSimpleNameCS(SimpleTypeEnum.KEYWORD_LITERAL, opCode);
+ setOffsets(simpleNameCS, getIToken(dtParser.getToken(1)));
+ Object[] iterContents = (Object[]) dtParser.getSym(3);
+ OCLExpressionCS bodyCS = null;
+ OCLExpressionCS conditionCS = null;
+ if ("xcollect".equals(opCode) || "collectOne".equals(opCode)) { //$NON-NLS-1$ //$NON-NLS-2$
+ bodyCS = (OCLExpressionCS) iterContents[2];
+ } else {
+ conditionCS = (OCLExpressionCS) iterContents[2];
}
-
- //
- // Rule 259: imperativeIterateExpCS ::= imperativeIteratorExpCSToken12 ( imperativeIterContents12 )
- //
- case 259:
-
- //
- // Rule 260: imperativeIterateExpCS ::= imperativeIteratorExpCSToken3 ( imperativeIterContents3 )
- //
- case 260: {
-
- String opCode = getTokenText(dtParser.getToken(1));
- SimpleNameCS simpleNameCS = createSimpleNameCS(
- SimpleTypeEnum.KEYWORD_LITERAL,
- opCode
- );
- setOffsets(simpleNameCS, getIToken(dtParser.getToken(1)));
- Object[] iterContents = (Object[]) dtParser.getSym(3);
- OCLExpressionCS bodyCS = null;
- OCLExpressionCS conditionCS = null;
- if ("xcollect".equals(opCode) || "collectOne".equals(opCode)) { //$NON-NLS-1$ //$NON-NLS-2$
- bodyCS = (OCLExpressionCS) iterContents[2];
- } else {
- conditionCS = (OCLExpressionCS) iterContents[2];
+ CSTNode result = createImperativeIterateExpCS(simpleNameCS, (EList<VariableCS>) iterContents[0], (VariableCS) iterContents[1], bodyCS, conditionCS);
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 261: imperativeIterateExpCS ::= imperativeIteratorExpCSToken
+ // qvtErrorToken
+ //
+ case 261: {
+
+ SimpleNameCS simpleNameCS = createSimpleNameCS(SimpleTypeEnum.KEYWORD_LITERAL, getTokenText(dtParser.getToken(1)));
+ setOffsets(simpleNameCS, getIToken(dtParser.getToken(1)));
+ CSTNode result = createImperativeIterateExpCS(simpleNameCS, ourEmptyEList, null, null, null);
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 262: imperativeIterContents12 ::= OclExpressionCS
+ //
+ case 262: {
+
+ dtParser.setSym1(new Object[] { ourEmptyEList, null, dtParser.getSym(1) });
+ break;
+ }
+
+ //
+ // Rule 263: imperativeIterContents12 ::= variableDeclarationListCS
+ // | OclExpressionCS
+ //
+ case 263: {
+
+ dtParser.setSym1(new Object[] { dtParser.getSym(1), null, dtParser.getSym(3) });
+ break;
+ }
+
+ //
+ // Rule 264: imperativeIterContents3 ::= variableDeclarationListCS ;
+ // TupleLiteralPartCS | OclExpressionCS
+ //
+ case 264: {
+
+ dtParser.setSym1(new Object[] { dtParser.getSym(1), dtParser.getSym(3), dtParser.getSym(5) });
+ break;
+ }
+
+ //
+ // Rule 265: exclamationOpt ::= $Empty
+ //
+ case 265:
+ dtParser.setSym1(null);
+ break;
+
+ //
+ // Rule 267: declarator_vsep ::= IDENTIFIER |
+ //
+ case 267: {
+
+ CSTNode result = createVariableCS(getTokenText(dtParser.getToken(1)), null, null);
+ setOffsets(result, getIToken(dtParser.getToken(1)));
+ dtParser.setSym1(result);
+ break;
+ }
+
+ //
+ // Rule 268: declarator_vsepOpt ::= $Empty
+ //
+ case 268:
+ dtParser.setSym1(null);
+ break;
+
+ //
+ // Rule 270: IterateExpCS ::= primaryExpCS exclamationOpt [
+ // declarator_vsepOpt OclExpressionCS ]
+ //
+ case 270: {
+
+ OCLExpressionCS source = (OCLExpressionCS) dtParser.getSym(1);
+ if (source instanceof ImperativeIterateExpCS) {
+ String opCode = isTokenOfType(getIToken(dtParser.getToken(2)), XpandParsersym.TK_EXCLAMATION_MARK) ? "collectselectOne" : "collectselect"; //$NON-NLS-1$ //$NON-NLS-2$
+ SimpleNameCS simpleNameCS = createSimpleNameCS(SimpleTypeEnum.KEYWORD_LITERAL, opCode);
+ setOffsets(simpleNameCS, getIToken(dtParser.getToken(3)), getIToken(dtParser.getToken(6)));
+
+ ImperativeIterateExpCS result = (ImperativeIterateExpCS) source;
+ result.setSimpleNameCS(simpleNameCS);
+
+ VariableCS variableCS = (VariableCS) dtParser.getSym(4);
+ if (variableCS != null) {
+ result.setTarget(variableCS);
}
- CSTNode result = createImperativeIterateExpCS(
- simpleNameCS,
- (EList<VariableCS>)iterContents[0],
- (VariableCS)iterContents[1],
- bodyCS,
- conditionCS
- );
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
+ result.setCondition((OCLExpressionCS) dtParser.getSym(5));
+
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(6)));
dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 261: imperativeIterateExpCS ::= imperativeIteratorExpCSToken qvtErrorToken
- //
- case 261: {
-
- SimpleNameCS simpleNameCS = createSimpleNameCS(
- SimpleTypeEnum.KEYWORD_LITERAL,
- getTokenText(dtParser.getToken(1))
- );
- setOffsets(simpleNameCS, getIToken(dtParser.getToken(1)));
- CSTNode result = createImperativeIterateExpCS(
- simpleNameCS,
- ourEmptyEList,
- null,
- null,
- null
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
+ } else {
+ String opCode = isTokenOfType(getIToken(dtParser.getToken(2)), XpandParsersym.TK_EXCLAMATION_MARK) ? "selectOne" : "xselect"; //$NON-NLS-1$ //$NON-NLS-2$
+ SimpleNameCS simpleNameCS = createSimpleNameCS(SimpleTypeEnum.KEYWORD_LITERAL, opCode);
+ setOffsets(simpleNameCS, getIToken(dtParser.getToken(3)), getIToken(dtParser.getToken(6)));
+
+ CallExpCS result = createImperativeIterateExpCS(simpleNameCS, ourEmptyEList, (VariableCS) dtParser.getSym(4), null, (OCLExpressionCS) dtParser.getSym(5));
+ result.setSource(source);
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(6)));
dtParser.setSym1(result);
- break;
- }
-
- //
- // Rule 262: imperativeIterContents12 ::= OclExpressionCS
- //
- case 262: {
-
- dtParser.setSym1(new Object[] {
- ourEmptyEList,
- null,
- dtParser.getSym(1)
- });
- break;
- }
-
- //
- // Rule 263: imperativeIterContents12 ::= variableDeclarationListCS | OclExpressionCS
- //
- case 263: {
-
- dtParser.setSym1(new Object[] {
- dtParser.getSym(1),
- null,
- dtParser.getSym(3)
- });
- break;
- }
-
- //
- // Rule 264: imperativeIterContents3 ::= variableDeclarationListCS ; TupleLiteralPartCS | OclExpressionCS
- //
- case 264: {
-
- dtParser.setSym1(new Object[] {
- dtParser.getSym(1),
- dtParser.getSym(3),
- dtParser.getSym(5)
- });
- break;
- }
-
- //
- // Rule 265: exclamationOpt ::= $Empty
- //
- case 265:
- dtParser.setSym1(null);
- break;
-
- //
- // Rule 267: declarator_vsep ::= IDENTIFIER |
- //
- case 267: {
-
- CSTNode result = createVariableCS(
- getTokenText(dtParser.getToken(1)),
- null,
- null
- );
- setOffsets(result, getIToken(dtParser.getToken(1)));
- dtParser.setSym1(result);
- break;
}
-
- //
- // Rule 268: declarator_vsepOpt ::= $Empty
- //
- case 268:
- dtParser.setSym1(null);
- break;
-
- //
- // Rule 270: IterateExpCS ::= primaryExpCS exclamationOpt [ declarator_vsepOpt OclExpressionCS ]
- //
- case 270: {
-
- OCLExpressionCS source = (OCLExpressionCS)dtParser.getSym(1);
- if (source instanceof ImperativeIterateExpCS) {
- String opCode = isTokenOfType(getIToken(dtParser.getToken(2)), XpandParsersym.TK_EXCLAMATION_MARK) ? "collectselectOne" : "collectselect"; //$NON-NLS-1$ //$NON-NLS-2$
- SimpleNameCS simpleNameCS = createSimpleNameCS(
- SimpleTypeEnum.KEYWORD_LITERAL,
- opCode
- );
- setOffsets(simpleNameCS, getIToken(dtParser.getToken(3)), getIToken(dtParser.getToken(6)));
-
- ImperativeIterateExpCS result = (ImperativeIterateExpCS) source;
- result.setSimpleNameCS(simpleNameCS);
-
- VariableCS variableCS = (VariableCS) dtParser.getSym(4);
- if (variableCS != null) {
- result.setTarget(variableCS);
- }
- result.setCondition((OCLExpressionCS) dtParser.getSym(5));
-
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(6)));
- dtParser.setSym1(result);
+ break;
}
- else {
- String opCode = isTokenOfType(getIToken(dtParser.getToken(2)), XpandParsersym.TK_EXCLAMATION_MARK) ? "selectOne" : "xselect"; //$NON-NLS-1$ //$NON-NLS-2$
- SimpleNameCS simpleNameCS = createSimpleNameCS(
- SimpleTypeEnum.KEYWORD_LITERAL,
- opCode
- );
- setOffsets(simpleNameCS, getIToken(dtParser.getToken(3)), getIToken(dtParser.getToken(6)));
-
- CallExpCS result = createImperativeIterateExpCS(
- simpleNameCS,
- ourEmptyEList,
- (VariableCS) dtParser.getSym(4),
- null,
- (OCLExpressionCS) dtParser.getSym(5)
- );
- result.setSource(source);
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(6)));
+
+ //
+ // Rule 271: IterateExpCS ::= primaryExpCS ->
+ // notReservedSimpleNameCS
+ //
+ case 271: {
+
+ String opCode = "xcollect"; //$NON-NLS-1$
+ SimpleNameCS simpleNameCS = createSimpleNameCS(SimpleTypeEnum.KEYWORD_LITERAL, opCode);
+
+ OCLExpressionCS source = (OCLExpressionCS) dtParser.getSym(1);
+ SimpleNameCS featureNameCS = (SimpleNameCS) dtParser.getSym(3);
+ OCLExpressionCS featureCallExpCS = createFeatureCallExpCS(source, null, featureNameCS, new BasicEList(), null);
+ setOffsets(featureCallExpCS, source, featureNameCS);
+
+ ImperativeIterateExpCS result = createImperativeIterateExpCS(simpleNameCS, ourEmptyEList, null, null, null);
+ result.setSource(featureCallExpCS);
+ setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
dtParser.setSym1(result);
+ break;
}
- break;
- }
-
- //
- // Rule 271: IterateExpCS ::= primaryExpCS -> notReservedSimpleNameCS
- //
- case 271: {
-
- String opCode = "xcollect"; //$NON-NLS-1$
- SimpleNameCS simpleNameCS = createSimpleNameCS(
- SimpleTypeEnum.KEYWORD_LITERAL,
- opCode
- );
-
- OCLExpressionCS source = (OCLExpressionCS)dtParser.getSym(1);
- SimpleNameCS featureNameCS = (SimpleNameCS)dtParser.getSym(3);
- OCLExpressionCS featureCallExpCS = createFeatureCallExpCS(
- source,
- null,
- featureNameCS,
- new BasicEList(),
- null
- );
- setOffsets(featureCallExpCS, source, featureNameCS);
-
- ImperativeIterateExpCS result = createImperativeIterateExpCS(
- simpleNameCS,
- ourEmptyEList,
- null,
- null,
- null
- );
- result.setSource(featureCallExpCS);
- setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
- dtParser.setSym1(result);
- break;
- }
-
+
//
- // Rule 272: primaryExpCS ::= break
+ // Rule 272: primaryExpCS ::= break
//
- case 272: {
-
+ case 272: {
+
OCLExpressionCS result = createBreakCS();
setOffsets(result, getIToken(dtParser.getToken(1)));
dtParser.setSym1(result);
- break;
- }
-
+ break;
+ }
+
//
- // Rule 273: primaryExpCS ::= continue
+ // Rule 273: primaryExpCS ::= continue
//
- case 273: {
-
+ case 273: {
+
OCLExpressionCS result = createContinueCS();
setOffsets(result, getIToken(dtParser.getToken(1)));
dtParser.setSym1(result);
- break;
+ break;
+ }
+
+ //
+ // Rule 274: template ::= emptyTemplate
+ //
+ case 274: {
+
+ setResult(xpandFactory.createTemplate(Collections.EMPTY_LIST, Collections.EMPTY_LIST, Collections.EMPTY_LIST, Collections.EMPTY_LIST, getRightIToken()));
+ break;
+ }
+ //
+ // Rule 277: template ::= LG commentTextPairAny imports
+ // extensionImports defineOrAroundSeq
+ //
+ case 277: {
+
+ List imports = (List) getRhsSym(3);
+ List extensionImports = (List) getRhsSym(4);
+ List defineOrAround = (List) getRhsSym(5);
+ List<Advice> advices = new LinkedList<Advice>();
+ List<Definition> defines = new LinkedList<Definition>();
+ for (Object o : defineOrAround) {
+ if (o instanceof Definition) {
+ defines.add((Definition) o);
+ } else if (o instanceof Advice) {
+ advices.add((Advice) o);
+ } else {
+ throw new IllegalStateException();// assert false?
+ }
}
-
- //
- // Rule 274: template ::= emptyTemplate
- //
- case 274: {
-
- setResult(xpandFactory.createTemplate(Collections.EMPTY_LIST, Collections.EMPTY_LIST, Collections.EMPTY_LIST, Collections.EMPTY_LIST, getRightIToken()));
- break;
- }
- //
- // Rule 277: template ::= LG commentTextPairAny imports extensionImports defineOrAroundSeq
- //
- case 277: {
-
- List imports = (List) getRhsSym(3);
- List extensionImports = (List) getRhsSym(4);
- List defineOrAround = (List) getRhsSym(5);
- List<Advice> advices = new LinkedList<Advice>();
- List<Definition> defines = new LinkedList<Definition>();
- for (Object o : defineOrAround) {
- if (o instanceof Definition) {
- defines.add((Definition) o);
- } else if (o instanceof Advice) {
- advices.add((Advice) o);
- } else {
- throw new IllegalStateException();// assert false?
+ setResult(xpandFactory.createTemplate(imports, extensionImports, defines, advices, getRightIToken()));
+ break;
+ }
+ //
+ // Rule 278: defineOrAroundSeq ::= define TEXT commentTextPairAny
+ // defineOrAroundSuffix
+ //
+ case 278: {
+
+ List result = new LinkedList();
+ result.add(getRhsSym(1));
+ result.addAll((List) getRhsSym(4));
+ setResult(result);
+ break;
+ }
+ //
+ // Rule 279: defineOrAroundSeq ::= around TEXT commentTextPairAny
+ // defineOrAroundSuffix
+ //
+ case 279: {
+
+ List result = new LinkedList();
+ result.add(getRhsSym(1));
+ result.addAll((List) getRhsSym(4));
+ setResult(result);
+ break;
+ }
+ //
+ // Rule 280: defineOrAroundSuffix ::= $Empty
+ //
+ case 280: {
+
+ setResult(Collections.EMPTY_LIST);
+ break;
+ }
+ //
+ // Rule 284: imports ::= $Empty
+ //
+ case 284: {
+
+ setResult(Collections.EMPTY_LIST);
+ break;
+ }
+ //
+ // Rule 285: imports ::= anImport imports
+ //
+ case 285: {
+
+ List res = new LinkedList();
+ res.add(getRhsSym(1));
+ res.addAll((List) getRhsSym(2));
+ setResult(res);
+ break;
+ }
+ //
+ // Rule 286: anImport ::= IMPORT StringLiteralExpCS TEXT
+ // commentTextPairAny
+ //
+ case 286: {
+
+ setResult(xpandFactory.createNamespaceImport(getLeftIToken(), (StringLiteralExpCS) getRhsSym(2)));
+ break;
+ }
+ //
+ // Rule 287: extensionImports ::= $Empty
+ //
+ case 287: {
+
+ setResult(Collections.EMPTY_LIST);
+ break;
+ }
+ //
+ // Rule 288: extensionImports ::= anExtensionImport extensionImports
+ //
+ case 288: {
+
+ List res = new LinkedList();
+ res.add(getRhsSym(1));
+ res.addAll((List) getRhsSym(2));
+ setResult(res);
+ break;
+ }
+ //
+ // Rule 289: anExtensionImport ::= EXTENSION pathNameCS TEXT
+ // commentTextPairAny
+ //
+ case 289: {
+
+ setResult(xpandFactory.createImportDeclaration(getLeftIToken(), (PathNameCS) getRhsSym(2)));
+ break;
+ }
+ //
+ // Rule 290: around ::= AROUND pointcut FOR typeCS sequence
+ // ENDAROUND
+ //
+ case 290: {
+
+ setResult(xpandFactory.createAround(getLeftIToken(), getRightIToken(), (Identifier) getRhsSym(2), Collections.<VariableCS> emptyList(), false, (TypeCS) getRhsSym(4), (List) getRhsSym(5)));
+ break;
+ }
+ //
+ // Rule 291: around ::= AROUND pointcut LPAREN parametersList RPAREN
+ // FOR typeCS sequence ENDAROUND
+ //
+ case 291: {
+
+ setResult(xpandFactory.createAround(getLeftIToken(), getRightIToken(), (Identifier) getRhsSym(2), (List<VariableCS>) getRhsSym(4), false, (TypeCS) getRhsSym(7), (List) getRhsSym(8)));
+ break;
+ }
+ //
+ // Rule 292: around ::= AROUND pointcut LPAREN parametersList COMMA
+ // MULTIPLY RPAREN FOR typeCS sequence ENDAROUND
+ //
+ case 292: {
+
+ setResult(xpandFactory.createAround(getLeftIToken(), getRightIToken(), (Identifier) getRhsSym(2), (List<VariableCS>) getRhsSym(4), true, (TypeCS) getRhsSym(9), (List) getRhsSym(10)));
+ break;
+ }
+ //
+ // Rule 293: around ::= AROUND pointcut LPAREN MULTIPLY RPAREN FOR
+ // typeCS sequence ENDAROUND
+ //
+ case 293: {
+
+ setResult(xpandFactory.createAround(getLeftIToken(), getRightIToken(), (Identifier) getRhsSym(2), Collections.<VariableCS> emptyList(), true, (TypeCS) getRhsSym(7), (List) getRhsSym(8)));
+ break;
+ }
+ //
+ // Rule 294: pointcut ::= MULTIPLY pointcutSuffix
+ //
+ case 294: {
+
+ // FIXME: may use SimpleNameCS here, though need more sophisticated
+ // code to update end position
+ // SimpleNameCS simpleNameCS =
+ // createSimpleNameCS(SimpleTypeEnum.IDENTIFIER_LITERAL,
+ // getTokenText(getRhsTokenIndex(1)));
+ // setOffsets(simpleNameCS, getLeftIToken());
+ Identifier res = xpandFactory.createIdentifier(getLeftIToken());
+ if (getRhsSym(2) != null) {
+ res = res.append((Identifier) getRhsSym(2));
}
+ setResult(res);
+ break;
}
- setResult(xpandFactory.createTemplate(imports, extensionImports, defines, advices, getRightIToken()));
- break;
- }
- //
- // Rule 278: defineOrAroundSeq ::= define TEXT commentTextPairAny defineOrAroundSuffix
- //
- case 278: {
-
- List result = new LinkedList();
- result.add(getRhsSym(1));
- result.addAll((List) getRhsSym(4));
- setResult(result);
- break;
- }
- //
- // Rule 279: defineOrAroundSeq ::= around TEXT commentTextPairAny defineOrAroundSuffix
- //
- case 279: {
-
- List result = new LinkedList();
- result.add(getRhsSym(1));
- result.addAll((List) getRhsSym(4));
- setResult(result);
- break;
- }
- //
- // Rule 280: defineOrAroundSuffix ::= $Empty
- //
- case 280: {
-
- setResult(Collections.EMPTY_LIST);
- break;
- }
- //
- // Rule 284: imports ::= $Empty
- //
- case 284: {
-
- setResult(Collections.EMPTY_LIST);
- break;
- }
- //
- // Rule 285: imports ::= anImport imports
- //
- case 285: {
-
- List res = new LinkedList();
- res.add(getRhsSym(1));
- res.addAll((List) getRhsSym(2));
- setResult(res);
- break;
- }
- //
- // Rule 286: anImport ::= IMPORT StringLiteralExpCS TEXT commentTextPairAny
- //
- case 286: {
-
- setResult(xpandFactory.createNamespaceImport(getLeftIToken(), (StringLiteralExpCS) getRhsSym(2)));
- break;
- }
- //
- // Rule 287: extensionImports ::= $Empty
- //
- case 287: {
-
- setResult(Collections.EMPTY_LIST);
- break;
- }
- //
- // Rule 288: extensionImports ::= anExtensionImport extensionImports
- //
- case 288: {
-
- List res = new LinkedList();
- res.add(getRhsSym(1));
- res.addAll((List) getRhsSym(2));
- setResult(res);
- break;
- }
- //
- // Rule 289: anExtensionImport ::= EXTENSION pathNameCS TEXT commentTextPairAny
- //
- case 289: {
-
- setResult(xpandFactory.createImportDeclaration(getLeftIToken(), (PathNameCS) getRhsSym(2)));
- break;
- }
- //
- // Rule 290: around ::= AROUND pointcut FOR typeCS sequence ENDAROUND
- //
- case 290: {
-
- setResult(xpandFactory.createAround(getLeftIToken(), getRightIToken(), (Identifier) getRhsSym(2), Collections.<VariableCS>emptyList(), false, (TypeCS) getRhsSym(4), (List) getRhsSym(5)));
- break;
- }
- //
- // Rule 291: around ::= AROUND pointcut LPAREN parametersList RPAREN FOR typeCS sequence ENDAROUND
- //
- case 291: {
-
- setResult(xpandFactory.createAround(getLeftIToken(), getRightIToken(), (Identifier) getRhsSym(2), (List<VariableCS>) getRhsSym(4), false, (TypeCS) getRhsSym(7), (List) getRhsSym(8)));
- break;
- }
- //
- // Rule 292: around ::= AROUND pointcut LPAREN parametersList COMMA MULTIPLY RPAREN FOR typeCS sequence ENDAROUND
- //
- case 292: {
-
- setResult(xpandFactory.createAround(getLeftIToken(), getRightIToken(), (Identifier) getRhsSym(2), (List<VariableCS>) getRhsSym(4), true, (TypeCS) getRhsSym(9), (List) getRhsSym(10)));
- break;
- }
- //
- // Rule 293: around ::= AROUND pointcut LPAREN MULTIPLY RPAREN FOR typeCS sequence ENDAROUND
- //
- case 293: {
-
- setResult(xpandFactory.createAround(getLeftIToken(), getRightIToken(), (Identifier) getRhsSym(2), Collections.<VariableCS>emptyList(), true, (TypeCS) getRhsSym(7), (List) getRhsSym(8)));
- break;
- }
- //
- // Rule 294: pointcut ::= MULTIPLY pointcutSuffix
- //
- case 294: {
-
-// FIXME: may use SimpleNameCS here, though need more sophisticated code to update end position
-// SimpleNameCS simpleNameCS = createSimpleNameCS(SimpleTypeEnum.IDENTIFIER_LITERAL, getTokenText(getRhsTokenIndex(1)));
-// setOffsets(simpleNameCS, getLeftIToken());
- Identifier res = xpandFactory.createIdentifier(getLeftIToken());
- if (getRhsSym(2) != null) {
- res = res.append((Identifier) getRhsSym(2));
- }
- setResult(res);
- break;
- }
- //
- // Rule 295: pointcut ::= IDENTIFIER pointcutSuffix
- //
- case 295: {
-
- Identifier res = xpandFactory.createIdentifier(getLeftIToken());
- if (getRhsSym(2) != null) {
- res = res.append((Identifier) getRhsSym(2));
- }
- setResult(res);
- break;
- }
- //
- // Rule 296: pointcutSuffix ::= $Empty
- //
- case 296: {
-
- setResult(null);
- break;
- }
- //
- // Rule 298: pointcutSuffix ::= COLONCOLON pointcutSuffix
- //
- case 298: {
-
- Identifier res = xpandFactory.createIdentifier(getLeftIToken());
- if (getRhsSym(2) != null) {
- res = res.append((Identifier) getRhsSym(2));
- }
- setResult(res);
- break;
- }
- //
- // Rule 299: define ::= DEFINE IDENTIFIER FOR typeCS sequence ENDDEFINE
- //
- case 299: {
-
- setResult(xpandFactory.createDefinition(getLeftIToken(), getRightIToken(), getRhsIToken(2), Collections.<VariableCS>emptyList(), (TypeCS) getRhsSym(4), (List) getRhsSym(5)));
- break;
- }
- //
- // Rule 300: define ::= DEFINE IDENTIFIER LPAREN parametersList RPAREN FOR typeCS sequence ENDDEFINE
- //
- case 300: {
-
- setResult(xpandFactory.createDefinition(getLeftIToken(), getRightIToken(), getRhsIToken(2), (List<VariableCS>) getRhsSym(4), (TypeCS) getRhsSym(7), (List) getRhsSym(8)));
- break;
- }
- //
- // Rule 301: parametersList ::= parameter
- //
- case 301: {
-
- VariableCS param = (VariableCS) getRhsSym(1);
- LinkedList res = new LinkedList();
- res.add(param);
- setResult(res);
- break;
- }
- //
- // Rule 302: parametersList ::= parametersList , parameter
- //
- case 302: {
-
- VariableCS param = (VariableCS) getRhsSym(3);
- LinkedList res = new LinkedList();
- res.addAll((List) getRhsSym(1));
- res.add(param);
- setResult(res);
- break;
- }
- //
- // Rule 304: parameter ::= typeCS IDENTIFIER
- //
- case 304: {
-
- VariableCS result = createVariableCS(getRhsIToken(2).toString(), (TypeCS) getRhsSym(1), null);
- setOffsets(result, (TypeCS) getRhsSym(1), getRhsIToken(2));
- setResult(result);
- break;
- }
- //
- // Rule 305: sequence ::= text sequenceSuffix
- //
- case 305: {
-
- List res = new LinkedList();
- res.addAll((List) getRhsSym(1));
- res.addAll((List) getRhsSym(2));
- setResult(res);
- break;
- }
- //
- // Rule 306: sequenceSuffix ::= $Empty
- //
- case 306: {
-
- setResult(Collections.EMPTY_LIST);
- break;
- }
- //
- // Rule 307: sequenceSuffix ::= statement text sequenceSuffix
- //
- case 307: {
-
- List res = new LinkedList();
- res.add(getRhsSym(1));
- res.addAll((List) getRhsSym(2));
- res.addAll((List) getRhsSym(3));
- setResult(res);
- break;
- }
- //
- // Rule 314: text ::= minusOpt TEXT textSuffix
- //
- case 314: {
-
- List res = new LinkedList();
- res.add(xpandFactory.createTextStatement(getRhsIToken(2), (IToken) getRhsSym(1)));
- res.addAll((List) getRhsSym(3));
- setResult(res);
- break;
- }
- //
- // Rule 315: textSuffix ::= $Empty
- //
- case 315: {
-
- setResult(Collections.EMPTY_LIST);
- break;
- }
- //
- // Rule 316: textSuffix ::= minusOpt TEXT textSuffix
- //
- case 316: {
-
- List res = new LinkedList();
- res.add(xpandFactory.createTextStatement(getRhsIToken(2), (IToken) getRhsSym(1)));
- res.addAll((List) getRhsSym(3));
- setResult(res);
- break;
- }
- //
- // Rule 317: minusOpt ::= $Empty
- //
- case 317: {
-
- setResult(null);
- break;
- }
- //
- // Rule 318: minusOpt ::= MINUS
- //
- case 318: {
-
- setResult(getLeftIToken());
- break;
- }
- //
- // Rule 322: errorStatement ::= ERROR OclExpressionCS
- //
- case 322: {
-
- setResult(xpandFactory.createErrorStatement(getLeftIToken(), (OCLExpressionCS) getRhsSym(2)));
- break;
- }
- //
- // Rule 323: expandStatement ::= EXPAND definitionName parameterListOpt
- //
- case 323: {
-
- setResult(xpandFactory.createExpandStatement(getLeftIToken(), (PathNameCS) getRhsSym(2), (List) getRhsSym(3), null, false, null));
- break;
- }
- //
- // Rule 324: expandStatement ::= EXPAND definitionName parameterListOpt FOR OclExpressionCS
- //
- case 324: {
-
- setResult(xpandFactory.createExpandStatement(getLeftIToken(), (PathNameCS) getRhsSym(2), (List) getRhsSym(3), (OCLExpressionCS) getRhsSym(5), false, null));
- break;
- }
- //
- // Rule 325: expandStatement ::= EXPAND definitionName parameterListOpt FOREACH OclExpressionCS separatorOpt
- //
- case 325: {
-
- setResult(xpandFactory.createExpandStatement(getLeftIToken(), (PathNameCS) getRhsSym(2), (List) getRhsSym(3), (OCLExpressionCS) getRhsSym(5), true, (OCLExpressionCS) getRhsSym(6)));
- break;
- }
- //
- // Rule 326: parameterListOpt ::= $Empty
- //
- case 326: {
-
- setResult(Collections.EMPTY_LIST);
- break;
- }
- //
- // Rule 327: parameterListOpt ::= LPAREN argumentsCS RPAREN
- //
- case 327: {
-
- setResult(getRhsSym(2));
- break;
- }
- //
- // Rule 329: expressionStmt ::= OclExpressionCS
- //
- case 329: {
-
- // XXX OCL CST doesn't keep track of line numbers, but we use them (perhaps, might refactor to stop using?)
- int lineNumber = getLeftIToken().getLine();
- setResult(xpandFactory.createExpressionStatement((OCLExpressionCS) getRhsSym(1), lineNumber));
- break;
- }
- //
- // Rule 330: fileStatement ::= FILE OclExpressionCS identOpt sequence ENDFILE
- //
- case 330: {
-
- setResult(xpandFactory.createFileStatement(getLeftIToken(), getRightIToken(), (OCLExpressionCS) getRhsSym(2), (Identifier) getRhsSym(3), (List) getRhsSym(4)));
- break;
- }
- //
- // Rule 331: identOpt ::= $Empty
- //
- case 331: {
-
- setResult(null);
- break;
- }
- //
- // Rule 332: identOpt ::= IDENTIFIER
- //
- case 332: {
-
- setResult(xpandFactory.createIdentifier(getLeftIToken()));
- break;
- }
- //
- // Rule 333: foreachStatement ::= FOREACH OclExpressionCS AS IDENTIFIER iteratorOpt separatorOpt sequence ENDFOREACH
- //
- case 333: {
-
- setResult(xpandFactory.createForEachStatement(getLeftIToken(), getRightIToken(), (OCLExpressionCS) getRhsSym(2), getRhsIToken(4), (OCLExpressionCS) getRhsSym(6), (IToken) getRhsSym(5), (List) getRhsSym(7)));
- break;
- }
- //
- // Rule 334: iteratorOpt ::= $Empty
- //
- case 334: {
-
- setResult(null);
- break;
- }
- //
- // Rule 335: iteratorOpt ::= ITERATOR IDENTIFIER
- //
- case 335: {
-
- setResult(getRightIToken());
- break;
- }
- //
- // Rule 336: separatorOpt ::= $Empty
- //
- case 336: {
-
- setResult(null);
- break;
- }
- //
- // Rule 337: separatorOpt ::= SEPARATOR OclExpressionCS
- //
- case 337: {
-
- setResult(getRhsSym(2));
- break;
- }
- //
- // Rule 338: ifStatement ::= IF OclExpressionCS sequence elseifAny elseOpt ENDIF
- //
- case 338: {
-
- IfStatement i = xpandFactory.createIfStatement(getLeftIToken(), (OCLExpressionCS) getRhsSym(2), (List) getRhsSym(3), null);
- IfStatement elseIf = (IfStatement) getRhsSym(4);
- IfStatement elseStmt = (IfStatement) getRhsSym(5);
- if (elseIf != null) {
- i.setElseIf(elseIf);
- IfStatement curElseIf = elseIf;
- // get the latest one in the chain
- while (curElseIf.getElseIf() != null) {
- curElseIf = curElseIf.getElseIf();
+ //
+ // Rule 295: pointcut ::= IDENTIFIER pointcutSuffix
+ //
+ case 295: {
+
+ Identifier res = xpandFactory.createIdentifier(getLeftIToken());
+ if (getRhsSym(2) != null) {
+ res = res.append((Identifier) getRhsSym(2));
}
- curElseIf.setElseIf(elseStmt);
- } else {
- i.setElseIf(elseStmt);
+ setResult(res);
+ break;
}
- setResult(i);
- break;
- }
//
- // Rule 339: elseifAny ::= $Empty
+ // Rule 296: pointcutSuffix ::= $Empty
//
- case 339: {
-
- setResult(null);
- break;
- }
+ case 296: {
+
+ setResult(null);
+ break;
+ }
//
- // Rule 340: elseifAny ::= ELSEIF OclExpressionCS sequence elseifAny
+ // Rule 298: pointcutSuffix ::= COLONCOLON pointcutSuffix
//
- case 340: {
-
- IfStatement elseIf = xpandFactory.createIfStatement(getLeftIToken(), (OCLExpressionCS) getRhsSym(2), (List) getRhsSym(3), null);
- IfStatement restElseIf = (IfStatement) getRhsSym(4);
- elseIf.setElseIf(restElseIf);
- setResult(elseIf);
- break;
- }
+ case 298: {
+
+ Identifier res = xpandFactory.createIdentifier(getLeftIToken());
+ if (getRhsSym(2) != null) {
+ res = res.append((Identifier) getRhsSym(2));
+ }
+ setResult(res);
+ break;
+ }
//
- // Rule 341: elseOpt ::= $Empty
+ // Rule 299: define ::= DEFINE IDENTIFIER FOR typeCS sequence
+ // ENDDEFINE
//
- case 341: {
-
- setResult(null);
- break;
- }
+ case 299: {
+
+ setResult(xpandFactory.createDefinition(getLeftIToken(), getRightIToken(), getRhsIToken(2), Collections.<VariableCS> emptyList(), (TypeCS) getRhsSym(4), (List) getRhsSym(5)));
+ break;
+ }
//
- // Rule 342: elseOpt ::= ELSE sequence
+ // Rule 300: define ::= DEFINE IDENTIFIER LPAREN parametersList
+ // RPAREN FOR typeCS sequence ENDDEFINE
//
- case 342: {
-
- setResult(xpandFactory.createIfStatement(getLeftIToken(), null, (List) getRhsSym(2), null));
- break;
- }
+ case 300: {
+
+ setResult(xpandFactory.createDefinition(getLeftIToken(), getRightIToken(), getRhsIToken(2), (List<VariableCS>) getRhsSym(4), (TypeCS) getRhsSym(7), (List) getRhsSym(8)));
+ break;
+ }
//
- // Rule 343: letStatement ::= LET OclExpressionCS AS IDENTIFIER sequence ENDLET
+ // Rule 301: parametersList ::= parameter
//
- case 343: {
-
- setResult(xpandFactory.createLetStatement(getLeftIToken(), getRightIToken(), (OCLExpressionCS) getRhsSym(2), getRhsIToken(4), (List) getRhsSym(5)));
- break;
- }
+ case 301: {
+
+ VariableCS param = (VariableCS) getRhsSym(1);
+ LinkedList res = new LinkedList();
+ res.add(param);
+ setResult(res);
+ break;
+ }
+ //
+ // Rule 302: parametersList ::= parametersList , parameter
+ //
+ case 302: {
+
+ VariableCS param = (VariableCS) getRhsSym(3);
+ LinkedList res = new LinkedList();
+ res.addAll((List) getRhsSym(1));
+ res.add(param);
+ setResult(res);
+ break;
+ }
//
- // Rule 344: protectStatement ::= PROTECT CSTART OclExpressionCS CEND OclExpressionCS ID OclExpressionCS disabledOpt sequence ENDPROTECT
+ // Rule 304: parameter ::= typeCS IDENTIFIER
//
- case 344: {
-
- setResult(xpandFactory.createProtectStatement(getLeftIToken(), getRightIToken(), (OCLExpressionCS) getRhsSym(3), (OCLExpressionCS) getRhsSym(5), (OCLExpressionCS) getRhsSym(7), (IToken) getRhsSym(8), (List) getRhsSym(9)));
- break;
- }
+ case 304: {
+
+ VariableCS result = createVariableCS(getRhsIToken(2).toString(), (TypeCS) getRhsSym(1), null);
+ setOffsets(result, (TypeCS) getRhsSym(1), getRhsIToken(2));
+ setResult(result);
+ break;
+ }
//
- // Rule 345: disabledOpt ::= $Empty
+ // Rule 305: sequence ::= text sequenceSuffix
//
- case 345: {
-
- setResult(null);
- break;
- }
+ case 305: {
+
+ List res = new LinkedList();
+ res.addAll((List) getRhsSym(1));
+ res.addAll((List) getRhsSym(2));
+ setResult(res);
+ break;
+ }
//
- // Rule 346: disabledOpt ::= DISABLE
+ // Rule 306: sequenceSuffix ::= $Empty
//
- case 346: {
-
- setResult(getLeftIToken());
- break;
+ case 306: {
+
+ setResult(Collections.EMPTY_LIST);
+ break;
+ }
+ //
+ // Rule 307: sequenceSuffix ::= statement text sequenceSuffix
+ //
+ case 307: {
+
+ List res = new LinkedList();
+ res.add(getRhsSym(1));
+ res.addAll((List) getRhsSym(2));
+ res.addAll((List) getRhsSym(3));
+ setResult(res);
+ break;
+ }
+ //
+ // Rule 314: text ::= minusOpt TEXT textSuffix
+ //
+ case 314: {
+
+ List res = new LinkedList();
+ res.add(xpandFactory.createTextStatement(getRhsIToken(2), (IToken) getRhsSym(1)));
+ res.addAll((List) getRhsSym(3));
+ setResult(res);
+ break;
+ }
+ //
+ // Rule 315: textSuffix ::= $Empty
+ //
+ case 315: {
+
+ setResult(Collections.EMPTY_LIST);
+ break;
+ }
+ //
+ // Rule 316: textSuffix ::= minusOpt TEXT textSuffix
+ //
+ case 316: {
+
+ List res = new LinkedList();
+ res.add(xpandFactory.createTextStatement(getRhsIToken(2), (IToken) getRhsSym(1)));
+ res.addAll((List) getRhsSym(3));
+ setResult(res);
+ break;
+ }
+ //
+ // Rule 317: minusOpt ::= $Empty
+ //
+ case 317: {
+
+ setResult(null);
+ break;
+ }
+ //
+ // Rule 318: minusOpt ::= MINUS
+ //
+ case 318: {
+
+ setResult(getLeftIToken());
+ break;
+ }
+ //
+ // Rule 322: errorStatement ::= ERROR OclExpressionCS
+ //
+ case 322: {
+
+ setResult(xpandFactory.createErrorStatement(getLeftIToken(), (OCLExpressionCS) getRhsSym(2)));
+ break;
+ }
+ //
+ // Rule 323: expandStatement ::= EXPAND definitionName
+ // parameterListOpt
+ //
+ case 323: {
+
+ setResult(xpandFactory.createExpandStatement(getLeftIToken(), (PathNameCS) getRhsSym(2), (List) getRhsSym(3), null, false, null));
+ break;
+ }
+ //
+ // Rule 324: expandStatement ::= EXPAND definitionName
+ // parameterListOpt FOR OclExpressionCS
+ //
+ case 324: {
+
+ setResult(xpandFactory.createExpandStatement(getLeftIToken(), (PathNameCS) getRhsSym(2), (List) getRhsSym(3), (OCLExpressionCS) getRhsSym(5), false, null));
+ break;
+ }
+ //
+ // Rule 325: expandStatement ::= EXPAND definitionName
+ // parameterListOpt FOREACH OclExpressionCS separatorOpt
+ //
+ case 325: {
+
+ setResult(xpandFactory.createExpandStatement(getLeftIToken(), (PathNameCS) getRhsSym(2), (List) getRhsSym(3), (OCLExpressionCS) getRhsSym(5), true, (OCLExpressionCS) getRhsSym(6)));
+ break;
+ }
+ //
+ // Rule 326: parameterListOpt ::= $Empty
+ //
+ case 326: {
+
+ setResult(Collections.EMPTY_LIST);
+ break;
+ }
+ //
+ // Rule 327: parameterListOpt ::= LPAREN argumentsCS RPAREN
+ //
+ case 327: {
+
+ setResult(getRhsSym(2));
+ break;
+ }
+ //
+ // Rule 329: expressionStmt ::= OclExpressionCS
+ //
+ case 329: {
+
+ // XXX OCL CST doesn't keep track of line numbers, but we use them
+ // (perhaps, might refactor to stop using?)
+ int lineNumber = getLeftIToken().getLine();
+ setResult(xpandFactory.createExpressionStatement((OCLExpressionCS) getRhsSym(1), lineNumber));
+ break;
+ }
+ //
+ // Rule 330: fileStatement ::= FILE OclExpressionCS identOpt
+ // sequence ENDFILE
+ //
+ case 330: {
+
+ setResult(xpandFactory.createFileStatement(getLeftIToken(), getRightIToken(), (OCLExpressionCS) getRhsSym(2), (Identifier) getRhsSym(3), (List) getRhsSym(4)));
+ break;
+ }
+ //
+ // Rule 331: identOpt ::= $Empty
+ //
+ case 331: {
+
+ setResult(null);
+ break;
+ }
+ //
+ // Rule 332: identOpt ::= IDENTIFIER
+ //
+ case 332: {
+
+ setResult(xpandFactory.createIdentifier(getLeftIToken()));
+ break;
+ }
+ //
+ // Rule 333: foreachStatement ::= FOREACH OclExpressionCS AS
+ // IDENTIFIER iteratorOpt separatorOpt sequence ENDFOREACH
+ //
+ case 333: {
+
+ setResult(xpandFactory.createForEachStatement(getLeftIToken(), getRightIToken(), (OCLExpressionCS) getRhsSym(2), getRhsIToken(4), (OCLExpressionCS) getRhsSym(6), (IToken) getRhsSym(5),
+ (List) getRhsSym(7)));
+ break;
+ }
+ //
+ // Rule 334: iteratorOpt ::= $Empty
+ //
+ case 334: {
+
+ setResult(null);
+ break;
+ }
+ //
+ // Rule 335: iteratorOpt ::= ITERATOR IDENTIFIER
+ //
+ case 335: {
+
+ setResult(getRightIToken());
+ break;
+ }
+ //
+ // Rule 336: separatorOpt ::= $Empty
+ //
+ case 336: {
+
+ setResult(null);
+ break;
+ }
+ //
+ // Rule 337: separatorOpt ::= SEPARATOR OclExpressionCS
+ //
+ case 337: {
+
+ setResult(getRhsSym(2));
+ break;
+ }
+ //
+ // Rule 338: ifStatement ::= IF OclExpressionCS sequence elseifAny
+ // elseOpt ENDIF
+ //
+ case 338: {
+
+ IfStatement i = xpandFactory.createIfStatement(getLeftIToken(), (OCLExpressionCS) getRhsSym(2), (List) getRhsSym(3), null);
+ IfStatement elseIf = (IfStatement) getRhsSym(4);
+ IfStatement elseStmt = (IfStatement) getRhsSym(5);
+ if (elseIf != null) {
+ i.setElseIf(elseIf);
+ IfStatement curElseIf = elseIf;
+ // get the latest one in the chain
+ while (curElseIf.getElseIf() != null) {
+ curElseIf = curElseIf.getElseIf();
+ }
+ curElseIf.setElseIf(elseStmt);
+ } else {
+ i.setElseIf(elseStmt);
}
-
- default:
- break;
+ setResult(i);
+ break;
+ }
+ //
+ // Rule 339: elseifAny ::= $Empty
+ //
+ case 339: {
+
+ setResult(null);
+ break;
+ }
+ //
+ // Rule 340: elseifAny ::= ELSEIF OclExpressionCS sequence elseifAny
+ //
+ case 340: {
+
+ IfStatement elseIf = xpandFactory.createIfStatement(getLeftIToken(), (OCLExpressionCS) getRhsSym(2), (List) getRhsSym(3), null);
+ IfStatement restElseIf = (IfStatement) getRhsSym(4);
+ elseIf.setElseIf(restElseIf);
+ setResult(elseIf);
+ break;
+ }
+ //
+ // Rule 341: elseOpt ::= $Empty
+ //
+ case 341: {
+
+ setResult(null);
+ break;
+ }
+ //
+ // Rule 342: elseOpt ::= ELSE sequence
+ //
+ case 342: {
+
+ setResult(xpandFactory.createIfStatement(getLeftIToken(), null, (List) getRhsSym(2), null));
+ break;
+ }
+ //
+ // Rule 343: letStatement ::= LET OclExpressionCS AS IDENTIFIER
+ // sequence ENDLET
+ //
+ case 343: {
+
+ setResult(xpandFactory.createLetStatement(getLeftIToken(), getRightIToken(), (OCLExpressionCS) getRhsSym(2), getRhsIToken(4), (List) getRhsSym(5)));
+ break;
+ }
+ //
+ // Rule 344: protectStatement ::= PROTECT CSTART OclExpressionCS
+ // CEND OclExpressionCS ID OclExpressionCS disabledOpt sequence
+ // ENDPROTECT
+ //
+ case 344: {
+
+ setResult(xpandFactory.createProtectStatement(getLeftIToken(), getRightIToken(), (OCLExpressionCS) getRhsSym(3), (OCLExpressionCS) getRhsSym(5), (OCLExpressionCS) getRhsSym(7),
+ (IToken) getRhsSym(8), (List) getRhsSym(9)));
+ break;
+ }
+ //
+ // Rule 345: disabledOpt ::= $Empty
+ //
+ case 345: {
+
+ setResult(null);
+ break;
+ }
+ //
+ // Rule 346: disabledOpt ::= DISABLE
+ //
+ case 346: {
+
+ setResult(getLeftIToken());
+ break;
+ }
+
+ default:
+ break;
}
return;
}
}
-

Back to the top