[242880] aigdalov cdamus - Cannot embed control characters in OCL Strings
diff --git a/plugins/org.eclipse.ocl/.settings/.api_filters b/plugins/org.eclipse.ocl/.settings/.api_filters
index 7508f40..ec124f8 100644
--- a/plugins/org.eclipse.ocl/.settings/.api_filters
+++ b/plugins/org.eclipse.ocl/.settings/.api_filters
@@ -1,13 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<component id="org.eclipse.ocl" version="2">
-<resource path="src/org/eclipse/ocl/cst/impl/ClassifierContextDeclCSImpl.java" type="org.eclipse.ocl.cst.impl.ClassifierContextDeclCSImpl">
-<filter id="338792546">
-<message_arguments>
-<message_argument value="org.eclipse.ocl.cst.impl.ClassifierContextDeclCSImpl"/>
-<message_argument value="basicSetInvOrDefCS(InvOrDefCS, NotificationChain)"/>
-</message_arguments>
-</filter>
-</resource>
<resource path="src/org/eclipse/ocl/parser/OCLParserprs.java" type="org.eclipse.ocl.parser.OCLParserprs">
<filter id="388194388">
<message_arguments>
@@ -101,6 +93,72 @@
</message_arguments>
</filter>
</resource>
+<resource path="src/org/eclipse/ocl/cst/impl/ClassifierContextDeclCSImpl.java" type="org.eclipse.ocl.cst.impl.ClassifierContextDeclCSImpl">
+<filter id="338792546">
+<message_arguments>
+<message_argument value="org.eclipse.ocl.cst.impl.ClassifierContextDeclCSImpl"/>
+<message_argument value="basicSetInvOrDefCS(InvOrDefCS, NotificationChain)"/>
+</message_arguments>
+</filter>
+</resource>
+<resource path="src/org/eclipse/ocl/parser/OCLLexerprs.java" type="org.eclipse.ocl.parser.OCLLexerprs">
+<filter id="388194388">
+<message_arguments>
+<message_argument value="org.eclipse.ocl.parser.OCLLexerprs"/>
+<message_argument value="NUM_RULES"/>
+<message_argument value="326"/>
+</message_arguments>
+</filter>
+<filter id="388194388">
+<message_arguments>
+<message_argument value="org.eclipse.ocl.parser.OCLLexerprs"/>
+<message_argument value="START_STATE"/>
+<message_argument value="327"/>
+</message_arguments>
+</filter>
+<filter id="388194388">
+<message_arguments>
+<message_argument value="org.eclipse.ocl.parser.OCLLexerprs"/>
+<message_argument value="ERROR_ACTION"/>
+<message_argument value="506"/>
+</message_arguments>
+</filter>
+<filter id="388194388">
+<message_arguments>
+<message_argument value="org.eclipse.ocl.parser.OCLLexerprs"/>
+<message_argument value="NUM_STATES"/>
+<message_argument value="49"/>
+</message_arguments>
+</filter>
+<filter id="388194388">
+<message_arguments>
+<message_argument value="org.eclipse.ocl.parser.OCLLexerprs"/>
+<message_argument value="LA_STATE_OFFSET"/>
+<message_argument value="832"/>
+</message_arguments>
+</filter>
+<filter id="388194388">
+<message_arguments>
+<message_argument value="org.eclipse.ocl.parser.OCLLexerprs"/>
+<message_argument value="ACCEPT_ACTION"/>
+<message_argument value="505"/>
+</message_arguments>
+</filter>
+<filter id="388194388">
+<message_arguments>
+<message_argument value="org.eclipse.ocl.parser.OCLLexerprs"/>
+<message_argument value="NUM_NONTERMINALS"/>
+<message_argument value="40"/>
+</message_arguments>
+</filter>
+<filter id="388194388">
+<message_arguments>
+<message_argument value="org.eclipse.ocl.parser.OCLLexerprs"/>
+<message_argument value="NUM_SYMBOLS"/>
+<message_argument value="143"/>
+</message_arguments>
+</filter>
+</resource>
<resource path="src/org/eclipse/ocl/parser/OCLParsersym.java" type="org.eclipse.ocl.parser.OCLParsersym">
<filter id="388194388">
<message_arguments>
@@ -133,13 +191,6 @@
<filter id="388194388">
<message_arguments>
<message_argument value="org.eclipse.ocl.parser.OCLParsersym"/>
-<message_argument value="TK_ATPRE"/>
-<message_argument value="72"/>
-</message_arguments>
-</filter>
-<filter id="388194388">
-<message_arguments>
-<message_argument value="org.eclipse.ocl.parser.OCLParsersym"/>
<message_argument value="TK_if"/>
<message_argument value="70"/>
</message_arguments>
@@ -147,8 +198,15 @@
<filter id="388194388">
<message_arguments>
<message_argument value="org.eclipse.ocl.parser.OCLParsersym"/>
-<message_argument value="TK_RPAREN"/>
-<message_argument value="2"/>
+<message_argument value="TK_ATPRE"/>
+<message_argument value="72"/>
+</message_arguments>
+</filter>
+<filter id="388194388">
+<message_arguments>
+<message_argument value="org.eclipse.ocl.parser.OCLParsersym"/>
+<message_argument value="TK_pre"/>
+<message_argument value="77"/>
</message_arguments>
</filter>
<filter id="388194388">
@@ -161,8 +219,8 @@
<filter id="388194388">
<message_arguments>
<message_argument value="org.eclipse.ocl.parser.OCLParsersym"/>
-<message_argument value="TK_pre"/>
-<message_argument value="77"/>
+<message_argument value="TK_RPAREN"/>
+<message_argument value="2"/>
</message_arguments>
</filter>
<filter id="388194388">
diff --git a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/internal/l10n/OCLMessages.java b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/internal/l10n/OCLMessages.java
index 4658e46..72db7a4 100644
--- a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/internal/l10n/OCLMessages.java
+++ b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/internal/l10n/OCLMessages.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005, 2008 IBM Corporation, Zeligsoft Inc., and others.
+ * Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,10 +11,11 @@
* IBM - Initial API and implementation
* E.D.Willink - Refactoring to support extensibility and flexible error handling
* Zeligsoft - Bug 253512
+ * Borland - Bug 242880
*
* </copyright>
*
- * $Id: OCLMessages.java,v 1.8 2008/11/12 15:38:23 cdamus Exp $
+ * $Id: OCLMessages.java,v 1.9 2009/02/12 00:04:09 cdamus Exp $
*/
package org.eclipse.ocl.internal.l10n;
@@ -241,6 +242,9 @@
public static String NonStd_CompareTo_;
public static String Ambig_AssocEnd_;
+
+ public static String StringNotProperlyClosed_ERROR;
+ public static String InvalidEscapeSequence_ERROR;
private static IMessages messagesImpl;
diff --git a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/internal/l10n/OCLMessages.properties b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/internal/l10n/OCLMessages.properties
index 0f9da84..68a3f1e 100644
--- a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/internal/l10n/OCLMessages.properties
+++ b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/internal/l10n/OCLMessages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2003, 2007 IBM Corporation and others.
+# Copyright (c) 2003, 2008 IBM Corporation, Borland Software Corp., and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -8,8 +8,9 @@
# Contributors:
# IBM Corporation - initial API and implementation
# E.D.Willink - Refactoring to support extensibility and flexible error handling
-#
-# $Id: OCLMessages.properties,v 1.8 2007/12/12 22:08:04 cdamus Exp $
+# Borland - Bug 242880
+#
+# $Id: OCLMessages.properties,v 1.9 2009/02/12 00:04:09 cdamus Exp $
#
###############################################################################
@@ -1331,4 +1332,15 @@
# Indicates usage of the Java convention for comparison via compareTo()
# operation instead of the OCL-standard <, >, <=, and >= operations.
#
-NonStd_CompareTo_ = Usage of non-standard interpolation of relational operators from "compareTo()" operation
\ No newline at end of file
+NonStd_CompareTo_ = Usage of non-standard interpolation of relational operators from "compareTo()" operation
+
+#
+# Indicates that a string literal is not properly closed, i.e. the
+# escape sequence start symbol is immediately followed by a trailing quote
+#
+StringNotProperlyClosed_ERROR = String literal not properly closed
+
+#
+# Indicates that a string literal contains an invalid escape sequence
+#
+InvalidEscapeSequence_ERROR = Invalid escape sequence (valid ones are \\b \\t \\n \\f \\r \\\" \\\' \\\\)
\ No newline at end of file
diff --git a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/options/ParsingOptions.java b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/options/ParsingOptions.java
index 3d63df2..16cbe5b 100644
--- a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/options/ParsingOptions.java
+++ b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/options/ParsingOptions.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * Copyright (c) 2007, 2009 IBM Corporation, Borland Software Corp., and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,10 +9,11 @@
*
* Contributors:
* IBM - Initial API and implementation
+ * Borland - Bug 242880
*
* </copyright>
*
- * $Id: ParsingOptions.java,v 1.4 2008/01/30 12:46:15 cdamus Exp $
+ * $Id: ParsingOptions.java,v 1.5 2009/02/12 00:04:09 cdamus Exp $
*/
package org.eclipse.ocl.options;
@@ -74,6 +75,22 @@
public static final Option<?> IMPLICIT_ROOT_CLASS =
new BasicOption<Object>("implict.root.class", null); //$NON-NLS-1$
+ /**
+ * <p>
+ * Parsing option indicating whether to process backslash escape sequences (
+ * <tt>\n</tt>, <tt>\r</tt>, etc.) the way it is done in Java or not to
+ * perform such processing to support backwards compatibility.
+ * </p>
+ * <p>
+ * The default value of this option is <tt>false</tt>. For enabling
+ * backslash escaping support, set this option <tt>true</tt>.
+ * </p>
+ *
+ * @since 1.3
+ */
+ public static final Option<Boolean> USE_BACKSLASH_ESCAPE_PROCESSING =
+ new BasicOption<Boolean>("use.backslash.escape.processing", false); //$NON-NLS-1$
+
/**
* <p>
* A parsing option specifying a class that's assumed to be the implicit
diff --git a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/AbstractOCLAnalyzer.java b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/AbstractOCLAnalyzer.java
index ecdb332..9570751 100644
--- a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/AbstractOCLAnalyzer.java
+++ b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/AbstractOCLAnalyzer.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc. and others.
+ * Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,10 +15,11 @@
* Zeligsoft - Bugs 243526, 243079, 245586 (merging and docs), 213886, 179990,
* 255599, 251349, 242236, 259740
* Nicolas Rouquette - Bug 259818 (regression)
+ * Borland - Bug 242880
*
* </copyright>
*
- * $Id: AbstractOCLAnalyzer.java,v 1.23 2009/01/15 19:09:28 cdamus Exp $
+ * $Id: AbstractOCLAnalyzer.java,v 1.24 2009/02/12 00:04:09 cdamus Exp $
*/
package org.eclipse.ocl.parser;
@@ -2980,13 +2981,7 @@
StringLiteralExp<C> astNode = oclFactory.createStringLiteralExp();
initASTMapping(env, astNode, stringLiteralExpCS);
- String stringLiteral = stringLiteralExpCS.getStringSymbol();
- if (stringLiteral.length() <= 2) {
- astNode.setStringSymbol("");//$NON-NLS-1$
- } else {
- astNode.setStringSymbol(processStringEscapes(stringLiteral
- .substring(1, stringLiteral.length() - 1)));
- }
+ astNode.setStringSymbol(stringLiteralExpCS.getStringSymbol());
astNode.setType(env.getOCLStandardLibrary().getString());
TRACE("stringLiteralExpCS", "String: " + stringLiteralExpCS.getSymbol());//$NON-NLS-2$//$NON-NLS-1$
@@ -2995,81 +2990,6 @@
}
/**
- * Processes escape sequences in string literals. Currently, only the
- * non-standard " '' " escape for single-quotes is supported.
- *
- * @param stringLiteral
- * a string literal
- *
- * @return the string, with any escape sequences converted
- */
- private String processStringEscapes(String stringLiteral) {
- String result = stringLiteral;
-
- int length = stringLiteral.length();
-
- for (int i = 0; i < length; i++) {
- // optimize for the case that there is no escape: don't create
- // any new string object or buffer unless we need one
- if (stringLiteral.charAt(i) == '\'') { // known BMP code point
- StringBuilder buf = new StringBuilder(length);
-
- // found an escape. Copy content up to this point
- buf.append(stringLiteral, 0, i);
-
- // continue processing to the end, appending to the buffer
- for (; i < length; i++) {
- char c = stringLiteral.charAt(i);
-
- if (c != '\'') { // known BMP code point
- buf.append(c);
- } else {
- i++; // next char
-
- if (i >= length) {
- // trailing single-quote is not an escape (although,
- // the lexer couldn't have parsed it, anyway)
- buf.append('\'');
- } else {
- c = stringLiteral.charAt(i);
-
- switch (c) {
- case '\'' : // known BMP code point
- // append the escaped single-quote
- buf.append('\'');
- break;
- default :
- // parser shouldn't have produced this
- buf.append('\''); // include the escape
- buf.append(c);
- break;
- }
- }
- }
- }
-
- result = buf.toString(); // convert the buffer
- }
- }
-
- if (!result.equals(stringLiteral)) {
- // 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.ANALYZER,
- OCLMessages.bind(OCLMessages.NonStd_SQuote_Escape_,
- stringLiteral), "stringLiteralExpCS", //$NON-NLS-1$
- null);
- }
- }
-
- return result;
- }
-
- /**
* BooleanLiteralExpCS
*
* @param booleanLiteralExpCS
diff --git a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/AbstractOCLParser.java b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/AbstractOCLParser.java
index f9f9f77..723bdfe 100644
--- a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/AbstractOCLParser.java
+++ b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/AbstractOCLParser.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
- * Copyright (c) 2005, 2008 IBM Corporation, Zeligsoft Inc., and others.
+ * Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,15 +12,18 @@
* E.D.Willink - refactored to separate from OCLAnalyzer and OCLParser
* - Bugs 243976, 259818
* Zeligsoft - Bugs 243976, 255599, 251349
+ * Borland - Bug 242880
*
* </copyright>
*
- * $Id: AbstractOCLParser.java,v 1.5 2009/01/13 19:44:29 cdamus Exp $
+ * $Id: AbstractOCLParser.java,v 1.6 2009/02/12 00:04:09 cdamus Exp $
*/
package org.eclipse.ocl.parser;
+import lpg.lpgjavaruntime.IToken;
import lpg.lpgjavaruntime.NullExportedSymbolsException;
import lpg.lpgjavaruntime.NullTerminalSymbolsException;
+import lpg.lpgjavaruntime.ParseErrorCodes;
import lpg.lpgjavaruntime.UndefinedEofSymbolException;
import lpg.lpgjavaruntime.UnimplementedTerminalsException;
@@ -76,13 +79,17 @@
import org.eclipse.ocl.cst.UnlimitedNaturalLiteralExpCS;
import org.eclipse.ocl.cst.VariableCS;
import org.eclipse.ocl.cst.VariableExpCS;
+import org.eclipse.ocl.internal.l10n.OCLMessages;
import org.eclipse.ocl.lpg.AbstractLexer;
import org.eclipse.ocl.lpg.AbstractParser;
import org.eclipse.ocl.lpg.BasicEnvironment;
+import org.eclipse.ocl.lpg.ProblemHandler;
+import org.eclipse.ocl.options.ParsingOptions;
+import org.eclipse.ocl.options.ProblemOption;
public abstract class AbstractOCLParser
extends AbstractParser {
-
+
public AbstractOCLParser(BasicEnvironment environment) {
super(environment);
}
@@ -113,7 +120,7 @@
+ OCLParsersym.orderedTerminalSymbols[OCLParserprs.EOFT_SYMBOL]);
}
}
-
+
protected PackageDeclarationCS createPackageDeclarationCS(
PathNameCS pathNameCS, EList<ContextDeclCS> contextDecls) {
PackageDeclarationCS result = CSTFactory.eINSTANCE
@@ -681,4 +688,171 @@
return result;
}
+
+ /**
+ * <p>
+ * Escaping support based on the QVT specification (8.4.3).
+ * </p>
+ * <p>
+ * All the usual escape characters using backslash can be used including the '\n' new-line character.
+ * The list of available escape characters are those defined for the Java language.
+ * <p>
+ * <p>
+ * EscapeSequence:
+ * </p>
+ * <table border="0" align="left">
+ * <tr><td><b><tt>\b</tt></b></td> <td><tt>\u0008</tt>: backspace <tt>BS</tt></td></tr>
+ * <tr><td><b><tt>\t</tt></b></td> <td><tt>\u0009</tt>: horizontal tab <tt>HT</tt></td></tr>
+ * <tr><td><b><tt>\n</tt></b></td> <td><tt>\u000a</tt>: line feed <tt>LF</tt></td></tr>
+ * <tr><td><b><tt>\f</tt></b></td> <td><tt>\u000c</tt>: form feed <tt>FF</tt></td></tr>
+ * <tr><td><b><tt>\r</tt></b></td> <td><tt>\u000d</tt>: carriage return <tt>CR</tt></td></tr>
+ * <tr><td><b><tt>\"</tt></b></td> <td><tt>\u0022</tt>: double quote <tt>"</tt></td></tr>
+ * <tr><td><b><tt>\'</tt></b></td> <td><tt>\u0027</tt>: single quote <tt>'</tt></td></tr>
+ * <tr><td><b><tt>\\</tt></b></td> <td><tt>\u005c</tt>: backslash <tt>\</tt></td></tr>
+ * <tr><td rowspan="2" valign="top"><b>OctalEscape</b></td> <td><tt>\u0000</tt> to <tt>\u00ff</tt>: from octal value</td></tr>
+ * <tr><td>\ ZeroToThree OctalDigit OctalDigit</td></tr>
+ * <tr><td><b>OctalDigit<b></td> <td><tt>0 1 2 3 4 5 6 7</tt></td></tr>
+ * <tr><td><b>ZeroToThree</b></td> <td><tt>0 1 2 3</tt></td></tr>
+ * </table>
+ *
+ * @param stringLiteral a string literal token with escape notation
+ * @return the unescaped string
+ *
+ * @since 1.3
+ */
+ protected String unescape(IToken stringLiteral) {
+ String rawString = stringLiteral.toString();
+ int rawStringLength = rawString.length();
+ if (rawStringLength <= 2) {
+ return ""; //$NON-NLS-1$
+ }
+ StringBuilder unescapedStringBuilder = null;
+ boolean isBackslashEscapeProcessingUsed = 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$
+ OCLMessages.StringNotProperlyClosed_ERROR);
+ }
+ char nextCh = rawString.charAt(i);
+ if (ch == '\\') {
+ switch (nextCh) {
+ case 'b' :
+ unescapedStringBuilder.append('\b');
+ break;
+ case 't' :
+ unescapedStringBuilder.append('\t');
+ break;
+ case 'n' :
+ unescapedStringBuilder.append('\n');
+ break;
+ case 'f' :
+ unescapedStringBuilder.append('\f');
+ break;
+ case 'r' :
+ unescapedStringBuilder.append('\r');
+ break;
+ case '\"' :
+ unescapedStringBuilder.append('\"');
+ break;
+ case '\'' :
+ unescapedStringBuilder.append('\'');
+ break;
+ case '\\' :
+ unescapedStringBuilder.append('\\');
+ break;
+ default :
+ // octal escape check
+ int unescapedChar = -1;
+ if ((nextCh >= '\u0030') && (nextCh <= '\u0037')) { // octal
+ // 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);
+ 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);
+ i++;
+ }
+ }
+ }
+ }
+ unescapedStringBuilder
+ .append((char) unescapedChar);
+ }
+ if (unescapedChar < 0) {
+ reportError(
+ ParseErrorCodes.INVALID_CODE,
+ "", stringLiteral.getTokenIndex(), stringLiteral.getTokenIndex(), //$NON-NLS-1$
+ OCLMessages.InvalidEscapeSequence_ERROR);
+ }
+ break;
+ }
+ } 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);
+ }
+ }
+ if (isNonStdSQEscapingUsed) {
+ // 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();
+ }
+
+ /**
+ * To be overridden in parsers which prohibit non-std SQL-like single quote
+ * escaping (" <tt>''</tt> ").
+ *
+ * @return true if such escaping is supported, false otherwise
+ *
+ * @since 1.3
+ */
+ protected boolean isNonStdSQSupported() {
+ return true;
+ }
}
diff --git a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/EssentialOCL.g b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/EssentialOCL.g
index fcb2aaf..c6d24ad 100644
--- a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/EssentialOCL.g
+++ b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/EssentialOCL.g
@@ -1,7 +1,7 @@
--/**
-- * <copyright>
-- *
--- * Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., and others.
+-- * Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., and others.
-- * All rights reserved. This program and the accompanying materials
-- * are made available under the terms of the Eclipse Public License v1.0
-- * which accompanies this distribution, and is available at
@@ -13,10 +13,11 @@
-- * E.D.Willink - Remove unnecessary warning suppression
-- * E.D.Willink - Bugs 225493, 243976, 259818
-- * Zeligsoft - Bug 243976
+-- * Borland - Bug 242880
-- *
-- * </copyright>
-- *
--- * $Id: EssentialOCL.g,v 1.5 2009/01/13 19:44:29 cdamus Exp $
+-- * $Id: EssentialOCL.g,v 1.6 2009/02/12 00:04:09 cdamus Exp $
-- */
--
-- The EssentialOCL Parser
@@ -187,7 +188,7 @@
/./**
* <copyright>
*
- * Copyright (c) 2005, 2008 IBM Corporation, Zeligsoft Inc., and others.
+ * Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -199,10 +200,11 @@
* E.D.Willink - Remove unnecessary warning suppression
* E.D.Willink - Bugs 225493, 243976
* Zeligsoft - Bug 243976
+ * Borland - Bug 242880
$copyright_contributions
* </copyright>
*
- * $Id: EssentialOCL.g,v 1.5 2009/01/13 19:44:29 cdamus Exp $
+ * $Id: EssentialOCL.g,v 1.6 2009/02/12 00:04:09 cdamus Exp $
*/
./
$End
@@ -1261,7 +1263,7 @@
./
stringLiteralExpCS ::= STRING_LITERAL
/.$BeginJava
- CSTNode result = createStringLiteralExpCS(getTokenText($getToken(1)));
+ CSTNode result = createStringLiteralExpCS(unescape(getIToken(($getToken(1)))));
setOffsets(result, getIToken($getToken(1)));
$setResult(result);
$EndJava
diff --git a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/OCLLexer.g b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/OCLLexer.g
index 0436c01..11bbb13 100644
--- a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/OCLLexer.g
+++ b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/OCLLexer.g
@@ -1,7 +1,7 @@
--/**
-- * <copyright>
-- *
--- * Copyright (c) 2005, 2007 IBM Corporation and others.
+-- * Copyright (c) 2005, 2009 IBM Corporation, Borland Software Corp., and others.
-- * All rights reserved. This program and the accompanying materials
-- * are made available under the terms of the Eclipse Public License v1.0
-- * which accompanies this distribution, and is available at
@@ -10,10 +10,11 @@
-- * Contributors:
-- * IBM - Initial API and implementation
-- * E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
--- *
+-- * Borland - Bug 242880
+-- *
-- * </copyright>
-- *
--- * $Id: OCLLexer.g,v 1.1 2007/10/11 23:05:00 cdamus Exp $
+-- * $Id: OCLLexer.g,v 1.2 2009/02/12 00:04:09 cdamus Exp $
-- */
--
-- The OCL Lexer
@@ -53,7 +54,7 @@
/./**
* <copyright>
*
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation, Borland Software Corp., and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -62,10 +63,11 @@
* Contributors:
* IBM - Initial API and implementation
* E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
+ * Borland - Bug 242880
$copyright_contributions
* </copyright>
*
- * $Id: OCLLexer.g,v 1.1 2007/10/11 23:05:00 cdamus Exp $
+ * $Id: OCLLexer.g,v 1.2 2009/02/12 00:04:09 cdamus Exp $
*/
./
$End
@@ -529,13 +531,16 @@
'%' | '&' | '^' | ':' | ';' | "'" | '\' | '|' | '{' | '}' |
'[' | ']' | '?' | ',' | '.' | '<' | '>' | '=' | '#' | DollarSign
- SpecialNotDQ -> '+' | '-' | '/' | '(' | ')' | '*' | '!' | '@' | '`' | '~' |
- '%' | '&' | '^' | ':' | ';' | "'" | '|' | '{' | '}' |
- '[' | ']' | '?' | ',' | '.' | '<' | '>' | '=' | '#' | DollarSign
+ SpecialNotSQNotDQ -> '+' | '-' | '/' | '(' | ')' | '*' | '!' | '@' | '`' | '~' |
+ '%' | '&' | '^' | ':' | ';' | '|' | '{' | '}' |
+ '[' | ']' | '?' | ',' | '.' | '<' | '>' | '=' | '#' | DollarSign
- SpecialNotSQ -> '+' | '-' | '/' | '(' | ')' | '*' | '!' | '@' | '`' | '~' |
- '%' | '&' | '^' | ':' | ';' | '"' | '|' | '{' | '}' | '\' |
- '[' | ']' | '?' | ',' | '.' | '<' | '>' | '=' | '#' | DollarSign
+
+ SpecialNotDQ -> SpecialNotSQNotDQ | "'"
+ SpecialNotSQ -> SpecialNotSQNotDQ | '"'
+
+ EscapedSymbols -> NotSQNotDQ | '"' | "'" | '\'
+ BackslashEscapedSymbol -> '\' EscapedSymbols
NotSlashOrStar -> Letter
| Digit
@@ -551,6 +556,11 @@
| FF
| CtlCharNotWS
+ NotSQNotDQ -> Letter
+ | Digit
+ | SpecialNotSQNotDQ
+ | Space
+
NotDQ -> Letter
| Digit
| SpecialNotDQ
@@ -564,6 +574,7 @@
| SpecialNotSQ
| Space
| EscapedSQ
+ | BackslashEscapedSymbol
--| '\' u HexDigit HexDigit HexDigit HexDigit
--| '\' OctalDigit
diff --git a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/OCLLexerprs.java b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/OCLLexerprs.java
index 0c864d3..24054f1 100644
--- a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/OCLLexerprs.java
+++ b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/OCLLexerprs.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
-* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., and others.
+* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,10 +10,11 @@
* Contributors:
* IBM - Initial API and implementation
* E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
-*
+* Borland - Bug 242880
+*
* </copyright>
*
-* $Id: OCLLexerprs.java,v 1.2 2009/01/13 20:31:30 cdamus Exp $
+* $Id: OCLLexerprs.java,v 1.3 2009/02/12 00:04:09 cdamus Exp $
*/
package org.eclipse.ocl.parser;
@@ -69,13 +70,11 @@
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
+ 1,1,2,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,2,2,1,
- 2,1,2,0,1,3,3,3,3,3,
- 3,3,4,4,3,3
+ 2,2,1,2,1,2,0,1,3,3,
+ 3,3,3,3,3,4,4,3,3
};
};
public final static byte baseCheck[] = BaseCheck.baseCheck;
@@ -85,57 +84,58 @@
public interface BaseAction {
public final static char baseAction[] = {
- 21,21,21,21,21,21,21,21,21,21,
- 21,21,21,21,21,21,21,21,21,21,
- 21,21,21,21,21,21,21,21,21,21,
- 21,21,21,21,21,21,21,21,21,21,
- 21,22,23,23,23,27,27,27,27,28,
- 28,26,26,6,6,35,35,30,13,13,
- 13,9,9,9,9,9,2,2,2,2,
+ 23,23,23,23,23,23,23,23,23,23,
+ 23,23,23,23,23,23,23,23,23,23,
+ 23,23,23,23,23,23,23,23,23,23,
+ 23,23,23,23,23,23,23,23,23,23,
+ 23,24,25,25,25,29,29,29,29,30,
+ 30,28,28,7,7,39,39,32,15,15,
+ 15,11,11,11,11,11,2,2,2,2,
3,3,3,3,3,3,3,3,3,3,
3,3,3,3,3,3,3,3,3,3,
3,3,3,3,3,3,4,4,4,4,
4,4,4,4,4,4,4,4,4,4,
4,4,4,4,4,4,4,4,4,4,
4,4,1,1,1,1,1,1,1,1,
- 1,1,37,37,37,37,37,37,37,37,
- 38,38,38,38,38,38,38,38,38,38,
- 38,38,36,36,39,39,39,15,15,40,
- 40,29,29,11,11,11,11,11,32,32,
- 32,32,32,32,32,32,32,32,32,32,
- 32,32,32,32,32,32,32,32,32,32,
- 32,32,32,32,32,32,32,32,17,17,
- 17,17,17,17,17,17,17,17,17,17,
- 17,17,17,17,17,17,17,17,17,17,
- 17,17,17,17,17,17,17,18,18,18,
- 18,18,18,18,18,18,18,18,18,18,
- 18,18,18,18,18,18,18,18,18,18,
- 18,18,18,18,18,18,7,7,7,7,
- 7,7,7,7,7,7,7,7,7,7,
- 7,7,7,7,7,7,7,7,7,7,
- 7,7,7,7,7,7,14,14,14,14,
- 31,31,31,31,31,31,31,31,19,19,
- 19,19,19,8,8,8,8,8,5,20,
- 33,33,10,10,12,12,16,24,24,24,
- 24,24,24,24,24,24,25,891,478,472,
- 472,472,2,354,1236,344,479,1280,491,1283,
- 344,1247,408,480,1269,54,162,408,339,6,
- 7,8,9,421,1223,54,337,488,309,481,
- 481,481,481,481,985,481,481,44,431,334,
- 427,309,481,481,481,481,481,1330,481,481,
- 304,431,1217,437,406,457,457,457,457,457,
- 990,457,457,1287,457,794,466,466,466,466,
- 1291,54,1,47,47,47,47,402,1307,54,
- 1288,47,1068,466,466,466,47,1318,54,47,
- 1146,205,52,52,52,52,1331,100,466,1216,
- 473,503,313,313,313,313,313,986,313,313,
- 994,400,496,496,496,1219,400,1069,1258,417,
- 1333,496,52,52,417,1289,496,600,313,313,
- 313,313,313,1332,313,313,697,311,311,311,
- 311,1220,1334,103,45,45,45,45,1335,1336,
- 1337,1281,45,506,311,311,311,45,1329,506,
- 45,1073,165,164,164,164,1148,165,164,164,
- 164,43,506,334,506,506
+ 1,1,41,41,41,41,41,41,41,41,
+ 42,42,42,42,42,42,42,42,42,42,
+ 42,42,40,40,43,43,43,17,17,44,
+ 44,31,31,13,13,13,13,13,34,34,
+ 34,34,34,34,34,34,34,34,34,34,
+ 34,34,34,34,34,34,34,34,34,34,
+ 34,34,34,34,34,34,34,34,19,19,
+ 19,19,19,19,19,19,19,19,19,19,
+ 19,19,19,19,19,19,19,19,19,19,
+ 19,19,19,19,19,19,19,5,5,5,
+ 5,5,5,5,5,5,5,5,5,5,
+ 5,5,5,5,5,5,5,5,5,5,
+ 5,5,5,5,5,20,20,8,8,35,
+ 35,35,35,9,16,16,16,16,33,33,
+ 33,33,33,33,33,33,36,36,36,36,
+ 21,21,21,21,21,10,10,10,10,10,
+ 10,6,22,37,37,12,12,14,14,18,
+ 26,26,26,26,26,26,26,26,26,27,
+ 988,486,485,485,485,1426,2,339,1333,326,
+ 1377,487,1380,493,1082,326,1366,54,488,1427,
+ 43,162,318,322,6,7,8,9,478,1320,
+ 54,320,315,309,490,490,490,490,490,490,
+ 1314,490,490,490,44,392,318,405,309,490,
+ 490,490,490,490,490,1087,490,490,490,1384,
+ 392,1385,430,406,409,409,409,409,409,409,
+ 1165,409,409,409,1243,409,891,424,424,424,
+ 424,424,600,296,296,296,296,296,296,1428,
+ 296,296,296,1388,54,100,424,424,424,697,
+ 296,296,296,296,296,296,1313,296,296,296,
+ 304,1404,54,424,794,294,294,294,294,294,
+ 1083,1,47,47,47,47,503,263,263,263,
+ 263,263,47,1316,294,294,294,47,1166,431,
+ 47,1091,403,498,498,498,1344,421,403,1355,
+ 467,473,1430,421,498,1386,467,1415,54,498,
+ 1429,263,263,103,45,45,45,45,205,52,
+ 52,52,52,1317,45,1431,1432,1433,1434,45,
+ 1378,515,45,1170,165,164,164,164,1245,165,
+ 164,164,164,515,515,515,515,515,515,515,
+ 515,52,52,515,515
};
};
public final static char baseAction[] = BaseAction.baseAction;
@@ -231,7 +231,7 @@
37,38,39,40,41,42,43,44,45,46,
47,48,49,50,51,52,53,54,55,56,
57,58,59,60,61,62,63,64,65,66,
- 67,68,69,70,71,72,0,74,75,76,
+ 67,68,69,70,71,72,73,74,75,76,
77,78,79,80,81,82,83,84,85,86,
87,88,89,90,91,92,93,94,95,96,
0,1,2,3,4,5,6,7,8,9,
@@ -241,54 +241,64 @@
40,41,42,43,44,45,46,47,48,49,
50,51,52,53,54,55,56,57,58,59,
60,61,62,63,64,65,66,67,68,69,
- 70,71,72,73,0,75,76,77,78,79,
+ 70,71,72,0,74,75,76,77,78,79,
80,81,82,83,84,85,86,87,88,89,
- 90,0,0,0,0,0,0,97,98,0,
- 100,101,102,0,1,2,3,4,5,6,
- 7,8,9,10,11,12,13,14,0,16,
- 17,18,19,20,21,22,23,24,25,26,
- 27,28,29,30,31,32,33,34,35,36,
- 37,38,39,40,41,42,43,44,45,46,
- 47,48,49,50,51,52,53,54,55,56,
- 57,58,59,60,61,62,63,64,65,75,
- 67,68,69,70,71,76,73,0,0,0,
- 77,78,0,1,2,3,4,5,6,7,
- 8,9,10,11,12,13,14,102,16,17,
- 18,19,20,21,22,23,24,25,26,27,
- 28,29,30,31,32,33,34,35,36,37,
- 38,39,40,41,42,43,44,45,46,47,
- 48,49,50,51,52,53,54,55,56,57,
- 58,59,60,61,62,63,64,65,71,0,
- 0,73,0,0,0,0,74,0,1,2,
+ 90,91,92,93,94,95,96,0,1,2,
3,4,5,6,7,8,9,10,11,12,
- 13,14,0,16,17,18,19,20,21,22,
+ 13,14,15,16,17,18,19,20,21,22,
23,24,25,26,27,28,29,30,31,32,
33,34,35,36,37,38,39,40,41,42,
43,44,45,46,47,48,49,50,51,52,
53,54,55,56,57,58,59,60,61,62,
- 63,64,65,68,69,0,0,0,0,0,
- 0,74,0,1,2,3,4,5,6,7,
- 8,9,10,11,12,0,1,2,3,4,
- 5,6,7,8,9,10,0,1,2,3,
- 4,5,6,7,8,9,10,0,1,2,
- 3,4,5,6,7,8,9,10,0,1,
- 2,3,4,5,6,7,8,9,10,0,
- 0,66,0,67,66,66,0,0,0,67,
+ 63,64,65,66,67,68,69,70,71,72,
+ 73,0,75,76,77,78,79,80,81,82,
+ 83,84,85,86,87,88,89,90,0,0,
+ 0,0,0,0,97,98,0,100,101,102,
0,1,2,3,4,5,6,7,8,9,
- 10,15,15,15,69,70,0,1,2,3,
- 4,5,6,7,8,9,10,0,1,2,
- 3,4,5,6,7,8,9,10,0,0,
- 0,0,0,0,0,0,0,0,0,11,
- 12,0,13,11,14,0,15,0,0,0,
- 0,72,0,0,68,0,0,0,0,0,
+ 10,11,12,13,14,0,16,17,18,19,
+ 20,21,22,23,24,25,26,27,28,29,
+ 30,31,32,33,34,35,36,37,38,39,
+ 40,41,42,43,44,45,46,47,48,49,
+ 50,51,52,53,54,55,56,57,58,59,
+ 60,61,62,63,64,65,75,67,68,69,
+ 70,71,76,73,0,0,0,77,78,0,
+ 1,2,3,4,5,6,7,8,9,10,
+ 11,12,13,14,102,16,17,18,19,20,
+ 21,22,23,24,25,26,27,28,29,30,
+ 31,32,33,34,35,36,37,38,39,40,
+ 41,42,43,44,45,46,47,48,49,50,
+ 51,52,53,54,55,56,57,58,59,60,
+ 61,62,63,64,65,71,0,0,73,0,
+ 0,0,0,74,0,1,2,3,4,5,
+ 6,7,8,9,10,11,12,13,14,0,
+ 16,17,18,19,20,21,22,23,24,25,
+ 26,27,28,29,30,31,32,33,34,35,
+ 36,37,38,39,40,41,42,43,44,45,
+ 46,47,48,49,50,51,52,53,54,55,
+ 56,57,58,59,60,61,62,63,64,65,
+ 68,69,0,0,0,0,0,0,74,0,
+ 1,2,3,4,5,6,7,8,9,10,
+ 11,12,0,1,2,3,4,5,6,7,
+ 8,9,10,0,1,2,3,4,5,6,
+ 7,8,9,10,0,1,2,3,4,5,
+ 6,7,8,9,10,0,1,2,3,4,
+ 5,6,7,8,9,10,0,0,66,0,
+ 67,66,66,0,0,0,67,0,1,2,
+ 3,4,5,6,7,8,9,10,15,15,
+ 15,69,70,0,1,2,3,4,5,6,
+ 7,8,9,10,0,1,2,3,4,5,
+ 6,7,8,9,10,0,0,0,0,0,
+ 0,0,0,0,0,0,11,12,0,13,
+ 11,14,0,15,0,0,0,0,72,0,
+ 0,68,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,97,98,0,100,
- 101,99,102,0,0,0,0,0,0,0,
+ 0,0,0,97,98,0,100,101,99,102,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
- 0,0,99,99,99,99,0,0,0,0
+ 0,0,0,0,0,0,0,0,0,99,
+ 99,99,99,0,0,0,0
};
};
public final static byte termCheck[] = TermCheck.termCheck;
@@ -296,150 +306,160 @@
public interface TermAction {
public final static char termAction[] = {0,
- 506,553,553,553,553,553,553,553,553,553,
- 553,553,553,553,553,553,553,553,553,553,
- 553,553,553,553,553,553,553,553,553,553,
- 553,553,553,553,553,553,553,553,553,553,
- 553,553,553,553,553,553,553,553,553,553,
- 553,553,553,553,553,553,553,553,553,553,
- 553,553,553,553,553,553,553,553,553,553,
- 553,473,553,553,553,553,553,553,552,553,
- 553,553,553,553,553,553,553,553,553,553,
- 553,553,553,553,553,553,553,553,553,506,
- 553,553,506,551,551,551,551,551,551,551,
- 551,551,551,551,551,551,551,551,551,551,
- 551,551,551,551,551,551,551,551,551,551,
- 551,551,551,551,551,551,551,551,551,551,
- 551,551,551,551,551,551,551,551,551,551,
- 551,551,551,551,551,551,551,551,551,551,
- 551,551,551,551,551,551,551,551,551,551,
- 551,551,551,556,551,551,551,551,551,551,
- 517,551,551,551,551,551,551,551,551,551,
- 551,551,551,551,551,551,551,551,551,551,
- 551,511,551,551,10,558,558,558,558,558,
- 558,558,558,558,558,558,558,558,558,558,
- 558,558,558,558,558,558,558,558,558,558,
- 558,558,558,558,558,558,558,558,558,558,
- 558,558,558,558,558,558,558,558,558,558,
- 558,558,558,558,558,558,558,558,558,558,
- 558,558,558,558,558,558,558,558,558,558,
- 558,558,558,558,558,558,558,558,558,558,
- 558,558,558,558,558,558,558,558,558,558,
- 558,558,558,558,558,558,558,558,558,558,
- 558,558,558,48,506,506,506,558,314,481,
- 481,481,481,481,481,481,481,481,481,481,
- 481,481,481,481,481,481,481,481,481,481,
- 481,481,481,481,481,481,481,481,481,481,
- 481,481,481,481,481,481,481,481,481,481,
- 481,481,481,481,481,481,481,481,481,481,
- 481,481,481,481,481,481,481,481,481,481,
- 481,481,481,481,429,481,481,481,481,481,
- 481,481,481,481,481,481,481,481,481,481,
- 481,481,481,481,481,481,481,481,481,481,
- 481,481,481,481,481,506,457,457,457,457,
- 457,457,457,457,457,457,457,457,457,457,
- 457,457,457,457,457,457,457,457,457,457,
- 457,457,457,457,457,457,457,457,457,457,
- 457,457,457,457,457,457,457,457,457,457,
- 457,457,457,457,457,457,457,457,457,457,
- 457,457,457,457,457,457,457,457,457,457,
- 457,445,457,457,457,457,457,457,457,457,
- 457,457,457,457,457,457,457,457,457,457,
- 457,457,457,457,457,457,457,457,457,457,
- 457,457,315,819,819,819,819,819,819,819,
- 819,819,819,819,819,819,819,819,819,819,
- 819,819,819,819,819,819,819,819,819,819,
- 819,819,819,819,819,819,819,819,819,819,
- 819,819,819,819,819,819,819,819,819,819,
- 819,819,819,819,819,819,819,819,819,819,
- 819,819,819,819,819,819,819,819,429,819,
- 819,819,819,819,819,819,819,819,819,819,
- 819,819,819,819,819,819,819,819,819,819,
- 819,819,819,819,819,819,819,819,819,506,
- 819,819,819,819,819,819,819,819,819,819,
- 819,819,819,819,819,819,819,819,819,819,
- 819,819,819,819,819,819,819,819,819,819,
- 819,819,819,819,819,819,819,819,819,819,
- 819,819,819,819,819,819,819,819,819,819,
- 819,819,819,819,819,819,819,819,819,819,
- 819,819,819,819,819,471,819,819,819,819,
- 819,819,819,819,819,819,819,819,819,819,
- 819,819,819,819,819,819,819,819,819,819,
- 819,819,819,819,819,819,506,817,817,817,
- 817,817,817,817,817,817,817,817,817,817,
- 817,817,817,817,817,817,817,817,817,817,
- 817,817,817,817,817,817,817,817,817,817,
- 817,817,817,817,817,817,817,817,817,817,
- 817,817,817,817,817,817,817,817,817,817,
- 817,817,817,817,817,817,817,817,817,817,
- 817,817,817,817,817,817,817,817,817,822,
- 817,817,817,817,817,817,817,817,817,817,
- 817,817,817,817,817,817,817,817,817,817,
- 817,817,447,506,466,466,466,466,466,466,
- 466,466,466,466,466,466,466,466,466,466,
- 466,466,466,466,466,466,466,466,466,466,
- 466,466,466,466,466,466,466,466,466,466,
- 466,466,466,466,466,466,466,466,466,466,
- 466,466,466,466,466,466,466,466,466,466,
- 466,466,466,466,466,466,466,466,466,466,
- 466,466,466,466,466,466,506,466,466,466,
- 466,466,466,466,466,466,466,466,466,466,
- 466,466,466,466,466,466,466,466,466,447,
- 506,478,478,478,478,478,478,478,478,478,
- 478,472,472,472,472,527,472,472,472,472,
- 472,472,472,472,472,472,472,472,472,472,
- 472,472,472,472,472,472,472,472,472,472,
- 472,472,472,472,472,472,472,472,472,472,
- 472,472,472,472,472,472,472,472,472,472,
- 472,472,472,472,472,472,384,382,410,420,
- 519,521,479,395,506,364,390,393,412,536,
- 377,358,540,533,534,531,532,546,537,523,
- 524,506,506,506,38,506,506,479,479,32,
- 479,479,371,506,400,400,400,400,400,400,
- 400,400,400,400,496,496,496,496,506,496,
- 496,496,496,496,496,496,496,496,496,496,
- 496,496,496,496,496,496,496,496,496,496,
- 496,496,496,496,496,496,496,496,496,496,
- 496,496,496,496,496,496,496,496,496,496,
- 496,496,496,496,496,496,496,496,496,545,
- 832,455,825,824,826,539,395,16,506,506,
- 463,827,1,671,671,671,671,671,671,671,
- 671,671,671,670,670,670,670,510,670,670,
- 670,670,670,670,670,670,670,670,670,670,
- 670,670,670,670,670,670,670,670,670,670,
- 670,670,670,670,670,670,670,670,670,670,
- 670,670,670,670,670,670,670,670,670,670,
- 670,670,670,670,670,670,670,670,380,506,
- 506,815,506,506,506,14,672,317,671,671,
- 671,671,671,671,671,671,671,671,670,670,
- 670,670,506,670,670,670,670,670,670,670,
- 670,670,670,670,670,670,670,670,670,670,
- 670,670,670,670,670,670,670,670,670,670,
- 670,670,670,670,670,670,670,670,670,670,
- 670,670,670,670,670,670,670,670,670,670,
- 670,670,670,535,557,506,35,506,308,3,
- 506,672,6,560,560,560,560,560,560,560,
- 560,560,560,334,334,506,344,344,344,344,
- 344,344,344,344,344,344,506,408,408,408,
- 408,408,408,408,408,408,408,506,417,417,
- 417,417,417,417,417,417,417,417,58,560,
- 560,560,560,560,560,560,560,560,560,12,
- 312,814,506,542,814,814,20,19,325,440,
- 57,560,560,560,560,560,560,560,560,560,
- 560,529,528,830,448,341,60,560,560,560,
- 560,560,560,560,560,560,560,59,560,560,
- 560,560,560,560,560,560,560,560,7,506,
- 506,322,506,163,53,161,167,506,506,334,
- 334,506,426,543,450,506,829,506,506,506,
- 506,668,506,506,530,506,506,506,506,506,
- 506,506,506,506,506,506,506,506,506,506,
- 506,506,506,506,506,506,668,668,506,668,
- 668,505,315,506,506,506,506,506,506,506,
- 506,506,506,506,506,506,506,506,506,506,
- 506,506,506,506,506,506,506,506,506,506,
- 506,506,506,506,506,506,506,506,506,506,
- 506,506,506,506,506,506,506,506,506,506,
- 506,506,1,6,12,1
+ 515,562,562,562,562,562,562,562,562,562,
+ 562,562,562,562,562,562,562,562,562,562,
+ 562,562,562,562,562,562,562,562,562,562,
+ 562,562,562,562,562,562,562,562,562,562,
+ 562,562,562,562,562,562,562,562,562,562,
+ 562,562,562,562,562,562,562,562,562,562,
+ 562,562,562,562,562,562,562,562,562,562,
+ 562,473,562,562,562,562,562,562,561,562,
+ 562,562,562,562,562,562,562,562,562,562,
+ 562,562,562,562,562,562,562,562,562,515,
+ 562,562,515,560,560,560,560,560,560,560,
+ 560,560,560,560,560,560,560,560,560,560,
+ 560,560,560,560,560,560,560,560,560,560,
+ 560,560,560,560,560,560,560,560,560,560,
+ 560,560,560,560,560,560,560,560,560,560,
+ 560,560,560,560,560,560,560,560,560,560,
+ 560,560,560,560,560,560,560,560,560,560,
+ 560,560,560,565,560,560,560,560,560,560,
+ 526,560,560,560,560,560,560,560,560,560,
+ 560,560,560,560,560,560,560,560,560,560,
+ 560,520,560,560,10,567,567,567,567,567,
+ 567,567,567,567,567,567,567,567,567,567,
+ 567,567,567,567,567,567,567,567,567,567,
+ 567,567,567,567,567,567,567,567,567,567,
+ 567,567,567,567,567,567,567,567,567,567,
+ 567,567,567,567,567,567,567,567,567,567,
+ 567,567,567,567,567,567,567,567,567,567,
+ 567,567,567,567,567,567,567,567,567,567,
+ 567,567,567,567,567,567,567,567,567,567,
+ 567,567,567,567,567,567,567,567,567,567,
+ 567,567,567,48,515,515,515,567,297,490,
+ 490,490,490,490,490,490,490,490,490,490,
+ 490,490,490,490,490,490,490,490,490,490,
+ 490,490,490,490,490,490,490,490,490,490,
+ 490,490,490,490,490,490,490,490,490,490,
+ 490,490,490,490,490,490,490,490,490,490,
+ 490,490,490,490,490,490,490,490,490,490,
+ 490,490,490,490,416,490,490,490,490,490,
+ 490,490,490,490,490,490,490,490,490,490,
+ 490,490,490,490,490,490,490,490,490,490,
+ 490,490,490,490,436,515,409,409,409,409,
+ 409,409,409,409,409,409,409,409,409,409,
+ 409,409,409,409,409,409,409,409,409,409,
+ 409,409,409,409,409,409,409,409,409,409,
+ 409,409,409,409,409,409,409,409,409,409,
+ 409,409,409,409,409,409,409,409,409,409,
+ 409,409,409,409,409,409,409,409,409,409,
+ 409,443,409,409,409,409,409,409,409,409,
+ 409,409,409,409,409,409,409,409,409,409,
+ 409,409,409,409,409,409,409,409,409,409,
+ 409,436,515,778,778,778,778,778,778,778,
+ 778,778,778,778,778,778,778,778,778,778,
+ 778,778,778,778,778,778,778,778,778,778,
+ 778,778,778,778,778,778,778,778,778,778,
+ 778,778,778,778,778,778,778,778,778,778,
+ 778,778,778,778,778,778,778,778,778,778,
+ 778,778,778,778,778,778,778,778,778,778,
+ 778,778,778,778,778,778,778,778,778,778,
+ 778,778,778,778,778,778,778,778,778,778,
+ 778,778,778,778,778,778,778,778,778,298,
+ 811,811,811,811,811,811,811,811,811,811,
+ 811,811,811,811,811,811,811,811,811,811,
+ 811,811,811,811,811,811,811,811,811,811,
+ 811,811,811,811,811,811,811,811,811,811,
+ 811,811,811,811,811,811,811,811,811,811,
+ 811,811,811,811,811,811,811,811,811,811,
+ 811,811,811,811,811,416,811,811,811,811,
+ 811,811,811,811,811,811,811,811,811,811,
+ 811,811,811,811,811,811,811,811,811,811,
+ 811,811,811,811,811,436,515,811,811,811,
+ 811,811,811,811,811,811,811,811,811,811,
+ 811,811,811,811,811,811,811,811,811,811,
+ 811,811,811,811,811,811,811,811,811,811,
+ 811,811,811,811,811,811,811,811,811,811,
+ 811,811,811,811,811,811,811,811,811,811,
+ 811,811,811,811,811,811,811,811,811,811,
+ 811,811,483,811,811,811,811,811,811,811,
+ 811,811,811,811,811,811,811,811,811,811,
+ 811,811,811,811,811,811,811,811,811,811,
+ 811,811,436,515,809,809,809,809,809,809,
+ 809,809,809,809,809,809,809,809,809,809,
+ 809,809,809,809,809,809,809,809,809,809,
+ 809,809,809,809,809,809,809,809,809,809,
+ 809,809,809,809,809,809,809,809,809,809,
+ 809,809,809,809,809,809,809,809,809,809,
+ 809,809,809,809,809,809,809,809,809,809,
+ 809,809,809,809,809,809,814,809,809,809,
+ 809,809,809,809,809,809,809,809,809,809,
+ 809,809,809,809,809,809,809,809,809,448,
+ 515,424,424,424,424,424,424,424,424,424,
+ 424,424,424,424,424,424,424,424,424,424,
+ 424,424,424,424,424,424,424,424,424,424,
+ 424,424,424,424,424,424,424,424,424,424,
+ 424,424,424,424,424,424,424,424,424,424,
+ 424,424,424,424,424,424,424,424,424,424,
+ 424,424,424,424,424,424,424,424,424,424,
+ 424,424,424,515,424,424,424,424,424,424,
+ 424,424,424,424,424,424,424,424,424,424,
+ 424,424,424,424,424,424,448,515,486,486,
+ 486,486,486,486,486,486,486,486,485,485,
+ 485,485,536,485,485,485,485,485,485,485,
+ 485,485,485,485,485,485,485,485,485,485,
+ 485,485,485,485,485,485,485,485,485,485,
+ 485,485,485,485,485,485,485,485,485,485,
+ 485,485,485,485,485,485,485,485,485,485,
+ 485,485,485,373,350,371,384,528,530,487,
+ 386,515,324,365,369,380,545,329,343,549,
+ 542,543,540,541,555,546,532,533,515,515,
+ 515,38,515,515,487,487,32,487,487,358,
+ 515,403,403,403,403,403,403,403,403,403,
+ 403,498,498,498,498,515,498,498,498,498,
+ 498,498,498,498,498,498,498,498,498,498,
+ 498,498,498,498,498,498,498,498,498,498,
+ 498,498,498,498,498,498,498,498,498,498,
+ 498,498,498,498,498,498,498,498,498,498,
+ 498,498,498,498,498,498,554,824,465,817,
+ 816,818,548,386,16,515,515,470,819,1,
+ 680,680,680,680,680,680,680,680,680,680,
+ 679,679,679,679,519,679,679,679,679,679,
+ 679,679,679,679,679,679,679,679,679,679,
+ 679,679,679,679,679,679,679,679,679,679,
+ 679,679,679,679,679,679,679,679,679,679,
+ 679,679,679,679,679,679,679,679,679,679,
+ 679,679,679,679,679,420,515,515,807,515,
+ 515,515,14,681,300,680,680,680,680,680,
+ 680,680,680,680,680,679,679,679,679,515,
+ 679,679,679,679,679,679,679,679,679,679,
+ 679,679,679,679,679,679,679,679,679,679,
+ 679,679,679,679,679,679,679,679,679,679,
+ 679,679,679,679,679,679,679,679,679,679,
+ 679,679,679,679,679,679,679,679,679,679,
+ 544,566,515,35,515,291,3,515,681,6,
+ 569,569,569,569,569,569,569,569,569,569,
+ 318,318,515,326,326,326,326,326,326,326,
+ 326,326,326,515,421,421,421,421,421,421,
+ 421,421,421,421,515,467,467,467,467,467,
+ 467,467,467,467,467,58,569,569,569,569,
+ 569,569,569,569,569,569,12,295,806,515,
+ 551,806,806,20,19,308,451,57,569,569,
+ 569,569,569,569,569,569,569,569,538,537,
+ 822,459,456,60,569,569,569,569,569,569,
+ 569,569,569,569,59,569,569,569,569,569,
+ 569,569,569,569,569,7,515,515,305,515,
+ 163,53,161,167,515,515,318,318,515,399,
+ 552,462,515,821,515,515,515,515,677,515,
+ 515,539,515,515,515,515,515,515,515,515,
+ 515,515,515,515,515,515,515,515,515,515,
+ 515,515,515,677,677,515,677,677,514,298,
+ 515,515,515,515,515,515,515,515,515,515,
+ 515,515,515,515,515,515,515,515,515,515,
+ 515,515,515,515,515,515,515,515,515,515,
+ 515,515,515,515,515,515,515,515,515,515,
+ 515,515,515,515,515,515,515,515,515,1,
+ 6,12,1
};
};
public final static char termAction[] = TermAction.termAction;
@@ -465,20 +485,20 @@
public final int getMaxNameLength() { return 0; }
public final static int
- NUM_STATES = 49,
+ NUM_STATES = 50,
NT_OFFSET = 103,
- LA_STATE_OFFSET = 832,
+ LA_STATE_OFFSET = 824,
MAX_LA = 1,
- NUM_RULES = 326,
- NUM_NONTERMINALS = 40,
- NUM_SYMBOLS = 143,
+ NUM_RULES = 309,
+ NUM_NONTERMINALS = 44,
+ NUM_SYMBOLS = 147,
SEGMENT_SIZE = 8192,
- START_STATE = 327,
+ START_STATE = 310,
IDENTIFIER_SYMBOL = 0,
EOFT_SYMBOL = 99,
EOLT_SYMBOL = 104,
- ACCEPT_ACTION = 505,
- ERROR_ACTION = 506;
+ ACCEPT_ACTION = 514,
+ ERROR_ACTION = 515;
public final static boolean BACKTRACK = false;
diff --git a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/OCLParser.java b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/OCLParser.java
index 6855be4..33e43c7 100644
--- a/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/OCLParser.java
+++ b/plugins/org.eclipse.ocl/src/org/eclipse/ocl/parser/OCLParser.java
@@ -1,7 +1,7 @@
/**
* <copyright>
*
-* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., and others.
+* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,10 +13,11 @@
* E.D.Willink - Remove unnecessary warning suppression
* E.D.Willink - Bugs 225493, 243976, 259818
* Zeligsoft - Bug 243976
+* Borland - Bug 242880
*
* </copyright>
*
-* $Id: OCLParser.java,v 1.5 2009/01/13 19:44:29 cdamus Exp $
+* $Id: OCLParser.java,v 1.6 2009/02/12 00:04:09 cdamus Exp $
*/
package org.eclipse.ocl.parser;
@@ -1182,7 +1183,7 @@
//
case 173: {
- CSTNode result = createStringLiteralExpCS(getTokenText(dtParser.getToken(1)));
+ CSTNode result = createStringLiteralExpCS(unescape(getIToken((dtParser.getToken(1)))));
setOffsets(result, getIToken(dtParser.getToken(1)));
dtParser.setSym1(result);
break;