Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 242153 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/ocl/expressions/impl/BooleanLiteralExpImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.ecore.EClass;
24
import org.eclipse.emf.ecore.EClass;
(-)src/org/eclipse/ocl/expressions/impl/UnlimitedNaturalLiteralExpImpl.java (-3 / +1 lines)
Lines 18-30 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
import org.eclipse.emf.common.notify.Notification;
22
21
22
import org.eclipse.emf.common.notify.Notification;
23
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.ecore.EClass;
24
import org.eclipse.emf.ecore.EClass;
25
26
import org.eclipse.emf.ecore.impl.ENotificationImpl;
25
import org.eclipse.emf.ecore.impl.ENotificationImpl;
27
28
import org.eclipse.ocl.expressions.ExpressionsPackage;
26
import org.eclipse.ocl.expressions.ExpressionsPackage;
29
import org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp;
27
import org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp;
30
import org.eclipse.ocl.expressions.operations.UnlimitedNaturalLiteralExpOperations;
28
import org.eclipse.ocl.expressions.operations.UnlimitedNaturalLiteralExpOperations;
(-)src/org/eclipse/ocl/expressions/impl/OCLExpressionImpl.java (-2 lines)
Lines 23-30 Link Here
23
import org.eclipse.emf.ecore.impl.EObjectImpl;
23
import org.eclipse.emf.ecore.impl.EObjectImpl;
24
import org.eclipse.ocl.expressions.ExpressionsPackage;
24
import org.eclipse.ocl.expressions.ExpressionsPackage;
25
import org.eclipse.ocl.expressions.OCLExpression;
25
import org.eclipse.ocl.expressions.OCLExpression;
26
27
//import org.eclipse.ocl.expressions.operations.OCLExpressionOperations;
28
import org.eclipse.ocl.util.ToStringVisitor;
26
import org.eclipse.ocl.util.ToStringVisitor;
29
import org.eclipse.ocl.utilities.ASTNode;
27
import org.eclipse.ocl.utilities.ASTNode;
30
import org.eclipse.ocl.utilities.UtilitiesPackage;
28
import org.eclipse.ocl.utilities.UtilitiesPackage;
(-)src/org/eclipse/ocl/expressions/impl/IfExpImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
(-)src/org/eclipse/ocl/expressions/impl/PropertyCallExpImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.ecore.EClass;
24
import org.eclipse.emf.ecore.EClass;
(-)src/org/eclipse/ocl/expressions/impl/EnumLiteralExpImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.ecore.EClass;
24
import org.eclipse.emf.ecore.EClass;
(-)src/org/eclipse/ocl/expressions/impl/CollectionLiteralExpImpl.java (-1 / +1 lines)
Lines 18-25 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Collection;
20
import java.util.Collection;
21
22
import java.util.Map;
21
import java.util.Map;
22
23
import org.eclipse.emf.common.notify.Notification;
23
import org.eclipse.emf.common.notify.Notification;
24
import org.eclipse.emf.common.notify.NotificationChain;
24
import org.eclipse.emf.common.notify.NotificationChain;
25
import org.eclipse.emf.common.util.DiagnosticChain;
25
import org.eclipse.emf.common.util.DiagnosticChain;
(-)src/org/eclipse/ocl/expressions/impl/IteratorExpImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.ocl.expressions.ExpressionsPackage;
24
import org.eclipse.ocl.expressions.ExpressionsPackage;
(-)src/org/eclipse/ocl/expressions/impl/CollectionLiteralPartImpl.java (-2 lines)
Lines 21-28 Link Here
21
import org.eclipse.emf.ecore.impl.EObjectImpl;
21
import org.eclipse.emf.ecore.impl.EObjectImpl;
22
import org.eclipse.ocl.expressions.CollectionLiteralPart;
22
import org.eclipse.ocl.expressions.CollectionLiteralPart;
23
import org.eclipse.ocl.expressions.ExpressionsPackage;
23
import org.eclipse.ocl.expressions.ExpressionsPackage;
24
25
//import org.eclipse.ocl.expressions.operations.CollectionLiteralPartOperations;
26
import org.eclipse.ocl.utilities.Visitor;
24
import org.eclipse.ocl.utilities.Visitor;
27
25
28
/**
26
/**
(-)src/org/eclipse/ocl/expressions/impl/CollectionItemImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
(-)src/org/eclipse/ocl/expressions/impl/MessageExpImpl.java (-1 / +1 lines)
Lines 18-25 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Collection;
20
import java.util.Collection;
21
22
import java.util.Map;
21
import java.util.Map;
22
23
import org.eclipse.emf.common.notify.Notification;
23
import org.eclipse.emf.common.notify.Notification;
24
import org.eclipse.emf.common.notify.NotificationChain;
24
import org.eclipse.emf.common.notify.NotificationChain;
25
import org.eclipse.emf.common.util.DiagnosticChain;
25
import org.eclipse.emf.common.util.DiagnosticChain;
(-)src/org/eclipse/ocl/expressions/impl/VariableExpImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.ecore.EClass;
24
import org.eclipse.emf.ecore.EClass;
(-)src/org/eclipse/ocl/expressions/impl/OperationCallExpImpl.java (-1 / +1 lines)
Lines 18-25 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Collection;
20
import java.util.Collection;
21
22
import java.util.Map;
21
import java.util.Map;
22
23
import org.eclipse.emf.common.notify.Notification;
23
import org.eclipse.emf.common.notify.Notification;
24
import org.eclipse.emf.common.notify.NotificationChain;
24
import org.eclipse.emf.common.notify.NotificationChain;
25
import org.eclipse.emf.common.util.DiagnosticChain;
25
import org.eclipse.emf.common.util.DiagnosticChain;
(-)src/org/eclipse/ocl/expressions/impl/IntegerLiteralExpImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.ecore.EClass;
24
import org.eclipse.emf.ecore.EClass;
(-)src/org/eclipse/ocl/expressions/impl/RealLiteralExpImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.ecore.EClass;
24
import org.eclipse.emf.ecore.EClass;
(-)src/org/eclipse/ocl/expressions/impl/CollectionRangeImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
(-)src/org/eclipse/ocl/expressions/impl/StringLiteralExpImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.ecore.EClass;
24
import org.eclipse.emf.ecore.EClass;
(-)src/org/eclipse/ocl/expressions/impl/TupleLiteralPartImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
(-)src/org/eclipse/ocl/expressions/impl/TupleLiteralExpImpl.java (-1 / +1 lines)
Lines 18-25 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Collection;
20
import java.util.Collection;
21
22
import java.util.Map;
21
import java.util.Map;
22
23
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.notify.NotificationChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
import org.eclipse.emf.common.util.EList;
25
import org.eclipse.emf.common.util.EList;
(-)src/org/eclipse/ocl/expressions/impl/ExpressionsFactoryImpl.java (-2 lines)
Lines 23-30 Link Here
23
import org.eclipse.emf.ecore.EPackage;
23
import org.eclipse.emf.ecore.EPackage;
24
import org.eclipse.emf.ecore.impl.EFactoryImpl;
24
import org.eclipse.emf.ecore.impl.EFactoryImpl;
25
import org.eclipse.emf.ecore.plugin.EcorePlugin;
25
import org.eclipse.emf.ecore.plugin.EcorePlugin;
26
27
//import org.eclipse.ocl.expressions.*;
28
import org.eclipse.ocl.expressions.AssociationClassCallExp;
26
import org.eclipse.ocl.expressions.AssociationClassCallExp;
29
import org.eclipse.ocl.expressions.BooleanLiteralExp;
27
import org.eclipse.ocl.expressions.BooleanLiteralExp;
30
import org.eclipse.ocl.expressions.CollectionItem;
28
import org.eclipse.ocl.expressions.CollectionItem;
(-)src/org/eclipse/ocl/expressions/impl/IterateExpImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
(-)src/org/eclipse/ocl/expressions/impl/VariableImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
(-)src/org/eclipse/ocl/expressions/impl/LetExpImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
(-)src/org/eclipse/ocl/expressions/impl/LoopExpImpl.java (-1 / +1 lines)
Lines 18-25 Link Here
18
package org.eclipse.ocl.expressions.impl;
18
package org.eclipse.ocl.expressions.impl;
19
19
20
import java.util.Collection;
20
import java.util.Collection;
21
22
import java.util.Map;
21
import java.util.Map;
22
23
import org.eclipse.emf.common.notify.Notification;
23
import org.eclipse.emf.common.notify.Notification;
24
import org.eclipse.emf.common.notify.NotificationChain;
24
import org.eclipse.emf.common.notify.NotificationChain;
25
import org.eclipse.emf.common.util.DiagnosticChain;
25
import org.eclipse.emf.common.util.DiagnosticChain;
(-)src/org/eclipse/ocl/types/operations/InvalidTypeOperations.java (-1 lines)
Lines 17-23 Link Here
17
package org.eclipse.ocl.types.operations;
17
package org.eclipse.ocl.types.operations;
18
18
19
import org.eclipse.emf.common.util.EList;
19
import org.eclipse.emf.common.util.EList;
20
21
import org.eclipse.ocl.types.InvalidType;
20
import org.eclipse.ocl.types.InvalidType;
22
21
23
/**
22
/**
(-)src/org/eclipse/ocl/types/operations/CollectionTypeOperations.java (-2 lines)
Lines 23-32 Link Here
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
import org.eclipse.emf.common.util.EList;
25
import org.eclipse.emf.common.util.EList;
26
27
import org.eclipse.ocl.Environment;
26
import org.eclipse.ocl.Environment;
28
import org.eclipse.ocl.types.CollectionType;
27
import org.eclipse.ocl.types.CollectionType;
29
30
import org.eclipse.ocl.types.util.TypesValidator;
28
import org.eclipse.ocl.types.util.TypesValidator;
31
import org.eclipse.ocl.util.OCLUtil;
29
import org.eclipse.ocl.util.OCLUtil;
32
30
(-)src/org/eclipse/ocl/types/operations/VoidTypeOperations.java (-1 lines)
Lines 17-23 Link Here
17
package org.eclipse.ocl.types.operations;
17
package org.eclipse.ocl.types.operations;
18
18
19
import org.eclipse.emf.common.util.EList;
19
import org.eclipse.emf.common.util.EList;
20
21
import org.eclipse.ocl.types.VoidType;
20
import org.eclipse.ocl.types.VoidType;
22
21
23
/**
22
/**
(-)src/org/eclipse/ocl/types/operations/PrimitiveTypeOperations.java (-1 lines)
Lines 17-23 Link Here
17
package org.eclipse.ocl.types.operations;
17
package org.eclipse.ocl.types.operations;
18
18
19
import org.eclipse.emf.common.util.EList;
19
import org.eclipse.emf.common.util.EList;
20
21
import org.eclipse.ocl.types.PrimitiveType;
20
import org.eclipse.ocl.types.PrimitiveType;
22
21
23
/**
22
/**
(-)src/org/eclipse/ocl/types/operations/MessageTypeOperations.java (-2 lines)
Lines 23-31 Link Here
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
import org.eclipse.emf.common.util.EList;
25
import org.eclipse.emf.common.util.EList;
26
27
import org.eclipse.ocl.types.MessageType;
26
import org.eclipse.ocl.types.MessageType;
28
29
import org.eclipse.ocl.types.util.TypesValidator;
27
import org.eclipse.ocl.types.util.TypesValidator;
30
28
31
/**
29
/**
(-)src/org/eclipse/ocl/types/operations/SequenceTypeOperations.java (-2 lines)
Lines 22-31 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.types.SequenceType;
26
import org.eclipse.ocl.types.SequenceType;
28
29
import org.eclipse.ocl.types.util.TypesValidator;
27
import org.eclipse.ocl.types.util.TypesValidator;
30
import org.eclipse.ocl.util.OCLUtil;
28
import org.eclipse.ocl.util.OCLUtil;
31
29
(-)src/org/eclipse/ocl/types/operations/BagTypeOperations.java (-2 lines)
Lines 22-31 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.types.BagType;
26
import org.eclipse.ocl.types.BagType;
28
29
import org.eclipse.ocl.types.util.TypesValidator;
27
import org.eclipse.ocl.types.util.TypesValidator;
30
import org.eclipse.ocl.util.OCLUtil;
28
import org.eclipse.ocl.util.OCLUtil;
31
29
(-)src/org/eclipse/ocl/types/operations/SetTypeOperations.java (-2 lines)
Lines 22-31 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.types.SetType;
26
import org.eclipse.ocl.types.SetType;
28
29
import org.eclipse.ocl.types.util.TypesValidator;
27
import org.eclipse.ocl.types.util.TypesValidator;
30
import org.eclipse.ocl.util.OCLUtil;
28
import org.eclipse.ocl.util.OCLUtil;
31
29
(-)src/org/eclipse/ocl/types/operations/TypeTypeOperations.java (-1 lines)
Lines 17-23 Link Here
17
package org.eclipse.ocl.types.operations;
17
package org.eclipse.ocl.types.operations;
18
18
19
import org.eclipse.emf.common.util.EList;
19
import org.eclipse.emf.common.util.EList;
20
21
import org.eclipse.ocl.types.TypeType;
20
import org.eclipse.ocl.types.TypeType;
22
21
23
/**
22
/**
(-)src/org/eclipse/ocl/types/operations/AnyTypeOperations.java (-1 lines)
Lines 17-23 Link Here
17
package org.eclipse.ocl.types.operations;
17
package org.eclipse.ocl.types.operations;
18
18
19
import org.eclipse.emf.common.util.EList;
19
import org.eclipse.emf.common.util.EList;
20
21
import org.eclipse.ocl.types.AnyType;
20
import org.eclipse.ocl.types.AnyType;
22
21
23
/**
22
/**
(-)src/org/eclipse/ocl/types/operations/TupleTypeOperations.java (-2 lines)
Lines 23-31 Link Here
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
import org.eclipse.emf.common.util.EList;
25
import org.eclipse.emf.common.util.EList;
26
27
import org.eclipse.ocl.types.TupleType;
26
import org.eclipse.ocl.types.TupleType;
28
29
import org.eclipse.ocl.types.util.TypesValidator;
27
import org.eclipse.ocl.types.util.TypesValidator;
30
28
31
/**
29
/**
(-)src/org/eclipse/ocl/types/operations/OrderedSetTypeOperations.java (-2 lines)
Lines 22-31 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.types.OrderedSetType;
26
import org.eclipse.ocl.types.OrderedSetType;
28
29
import org.eclipse.ocl.types.util.TypesValidator;
27
import org.eclipse.ocl.types.util.TypesValidator;
30
import org.eclipse.ocl.util.OCLUtil;
28
import org.eclipse.ocl.util.OCLUtil;
31
29
(-)src/org/eclipse/ocl/OCL.java (-1 / +1 lines)
Lines 275-281 Link Here
275
				rootEnvironment, contentAsString.toCharArray());
275
				rootEnvironment, contentAsString.toCharArray());
276
			OCLBacktrackingParser parser = new OCLBacktrackingParser(lexer);
276
			OCLBacktrackingParser parser = new OCLBacktrackingParser(lexer);
277
			parser.setDefaultRepairCount(parserRepairCount);
277
			parser.setDefaultRepairCount(parserRepairCount);
278
			lexer.lexToTokens(parser);
278
			lexer.lexer(parser.getIPrsStream());
279
			analyzer = new OCLAnalyzer<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E>(
279
			analyzer = new OCLAnalyzer<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E>(
280
				parser);
280
				parser);
281
		} else {
281
		} else {
(-)src/org/eclipse/ocl/expressions/PropertyCallExp.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
23
23
/**
24
/**
(-)src/org/eclipse/ocl/expressions/CollectionLiteralExp.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.EList;
23
import org.eclipse.emf.common.util.EList;
23
24
(-)src/org/eclipse/ocl/expressions/LoopExp.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.EList;
23
import org.eclipse.emf.common.util.EList;
23
24
(-)src/org/eclipse/ocl/expressions/MessageExp.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.EList;
23
import org.eclipse.emf.common.util.EList;
23
import org.eclipse.ocl.utilities.CallingASTNode;
24
import org.eclipse.ocl.utilities.CallingASTNode;
(-)src/org/eclipse/ocl/expressions/OperationCallExp.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.EList;
23
import org.eclipse.emf.common.util.EList;
23
24
(-)src/org/eclipse/ocl/expressions/TupleLiteralPart.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.ocl.utilities.TypedASTNode;
23
import org.eclipse.ocl.utilities.TypedASTNode;
23
import org.eclipse.ocl.utilities.TypedElement;
24
import org.eclipse.ocl.utilities.TypedElement;
(-)src/org/eclipse/ocl/expressions/UnlimitedNaturalLiteralExp.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
23
23
/**
24
/**
(-)src/org/eclipse/ocl/expressions/BooleanLiteralExp.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
23
23
/**
24
/**
(-)src/org/eclipse/ocl/expressions/CollectionRange.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
23
23
/**
24
/**
(-)src/org/eclipse/ocl/expressions/Variable.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.ocl.utilities.TypedASTNode;
23
import org.eclipse.ocl.utilities.TypedASTNode;
23
import org.eclipse.ocl.utilities.TypedElement;
24
import org.eclipse.ocl.utilities.TypedElement;
(-)src/org/eclipse/ocl/expressions/RealLiteralExp.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
23
23
/**
24
/**
(-)src/org/eclipse/ocl/expressions/LetExp.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
23
23
/**
24
/**
(-)src/org/eclipse/ocl/expressions/EnumLiteralExp.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
23
23
/**
24
/**
(-)src/org/eclipse/ocl/expressions/IntegerLiteralExp.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
23
23
/**
24
/**
(-)src/org/eclipse/ocl/expressions/VariableExp.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
23
23
/**
24
/**
(-)src/org/eclipse/ocl/expressions/StringLiteralExp.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
23
23
/**
24
/**
(-)src/org/eclipse/ocl/expressions/IteratorExp.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
23
23
/**
24
/**
(-)src/org/eclipse/ocl/expressions/CollectionItem.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
23
23
/**
24
/**
(-)src/org/eclipse/ocl/expressions/TupleLiteralExp.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.EList;
23
import org.eclipse.emf.common.util.EList;
23
24
(-)src/org/eclipse/ocl/expressions/IfExp.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
23
23
/**
24
/**
(-)src/org/eclipse/ocl/expressions/IterateExp.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.expressions;
18
package org.eclipse.ocl.expressions;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
23
23
/**
24
/**
(-)src/org/eclipse/ocl/cst/CSTNode.java (-5 / +6 lines)
Lines 17-23 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.cst;
18
package org.eclipse.ocl.cst;
19
19
20
import lpg.lpgjavaruntime.IToken;
20
import lpg.runtime.IToken;
21
21
import org.eclipse.emf.ecore.EObject;
22
import org.eclipse.emf.ecore.EObject;
22
23
23
/**
24
/**
Lines 104-110 Link Here
104
	 * If the meaning of the '<em>Start Token</em>' attribute isn't clear,
105
	 * If the meaning of the '<em>Start Token</em>' attribute isn't clear,
105
	 * there really should be more of a description here...
106
	 * there really should be more of a description here...
106
	 * </p>
107
	 * </p>
107
	 * @since 1.3
108
	 * @since 3.0
108
	 * <!-- end-user-doc -->
109
	 * <!-- end-user-doc -->
109
	 * @return the value of the '<em>Start Token</em>' attribute.
110
	 * @return the value of the '<em>Start Token</em>' attribute.
110
	 * @see #setStartToken(IToken)
111
	 * @see #setStartToken(IToken)
Lines 117-123 Link Here
117
	/**
118
	/**
118
	 * Sets the value of the '{@link org.eclipse.ocl.cst.CSTNode#getStartToken <em>Start Token</em>}' attribute.
119
	 * Sets the value of the '{@link org.eclipse.ocl.cst.CSTNode#getStartToken <em>Start Token</em>}' attribute.
119
	 * <!-- begin-user-doc -->
120
	 * <!-- begin-user-doc -->
120
	 * @since 1.3
121
	 * @since 3.0
121
	 * <!-- end-user-doc -->
122
	 * <!-- end-user-doc -->
122
	 * @param value the new value of the '<em>Start Token</em>' attribute.
123
	 * @param value the new value of the '<em>Start Token</em>' attribute.
123
	 * @see #getStartToken()
124
	 * @see #getStartToken()
Lines 132-138 Link Here
132
	 * If the meaning of the '<em>End Token</em>' attribute isn't clear,
133
	 * If the meaning of the '<em>End Token</em>' attribute isn't clear,
133
	 * there really should be more of a description here...
134
	 * there really should be more of a description here...
134
	 * </p>
135
	 * </p>
135
	 * @since 1.3
136
	 * @since 3.0
136
	 * <!-- end-user-doc -->
137
	 * <!-- end-user-doc -->
137
	 * @return the value of the '<em>End Token</em>' attribute.
138
	 * @return the value of the '<em>End Token</em>' attribute.
138
	 * @see #setEndToken(IToken)
139
	 * @see #setEndToken(IToken)
Lines 145-151 Link Here
145
	/**
146
	/**
146
	 * Sets the value of the '{@link org.eclipse.ocl.cst.CSTNode#getEndToken <em>End Token</em>}' attribute.
147
	 * Sets the value of the '{@link org.eclipse.ocl.cst.CSTNode#getEndToken <em>End Token</em>}' attribute.
147
	 * <!-- begin-user-doc -->
148
	 * <!-- begin-user-doc -->
148
	 * @since 1.3
149
	 * @since 3.0
149
	 * <!-- end-user-doc -->
150
	 * <!-- end-user-doc -->
150
	 * @param value the new value of the '<em>End Token</em>' attribute.
151
	 * @param value the new value of the '<em>End Token</em>' attribute.
151
	 * @see #getEndToken()
152
	 * @see #getEndToken()
(-)src/org/eclipse/ocl/cst/CSTPackage.java (-5 / +5 lines)
Lines 4937-4943 Link Here
4937
	 * The meta object id for the '<em>IToken</em>' data type.
4937
	 * The meta object id for the '<em>IToken</em>' data type.
4938
	 * <!-- begin-user-doc -->
4938
	 * <!-- begin-user-doc -->
4939
	 * <!-- end-user-doc -->
4939
	 * <!-- end-user-doc -->
4940
	 * @see lpg.lpgjavaruntime.IToken
4940
	 * @see lpg.runtime.IToken
4941
	 * @see org.eclipse.ocl.cst.impl.CSTPackageImpl#getIToken()
4941
	 * @see org.eclipse.ocl.cst.impl.CSTPackageImpl#getIToken()
4942
	 * @generated
4942
	 * @generated
4943
	 * @noreference This field is not intended to be referenced by clients.
4943
	 * @noreference This field is not intended to be referenced by clients.
Lines 6425-6437 Link Here
6425
	EEnum getDotOrArrowEnum();
6425
	EEnum getDotOrArrowEnum();
6426
6426
6427
	/**
6427
	/**
6428
	 * Returns the meta object for data type '{@link lpg.lpgjavaruntime.IToken <em>IToken</em>}'.
6428
	 * Returns the meta object for data type '{@link lpg.runtime.IToken <em>IToken</em>}'.
6429
	 * <!-- begin-user-doc -->
6429
	 * <!-- begin-user-doc -->
6430
	 * @since 1.3
6430
	 * @since 1.3
6431
	 * <!-- end-user-doc -->
6431
	 * <!-- end-user-doc -->
6432
	 * @return the meta object for data type '<em>IToken</em>'.
6432
	 * @return the meta object for data type '<em>IToken</em>'.
6433
	 * @see lpg.lpgjavaruntime.IToken
6433
	 * @see lpg.runtime.IToken
6434
	 * @model instanceClass="lpg.lpgjavaruntime.IToken"
6434
	 * @model instanceClass="lpg.runtime.IToken"
6435
	 * @generated
6435
	 * @generated
6436
	 */
6436
	 */
6437
	EDataType getIToken();
6437
	EDataType getIToken();
Lines 7765-7771 Link Here
7765
		 * <!-- begin-user-doc -->
7765
		 * <!-- begin-user-doc -->
7766
		 * @since 1.3
7766
		 * @since 1.3
7767
		 * <!-- end-user-doc -->
7767
		 * <!-- end-user-doc -->
7768
		 * @see lpg.lpgjavaruntime.IToken
7768
		 * @see lpg.runtime.IToken
7769
		 * @see org.eclipse.ocl.cst.impl.CSTPackageImpl#getIToken()
7769
		 * @see org.eclipse.ocl.cst.impl.CSTPackageImpl#getIToken()
7770
		 * @generated
7770
		 * @generated
7771
		 */
7771
		 */
(-)src/org/eclipse/ocl/cst/impl/CSTPackageImpl.java (-1 / +2 lines)
Lines 18-24 Link Here
18
 */
18
 */
19
package org.eclipse.ocl.cst.impl;
19
package org.eclipse.ocl.cst.impl;
20
20
21
import lpg.lpgjavaruntime.IToken;
21
import lpg.runtime.IToken;
22
22
import org.eclipse.emf.ecore.EAttribute;
23
import org.eclipse.emf.ecore.EAttribute;
23
import org.eclipse.emf.ecore.EClass;
24
import org.eclipse.emf.ecore.EClass;
24
import org.eclipse.emf.ecore.EDataType;
25
import org.eclipse.emf.ecore.EDataType;
(-)src/org/eclipse/ocl/cst/impl/ClassifierContextDeclCSImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.cst.impl;
18
package org.eclipse.ocl.cst.impl;
19
19
20
import java.util.Collection;
20
import java.util.Collection;
21
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.notify.NotificationChain;
23
import org.eclipse.emf.common.util.EList;
24
import org.eclipse.emf.common.util.EList;
(-)src/org/eclipse/ocl/cst/impl/CSTNodeImpl.java (-5 / +6 lines)
Lines 17-23 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.cst.impl;
18
package org.eclipse.ocl.cst.impl;
19
19
20
import lpg.lpgjavaruntime.IToken;
20
import lpg.runtime.IToken;
21
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.impl.ENotificationImpl;
24
import org.eclipse.emf.ecore.impl.ENotificationImpl;
Lines 217-223 Link Here
217
218
218
	/**
219
	/**
219
	 * <!-- begin-user-doc -->
220
	 * <!-- begin-user-doc -->
220
	 * @since 1.3
221
	 * @since 3.0
221
	 * <!-- end-user-doc -->
222
	 * <!-- end-user-doc -->
222
	 * @generated
223
	 * @generated
223
	 */
224
	 */
Lines 227-233 Link Here
227
228
228
	/**
229
	/**
229
	 * <!-- begin-user-doc -->
230
	 * <!-- begin-user-doc -->
230
	 * @since 1.3
231
	 * @since 3.0
231
	 * <!-- end-user-doc -->
232
	 * <!-- end-user-doc -->
232
	 * @generated
233
	 * @generated
233
	 */
234
	 */
Lines 241-247 Link Here
241
242
242
	/**
243
	/**
243
	 * <!-- begin-user-doc -->
244
	 * <!-- begin-user-doc -->
244
	 * @since 1.3
245
	 * @since 3.0
245
	 * <!-- end-user-doc -->
246
	 * <!-- end-user-doc -->
246
	 * @generated
247
	 * @generated
247
	 */
248
	 */
Lines 251-257 Link Here
251
252
252
	/**
253
	/**
253
	 * <!-- begin-user-doc -->
254
	 * <!-- begin-user-doc -->
254
	 * @since 1.3
255
	 * @since 3.0
255
	 * <!-- end-user-doc -->
256
	 * <!-- end-user-doc -->
256
	 * @generated
257
	 * @generated
257
	 */
258
	 */
(-)src/org/eclipse/ocl/cst/impl/CSTFactoryImpl.java (-4 / +3 lines)
Lines 17-31 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.cst.impl;
18
package org.eclipse.ocl.cst.impl;
19
19
20
import lpg.lpgjavaruntime.IToken;
20
import lpg.runtime.IToken;
21
21
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.EDataType;
23
import org.eclipse.emf.ecore.EDataType;
23
import org.eclipse.emf.ecore.EObject;
24
import org.eclipse.emf.ecore.EObject;
24
import org.eclipse.emf.ecore.EPackage;
25
import org.eclipse.emf.ecore.EPackage;
25
import org.eclipse.emf.ecore.impl.EFactoryImpl;
26
import org.eclipse.emf.ecore.impl.EFactoryImpl;
26
import org.eclipse.emf.ecore.plugin.EcorePlugin;
27
import org.eclipse.emf.ecore.plugin.EcorePlugin;
27
28
//import org.eclipse.ocl.cst.*;
29
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
28
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
30
import org.eclipse.ocl.cst.CSTFactory;
29
import org.eclipse.ocl.cst.CSTFactory;
31
import org.eclipse.ocl.cst.CSTPackage;
30
import org.eclipse.ocl.cst.CSTPackage;
Lines 823-829 Link Here
823
822
824
	/**
823
	/**
825
	 * <!-- begin-user-doc -->
824
	 * <!-- begin-user-doc -->
826
	 * @since 1.3
825
	 * @since 3.0
827
	 * <!-- end-user-doc -->
826
	 * <!-- end-user-doc -->
828
	 * @generated
827
	 * @generated
829
	 */
828
	 */
(-)src/org/eclipse/ocl/cst/impl/OCLDocumentCSImpl.java (-4 lines)
Lines 19-33 Link Here
19
import java.util.Collection;
19
import java.util.Collection;
20
20
21
import org.eclipse.emf.common.notify.NotificationChain;
21
import org.eclipse.emf.common.notify.NotificationChain;
22
23
import org.eclipse.emf.common.util.EList;
22
import org.eclipse.emf.common.util.EList;
24
25
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.EClass;
26
import org.eclipse.emf.ecore.InternalEObject;
24
import org.eclipse.emf.ecore.InternalEObject;
27
28
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
25
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
29
import org.eclipse.emf.ecore.util.InternalEList;
26
import org.eclipse.emf.ecore.util.InternalEList;
30
31
import org.eclipse.ocl.cst.CSTPackage;
27
import org.eclipse.ocl.cst.CSTPackage;
32
import org.eclipse.ocl.cst.OCLDocumentCS;
28
import org.eclipse.ocl.cst.OCLDocumentCS;
33
import org.eclipse.ocl.cst.PackageDeclarationCS;
29
import org.eclipse.ocl.cst.PackageDeclarationCS;
(-)src/org/eclipse/ocl/parser/OCLParser.java (-882 / +1515 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., 
5
* Open Canarias S.L. and others.
5
* All rights reserved.   This program and the accompanying materials
6
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
7
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
8
* which accompanies this distribution, and is available at
Lines 14-23 Link Here
14
*   E.D.Willink - Bugs 225493, 243976, 259818
15
*   E.D.Willink - Bugs 225493, 243976, 259818
15
*   Zeligsoft - Bug 243976
16
*   Zeligsoft - Bug 243976
16
*   Borland - Bug 242880
17
*   Borland - Bug 242880
18
*   Adolfo Sanchez- Barbudo Herrera - LPG v 2.0.17 adoption
17
*
19
*
18
* </copyright>
20
* </copyright>
19
*
21
*
20
* $Id: OCLParser.java,v 1.8 2009/08/28 20:43:11 ewillink Exp $
22
* $Id: EssentialOCL.g,v 1.7 2009/03/05 14:12:14 cdamus Exp $
21
*/
23
*/
22
24
23
package org.eclipse.ocl.parser;
25
package org.eclipse.ocl.parser;
Lines 43-58 Link Here
43
import org.eclipse.ocl.cst.VariableCS;
45
import org.eclipse.ocl.cst.VariableCS;
44
import org.eclipse.ocl.util.OCLStandardLibraryUtil;
46
import org.eclipse.ocl.util.OCLStandardLibraryUtil;
45
import org.eclipse.ocl.utilities.PredefinedType;
47
import org.eclipse.ocl.utilities.PredefinedType;
48
import org.eclipse.ocl.lpg.OCLParserStream;
46
49
47
import lpg.lpgjavaruntime.BadParseException;
50
import lpg.runtime.BadParseException;
48
import lpg.lpgjavaruntime.BadParseSymFileException;
51
import lpg.runtime.BadParseSymFileException;
49
import lpg.lpgjavaruntime.DeterministicParser;
52
import lpg.runtime.DeterministicParser;
50
import lpg.lpgjavaruntime.DiagnoseParser;
53
import lpg.runtime.DiagnoseParser;
51
import lpg.lpgjavaruntime.IToken;
54
import lpg.runtime.ErrorToken;
52
import lpg.lpgjavaruntime.Monitor;
55
import lpg.runtime.IToken;
53
import lpg.lpgjavaruntime.NotDeterministicParseTableException;
56
import lpg.runtime.ILexStream;
54
import lpg.lpgjavaruntime.ParseTable;
57
import lpg.runtime.Monitor;
55
import lpg.lpgjavaruntime.RuleAction;
58
import lpg.runtime.NotDeterministicParseTableException;
59
import lpg.runtime.NullExportedSymbolsException;
60
import lpg.runtime.NullTerminalSymbolsException;
61
import lpg.runtime.ParseTable;
62
import lpg.runtime.PrsStream;
63
import lpg.runtime.RuleAction;
64
import lpg.runtime.UndefinedEofSymbolException;
65
import lpg.runtime.UnimplementedTerminalsException;	
56
66
57
import org.eclipse.ocl.Environment;
67
import org.eclipse.ocl.Environment;
58
import org.eclipse.ocl.cst.DefExpressionCS;
68
import org.eclipse.ocl.cst.DefExpressionCS;
Lines 64-159 Link Here
64
74
65
public class OCLParser extends AbstractOCLParser implements RuleAction
75
public class OCLParser extends AbstractOCLParser implements RuleAction
66
{
76
{
67
	protected static ParseTable prs = new OCLParserprs();
77
	private OCLParserStream prsStream = null;
68
	private DeterministicParser dtParser;
78
	
69
79
	private boolean unimplementedSymbolsWarning = false;
70
	public OCLParser(OCLLexer lexer) {
71
		super(lexer);
72
	}
73
74
	public int getEOFTokenKind() { return OCLParserprs.EOFT_SYMBOL; }
75
80
76
	public Environment<?,?,?,?,?,?,?,?,?,?,?,?> getOCLEnvironment() {
81
	private static ParseTable prsTable = new OCLParserprs();
77
		return getLexer().getOCLEnvironment();
82
	public ParseTable getParseTable() { return prsTable; }
78
	}
79
	
83
	
80
	@Override 
84
	private DeterministicParser dtParser = null;
81
	public OCLLexer getLexer() {
85
	public DeterministicParser getParser() { return dtParser; }
82
		return (OCLLexer)super.getLexer();
86
	
83
	}
87
	 private void setResult(Object object) { dtParser.setSym1(object); }
88
    public Object getRhsSym(int i) { return dtParser.getSym(i); }
84
89
85
	public String getTokenKindName(int kind) { return OCLParsersym.orderedTerminalSymbols[kind]; }			
90
    public int getRhsTokenIndex(int i) { return dtParser.getToken(i); }
91
    public IToken getRhsIToken(int i) { return prsStream.getIToken(getRhsTokenIndex(i)); }
92
    
93
    public int getRhsFirstTokenIndex(int i) { return dtParser.getFirstToken(i); }
94
    public IToken getRhsFirstIToken(int i) { return prsStream.getIToken(getRhsFirstTokenIndex(i)); }
95
96
    public int getRhsLastTokenIndex(int i) { return dtParser.getLastToken(i); }
97
    public IToken getRhsLastIToken(int i) { return prsStream.getIToken(getRhsLastTokenIndex(i)); }
98
99
    public int getLeftSpan() { return dtParser.getFirstToken(); }
100
    public IToken getLeftIToken()  { return prsStream.getIToken(getLeftSpan()); }
101
102
    public int getRightSpan() { return dtParser.getLastToken(); }
103
    public IToken getRightIToken() { return prsStream.getIToken(getRightSpan()); }
104
105
    public int getRhsErrorTokenIndex(int i)
106
    {
107
        int index = dtParser.getToken(i);
108
        IToken err = prsStream.getIToken(index);
109
        return (err instanceof ErrorToken ? index : 0);
110
    }
111
    public ErrorToken getRhsErrorIToken(int i)
112
    {
113
        int index = dtParser.getToken(i);
114
        IToken err = prsStream.getIToken(index);
115
        return (ErrorToken) (err instanceof ErrorToken ? err : null);
116
    }
117
118
	public void reset(ILexStream lexStream)
119
    {
120
        prsStream = new OCLParserStream(getEnvironment(), lexStream);
121
        dtParser.reset(prsStream);
122
123
        try
124
        {
125
            prsStream.remapTerminalSymbols(orderedTerminalSymbols(), prsTable.getEoftSymbol());
126
        }
127
        catch(NullExportedSymbolsException e) {
128
        }
129
        catch(NullTerminalSymbolsException e) {
130
        }
131
        catch(UnimplementedTerminalsException e)
132
        {
133
            if (unimplementedSymbolsWarning) {
134
                java.util.ArrayList<?> unimplemented_symbols = e.getSymbols();
135
                System.out.println("The Lexer will not scan the following token(s):");
136
                for (int i = 0; i < unimplemented_symbols.size(); i++)
137
                {
138
                    Integer id = (Integer) unimplemented_symbols.get(i);
139
                    System.out.println("    " + OCLParsersym.orderedTerminalSymbols[id.intValue()]);               
140
                }
141
                System.out.println();
142
            }
143
        }
144
        catch(UndefinedEofSymbolException e)
145
        {
146
            throw new Error(new UndefinedEofSymbolException
147
                                ("The Lexer does not implement the Eof symbol " +
148
                                 OCLParsersym.orderedTerminalSymbols[prsTable.getEoftSymbol()]));
149
        }
150
    }
151
152
    public OCLParser(OCLLexer lexer)
153
    {
154
    		super(lexer);        		
155
        try
156
        {
157
            dtParser = new DeterministicParser(prsStream, prsTable, this);
158
        }
159
        catch (NotDeterministicParseTableException e)
160
        {
161
            throw new RuntimeException("****Error: Regenerate OCLParserprs.java with -NOBACKTRACK option");
162
        }
163
        catch (BadParseSymFileException e)
164
        {
165
            throw new Error(new BadParseSymFileException("Bad Parser Symbol File -- OCLParsersym.java. Regenerate OCLParserprs.java"));
166
        }
167
        
168
        reset(lexer.getILexStream());
169
    }		
170
171
    public int numTokenKinds() { return OCLParsersym.numTokenKinds; }
172
    public String[] orderedTerminalSymbols() { return OCLParsersym.orderedTerminalSymbols; }
173
    public String getTokenKindName(int kind) { return OCLParsersym.orderedTerminalSymbols[kind]; }            
174
    public int getEOFTokenKind() { return prsTable.getEoftSymbol(); }
175
    public OCLParserStream getIPrsStream() { return prsStream; }
86
176
87
	@Override
177
    /**
88
	public String[] orderedTerminalSymbols() { return OCLParsersym.orderedTerminalSymbols; }
178
     * @deprecated replaced by {@link #getIPrsStream()}
89
		
179
     *
90
	@SuppressWarnings("nls")
180
     */
91
	@Override
181
    public PrsStream getPrsStream() { return prsStream; }
92
	public CSTNode parseTokensToCST(Monitor monitor, int error_repair_count) {
93
		ParseTable prsTable = new OCLParserprs();
94
182
95
		try {
183
    /**
96
			dtParser = new DeterministicParser(monitor, this, prsTable, this);
184
     * @deprecated replaced by {@link #getIPrsStream()}
97
		}
185
     *
98
		catch (NotDeterministicParseTableException e) {
186
     */
99
            throw new RuntimeException("****Error: Regenerate OCLParserprs.java with -NOBACKTRACK option");
187
    public PrsStream getParseStream() { return prsStream; }
100
		}
101
		catch (BadParseSymFileException e) {
102
			throw new RuntimeException("****Error: Bad Parser Symbol File -- OCLParsersym.java. Regenerate OCLParserprs.java");
103
		}
104
188
105
		try {
189
    public CSTNode parser()
106
			return (CSTNode) dtParser.parse();
190
    {
107
		}
191
        return parser(null, getDefaultRepairCount());
108
		catch (BadParseException e) {
192
    }
109
			reset(e.error_token); // point to error token
193
        
194
    public CSTNode parser(Monitor monitor)
195
    {
196
        return parser(monitor, getDefaultRepairCount());
197
    }
198
        
199
    public CSTNode parser(int error_repair_count)
200
    {
201
        return parser(null, error_repair_count);
202
    }
203
        
204
    public CSTNode parser(Monitor monitor, int error_repair_count)
205
    {
206
        dtParser.setMonitor(monitor);
207
208
        try
209
        {
210
            return (CSTNode) dtParser.parse();
211
        }
212
        catch (BadParseException e)
213
        {
214
            prsStream.reset(e.error_token); // point to error token
215
216
            DiagnoseParser diagnoseParser = new DiagnoseParser(prsStream, prsTable);
217
            diagnoseParser.diagnose(e.error_token);
218
        }
219
220
        return null;
221
    }
222
223
    //
224
    // Additional entry points, if any
225
    //
226
    
110
227
111
			DiagnoseParser diagnoseParser = new DiagnoseParser(this, prsTable);
228
    // OCL Additions
112
			diagnoseParser.diagnose(e.error_token);
113
		}
114
229
115
		return null;
230
	public Environment<?,?,?,?,?,?,?,?,?,?,?,?> getOCLEnvironment() {
231
		return getLexer().getOCLEnvironment();
116
	}
232
	}
117
233
	
118
    /**
234
	@Override
119
     * Initializes a concrete-syntax node's start and end offsets from the
235
	public OCLLexer getLexer() {
120
     * current token in the parser stream.
236
		return (OCLLexer) super.getLexer();
121
     * 
122
     * @param cstNode a concrete-syntax node
123
     * 
124
     * @since 1.2
125
     */
126
	protected void setOffsets(CSTNode cstNode) {
127
		IToken firstToken = getIToken(dtParser.getToken(1));
128
		cstNode.setStartToken(firstToken);
129
		cstNode.setEndToken(firstToken);
130
		cstNode.setStartOffset(firstToken.getStartOffset());
131
		cstNode.setEndOffset(firstToken.getEndOffset()-1);
132
	}
237
	}
133
238
134
239
240
// Some methods to keep compatibility backwards
241
/**
242
* @since 3.0
243
*/
244
protected IToken getIToken(int i) {
245
	return prsStream.getIToken(i);
246
}
247
	
248
protected String getTokenText(int i) {
249
	return prsStream.getTokenText(i);
250
}
251
135
252
136
	@SuppressWarnings("unchecked")
253
	@SuppressWarnings("unchecked")
137
	public void ruleAction(int ruleNumber)
254
    public void ruleAction(int ruleNumber)
138
	{
255
    {
139
		switch (ruleNumber) {
256
        switch (ruleNumber)
140
		
257
        {
141
 
258
 
142
			//
259
			//
143
			// Rule 46:  binaryName ::= binaryIdentifier
260
			// Rule 46:  binaryName ::= binaryIdentifier
144
			//
261
			//
262
			
145
			case 46:
263
			case 46:
146
 
264
 
147
			//
265
			//
148
			// Rule 47:  keywordAsName ::= keywordAsIdentifier
266
			// Rule 47:  keywordAsName ::= keywordAsIdentifier
149
			//
267
			//
268
			
150
			case 47:
269
			case 47:
151
 
270
 
152
			//
271
			//
153
			// Rule 48:  keywordAsName1 ::= keywordAsIdentifier1
272
			// Rule 48:  keywordAsName1 ::= keywordAsIdentifier1
154
			//
273
			//
274
			
155
			case 48:
275
			case 48:
156
 
276
157
			//
277
			//
158
			// Rule 49:  unaryName ::= unaryIdentifier
278
			// Rule 49:  unaryName ::= unaryIdentifier
159
			//
279
			//
Lines 161-183 Link Here
161
				
281
				
162
				SimpleNameCS result = createSimpleNameCS(
282
				SimpleNameCS result = createSimpleNameCS(
163
							SimpleTypeEnum.IDENTIFIER_LITERAL,
283
							SimpleTypeEnum.IDENTIFIER_LITERAL,
164
							getTokenText(dtParser.getToken(1))
284
							getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
285
            getParser().getToken(1))
165
						);
286
						);
166
				setOffsets(result, getIToken(dtParser.getToken(1)));
287
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
167
				dtParser.setSym1(result);
288
            getParser().getToken(1)));
168
	  		  break;
289
				 // macro setResult is deprecated. Use function setResult
169
			}
290
             getParser().setSym1(result);
291
	                  break;
292
            }
170
	 
293
	 
171
			//
294
			//
172
			// Rule 50:  iterateName ::= iterate
295
			// Rule 50:  iterateName ::= iterate
173
			//
296
			//
297
			
174
			case 50:
298
			case 50:
175
 
299
 
176
			//
300
			//
177
			// Rule 51:  iteratorName ::= iteratorIdentifier
301
			// Rule 51:  iteratorName ::= iteratorIdentifier
178
			//
302
			//
303
			
179
			case 51:
304
			case 51:
180
 
305
181
			//
306
			//
182
			// Rule 52:  oclIsInStateName ::= oclIsInState
307
			// Rule 52:  oclIsInStateName ::= oclIsInState
183
			//
308
			//
Lines 185-307 Link Here
185
				
310
				
186
				SimpleNameCS result = createSimpleNameCS(
311
				SimpleNameCS result = createSimpleNameCS(
187
							SimpleTypeEnum.KEYWORD_LITERAL,
312
							SimpleTypeEnum.KEYWORD_LITERAL,
188
							getTokenText(dtParser.getToken(1))
313
							getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
314
            getParser().getToken(1))
189
						);
315
						);
190
				setOffsets(result, getIToken(dtParser.getToken(1)));
316
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
191
				dtParser.setSym1(result);
317
            getParser().getToken(1)));
192
	  		  break;
318
				 // macro setResult is deprecated. Use function setResult
193
			}
319
             getParser().setSym1(result);
194
	 
320
	                  break;
321
            }
322
	
195
			//
323
			//
196
			// Rule 55:  operationCS1 ::= IDENTIFIER ( parametersCSopt ) : typeCSopt
324
			// Rule 55:  operationCS1 ::= IDENTIFIER ( parametersCSopt ) : typeCSopt
197
			//
325
			//
198
			case 55: {
326
			case 55: {
199
				
327
				
200
				CSTNode result = createOperationCS(
328
				CSTNode result = createOperationCS(
201
						getTokenText(dtParser.getToken(1)),
329
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
202
						(EList)dtParser.getSym(3),
330
            getParser().getToken(1)),
203
						(TypeCS)dtParser.getSym(6)
331
						(EList) // macro getSym is deprecated. Use function getRhsSym
204
					);
332
          getParser().getSym(3),
205
				if (dtParser.getSym(6) != null) {
333
						(TypeCS) // macro getSym is deprecated. Use function getRhsSym
206
					setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(6));
334
          getParser().getSym(6)
335
					);
336
				if ( // macro getSym is deprecated. Use function getRhsSym
337
          getParser().getSym(6) != null) {
338
					setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
339
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
340
          getParser().getSym(6));
207
				} else {
341
				} else {
208
					setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(5)));
342
					setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
343
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
344
            getParser().getToken(5)));
209
				}
345
				}
210
				dtParser.setSym1(result);
346
				 // macro setResult is deprecated. Use function setResult
211
	  		  break;
347
             getParser().setSym1(result);
212
			}
348
	                  break;
213
	 
349
            }
350
	
214
			//
351
			//
215
			// Rule 56:  operationCS2 ::= pathNameCS :: simpleNameCS ( parametersCSopt ) : typeCSopt
352
			// Rule 56:  operationCS2 ::= pathNameCS :: simpleNameCS ( parametersCSopt ) : typeCSopt
216
			//
353
			//
217
			case 56: {
354
			case 56: {
218
				
355
				
219
				CSTNode result = createOperationCS(
356
				CSTNode result = createOperationCS(
220
						(PathNameCS)dtParser.getSym(1),
357
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
221
						(SimpleNameCS)dtParser.getSym(3),
358
          getParser().getSym(1),
222
						(EList)dtParser.getSym(5),
359
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
223
						(TypeCS)dtParser.getSym(8)
360
          getParser().getSym(3),
224
					);
361
						(EList) // macro getSym is deprecated. Use function getRhsSym
225
				if (dtParser.getSym(8) != null) {
362
          getParser().getSym(5),
226
					setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(8));
363
						(TypeCS) // macro getSym is deprecated. Use function getRhsSym
364
          getParser().getSym(8)
365
					);
366
				if ( // macro getSym is deprecated. Use function getRhsSym
367
          getParser().getSym(8) != null) {
368
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
369
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
370
          getParser().getSym(8));
227
				} else {
371
				} else {
228
					setOffsets(result, (CSTNode)dtParser.getSym(1), getIToken(dtParser.getToken(7)));
372
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
373
          getParser().getSym(1), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
374
            getParser().getToken(7)));
229
				}
375
				}
230
				dtParser.setSym1(result);
376
				 // macro setResult is deprecated. Use function setResult
231
	  		  break;
377
             getParser().setSym1(result);
232
			}
378
	                  break;
379
            }
233
	 
380
	 
234
			//
381
			//
235
			// Rule 57:  parametersCSopt ::= $Empty
382
			// Rule 57:  parametersCSopt ::= $Empty
236
			//
383
			//
384
			
237
			case 57:
385
			case 57:
238
				dtParser.setSym1(new BasicEList());
386
				setResult(new BasicEList());
239
				break;
387
				break;
240
 
388
241
			//
389
			//
242
			// Rule 59:  parametersCS ::= variableCS
390
			// Rule 59:  parametersCS ::= variableCS
243
			//
391
			//
244
			case 59: {
392
			case 59: {
245
				
393
				
246
				EList result = new BasicEList();
394
				EList result = new BasicEList();
247
				result.add(dtParser.getSym(1));
395
				result.add( // macro getSym is deprecated. Use function getRhsSym
248
				dtParser.setSym1(result);
396
          getParser().getSym(1));
249
	  		  break;
397
				 // macro setResult is deprecated. Use function setResult
250
			}
398
             getParser().setSym1(result);
251
	 
399
	                  break;
400
            }
401
	
252
			//
402
			//
253
			// Rule 60:  parametersCS ::= parametersCS , variableCS
403
			// Rule 60:  parametersCS ::= parametersCS , variableCS
254
			//
404
			//
255
			case 60: {
405
			case 60: {
256
				
406
				
257
				EList result = (EList)dtParser.getSym(1);
407
				EList result = (EList) // macro getSym is deprecated. Use function getRhsSym
258
				result.add(dtParser.getSym(3));
408
          getParser().getSym(1);
259
				dtParser.setSym1(result);
409
				result.add( // macro getSym is deprecated. Use function getRhsSym
260
	  		  break;
410
          getParser().getSym(3));
261
			}
411
				 // macro setResult is deprecated. Use function setResult
262
	 
412
             getParser().setSym1(result);
413
	                  break;
414
            }
415
	
263
			//
416
			//
264
			// Rule 61:  simpleNameCSopt ::= $Empty
417
			// Rule 61:  simpleNameCSopt ::= $Empty
265
			//
418
			//
266
			case 61:
419
			case 61:
267
				dtParser.setSym1(null);
420
                setResult(null);
268
				break;
421
                break;
269
 
422
 
270
			//
423
			//
271
			// Rule 67:  impliesExpCS ::= impliesExpCS implies andOrXorExpCS
424
			// Rule 67:  impliesExpCS ::= impliesExpCS implies andOrXorExpCS
272
			//
425
			//
426
			
273
			case 67:
427
			case 67:
274
 
428
 
275
			//
429
			//
276
			// Rule 68:  impliesWithLet ::= impliesExpCS implies andOrXorWithLet
430
			// Rule 68:  impliesWithLet ::= impliesExpCS implies andOrXorWithLet
277
			//
431
			//
432
			
278
			case 68:
433
			case 68:
279
 
434
 
280
			//
435
			//
281
			// Rule 71:  andOrXorExpCS ::= andOrXorExpCS and equalityExpCS
436
			// Rule 71:  andOrXorExpCS ::= andOrXorExpCS and equalityExpCS
282
			//
437
			//
438
			
283
			case 71:
439
			case 71:
284
 
440
 
285
			//
441
			//
286
			// Rule 72:  andOrXorExpCS ::= andOrXorExpCS or equalityExpCS
442
			// Rule 72:  andOrXorExpCS ::= andOrXorExpCS or equalityExpCS
287
			//
443
			//
444
			
288
			case 72:
445
			case 72:
289
 
446
 
290
			//
447
			//
291
			// Rule 73:  andOrXorExpCS ::= andOrXorExpCS xor equalityExpCS
448
			// Rule 73:  andOrXorExpCS ::= andOrXorExpCS xor equalityExpCS
292
			//
449
			//
450
			
293
			case 73:
451
			case 73:
294
 
452
 
295
			//
453
			//
296
			// Rule 74:  andOrXorWithLet ::= andOrXorExpCS and equalityWithLet
454
			// Rule 74:  andOrXorWithLet ::= andOrXorExpCS and equalityWithLet
297
			//
455
			//
456
			
298
			case 74:
457
			case 74:
299
 
458
 
300
			//
459
			//
301
			// Rule 75:  andOrXorWithLet ::= andOrXorExpCS or equalityWithLet
460
			// Rule 75:  andOrXorWithLet ::= andOrXorExpCS or equalityWithLet
302
			//
461
			//
462
			
303
			case 75:
463
			case 75:
304
 
464
305
			//
465
			//
306
			// Rule 76:  andOrXorWithLet ::= andOrXorExpCS xor equalityWithLet
466
			// Rule 76:  andOrXorWithLet ::= andOrXorExpCS xor equalityWithLet
307
			//
467
			//
Lines 309-334 Link Here
309
				
469
				
310
				SimpleNameCS simpleNameCS = createSimpleNameCS(
470
				SimpleNameCS simpleNameCS = createSimpleNameCS(
311
							SimpleTypeEnum.STRING_LITERAL,
471
							SimpleTypeEnum.STRING_LITERAL,
312
							getTokenText(dtParser.getToken(2))
472
							getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
473
            getParser().getToken(2))
313
						);
474
						);
314
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
475
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
476
            getParser().getToken(2)));
315
				EList args = new BasicEList();
477
				EList args = new BasicEList();
316
				args.add(dtParser.getSym(3));
478
				args.add( // macro getSym is deprecated. Use function getRhsSym
479
          getParser().getSym(3));
317
				CSTNode result = createOperationCallExpCS(
480
				CSTNode result = createOperationCallExpCS(
318
						(OCLExpressionCS)dtParser.getSym(1),
481
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
482
          getParser().getSym(1),
319
						simpleNameCS,
483
						simpleNameCS,
320
						args
484
						args
321
					);
485
					);
322
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
486
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
323
				dtParser.setSym1(result);
487
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
324
	  		  break;
488
          getParser().getSym(3));
325
			}
489
				 // macro setResult is deprecated. Use function setResult
490
             getParser().setSym1(result);
491
	                  break;
492
            }
326
	 
493
	 
327
			//
494
			//
328
			// Rule 79:  equalityExpCS ::= equalityExpCS = relationalExpCS
495
			// Rule 79:  equalityExpCS ::= equalityExpCS = relationalExpCS
329
			//
496
			//
497
			
330
			case 79:
498
			case 79:
331
 
499
332
			//
500
			//
333
			// Rule 80:  equalityWithLet ::= equalityExpCS = relationalWithLet
501
			// Rule 80:  equalityWithLet ::= equalityExpCS = relationalWithLet
334
			//
502
			//
Lines 338-361 Link Here
338
							SimpleTypeEnum.STRING_LITERAL,
506
							SimpleTypeEnum.STRING_LITERAL,
339
							OCLStandardLibraryUtil.getOperationName(PredefinedType.EQUAL)
507
							OCLStandardLibraryUtil.getOperationName(PredefinedType.EQUAL)
340
						);
508
						);
341
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
509
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
510
            getParser().getToken(2)));
342
				EList args = new BasicEList();
511
				EList args = new BasicEList();
343
				args.add(dtParser.getSym(3));
512
				args.add( // macro getSym is deprecated. Use function getRhsSym
513
          getParser().getSym(3));
344
				CSTNode result = createOperationCallExpCS(
514
				CSTNode result = createOperationCallExpCS(
345
						(OCLExpressionCS)dtParser.getSym(1),
515
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
516
          getParser().getSym(1),
346
						simpleNameCS,
517
						simpleNameCS,
347
						args
518
						args
348
					);
519
					);
349
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
520
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
350
				dtParser.setSym1(result);
521
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
351
	  		  break;
522
          getParser().getSym(3));
352
			}
523
				 // macro setResult is deprecated. Use function setResult
524
             getParser().setSym1(result);
525
	                  break;
526
            }
353
	 
527
	 
354
			//
528
			//
355
			// Rule 81:  equalityExpCS ::= equalityExpCS <> relationalExpCS
529
			// Rule 81:  equalityExpCS ::= equalityExpCS <> relationalExpCS
356
			//
530
			//
531
			
357
			case 81:
532
			case 81:
358
 
533
359
			//
534
			//
360
			// Rule 82:  equalityWithLet ::= equalityExpCS <> relationalWithLet
535
			// Rule 82:  equalityWithLet ::= equalityExpCS <> relationalWithLet
361
			//
536
			//
Lines 365-388 Link Here
365
							SimpleTypeEnum.STRING_LITERAL,
540
							SimpleTypeEnum.STRING_LITERAL,
366
							OCLStandardLibraryUtil.getOperationName(PredefinedType.NOT_EQUAL)
541
							OCLStandardLibraryUtil.getOperationName(PredefinedType.NOT_EQUAL)
367
						);
542
						);
368
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
543
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
544
            getParser().getToken(2)));
369
				EList args = new BasicEList();
545
				EList args = new BasicEList();
370
				args.add(dtParser.getSym(3));
546
				args.add( // macro getSym is deprecated. Use function getRhsSym
547
          getParser().getSym(3));
371
				CSTNode result = createOperationCallExpCS(
548
				CSTNode result = createOperationCallExpCS(
372
						(OCLExpressionCS)dtParser.getSym(1),
549
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
550
          getParser().getSym(1),
373
						simpleNameCS,
551
						simpleNameCS,
374
						args
552
						args
375
					);
553
					);
376
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
554
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
377
				dtParser.setSym1(result);
555
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
378
	  		  break;
556
          getParser().getSym(3));
379
			}
557
				 // macro setResult is deprecated. Use function setResult
558
             getParser().setSym1(result);
559
	                  break;
560
            }
380
	 
561
	 
381
			//
562
			//
382
			// Rule 85:  relationalExpCS ::= relationalExpCS > ifExpCSPrec
563
			// Rule 85:  relationalExpCS ::= relationalExpCS > ifExpCSPrec
383
			//
564
			//
565
			
384
			case 85:
566
			case 85:
385
 
567
386
			//
568
			//
387
			// Rule 86:  relationalWithLet ::= relationalExpCS > additiveWithLet
569
			// Rule 86:  relationalWithLet ::= relationalExpCS > additiveWithLet
388
			//
570
			//
Lines 392-415 Link Here
392
							SimpleTypeEnum.STRING_LITERAL,
574
							SimpleTypeEnum.STRING_LITERAL,
393
							OCLStandardLibraryUtil.getOperationName(PredefinedType.GREATER_THAN)
575
							OCLStandardLibraryUtil.getOperationName(PredefinedType.GREATER_THAN)
394
						);
576
						);
395
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
577
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
578
            getParser().getToken(2)));
396
				EList args = new BasicEList();
579
				EList args = new BasicEList();
397
				args.add(dtParser.getSym(3));
580
				args.add( // macro getSym is deprecated. Use function getRhsSym
581
          getParser().getSym(3));
398
				CSTNode result = createOperationCallExpCS(
582
				CSTNode result = createOperationCallExpCS(
399
						(OCLExpressionCS)dtParser.getSym(1),
583
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
584
          getParser().getSym(1),
400
						simpleNameCS,
585
						simpleNameCS,
401
						args
586
						args
402
					);
587
					);
403
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
588
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
404
				dtParser.setSym1(result);
589
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
405
	  		  break;
590
          getParser().getSym(3));
406
			}
591
				 // macro setResult is deprecated. Use function setResult
592
             getParser().setSym1(result);
593
	                  break;
594
            }
407
	 
595
	 
408
			//
596
			//
409
			// Rule 87:  relationalExpCS ::= relationalExpCS < ifExpCSPrec
597
			// Rule 87:  relationalExpCS ::= relationalExpCS < ifExpCSPrec
410
			//
598
			//
599
			
411
			case 87:
600
			case 87:
412
 
601
413
			//
602
			//
414
			// Rule 88:  relationalWithLet ::= relationalExpCS < additiveWithLet
603
			// Rule 88:  relationalWithLet ::= relationalExpCS < additiveWithLet
415
			//
604
			//
Lines 419-442 Link Here
419
							SimpleTypeEnum.STRING_LITERAL,
608
							SimpleTypeEnum.STRING_LITERAL,
420
							OCLStandardLibraryUtil.getOperationName(PredefinedType.LESS_THAN)
609
							OCLStandardLibraryUtil.getOperationName(PredefinedType.LESS_THAN)
421
						);
610
						);
422
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
611
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
612
            getParser().getToken(2)));
423
				EList args = new BasicEList();
613
				EList args = new BasicEList();
424
				args.add(dtParser.getSym(3));
614
				args.add( // macro getSym is deprecated. Use function getRhsSym
615
          getParser().getSym(3));
425
				CSTNode result = createOperationCallExpCS(
616
				CSTNode result = createOperationCallExpCS(
426
						(OCLExpressionCS)dtParser.getSym(1),
617
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
618
          getParser().getSym(1),
427
						simpleNameCS,
619
						simpleNameCS,
428
						args
620
						args
429
					);
621
					);
430
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
622
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
431
				dtParser.setSym1(result);
623
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
432
	  		  break;
624
          getParser().getSym(3));
433
			}
625
				 // macro setResult is deprecated. Use function setResult
626
             getParser().setSym1(result);
627
	                  break;
628
            }
434
	 
629
	 
435
			//
630
			//
436
			// Rule 89:  relationalExpCS ::= relationalExpCS >= ifExpCSPrec
631
			// Rule 89:  relationalExpCS ::= relationalExpCS >= ifExpCSPrec
437
			//
632
			//
633
			
438
			case 89:
634
			case 89:
439
 
635
440
			//
636
			//
441
			// Rule 90:  relationalWithLet ::= relationalExpCS >= additiveWithLet
637
			// Rule 90:  relationalWithLet ::= relationalExpCS >= additiveWithLet
442
			//
638
			//
Lines 446-469 Link Here
446
							SimpleTypeEnum.STRING_LITERAL,
642
							SimpleTypeEnum.STRING_LITERAL,
447
							OCLStandardLibraryUtil.getOperationName(PredefinedType.GREATER_THAN_EQUAL)
643
							OCLStandardLibraryUtil.getOperationName(PredefinedType.GREATER_THAN_EQUAL)
448
						);
644
						);
449
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
645
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
646
            getParser().getToken(2)));
450
				EList args = new BasicEList();
647
				EList args = new BasicEList();
451
				args.add(dtParser.getSym(3));
648
				args.add( // macro getSym is deprecated. Use function getRhsSym
649
          getParser().getSym(3));
452
				CSTNode result = createOperationCallExpCS(
650
				CSTNode result = createOperationCallExpCS(
453
						(OCLExpressionCS)dtParser.getSym(1),
651
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
652
          getParser().getSym(1),
454
						simpleNameCS,
653
						simpleNameCS,
455
						args
654
						args
456
					);
655
					);
457
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
656
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
458
				dtParser.setSym1(result);
657
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
459
	  		  break;
658
          getParser().getSym(3));
460
			}
659
				 // macro setResult is deprecated. Use function setResult
660
             getParser().setSym1(result);
661
	                  break;
662
            }
461
	 
663
	 
462
			//
664
			//
463
			// Rule 91:  relationalExpCS ::= relationalExpCS <= ifExpCSPrec
665
			// Rule 91:  relationalExpCS ::= relationalExpCS <= ifExpCSPrec
464
			//
666
			//
667
			
465
			case 91:
668
			case 91:
466
 
669
467
			//
670
			//
468
			// Rule 92:  relationalWithLet ::= relationalExpCS <= additiveWithLet
671
			// Rule 92:  relationalWithLet ::= relationalExpCS <= additiveWithLet
469
			//
672
			//
Lines 473-496 Link Here
473
							SimpleTypeEnum.STRING_LITERAL,
676
							SimpleTypeEnum.STRING_LITERAL,
474
							OCLStandardLibraryUtil.getOperationName(PredefinedType.LESS_THAN_EQUAL)
677
							OCLStandardLibraryUtil.getOperationName(PredefinedType.LESS_THAN_EQUAL)
475
						);
678
						);
476
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
679
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
680
            getParser().getToken(2)));
477
				EList args = new BasicEList();
681
				EList args = new BasicEList();
478
				args.add(dtParser.getSym(3));
682
				args.add( // macro getSym is deprecated. Use function getRhsSym
683
          getParser().getSym(3));
479
				CSTNode result = createOperationCallExpCS(
684
				CSTNode result = createOperationCallExpCS(
480
						(OCLExpressionCS)dtParser.getSym(1),
685
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
686
          getParser().getSym(1),
481
						simpleNameCS,
687
						simpleNameCS,
482
						args
688
						args
483
					);
689
					);
484
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
690
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
485
				dtParser.setSym1(result);
691
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
486
	  		  break;
692
          getParser().getSym(3));
487
			}
693
				 // macro setResult is deprecated. Use function setResult
694
             getParser().setSym1(result);
695
	                  break;
696
            }
488
	 
697
	 
489
			//
698
			//
490
			// Rule 97:  additiveExpCS ::= additiveExpCS + multiplicativeExpCS
699
			// Rule 97:  additiveExpCS ::= additiveExpCS + multiplicativeExpCS
491
			//
700
			//
701
			
492
			case 97:
702
			case 97:
493
 
703
494
			//
704
			//
495
			// Rule 98:  additiveWithLet ::= additiveExpCS + multiplicativeWithLet
705
			// Rule 98:  additiveWithLet ::= additiveExpCS + multiplicativeWithLet
496
			//
706
			//
Lines 500-523 Link Here
500
							SimpleTypeEnum.STRING_LITERAL,
710
							SimpleTypeEnum.STRING_LITERAL,
501
							OCLStandardLibraryUtil.getOperationName(PredefinedType.PLUS)
711
							OCLStandardLibraryUtil.getOperationName(PredefinedType.PLUS)
502
						);
712
						);
503
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
713
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
714
            getParser().getToken(2)));
504
				EList args = new BasicEList();
715
				EList args = new BasicEList();
505
				args.add(dtParser.getSym(3));
716
				args.add( // macro getSym is deprecated. Use function getRhsSym
717
          getParser().getSym(3));
506
				CSTNode result = createOperationCallExpCS(
718
				CSTNode result = createOperationCallExpCS(
507
						(OCLExpressionCS)dtParser.getSym(1),
719
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
720
          getParser().getSym(1),
508
						simpleNameCS,
721
						simpleNameCS,
509
						args
722
						args
510
					);
723
					);
511
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
724
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
512
				dtParser.setSym1(result);
725
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
513
	  		  break;
726
          getParser().getSym(3));
514
			}
727
				 // macro setResult is deprecated. Use function setResult
728
             getParser().setSym1(result);
729
	                  break;
730
            }
515
	 
731
	 
516
			//
732
			//
517
			// Rule 99:  additiveExpCS ::= additiveExpCS - multiplicativeExpCS
733
			// Rule 99:  additiveExpCS ::= additiveExpCS - multiplicativeExpCS
518
			//
734
			//
735
			
519
			case 99:
736
			case 99:
520
 
737
521
			//
738
			//
522
			// Rule 100:  additiveWithLet ::= additiveExpCS - multiplicativeWithLet
739
			// Rule 100:  additiveWithLet ::= additiveExpCS - multiplicativeWithLet
523
			//
740
			//
Lines 527-550 Link Here
527
							SimpleTypeEnum.STRING_LITERAL,
744
							SimpleTypeEnum.STRING_LITERAL,
528
							OCLStandardLibraryUtil.getOperationName(PredefinedType.MINUS)
745
							OCLStandardLibraryUtil.getOperationName(PredefinedType.MINUS)
529
						);
746
						);
530
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
747
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
748
            getParser().getToken(2)));
531
				EList args = new BasicEList();
749
				EList args = new BasicEList();
532
				args.add(dtParser.getSym(3));
750
				args.add( // macro getSym is deprecated. Use function getRhsSym
751
          getParser().getSym(3));
533
				CSTNode result = createOperationCallExpCS(
752
				CSTNode result = createOperationCallExpCS(
534
						(OCLExpressionCS)dtParser.getSym(1),
753
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
754
          getParser().getSym(1),
535
						simpleNameCS,
755
						simpleNameCS,
536
						args
756
						args
537
					);
757
					);
538
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
758
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
539
				dtParser.setSym1(result);
759
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
540
	  		  break;
760
          getParser().getSym(3));
541
			}
761
				 // macro setResult is deprecated. Use function setResult
762
             getParser().setSym1(result);
763
	                  break;
764
            }
542
	 
765
	 
543
			//
766
			//
544
			// Rule 103:  multiplicativeExpCS ::= multiplicativeExpCS * unaryExpCS
767
			// Rule 103:  multiplicativeExpCS ::= multiplicativeExpCS * unaryExpCS
545
			//
768
			//
769
			
546
			case 103:
770
			case 103:
547
 
771
548
			//
772
			//
549
			// Rule 104:  multiplicativeWithLet ::= multiplicativeExpCS * unaryWithLet
773
			// Rule 104:  multiplicativeWithLet ::= multiplicativeExpCS * unaryWithLet
550
			//
774
			//
Lines 554-577 Link Here
554
							SimpleTypeEnum.STRING_LITERAL,
778
							SimpleTypeEnum.STRING_LITERAL,
555
							OCLStandardLibraryUtil.getOperationName(PredefinedType.TIMES)
779
							OCLStandardLibraryUtil.getOperationName(PredefinedType.TIMES)
556
						);
780
						);
557
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
781
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
782
            getParser().getToken(2)));
558
				EList args = new BasicEList();
783
				EList args = new BasicEList();
559
				args.add(dtParser.getSym(3));
784
				args.add( // macro getSym is deprecated. Use function getRhsSym
785
          getParser().getSym(3));
560
				CSTNode result = createOperationCallExpCS(
786
				CSTNode result = createOperationCallExpCS(
561
						(OCLExpressionCS)dtParser.getSym(1),
787
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
788
          getParser().getSym(1),
562
						simpleNameCS,
789
						simpleNameCS,
563
						args
790
						args
564
					);
791
					);
565
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
792
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
566
				dtParser.setSym1(result);
793
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
567
	  		  break;
794
          getParser().getSym(3));
568
			}
795
				 // macro setResult is deprecated. Use function setResult
796
             getParser().setSym1(result);
797
	                  break;
798
            }
569
	 
799
	 
570
			//
800
			//
571
			// Rule 105:  multiplicativeExpCS ::= multiplicativeExpCS / unaryExpCS
801
			// Rule 105:  multiplicativeExpCS ::= multiplicativeExpCS / unaryExpCS
572
			//
802
			//
803
			
573
			case 105:
804
			case 105:
574
 
805
575
			//
806
			//
576
			// Rule 106:  multiplicativeWithLet ::= multiplicativeExpCS / unaryWithLet
807
			// Rule 106:  multiplicativeWithLet ::= multiplicativeExpCS / unaryWithLet
577
			//
808
			//
Lines 581-599 Link Here
581
							SimpleTypeEnum.STRING_LITERAL,
812
							SimpleTypeEnum.STRING_LITERAL,
582
							OCLStandardLibraryUtil.getOperationName(PredefinedType.DIVIDE)
813
							OCLStandardLibraryUtil.getOperationName(PredefinedType.DIVIDE)
583
						);
814
						);
584
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
815
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
816
            getParser().getToken(2)));
585
				EList args = new BasicEList();
817
				EList args = new BasicEList();
586
				args.add(dtParser.getSym(3));
818
				args.add( // macro getSym is deprecated. Use function getRhsSym
819
          getParser().getSym(3));
587
				CSTNode result = createOperationCallExpCS(
820
				CSTNode result = createOperationCallExpCS(
588
						(OCLExpressionCS)dtParser.getSym(1),
821
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
822
          getParser().getSym(1),
589
						simpleNameCS,
823
						simpleNameCS,
590
						args
824
						args
591
					);
825
					);
592
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
826
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
593
				dtParser.setSym1(result);
827
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
594
	  		  break;
828
          getParser().getSym(3));
595
			}
829
				 // macro setResult is deprecated. Use function setResult
596
	 
830
             getParser().setSym1(result);
831
	                  break;
832
            }
833
	
597
			//
834
			//
598
			// Rule 109:  unaryExpCS ::= - unaryExpCS
835
			// Rule 109:  unaryExpCS ::= - unaryExpCS
599
			//
836
			//
Lines 603-619 Link Here
603
							SimpleTypeEnum.STRING_LITERAL,
840
							SimpleTypeEnum.STRING_LITERAL,
604
							OCLStandardLibraryUtil.getOperationName(PredefinedType.MINUS)
841
							OCLStandardLibraryUtil.getOperationName(PredefinedType.MINUS)
605
						);
842
						);
606
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(1)));
843
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
844
            getParser().getToken(1)));
607
				CSTNode result = createOperationCallExpCS(
845
				CSTNode result = createOperationCallExpCS(
608
						(OCLExpressionCS)dtParser.getSym(2),
846
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
847
          getParser().getSym(2),
609
						simpleNameCS,
848
						simpleNameCS,
610
						new BasicEList()
849
						new BasicEList()
611
					);
850
					);
612
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(2));
851
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
613
				dtParser.setSym1(result);
852
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
614
	  		  break;
853
          getParser().getSym(2));
615
			}
854
				 // macro setResult is deprecated. Use function setResult
616
	 
855
             getParser().setSym1(result);
856
	                  break;
857
            }
858
	
617
			//
859
			//
618
			// Rule 110:  unaryExpCS ::= not unaryExpCS
860
			// Rule 110:  unaryExpCS ::= not unaryExpCS
619
			//
861
			//
Lines 621-663 Link Here
621
				
863
				
622
				SimpleNameCS simpleNameCS = createSimpleNameCS(
864
				SimpleNameCS simpleNameCS = createSimpleNameCS(
623
							SimpleTypeEnum.STRING_LITERAL,
865
							SimpleTypeEnum.STRING_LITERAL,
624
							getTokenText(dtParser.getToken(1))
866
							getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
867
            getParser().getToken(1))
625
						);
868
						);
626
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(1)));
869
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
870
            getParser().getToken(1)));
627
				CSTNode result = createOperationCallExpCS(
871
				CSTNode result = createOperationCallExpCS(
628
						(OCLExpressionCS)dtParser.getSym(2),
872
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
873
          getParser().getSym(2),
629
						simpleNameCS,
874
						simpleNameCS,
630
						new BasicEList()
875
						new BasicEList()
631
					);
876
					);
632
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(2));
877
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
633
				dtParser.setSym1(result);
878
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
634
	  		  break;
879
          getParser().getSym(2));
635
			}
880
				 // macro setResult is deprecated. Use function setResult
636
	 
881
             getParser().setSym1(result);
882
	                  break;
883
            }
884
	
637
			//
885
			//
638
			// Rule 112:  dotArrowExpCS ::= dotArrowExpCS callExpCS
886
			// Rule 112:  dotArrowExpCS ::= dotArrowExpCS callExpCS
639
			//
887
			//
640
			case 112: {
888
			case 112: {
641
				
889
				
642
				CallExpCS result = (CallExpCS)dtParser.getSym(2);
890
				CallExpCS result = (CallExpCS) // macro getSym is deprecated. Use function getRhsSym
643
				result.setSource((OCLExpressionCS)dtParser.getSym(1));
891
          getParser().getSym(2);
644
				setOffsets(result, (CSTNode)dtParser.getSym(1), result);
892
				result.setSource((OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
645
				dtParser.setSym1(result);
893
          getParser().getSym(1));
646
	  		  break;
894
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
647
			}
895
          getParser().getSym(1), result);
648
	 
896
				 // macro setResult is deprecated. Use function setResult
897
             getParser().setSym1(result);
898
	                  break;
899
            }
900
	
649
			//
901
			//
650
			// Rule 113:  dotArrowExpCS ::= dotArrowExpCS messageExpCS
902
			// Rule 113:  dotArrowExpCS ::= dotArrowExpCS messageExpCS
651
			//
903
			//
652
			case 113: {
904
			case 113: {
653
				
905
				
654
				MessageExpCS result = (MessageExpCS)dtParser.getSym(2);
906
				MessageExpCS result = (MessageExpCS) // macro getSym is deprecated. Use function getRhsSym
655
				result.setTarget((OCLExpressionCS)dtParser.getSym(1));
907
          getParser().getSym(2);
656
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(2));
908
				result.setTarget((OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
657
				dtParser.setSym1(result);
909
          getParser().getSym(1));
658
	  		  break;
910
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
659
			}
911
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
660
	 
912
          getParser().getSym(2));
913
				 // macro setResult is deprecated. Use function setResult
914
             getParser().setSym1(result);
915
	                  break;
916
            }
917
	
661
			//
918
			//
662
			// Rule 114:  dotArrowExpCS ::= NUMERIC_OPERATION ( argumentsCSopt )
919
			// Rule 114:  dotArrowExpCS ::= NUMERIC_OPERATION ( argumentsCSopt )
663
			//
920
			//
Lines 670-676 Link Here
670
				String simpleName = text.substring(index + 1);
927
				String simpleName = text.substring(index + 1);
671
928
672
				// create the IntegerLiteralExpCS
929
				// create the IntegerLiteralExpCS
673
				IToken numericToken = getIToken(dtParser.getToken(1));
930
				IToken numericToken = getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
931
            getParser().getToken(1));
674
				int startOffset = numericToken.getStartOffset();
932
				int startOffset = numericToken.getStartOffset();
675
				int endOffset = startOffset + integer.length() - 1; // inclusive
933
				int endOffset = startOffset + integer.length() - 1; // inclusive
676
934
Lines 681-687 Link Here
681
				integerLiteralExpCS.setEndToken(numericToken);
939
				integerLiteralExpCS.setEndToken(numericToken);
682
940
683
				startOffset = endOffset + 2; // end of integerLiteral + 1('.') + 1(start of simpleName)
941
				startOffset = endOffset + 2; // end of integerLiteral + 1('.') + 1(start of simpleName)
684
				endOffset = getIToken(dtParser.getToken(1)).getEndOffset();
942
				endOffset = getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
943
            getParser().getToken(1)).getEndOffset();
685
944
686
				// create the SimpleNameCS
945
				// create the SimpleNameCS
687
				SimpleNameCS simpleNameCS = createSimpleNameCS(
946
				SimpleNameCS simpleNameCS = createSimpleNameCS(
Lines 697-786 Link Here
697
				CSTNode result = createOperationCallExpCS(
956
				CSTNode result = createOperationCallExpCS(
698
						integerLiteralExpCS,
957
						integerLiteralExpCS,
699
						simpleNameCS,
958
						simpleNameCS,
700
						(EList)dtParser.getSym(3)
959
						(EList) // macro getSym is deprecated. Use function getRhsSym
960
          getParser().getSym(3)
701
					);
961
					);
702
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
962
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
703
				dtParser.setSym1(result);
963
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
704
	  		  break;
964
            getParser().getToken(4)));
705
			}
965
				 // macro setResult is deprecated. Use function setResult
706
	 
966
             getParser().setSym1(result);
967
	                  break;
968
            }
969
	
707
			//
970
			//
708
			// Rule 115:  dotArrowExpCS ::= pathNameCS :: simpleNameCS ( argumentsCSopt )
971
			// Rule 115:  dotArrowExpCS ::= pathNameCS :: simpleNameCS ( argumentsCSopt )
709
			//
972
			//
710
			case 115: {
973
			case 115: {
711
				
974
				
712
				OperationCallExpCS result = createOperationCallExpCS(
975
				OperationCallExpCS result = createOperationCallExpCS(
713
						(PathNameCS)dtParser.getSym(1),
976
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
714
						(SimpleNameCS)dtParser.getSym(3),
977
          getParser().getSym(1),
715
						(EList)dtParser.getSym(5)
978
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
716
					);
979
          getParser().getSym(3),
717
				setOffsets(result, (CSTNode)dtParser.getSym(1), getIToken(dtParser.getToken(6)));
980
						(EList) // macro getSym is deprecated. Use function getRhsSym
981
          getParser().getSym(5)
982
					);
983
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
984
          getParser().getSym(1), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
985
            getParser().getToken(6)));
718
				result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
986
				result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
719
				dtParser.setSym1(result);
987
				 // macro setResult is deprecated. Use function setResult
720
	  		  break;
988
             getParser().setSym1(result);
721
			}
989
	                  break;
722
	 
990
            }
991
	
723
			//
992
			//
724
			// Rule 120:  oclExpCS ::= ( oclExpressionCS )
993
			// Rule 120:  oclExpCS ::= ( oclExpressionCS )
725
			//
994
			//
726
			case 120: {
995
			case 120: {
727
				
996
				
728
				CSTNode result = (CSTNode)dtParser.getSym(2);
997
				CSTNode result = (CSTNode) // macro getSym is deprecated. Use function getRhsSym
729
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
998
          getParser().getSym(2);
730
				dtParser.setSym1(result);
999
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
731
	  		  break;
1000
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
732
			}
1001
            getParser().getToken(3)));
1002
				 // macro setResult is deprecated. Use function setResult
1003
             getParser().setSym1(result);
1004
	                  break;
1005
            }
733
	 
1006
	 
734
			//
1007
			//
735
			// Rule 121:  variableExpCS ::= simpleNameCS isMarkedPreCS
1008
			// Rule 121:  variableExpCS ::= simpleNameCS isMarkedPreCS
736
			//
1009
			//
1010
			
737
			case 121:
1011
			case 121:
738
 
1012
739
			//
1013
			//
740
			// Rule 122:  variableExpCS ::= keywordAsName1 isMarkedPreCS
1014
			// Rule 122:  variableExpCS ::= keywordAsName1 isMarkedPreCS
741
			//
1015
			//
742
			case 122: {
1016
			case 122: {
743
				
1017
				
744
				IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)dtParser.getSym(2);
1018
				IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS) // macro getSym is deprecated. Use function getRhsSym
1019
          getParser().getSym(2);
745
				CSTNode result = createVariableExpCS(
1020
				CSTNode result = createVariableExpCS(
746
						(SimpleNameCS)dtParser.getSym(1),
1021
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1022
          getParser().getSym(1),
747
						new BasicEList(),
1023
						new BasicEList(),
748
						isMarkedPreCS
1024
						isMarkedPreCS
749
					);
1025
					);
750
				if (isMarkedPreCS.isPre()) {
1026
				if (isMarkedPreCS.isPre()) {
751
					setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(2));
1027
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1028
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1029
          getParser().getSym(2));
752
				} else {
1030
				} else {
753
					setOffsets(result, (CSTNode)dtParser.getSym(1));
1031
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1032
          getParser().getSym(1));
754
				}
1033
				}
755
				dtParser.setSym1(result);
1034
				 // macro setResult is deprecated. Use function setResult
756
	  		  break;
1035
             getParser().setSym1(result);
757
			}
1036
	                  break;
1037
            }
758
	 
1038
	 
759
			//
1039
			//
760
			// Rule 123:  variableExpCS ::= simpleNameCS [ argumentsCS ] isMarkedPreCS
1040
			// Rule 123:  variableExpCS ::= simpleNameCS [ argumentsCS ] isMarkedPreCS
761
			//
1041
			//
1042
			
762
			case 123:
1043
			case 123:
763
 
1044
764
			//
1045
			//
765
			// Rule 124:  variableExpCS ::= keywordAsName1 [ argumentsCS ] isMarkedPreCS
1046
			// Rule 124:  variableExpCS ::= keywordAsName1 [ argumentsCS ] isMarkedPreCS
766
			//
1047
			//
767
			case 124: {
1048
			case 124: {
768
				
1049
				
769
				IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)dtParser.getSym(5);
1050
				IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS) // macro getSym is deprecated. Use function getRhsSym
1051
          getParser().getSym(5);
770
				CSTNode result = createVariableExpCS(
1052
				CSTNode result = createVariableExpCS(
771
						(SimpleNameCS)dtParser.getSym(1),
1053
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
772
						(EList)dtParser.getSym(3),
1054
          getParser().getSym(1),
1055
						(EList) // macro getSym is deprecated. Use function getRhsSym
1056
          getParser().getSym(3),
773
						isMarkedPreCS
1057
						isMarkedPreCS
774
					);
1058
					);
775
				if (isMarkedPreCS.isPre()) {
1059
				if (isMarkedPreCS.isPre()) {
776
					setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(5));
1060
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1061
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1062
          getParser().getSym(5));
777
				} else {
1063
				} else {
778
					setOffsets(result, (CSTNode)dtParser.getSym(1), getIToken(dtParser.getToken(4)));
1064
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1065
          getParser().getSym(1), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1066
            getParser().getToken(4)));
779
				}
1067
				}
780
				dtParser.setSym1(result);
1068
				 // macro setResult is deprecated. Use function setResult
781
	  		  break;
1069
             getParser().setSym1(result);
782
			}
1070
	                  break;
783
	 
1071
            }
1072
	
784
			//
1073
			//
785
			// Rule 126:  simpleNameCS ::= self
1074
			// Rule 126:  simpleNameCS ::= self
786
			//
1075
			//
Lines 788-800 Link Here
788
				
1077
				
789
				CSTNode result = createSimpleNameCS(
1078
				CSTNode result = createSimpleNameCS(
790
						SimpleTypeEnum.SELF_LITERAL,
1079
						SimpleTypeEnum.SELF_LITERAL,
791
						getTokenText(dtParser.getToken(1))
1080
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1081
            getParser().getToken(1))
792
					);
1082
					);
793
				setOffsets(result, getIToken(dtParser.getToken(1)));
1083
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
794
				dtParser.setSym1(result);
1084
            getParser().getToken(1)));
795
	  		  break;
1085
				 // macro setResult is deprecated. Use function setResult
796
			}
1086
             getParser().setSym1(result);
797
	 
1087
	                  break;
1088
            }
1089
	
798
			//
1090
			//
799
			// Rule 127:  simpleNameCS ::= IDENTIFIER
1091
			// Rule 127:  simpleNameCS ::= IDENTIFIER
800
			//
1092
			//
Lines 802-814 Link Here
802
				
1094
				
803
				CSTNode result = createSimpleNameCS(
1095
				CSTNode result = createSimpleNameCS(
804
						SimpleTypeEnum.IDENTIFIER_LITERAL,
1096
						SimpleTypeEnum.IDENTIFIER_LITERAL,
805
						getTokenText(dtParser.getToken(1))
1097
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1098
            getParser().getToken(1))
806
					);
1099
					);
807
				setOffsets(result, getIToken(dtParser.getToken(1)));
1100
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
808
				dtParser.setSym1(result);
1101
            getParser().getToken(1)));
809
	  		  break;
1102
				 // macro setResult is deprecated. Use function setResult
810
			}
1103
             getParser().setSym1(result);
811
	 
1104
	                  break;
1105
            }
1106
	
812
			//
1107
			//
813
			// Rule 128:  primitiveTypeCS ::= Integer
1108
			// Rule 128:  primitiveTypeCS ::= Integer
814
			//
1109
			//
Lines 816-828 Link Here
816
				
1111
				
817
				CSTNode result = createPrimitiveTypeCS(
1112
				CSTNode result = createPrimitiveTypeCS(
818
						SimpleTypeEnum.INTEGER_LITERAL,
1113
						SimpleTypeEnum.INTEGER_LITERAL,
819
						getTokenText(dtParser.getToken(1))
1114
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1115
            getParser().getToken(1))
820
					);
1116
					);
821
				setOffsets(result, getIToken(dtParser.getToken(1)));
1117
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
822
				dtParser.setSym1(result);
1118
            getParser().getToken(1)));
823
	  		  break;
1119
				 // macro setResult is deprecated. Use function setResult
824
			}
1120
             getParser().setSym1(result);
825
	 
1121
	                  break;
1122
            }
1123
	
826
			//
1124
			//
827
			// Rule 129:  primitiveTypeCS ::= UnlimitedNatural
1125
			// Rule 129:  primitiveTypeCS ::= UnlimitedNatural
828
			//
1126
			//
Lines 830-842 Link Here
830
				
1128
				
831
				CSTNode result = createPrimitiveTypeCS(
1129
				CSTNode result = createPrimitiveTypeCS(
832
						SimpleTypeEnum.UNLIMITED_NATURAL_LITERAL,
1130
						SimpleTypeEnum.UNLIMITED_NATURAL_LITERAL,
833
						getTokenText(dtParser.getToken(1))
1131
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1132
            getParser().getToken(1))
834
					);
1133
					);
835
				setOffsets(result, getIToken(dtParser.getToken(1)));
1134
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
836
				dtParser.setSym1(result);
1135
            getParser().getToken(1)));
837
	  		  break;
1136
				 // macro setResult is deprecated. Use function setResult
838
			}
1137
             getParser().setSym1(result);
839
	 
1138
	                  break;
1139
            }
1140
	
840
			//
1141
			//
841
			// Rule 130:  primitiveTypeCS ::= String
1142
			// Rule 130:  primitiveTypeCS ::= String
842
			//
1143
			//
Lines 844-856 Link Here
844
				
1145
				
845
				CSTNode result = createPrimitiveTypeCS(
1146
				CSTNode result = createPrimitiveTypeCS(
846
						SimpleTypeEnum.STRING_LITERAL,
1147
						SimpleTypeEnum.STRING_LITERAL,
847
						getTokenText(dtParser.getToken(1))
1148
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1149
            getParser().getToken(1))
848
					);
1150
					);
849
				setOffsets(result, getIToken(dtParser.getToken(1)));
1151
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
850
				dtParser.setSym1(result);
1152
            getParser().getToken(1)));
851
	  		  break;
1153
				 // macro setResult is deprecated. Use function setResult
852
			}
1154
             getParser().setSym1(result);
853
	 
1155
	                  break;
1156
            }
1157
	
854
			//
1158
			//
855
			// Rule 131:  primitiveTypeCS ::= Real
1159
			// Rule 131:  primitiveTypeCS ::= Real
856
			//
1160
			//
Lines 858-870 Link Here
858
				
1162
				
859
				CSTNode result = createPrimitiveTypeCS(
1163
				CSTNode result = createPrimitiveTypeCS(
860
						SimpleTypeEnum.REAL_LITERAL,
1164
						SimpleTypeEnum.REAL_LITERAL,
861
						getTokenText(dtParser.getToken(1))
1165
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1166
            getParser().getToken(1))
862
					);
1167
					);
863
				setOffsets(result, getIToken(dtParser.getToken(1)));
1168
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
864
				dtParser.setSym1(result);
1169
            getParser().getToken(1)));
865
	  		  break;
1170
				 // macro setResult is deprecated. Use function setResult
866
			}
1171
             getParser().setSym1(result);
867
	 
1172
	                  break;
1173
            }
1174
	
868
			//
1175
			//
869
			// Rule 132:  primitiveTypeCS ::= Boolean
1176
			// Rule 132:  primitiveTypeCS ::= Boolean
870
			//
1177
			//
Lines 872-884 Link Here
872
				
1179
				
873
				CSTNode result = createPrimitiveTypeCS(
1180
				CSTNode result = createPrimitiveTypeCS(
874
						SimpleTypeEnum.BOOLEAN_LITERAL,
1181
						SimpleTypeEnum.BOOLEAN_LITERAL,
875
						getTokenText(dtParser.getToken(1))
1182
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1183
            getParser().getToken(1))
876
					);
1184
					);
877
				setOffsets(result, getIToken(dtParser.getToken(1)));
1185
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
878
				dtParser.setSym1(result);
1186
            getParser().getToken(1)));
879
	  		  break;
1187
				 // macro setResult is deprecated. Use function setResult
880
			}
1188
             getParser().setSym1(result);
881
	 
1189
	                  break;
1190
            }
1191
	
882
			//
1192
			//
883
			// Rule 133:  primitiveTypeCS ::= OclAny
1193
			// Rule 133:  primitiveTypeCS ::= OclAny
884
			//
1194
			//
Lines 886-898 Link Here
886
				
1196
				
887
				CSTNode result = createPrimitiveTypeCS(
1197
				CSTNode result = createPrimitiveTypeCS(
888
						SimpleTypeEnum.OCL_ANY_LITERAL,
1198
						SimpleTypeEnum.OCL_ANY_LITERAL,
889
						getTokenText(dtParser.getToken(1))
1199
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1200
            getParser().getToken(1))
890
					);
1201
					);
891
				setOffsets(result, getIToken(dtParser.getToken(1)));
1202
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
892
				dtParser.setSym1(result);
1203
            getParser().getToken(1)));
893
	  		  break;
1204
				 // macro setResult is deprecated. Use function setResult
894
			}
1205
             getParser().setSym1(result);
895
	 
1206
	                  break;
1207
            }
1208
	
896
			//
1209
			//
897
			// Rule 134:  primitiveTypeCS ::= OclVoid
1210
			// Rule 134:  primitiveTypeCS ::= OclVoid
898
			//
1211
			//
Lines 900-912 Link Here
900
				
1213
				
901
				CSTNode result = createPrimitiveTypeCS(
1214
				CSTNode result = createPrimitiveTypeCS(
902
						SimpleTypeEnum.OCL_VOID_LITERAL,
1215
						SimpleTypeEnum.OCL_VOID_LITERAL,
903
						getTokenText(dtParser.getToken(1))
1216
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1217
            getParser().getToken(1))
904
					);
1218
					);
905
				setOffsets(result, getIToken(dtParser.getToken(1)));
1219
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
906
				dtParser.setSym1(result);
1220
            getParser().getToken(1)));
907
	  		  break;
1221
				 // macro setResult is deprecated. Use function setResult
908
			}
1222
             getParser().setSym1(result);
909
	 
1223
	                  break;
1224
            }
1225
	
910
			//
1226
			//
911
			// Rule 135:  primitiveTypeCS ::= Invalid
1227
			// Rule 135:  primitiveTypeCS ::= Invalid
912
			//
1228
			//
Lines 914-926 Link Here
914
				
1230
				
915
				CSTNode result = createPrimitiveTypeCS(
1231
				CSTNode result = createPrimitiveTypeCS(
916
						SimpleTypeEnum.INVALID_LITERAL,
1232
						SimpleTypeEnum.INVALID_LITERAL,
917
						getTokenText(dtParser.getToken(1))
1233
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1234
            getParser().getToken(1))
918
					);
1235
					);
919
				setOffsets(result, getIToken(dtParser.getToken(1)));
1236
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
920
				dtParser.setSym1(result);
1237
            getParser().getToken(1)));
921
	  		  break;
1238
				 // macro setResult is deprecated. Use function setResult
922
			}
1239
             getParser().setSym1(result);
923
	 
1240
	                  break;
1241
            }
1242
	
924
			//
1243
			//
925
			// Rule 136:  primitiveTypeCS ::= OclMessage
1244
			// Rule 136:  primitiveTypeCS ::= OclMessage
926
			//
1245
			//
Lines 928-1739 Link Here
928
				
1247
				
929
				CSTNode result = createPrimitiveTypeCS(
1248
				CSTNode result = createPrimitiveTypeCS(
930
						SimpleTypeEnum.OCL_MESSAGE_LITERAL,
1249
						SimpleTypeEnum.OCL_MESSAGE_LITERAL,
931
						getTokenText(dtParser.getToken(1))
1250
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1251
            getParser().getToken(1))
932
					);
1252
					);
933
				setOffsets(result, getIToken(dtParser.getToken(1)));
1253
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
934
				dtParser.setSym1(result);
1254
            getParser().getToken(1)));
935
	  		  break;
1255
				 // macro setResult is deprecated. Use function setResult
936
			}
1256
             getParser().setSym1(result);
937
	 
1257
	                  break;
1258
            }
1259
	
938
			//
1260
			//
939
			// Rule 137:  pathNameCS ::= IDENTIFIER
1261
			// Rule 137:  pathNameCS ::= IDENTIFIER
940
			//
1262
			//
941
			case 137: {
1263
			case 137: {
942
				
1264
				
943
				CSTNode result = createPathNameCS(getTokenText(dtParser.getToken(1)));
1265
				CSTNode result = createPathNameCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
944
				setOffsets(result, getIToken(dtParser.getToken(1)));
1266
            getParser().getToken(1)));
945
				dtParser.setSym1(result);
1267
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
946
	  		  break;
1268
            getParser().getToken(1)));
947
			}
1269
				 // macro setResult is deprecated. Use function setResult
948
	 
1270
             getParser().setSym1(result);
1271
	                  break;
1272
            }
1273
	
949
			//
1274
			//
950
			// Rule 138:  pathNameCS ::= pathNameCS :: simpleNameCS
1275
			// Rule 138:  pathNameCS ::= pathNameCS :: simpleNameCS
951
			//
1276
			//
952
			case 138: {
1277
			case 138: {
953
				
1278
				
954
				PathNameCS result = (PathNameCS)dtParser.getSym(1);
1279
				PathNameCS result = (PathNameCS) // macro getSym is deprecated. Use function getRhsSym
1280
          getParser().getSym(1);
955
				result = extendPathNameCS(result, getTokenText(dtParser.getToken(3)));
1281
				result = extendPathNameCS(result, getTokenText(dtParser.getToken(3)));
956
				setOffsets(result, result, (CSTNode)dtParser.getSym(3));
1282
				setOffsets(result, result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
957
				dtParser.setSym1(result);
1283
          getParser().getSym(3));
958
	  		  break;
1284
				 // macro setResult is deprecated. Use function setResult
959
			}
1285
             getParser().setSym1(result);
960
	 
1286
	                  break;
1287
            }
1288
	
961
			//
1289
			//
962
			// Rule 139:  pathNameCSOpt ::= $Empty
1290
			// Rule 139:  pathNameCSOpt ::= $Empty
963
			//
1291
			//
964
			case 139: {
1292
			case 139: {
965
				
1293
				
966
				CSTNode result = createPathNameCS();
1294
				CSTNode result = createPathNameCS();
967
				dtParser.setSym1(result);
1295
				 // macro setResult is deprecated. Use function setResult
968
	  		  break;
1296
             getParser().setSym1(result);
969
			}
1297
	                  break;
1298
            }
970
	 
1299
	 
971
			//
1300
			//
972
			// Rule 147:  enumLiteralExpCS ::= pathNameCS :: keywordAsName
1301
			// Rule 147:  enumLiteralExpCS ::= pathNameCS :: keywordAsName
973
			//
1302
			//
1303
			
974
			case 147:
1304
			case 147:
975
 
1305
976
			//
1306
			//
977
			// Rule 148:  enumLiteralExpCS ::= pathNameCS :: simpleNameCS
1307
			// Rule 148:  enumLiteralExpCS ::= pathNameCS :: simpleNameCS
978
			//
1308
			//
979
			case 148: {
1309
			case 148: {
980
				
1310
				
981
				CSTNode result = createEnumLiteralExpCS(
1311
				CSTNode result = createEnumLiteralExpCS(
982
						(PathNameCS)dtParser.getSym(1),
1312
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
983
						(SimpleNameCS)dtParser.getSym(3)
1313
          getParser().getSym(1),
984
					);
1314
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
985
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
1315
          getParser().getSym(3)
986
				dtParser.setSym1(result);
1316
					);
987
	  		  break;
1317
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
988
			}
1318
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
989
	 
1319
          getParser().getSym(3));
1320
				 // macro setResult is deprecated. Use function setResult
1321
             getParser().setSym1(result);
1322
	                  break;
1323
            }
1324
	
990
			//
1325
			//
991
			// Rule 149:  collectionLiteralExpCS ::= collectionTypeIdentifierCS { collectionLiteralPartsCSopt }
1326
			// Rule 149:  collectionLiteralExpCS ::= collectionTypeIdentifierCS { collectionLiteralPartsCSopt }
992
			//
1327
			//
993
			case 149: {
1328
			case 149: {
994
				
1329
				
995
				Object[] objs = (Object[])dtParser.getSym(1);
1330
				Object[] objs = (Object[]) // macro getSym is deprecated. Use function getRhsSym
1331
          getParser().getSym(1);
996
				CSTNode result = createCollectionLiteralExpCS(
1332
				CSTNode result = createCollectionLiteralExpCS(
997
						(CollectionTypeIdentifierEnum)objs[1],
1333
						(CollectionTypeIdentifierEnum)objs[1],
998
						(EList)dtParser.getSym(3)
1334
						(EList) // macro getSym is deprecated. Use function getRhsSym
1335
          getParser().getSym(3)
999
					);
1336
					);
1000
				setOffsets(result, (IToken)objs[0], getIToken(dtParser.getToken(4)));
1337
				setOffsets(result, (IToken)objs[0], getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1001
				dtParser.setSym1(result);
1338
            getParser().getToken(4)));
1002
	  		  break;
1339
				 // macro setResult is deprecated. Use function setResult
1003
			}
1340
             getParser().setSym1(result);
1004
	 
1341
	                  break;
1342
            }
1343
	
1005
			//
1344
			//
1006
			// Rule 150:  collectionTypeIdentifierCS ::= Set
1345
			// Rule 150:  collectionTypeIdentifierCS ::= Set
1007
			//
1346
			//
1008
			case 150: {
1347
			case 150: {
1009
				
1348
				
1010
				dtParser.setSym1(new Object[]{getIToken(dtParser.getToken(1)), CollectionTypeIdentifierEnum.SET_LITERAL});
1349
				 // macro setResult is deprecated. Use function setResult
1011
	  		  break;
1350
             getParser().setSym1(new Object[]{getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1012
			}
1351
            getParser().getToken(1)), CollectionTypeIdentifierEnum.SET_LITERAL});
1013
	 
1352
	                  break;
1353
            }
1354
	
1014
			//
1355
			//
1015
			// Rule 151:  collectionTypeIdentifierCS ::= Bag
1356
			// Rule 151:  collectionTypeIdentifierCS ::= Bag
1016
			//
1357
			//
1017
			case 151: {
1358
			case 151: {
1018
				
1359
				
1019
				dtParser.setSym1(new Object[]{getIToken(dtParser.getToken(1)), CollectionTypeIdentifierEnum.BAG_LITERAL});
1360
				 // macro setResult is deprecated. Use function setResult
1020
	  		  break;
1361
             getParser().setSym1(new Object[]{getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1021
			}
1362
            getParser().getToken(1)), CollectionTypeIdentifierEnum.BAG_LITERAL});
1022
	 
1363
	                  break;
1364
            }
1365
	
1023
			//
1366
			//
1024
			// Rule 152:  collectionTypeIdentifierCS ::= Sequence
1367
			// Rule 152:  collectionTypeIdentifierCS ::= Sequence
1025
			//
1368
			//
1026
			case 152: {
1369
			case 152: {
1027
				
1370
				
1028
				dtParser.setSym1(new Object[]{getIToken(dtParser.getToken(1)), CollectionTypeIdentifierEnum.SEQUENCE_LITERAL});
1371
				 // macro setResult is deprecated. Use function setResult
1029
	  		  break;
1372
             getParser().setSym1(new Object[]{getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1030
			}
1373
            getParser().getToken(1)), CollectionTypeIdentifierEnum.SEQUENCE_LITERAL});
1031
	 
1374
	                  break;
1375
            }
1376
	
1032
			//
1377
			//
1033
			// Rule 153:  collectionTypeIdentifierCS ::= Collection
1378
			// Rule 153:  collectionTypeIdentifierCS ::= Collection
1034
			//
1379
			//
1035
			case 153: {
1380
			case 153: {
1036
				
1381
				
1037
				dtParser.setSym1(new Object[]{getIToken(dtParser.getToken(1)), CollectionTypeIdentifierEnum.COLLECTION_LITERAL});
1382
				 // macro setResult is deprecated. Use function setResult
1038
	  		  break;
1383
             getParser().setSym1(new Object[]{getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1039
			}
1384
            getParser().getToken(1)), CollectionTypeIdentifierEnum.COLLECTION_LITERAL});
1040
	 
1385
	                  break;
1386
            }
1387
	
1041
			//
1388
			//
1042
			// Rule 154:  collectionTypeIdentifierCS ::= OrderedSet
1389
			// Rule 154:  collectionTypeIdentifierCS ::= OrderedSet
1043
			//
1390
			//
1044
			case 154: {
1391
			case 154: {
1045
				
1392
				
1046
				dtParser.setSym1(new Object[]{getIToken(dtParser.getToken(1)), CollectionTypeIdentifierEnum.ORDERED_SET_LITERAL});
1393
				 // macro setResult is deprecated. Use function setResult
1047
	  		  break;
1394
             getParser().setSym1(new Object[]{getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1048
			}
1395
            getParser().getToken(1)), CollectionTypeIdentifierEnum.ORDERED_SET_LITERAL});
1396
	                  break;
1397
            }
1049
	 
1398
	 
1050
			//
1399
			//
1051
			// Rule 155:  collectionLiteralPartsCSopt ::= $Empty
1400
			// Rule 155:  collectionLiteralPartsCSopt ::= $Empty
1052
			//
1401
			//
1402
			
1053
			case 155:
1403
			case 155:
1054
				dtParser.setSym1(new BasicEList());
1404
				setResult(new BasicEList());
1055
				break;
1405
				break;
1056
 
1406
1057
			//
1407
			//
1058
			// Rule 157:  collectionLiteralPartsCS ::= collectionLiteralPartCS
1408
			// Rule 157:  collectionLiteralPartsCS ::= collectionLiteralPartCS
1059
			//
1409
			//
1060
			case 157: {
1410
			case 157: {
1061
				
1411
				
1062
				EList result = new BasicEList();
1412
				EList result = new BasicEList();
1063
				result.add(dtParser.getSym(1));
1413
				result.add( // macro getSym is deprecated. Use function getRhsSym
1064
				dtParser.setSym1(result);
1414
          getParser().getSym(1));
1065
	  		  break;
1415
				 // macro setResult is deprecated. Use function setResult
1066
			}
1416
             getParser().setSym1(result);
1067
	 
1417
	                  break;
1418
            }
1419
	
1068
			//
1420
			//
1069
			// Rule 158:  collectionLiteralPartsCS ::= collectionLiteralPartsCS , collectionLiteralPartCS
1421
			// Rule 158:  collectionLiteralPartsCS ::= collectionLiteralPartsCS , collectionLiteralPartCS
1070
			//
1422
			//
1071
			case 158: {
1423
			case 158: {
1072
				
1424
				
1073
				EList result = (EList)dtParser.getSym(1);
1425
				EList result = (EList) // macro getSym is deprecated. Use function getRhsSym
1074
				result.add(dtParser.getSym(3));
1426
          getParser().getSym(1);
1075
				dtParser.setSym1(result);
1427
				result.add( // macro getSym is deprecated. Use function getRhsSym
1076
	  		  break;
1428
          getParser().getSym(3));
1077
			}
1429
				 // macro setResult is deprecated. Use function setResult
1078
	 
1430
             getParser().setSym1(result);
1431
	                  break;
1432
            }
1433
	
1079
			//
1434
			//
1080
			// Rule 160:  collectionLiteralPartCS ::= oclExpressionCS
1435
			// Rule 160:  collectionLiteralPartCS ::= oclExpressionCS
1081
			//
1436
			//
1082
			case 160: {
1437
			case 160: {
1083
				
1438
				
1084
				CSTNode result = createCollectionLiteralPartCS(
1439
				CSTNode result = createCollectionLiteralPartCS(
1085
						(OCLExpressionCS)dtParser.getSym(1)
1440
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1441
          getParser().getSym(1)
1086
					);
1442
					);
1087
				setOffsets(result, (CSTNode)dtParser.getSym(1));
1443
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1088
				dtParser.setSym1(result);
1444
          getParser().getSym(1));
1089
	  		  break;
1445
				 // macro setResult is deprecated. Use function setResult
1090
			}
1446
             getParser().setSym1(result);
1091
	 
1447
	                  break;
1448
            }
1449
	
1092
			//
1450
			//
1093
			// Rule 161:  collectionRangeCS ::= - INTEGER_RANGE_START oclExpressionCS
1451
			// Rule 161:  collectionRangeCS ::= - INTEGER_RANGE_START oclExpressionCS
1094
			//
1452
			//
1095
			case 161: {
1453
			case 161: {
1096
				
1454
				
1097
				OCLExpressionCS rangeStart = createRangeStart(
1455
				OCLExpressionCS rangeStart = createRangeStart(
1098
						getTokenText(dtParser.getToken(2)), true);
1456
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1457
            getParser().getToken(2)), true);
1099
				CSTNode result = createCollectionRangeCS(
1458
				CSTNode result = createCollectionRangeCS(
1100
						rangeStart,
1459
						rangeStart,
1101
						(OCLExpressionCS)dtParser.getSym(3)
1460
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1461
          getParser().getSym(3)
1102
					);
1462
					);
1103
				setOffsets(result, rangeStart, (CSTNode)dtParser.getSym(3));
1463
				setOffsets(result, rangeStart, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1104
				dtParser.setSym1(result);
1464
          getParser().getSym(3));
1105
	  		  break;
1465
				 // macro setResult is deprecated. Use function setResult
1106
			}
1466
             getParser().setSym1(result);
1107
	 
1467
	                  break;
1468
            }
1469
	
1108
			//
1470
			//
1109
			// Rule 162:  collectionRangeCS ::= INTEGER_RANGE_START oclExpressionCS
1471
			// Rule 162:  collectionRangeCS ::= INTEGER_RANGE_START oclExpressionCS
1110
			//
1472
			//
1111
			case 162: {
1473
			case 162: {
1112
				
1474
				
1113
				OCLExpressionCS rangeStart = createRangeStart(
1475
				OCLExpressionCS rangeStart = createRangeStart(
1114
						getTokenText(dtParser.getToken(1)), false);
1476
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1477
            getParser().getToken(1)), false);
1115
				CSTNode result = createCollectionRangeCS(
1478
				CSTNode result = createCollectionRangeCS(
1116
						rangeStart,
1479
						rangeStart,
1117
						(OCLExpressionCS)dtParser.getSym(2)
1480
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1481
          getParser().getSym(2)
1118
					);
1482
					);
1119
				setOffsets(result, rangeStart, (CSTNode)dtParser.getSym(2));
1483
				setOffsets(result, rangeStart, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1120
				dtParser.setSym1(result);
1484
          getParser().getSym(2));
1121
	  		  break;
1485
				 // macro setResult is deprecated. Use function setResult
1122
			}
1486
             getParser().setSym1(result);
1123
	 
1487
	                  break;
1488
            }
1489
	
1124
			//
1490
			//
1125
			// Rule 163:  collectionRangeCS ::= oclExpressionCS .. oclExpressionCS
1491
			// Rule 163:  collectionRangeCS ::= oclExpressionCS .. oclExpressionCS
1126
			//
1492
			//
1127
			case 163: {
1493
			case 163: {
1128
				
1494
				
1129
				CSTNode result = createCollectionRangeCS(
1495
				CSTNode result = createCollectionRangeCS(
1130
						(OCLExpressionCS)dtParser.getSym(1),
1496
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1131
						(OCLExpressionCS)dtParser.getSym(3)
1497
          getParser().getSym(1),
1132
					);
1498
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1133
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
1499
          getParser().getSym(3)
1134
				dtParser.setSym1(result);
1500
					);
1135
	  		  break;
1501
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1136
			}
1502
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1137
	 
1503
          getParser().getSym(3));
1504
				 // macro setResult is deprecated. Use function setResult
1505
             getParser().setSym1(result);
1506
	                  break;
1507
            }
1508
	
1138
			//
1509
			//
1139
			// Rule 169:  tupleLiteralExpCS ::= Tuple { variableListCS2 }
1510
			// Rule 169:  tupleLiteralExpCS ::= Tuple { variableListCS2 }
1140
			//
1511
			//
1141
			case 169: {
1512
			case 169: {
1142
				
1513
				
1143
				CSTNode result = createTupleLiteralExpCS((EList)dtParser.getSym(3));
1514
				CSTNode result = createTupleLiteralExpCS((EList) // macro getSym is deprecated. Use function getRhsSym
1144
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
1515
          getParser().getSym(3));
1145
				dtParser.setSym1(result);
1516
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1146
	  		  break;
1517
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1147
			}
1518
            getParser().getToken(4)));
1148
	 
1519
				 // macro setResult is deprecated. Use function setResult
1520
             getParser().setSym1(result);
1521
	                  break;
1522
            }
1523
	
1149
			//
1524
			//
1150
			// Rule 170:  integerLiteralExpCS ::= INTEGER_LITERAL
1525
			// Rule 170:  integerLiteralExpCS ::= INTEGER_LITERAL
1151
			//
1526
			//
1152
			case 170: {
1527
			case 170: {
1153
				
1528
				
1154
				CSTNode result = createIntegerLiteralExpCS(getTokenText(dtParser.getToken(1)));
1529
				CSTNode result = createIntegerLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1155
				setOffsets(result, getIToken(dtParser.getToken(1)));
1530
            getParser().getToken(1)));
1156
				dtParser.setSym1(result);
1531
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1157
	  		  break;
1532
            getParser().getToken(1)));
1158
			}
1533
				 // macro setResult is deprecated. Use function setResult
1159
	 
1534
             getParser().setSym1(result);
1535
	                  break;
1536
            }
1537
	
1160
			//
1538
			//
1161
			// Rule 171:  unlimitedNaturalLiteralExpCS ::= *
1539
			// Rule 171:  unlimitedNaturalLiteralExpCS ::= *
1162
			//
1540
			//
1163
			case 171: {
1541
			case 171: {
1164
				
1542
				
1165
				CSTNode result = createUnlimitedNaturalLiteralExpCS(getTokenText(dtParser.getToken(1)));
1543
				CSTNode result = createUnlimitedNaturalLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1166
				setOffsets(result, getIToken(dtParser.getToken(1)));
1544
            getParser().getToken(1)));
1167
				dtParser.setSym1(result);
1545
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1168
	  		  break;
1546
            getParser().getToken(1)));
1169
			}
1547
				 // macro setResult is deprecated. Use function setResult
1170
	 
1548
             getParser().setSym1(result);
1549
	                  break;
1550
            }
1551
	
1171
			//
1552
			//
1172
			// Rule 172:  realLiteralExpCS ::= REAL_LITERAL
1553
			// Rule 172:  realLiteralExpCS ::= REAL_LITERAL
1173
			//
1554
			//
1174
			case 172: {
1555
			case 172: {
1175
				
1556
				
1176
				CSTNode result = createRealLiteralExpCS(getTokenText(dtParser.getToken(1)));
1557
				CSTNode result = createRealLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1177
				setOffsets(result, getIToken(dtParser.getToken(1)));
1558
            getParser().getToken(1)));
1178
				dtParser.setSym1(result);
1559
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1179
	  		  break;
1560
            getParser().getToken(1)));
1180
			}
1561
				 // macro setResult is deprecated. Use function setResult
1181
	 
1562
             getParser().setSym1(result);
1563
	                  break;
1564
            }
1565
	
1182
			//
1566
			//
1183
			// Rule 173:  stringLiteralExpCS ::= STRING_LITERAL
1567
			// Rule 173:  stringLiteralExpCS ::= STRING_LITERAL
1184
			//
1568
			//
1185
			case 173: {
1569
			case 173: {
1186
				
1570
				
1187
				IToken literalToken = getIToken(dtParser.getToken(1));
1571
				IToken literalToken = getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1572
            getParser().getToken(1));
1188
				StringLiteralExpCS result = createStringLiteralExpCS(literalToken.toString());
1573
				StringLiteralExpCS result = createStringLiteralExpCS(literalToken.toString());
1189
				result.setUnescapedStringSymbol(unescape(literalToken));
1574
				result.setUnescapedStringSymbol(unescape(literalToken));
1190
				setOffsets(result, literalToken);
1575
				setOffsets(result, literalToken);
1191
				dtParser.setSym1(result);
1576
				 // macro setResult is deprecated. Use function setResult
1192
	  		  break;
1577
             getParser().setSym1(result);
1193
			}
1578
	                  break;
1194
	 
1579
            }
1580
	
1195
			//
1581
			//
1196
			// Rule 174:  booleanLiteralExpCS ::= true
1582
			// Rule 174:  booleanLiteralExpCS ::= true
1197
			//
1583
			//
1198
			case 174: {
1584
			case 174: {
1199
				
1585
				
1200
				CSTNode result = createBooleanLiteralExpCS(getTokenText(dtParser.getToken(1)));
1586
				CSTNode result = createBooleanLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1201
				setOffsets(result, getIToken(dtParser.getToken(1)));
1587
            getParser().getToken(1)));
1202
				dtParser.setSym1(result);
1588
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1203
	  		  break;
1589
            getParser().getToken(1)));
1204
			}
1590
				 // macro setResult is deprecated. Use function setResult
1205
	 
1591
             getParser().setSym1(result);
1592
	                  break;
1593
            }
1594
	
1206
			//
1595
			//
1207
			// Rule 175:  booleanLiteralExpCS ::= false
1596
			// Rule 175:  booleanLiteralExpCS ::= false
1208
			//
1597
			//
1209
			case 175: {
1598
			case 175: {
1210
				
1599
				
1211
				CSTNode result = createBooleanLiteralExpCS(getTokenText(dtParser.getToken(1)));
1600
				CSTNode result = createBooleanLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1212
				setOffsets(result, getIToken(dtParser.getToken(1)));
1601
            getParser().getToken(1)));
1213
				dtParser.setSym1(result);
1602
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1214
	  		  break;
1603
            getParser().getToken(1)));
1215
			}
1604
				 // macro setResult is deprecated. Use function setResult
1216
	 
1605
             getParser().setSym1(result);
1606
	                  break;
1607
            }
1608
	
1217
			//
1609
			//
1218
			// Rule 176:  nullLiteralExpCS ::= null
1610
			// Rule 176:  nullLiteralExpCS ::= null
1219
			//
1611
			//
1220
			case 176: {
1612
			case 176: {
1221
				
1613
				
1222
				CSTNode result = createNullLiteralExpCS(getTokenText(dtParser.getToken(1)));
1614
				CSTNode result = createNullLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1223
				setOffsets(result, getIToken(dtParser.getToken(1)));
1615
            getParser().getToken(1)));
1224
				dtParser.setSym1(result);
1616
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1225
	  		  break;
1617
            getParser().getToken(1)));
1226
			}
1618
				 // macro setResult is deprecated. Use function setResult
1227
	 
1619
             getParser().setSym1(result);
1620
	                  break;
1621
            }
1622
	
1228
			//
1623
			//
1229
			// Rule 177:  invalidLiteralExpCS ::= OclInvalid
1624
			// Rule 177:  invalidLiteralExpCS ::= OclInvalid
1230
			//
1625
			//
1231
			case 177: {
1626
			case 177: {
1232
				
1627
				
1233
				CSTNode result = createInvalidLiteralExpCS(getTokenText(dtParser.getToken(1)));
1628
				CSTNode result = createInvalidLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1234
				setOffsets(result, getIToken(dtParser.getToken(1)));
1629
            getParser().getToken(1)));
1235
				dtParser.setSym1(result);
1630
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1236
	  		  break;
1631
            getParser().getToken(1)));
1237
			}
1632
				 // macro setResult is deprecated. Use function setResult
1633
             getParser().setSym1(result);
1634
	                  break;
1635
            }
1238
	 
1636
	 
1239
			//
1637
			//
1240
			// Rule 178:  callExpCS ::= -> featureCallExpCS
1638
			// Rule 178:  callExpCS ::= -> featureCallExpCS
1241
			//
1639
			//
1640
			
1242
			case 178:
1641
			case 178:
1243
 
1642
1244
			//
1643
			//
1245
			// Rule 179:  callExpCS ::= -> loopExpCS
1644
			// Rule 179:  callExpCS ::= -> loopExpCS
1246
			//
1645
			//
1247
			case 179: {
1646
			case 179: {
1248
				
1647
				
1249
				CallExpCS result = (CallExpCS)dtParser.getSym(2);
1648
				CallExpCS result = (CallExpCS) // macro getSym is deprecated. Use function getRhsSym
1649
          getParser().getSym(2);
1250
				result.setAccessor(DotOrArrowEnum.ARROW_LITERAL);
1650
				result.setAccessor(DotOrArrowEnum.ARROW_LITERAL);
1251
				dtParser.setSym1(result);
1651
				 // macro setResult is deprecated. Use function setResult
1252
	  		  break;
1652
             getParser().setSym1(result);
1253
			}
1653
	                  break;
1654
            }
1254
	 
1655
	 
1255
			//
1656
			//
1256
			// Rule 180:  callExpCS ::= . keywordOperationCallExpCS
1657
			// Rule 180:  callExpCS ::= . keywordOperationCallExpCS
1257
			//
1658
			//
1659
			
1258
			case 180:
1660
			case 180:
1259
 
1661
1260
			//
1662
			//
1261
			// Rule 181:  callExpCS ::= . featureCallExpCS
1663
			// Rule 181:  callExpCS ::= . featureCallExpCS
1262
			//
1664
			//
1263
			case 181: {
1665
			case 181: {
1264
				
1666
				
1265
				CallExpCS result = (CallExpCS)dtParser.getSym(2);
1667
				CallExpCS result = (CallExpCS) // macro getSym is deprecated. Use function getRhsSym
1668
          getParser().getSym(2);
1266
				result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
1669
				result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
1267
				dtParser.setSym1(result);
1670
				 // macro setResult is deprecated. Use function setResult
1268
	  		  break;
1671
             getParser().setSym1(result);
1269
			}
1672
	                  break;
1270
	 
1673
            }
1674
	
1271
			//
1675
			//
1272
			// Rule 184:  iteratorExpCS ::= iteratorName ( oclExpressionCS )
1676
			// Rule 184:  iteratorExpCS ::= iteratorName ( oclExpressionCS )
1273
			//
1677
			//
1274
			case 184: {
1678
			case 184: {
1275
				
1679
				
1276
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(1);
1680
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1681
          getParser().getSym(1);
1277
				CSTNode result = createIteratorExpCS(
1682
				CSTNode result = createIteratorExpCS(
1278
						simpleNameCS,
1683
						simpleNameCS,
1279
						null,
1684
						null,
1280
						null,
1685
						null,
1281
						(OCLExpressionCS)dtParser.getSym(3)
1686
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1687
          getParser().getSym(3)
1282
					);
1688
					);
1283
				setOffsets(result, simpleNameCS, getIToken(dtParser.getToken(4)));
1689
				setOffsets(result, simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1284
				dtParser.setSym1(result);
1690
            getParser().getToken(4)));
1285
	  		  break;
1691
				 // macro setResult is deprecated. Use function setResult
1286
			}
1692
             getParser().setSym1(result);
1287
	 
1693
	                  break;
1694
            }
1695
	
1288
			//
1696
			//
1289
			// Rule 185:  iteratorExpCS ::= iteratorName ( variableCS | oclExpressionCS )
1697
			// Rule 185:  iteratorExpCS ::= iteratorName ( variableCS | oclExpressionCS )
1290
			//
1698
			//
1291
			case 185: {
1699
			case 185: {
1292
				
1700
				
1293
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(1);
1701
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1702
          getParser().getSym(1);
1294
				CSTNode result = createIteratorExpCS(
1703
				CSTNode result = createIteratorExpCS(
1295
						simpleNameCS,
1704
						simpleNameCS,
1296
						(VariableCS)dtParser.getSym(3),
1705
						(VariableCS) // macro getSym is deprecated. Use function getRhsSym
1706
          getParser().getSym(3),
1297
						null,
1707
						null,
1298
						(OCLExpressionCS)dtParser.getSym(5)
1708
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1709
          getParser().getSym(5)
1299
					);
1710
					);
1300
				setOffsets(result, simpleNameCS, getIToken(dtParser.getToken(6)));
1711
				setOffsets(result, simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1301
				dtParser.setSym1(result);
1712
            getParser().getToken(6)));
1302
	  		  break;
1713
				 // macro setResult is deprecated. Use function setResult
1303
			}
1714
             getParser().setSym1(result);
1304
	 
1715
	                  break;
1716
            }
1717
	
1305
			//
1718
			//
1306
			// Rule 186:  iteratorExpCS ::= iteratorName ( variableCS , variableCS | oclExpressionCS )
1719
			// Rule 186:  iteratorExpCS ::= iteratorName ( variableCS , variableCS | oclExpressionCS )
1307
			//
1720
			//
1308
			case 186: {
1721
			case 186: {
1309
				
1722
				
1310
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(1);
1723
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1724
          getParser().getSym(1);
1311
				CSTNode result = createIteratorExpCS(
1725
				CSTNode result = createIteratorExpCS(
1312
						simpleNameCS,
1726
						simpleNameCS,
1313
						(VariableCS)dtParser.getSym(3),
1727
						(VariableCS) // macro getSym is deprecated. Use function getRhsSym
1314
						(VariableCS)dtParser.getSym(5),
1728
          getParser().getSym(3),
1315
						(OCLExpressionCS)dtParser.getSym(7)
1729
						(VariableCS) // macro getSym is deprecated. Use function getRhsSym
1316
					);
1730
          getParser().getSym(5),
1317
				setOffsets(result, simpleNameCS, getIToken(dtParser.getToken(8)));
1731
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1318
				dtParser.setSym1(result);
1732
          getParser().getSym(7)
1319
	  		  break;
1733
					);
1320
			}
1734
				setOffsets(result, simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1321
	 
1735
            getParser().getToken(8)));
1736
				 // macro setResult is deprecated. Use function setResult
1737
             getParser().setSym1(result);
1738
	                  break;
1739
            }
1740
	
1322
			//
1741
			//
1323
			// Rule 187:  iterateExpCS ::= iterateName ( variableCS | oclExpressionCS )
1742
			// Rule 187:  iterateExpCS ::= iterateName ( variableCS | oclExpressionCS )
1324
			//
1743
			//
1325
			case 187: {
1744
			case 187: {
1326
				
1745
				
1327
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(1);
1746
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1747
          getParser().getSym(1);
1328
				CSTNode result = createIterateExpCS(
1748
				CSTNode result = createIterateExpCS(
1329
						simpleNameCS,
1749
						simpleNameCS,
1330
						(VariableCS)dtParser.getSym(3),
1750
						(VariableCS) // macro getSym is deprecated. Use function getRhsSym
1751
          getParser().getSym(3),
1331
						null,
1752
						null,
1332
						(OCLExpressionCS)dtParser.getSym(5)
1753
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1754
          getParser().getSym(5)
1333
					);
1755
					);
1334
				setOffsets(result, simpleNameCS, getIToken(dtParser.getToken(6)));
1756
				setOffsets(result, simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1335
				dtParser.setSym1(result);
1757
            getParser().getToken(6)));
1336
	  		  break;
1758
				 // macro setResult is deprecated. Use function setResult
1337
			}
1759
             getParser().setSym1(result);
1338
	 
1760
	                  break;
1761
            }
1762
	
1339
			//
1763
			//
1340
			// Rule 188:  iterateExpCS ::= iterateName ( variableCS ; variableCS | oclExpressionCS )
1764
			// Rule 188:  iterateExpCS ::= iterateName ( variableCS ; variableCS | oclExpressionCS )
1341
			//
1765
			//
1342
			case 188: {
1766
			case 188: {
1343
				
1767
				
1344
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(1);
1768
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1769
          getParser().getSym(1);
1345
				CSTNode result = createIterateExpCS(
1770
				CSTNode result = createIterateExpCS(
1346
						simpleNameCS,
1771
						simpleNameCS,
1347
						(VariableCS)dtParser.getSym(3),
1772
						(VariableCS) // macro getSym is deprecated. Use function getRhsSym
1348
						(VariableCS)dtParser.getSym(5),
1773
          getParser().getSym(3),
1349
						(OCLExpressionCS)dtParser.getSym(7)
1774
						(VariableCS) // macro getSym is deprecated. Use function getRhsSym
1350
					);
1775
          getParser().getSym(5),
1351
				setOffsets(result, simpleNameCS, getIToken(dtParser.getToken(8)));
1776
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1352
				dtParser.setSym1(result);
1777
          getParser().getSym(7)
1353
	  		  break;
1778
					);
1354
			}
1779
				setOffsets(result, simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1355
	 
1780
            getParser().getToken(8)));
1781
				 // macro setResult is deprecated. Use function setResult
1782
             getParser().setSym1(result);
1783
	                  break;
1784
            }
1785
	
1356
			//
1786
			//
1357
			// Rule 189:  variableCS ::= IDENTIFIER
1787
			// Rule 189:  variableCS ::= IDENTIFIER
1358
			//
1788
			//
1359
			case 189: {
1789
			case 189: {
1360
				
1790
				
1361
				CSTNode result = createVariableCS(
1791
				CSTNode result = createVariableCS(
1362
						getTokenText(dtParser.getToken(1)),
1792
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1793
            getParser().getToken(1)),
1363
						null,
1794
						null,
1364
						null
1795
						null
1365
					);
1796
					);
1366
				setOffsets(result, getIToken(dtParser.getToken(1)));
1797
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1367
				dtParser.setSym1(result);
1798
            getParser().getToken(1)));
1368
	  		  break;
1799
				 // macro setResult is deprecated. Use function setResult
1369
			}
1800
             getParser().setSym1(result);
1370
	 
1801
	                  break;
1802
            }
1803
	
1371
			//
1804
			//
1372
			// Rule 190:  typedVariableCS ::= IDENTIFIER : typeCS
1805
			// Rule 190:  typedVariableCS ::= IDENTIFIER : typeCS
1373
			//
1806
			//
1374
			case 190: {
1807
			case 190: {
1375
				
1808
				
1376
				CSTNode result = createVariableCS(
1809
				CSTNode result = createVariableCS(
1377
						getTokenText(dtParser.getToken(1)),
1810
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1378
						(TypeCS)dtParser.getSym(3),
1811
            getParser().getToken(1)),
1812
						(TypeCS) // macro getSym is deprecated. Use function getRhsSym
1813
          getParser().getSym(3),
1379
						null
1814
						null
1380
					);
1815
					);
1381
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(3));
1816
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1382
				dtParser.setSym1(result);
1817
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1383
	  		  break;
1818
          getParser().getSym(3));
1384
			}
1819
				 // macro setResult is deprecated. Use function setResult
1385
	 
1820
             getParser().setSym1(result);
1821
	                  break;
1822
            }
1823
	
1386
			//
1824
			//
1387
			// Rule 192:  variableCS ::= IDENTIFIER : typeCS = oclExpressionCS
1825
			// Rule 192:  variableCS ::= IDENTIFIER : typeCS = oclExpressionCS
1388
			//
1826
			//
1389
			case 192: {
1827
			case 192: {
1390
				
1828
				
1391
				CSTNode result = createVariableCS(
1829
				CSTNode result = createVariableCS(
1392
						getTokenText(dtParser.getToken(1)),
1830
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1393
						(TypeCS)dtParser.getSym(3),
1831
            getParser().getToken(1)),
1394
						(OCLExpressionCS)dtParser.getSym(5)
1832
						(TypeCS) // macro getSym is deprecated. Use function getRhsSym
1395
					);
1833
          getParser().getSym(3),
1396
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(5));
1834
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1397
				dtParser.setSym1(result);
1835
          getParser().getSym(5)
1398
	  		  break;
1836
					);
1399
			}
1837
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1400
	 
1838
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1839
          getParser().getSym(5));
1840
				 // macro setResult is deprecated. Use function setResult
1841
             getParser().setSym1(result);
1842
	                  break;
1843
            }
1844
	
1401
			//
1845
			//
1402
			// Rule 193:  variableCS2 ::= IDENTIFIER = oclExpressionCS
1846
			// Rule 193:  variableCS2 ::= IDENTIFIER = oclExpressionCS
1403
			//
1847
			//
1404
			case 193: {
1848
			case 193: {
1405
				
1849
				
1406
				CSTNode result = createVariableCS(
1850
				CSTNode result = createVariableCS(
1407
						getTokenText(dtParser.getToken(1)),
1851
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1852
            getParser().getToken(1)),
1408
						null,
1853
						null,
1409
						(OCLExpressionCS)dtParser.getSym(3)
1854
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1855
          getParser().getSym(3)
1410
					);
1856
					);
1411
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(3));
1857
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1412
				dtParser.setSym1(result);
1858
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1413
	  		  break;
1859
          getParser().getSym(3));
1414
			}
1860
				 // macro setResult is deprecated. Use function setResult
1415
	 
1861
             getParser().setSym1(result);
1862
	                  break;
1863
            }
1864
	
1416
			//
1865
			//
1417
			// Rule 194:  typeCSopt ::= $Empty
1866
			// Rule 194:  typeCSopt ::= $Empty
1418
			//
1867
			//
1419
			case 194:
1868
			case 194:
1420
				dtParser.setSym1(null);
1869
                setResult(null);
1421
				break;
1870
                break;
1422
 
1871
1423
			//
1872
			//
1424
			// Rule 200:  collectionTypeCS ::= collectionTypeIdentifierCS ( typeCS )
1873
			// Rule 200:  collectionTypeCS ::= collectionTypeIdentifierCS ( typeCS )
1425
			//
1874
			//
1426
			case 200: {
1875
			case 200: {
1427
				
1876
				
1428
				Object[] objs = (Object[])dtParser.getSym(1);
1877
				Object[] objs = (Object[]) // macro getSym is deprecated. Use function getRhsSym
1878
          getParser().getSym(1);
1429
				CSTNode result = createCollectionTypeCS(
1879
				CSTNode result = createCollectionTypeCS(
1430
						(CollectionTypeIdentifierEnum)objs[1],
1880
						(CollectionTypeIdentifierEnum)objs[1],
1431
						(TypeCS)dtParser.getSym(3)
1881
						(TypeCS) // macro getSym is deprecated. Use function getRhsSym
1882
          getParser().getSym(3)
1432
					);
1883
					);
1433
				setOffsets(result, (IToken)objs[0], getIToken(dtParser.getToken(4)));
1884
				setOffsets(result, (IToken)objs[0], getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1434
				dtParser.setSym1(result);
1885
            getParser().getToken(4)));
1435
	  		  break;
1886
				 // macro setResult is deprecated. Use function setResult
1436
			}
1887
             getParser().setSym1(result);
1437
	 
1888
	                  break;
1889
            }
1890
	
1438
			//
1891
			//
1439
			// Rule 201:  tupleTypeCS ::= Tuple ( variableListCSopt )
1892
			// Rule 201:  tupleTypeCS ::= Tuple ( variableListCSopt )
1440
			//
1893
			//
1441
			case 201: {
1894
			case 201: {
1442
				
1895
				
1443
				CSTNode result = createTupleTypeCS((EList)dtParser.getSym(3));
1896
				CSTNode result = createTupleTypeCS((EList) // macro getSym is deprecated. Use function getRhsSym
1444
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
1897
          getParser().getSym(3));
1445
				dtParser.setSym1(result);
1898
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1446
	  		  break;
1899
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1447
			}
1900
            getParser().getToken(4)));
1901
				 // macro setResult is deprecated. Use function setResult
1902
             getParser().setSym1(result);
1903
	                  break;
1904
            }
1448
	 
1905
	 
1449
			//
1906
			//
1450
			// Rule 202:  variableListCSopt ::= $Empty
1907
			// Rule 202:  variableListCSopt ::= $Empty
1451
			//
1908
			//
1909
			
1452
			case 202:
1910
			case 202:
1453
				dtParser.setSym1(new BasicEList());
1911
				setResult(new BasicEList());
1454
				break;
1912
				break;
1455
 
1913
1456
			//
1914
			//
1457
			// Rule 204:  variableListCS ::= variableCS
1915
			// Rule 204:  variableListCS ::= variableCS
1458
			//
1916
			//
1459
			case 204: {
1917
			case 204: {
1460
				
1918
				
1461
				EList result = new BasicEList();
1919
				EList result = new BasicEList();
1462
				result.add(dtParser.getSym(1));
1920
				result.add( // macro getSym is deprecated. Use function getRhsSym
1463
				dtParser.setSym1(result);
1921
          getParser().getSym(1));
1464
	  		  break;
1922
				 // macro setResult is deprecated. Use function setResult
1465
			}
1923
             getParser().setSym1(result);
1466
	 
1924
	                  break;
1925
            }
1926
	
1467
			//
1927
			//
1468
			// Rule 205:  variableListCS ::= variableListCS , variableCS
1928
			// Rule 205:  variableListCS ::= variableListCS , variableCS
1469
			//
1929
			//
1470
			case 205: {
1930
			case 205: {
1471
				
1931
				
1472
				EList result = (EList)dtParser.getSym(1);
1932
				EList result = (EList) // macro getSym is deprecated. Use function getRhsSym
1473
				result.add(dtParser.getSym(3));
1933
          getParser().getSym(1);
1474
				dtParser.setSym1(result);
1934
				result.add( // macro getSym is deprecated. Use function getRhsSym
1475
	  		  break;
1935
          getParser().getSym(3));
1476
			}
1936
				 // macro setResult is deprecated. Use function setResult
1937
             getParser().setSym1(result);
1938
	                  break;
1939
            }
1477
	 
1940
	 
1478
			//
1941
			//
1479
			// Rule 206:  variableListCS2 ::= variableCS2
1942
			// Rule 206:  variableListCS2 ::= variableCS2
1480
			//
1943
			//
1944
			
1481
			case 206:
1945
			case 206:
1482
 
1946
1483
			//
1947
			//
1484
			// Rule 207:  variableListCS2 ::= variableCS
1948
			// Rule 207:  variableListCS2 ::= variableCS
1485
			//
1949
			//
1486
			case 207: {
1950
			case 207: {
1487
				
1951
				
1488
				EList result = new BasicEList();
1952
				EList result = new BasicEList();
1489
				result.add(dtParser.getSym(1));
1953
				result.add( // macro getSym is deprecated. Use function getRhsSym
1490
				dtParser.setSym1(result);
1954
          getParser().getSym(1));
1491
	  		  break;
1955
				 // macro setResult is deprecated. Use function setResult
1492
			}
1956
             getParser().setSym1(result);
1957
	                  break;
1958
            }
1493
	 
1959
	 
1494
			//
1960
			//
1495
			// Rule 208:  variableListCS2 ::= variableListCS2 , variableCS2
1961
			// Rule 208:  variableListCS2 ::= variableListCS2 , variableCS2
1496
			//
1962
			//
1963
			
1497
			case 208:
1964
			case 208:
1498
 
1965
1499
			//
1966
			//
1500
			// Rule 209:  variableListCS2 ::= variableListCS2 , variableCS
1967
			// Rule 209:  variableListCS2 ::= variableListCS2 , variableCS
1501
			//
1968
			//
1502
			case 209: {
1969
			case 209: {
1503
				
1970
				
1504
				EList result = (EList)dtParser.getSym(1);
1971
				EList result = (EList) // macro getSym is deprecated. Use function getRhsSym
1505
				result.add(dtParser.getSym(3));
1972
          getParser().getSym(1);
1506
				dtParser.setSym1(result);
1973
				result.add( // macro getSym is deprecated. Use function getRhsSym
1507
	  		  break;
1974
          getParser().getSym(3));
1508
			}
1975
				 // macro setResult is deprecated. Use function setResult
1976
             getParser().setSym1(result);
1977
	                  break;
1978
            }
1509
	 
1979
	 
1510
			//
1980
			//
1511
			// Rule 212:  featureCallExpCS ::= unaryName isMarkedPreCS ( argumentsCSopt )
1981
			// Rule 212:  featureCallExpCS ::= unaryName isMarkedPreCS ( argumentsCSopt )
1512
			//
1982
			//
1983
			
1513
			case 212:
1984
			case 212:
1514
 
1985
 
1515
			//
1986
			//
1516
			// Rule 213:  operationCallExpCS ::= binaryName isMarkedPreCS ( argumentsCSopt )
1987
			// Rule 213:  operationCallExpCS ::= binaryName isMarkedPreCS ( argumentsCSopt )
1517
			//
1988
			//
1989
			
1518
			case 213:
1990
			case 213:
1519
 
1991
1520
			//
1992
			//
1521
			// Rule 214:  keywordOperationCallExpCS ::= keywordAsName isMarkedPreCS ( argumentsCSopt )
1993
			// Rule 214:  keywordOperationCallExpCS ::= keywordAsName isMarkedPreCS ( argumentsCSopt )
1522
			//
1994
			//
1523
			case 214: {
1995
			case 214: {
1524
				
1996
				
1525
				CSTNode result = createOperationCallExpCS(
1997
				CSTNode result = createOperationCallExpCS(
1526
						(SimpleNameCS)dtParser.getSym(1),
1998
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1527
						(IsMarkedPreCS)dtParser.getSym(2),
1999
          getParser().getSym(1),
1528
						(EList)dtParser.getSym(4)
2000
						(IsMarkedPreCS) // macro getSym is deprecated. Use function getRhsSym
1529
					);
2001
          getParser().getSym(2),
1530
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(5)));
2002
						(EList) // macro getSym is deprecated. Use function getRhsSym
1531
				dtParser.setSym1(result);
2003
          getParser().getSym(4)
1532
	  		  break;
2004
					);
1533
			}
2005
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1534
	 
2006
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2007
            getParser().getToken(5)));
2008
				 // macro setResult is deprecated. Use function setResult
2009
             getParser().setSym1(result);
2010
	                  break;
2011
            }
2012
	
1535
			//
2013
			//
1536
			// Rule 215:  stateExpCS ::= pathNameCSOpt
2014
			// Rule 215:  stateExpCS ::= pathNameCSOpt
1537
			//
2015
			//
1538
			case 215: {
2016
			case 215: {
1539
				
2017
				
1540
				PathNameCS pathNameCS = (PathNameCS)dtParser.getSym(1);
2018
				PathNameCS pathNameCS = (PathNameCS) // macro getSym is deprecated. Use function getRhsSym
2019
          getParser().getSym(1);
1541
				StateExpCS result = createStateExpCS(pathNameCS);
2020
				StateExpCS result = createStateExpCS(pathNameCS);
1542
				setOffsets(result, pathNameCS);
2021
				setOffsets(result, pathNameCS);
1543
				dtParser.setSym1(result);
2022
				 // macro setResult is deprecated. Use function setResult
1544
	  		  break;
2023
             getParser().setSym1(result);
1545
			}
2024
	                  break;
1546
	 
2025
            }
2026
	
1547
			//
2027
			//
1548
			// Rule 216:  operationCallExpCS ::= oclIsInStateName isMarkedPreCS ( stateExpCS )
2028
			// Rule 216:  operationCallExpCS ::= oclIsInStateName isMarkedPreCS ( stateExpCS )
1549
			//
2029
			//
1550
			case 216: {
2030
			case 216: {
1551
				
2031
				
1552
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(1);
2032
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2033
          getParser().getSym(1);
1553
				CSTNode result = createOperationCallExpCS(
2034
				CSTNode result = createOperationCallExpCS(
1554
						simpleNameCS,
2035
						simpleNameCS,
1555
						(IsMarkedPreCS)dtParser.getSym(2),
2036
						(IsMarkedPreCS) // macro getSym is deprecated. Use function getRhsSym
1556
						(StateExpCS)dtParser.getSym(4)
2037
          getParser().getSym(2),
1557
					);
2038
						(StateExpCS) // macro getSym is deprecated. Use function getRhsSym
1558
				setOffsets(result, simpleNameCS, getIToken(dtParser.getToken(5)));
2039
          getParser().getSym(4)
1559
				dtParser.setSym1(result);
2040
					);
1560
	  		  break;
2041
				setOffsets(result, simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1561
			}
2042
            getParser().getToken(5)));
2043
				 // macro setResult is deprecated. Use function setResult
2044
             getParser().setSym1(result);
2045
	                  break;
2046
            }
1562
	 
2047
	 
1563
			//
2048
			//
1564
			// Rule 217:  attrOrNavCallExpCS ::= simpleNameCS isMarkedPreCS
2049
			// Rule 217:  attrOrNavCallExpCS ::= simpleNameCS isMarkedPreCS
1565
			//
2050
			//
2051
			
1566
			case 217:
2052
			case 217:
1567
 
2053
1568
			//
2054
			//
1569
			// Rule 218:  attrOrNavCallExpCS ::= keywordAsName isMarkedPreCS
2055
			// Rule 218:  attrOrNavCallExpCS ::= keywordAsName isMarkedPreCS
1570
			//
2056
			//
1571
			case 218: {
2057
			case 218: {
1572
				
2058
				
1573
				IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)dtParser.getSym(2);
2059
				IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS) // macro getSym is deprecated. Use function getRhsSym
2060
          getParser().getSym(2);
1574
				CSTNode result = createFeatureCallExpCS(
2061
				CSTNode result = createFeatureCallExpCS(
1575
						(SimpleNameCS)dtParser.getSym(1),
2062
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2063
          getParser().getSym(1),
1576
						new BasicEList(),
2064
						new BasicEList(),
1577
						isMarkedPreCS
2065
						isMarkedPreCS
1578
					);
2066
					);
1579
				if (isMarkedPreCS.isPre()) {
2067
				if (isMarkedPreCS.isPre()) {
1580
					setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(2));
2068
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2069
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2070
          getParser().getSym(2));
1581
				} else {
2071
				} else {
1582
					setOffsets(result, (CSTNode)dtParser.getSym(1));
2072
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2073
          getParser().getSym(1));
1583
				}
2074
				}
1584
				dtParser.setSym1(result);
2075
				 // macro setResult is deprecated. Use function setResult
1585
	  		  break;
2076
             getParser().setSym1(result);
1586
			}
2077
	                  break;
1587
	 
2078
            }
2079
	
1588
			//
2080
			//
1589
			// Rule 219:  attrOrNavCallExpCS ::= simpleNameCS [ argumentsCS ] isMarkedPreCS
2081
			// Rule 219:  attrOrNavCallExpCS ::= simpleNameCS [ argumentsCS ] isMarkedPreCS
1590
			//
2082
			//
1591
			case 219: {
2083
			case 219: {
1592
				
2084
				
1593
				IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)dtParser.getSym(5);
2085
				IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS) // macro getSym is deprecated. Use function getRhsSym
2086
          getParser().getSym(5);
1594
				CSTNode result = createFeatureCallExpCS(
2087
				CSTNode result = createFeatureCallExpCS(
1595
						(SimpleNameCS)dtParser.getSym(1),
2088
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1596
						(EList)dtParser.getSym(3),
2089
          getParser().getSym(1),
2090
						(EList) // macro getSym is deprecated. Use function getRhsSym
2091
          getParser().getSym(3),
1597
						isMarkedPreCS
2092
						isMarkedPreCS
1598
					);
2093
					);
1599
				if (isMarkedPreCS.isPre()) {
2094
				if (isMarkedPreCS.isPre()) {
1600
					setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(5));
2095
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2096
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2097
          getParser().getSym(5));
1601
				} else {
2098
				} else {
1602
					setOffsets(result, (CSTNode)dtParser.getSym(1), getIToken(dtParser.getToken(4)));
2099
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2100
          getParser().getSym(1), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2101
            getParser().getToken(4)));
1603
				}
2102
				}
1604
				dtParser.setSym1(result);
2103
				 // macro setResult is deprecated. Use function setResult
1605
	  		  break;
2104
             getParser().setSym1(result);
1606
			}
2105
	                  break;
1607
	 
2106
            }
2107
	
1608
			//
2108
			//
1609
			// Rule 220:  isMarkedPreCS ::= $Empty
2109
			// Rule 220:  isMarkedPreCS ::= $Empty
1610
			//
2110
			//
1611
			case 220: {
2111
			case 220: {
1612
				
2112
				
1613
				CSTNode result = createIsMarkedPreCS(false);
2113
				CSTNode result = createIsMarkedPreCS(false);
1614
				setOffsets(result, getIToken(dtParser.getToken(1)));
2114
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1615
				dtParser.setSym1(result);
2115
            getParser().getToken(1)));
1616
	  		  break;
2116
				 // macro setResult is deprecated. Use function setResult
1617
			}
2117
             getParser().setSym1(result);
1618
	 
2118
	                  break;
2119
            }
2120
	
1619
			//
2121
			//
1620
			// Rule 221:  isMarkedPreCS ::= @pre
2122
			// Rule 221:  isMarkedPreCS ::= @pre
1621
			//
2123
			//
1622
			case 221: {
2124
			case 221: {
1623
				
2125
				
1624
				CSTNode result = createIsMarkedPreCS(true);
2126
				CSTNode result = createIsMarkedPreCS(true);
1625
				setOffsets(result, getIToken(dtParser.getToken(1)));
2127
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1626
				dtParser.setSym1(result);
2128
            getParser().getToken(1)));
1627
	  		  break;
2129
				 // macro setResult is deprecated. Use function setResult
1628
			}
2130
             getParser().setSym1(result);
2131
	                  break;
2132
            }
1629
	 
2133
	 
1630
			//
2134
			//
1631
			// Rule 222:  argumentsCSopt ::= $Empty
2135
			// Rule 222:  argumentsCSopt ::= $Empty
1632
			//
2136
			//
2137
			
1633
			case 222:
2138
			case 222:
1634
				dtParser.setSym1(new BasicEList());
2139
				setResult(new BasicEList());
1635
				break;
2140
				break;
1636
 
2141
1637
			//
2142
			//
1638
			// Rule 224:  argumentsCS ::= oclExpressionCS
2143
			// Rule 224:  argumentsCS ::= oclExpressionCS
1639
			//
2144
			//
1640
			case 224: {
2145
			case 224: {
1641
				
2146
				
1642
				EList result = new BasicEList();
2147
				EList result = new BasicEList();
1643
				result.add(dtParser.getSym(1));
2148
				result.add( // macro getSym is deprecated. Use function getRhsSym
1644
				dtParser.setSym1(result);
2149
          getParser().getSym(1));
1645
	  		  break;
2150
				 // macro setResult is deprecated. Use function setResult
1646
			}
2151
             getParser().setSym1(result);
1647
	 
2152
	                  break;
2153
            }
2154
	
1648
			//
2155
			//
1649
			// Rule 225:  argumentsCS ::= argumentsCS , oclExpressionCS
2156
			// Rule 225:  argumentsCS ::= argumentsCS , oclExpressionCS
1650
			//
2157
			//
1651
			case 225: {
2158
			case 225: {
1652
				
2159
				
1653
				EList result = (EList)dtParser.getSym(1);
2160
				EList result = (EList) // macro getSym is deprecated. Use function getRhsSym
1654
				result.add(dtParser.getSym(3));
2161
          getParser().getSym(1);
1655
				dtParser.setSym1(result);
2162
				result.add( // macro getSym is deprecated. Use function getRhsSym
1656
	  		  break;
2163
          getParser().getSym(3));
1657
			}
2164
				 // macro setResult is deprecated. Use function setResult
1658
	 
2165
             getParser().setSym1(result);
2166
	                  break;
2167
            }
2168
	
1659
			//
2169
			//
1660
			// Rule 226:  letExpCS ::= let variableListCS in oclExpressionCS
2170
			// Rule 226:  letExpCS ::= let variableListCS in oclExpressionCS
1661
			//
2171
			//
1662
			case 226: {
2172
			case 226: {
1663
				
2173
				
1664
				CSTNode result = createLetExpCS(
2174
				CSTNode result = createLetExpCS(
1665
						(EList)dtParser.getSym(2),
2175
						(EList) // macro getSym is deprecated. Use function getRhsSym
1666
						(OCLExpressionCS)dtParser.getSym(4)
2176
          getParser().getSym(2),
1667
					);
2177
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1668
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(4));
2178
          getParser().getSym(4)
1669
				dtParser.setSym1(result);
2179
					);
1670
	  		  break;
2180
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1671
			}
2181
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1672
	 
2182
          getParser().getSym(4));
2183
				 // macro setResult is deprecated. Use function setResult
2184
             getParser().setSym1(result);
2185
	                  break;
2186
            }
2187
	
1673
			//
2188
			//
1674
			// Rule 227:  ifExpCS ::= if oclExpressionCS then oclExpressionCS else oclExpressionCS endif
2189
			// Rule 227:  ifExpCS ::= if oclExpressionCS then oclExpressionCS else oclExpressionCS endif
1675
			//
2190
			//
1676
			case 227: {
2191
			case 227: {
1677
				
2192
				
1678
				CSTNode result = createIfExpCS(
2193
				CSTNode result = createIfExpCS(
1679
						(OCLExpressionCS)dtParser.getSym(2),
2194
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1680
						(OCLExpressionCS)dtParser.getSym(4),
2195
          getParser().getSym(2),
1681
						(OCLExpressionCS)dtParser.getSym(6)
2196
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1682
					);
2197
          getParser().getSym(4),
1683
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(7)));
2198
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1684
				dtParser.setSym1(result);
2199
          getParser().getSym(6)
1685
	  		  break;
2200
					);
1686
			}
2201
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2202
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2203
            getParser().getToken(7)));
2204
				 // macro setResult is deprecated. Use function setResult
2205
             getParser().setSym1(result);
2206
	                  break;
2207
            }
1687
	 
2208
	 
1688
			//
2209
			//
1689
			// Rule 228:  messageExpCS ::= ^ simpleNameCS ( oclMessageArgumentsCSopt )
2210
			// Rule 228:  messageExpCS ::= ^ simpleNameCS ( oclMessageArgumentsCSopt )
1690
			//
2211
			//
2212
			
1691
			case 228:
2213
			case 228:
1692
 
2214
1693
			//
2215
			//
1694
			// Rule 229:  messageExpCS ::= ^^ simpleNameCS ( oclMessageArgumentsCSopt )
2216
			// Rule 229:  messageExpCS ::= ^^ simpleNameCS ( oclMessageArgumentsCSopt )
1695
			//
2217
			//
1696
			case 229: {
2218
			case 229: {
1697
				
2219
				
1698
				CSTNode result = createMessageExpCS(
2220
				CSTNode result = createMessageExpCS(
1699
						getIToken(dtParser.getToken(1)).getKind() == OCLParsersym.TK_CARET,
2221
						getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1700
						(SimpleNameCS)dtParser.getSym(2),
2222
            getParser().getToken(1)).getKind() == OCLParsersym.TK_CARET,
1701
						(EList<OCLMessageArgCS>)dtParser.getSym(4)
2223
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1702
					);
2224
          getParser().getSym(2),
1703
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(5)));
2225
						(EList<OCLMessageArgCS>) // macro getSym is deprecated. Use function getRhsSym
1704
				dtParser.setSym1(result);
2226
          getParser().getSym(4)
1705
	  		  break;
2227
					);
1706
			}
2228
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2229
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2230
            getParser().getToken(5)));
2231
				 // macro setResult is deprecated. Use function setResult
2232
             getParser().setSym1(result);
2233
	                  break;
2234
            }
1707
	 
2235
	 
1708
			//
2236
			//
1709
			// Rule 230:  oclMessageArgumentsCSopt ::= $Empty
2237
			// Rule 230:  oclMessageArgumentsCSopt ::= $Empty
1710
			//
2238
			//
2239
			
1711
			case 230:
2240
			case 230:
1712
				dtParser.setSym1(new BasicEList());
2241
				setResult(new BasicEList());
1713
				break;
2242
				break;
1714
 
2243
1715
			//
2244
			//
1716
			// Rule 232:  oclMessageArgumentsCS ::= oclMessageArgCS
2245
			// Rule 232:  oclMessageArgumentsCS ::= oclMessageArgCS
1717
			//
2246
			//
1718
			case 232: {
2247
			case 232: {
1719
				
2248
				
1720
				EList result = new BasicEList();
2249
				EList result = new BasicEList();
1721
				result.add(dtParser.getSym(1));
2250
				result.add( // macro getSym is deprecated. Use function getRhsSym
1722
				dtParser.setSym1(result);
2251
          getParser().getSym(1));
1723
	  		  break;
2252
				 // macro setResult is deprecated. Use function setResult
1724
			}
2253
             getParser().setSym1(result);
1725
	 
2254
	                  break;
2255
            }
2256
	
1726
			//
2257
			//
1727
			// Rule 233:  oclMessageArgumentsCS ::= oclMessageArgumentsCS , oclMessageArgCS
2258
			// Rule 233:  oclMessageArgumentsCS ::= oclMessageArgumentsCS , oclMessageArgCS
1728
			//
2259
			//
1729
			case 233: {
2260
			case 233: {
1730
				
2261
				
1731
				EList result = (EList)dtParser.getSym(1);
2262
				EList result = (EList) // macro getSym is deprecated. Use function getRhsSym
1732
				result.add(dtParser.getSym(3));
2263
          getParser().getSym(1);
1733
				dtParser.setSym1(result);
2264
				result.add( // macro getSym is deprecated. Use function getRhsSym
1734
	  		  break;
2265
          getParser().getSym(3));
1735
			}
2266
				 // macro setResult is deprecated. Use function setResult
1736
	 
2267
             getParser().setSym1(result);
2268
	                  break;
2269
            }
2270
	
1737
			//
2271
			//
1738
			// Rule 234:  oclMessageArgCS ::= oclExpressionCS
2272
			// Rule 234:  oclMessageArgCS ::= oclExpressionCS
1739
			//
2273
			//
Lines 1741-1753 Link Here
1741
				
2275
				
1742
				CSTNode result = createOCLMessageArgCS(
2276
				CSTNode result = createOCLMessageArgCS(
1743
						null,
2277
						null,
1744
						(OCLExpressionCS)dtParser.getSym(1)
2278
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
2279
          getParser().getSym(1)
1745
					);
2280
					);
1746
				setOffsets(result, (CSTNode)dtParser.getSym(1));
2281
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1747
				dtParser.setSym1(result);
2282
          getParser().getSym(1));
1748
	  		  break;
2283
				 // macro setResult is deprecated. Use function setResult
1749
			}
2284
             getParser().setSym1(result);
1750
	 
2285
	                  break;
2286
            }
2287
	
1751
			//
2288
			//
1752
			// Rule 235:  oclMessageArgCS ::= ?
2289
			// Rule 235:  oclMessageArgCS ::= ?
1753
			//
2290
			//
Lines 1757-1990 Link Here
1757
						null,
2294
						null,
1758
						null
2295
						null
1759
					);
2296
					);
1760
				setOffsets(result, getIToken(dtParser.getToken(1)));
2297
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1761
				dtParser.setSym1(result);
2298
            getParser().getToken(1)));
1762
	  		  break;
2299
				 // macro setResult is deprecated. Use function setResult
1763
			}
2300
             getParser().setSym1(result);
1764
	 
2301
	                  break;
2302
            }
2303
	
1765
			//
2304
			//
1766
			// Rule 236:  oclMessageArgCS ::= ? : typeCS
2305
			// Rule 236:  oclMessageArgCS ::= ? : typeCS
1767
			//
2306
			//
1768
			case 236: {
2307
			case 236: {
1769
				
2308
				
1770
				CSTNode result = createOCLMessageArgCS(
2309
				CSTNode result = createOCLMessageArgCS(
1771
						(TypeCS)dtParser.getSym(3),
2310
						(TypeCS) // macro getSym is deprecated. Use function getRhsSym
2311
          getParser().getSym(3),
1772
						null
2312
						null
1773
					);
2313
					);
1774
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(3));
2314
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1775
				dtParser.setSym1(result);
2315
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1776
	  		  break;
2316
          getParser().getSym(3));
1777
			}
2317
				 // macro setResult is deprecated. Use function setResult
1778
	 
2318
             getParser().setSym1(result);
2319
	                  break;
2320
            }
2321
	
1779
			//
2322
			//
1780
			// Rule 245:  packageDeclarationCSm ::= packageDeclarationCSm packageDeclarationCS
2323
			// Rule 245:  packageDeclarationCSm ::= packageDeclarationCSm packageDeclarationCS
1781
			//
2324
			//
1782
			case 245: {
2325
			case 245: {
1783
				
2326
				
1784
				PackageDeclarationCS result = (PackageDeclarationCS)dtParser.getSym(2);
2327
				PackageDeclarationCS result = (PackageDeclarationCS) // macro getSym is deprecated. Use function getRhsSym
1785
				result.setPackageDeclarationCS((PackageDeclarationCS) dtParser.getSym(1));
2328
          getParser().getSym(2);
1786
				dtParser.setSym1(result);
2329
				result.setPackageDeclarationCS((PackageDeclarationCS)  // macro getSym is deprecated. Use function getRhsSym
1787
	  		  break;
2330
          getParser().getSym(1));
1788
			}
2331
				 // macro setResult is deprecated. Use function setResult
1789
	 
2332
             getParser().setSym1(result);
2333
	                  break;
2334
            }
2335
	
1790
			//
2336
			//
1791
			// Rule 246:  packageDeclarationCS ::= package pathNameCS contextDeclCSmopt endpackage
2337
			// Rule 246:  packageDeclarationCS ::= package pathNameCS contextDeclCSmopt endpackage
1792
			//
2338
			//
1793
			case 246: {
2339
			case 246: {
1794
				
2340
				
1795
				CSTNode result = createPackageDeclarationCS(
2341
				CSTNode result = createPackageDeclarationCS(
1796
						(PathNameCS)dtParser.getSym(2),
2342
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
1797
						(EList)dtParser.getSym(3)
2343
          getParser().getSym(2),
1798
					);
2344
						(EList) // macro getSym is deprecated. Use function getRhsSym
1799
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
2345
          getParser().getSym(3)
1800
				dtParser.setSym1(result);
2346
					);
1801
	  		  break;
2347
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1802
			}
2348
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1803
	 
2349
            getParser().getToken(4)));
2350
				 // macro setResult is deprecated. Use function setResult
2351
             getParser().setSym1(result);
2352
	                  break;
2353
            }
2354
	
1804
			//
2355
			//
1805
			// Rule 247:  packageDeclarationCS1 ::= contextDeclCSm
2356
			// Rule 247:  packageDeclarationCS1 ::= contextDeclCSm
1806
			//
2357
			//
1807
			case 247: {
2358
			case 247: {
1808
				
2359
				
1809
				EList contextDecls = (EList)dtParser.getSym(1);
2360
				EList contextDecls = (EList) // macro getSym is deprecated. Use function getRhsSym
2361
          getParser().getSym(1);
1810
				CSTNode result = createPackageDeclarationCS(null, contextDecls);
2362
				CSTNode result = createPackageDeclarationCS(null, contextDecls);
1811
				if (!contextDecls.isEmpty()) {
2363
				if (!contextDecls.isEmpty()) {
1812
					setOffsets(result, (CSTNode)contextDecls.get(0), (CSTNode)contextDecls.get(contextDecls.size()-1));
2364
					setOffsets(result, (CSTNode)contextDecls.get(0), (CSTNode)contextDecls.get(contextDecls.size()-1));
1813
				}
2365
				}
1814
				dtParser.setSym1(result);
2366
				 // macro setResult is deprecated. Use function setResult
1815
	  		  break;
2367
             getParser().setSym1(result);
1816
			}
2368
	                  break;
2369
            }
1817
	 
2370
	 
1818
			//
2371
			//
1819
			// Rule 248:  contextDeclCSmopt ::= $Empty
2372
			// Rule 248:  contextDeclCSmopt ::= $Empty
1820
			//
2373
			//
2374
			
1821
			case 248:
2375
			case 248:
1822
				dtParser.setSym1(new BasicEList());
2376
				setResult(new BasicEList());
1823
				break;
2377
				break;
1824
 
2378
1825
			//
2379
			//
1826
			// Rule 250:  contextDeclCSm ::= contextDeclCS
2380
			// Rule 250:  contextDeclCSm ::= contextDeclCS
1827
			//
2381
			//
1828
			case 250: {
2382
			case 250: {
1829
				
2383
				
1830
				EList result = new BasicEList();
2384
				EList result = new BasicEList();
1831
				result.add(dtParser.getSym(1));
2385
				result.add( // macro getSym is deprecated. Use function getRhsSym
1832
				dtParser.setSym1(result);
2386
          getParser().getSym(1));
1833
	  		  break;
2387
				 // macro setResult is deprecated. Use function setResult
1834
			}
2388
             getParser().setSym1(result);
1835
	 
2389
	                  break;
2390
            }
2391
	
1836
			//
2392
			//
1837
			// Rule 251:  contextDeclCSm ::= contextDeclCSm contextDeclCS
2393
			// Rule 251:  contextDeclCSm ::= contextDeclCSm contextDeclCS
1838
			//
2394
			//
1839
			case 251: {
2395
			case 251: {
1840
				
2396
				
1841
				EList result = (EList)dtParser.getSym(1);
2397
				EList result = (EList) // macro getSym is deprecated. Use function getRhsSym
1842
				result.add(dtParser.getSym(2));
2398
          getParser().getSym(1);
1843
				dtParser.setSym1(result);
2399
				result.add( // macro getSym is deprecated. Use function getRhsSym
1844
	  		  break;
2400
          getParser().getSym(2));
1845
			}
2401
				 // macro setResult is deprecated. Use function setResult
1846
	 
2402
             getParser().setSym1(result);
2403
	                  break;
2404
            }
2405
	
1847
			//
2406
			//
1848
			// Rule 255:  propertyContextCS ::= context pathNameCS :: simpleNameCS : typeCS initOrDerValueCS
2407
			// Rule 255:  propertyContextCS ::= context pathNameCS :: simpleNameCS : typeCS initOrDerValueCS
1849
			//
2408
			//
1850
			case 255: {
2409
			case 255: {
1851
				
2410
				
1852
				CSTNode result = createPropertyContextCS(
2411
				CSTNode result = createPropertyContextCS(
1853
						(PathNameCS)dtParser.getSym(2),
2412
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
1854
						(SimpleNameCS)dtParser.getSym(4),
2413
          getParser().getSym(2),
1855
						(TypeCS)dtParser.getSym(6),
2414
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1856
						(InitOrDerValueCS)dtParser.getSym(7)
2415
          getParser().getSym(4),
1857
					);
2416
						(TypeCS) // macro getSym is deprecated. Use function getRhsSym
1858
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(7));
2417
          getParser().getSym(6),
1859
				dtParser.setSym1(result);
2418
						(InitOrDerValueCS) // macro getSym is deprecated. Use function getRhsSym
1860
	  		  break;
2419
          getParser().getSym(7)
1861
			}
2420
					);
1862
	 
2421
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2422
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2423
          getParser().getSym(7));
2424
				 // macro setResult is deprecated. Use function setResult
2425
             getParser().setSym1(result);
2426
	                  break;
2427
            }
2428
	
1863
			//
2429
			//
1864
			// Rule 256:  initOrDerValueCS ::= initOrDerValueCSopt init : oclExpressionCS
2430
			// Rule 256:  initOrDerValueCS ::= initOrDerValueCSopt init : oclExpressionCS
1865
			//
2431
			//
1866
			case 256: {
2432
			case 256: {
1867
				
2433
				
1868
				CSTNode result = createInitValueCS(
2434
				CSTNode result = createInitValueCS(
1869
						(InitOrDerValueCS)dtParser.getSym(1),
2435
						(InitOrDerValueCS) // macro getSym is deprecated. Use function getRhsSym
1870
						(OCLExpressionCS)dtParser.getSym(4)
2436
          getParser().getSym(1),
1871
					);
2437
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1872
				if (dtParser.getSym(1) != null) {
2438
          getParser().getSym(4)
1873
					setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(4));
2439
					);
2440
				if ( // macro getSym is deprecated. Use function getRhsSym
2441
          getParser().getSym(1) != null) {
2442
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2443
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2444
          getParser().getSym(4));
1874
				} else {
2445
				} else {
1875
					setOffsets(result, getIToken(dtParser.getToken(2)), (CSTNode)dtParser.getSym(4));
2446
					setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2447
            getParser().getToken(2)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2448
          getParser().getSym(4));
1876
				}
2449
				}
1877
				dtParser.setSym1(result);
2450
				 // macro setResult is deprecated. Use function setResult
1878
	  		  break;
2451
             getParser().setSym1(result);
1879
			}
2452
	                  break;
1880
	 
2453
            }
2454
	
1881
			//
2455
			//
1882
			// Rule 257:  initOrDerValueCS ::= initOrDerValueCSopt derive : oclExpressionCS
2456
			// Rule 257:  initOrDerValueCS ::= initOrDerValueCSopt derive : oclExpressionCS
1883
			//
2457
			//
1884
			case 257: {
2458
			case 257: {
1885
				
2459
				
1886
				CSTNode result = createDerValueCS(
2460
				CSTNode result = createDerValueCS(
1887
						(InitOrDerValueCS)dtParser.getSym(1),
2461
						(InitOrDerValueCS) // macro getSym is deprecated. Use function getRhsSym
1888
						(OCLExpressionCS)dtParser.getSym(4)
2462
          getParser().getSym(1),
1889
					);
2463
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1890
				if (dtParser.getSym(1) != null) {
2464
          getParser().getSym(4)
1891
					setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(4));
2465
					);
2466
				if ( // macro getSym is deprecated. Use function getRhsSym
2467
          getParser().getSym(1) != null) {
2468
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2469
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2470
          getParser().getSym(4));
1892
				} else {
2471
				} else {
1893
					setOffsets(result, getIToken(dtParser.getToken(2)), (CSTNode)dtParser.getSym(4));
2472
					setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2473
            getParser().getToken(2)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2474
          getParser().getSym(4));
1894
				}
2475
				}
1895
				dtParser.setSym1(result);
2476
				 // macro setResult is deprecated. Use function setResult
1896
	  		  break;
2477
             getParser().setSym1(result);
1897
			}
2478
	                  break;
1898
	 
2479
            }
2480
	
1899
			//
2481
			//
1900
			// Rule 258:  initOrDerValueCSopt ::= $Empty
2482
			// Rule 258:  initOrDerValueCSopt ::= $Empty
1901
			//
2483
			//
1902
			case 258:
2484
			case 258:
1903
				dtParser.setSym1(null);
2485
                setResult(null);
1904
				break;
2486
                break;
1905
 
2487
1906
			//
2488
			//
1907
			// Rule 260:  classifierContextDeclCS ::= context pathNameCS invOrDefCSm
2489
			// Rule 260:  classifierContextDeclCS ::= context pathNameCS invOrDefCSm
1908
			//
2490
			//
1909
			case 260: {
2491
			case 260: {
1910
				
2492
				
1911
				EList<InvOrDefCS> list = (EList<InvOrDefCS>)dtParser.getSym(3);
2493
				EList<InvOrDefCS> list = (EList<InvOrDefCS>) // macro getSym is deprecated. Use function getRhsSym
2494
          getParser().getSym(3);
1912
				CSTNode result = createClassifierContextDeclCS(
2495
				CSTNode result = createClassifierContextDeclCS(
1913
						(PathNameCS)dtParser.getSym(2),
2496
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
2497
          getParser().getSym(2),
1914
						list
2498
						list
1915
					);
2499
					);
1916
				setOffsets(result, getIToken(dtParser.getToken(1)), list.get(list.size()-1));
2500
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1917
				dtParser.setSym1(result);
2501
            getParser().getToken(1)), list.get(list.size()-1));
1918
	  		  break;
2502
				 // macro setResult is deprecated. Use function setResult
1919
			}
2503
             getParser().setSym1(result);
1920
	 
2504
	                  break;
2505
            }
2506
	
1921
			//
2507
			//
1922
			// Rule 261:  invOrDefCSm ::= invOrDefCS
2508
			// Rule 261:  invOrDefCSm ::= invOrDefCS
1923
			//
2509
			//
1924
			case 261: {
2510
			case 261: {
1925
				
2511
				
1926
				EList<InvOrDefCS> result = new BasicEList<InvOrDefCS>();
2512
				EList<InvOrDefCS> result = new BasicEList<InvOrDefCS>();
1927
				result.add((InvOrDefCS)dtParser.getSym(1));
2513
				result.add((InvOrDefCS) // macro getSym is deprecated. Use function getRhsSym
1928
				dtParser.setSym1(result);
2514
          getParser().getSym(1));
1929
	  		  break;
2515
				 // macro setResult is deprecated. Use function setResult
1930
			}
2516
             getParser().setSym1(result);
1931
	 
2517
	                  break;
2518
            }
2519
	
1932
			//
2520
			//
1933
			// Rule 262:  invOrDefCSm ::= invOrDefCSm invOrDefCS
2521
			// Rule 262:  invOrDefCSm ::= invOrDefCSm invOrDefCS
1934
			//
2522
			//
1935
			case 262: {
2523
			case 262: {
1936
				
2524
				
1937
				EList<InvOrDefCS> result = (EList<InvOrDefCS>)dtParser.getSym(1);
2525
				EList<InvOrDefCS> result = (EList<InvOrDefCS>) // macro getSym is deprecated. Use function getRhsSym
1938
				result.add((InvOrDefCS)dtParser.getSym(2));
2526
          getParser().getSym(1);
1939
				dtParser.setSym1(result);
2527
				result.add((InvOrDefCS) // macro getSym is deprecated. Use function getRhsSym
1940
	  		  break;
2528
          getParser().getSym(2));
1941
			}
2529
				 // macro setResult is deprecated. Use function setResult
1942
	 
2530
             getParser().setSym1(result);
2531
	                  break;
2532
            }
2533
	
1943
			//
2534
			//
1944
			// Rule 263:  invOrDefCS ::= inv simpleNameCSopt : oclExpressionCS
2535
			// Rule 263:  invOrDefCS ::= inv simpleNameCSopt : oclExpressionCS
1945
			//
2536
			//
1946
			case 263: {
2537
			case 263: {
1947
				
2538
				
1948
				CSTNode result = createInvCS(
2539
				CSTNode result = createInvCS(
1949
						(SimpleNameCS)dtParser.getSym(2),
2540
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1950
						(OCLExpressionCS)dtParser.getSym(4)
2541
          getParser().getSym(2),
1951
					);
2542
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1952
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(4));
2543
          getParser().getSym(4)
1953
				dtParser.setSym1(result);
2544
					);
1954
	  		  break;
2545
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1955
			}
2546
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1956
	 
2547
          getParser().getSym(4));
2548
				 // macro setResult is deprecated. Use function setResult
2549
             getParser().setSym1(result);
2550
	                  break;
2551
            }
2552
	
1957
			//
2553
			//
1958
			// Rule 264:  invOrDefCS ::= def simpleNameCSopt : defExpressionCS
2554
			// Rule 264:  invOrDefCS ::= def simpleNameCSopt : defExpressionCS
1959
			//
2555
			//
1960
			case 264: {
2556
			case 264: {
1961
				
2557
				
1962
				CSTNode result = createDefCS(
2558
				CSTNode result = createDefCS(
1963
						(SimpleNameCS)dtParser.getSym(2),
2559
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1964
						(DefExpressionCS)dtParser.getSym(4)
2560
          getParser().getSym(2),
1965
					);
2561
						(DefExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1966
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(4));
2562
          getParser().getSym(4)
1967
				dtParser.setSym1(result);
2563
					);
1968
	  		  break;
2564
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1969
			}
2565
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1970
	 
2566
          getParser().getSym(4));
2567
				 // macro setResult is deprecated. Use function setResult
2568
             getParser().setSym1(result);
2569
	                  break;
2570
            }
2571
	
1971
			//
2572
			//
1972
			// Rule 265:  defExpressionCS ::= typedVariableCS = oclExpressionCS
2573
			// Rule 265:  defExpressionCS ::= typedVariableCS = oclExpressionCS
1973
			//
2574
			//
1974
			case 265: {
2575
			case 265: {
1975
				
2576
				
1976
				VariableCS variableCS = (VariableCS)dtParser.getSym(1);
2577
				VariableCS variableCS = (VariableCS) // macro getSym is deprecated. Use function getRhsSym
1977
				OCLExpressionCS expressionCS = (OCLExpressionCS)dtParser.getSym(3);
2578
          getParser().getSym(1);
2579
				OCLExpressionCS expressionCS = (OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
2580
          getParser().getSym(3);
1978
				CSTNode result = createDefExpressionCS(
2581
				CSTNode result = createDefExpressionCS(
1979
						variableCS,
2582
						variableCS,
1980
						null,
2583
						null,
1981
						expressionCS
2584
						expressionCS
1982
					);
2585
					);
1983
				setOffsets(result, variableCS, expressionCS);
2586
				setOffsets(result, variableCS, expressionCS);
1984
				dtParser.setSym1(result);
2587
				 // macro setResult is deprecated. Use function setResult
1985
	  		  break;
2588
             getParser().setSym1(result);
1986
			}
2589
	                  break;
1987
	 
2590
            }
2591
	
1988
			//
2592
			//
1989
			// Rule 266:  defExpressionCS ::= operationCS1 = oclExpressionCS
2593
			// Rule 266:  defExpressionCS ::= operationCS1 = oclExpressionCS
1990
			//
2594
			//
Lines 1992-2042 Link Here
1992
				
2596
				
1993
				CSTNode result = createDefExpressionCS(
2597
				CSTNode result = createDefExpressionCS(
1994
						null,
2598
						null,
1995
						(OperationCS)dtParser.getSym(1),
2599
						(OperationCS) // macro getSym is deprecated. Use function getRhsSym
1996
						(OCLExpressionCS)dtParser.getSym(3)
2600
          getParser().getSym(1),
1997
					);
2601
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1998
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
2602
          getParser().getSym(3)
1999
				dtParser.setSym1(result);
2603
					);
2000
	  		  break;
2604
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2001
			}
2605
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2002
	 
2606
          getParser().getSym(3));
2607
				 // macro setResult is deprecated. Use function setResult
2608
             getParser().setSym1(result);
2609
	                  break;
2610
            }
2611
	
2003
			//
2612
			//
2004
			// Rule 267:  operationContextDeclCS ::= context operationCS2 prePostOrBodyDeclCSm
2613
			// Rule 267:  operationContextDeclCS ::= context operationCS2 prePostOrBodyDeclCSm
2005
			//
2614
			//
2006
			case 267: {
2615
			case 267: {
2007
				
2616
				
2008
				EList prePostOrBodyDecls = (EList)dtParser.getSym(3);
2617
				EList prePostOrBodyDecls = (EList) // macro getSym is deprecated. Use function getRhsSym
2618
          getParser().getSym(3);
2009
				CSTNode result = createOperationContextDeclCS(
2619
				CSTNode result = createOperationContextDeclCS(
2010
						(OperationCS)dtParser.getSym(2),
2620
						(OperationCS) // macro getSym is deprecated. Use function getRhsSym
2621
          getParser().getSym(2),
2011
						prePostOrBodyDecls
2622
						prePostOrBodyDecls
2012
					);
2623
					);
2013
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)prePostOrBodyDecls.get(prePostOrBodyDecls.size()-1));
2624
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2014
				dtParser.setSym1(result);
2625
            getParser().getToken(1)), (CSTNode)prePostOrBodyDecls.get(prePostOrBodyDecls.size()-1));
2015
	  		  break;
2626
				 // macro setResult is deprecated. Use function setResult
2016
			}
2627
             getParser().setSym1(result);
2017
	 
2628
	                  break;
2629
            }
2630
	
2018
			//
2631
			//
2019
			// Rule 268:  prePostOrBodyDeclCSm ::= prePostOrBodyDeclCS
2632
			// Rule 268:  prePostOrBodyDeclCSm ::= prePostOrBodyDeclCS
2020
			//
2633
			//
2021
			case 268: {
2634
			case 268: {
2022
				
2635
				
2023
				EList result = new BasicEList();
2636
				EList result = new BasicEList();
2024
				result.add(dtParser.getSym(1));
2637
				result.add( // macro getSym is deprecated. Use function getRhsSym
2025
				dtParser.setSym1(result);
2638
          getParser().getSym(1));
2026
	  		  break;
2639
				 // macro setResult is deprecated. Use function setResult
2027
			}
2640
             getParser().setSym1(result);
2028
	 
2641
	                  break;
2642
            }
2643
	
2029
			//
2644
			//
2030
			// Rule 269:  prePostOrBodyDeclCSm ::= prePostOrBodyDeclCSm prePostOrBodyDeclCS
2645
			// Rule 269:  prePostOrBodyDeclCSm ::= prePostOrBodyDeclCSm prePostOrBodyDeclCS
2031
			//
2646
			//
2032
			case 269: {
2647
			case 269: {
2033
				
2648
				
2034
				EList result = (EList)dtParser.getSym(1);
2649
				EList result = (EList) // macro getSym is deprecated. Use function getRhsSym
2035
				result.add(dtParser.getSym(2));
2650
          getParser().getSym(1);
2036
				dtParser.setSym1(result);
2651
				result.add( // macro getSym is deprecated. Use function getRhsSym
2037
	  		  break;
2652
          getParser().getSym(2));
2038
			}
2653
				 // macro setResult is deprecated. Use function setResult
2039
	 
2654
             getParser().setSym1(result);
2655
	                  break;
2656
            }
2657
	
2040
			//
2658
			//
2041
			// Rule 270:  prePostOrBodyDeclCS ::= pre simpleNameCSopt : oclExpressionCS
2659
			// Rule 270:  prePostOrBodyDeclCS ::= pre simpleNameCSopt : oclExpressionCS
2042
			//
2660
			//
Lines 2044-2057 Link Here
2044
				
2662
				
2045
				CSTNode result = createPrePostOrBodyDeclCS(
2663
				CSTNode result = createPrePostOrBodyDeclCS(
2046
						PrePostOrBodyEnum.PRE_LITERAL,
2664
						PrePostOrBodyEnum.PRE_LITERAL,
2047
						(SimpleNameCS)dtParser.getSym(2),
2665
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2048
						(OCLExpressionCS)dtParser.getSym(4)
2666
          getParser().getSym(2),
2049
					);
2667
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
2050
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(4));
2668
          getParser().getSym(4)
2051
				dtParser.setSym1(result);
2669
					);
2052
	  		  break;
2670
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2053
			}
2671
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2054
	 
2672
          getParser().getSym(4));
2673
				 // macro setResult is deprecated. Use function setResult
2674
             getParser().setSym1(result);
2675
	                  break;
2676
            }
2677
	
2055
			//
2678
			//
2056
			// Rule 271:  prePostOrBodyDeclCS ::= post simpleNameCSopt : oclExpressionCS
2679
			// Rule 271:  prePostOrBodyDeclCS ::= post simpleNameCSopt : oclExpressionCS
2057
			//
2680
			//
Lines 2059-2072 Link Here
2059
				
2682
				
2060
				CSTNode result = createPrePostOrBodyDeclCS(
2683
				CSTNode result = createPrePostOrBodyDeclCS(
2061
						PrePostOrBodyEnum.POST_LITERAL,
2684
						PrePostOrBodyEnum.POST_LITERAL,
2062
						(SimpleNameCS)dtParser.getSym(2),
2685
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2063
						(OCLExpressionCS)dtParser.getSym(4)
2686
          getParser().getSym(2),
2064
					);
2687
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
2065
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(4));
2688
          getParser().getSym(4)
2066
				dtParser.setSym1(result);
2689
					);
2067
	  		  break;
2690
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2068
			}
2691
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2069
	 
2692
          getParser().getSym(4));
2693
				 // macro setResult is deprecated. Use function setResult
2694
             getParser().setSym1(result);
2695
	                  break;
2696
            }
2697
	
2070
			//
2698
			//
2071
			// Rule 272:  prePostOrBodyDeclCS ::= body simpleNameCSopt : oclExpressionCS
2699
			// Rule 272:  prePostOrBodyDeclCS ::= body simpleNameCSopt : oclExpressionCS
2072
			//
2700
			//
Lines 2074-2088 Link Here
2074
				
2702
				
2075
				CSTNode result = createPrePostOrBodyDeclCS(
2703
				CSTNode result = createPrePostOrBodyDeclCS(
2076
						PrePostOrBodyEnum.BODY_LITERAL,
2704
						PrePostOrBodyEnum.BODY_LITERAL,
2077
						(SimpleNameCS)dtParser.getSym(2),
2705
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2078
						(OCLExpressionCS)dtParser.getSym(4)
2706
          getParser().getSym(2),
2079
					);
2707
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
2080
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(4));
2708
          getParser().getSym(4)
2081
				dtParser.setSym1(result);
2709
					);
2082
	  		  break;
2710
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2083
			}
2711
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2084
	
2712
          getParser().getSym(4));
2713
				 // macro setResult is deprecated. Use function setResult
2714
             getParser().setSym1(result);
2715
	                  break;
2716
            }
2085
	
2717
	
2718
    
2086
			default:
2719
			default:
2087
				break;
2720
				break;
2088
		}
2721
		}
(-)src/org/eclipse/ocl/parser/OCLProblemHandler.java (-14 / +23 lines)
Lines 17-22 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.parser;
18
package org.eclipse.ocl.parser;
19
19
20
import lpg.runtime.IPrsStream;
21
20
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
21
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
22
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
Lines 81-97 Link Here
81
	@Override
83
	@Override
82
	public void lexerProblem(Severity problemSeverity, String problemMessage,
84
	public void lexerProblem(Severity problemSeverity, String problemMessage,
83
			String processingContext, int startOffset, int endOffset) {
85
			String processingContext, int startOffset, int endOffset) {
84
		int leftToken = getParser().getTokenIndexAtCharacter(startOffset);
86
		int leftToken = getIPrsStream().getTokenIndexAtCharacter(startOffset);
85
		if (leftToken < 0) {
87
		if (leftToken < 0) {
86
            leftToken = -leftToken;
88
            leftToken = -leftToken;
87
        }
89
        }
88
		String message = problemMessage
90
		String message = problemMessage
89
	             		+ " (" + getParser().getKind(leftToken) + ") : "  //$NON-NLS-1$//$NON-NLS-2$
91
	             		+ " (" + getIPrsStream().getKind(leftToken) + ") : "  //$NON-NLS-1$//$NON-NLS-2$
90
	             		+ getParser().getStartOffset(leftToken)
92
	             		+ getIPrsStream().getStartOffset(leftToken)
91
	             		+ ":" + getParser().getLineNumberOfTokenAt(leftToken) //$NON-NLS-1$
93
	             		+ ":" + getIPrsStream().getLineNumberOfTokenAt(leftToken) //$NON-NLS-1$
92
	             		+ ":" + getParser().getColumnOfTokenAt(leftToken) //$NON-NLS-1$
94
	             		+ ":" + getIPrsStream().getColumnOfTokenAt(leftToken) //$NON-NLS-1$
93
	             		+ ":" + getParser().getTokenLength(leftToken) //$NON-NLS-1$
95
	             		+ ":" + getIPrsStream().getTokenLength(leftToken) //$NON-NLS-1$
94
	             		+ " " + getParser().getTokenText(leftToken); //$NON-NLS-1$
96
	             		+ " " + getIPrsStream().getTokenText(leftToken); //$NON-NLS-1$
95
		handleProblem(problemSeverity, Phase.LEXER, message,
97
		handleProblem(problemSeverity, Phase.LEXER, message,
96
				processingContext, startOffset, endOffset);
98
				processingContext, startOffset, endOffset);
97
	}
99
	}
Lines 99-120 Link Here
99
	@Override
101
	@Override
100
	public void parserProblem(Severity problemSeverity, String problemMessage,
102
	public void parserProblem(Severity problemSeverity, String problemMessage,
101
			String processingContext, int startOffset, int endOffset) {
103
			String processingContext, int startOffset, int endOffset) {
102
		int leftToken = getParser().getTokenIndexAtCharacter(startOffset);
104
		int leftToken = getIPrsStream().getTokenIndexAtCharacter(startOffset);
103
		int rightToken = getParser().getTokenIndexAtCharacter(endOffset);
105
		int rightToken = getIPrsStream().getTokenIndexAtCharacter(endOffset);
104
		int leftTokenLoc = (leftToken > rightToken ? rightToken : leftToken);
106
		int leftTokenLoc = (leftToken > rightToken ? rightToken : leftToken);
105
		int rightTokenLoc = rightToken;
107
		int rightTokenLoc = rightToken;
106
	    int line = getParser().getLine(leftTokenLoc) + getErrorReportLineOffset();
108
	    int line = getIPrsStream().getLine(leftTokenLoc) + getErrorReportLineOffset();
107
	    if (line > 0) {
109
	    if (line > 0) {
108
			String locInfo = OCLMessages.bind(OCLMessages.ErrorReport_RowColumn,
110
			String locInfo = OCLMessages.bind(OCLMessages.ErrorReport_RowColumn,
109
					new Object[]{
111
					new Object[]{
110
						new Integer((getParser().getLine(leftTokenLoc) + getErrorReportLineOffset())),
112
						new Integer((getIPrsStream().getLine(leftTokenLoc) + getErrorReportLineOffset())),
111
						new Integer(getParser().getColumn(leftTokenLoc)),
113
						new Integer(getIPrsStream().getColumn(leftTokenLoc)),
112
						new Integer((getParser().getEndLine(rightTokenLoc) + getErrorReportLineOffset())),
114
						new Integer((getIPrsStream().getEndLine(rightTokenLoc) + getErrorReportLineOffset())),
113
						new Integer(getParser().getEndColumn(rightTokenLoc))
115
						new Integer(getIPrsStream().getEndColumn(rightTokenLoc))
114
				});
116
				});
115
			problemMessage = locInfo + " " + problemMessage; //$NON-NLS-1$
117
			problemMessage = locInfo + " " + problemMessage; //$NON-NLS-1$
116
	    }
118
	    }
117
	    handleProblem(problemSeverity, Phase.PARSER, problemMessage,
119
	    handleProblem(problemSeverity, Phase.PARSER, problemMessage,
118
				processingContext, startOffset, endOffset);
120
				processingContext, startOffset, endOffset);
119
	}
121
	}
122
	
123
	/**
124
	 * @since 3.0
125
	 */
126
	protected IPrsStream getIPrsStream() {
127
		return getParser().getIPrsStream();
128
	}
120
}
129
}
(-)src/org/eclipse/ocl/parser/OCLParsersym.java (-13 / +6 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., 
5
* Open Canarias S.L. and others.
5
* All rights reserved.   This program and the accompanying materials
6
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
7
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
8
* which accompanies this distribution, and is available at
Lines 14-38 Link Here
14
*   E.D.Willink - Bugs 225493, 243976, 259818
15
*   E.D.Willink - Bugs 225493, 243976, 259818
15
*   Zeligsoft - Bug 243976
16
*   Zeligsoft - Bug 243976
16
*   Borland - Bug 242880
17
*   Borland - Bug 242880
18
*   Adolfo Sanchez- Barbudo Herrera - LPG v 2.0.17 adoption
17
*
19
*
18
* </copyright>
20
* </copyright>
19
*
21
*
20
* $Id: OCLParsersym.java,v 1.6 2009/08/28 20:43:11 ewillink Exp $
22
* $Id: EssentialOCL.g,v 1.7 2009/03/05 14:12:14 cdamus Exp $
21
*/
23
*/
22
24
23
package org.eclipse.ocl.parser;
25
package org.eclipse.ocl.parser;
24
26
25
/**
26
 * @noimplement This interface is not intended to be implemented by clients.
27
 * @noextend This interface is not intended to be extended by clients.
28
 */
29
@SuppressWarnings("nls")
30
public interface OCLParsersym {
27
public interface OCLParsersym {
31
	/**
32
	 * Token kind codes.
33
	 * 
34
	 * @noreference These constants are not intended to be referenced by clients.
35
	 */
36
    public final static int
28
    public final static int
37
      TK_NUMERIC_OPERATION = 60,
29
      TK_NUMERIC_OPERATION = 60,
38
      TK_STRING_LITERAL = 61,
30
      TK_STRING_LITERAL = 61,
Lines 136-142 Link Here
136
      TK_MULTI_LINE_COMMENT = 100,
128
      TK_MULTI_LINE_COMMENT = 100,
137
      TK_ERROR_TOKEN = 101;
129
      TK_ERROR_TOKEN = 101;
138
130
139
      public final static String orderedTerminalSymbols[] = {
131
    public final static String orderedTerminalSymbols[] = {
140
                 "",
132
                 "",
141
                 "LPAREN",
133
                 "LPAREN",
142
                 "IDENTIFIER",
134
                 "IDENTIFIER",
Lines 241-245 Link Here
241
                 "ERROR_TOKEN"
233
                 "ERROR_TOKEN"
242
             };
234
             };
243
235
236
    public final static int numTokenKinds = orderedTerminalSymbols.length;
244
    public final static boolean isValidForParser = true;
237
    public final static boolean isValidForParser = true;
245
}
238
}
(-)src/org/eclipse/ocl/parser/OCLKWLexer.java (-123 / +188 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2007 IBM Corporation and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc, Open Canarias S.L., and others.
5
* All rights reserved.   This program and the accompanying materials
5
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
6
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
7
* which accompanies this distribution, and is available at
Lines 10-26 Link Here
10
* Contributors:
10
* Contributors:
11
*   IBM - Initial API and implementation
11
*   IBM - Initial API and implementation
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
13
*   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
13
*
14
*
14
* </copyright>
15
* </copyright>
15
*
16
*
16
* $Id: OCLKWLexer.java,v 1.3 2009/08/28 20:43:11 ewillink Exp $
17
* 
17
*/
18
*/
18
19
19
package org.eclipse.ocl.parser;
20
package org.eclipse.ocl.parser;
20
21
21
22
22
23
23
public class OCLKWLexer extends OCLKWLexerprs implements OCLParsersym
24
public class OCLKWLexer extends OCLKWLexerprs
24
{
25
{
25
    private char[] inputChars;
26
    private char[] inputChars;
26
    private final int keywordKind[] = new int[63 + 1];
27
    private final int keywordKind[] = new int[63 + 1];
Lines 57-122 Link Here
57
    final static int tokenKind[] = new int[128];
58
    final static int tokenKind[] = new int[128];
58
    static
59
    static
59
    {
60
    {
60
        tokenKind['$'] = Char_DollarSign;
61
        tokenKind['$'] = OCLKWLexersym.Char_DollarSign;
61
62
        tokenKind['%'] = OCLKWLexersym.Char_Percent;
62
        tokenKind['a'] = Char_a;
63
        tokenKind['_'] = OCLKWLexersym.Char__;
63
        tokenKind['b'] = Char_b;
64
64
        tokenKind['c'] = Char_c;
65
        tokenKind['a'] = OCLKWLexersym.Char_a;
65
        tokenKind['d'] = Char_d;
66
        tokenKind['b'] = OCLKWLexersym.Char_b;
66
        tokenKind['e'] = Char_e;
67
        tokenKind['c'] = OCLKWLexersym.Char_c;
67
        tokenKind['f'] = Char_f;
68
        tokenKind['d'] = OCLKWLexersym.Char_d;
68
        tokenKind['g'] = Char_g;
69
        tokenKind['e'] = OCLKWLexersym.Char_e;
69
        tokenKind['h'] = Char_h;
70
        tokenKind['f'] = OCLKWLexersym.Char_f;
70
        tokenKind['i'] = Char_i;
71
        tokenKind['g'] = OCLKWLexersym.Char_g;
71
        tokenKind['j'] = Char_j;
72
        tokenKind['h'] = OCLKWLexersym.Char_h;
72
        tokenKind['k'] = Char_k;
73
        tokenKind['i'] = OCLKWLexersym.Char_i;
73
        tokenKind['l'] = Char_l;
74
        tokenKind['j'] = OCLKWLexersym.Char_j;
74
        tokenKind['m'] = Char_m;
75
        tokenKind['k'] = OCLKWLexersym.Char_k;
75
        tokenKind['n'] = Char_n;
76
        tokenKind['l'] = OCLKWLexersym.Char_l;
76
        tokenKind['o'] = Char_o;
77
        tokenKind['m'] = OCLKWLexersym.Char_m;
77
        tokenKind['p'] = Char_p;
78
        tokenKind['n'] = OCLKWLexersym.Char_n;
78
        tokenKind['q'] = Char_q;
79
        tokenKind['o'] = OCLKWLexersym.Char_o;
79
        tokenKind['r'] = Char_r;
80
        tokenKind['p'] = OCLKWLexersym.Char_p;
80
        tokenKind['s'] = Char_s;
81
        tokenKind['q'] = OCLKWLexersym.Char_q;
81
        tokenKind['t'] = Char_t;
82
        tokenKind['r'] = OCLKWLexersym.Char_r;
82
        tokenKind['u'] = Char_u;
83
        tokenKind['s'] = OCLKWLexersym.Char_s;
83
        tokenKind['v'] = Char_v;
84
        tokenKind['t'] = OCLKWLexersym.Char_t;
84
        tokenKind['w'] = Char_w;
85
        tokenKind['u'] = OCLKWLexersym.Char_u;
85
        tokenKind['x'] = Char_x;
86
        tokenKind['v'] = OCLKWLexersym.Char_v;
86
        tokenKind['y'] = Char_y;
87
        tokenKind['w'] = OCLKWLexersym.Char_w;
87
        tokenKind['z'] = Char_z;
88
        tokenKind['x'] = OCLKWLexersym.Char_x;
88
89
        tokenKind['y'] = OCLKWLexersym.Char_y;
89
        tokenKind['A'] = Char_A;
90
        tokenKind['z'] = OCLKWLexersym.Char_z;
90
        tokenKind['B'] = Char_B;
91
91
        tokenKind['C'] = Char_C;
92
        tokenKind['A'] = OCLKWLexersym.Char_A;
92
        tokenKind['D'] = Char_D;
93
        tokenKind['B'] = OCLKWLexersym.Char_B;
93
        tokenKind['E'] = Char_E;
94
        tokenKind['C'] = OCLKWLexersym.Char_C;
94
        tokenKind['F'] = Char_F;
95
        tokenKind['D'] = OCLKWLexersym.Char_D;
95
        tokenKind['G'] = Char_G;
96
        tokenKind['E'] = OCLKWLexersym.Char_E;
96
        tokenKind['H'] = Char_H;
97
        tokenKind['F'] = OCLKWLexersym.Char_F;
97
        tokenKind['I'] = Char_I;
98
        tokenKind['G'] = OCLKWLexersym.Char_G;
98
        tokenKind['J'] = Char_J;
99
        tokenKind['H'] = OCLKWLexersym.Char_H;
99
        tokenKind['K'] = Char_K;
100
        tokenKind['I'] = OCLKWLexersym.Char_I;
100
        tokenKind['L'] = Char_L;
101
        tokenKind['J'] = OCLKWLexersym.Char_J;
101
        tokenKind['M'] = Char_M;
102
        tokenKind['K'] = OCLKWLexersym.Char_K;
102
        tokenKind['N'] = Char_N;
103
        tokenKind['L'] = OCLKWLexersym.Char_L;
103
        tokenKind['O'] = Char_O;
104
        tokenKind['M'] = OCLKWLexersym.Char_M;
104
        tokenKind['P'] = Char_P;
105
        tokenKind['N'] = OCLKWLexersym.Char_N;
105
        tokenKind['Q'] = Char_Q;
106
        tokenKind['O'] = OCLKWLexersym.Char_O;
106
        tokenKind['R'] = Char_R;
107
        tokenKind['P'] = OCLKWLexersym.Char_P;
107
        tokenKind['S'] = Char_S;
108
        tokenKind['Q'] = OCLKWLexersym.Char_Q;
108
        tokenKind['T'] = Char_T;
109
        tokenKind['R'] = OCLKWLexersym.Char_R;
109
        tokenKind['U'] = Char_U;
110
        tokenKind['S'] = OCLKWLexersym.Char_S;
110
        tokenKind['V'] = Char_V;
111
        tokenKind['T'] = OCLKWLexersym.Char_T;
111
        tokenKind['W'] = Char_W;
112
        tokenKind['U'] = OCLKWLexersym.Char_U;
112
        tokenKind['X'] = Char_X;
113
        tokenKind['V'] = OCLKWLexersym.Char_V;
113
        tokenKind['Y'] = Char_Y;
114
        tokenKind['W'] = OCLKWLexersym.Char_W;
114
        tokenKind['Z'] = Char_Z;
115
        tokenKind['X'] = OCLKWLexersym.Char_X;
116
        tokenKind['Y'] = OCLKWLexersym.Char_Y;
117
        tokenKind['Z'] = OCLKWLexersym.Char_Z;
115
    };
118
    };
116
119
117
    final int getKind(char c)
120
    final int getKind(char c)
118
    {
121
    {
119
        return (c < 128 ? tokenKind[c] : 0);
122
        return (((c & 0xFFFFFF80) == 0) /* 0 <= c < 128? */ ? tokenKind[c] : 0);
120
    }
123
    }
121
124
122
125
Lines 128-509 Link Here
128
        //
131
        //
129
        // Rule 1:  KeyWord ::= s e l f
132
        // Rule 1:  KeyWord ::= s e l f
130
        //
133
        //
131
		keywordKind[1] = (TK_self);
134
        
135
		keywordKind[1] = (OCLParsersym.TK_self);
132
	  
136
	  
133
	
137
	
134
        //
138
        //
135
        // Rule 2:  KeyWord ::= i n v
139
        // Rule 2:  KeyWord ::= i n v
136
        //
140
        //
137
		keywordKind[2] = (TK_inv);
141
        
142
		keywordKind[2] = (OCLParsersym.TK_inv);
138
	  
143
	  
139
	
144
	
140
        //
145
        //
141
        // Rule 3:  KeyWord ::= p r e
146
        // Rule 3:  KeyWord ::= p r e
142
        //
147
        //
143
		keywordKind[3] = (TK_pre);
148
        
149
		keywordKind[3] = (OCLParsersym.TK_pre);
144
	  
150
	  
145
	
151
	
146
        //
152
        //
147
        // Rule 4:  KeyWord ::= p o s t
153
        // Rule 4:  KeyWord ::= p o s t
148
        //
154
        //
149
		keywordKind[4] = (TK_post);
155
        
156
		keywordKind[4] = (OCLParsersym.TK_post);
150
	  
157
	  
151
	
158
	
152
        //
159
        //
153
        // Rule 5:  KeyWord ::= b o d y
160
        // Rule 5:  KeyWord ::= b o d y
154
        //
161
        //
155
		keywordKind[5] = (TK_body);
162
        
163
		keywordKind[5] = (OCLParsersym.TK_body);
156
	  
164
	  
157
	
165
	
158
        //
166
        //
159
        // Rule 6:  KeyWord ::= c o n t e x t
167
        // Rule 6:  KeyWord ::= c o n t e x t
160
        //
168
        //
161
		keywordKind[6] = (TK_context);
169
        
170
		keywordKind[6] = (OCLParsersym.TK_context);
162
	  
171
	  
163
	
172
	
164
        //
173
        //
165
        // Rule 7:  KeyWord ::= p a c k a g e
174
        // Rule 7:  KeyWord ::= p a c k a g e
166
        //
175
        //
167
		keywordKind[7] = (TK_package);
176
        
177
		keywordKind[7] = (OCLParsersym.TK_package);
168
	  
178
	  
169
	
179
	
170
        //
180
        //
171
        // Rule 8:  KeyWord ::= e n d p a c k a g e
181
        // Rule 8:  KeyWord ::= e n d p a c k a g e
172
        //
182
        //
173
		keywordKind[8] = (TK_endpackage);
183
        
184
		keywordKind[8] = (OCLParsersym.TK_endpackage);
174
	  
185
	  
175
	
186
	
176
        //
187
        //
177
        // Rule 9:  KeyWord ::= d e f
188
        // Rule 9:  KeyWord ::= d e f
178
        //
189
        //
179
		keywordKind[9] = (TK_def);
190
        
191
		keywordKind[9] = (OCLParsersym.TK_def);
180
	  
192
	  
181
	
193
	
182
        //
194
        //
183
        // Rule 10:  KeyWord ::= d e r i v e
195
        // Rule 10:  KeyWord ::= d e r i v e
184
        //
196
        //
185
		keywordKind[10] = (TK_derive);
197
        
198
		keywordKind[10] = (OCLParsersym.TK_derive);
186
	  
199
	  
187
	
200
	
188
        //
201
        //
189
        // Rule 11:  KeyWord ::= i n i t
202
        // Rule 11:  KeyWord ::= i n i t
190
        //
203
        //
191
		keywordKind[11] = (TK_init);
204
        
205
		keywordKind[11] = (OCLParsersym.TK_init);
192
	  
206
	  
193
	
207
	
194
        //
208
        //
195
        // Rule 12:  KeyWord ::= i f
209
        // Rule 12:  KeyWord ::= i f
196
        //
210
        //
197
		keywordKind[12] = (TK_if);
211
        
212
		keywordKind[12] = (OCLParsersym.TK_if);
198
	  
213
	  
199
	
214
	
200
        //
215
        //
201
        // Rule 13:  KeyWord ::= t h e n
216
        // Rule 13:  KeyWord ::= t h e n
202
        //
217
        //
203
		keywordKind[13] = (TK_then);
218
        
219
		keywordKind[13] = (OCLParsersym.TK_then);
204
	  
220
	  
205
	
221
	
206
        //
222
        //
207
        // Rule 14:  KeyWord ::= e l s e
223
        // Rule 14:  KeyWord ::= e l s e
208
        //
224
        //
209
		keywordKind[14] = (TK_else);
225
        
226
		keywordKind[14] = (OCLParsersym.TK_else);
210
	  
227
	  
211
	
228
	
212
        //
229
        //
213
        // Rule 15:  KeyWord ::= e n d i f
230
        // Rule 15:  KeyWord ::= e n d i f
214
        //
231
        //
215
		keywordKind[15] = (TK_endif);
232
        
233
		keywordKind[15] = (OCLParsersym.TK_endif);
216
	  
234
	  
217
	
235
	
218
        //
236
        //
219
        // Rule 16:  KeyWord ::= a n d
237
        // Rule 16:  KeyWord ::= a n d
220
        //
238
        //
221
		keywordKind[16] = (TK_and);
239
        
240
		keywordKind[16] = (OCLParsersym.TK_and);
222
	  
241
	  
223
	
242
	
224
        //
243
        //
225
        // Rule 17:  KeyWord ::= o r
244
        // Rule 17:  KeyWord ::= o r
226
        //
245
        //
227
		keywordKind[17] = (TK_or);
246
        
247
		keywordKind[17] = (OCLParsersym.TK_or);
228
	  
248
	  
229
	
249
	
230
        //
250
        //
231
        // Rule 18:  KeyWord ::= x o r
251
        // Rule 18:  KeyWord ::= x o r
232
        //
252
        //
233
		keywordKind[18] = (TK_xor);
253
        
254
		keywordKind[18] = (OCLParsersym.TK_xor);
234
	  
255
	  
235
	
256
	
236
        //
257
        //
237
        // Rule 19:  KeyWord ::= n o t
258
        // Rule 19:  KeyWord ::= n o t
238
        //
259
        //
239
		keywordKind[19] = (TK_not);
260
        
261
		keywordKind[19] = (OCLParsersym.TK_not);
240
	  
262
	  
241
	
263
	
242
        //
264
        //
243
        // Rule 20:  KeyWord ::= i m p l i e s
265
        // Rule 20:  KeyWord ::= i m p l i e s
244
        //
266
        //
245
		keywordKind[20] = (TK_implies);
267
        
268
		keywordKind[20] = (OCLParsersym.TK_implies);
246
	  
269
	  
247
	
270
	
248
        //
271
        //
249
        // Rule 21:  KeyWord ::= l e t
272
        // Rule 21:  KeyWord ::= l e t
250
        //
273
        //
251
		keywordKind[21] = (TK_let);
274
        
275
		keywordKind[21] = (OCLParsersym.TK_let);
252
	  
276
	  
253
	
277
	
254
        //
278
        //
255
        // Rule 22:  KeyWord ::= i n
279
        // Rule 22:  KeyWord ::= i n
256
        //
280
        //
257
		keywordKind[22] = (TK_in);
281
        
282
		keywordKind[22] = (OCLParsersym.TK_in);
258
	  
283
	  
259
	
284
	
260
        //
285
        //
261
        // Rule 23:  KeyWord ::= t r u e
286
        // Rule 23:  KeyWord ::= t r u e
262
        //
287
        //
263
		keywordKind[23] = (TK_true);
288
        
289
		keywordKind[23] = (OCLParsersym.TK_true);
264
	  
290
	  
265
	
291
	
266
        //
292
        //
267
        // Rule 24:  KeyWord ::= f a l s e
293
        // Rule 24:  KeyWord ::= f a l s e
268
        //
294
        //
269
		keywordKind[24] = (TK_false);
295
        
296
		keywordKind[24] = (OCLParsersym.TK_false);
270
	  
297
	  
271
	
298
	
272
        //
299
        //
273
        // Rule 25:  KeyWord ::= S e t
300
        // Rule 25:  KeyWord ::= S e t
274
        //
301
        //
275
		keywordKind[25] = (TK_Set);
302
        
303
		keywordKind[25] = (OCLParsersym.TK_Set);
276
	  
304
	  
277
	
305
	
278
        //
306
        //
279
        // Rule 26:  KeyWord ::= B a g
307
        // Rule 26:  KeyWord ::= B a g
280
        //
308
        //
281
		keywordKind[26] = (TK_Bag);
309
        
310
		keywordKind[26] = (OCLParsersym.TK_Bag);
282
	  
311
	  
283
	
312
	
284
        //
313
        //
285
        // Rule 27:  KeyWord ::= S e q u e n c e
314
        // Rule 27:  KeyWord ::= S e q u e n c e
286
        //
315
        //
287
		keywordKind[27] = (TK_Sequence);
316
        
317
		keywordKind[27] = (OCLParsersym.TK_Sequence);
288
	  
318
	  
289
	
319
	
290
        //
320
        //
291
        // Rule 28:  KeyWord ::= C o l l e c t i o n
321
        // Rule 28:  KeyWord ::= C o l l e c t i o n
292
        //
322
        //
293
		keywordKind[28] = (TK_Collection);
323
        
324
		keywordKind[28] = (OCLParsersym.TK_Collection);
294
	  
325
	  
295
	
326
	
296
        //
327
        //
297
        // Rule 29:  KeyWord ::= O r d e r e d S e t
328
        // Rule 29:  KeyWord ::= O r d e r e d S e t
298
        //
329
        //
299
		keywordKind[29] = (TK_OrderedSet);
330
        
331
		keywordKind[29] = (OCLParsersym.TK_OrderedSet);
300
	  
332
	  
301
	
333
	
302
        //
334
        //
303
        // Rule 30:  KeyWord ::= i t e r a t e
335
        // Rule 30:  KeyWord ::= i t e r a t e
304
        //
336
        //
305
		keywordKind[30] = (TK_iterate);
337
        
338
		keywordKind[30] = (OCLParsersym.TK_iterate);
306
	  
339
	  
307
	
340
	
308
        //
341
        //
309
        // Rule 31:  KeyWord ::= f o r A l l
342
        // Rule 31:  KeyWord ::= f o r A l l
310
        //
343
        //
311
		keywordKind[31] = (TK_forAll);
344
        
345
		keywordKind[31] = (OCLParsersym.TK_forAll);
312
	  
346
	  
313
	
347
	
314
        //
348
        //
315
        // Rule 32:  KeyWord ::= e x i s t s
349
        // Rule 32:  KeyWord ::= e x i s t s
316
        //
350
        //
317
		keywordKind[32] = (TK_exists);
351
        
352
		keywordKind[32] = (OCLParsersym.TK_exists);
318
	  
353
	  
319
	
354
	
320
        //
355
        //
321
        // Rule 33:  KeyWord ::= i s U n i q u e
356
        // Rule 33:  KeyWord ::= i s U n i q u e
322
        //
357
        //
323
		keywordKind[33] = (TK_isUnique);
358
        
359
		keywordKind[33] = (OCLParsersym.TK_isUnique);
324
	  
360
	  
325
	
361
	
326
        //
362
        //
327
        // Rule 34:  KeyWord ::= a n y
363
        // Rule 34:  KeyWord ::= a n y
328
        //
364
        //
329
		keywordKind[34] = (TK_any);
365
        
366
		keywordKind[34] = (OCLParsersym.TK_any);
330
	  
367
	  
331
	
368
	
332
        //
369
        //
333
        // Rule 35:  KeyWord ::= o n e
370
        // Rule 35:  KeyWord ::= o n e
334
        //
371
        //
335
		keywordKind[35] = (TK_one);
372
        
373
		keywordKind[35] = (OCLParsersym.TK_one);
336
	  
374
	  
337
	
375
	
338
        //
376
        //
339
        // Rule 36:  KeyWord ::= c o l l e c t
377
        // Rule 36:  KeyWord ::= c o l l e c t
340
        //
378
        //
341
		keywordKind[36] = (TK_collect);
379
        
380
		keywordKind[36] = (OCLParsersym.TK_collect);
342
	  
381
	  
343
	
382
	
344
        //
383
        //
345
        // Rule 37:  KeyWord ::= s e l e c t
384
        // Rule 37:  KeyWord ::= s e l e c t
346
        //
385
        //
347
		keywordKind[37] = (TK_select);
386
        
387
		keywordKind[37] = (OCLParsersym.TK_select);
348
	  
388
	  
349
	
389
	
350
        //
390
        //
351
        // Rule 38:  KeyWord ::= r e j e c t
391
        // Rule 38:  KeyWord ::= r e j e c t
352
        //
392
        //
353
		keywordKind[38] = (TK_reject);
393
        
394
		keywordKind[38] = (OCLParsersym.TK_reject);
354
	  
395
	  
355
	
396
	
356
        //
397
        //
357
        // Rule 39:  KeyWord ::= c o l l e c t N e s t e d
398
        // Rule 39:  KeyWord ::= c o l l e c t N e s t e d
358
        //
399
        //
359
		keywordKind[39] = (TK_collectNested);
400
        
401
		keywordKind[39] = (OCLParsersym.TK_collectNested);
360
	  
402
	  
361
	
403
	
362
        //
404
        //
363
        // Rule 40:  KeyWord ::= s o r t e d B y
405
        // Rule 40:  KeyWord ::= s o r t e d B y
364
        //
406
        //
365
		keywordKind[40] = (TK_sortedBy);
407
        
408
		keywordKind[40] = (OCLParsersym.TK_sortedBy);
366
	  
409
	  
367
	
410
	
368
        //
411
        //
369
        // Rule 41:  KeyWord ::= c l o s u r e
412
        // Rule 41:  KeyWord ::= c l o s u r e
370
        //
413
        //
371
		keywordKind[41] = (TK_closure);
414
        
415
		keywordKind[41] = (OCLParsersym.TK_closure);
372
	  
416
	  
373
	
417
	
374
        //
418
        //
375
        // Rule 42:  KeyWord ::= o c l I s K i n d O f
419
        // Rule 42:  KeyWord ::= o c l I s K i n d O f
376
        //
420
        //
377
		keywordKind[42] = (TK_oclIsKindOf);
421
        
422
		keywordKind[42] = (OCLParsersym.TK_oclIsKindOf);
378
	  
423
	  
379
	
424
	
380
        //
425
        //
381
        // Rule 43:  KeyWord ::= o c l I s T y p e O f
426
        // Rule 43:  KeyWord ::= o c l I s T y p e O f
382
        //
427
        //
383
		keywordKind[43] = (TK_oclIsTypeOf);
428
        
429
		keywordKind[43] = (OCLParsersym.TK_oclIsTypeOf);
384
	  
430
	  
385
	
431
	
386
        //
432
        //
387
        // Rule 44:  KeyWord ::= o c l A s T y p e
433
        // Rule 44:  KeyWord ::= o c l A s T y p e
388
        //
434
        //
389
		keywordKind[44] = (TK_oclAsType);
435
        
436
		keywordKind[44] = (OCLParsersym.TK_oclAsType);
390
	  
437
	  
391
	
438
	
392
        //
439
        //
393
        // Rule 45:  KeyWord ::= o c l I s N e w
440
        // Rule 45:  KeyWord ::= o c l I s N e w
394
        //
441
        //
395
		keywordKind[45] = (TK_oclIsNew);
442
        
443
		keywordKind[45] = (OCLParsersym.TK_oclIsNew);
396
	  
444
	  
397
	
445
	
398
        //
446
        //
399
        // Rule 46:  KeyWord ::= o c l I s U n d e f i n e d
447
        // Rule 46:  KeyWord ::= o c l I s U n d e f i n e d
400
        //
448
        //
401
		keywordKind[46] = (TK_oclIsUndefined);
449
        
450
		keywordKind[46] = (OCLParsersym.TK_oclIsUndefined);
402
	  
451
	  
403
	
452
	
404
        //
453
        //
405
        // Rule 47:  KeyWord ::= o c l I s I n v a l i d
454
        // Rule 47:  KeyWord ::= o c l I s I n v a l i d
406
        //
455
        //
407
		keywordKind[47] = (TK_oclIsInvalid);
456
        
457
		keywordKind[47] = (OCLParsersym.TK_oclIsInvalid);
408
	  
458
	  
409
	
459
	
410
        //
460
        //
411
        // Rule 48:  KeyWord ::= o c l I s I n S t a t e
461
        // Rule 48:  KeyWord ::= o c l I s I n S t a t e
412
        //
462
        //
413
		keywordKind[48] = (TK_oclIsInState);
463
        
464
		keywordKind[48] = (OCLParsersym.TK_oclIsInState);
414
	  
465
	  
415
	
466
	
416
        //
467
        //
417
        // Rule 49:  KeyWord ::= a l l I n s t a n c e s
468
        // Rule 49:  KeyWord ::= a l l I n s t a n c e s
418
        //
469
        //
419
		keywordKind[49] = (TK_allInstances);
470
        
471
		keywordKind[49] = (OCLParsersym.TK_allInstances);
420
	  
472
	  
421
	
473
	
422
        //
474
        //
423
        // Rule 50:  KeyWord ::= S t r i n g
475
        // Rule 50:  KeyWord ::= S t r i n g
424
        //
476
        //
425
		keywordKind[50] = (TK_String);
477
        
478
		keywordKind[50] = (OCLParsersym.TK_String);
426
	  
479
	  
427
	
480
	
428
        //
481
        //
429
        // Rule 51:  KeyWord ::= I n t e g e r
482
        // Rule 51:  KeyWord ::= I n t e g e r
430
        //
483
        //
431
		keywordKind[51] = (TK_Integer);
484
        
485
		keywordKind[51] = (OCLParsersym.TK_Integer);
432
	  
486
	  
433
	
487
	
434
        //
488
        //
435
        // Rule 52:  KeyWord ::= U n l i m i t e d N a t u r a l
489
        // Rule 52:  KeyWord ::= U n l i m i t e d N a t u r a l
436
        //
490
        //
437
		keywordKind[52] = (TK_UnlimitedNatural);
491
        
492
		keywordKind[52] = (OCLParsersym.TK_UnlimitedNatural);
438
	  
493
	  
439
	
494
	
440
        //
495
        //
441
        // Rule 53:  KeyWord ::= R e a l
496
        // Rule 53:  KeyWord ::= R e a l
442
        //
497
        //
443
		keywordKind[53] = (TK_Real);
498
        
499
		keywordKind[53] = (OCLParsersym.TK_Real);
444
	  
500
	  
445
	
501
	
446
        //
502
        //
447
        // Rule 54:  KeyWord ::= B o o l e a n
503
        // Rule 54:  KeyWord ::= B o o l e a n
448
        //
504
        //
449
		keywordKind[54] = (TK_Boolean);
505
        
506
		keywordKind[54] = (OCLParsersym.TK_Boolean);
450
	  
507
	  
451
	
508
	
452
        //
509
        //
453
        // Rule 55:  KeyWord ::= T u p l e
510
        // Rule 55:  KeyWord ::= T u p l e
454
        //
511
        //
455
		keywordKind[55] = (TK_Tuple);
512
        
513
		keywordKind[55] = (OCLParsersym.TK_Tuple);
456
	  
514
	  
457
	
515
	
458
        //
516
        //
459
        // Rule 56:  KeyWord ::= O c l A n y
517
        // Rule 56:  KeyWord ::= O c l A n y
460
        //
518
        //
461
		keywordKind[56] = (TK_OclAny);
519
        
520
		keywordKind[56] = (OCLParsersym.TK_OclAny);
462
	  
521
	  
463
	
522
	
464
        //
523
        //
465
        // Rule 57:  KeyWord ::= O c l V o i d
524
        // Rule 57:  KeyWord ::= O c l V o i d
466
        //
525
        //
467
		keywordKind[57] = (TK_OclVoid);
526
        
527
		keywordKind[57] = (OCLParsersym.TK_OclVoid);
468
	  
528
	  
469
	
529
	
470
        //
530
        //
471
        // Rule 58:  KeyWord ::= I n v a l i d
531
        // Rule 58:  KeyWord ::= I n v a l i d
472
        //
532
        //
473
		keywordKind[58] = (TK_Invalid);
533
        
534
		keywordKind[58] = (OCLParsersym.TK_Invalid);
474
	  
535
	  
475
	
536
	
476
        //
537
        //
477
        // Rule 59:  KeyWord ::= O c l M e s s a g e
538
        // Rule 59:  KeyWord ::= O c l M e s s a g e
478
        //
539
        //
479
		keywordKind[59] = (TK_OclMessage);
540
        
541
		keywordKind[59] = (OCLParsersym.TK_OclMessage);
480
	  
542
	  
481
	
543
	
482
        //
544
        //
483
        // Rule 60:  KeyWord ::= n u l l
545
        // Rule 60:  KeyWord ::= n u l l
484
        //
546
        //
485
		keywordKind[60] = (TK_null);
547
        
548
		keywordKind[60] = (OCLParsersym.TK_null);
486
	  
549
	  
487
	
550
	
488
        //
551
        //
489
        // Rule 61:  KeyWord ::= O c l I n v a l i d
552
        // Rule 61:  KeyWord ::= O c l I n v a l i d
490
        //
553
        //
491
		keywordKind[61] = (TK_OclInvalid);
554
        
555
		keywordKind[61] = (OCLParsersym.TK_OclInvalid);
492
	  
556
	  
493
	
557
	
494
        //
558
        //
495
        // Rule 62:  KeyWord ::= a t t r
559
        // Rule 62:  KeyWord ::= a t t r
496
        //
560
        //
497
		keywordKind[62] = (TK_attr);
561
        
562
		keywordKind[62] = (OCLParsersym.TK_attr);
498
	  
563
	  
499
	
564
	
500
        //
565
        //
501
        // Rule 63:  KeyWord ::= o p e r
566
        // Rule 63:  KeyWord ::= o p e r
502
        //
567
        //
503
		keywordKind[63] = (TK_oper);
568
        
569
		keywordKind[63] = (OCLParsersym.TK_oper);
504
	  
570
	  
505
	
571
	
506
507
        for (int i = 0; i < keywordKind.length; i++)
572
        for (int i = 0; i < keywordKind.length; i++)
508
        {
573
        {
509
            if (keywordKind[i] == 0)
574
            if (keywordKind[i] == 0)
(-)src/org/eclipse/ocl/parser/OCLParser.g
Lines 1-7 Link Here
1
--/**
1
--/**
2
-- * <copyright>
2
-- * <copyright>
3
-- *
3
-- *
(-)* Copyright (c) 2005, 2009 IBM Corporation and others. (-66 / +62 lines)
Lines 11-16 Link Here
11
-- *   IBM - Initial API and implementation
11
-- *   IBM - Initial API and implementation
12
-- *   E.D. Willink - Elimination of some shift-reduce conflicts
12
-- *   E.D. Willink - Elimination of some shift-reduce conflicts
13
-- *      - Bug 259818
13
-- *      - Bug 259818
14
-- *   Adolfo Sanchez- Barbudo Herrera - LPG v 2.0.17 adoption
14
-- *
15
-- *
15
-- * </copyright>
16
-- * </copyright>
16
-- *
17
-- *
Lines 22-55 Link Here
22
23
23
%options escape=$
24
%options escape=$
24
%options la=2
25
%options la=2
25
%options table=java
26
%options fp=OCLParser,prefix=TK_
26
%options fp=OCLParser,prefix=TK_
27
%options error-maps
28
%options scopes
29
%options margin=4
30
%options noserialize
27
%options noserialize
31
%options package=org.eclipse.ocl.parser
28
%options package=org.eclipse.ocl.parser
32
%options import_terminals=OCLLexer.g
29
%options import_terminals=OCLLexer.gi
33
%options ast_type=CSTNode
30
%options ast_type=CSTNode
34
%options programming_language=java
31
%options ParseTable=lpg.runtime.ParseTable
35
%options action=("*.java", "/.", "./")
32
%options template=dtParserTemplateF.gi
36
%options ParseTable=lpg.lpgjavaruntime.ParseTable
37
%options include_directory=".;../lpg"
33
%options include_directory=".;../lpg"
38
34
39
$Start
35
%Start
40
	goal
36
	goal
41
$End
37
%End
42
38
43
$Include
39
%Import
44
	EssentialOCL.g
40
	EssentialOCL.gi
45
$End
41
%End
46
42
47
$Define
43
%Define
48
    $environment_class /.Environment<?,?,?,?,?,?,?,?,?,?,?,?>./
44
    $environment_class /.Environment<?,?,?,?,?,?,?,?,?,?,?,?>./
49
	$lex_stream_class /.OCLLexer./
45
	$lex_stream_class /.OCLLexer./
50
$End
46
%End
51
47
52
$Globals
48
%Globals
53
	/.
49
	/.
54
	import org.eclipse.ocl.Environment;
50
	import org.eclipse.ocl.Environment;
55
	import org.eclipse.ocl.cst.DefExpressionCS;
51
	import org.eclipse.ocl.cst.DefExpressionCS;
Lines 59-67 Link Here
59
	import org.eclipse.ocl.cst.PackageDeclarationCS;
55
	import org.eclipse.ocl.cst.PackageDeclarationCS;
60
	import org.eclipse.ocl.cst.PrePostOrBodyEnum;
56
	import org.eclipse.ocl.cst.PrePostOrBodyEnum;
61
	./
57
	./
62
$End
58
%End
63
59
64
$KeyWords
60
%KeyWords
65
	context
61
	context
66
	package
62
	package
67
	
63
	
Lines 71-79 Link Here
71
	--
67
	--
72
	attr
68
	attr
73
	oper
69
	oper
74
$End
70
%End
75
71
76
$Rules
72
%Rules
77
	-- opt = optional
73
	-- opt = optional
78
	-- m = multiple
74
	-- m = multiple
79
	
75
	
Lines 83-138 Link Here
83
	goal -> prePostOrBodyDeclCS
79
	goal -> prePostOrBodyDeclCS
84
	goal -> initOrDerValueCS
80
	goal -> initOrDerValueCS
85
	goal -> variableCS
81
	goal -> variableCS
86
	goal -> $empty	
82
	goal -> %empty	
87
83
88
	packageDeclarationCSm -> packageDeclarationCS
84
	packageDeclarationCSm -> packageDeclarationCS
89
	packageDeclarationCSm ::= packageDeclarationCSm packageDeclarationCS
85
	packageDeclarationCSm ::= packageDeclarationCSm packageDeclarationCS
90
		/.$BeginJava
86
		/.$BeginCode
91
					PackageDeclarationCS result = (PackageDeclarationCS)$getSym(2);
87
					PackageDeclarationCS result = (PackageDeclarationCS)$getSym(2);
92
					result.setPackageDeclarationCS((PackageDeclarationCS) $getSym(1));
88
					result.setPackageDeclarationCS((PackageDeclarationCS) $getSym(1));
93
					$setResult(result);
89
					$setResult(result);
94
		  $EndJava
90
		  $EndCode
95
		./
91
		./
96
	packageDeclarationCS ::= package pathNameCS contextDeclCSmopt endpackage
92
	packageDeclarationCS ::= package pathNameCS contextDeclCSmopt endpackage
97
		/.$BeginJava
93
		/.$BeginCode
98
					CSTNode result = createPackageDeclarationCS(
94
					CSTNode result = createPackageDeclarationCS(
99
							(PathNameCS)$getSym(2),
95
							(PathNameCS)$getSym(2),
100
							(EList)$getSym(3)
96
							(EList)$getSym(3)
101
						);
97
						);
102
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(4)));
98
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(4)));
103
					$setResult(result);
99
					$setResult(result);
104
		  $EndJava
100
		  $EndCode
105
		./
101
		./
106
	
102
	
107
	packageDeclarationCS1 ::= contextDeclCSm
103
	packageDeclarationCS1 ::= contextDeclCSm
108
		/.$BeginJava
104
		/.$BeginCode
109
					EList contextDecls = (EList)$getSym(1);
105
					EList contextDecls = (EList)$getSym(1);
110
					CSTNode result = createPackageDeclarationCS(null, contextDecls);
106
					CSTNode result = createPackageDeclarationCS(null, contextDecls);
111
					if (!contextDecls.isEmpty()) {
107
					if (!contextDecls.isEmpty()) {
112
						setOffsets(result, (CSTNode)contextDecls.get(0), (CSTNode)contextDecls.get(contextDecls.size()-1));
108
						setOffsets(result, (CSTNode)contextDecls.get(0), (CSTNode)contextDecls.get(contextDecls.size()-1));
113
					}
109
					}
114
					$setResult(result);
110
					$setResult(result);
115
		  $EndJava
111
		  $EndCode
116
		./
112
		./
117
113
118
114
119
	contextDeclCSmopt ::= $empty
115
	contextDeclCSmopt ::= %empty
120
		/.$EmptyListAction./
116
		/.$EmptyListAction./
121
	contextDeclCSmopt -> contextDeclCSm
117
	contextDeclCSmopt -> contextDeclCSm
122
118
123
	contextDeclCSm ::= contextDeclCS
119
	contextDeclCSm ::= contextDeclCS
124
		/.$BeginJava
120
		/.$BeginCode
125
					EList result = new BasicEList();
121
					EList result = new BasicEList();
126
					result.add($getSym(1));
122
					result.add($getSym(1));
127
					$setResult(result);
123
					$setResult(result);
128
		  $EndJava
124
		  $EndCode
129
		./
125
		./
130
	contextDeclCSm ::= contextDeclCSm contextDeclCS
126
	contextDeclCSm ::= contextDeclCSm contextDeclCS
131
		/.$BeginJava
127
		/.$BeginCode
132
					EList result = (EList)$getSym(1);
128
					EList result = (EList)$getSym(1);
133
					result.add($getSym(2));
129
					result.add($getSym(2));
134
					$setResult(result);
130
					$setResult(result);
135
		  $EndJava
131
		  $EndCode
136
		./
132
		./
137
133
138
	contextDeclCS -> classifierContextDeclCS
134
	contextDeclCS -> classifierContextDeclCS
Lines 140-146 Link Here
140
	contextDeclCS -> propertyContextCS
136
	contextDeclCS -> propertyContextCS
141
137
142
	propertyContextCS ::= context pathNameCS '::' simpleNameCS ':' typeCS initOrDerValueCS
138
	propertyContextCS ::= context pathNameCS '::' simpleNameCS ':' typeCS initOrDerValueCS
143
		/.$BeginJava
139
		/.$BeginCode
144
					CSTNode result = createPropertyContextCS(
140
					CSTNode result = createPropertyContextCS(
145
							(PathNameCS)$getSym(2),
141
							(PathNameCS)$getSym(2),
146
							(SimpleNameCS)$getSym(4),
142
							(SimpleNameCS)$getSym(4),
Lines 149-159 Link Here
149
						);
145
						);
150
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(7));
146
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(7));
151
					$setResult(result);
147
					$setResult(result);
152
		  $EndJava
148
		  $EndCode
153
		./
149
		./
154
150
155
	initOrDerValueCS ::= initOrDerValueCSopt init ':' oclExpressionCS
151
	initOrDerValueCS ::= initOrDerValueCSopt init ':' oclExpressionCS
156
		/.$BeginJava
152
		/.$BeginCode
157
					CSTNode result = createInitValueCS(
153
					CSTNode result = createInitValueCS(
158
							(InitOrDerValueCS)$getSym(1),
154
							(InitOrDerValueCS)$getSym(1),
159
							(OCLExpressionCS)$getSym(4)
155
							(OCLExpressionCS)$getSym(4)
Lines 164-174 Link Here
164
						setOffsets(result, getIToken($getToken(2)), (CSTNode)$getSym(4));
160
						setOffsets(result, getIToken($getToken(2)), (CSTNode)$getSym(4));
165
					}
161
					}
166
					$setResult(result);
162
					$setResult(result);
167
		  $EndJava
163
		  $EndCode
168
		./
164
		./
169
165
170
	initOrDerValueCS ::= initOrDerValueCSopt derive ':' oclExpressionCS
166
	initOrDerValueCS ::= initOrDerValueCSopt derive ':' oclExpressionCS
171
		/.$BeginJava
167
		/.$BeginCode
172
					CSTNode result = createDerValueCS(
168
					CSTNode result = createDerValueCS(
173
							(InitOrDerValueCS)$getSym(1),
169
							(InitOrDerValueCS)$getSym(1),
174
							(OCLExpressionCS)$getSym(4)
170
							(OCLExpressionCS)$getSym(4)
Lines 179-193 Link Here
179
						setOffsets(result, getIToken($getToken(2)), (CSTNode)$getSym(4));
175
						setOffsets(result, getIToken($getToken(2)), (CSTNode)$getSym(4));
180
					}
176
					}
181
					$setResult(result);
177
					$setResult(result);
182
		  $EndJava
178
		  $EndCode
183
		./
179
		./
184
180
185
	initOrDerValueCSopt ::= $empty
181
	initOrDerValueCSopt ::= %empty
186
		/.$NullAction./
182
		/.$NullAction./
187
	initOrDerValueCSopt -> initOrDerValueCS
183
	initOrDerValueCSopt -> initOrDerValueCS
188
184
189
	classifierContextDeclCS ::= context pathNameCS invOrDefCSm
185
	classifierContextDeclCS ::= context pathNameCS invOrDefCSm
190
		/.$BeginJava
186
		/.$BeginCode
191
					EList<InvOrDefCS> list = (EList<InvOrDefCS>)$getSym(3);
187
					EList<InvOrDefCS> list = (EList<InvOrDefCS>)$getSym(3);
192
					CSTNode result = createClassifierContextDeclCS(
188
					CSTNode result = createClassifierContextDeclCS(
193
							(PathNameCS)$getSym(2),
189
							(PathNameCS)$getSym(2),
Lines 195-241 Link Here
195
						);
191
						);
196
					setOffsets(result, getIToken($getToken(1)), list.get(list.size()-1));
192
					setOffsets(result, getIToken($getToken(1)), list.get(list.size()-1));
197
					$setResult(result);
193
					$setResult(result);
198
		  $EndJava
194
		  $EndCode
199
		./
195
		./
200
196
201
	invOrDefCSm ::= invOrDefCS
197
	invOrDefCSm ::= invOrDefCS
202
		/.$BeginJava
198
		/.$BeginCode
203
					EList<InvOrDefCS> result = new BasicEList<InvOrDefCS>();
199
					EList<InvOrDefCS> result = new BasicEList<InvOrDefCS>();
204
					result.add((InvOrDefCS)$getSym(1));
200
					result.add((InvOrDefCS)$getSym(1));
205
					$setResult(result);
201
					$setResult(result);
206
		  $EndJava
202
		  $EndCode
207
		./
203
		./
208
	invOrDefCSm ::= invOrDefCSm invOrDefCS
204
	invOrDefCSm ::= invOrDefCSm invOrDefCS
209
		/.$BeginJava
205
		/.$BeginCode
210
					EList<InvOrDefCS> result = (EList<InvOrDefCS>)$getSym(1);
206
					EList<InvOrDefCS> result = (EList<InvOrDefCS>)$getSym(1);
211
					result.add((InvOrDefCS)$getSym(2));
207
					result.add((InvOrDefCS)$getSym(2));
212
					$setResult(result);
208
					$setResult(result);
213
		  $EndJava
209
		  $EndCode
214
		./
210
		./
215
	invOrDefCS ::= inv simpleNameCSopt ':' oclExpressionCS
211
	invOrDefCS ::= inv simpleNameCSopt ':' oclExpressionCS
216
		/.$BeginJava
212
		/.$BeginCode
217
					CSTNode result = createInvCS(
213
					CSTNode result = createInvCS(
218
							(SimpleNameCS)$getSym(2),
214
							(SimpleNameCS)$getSym(2),
219
							(OCLExpressionCS)$getSym(4)
215
							(OCLExpressionCS)$getSym(4)
220
						);
216
						);
221
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(4));
217
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(4));
222
					$setResult(result);
218
					$setResult(result);
223
		  $EndJava
219
		  $EndCode
224
		./
220
		./
225
	
221
	
226
	invOrDefCS ::= def simpleNameCSopt ':' defExpressionCS
222
	invOrDefCS ::= def simpleNameCSopt ':' defExpressionCS
227
		/.$BeginJava
223
		/.$BeginCode
228
					CSTNode result = createDefCS(
224
					CSTNode result = createDefCS(
229
							(SimpleNameCS)$getSym(2),
225
							(SimpleNameCS)$getSym(2),
230
							(DefExpressionCS)$getSym(4)
226
							(DefExpressionCS)$getSym(4)
231
						);
227
						);
232
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(4));
228
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(4));
233
					$setResult(result);
229
					$setResult(result);
234
		  $EndJava
230
		  $EndCode
235
		./
231
		./
236
232
237
	defExpressionCS ::= typedVariableCS '=' oclExpressionCS
233
	defExpressionCS ::= typedVariableCS '=' oclExpressionCS
238
		/.$BeginJava
234
		/.$BeginCode
239
					VariableCS variableCS = (VariableCS)$getSym(1);
235
					VariableCS variableCS = (VariableCS)$getSym(1);
240
					OCLExpressionCS expressionCS = (OCLExpressionCS)$getSym(3);
236
					OCLExpressionCS expressionCS = (OCLExpressionCS)$getSym(3);
241
					CSTNode result = createDefExpressionCS(
237
					CSTNode result = createDefExpressionCS(
Lines 245-254 Link Here
245
						);
241
						);
246
					setOffsets(result, variableCS, expressionCS);
242
					setOffsets(result, variableCS, expressionCS);
247
					$setResult(result);
243
					$setResult(result);
248
		  $EndJava
244
		  $EndCode
249
		./
245
		./
250
	defExpressionCS ::= operationCS1 '=' oclExpressionCS
246
	defExpressionCS ::= operationCS1 '=' oclExpressionCS
251
		/.$BeginJava
247
		/.$BeginCode
252
					CSTNode result = createDefExpressionCS(
248
					CSTNode result = createDefExpressionCS(
253
							null,
249
							null,
254
							(OperationCS)$getSym(1),
250
							(OperationCS)$getSym(1),
Lines 256-266 Link Here
256
						);
252
						);
257
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3));
253
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3));
258
					$setResult(result);
254
					$setResult(result);
259
		  $EndJava
255
		  $EndCode
260
		./
256
		./
261
257
262
	operationContextDeclCS ::= context operationCS2 prePostOrBodyDeclCSm
258
	operationContextDeclCS ::= context operationCS2 prePostOrBodyDeclCSm
263
		/.$BeginJava
259
		/.$BeginCode
264
					EList prePostOrBodyDecls = (EList)$getSym(3);
260
					EList prePostOrBodyDecls = (EList)$getSym(3);
265
					CSTNode result = createOperationContextDeclCS(
261
					CSTNode result = createOperationContextDeclCS(
266
							(OperationCS)$getSym(2),
262
							(OperationCS)$getSym(2),
Lines 268-293 Link Here
268
						);
264
						);
269
					setOffsets(result, getIToken($getToken(1)), (CSTNode)prePostOrBodyDecls.get(prePostOrBodyDecls.size()-1));
265
					setOffsets(result, getIToken($getToken(1)), (CSTNode)prePostOrBodyDecls.get(prePostOrBodyDecls.size()-1));
270
					$setResult(result);
266
					$setResult(result);
271
		  $EndJava
267
		  $EndCode
272
		./
268
		./
273
269
274
	prePostOrBodyDeclCSm ::= prePostOrBodyDeclCS
270
	prePostOrBodyDeclCSm ::= prePostOrBodyDeclCS
275
		/.$BeginJava
271
		/.$BeginCode
276
					EList result = new BasicEList();
272
					EList result = new BasicEList();
277
					result.add($getSym(1));
273
					result.add($getSym(1));
278
					$setResult(result);
274
					$setResult(result);
279
		  $EndJava
275
		  $EndCode
280
		./
276
		./
281
	prePostOrBodyDeclCSm ::= prePostOrBodyDeclCSm prePostOrBodyDeclCS
277
	prePostOrBodyDeclCSm ::= prePostOrBodyDeclCSm prePostOrBodyDeclCS
282
		/.$BeginJava
278
		/.$BeginCode
283
					EList result = (EList)$getSym(1);
279
					EList result = (EList)$getSym(1);
284
					result.add($getSym(2));
280
					result.add($getSym(2));
285
					$setResult(result);
281
					$setResult(result);
286
		  $EndJava
282
		  $EndCode
287
		./
283
		./
288
284
289
	prePostOrBodyDeclCS ::= pre simpleNameCSopt ':' oclExpressionCS
285
	prePostOrBodyDeclCS ::= pre simpleNameCSopt ':' oclExpressionCS
290
		/.$BeginJava
286
		/.$BeginCode
291
					CSTNode result = createPrePostOrBodyDeclCS(
287
					CSTNode result = createPrePostOrBodyDeclCS(
292
							PrePostOrBodyEnum.PRE_LITERAL,
288
							PrePostOrBodyEnum.PRE_LITERAL,
293
							(SimpleNameCS)$getSym(2),
289
							(SimpleNameCS)$getSym(2),
Lines 295-304 Link Here
295
						);
291
						);
296
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(4));
292
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(4));
297
					$setResult(result);
293
					$setResult(result);
298
		  $EndJava
294
		  $EndCode
299
		./
295
		./
300
	prePostOrBodyDeclCS ::= post simpleNameCSopt ':' oclExpressionCS
296
	prePostOrBodyDeclCS ::= post simpleNameCSopt ':' oclExpressionCS
301
		/.$BeginJava
297
		/.$BeginCode
302
					CSTNode result = createPrePostOrBodyDeclCS(
298
					CSTNode result = createPrePostOrBodyDeclCS(
303
							PrePostOrBodyEnum.POST_LITERAL,
299
							PrePostOrBodyEnum.POST_LITERAL,
304
							(SimpleNameCS)$getSym(2),
300
							(SimpleNameCS)$getSym(2),
Lines 306-315 Link Here
306
						);
302
						);
307
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(4));
303
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(4));
308
					$setResult(result);
304
					$setResult(result);
309
		  $EndJava
305
		  $EndCode
310
		./
306
		./
311
	prePostOrBodyDeclCS ::= body simpleNameCSopt ':' oclExpressionCS
307
	prePostOrBodyDeclCS ::= body simpleNameCSopt ':' oclExpressionCS
312
		/.$BeginJava
308
		/.$BeginCode
313
					CSTNode result = createPrePostOrBodyDeclCS(
309
					CSTNode result = createPrePostOrBodyDeclCS(
314
							PrePostOrBodyEnum.BODY_LITERAL,
310
							PrePostOrBodyEnum.BODY_LITERAL,
315
							(SimpleNameCS)$getSym(2),
311
							(SimpleNameCS)$getSym(2),
Lines 317-322 Link Here
317
						);
313
						);
318
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(4));
314
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(4));
319
					$setResult(result);
315
					$setResult(result);
320
		  $EndJava
316
		  $EndCode
321
		./
317
		./
322
$End
318
%End
(-)src/org/eclipse/ocl/parser/OCLLexerprs.java (-44 / +105 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2009 IBM Corporation, Borland Software Corp.,  and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Borland Software Corp., Open Canarias S.L. and others.
5
* All rights reserved.   This program and the accompanying materials
5
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
6
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
7
* which accompanies this distribution, and is available at
Lines 10-25 Link Here
10
* Contributors:
10
* Contributors:
11
*   IBM - Initial API and implementation
11
*   IBM - Initial API and implementation
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
13
*               - Bug 259818
13
*   Borland - Bug 242880
14
*   Borland - Bug 242880
15
*   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
14
*
16
*
15
* </copyright>
17
* </copyright>
16
*
18
*
17
* $Id: OCLLexerprs.java,v 1.4 2009/08/28 20:43:11 ewillink Exp $
19
* $Id$
18
*/
20
*/
19
21
20
package org.eclipse.ocl.parser;
22
package org.eclipse.ocl.parser;
21
23
22
public class OCLLexerprs implements lpg.lpgjavaruntime.ParseTable, OCLLexersym {
24
public class OCLLexerprs implements lpg.runtime.ParseTable, OCLLexersym {
25
    public final static int ERROR_SYMBOL = 0;
26
    public final int getErrorSymbol() { return ERROR_SYMBOL; }
27
28
    public final static int SCOPE_UBOUND = 0;
29
    public final int getScopeUbound() { return SCOPE_UBOUND; }
30
31
    public final static int SCOPE_SIZE = 0;
32
    public final int getScopeSize() { return SCOPE_SIZE; }
33
34
    public final static int MAX_NAME_LENGTH = 0;
35
    public final int getMaxNameLength() { return MAX_NAME_LENGTH; }
36
37
    public final static int NUM_STATES = 50;
38
    public final int getNumStates() { return NUM_STATES; }
39
40
    public final static int NT_OFFSET = 103;
41
    public final int getNtOffset() { return NT_OFFSET; }
42
43
    public final static int LA_STATE_OFFSET = 824;
44
    public final int getLaStateOffset() { return LA_STATE_OFFSET; }
45
46
    public final static int MAX_LA = 1;
47
    public final int getMaxLa() { return MAX_LA; }
48
49
    public final static int NUM_RULES = 309;
50
    public final int getNumRules() { return NUM_RULES; }
51
52
    public final static int NUM_NONTERMINALS = 44;
53
    public final int getNumNonterminals() { return NUM_NONTERMINALS; }
54
55
    public final static int NUM_SYMBOLS = 147;
56
    public final int getNumSymbols() { return NUM_SYMBOLS; }
57
58
    public final static int SEGMENT_SIZE = 8192;
59
    public final int getSegmentSize() { return SEGMENT_SIZE; }
60
61
    public final static int START_STATE = 310;
62
    public final int getStartState() { return START_STATE; }
63
64
    public final static int IDENTIFIER_SYMBOL = 0;
65
    public final int getIdentifier_SYMBOL() { return IDENTIFIER_SYMBOL; }
66
67
    public final static int EOFT_SYMBOL = 99;
68
    public final int getEoftSymbol() { return EOFT_SYMBOL; }
69
70
    public final static int EOLT_SYMBOL = 104;
71
    public final int getEoltSymbol() { return EOLT_SYMBOL; }
72
73
    public final static int ACCEPT_ACTION = 514;
74
    public final int getAcceptAction() { return ACCEPT_ACTION; }
75
76
    public final static int ERROR_ACTION = 515;
77
    public final int getErrorAction() { return ERROR_ACTION; }
78
79
    public final static boolean BACKTRACK = false;
80
    public final boolean getBacktrack() { return BACKTRACK; }
81
82
    public final int getStartSymbol() { return lhs(0); }
83
    public final boolean isValidForParser() { return OCLLexersym.isValidForParser; }
84
85
86
    public interface IsNullable {
87
        public final static byte isNullable[] = {0,
88
            0,0,0,0,0,0,0,0,0,0,
89
            0,0,0,0,0,0,0,0,0,0,
90
            0,0,0,0,0,0,0,0,0,0,
91
            0,0,0,0,0,0,0,0,0,0,
92
            0,0,0,0,0,0,0,0,0,0,
93
            0,0,0,0,0,0,0,0,0,0,
94
            0,0,0,0,0,0,0,0,0,0,
95
            0,0,0,0,0,0,0,0,0,0,
96
            0,0,0,0,0,0,0,0,0,0,
97
            0,0,0,0,0,0,0,0,0,0,
98
            0,0,0,0,0,0,0,0,0,0,
99
            0,0,0,0,0,0,1,0,0,0,
100
            0,0,0,0,0,0,0,0,0,0,
101
            0,1,0,0,0,0,0,0,0,0,
102
            0,0,0,0,0,0,0
103
        };
104
    };
105
    public final static byte isNullable[] = IsNullable.isNullable;
106
    public final boolean isNullable(int index) { return isNullable[index] != 0; }
107
108
    public interface ProsthesesIndex {
109
        public final static byte prosthesesIndex[] = {0,
110
            20,25,26,27,35,4,15,37,40,43,
111
            24,5,3,6,17,18,23,32,34,36,
112
            41,42,2,7,8,9,10,11,12,13,
113
            14,16,19,33,38,39,44,1,21,22,
114
            28,29,30,31
115
        };
116
    };
117
    public final static byte prosthesesIndex[] = ProsthesesIndex.prosthesesIndex;
118
    public final int prosthesesIndex(int index) { return prosthesesIndex[index]; }
23
119
24
    public interface IsKeyword {
120
    public interface IsKeyword {
25
        public final static byte isKeyword[] = {0,
121
        public final static byte isKeyword[] = {0,
Lines 476-531 Link Here
476
    public final int scopeState(int index) { return 0;}
572
    public final int scopeState(int index) { return 0;}
477
    public final int inSymb(int index) { return 0;}
573
    public final int inSymb(int index) { return 0;}
478
    public final String name(int index) { return null; }
574
    public final String name(int index) { return null; }
479
    public final int getErrorSymbol() { return 0; }
480
    public final int getScopeUbound() { return 0; }
481
    public final int getScopeSize() { return 0; }
482
    public final int getMaxNameLength() { return 0; }
483
484
    public final static int
485
           NUM_STATES        = 50,
486
           NT_OFFSET         = 103,
487
           LA_STATE_OFFSET   = 824,
488
           MAX_LA            = 1,
489
           NUM_RULES         = 309,
490
           NUM_NONTERMINALS  = 44,
491
           NUM_SYMBOLS       = 147,
492
           SEGMENT_SIZE      = 8192,
493
           START_STATE       = 310,
494
           IDENTIFIER_SYMBOL = 0,
495
           EOFT_SYMBOL       = 99,
496
           EOLT_SYMBOL       = 104,
497
           ACCEPT_ACTION     = 514,
498
           ERROR_ACTION      = 515;
499
500
    public final static boolean BACKTRACK = false;
501
502
    public final int getNumStates() { return NUM_STATES; }
503
    public final int getNtOffset() { return NT_OFFSET; }
504
    public final int getLaStateOffset() { return LA_STATE_OFFSET; }
505
    public final int getMaxLa() { return MAX_LA; }
506
    public final int getNumRules() { return NUM_RULES; }
507
    public final int getNumNonterminals() { return NUM_NONTERMINALS; }
508
    public final int getNumSymbols() { return NUM_SYMBOLS; }
509
    public final int getSegmentSize() { return SEGMENT_SIZE; }
510
    public final int getStartState() { return START_STATE; }
511
    public final int getStartSymbol() { return lhs[0]; }
512
    public final int getIdentifierSymbol() { return IDENTIFIER_SYMBOL; }
513
    public final int getEoftSymbol() { return EOFT_SYMBOL; }
514
    public final int getEoltSymbol() { return EOLT_SYMBOL; }
515
    public final int getAcceptAction() { return ACCEPT_ACTION; }
516
    public final int getErrorAction() { return ERROR_ACTION; }
517
    public final boolean isValidForParser() { return isValidForParser; }
518
    public final boolean getBacktrack() { return BACKTRACK; }
519
520
    public final int originalState(int state) { return 0; }
575
    public final int originalState(int state) { return 0; }
521
    public final int asi(int state) { return 0; }
576
    public final int asi(int state) { return 0; }
522
    public final int nasi(int state) { return 0; }
577
    public final int nasi(int state) { return 0; }
523
    public final int inSymbol(int state) { return 0; }
578
    public final int inSymbol(int state) { return 0; }
524
579
580
    /**
581
     * assert(! goto_default);
582
     */
525
    public final int ntAction(int state, int sym) {
583
    public final int ntAction(int state, int sym) {
526
        return baseAction[state + sym];
584
        return baseAction[state + sym];
527
    }
585
    }
528
586
587
    /**
588
     * assert(! shift_default);
589
     */
529
    public final int tAction(int state, int sym) {
590
    public final int tAction(int state, int sym) {
530
        int i = baseAction[state],
591
        int i = baseAction[state],
531
            k = i + sym;
592
            k = i + sym;
(-)src/org/eclipse/ocl/parser/OCLAnalyzer.java (-4 / +4 lines)
Lines 86-95 Link Here
86
	 * @param environment
86
	 * @param environment
87
	 *            the symbolic and problem handling environment
87
	 *            the symbolic and problem handling environment
88
	 */
88
	 */
89
	public OCLAnalyzer(
89
	/*public OCLAnalyzer(
90
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> environment) {
90
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> environment) {
91
		this(new OCLParser(new OCLLexer(environment)));
91
		this(new OCLParser(new OCLLexer(environment)));
92
	}
92
	}*/
93
93
94
	/**
94
	/**
95
	 * Construct an OCL semantic analyzer with default syntactic and lexical
95
	 * Construct an OCL semantic analyzer with default syntactic and lexical
Lines 105-111 Link Here
105
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> environment,
105
			Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> environment,
106
			String text) {
106
			String text) {
107
		this(new OCLParser(new OCLLexer(environment, text.toCharArray())));
107
		this(new OCLParser(new OCLLexer(environment, text.toCharArray())));
108
		getLexer().lexToTokens(getAbstractParser());
108
		getLexer().lexer(getAbstractParser().getIPrsStream());
109
	}
109
	}
110
110
111
	/**
111
	/**
Lines 137-143 Link Here
137
	 * @return the parsed CST, or <code>null</code> if it could not be parsed
137
	 * @return the parsed CST, or <code>null</code> if it could not be parsed
138
	 */
138
	 */
139
	public CSTNode parseConcreteSyntax() {
139
	public CSTNode parseConcreteSyntax() {
140
		return getAbstractParser().parseTokensToCST();
140
		return getAbstractParser().parser();
141
	}
141
	}
142
142
143
	/**
143
	/**
(-)src/org/eclipse/ocl/parser/OCLKWLexerprs.java (-46 / +93 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2007 IBM Corporation and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc, Open Canarias S.L., and others.
5
* All rights reserved.   This program and the accompanying materials
5
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
6
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
7
* which accompanies this distribution, and is available at
Lines 10-24 Link Here
10
* Contributors:
10
* Contributors:
11
*   IBM - Initial API and implementation
11
*   IBM - Initial API and implementation
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
13
*   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
13
*
14
*
14
* </copyright>
15
* </copyright>
15
*
16
*
16
* $Id: OCLKWLexerprs.java,v 1.3 2009/08/28 20:43:11 ewillink Exp $
17
* 
17
*/
18
*/
18
19
19
package org.eclipse.ocl.parser;
20
package org.eclipse.ocl.parser;
20
21
21
public class OCLKWLexerprs implements lpg.lpgjavaruntime.ParseTable, OCLKWLexersym {
22
public class OCLKWLexerprs implements lpg.runtime.ParseTable, OCLKWLexersym {
23
    public final static int ERROR_SYMBOL = 0;
24
    public final int getErrorSymbol() { return ERROR_SYMBOL; }
25
26
    public final static int SCOPE_UBOUND = 0;
27
    public final int getScopeUbound() { return SCOPE_UBOUND; }
28
29
    public final static int SCOPE_SIZE = 0;
30
    public final int getScopeSize() { return SCOPE_SIZE; }
31
32
    public final static int MAX_NAME_LENGTH = 0;
33
    public final int getMaxNameLength() { return MAX_NAME_LENGTH; }
34
35
    public final static int NUM_STATES = 256;
36
    public final int getNumStates() { return NUM_STATES; }
37
38
    public final static int NT_OFFSET = 56;
39
    public final int getNtOffset() { return NT_OFFSET; }
40
41
    public final static int LA_STATE_OFFSET = 386;
42
    public final int getLaStateOffset() { return LA_STATE_OFFSET; }
43
44
    public final static int MAX_LA = 1;
45
    public final int getMaxLa() { return MAX_LA; }
46
47
    public final static int NUM_RULES = 63;
48
    public final int getNumRules() { return NUM_RULES; }
49
50
    public final static int NUM_NONTERMINALS = 2;
51
    public final int getNumNonterminals() { return NUM_NONTERMINALS; }
52
53
    public final static int NUM_SYMBOLS = 58;
54
    public final int getNumSymbols() { return NUM_SYMBOLS; }
55
56
    public final static int SEGMENT_SIZE = 8192;
57
    public final int getSegmentSize() { return SEGMENT_SIZE; }
58
59
    public final static int START_STATE = 64;
60
    public final int getStartState() { return START_STATE; }
61
62
    public final static int IDENTIFIER_SYMBOL = 0;
63
    public final int getIdentifier_SYMBOL() { return IDENTIFIER_SYMBOL; }
64
65
    public final static int EOFT_SYMBOL = 39;
66
    public final int getEoftSymbol() { return EOFT_SYMBOL; }
67
68
    public final static int EOLT_SYMBOL = 57;
69
    public final int getEoltSymbol() { return EOLT_SYMBOL; }
70
71
    public final static int ACCEPT_ACTION = 322;
72
    public final int getAcceptAction() { return ACCEPT_ACTION; }
73
74
    public final static int ERROR_ACTION = 323;
75
    public final int getErrorAction() { return ERROR_ACTION; }
76
77
    public final static boolean BACKTRACK = false;
78
    public final boolean getBacktrack() { return BACKTRACK; }
79
80
    public final int getStartSymbol() { return lhs(0); }
81
    public final boolean isValidForParser() { return OCLKWLexersym.isValidForParser; }
82
83
84
    public interface IsNullable {
85
        public final static byte isNullable[] = {0,
86
            0,0,0,0,0,0,0,0,0,0,
87
            0,0,0,0,0,0,0,0,0,0,
88
            0,0,0,0,0,0,0,0,0,0,
89
            0,0,0,0,0,0,0,0,0,0,
90
            0,0,0,0,0,0,0,0,0,0,
91
            0,0,0,0,0,0,0,0
92
        };
93
    };
94
    public final static byte isNullable[] = IsNullable.isNullable;
95
    public final boolean isNullable(int index) { return isNullable[index] != 0; }
96
97
    public interface ProsthesesIndex {
98
        public final static byte prosthesesIndex[] = {0,
99
            2,1
100
        };
101
    };
102
    public final static byte prosthesesIndex[] = ProsthesesIndex.prosthesesIndex;
103
    public final int prosthesesIndex(int index) { return prosthesesIndex[index]; }
22
104
23
    public interface IsKeyword {
105
    public interface IsKeyword {
24
        public final static byte isKeyword[] = {0,
106
        public final static byte isKeyword[] = {0,
Lines 27-33 Link Here
27
            0,0,0,0,0,0,0,0,0,0,
109
            0,0,0,0,0,0,0,0,0,0,
28
            0,0,0,0,0,0,0,0,0,0,
110
            0,0,0,0,0,0,0,0,0,0,
29
            0,0,0,0,0,0,0,0,0,0,
111
            0,0,0,0,0,0,0,0,0,0,
30
            0,0,0,0
112
            0,0,0,0,0,0
31
        };
113
        };
32
    };
114
    };
33
    public final static byte isKeyword[] = IsKeyword.isKeyword;
115
    public final static byte isKeyword[] = IsKeyword.isKeyword;
Lines 156-162 Link Here
156
            0,0,0,0,0,0,0,0,0,0,
238
            0,0,0,0,0,0,0,0,0,0,
157
            0,0,0,0,0,0,0,0,0,0,
239
            0,0,0,0,0,0,0,0,0,0,
158
            0,0,0,0,0,0,0,0,0,0,
240
            0,0,0,0,0,0,0,0,0,0,
159
            0,0,0,0,0
241
            0,0,0,0,0,0,0
160
        };
242
        };
161
    };
243
    };
162
    public final static byte termCheck[] = TermCheck.termCheck;
244
    public final static byte termCheck[] = TermCheck.termCheck;
Lines 242-297 Link Here
242
    public final int scopeState(int index) { return 0;}
324
    public final int scopeState(int index) { return 0;}
243
    public final int inSymb(int index) { return 0;}
325
    public final int inSymb(int index) { return 0;}
244
    public final String name(int index) { return null; }
326
    public final String name(int index) { return null; }
245
    public final int getErrorSymbol() { return 0; }
246
    public final int getScopeUbound() { return 0; }
247
    public final int getScopeSize() { return 0; }
248
    public final int getMaxNameLength() { return 0; }
249
250
    public final static int
251
           NUM_STATES        = 256,
252
           NT_OFFSET         = 54,
253
           LA_STATE_OFFSET   = 386,
254
           MAX_LA            = 1,
255
           NUM_RULES         = 63,
256
           NUM_NONTERMINALS  = 2,
257
           NUM_SYMBOLS       = 56,
258
           SEGMENT_SIZE      = 8192,
259
           START_STATE       = 64,
260
           IDENTIFIER_SYMBOL = 0,
261
           EOFT_SYMBOL       = 39,
262
           EOLT_SYMBOL       = 55,
263
           ACCEPT_ACTION     = 322,
264
           ERROR_ACTION      = 323;
265
266
    public final static boolean BACKTRACK = false;
267
268
    public final int getNumStates() { return NUM_STATES; }
269
    public final int getNtOffset() { return NT_OFFSET; }
270
    public final int getLaStateOffset() { return LA_STATE_OFFSET; }
271
    public final int getMaxLa() { return MAX_LA; }
272
    public final int getNumRules() { return NUM_RULES; }
273
    public final int getNumNonterminals() { return NUM_NONTERMINALS; }
274
    public final int getNumSymbols() { return NUM_SYMBOLS; }
275
    public final int getSegmentSize() { return SEGMENT_SIZE; }
276
    public final int getStartState() { return START_STATE; }
277
    public final int getStartSymbol() { return lhs[0]; }
278
    public final int getIdentifierSymbol() { return IDENTIFIER_SYMBOL; }
279
    public final int getEoftSymbol() { return EOFT_SYMBOL; }
280
    public final int getEoltSymbol() { return EOLT_SYMBOL; }
281
    public final int getAcceptAction() { return ACCEPT_ACTION; }
282
    public final int getErrorAction() { return ERROR_ACTION; }
283
    public final boolean isValidForParser() { return isValidForParser; }
284
    public final boolean getBacktrack() { return BACKTRACK; }
285
286
    public final int originalState(int state) { return 0; }
327
    public final int originalState(int state) { return 0; }
287
    public final int asi(int state) { return 0; }
328
    public final int asi(int state) { return 0; }
288
    public final int nasi(int state) { return 0; }
329
    public final int nasi(int state) { return 0; }
289
    public final int inSymbol(int state) { return 0; }
330
    public final int inSymbol(int state) { return 0; }
290
331
332
    /**
333
     * assert(! goto_default);
334
     */
291
    public final int ntAction(int state, int sym) {
335
    public final int ntAction(int state, int sym) {
292
        return baseAction[state + sym];
336
        return baseAction[state + sym];
293
    }
337
    }
294
338
339
    /**
340
     * assert(! shift_default);
341
     */
295
    public final int tAction(int state, int sym) {
342
    public final int tAction(int state, int sym) {
296
        int i = baseAction[state],
343
        int i = baseAction[state],
297
            k = i + sym;
344
            k = i + sym;
(-)src/org/eclipse/ocl/parser/OCLKWLexersym.java (-22 / +23 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2007 IBM Corporation and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc, Open Canarias S.L., and others.
5
* All rights reserved.   This program and the accompanying materials
5
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
6
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
7
* which accompanies this distribution, and is available at
Lines 10-31 Link Here
10
* Contributors:
10
* Contributors:
11
*   IBM - Initial API and implementation
11
*   IBM - Initial API and implementation
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
13
*   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
13
*
14
*
14
* </copyright>
15
* </copyright>
15
*
16
*
16
* $Id: OCLKWLexersym.java,v 1.3 2009/08/28 20:43:11 ewillink Exp $
17
* 
17
*/
18
*/
18
19
19
package org.eclipse.ocl.parser;
20
package org.eclipse.ocl.parser;
20
21
21
/**
22
 * @noimplement This interface is not intended to be implemented by clients.
23
 * @noextend This interface is not intended to be extended by clients.
24
 */
25
@SuppressWarnings("nls")
26
public interface OCLKWLexersym {
22
public interface OCLKWLexersym {
27
    public final static int
23
    public final static int
28
      Char_DollarSign = 40,
24
      Char_DollarSign = 40,
25
      Char_Percent = 41,
26
      Char__ = 42,
29
      Char_a = 5,
27
      Char_a = 5,
30
      Char_b = 30,
28
      Char_b = 30,
31
      Char_c = 11,
29
      Char_c = 11,
Lines 51-86 Link Here
51
      Char_w = 33,
49
      Char_w = 33,
52
      Char_x = 19,
50
      Char_x = 19,
53
      Char_y = 16,
51
      Char_y = 16,
54
      Char_z = 41,
52
      Char_z = 43,
55
      Char_A = 20,
53
      Char_A = 20,
56
      Char_B = 29,
54
      Char_B = 29,
57
      Char_C = 34,
55
      Char_C = 34,
58
      Char_D = 42,
56
      Char_D = 44,
59
      Char_E = 43,
57
      Char_E = 45,
60
      Char_F = 44,
58
      Char_F = 46,
61
      Char_G = 45,
59
      Char_G = 47,
62
      Char_H = 46,
60
      Char_H = 48,
63
      Char_I = 18,
61
      Char_I = 18,
64
      Char_J = 47,
62
      Char_J = 49,
65
      Char_K = 35,
63
      Char_K = 35,
66
      Char_L = 48,
64
      Char_L = 50,
67
      Char_M = 36,
65
      Char_M = 36,
68
      Char_N = 21,
66
      Char_N = 21,
69
      Char_O = 22,
67
      Char_O = 22,
70
      Char_P = 49,
68
      Char_P = 51,
71
      Char_Q = 50,
69
      Char_Q = 52,
72
      Char_R = 37,
70
      Char_R = 37,
73
      Char_S = 23,
71
      Char_S = 23,
74
      Char_T = 24,
72
      Char_T = 24,
75
      Char_U = 25,
73
      Char_U = 25,
76
      Char_V = 38,
74
      Char_V = 38,
77
      Char_W = 51,
75
      Char_W = 53,
78
      Char_X = 52,
76
      Char_X = 54,
79
      Char_Y = 53,
77
      Char_Y = 55,
80
      Char_Z = 54,
78
      Char_Z = 56,
81
      Char_EOF = 39;
79
      Char_EOF = 39;
82
80
83
      public final static String orderedTerminalSymbols[] = {
81
    public final static String orderedTerminalSymbols[] = {
84
                 "",
82
                 "",
85
                 "e",
83
                 "e",
86
                 "t",
84
                 "t",
Lines 122-127 Link Here
122
                 "V",
120
                 "V",
123
                 "EOF",
121
                 "EOF",
124
                 "DollarSign",
122
                 "DollarSign",
123
                 "Percent",
124
                 "_",
125
                 "z",
125
                 "z",
126
                 "D",
126
                 "D",
127
                 "E",
127
                 "E",
Lines 138-142 Link Here
138
                 "Z"
138
                 "Z"
139
             };
139
             };
140
140
141
    public final static int numTokenKinds = orderedTerminalSymbols.length;
141
    public final static boolean isValidForParser = true;
142
    public final static boolean isValidForParser = true;
142
}
143
}
(-)src/org/eclipse/ocl/parser/AbstractOCLParser.java (-20 / +12 lines)
Lines 20-31 Link Here
20
 */
20
 */
21
package org.eclipse.ocl.parser;
21
package org.eclipse.ocl.parser;
22
22
23
import lpg.lpgjavaruntime.IToken;
23
import lpg.runtime.IToken;
24
import lpg.lpgjavaruntime.NullExportedSymbolsException;
24
import lpg.runtime.ParseErrorCodes;
25
import lpg.lpgjavaruntime.NullTerminalSymbolsException;
26
import lpg.lpgjavaruntime.ParseErrorCodes;
27
import lpg.lpgjavaruntime.UndefinedEofSymbolException;
28
import lpg.lpgjavaruntime.UnimplementedTerminalsException;
29
25
30
import org.eclipse.emf.common.util.EList;
26
import org.eclipse.emf.common.util.EList;
31
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
27
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
Lines 82-102 Link Here
82
import org.eclipse.ocl.internal.l10n.OCLMessages;
78
import org.eclipse.ocl.internal.l10n.OCLMessages;
83
import org.eclipse.ocl.lpg.AbstractLexer;
79
import org.eclipse.ocl.lpg.AbstractLexer;
84
import org.eclipse.ocl.lpg.AbstractParser;
80
import org.eclipse.ocl.lpg.AbstractParser;
85
import org.eclipse.ocl.lpg.BasicEnvironment;
86
import org.eclipse.ocl.lpg.ProblemHandler;
81
import org.eclipse.ocl.lpg.ProblemHandler;
87
import org.eclipse.ocl.options.ParsingOptions;
82
import org.eclipse.ocl.options.ParsingOptions;
88
import org.eclipse.ocl.options.ProblemOption;
83
import org.eclipse.ocl.options.ProblemOption;
89
84
85
90
public abstract class AbstractOCLParser
86
public abstract class AbstractOCLParser
91
		extends AbstractParser {
87
		extends AbstractParser {
92
	
88
	
93
	public AbstractOCLParser(BasicEnvironment environment) {
89
	public AbstractOCLParser(AbstractLexer lexer) {
94
		super(environment);
90
		super(lexer);
95
	}
91
		/*super(lexStream);
96
97
	@SuppressWarnings("nls")
98
	public AbstractOCLParser(AbstractLexer lexStream) {
99
		super(lexStream);
100
92
101
		try {
93
		try {
102
			super.remapTerminalSymbols(orderedTerminalSymbols(),
94
			super.remapTerminalSymbols(orderedTerminalSymbols(),
Lines 118-124 Link Here
118
			throw new RuntimeException(
110
			throw new RuntimeException(
119
				"The Lexer does not implement the Eof symbol "
111
				"The Lexer does not implement the Eof symbol "
120
					+ OCLParsersym.orderedTerminalSymbols[OCLParserprs.EOFT_SYMBOL]);
112
					+ OCLParsersym.orderedTerminalSymbols[OCLParserprs.EOFT_SYMBOL]);
121
		}
113
		}*/
122
	}
114
	}
123
	
115
	
124
	protected PackageDeclarationCS createPackageDeclarationCS(
116
	protected PackageDeclarationCS createPackageDeclarationCS(
Lines 718-724 Link Here
718
	 * @param stringLiteral a string literal token with escape notation 
710
	 * @param stringLiteral a string literal token with escape notation 
719
	 * @return the unescaped string
711
	 * @return the unescaped string
720
	 * 
712
	 * 
721
	 * @since 1.3
713
	 * @since 3.0
722
	 */
714
	 */
723
	protected String unescape(IToken stringLiteral) {
715
	protected String unescape(IToken stringLiteral) {
724
		String rawString = stringLiteral.toString();
716
		String rawString = stringLiteral.toString();
Lines 741-749 Link Here
741
				}
733
				}
742
				i++;
734
				i++;
743
				if (i >= n) {
735
				if (i >= n) {
744
					reportError(
736
					getIPrsStream().reportError(
745
						ParseErrorCodes.INVALID_CODE,
737
						ParseErrorCodes.INVALID_CODE,
746
						"", stringLiteral.getTokenIndex(), stringLiteral.getTokenIndex(), //$NON-NLS-1$
738
						stringLiteral.getTokenIndex(), stringLiteral.getTokenIndex(),
747
						OCLMessages.StringNotProperlyClosed_ERROR);
739
						OCLMessages.StringNotProperlyClosed_ERROR);
748
				}
740
				}
749
				char nextCh = rawString.charAt(i);
741
				char nextCh = rawString.charAt(i);
Lines 810-818 Link Here
810
									.append((char) unescapedChar);
802
									.append((char) unescapedChar);
811
							}
803
							}
812
							if (unescapedChar < 0) {
804
							if (unescapedChar < 0) {
813
								reportError(
805
								getIPrsStream().reportError(
814
									ParseErrorCodes.INVALID_CODE,
806
									ParseErrorCodes.INVALID_CODE,
815
									"", stringLiteral.getTokenIndex(), stringLiteral.getTokenIndex(), //$NON-NLS-1$
807
									stringLiteral.getTokenIndex(), stringLiteral.getTokenIndex(),
816
									OCLMessages.InvalidEscapeSequence_ERROR);
808
									OCLMessages.InvalidEscapeSequence_ERROR);
817
							}
809
							}
818
							break;
810
							break;
(-)src/org/eclipse/ocl/parser/OCLParserprs.java (-72 / +135 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., 
5
* Open Canarias S.L. and others.
5
* All rights reserved.   This program and the accompanying materials
6
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
7
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
8
* which accompanies this distribution, and is available at
Lines 14-32 Link Here
14
*   E.D.Willink - Bugs 225493, 243976, 259818
15
*   E.D.Willink - Bugs 225493, 243976, 259818
15
*   Zeligsoft - Bug 243976
16
*   Zeligsoft - Bug 243976
16
*   Borland - Bug 242880
17
*   Borland - Bug 242880
18
*   Adolfo Sanchez- Barbudo Herrera - LPG v 2.0.17 adoption
17
*
19
*
18
* </copyright>
20
* </copyright>
19
*
21
*
20
* $Id: OCLParserprs.java,v 1.7 2009/08/28 20:43:11 ewillink Exp $
22
* $Id: EssentialOCL.g,v 1.7 2009/03/05 14:12:14 cdamus Exp $
21
*/
23
*/
22
24
23
package org.eclipse.ocl.parser;
25
package org.eclipse.ocl.parser;
24
26
25
/**
27
public class OCLParserprs implements lpg.runtime.ParseTable, OCLParsersym {
26
 * @noextend This interface is not intended to be extended by clients.
28
    public final static int ERROR_SYMBOL = 101;
27
 */
29
    public final int getErrorSymbol() { return ERROR_SYMBOL; }
28
@SuppressWarnings("nls")
30
29
public class OCLParserprs implements lpg.lpgjavaruntime.ParseTable, OCLParsersym {
31
    public final static int SCOPE_UBOUND = 43;
32
    public final int getScopeUbound() { return SCOPE_UBOUND; }
33
34
    public final static int SCOPE_SIZE = 44;
35
    public final int getScopeSize() { return SCOPE_SIZE; }
36
37
    public final static int MAX_NAME_LENGTH = 26;
38
    public final int getMaxNameLength() { return MAX_NAME_LENGTH; }
39
40
    public final static int NUM_STATES = 214;
41
    public final int getNumStates() { return NUM_STATES; }
42
43
    public final static int NT_OFFSET = 101;
44
    public final int getNtOffset() { return NT_OFFSET; }
45
46
    public final static int LA_STATE_OFFSET = 3369;
47
    public final int getLaStateOffset() { return LA_STATE_OFFSET; }
48
49
    public final static int MAX_LA = 2;
50
    public final int getMaxLa() { return MAX_LA; }
51
52
    public final static int NUM_RULES = 272;
53
    public final int getNumRules() { return NUM_RULES; }
54
55
    public final static int NUM_NONTERMINALS = 104;
56
    public final int getNumNonterminals() { return NUM_NONTERMINALS; }
57
58
    public final static int NUM_SYMBOLS = 205;
59
    public final int getNumSymbols() { return NUM_SYMBOLS; }
60
61
    public final static int SEGMENT_SIZE = 8192;
62
    public final int getSegmentSize() { return SEGMENT_SIZE; }
63
64
    public final static int START_STATE = 2905;
65
    public final int getStartState() { return START_STATE; }
66
67
    public final static int IDENTIFIER_SYMBOL = 2;
68
    public final int getIdentifier_SYMBOL() { return IDENTIFIER_SYMBOL; }
69
70
    public final static int EOFT_SYMBOL = 79;
71
    public final int getEoftSymbol() { return EOFT_SYMBOL; }
72
73
    public final static int EOLT_SYMBOL = 79;
74
    public final int getEoltSymbol() { return EOLT_SYMBOL; }
75
76
    public final static int ACCEPT_ACTION = 3096;
77
    public final int getAcceptAction() { return ACCEPT_ACTION; }
78
79
    public final static int ERROR_ACTION = 3097;
80
    public final int getErrorAction() { return ERROR_ACTION; }
81
82
    public final static boolean BACKTRACK = false;
83
    public final boolean getBacktrack() { return BACKTRACK; }
84
85
    public final int getStartSymbol() { return lhs(0); }
86
    public final boolean isValidForParser() { return OCLParsersym.isValidForParser; }
87
88
89
    public interface IsNullable {
90
        public final static byte isNullable[] = {0,
91
            0,0,0,0,0,0,0,0,0,0,
92
            0,0,0,0,0,0,0,0,0,0,
93
            0,0,0,0,0,0,0,0,0,0,
94
            0,0,0,0,0,0,0,0,0,0,
95
            0,0,0,0,0,0,0,0,0,0,
96
            0,0,0,0,0,0,0,0,0,0,
97
            0,0,0,0,0,0,0,0,0,0,
98
            0,0,0,0,0,0,0,0,0,0,
99
            0,0,0,0,0,0,0,0,0,0,
100
            0,0,0,0,0,0,0,0,0,0,
101
            0,0,0,0,0,0,0,0,0,0,
102
            0,0,0,0,0,0,0,0,0,0,
103
            0,0,0,0,0,0,0,0,0,0,
104
            0,0,0,0,0,0,0,0,0,0,
105
            0,0,0,0,0,0,0,0,0,0,
106
            1,0,0,0,0,1,1,0,0,0,
107
            0,0,0,0,0,0,1,1,0,0,
108
            0,0,0,0,0,1,0,0,0,0,
109
            1,1,0,0,0,0,0,0,1,1,
110
            0,0,0,0,0,1,1,0,0,1,
111
            0,0,0,0,0
112
        };
113
    };
114
    public final static byte isNullable[] = IsNullable.isNullable;
115
    public final boolean isNullable(int index) { return isNullable[index] != 0; }
116
117
    public interface ProsthesesIndex {
118
        public final static byte prosthesesIndex[] = {0,
119
            54,9,21,62,5,6,7,10,3,8,
120
            15,50,51,11,40,42,44,48,49,56,
121
            57,58,59,60,61,67,68,69,70,71,
122
            41,43,38,39,34,35,36,37,32,33,
123
            30,31,28,29,25,26,27,77,23,52,
124
            53,78,80,81,24,47,97,98,99,100,
125
            88,91,92,4,12,19,20,22,65,66,
126
            73,79,83,84,86,87,93,94,96,101,
127
            2,13,14,17,18,45,46,55,63,64,
128
            72,74,75,76,82,85,89,90,95,102,
129
            103,104,1,16
130
        };
131
    };
132
    public final static byte prosthesesIndex[] = ProsthesesIndex.prosthesesIndex;
133
    public final int prosthesesIndex(int index) { return prosthesesIndex[index]; }
30
134
31
    public interface IsKeyword {
135
    public interface IsKeyword {
32
        public final static byte isKeyword[] = {0,
136
        public final static byte isKeyword[] = {0,
Lines 1193-1221 Link Here
1193
1297
1194
    public interface ScopeRhs {
1298
    public interface ScopeRhs {
1195
        public final static char scopeRhs[] = {0,
1299
        public final static char scopeRhs[] = {0,
1196
            176,1,103,88,0,12,0,176,1,103,
1300
            176,1,103,88,0,4,0,176,1,103,
1197
            87,0,146,93,146,92,146,71,0,45,
1301
            87,0,146,93,146,92,146,71,0,94,
1198
            0,146,92,146,71,0,44,118,45,0,
1302
            0,146,92,146,71,0,93,146,94,0,
1199
            146,71,0,43,118,44,118,45,0,174,
1303
            146,71,0,92,146,93,146,94,0,174,
1200
            68,0,52,118,0,152,81,103,0,16,
1304
            68,0,96,146,0,152,81,103,0,74,
1201
            0,0,157,1,151,109,0,157,1,151,
1305
            151,0,157,1,151,109,0,157,1,151,
1202
            111,0,157,1,151,166,0,196,1,59,
1306
            111,0,157,1,151,166,0,196,1,59,
1203
            0,153,1,105,0,153,24,2,0,7,
1307
            0,153,1,105,0,153,24,2,0,3,
1204
            118,0,146,72,150,84,150,1,183,0,
1308
            146,0,146,72,150,84,150,1,183,0,
1205
            150,84,150,1,183,0,18,118,12,0,
1309
            150,84,150,1,183,0,72,146,4,0,
1206
            150,1,183,0,22,117,18,118,12,0,
1310
            150,1,183,0,84,150,72,146,4,0,
1207
            146,72,150,1,183,0,146,72,150,36,
1311
            146,72,150,1,183,0,146,72,150,36,
1208
            150,1,184,0,150,36,150,1,184,0,
1312
            150,1,184,0,150,36,150,1,184,0,
1209
            150,1,184,0,19,117,18,118,12,0,
1313
            150,1,184,0,36,150,72,146,4,0,
1210
            146,72,150,1,184,0,146,1,184,0,
1314
            146,72,150,1,184,0,146,1,184,0,
1211
            192,69,59,0,14,0,190,69,105,0,
1315
            192,69,59,0,80,0,190,69,105,0,
1212
            152,81,115,0,146,1,0,157,1,103,
1316
            152,81,115,0,146,1,0,157,1,103,
1213
            67,104,0,157,1,60,0,134,0,4,
1317
            67,104,0,157,1,60,0,134,0,17,
1214
            132,0,3,132,0,138,0,2,130,0,
1318
            132,0,16,132,0,138,0,35,135,0,
1215
            1,130,0,140,0,9,127,0,8,127,
1319
            34,135,0,140,0,21,137,0,20,137,
1216
            0,6,127,0,5,127,0,142,0,10,
1320
            0,19,137,0,18,137,0,142,0,5,
1217
            125,0,7,125,0,144,0,48,123,0,
1321
            141,0,3,141,0,144,0,28,143,0,
1218
            47,123,0,46,123,0
1322
            27,143,0,26,143,0
1219
        };
1323
        };
1220
    };
1324
    };
1221
    public final static char scopeRhs[] = ScopeRhs.scopeRhs;
1325
    public final static char scopeRhs[] = ScopeRhs.scopeRhs;
Lines 1433-1485 Link Here
1433
    public final static String name[] = Name.name;
1537
    public final static String name[] = Name.name;
1434
    public final String name(int index) { return name[index]; }
1538
    public final String name(int index) { return name[index]; }
1435
1539
1436
    public final static int
1437
           ERROR_SYMBOL      = 101,
1438
           SCOPE_UBOUND      = 43,
1439
           SCOPE_SIZE        = 44,
1440
           MAX_NAME_LENGTH   = 26;
1441
1442
    public final int getErrorSymbol() { return ERROR_SYMBOL; }
1443
    public final int getScopeUbound() { return SCOPE_UBOUND; }
1444
    public final int getScopeSize() { return SCOPE_SIZE; }
1445
    public final int getMaxNameLength() { return MAX_NAME_LENGTH; }
1446
1447
    public final static int
1448
           NUM_STATES        = 214,
1449
           NT_OFFSET         = 101,
1450
           LA_STATE_OFFSET   = 3369,
1451
           MAX_LA            = 2,
1452
           NUM_RULES         = 272,
1453
           NUM_NONTERMINALS  = 104,
1454
           NUM_SYMBOLS       = 205,
1455
           SEGMENT_SIZE      = 8192,
1456
           START_STATE       = 2905,
1457
           IDENTIFIER_SYMBOL = 2,
1458
           EOFT_SYMBOL       = 79,
1459
           EOLT_SYMBOL       = 79,
1460
           ACCEPT_ACTION     = 3096,
1461
           ERROR_ACTION      = 3097;
1462
1463
    public final static boolean BACKTRACK = false;
1464
1465
    public final int getNumStates() { return NUM_STATES; }
1466
    public final int getNtOffset() { return NT_OFFSET; }
1467
    public final int getLaStateOffset() { return LA_STATE_OFFSET; }
1468
    public final int getMaxLa() { return MAX_LA; }
1469
    public final int getNumRules() { return NUM_RULES; }
1470
    public final int getNumNonterminals() { return NUM_NONTERMINALS; }
1471
    public final int getNumSymbols() { return NUM_SYMBOLS; }
1472
    public final int getSegmentSize() { return SEGMENT_SIZE; }
1473
    public final int getStartState() { return START_STATE; }
1474
    public final int getStartSymbol() { return lhs[0]; }
1475
    public final int getIdentifierSymbol() { return IDENTIFIER_SYMBOL; }
1476
    public final int getEoftSymbol() { return EOFT_SYMBOL; }
1477
    public final int getEoltSymbol() { return EOLT_SYMBOL; }
1478
    public final int getAcceptAction() { return ACCEPT_ACTION; }
1479
    public final int getErrorAction() { return ERROR_ACTION; }
1480
    public final boolean isValidForParser() { return isValidForParser; }
1481
    public final boolean getBacktrack() { return BACKTRACK; }
1482
1483
    public final int originalState(int state) {
1540
    public final int originalState(int state) {
1484
        return -baseCheck[state];
1541
        return -baseCheck[state];
1485
    }
1542
    }
Lines 1493-1502 Link Here
1493
        return inSymb[originalState(state)];
1550
        return inSymb[originalState(state)];
1494
    }
1551
    }
1495
1552
1553
    /**
1554
     * assert(! goto_default);
1555
     */
1496
    public final int ntAction(int state, int sym) {
1556
    public final int ntAction(int state, int sym) {
1497
        return baseAction[state + sym];
1557
        return baseAction[state + sym];
1498
    }
1558
    }
1499
1559
1560
    /**
1561
     * assert(! shift_default);
1562
     */
1500
    public final int tAction(int state, int sym) {
1563
    public final int tAction(int state, int sym) {
1501
        int i = baseAction[state],
1564
        int i = baseAction[state],
1502
            k = i + sym;
1565
            k = i + sym;
(-)src/org/eclipse/ocl/parser/OCLLexersym.java (-8 / +6 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2009 IBM Corporation, Borland Software Corp.,  and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Borland Software Corp., Open Canarias S.L. and others.
5
* All rights reserved.   This program and the accompanying materials
5
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
6
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
7
* which accompanies this distribution, and is available at
Lines 10-29 Link Here
10
* Contributors:
10
* Contributors:
11
*   IBM - Initial API and implementation
11
*   IBM - Initial API and implementation
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
13
*               - Bug 259818
13
*   Borland - Bug 242880
14
*   Borland - Bug 242880
15
*   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
14
*
16
*
15
* </copyright>
17
* </copyright>
16
*
18
*
17
* $Id: OCLLexersym.java,v 1.3 2009/08/28 20:43:11 ewillink Exp $
19
* $Id$
18
*/
20
*/
19
21
20
package org.eclipse.ocl.parser;
22
package org.eclipse.ocl.parser;
21
23
22
/**
23
 * @noimplement This interface is not intended to be implemented by clients.
24
 * @noextend This interface is not intended to be extended by clients.
25
 */
26
@SuppressWarnings("nls")
27
public interface OCLLexersym {
24
public interface OCLLexersym {
28
    public final static int
25
    public final static int
29
      Char_CtlCharNotWS = 103,
26
      Char_CtlCharNotWS = 103,
Lines 130-136 Link Here
130
      Char_Equal = 15,
127
      Char_Equal = 15,
131
      Char_EOF = 99;
128
      Char_EOF = 99;
132
129
133
      public final static String orderedTerminalSymbols[] = {
130
    public final static String orderedTerminalSymbols[] = {
134
                 "",
131
                 "",
135
                 "0",
132
                 "0",
136
                 "1",
133
                 "1",
Lines 237-241 Link Here
237
                 "CtlCharNotWS"
234
                 "CtlCharNotWS"
238
             };
235
             };
239
236
237
    public final static int numTokenKinds = orderedTerminalSymbols.length;
240
    public final static boolean isValidForParser = true;
238
    public final static boolean isValidForParser = true;
241
}
239
}
(-)src/org/eclipse/ocl/parser/OCLLexer.java (-328 / +492 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2009 IBM Corporation, Borland Software Corp.,  and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Borland Software Corp., Open Canarias S.L. and others.
5
* All rights reserved.   This program and the accompanying materials
5
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
6
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
7
* which accompanies this distribution, and is available at
Lines 10-124 Link Here
10
* Contributors:
10
* Contributors:
11
*   IBM - Initial API and implementation
11
*   IBM - Initial API and implementation
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
13
*               - Bug 259818
13
*   Borland - Bug 242880
14
*   Borland - Bug 242880
15
*   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
14
*
16
*
15
* </copyright>
17
* </copyright>
16
*
18
*
17
* $Id: OCLLexer.java,v 1.4 2009/08/28 20:43:11 ewillink Exp $
19
* $Id$
18
*/
20
*/
19
21
20
package org.eclipse.ocl.parser;
22
package org.eclipse.ocl.parser;
21
23
22
import lpg.lpgjavaruntime.*;
24
import lpg.runtime.*;
23
import org.eclipse.ocl.lpg.AbstractLexer;
25
import org.eclipse.ocl.lpg.AbstractLexer;
24
import org.eclipse.ocl.lpg.AbstractParser;
26
import org.eclipse.ocl.lpg.AbstractLexerStream;
27
import org.eclipse.ocl.lpg.OCLParserStream;
28
29
import java.io.Reader;
30
25
import org.eclipse.ocl.Environment;
31
import org.eclipse.ocl.Environment;
26
import org.eclipse.ocl.lpg.BasicEnvironment;
32
import org.eclipse.ocl.lpg.BasicEnvironment;
27
import org.eclipse.ocl.util.OCLUtil;
33
import org.eclipse.ocl.util.OCLUtil;
28
34
29
@SuppressWarnings("nls")
35
@SuppressWarnings("nls")
30
public class OCLLexer extends AbstractLexer implements OCLParsersym, OCLLexersym, RuleAction
36
public class OCLLexer extends AbstractLexer implements RuleAction
31
{
37
{
38
    private OCLLexerStream lexStream;
39
32
    private static ParseTable prs = new OCLLexerprs();
40
    private static ParseTable prs = new OCLLexerprs();
33
    //
41
    public ParseTable getParseTable() { return prs; }
34
    // The Lexer contains an array of characters as the input stream to be parsed.
42
35
    // There are methods to retrieve and classify characters.
43
    private LexParser lexParser = new LexParser();
36
    // The lexparser "token" is implemented simply as the index of the next character in the array.
44
    public LexParser getParser() { return lexParser; }
37
    // The Lexer extends the abstract class LpgLexStream with an implementation of the abstract
45
38
    // method getKind.  The template defines the Lexer class and the lexer() method.
46
    public int getToken(int i) { return lexParser.getToken(i); }
39
    // A driver creates the action class, "Lexer", passing an Option object to the constructor.
47
    public int getRhsFirstTokenIndex(int i) { return lexParser.getFirstToken(i); }
40
    //
48
    public int getRhsLastTokenIndex(int i) { return lexParser.getLastToken(i); }
41
    protected OCLKWLexer kwLexer;
49
42
    protected boolean printTokens;
50
    public int getLeftSpan() { return lexParser.getToken(1); }
43
    private AbstractParser parser;
51
    public int getRightSpan() { return lexParser.getLastToken(); }
44
    private LexParser lexParser = new LexParser(this, prs, this);
52
53
    public void resetKeywordLexer()
54
    {
55
        if (kwLexer == null)
56
              this.kwLexer = new OCLKWLexer(lexStream.getInputChars(), OCLParsersym.TK_IDENTIFIER);
57
        else this.kwLexer.setInputChars(lexStream.getInputChars());
58
    }
59
60
    public void reset(String filename, int tab) throws java.io.IOException
61
    {
62
        lexStream = new OCLLexerStream(getOCLEnvironment(), filename, tab);
63
        lexParser.reset(lexStream, prs, this);
64
        resetKeywordLexer();
65
    }
66
67
    public void reset(char[] input_chars, String filename)
68
    {
69
        reset(input_chars, filename, ECLIPSE_TAB_VALUE);
70
    }
71
72
    public void reset(char[] input_chars, String filename, int tab)
73
    {
74
        lexStream = new OCLLexerStream(getOCLEnvironment(), input_chars, filename, tab);
75
        lexParser.reset(lexStream, prs, this);
76
        resetKeywordLexer();
77
    }
78
79
    // OCL addition to reset the lexer stream from an input reader
80
    public void reset(Reader reader, String filename) throws java.io.IOException {
81
        reset(reader, filename, ECLIPSE_TAB_VALUE);
82
    }
45
    
83
    
46
    private final Environment<?,?,?,?,?,?,?,?,?,?,?,?> oclEnvironment;
84
    // OCL addition to reset the lexer stream from an input reader
85
	  public void reset(Reader reader, String filename, int tab) throws java.io.IOException {
86
    		char[] input_chars = getInputChars(reader);
87
        reset(input_chars, filename, tab);
88
    }
47
89
48
    public OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment) {
90
	  /**
91
	   * @since 3.0
92
	   */
93
    public OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, String filename, int tab) throws java.io.IOException {
49
        super(OCLUtil.getAdapter(environment, BasicEnvironment.class));
94
        super(OCLUtil.getAdapter(environment, BasicEnvironment.class));
95
        reset(filename, tab);
50
        oclEnvironment = environment;
96
        oclEnvironment = environment;
51
    }
97
    }
52
    
53
	public OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, char[] chars) {
54
		this(environment, chars, "OCL", ECLIPSE_TAB_VALUE);
55
		kwLexer = new OCLKWLexer(getInputChars(), TK_IDENTIFIER);
56
	}
57
98
58
    public OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, char[] input_chars, String filename, int tab)  {
99
	  /**
59
        super(OCLUtil.getAdapter(environment, BasicEnvironment.class), input_chars, filename, tab);
100
	   * @since 3.0
101
	   */
102
    public OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, String filename) throws java.io.IOException{
103
        this(environment, filename, ECLIPSE_TAB_VALUE);
104
    }
105
106
    public OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, char[] input_chars, String filename, int tab) {
107
        super(OCLUtil.getAdapter(environment, BasicEnvironment.class));
108
        reset(input_chars, filename, tab);
60
        oclEnvironment = environment;
109
        oclEnvironment = environment;
61
    }
110
    }
111
112
	  public OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, char[] chars) {
113
        this(environment, chars, "OCL", ECLIPSE_TAB_VALUE);
114
	  }
115
116
	  /**
117
	   * @since 3.0
118
	   */
119
	  public OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, Reader reader) throws java.io.IOException {
120
        this(environment, reader, "OCL");
121
	  }
122
123
	  /**
124
	   * @since 3.0
125
	   */
126
    public OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, Reader reader, String filename) throws java.io.IOException {
127
			this(environment, reader, filename, ECLIPSE_TAB_VALUE);
128
	  }
129
	  
130
	  /**
131
	   * @since 3.0
132
	   */
133
	  public OCLLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, Reader reader, String filename, int tab) throws java.io.IOException {
134
			super(OCLUtil.getAdapter(environment, BasicEnvironment.class));
135
			reset(reader, filename, tab);
136
			oclEnvironment = environment;
137
	  }
138
    
139
    private final Environment<?,?,?,?,?,?,?,?,?,?,?,?> oclEnvironment;
62
    
140
    
63
	public Environment<?,?,?,?,?,?,?,?,?,?,?,?> getOCLEnvironment() {
141
    public Environment<?,?,?,?,?,?,?,?,?,?,?,?> getOCLEnvironment() {
64
    	return oclEnvironment;
142
    	return oclEnvironment;
65
    }
143
    }
66
144
67
    @Override
145
    public AbstractLexerStream getILexStream() { return lexStream; }
68
    public int [] getKeywordKinds() { return kwLexer.getKeywordKinds(); }
69
146
70
    public int getLeftSpan() { return lexParser.getFirstToken(); }
147
    /**
71
    public AbstractParser getParser() { return parser; }
148
     * @deprecated replaced by {@link #getILexStream()}
72
    public int getRhsFirstTokenIndex(int i) { return lexParser.getFirstToken(i); }
149
     */
73
    public int getRhsLastTokenIndex(int i) { return lexParser.getLastToken(i); }
150
    public ILexStream getLexStream() { return lexStream; }
74
    public int getRightSpan() { return lexParser.getLastToken(); }
75
151
76
    @Override
152
    private void initializeLexer(OCLParserStream prsStream, int start_offset, int end_offset)
77
    public int getToken(int i) { return lexParser.getToken(i); }
153
    {
154
        if (lexStream.getInputChars() == null)
155
            throw new NullPointerException("LexStream was not initialized");
156
        lexStream.setPrsStream(prsStream);
157
        prsStream.makeToken(start_offset, end_offset, 0); // Token list must start with a bad token
158
    }
78
159
79
    @Override
160
    private void addEOF(OCLParserStream prsStream, int end_offset)
80
    public void initialize(char [] content, String filename)
81
    {
161
    {
82
        super.initialize(content, filename);
162
        prsStream.makeToken(end_offset, end_offset, OCLParsersym.TK_EOF_TOKEN); // and end with the end of file token
83
        if (kwLexer == null)
163
        prsStream.setStreamLength(prsStream.getSize());
84
             kwLexer = new OCLKWLexer(getInputChars(), TK_IDENTIFIER);
85
        else
86
             kwLexer.setInputChars(getInputChars());
87
    }
164
    }
88
165
89
    @Override
166
    public void lexer(OCLParserStream prsStream)
90
    public String[] orderedExportedSymbols() { return OCLParsersym.orderedTerminalSymbols; }
167
    {
168
        lexer(null, prsStream);
169
    }
91
    
170
    
92
    @Override
171
    public void lexer(Monitor monitor, OCLParserStream prsStream)
93
    public void setInputChars(char[] inputChars) {
172
    {
94
		super.setInputChars(inputChars);
173
        initializeLexer(prsStream, 0, -1);
95
		kwLexer = new OCLKWLexer(getInputChars(), TK_IDENTIFIER);
174
        lexParser.parseCharacters(monitor);  // Lex the input characters
96
	}
175
        addEOF(prsStream, lexStream.getStreamIndex());
176
    }
177
178
    public void lexer(OCLParserStream prsStream, int start_offset, int end_offset)
179
    {
180
        lexer(null, prsStream, start_offset, end_offset);
181
    }
97
    
182
    
98
    @Override
183
    public void lexer(Monitor monitor, OCLParserStream prsStream, int start_offset, int end_offset)
99
    public void lexToTokens(Monitor monitor, AbstractParser parser)
100
    {
184
    {
101
        if (getInputChars() == null)
185
        if (start_offset <= 1)
102
            throw new NullPointerException("LexStream was not initialized");
186
             initializeLexer(prsStream, 0, -1);
187
        else initializeLexer(prsStream, start_offset - 1, start_offset - 1);
188
189
        lexParser.parseCharacters(monitor, start_offset, end_offset);
190
191
        addEOF(prsStream, (end_offset >= lexStream.getStreamIndex() ? lexStream.getStreamIndex() : end_offset + 1));
192
    }
193
194
    /**
195
     * If a parse stream was not passed to this Lexical analyser then we
196
     * simply report a lexical error. Otherwise, we produce a bad token.
197
     */
198
    public void reportLexicalError(int startLoc, int endLoc) {
199
        IPrsStream prs_stream = lexStream.getIPrsStream();
200
        if (prs_stream == null)
201
            lexStream.reportLexicalError(startLoc, endLoc);
202
        else {
203
            //
204
            // Remove any token that may have been processed that fall in the
205
            // range of the lexical error... then add one error token that spans
206
            // the error range.
207
            //
208
            for (int i = prs_stream.getSize() - 1; i > 0; i--) {
209
                if (prs_stream.getStartOffset(i) >= startLoc)
210
                     prs_stream.removeLastToken();
211
                else break;
212
            }
213
            prs_stream.makeToken(startLoc, endLoc, 0); // add an error token to the prsStream
214
        }        
215
    }
103
216
104
        this.parser = parser;
217
    //
218
    // The Lexer contains an array of characters as the input stream to be parsed.
219
    // There are methods to retrieve and classify characters.
220
    // The lexparser "token" is implemented simply as the index of the next character in the array.
221
    // The Lexer extends the abstract class LpgLexStream with an implementation of the abstract
222
    // method getKind.  The template defines the Lexer class and the lexer() method.
223
    // A driver creates the action class, "Lexer", passing an Option object to the constructor.
224
    //
225
    OCLKWLexer kwLexer;
226
    boolean printTokens;
227
    private final static int ECLIPSE_TAB_VALUE = 4;
105
228
106
        parser.makeToken(0, 0, 0); // Token list must start with a bad token
229
    public int [] getKeywordKinds() { return kwLexer.getKeywordKinds(); }
107
            
230
108
        lexParser.parseCharacters(monitor);  // Lex the input characters
231
109
            
232
    /**
110
        int i = getStreamIndex();
233
     * @deprecated function replaced by {@link #reset(char [] content, String filename)}
111
        parser.makeToken(i, i, TK_EOF_TOKEN); // and end with the end of file token
234
     */
112
        parser.setStreamLength(parser.getSize());
235
    public void initialize(char [] content, String filename)
113
            
236
    {
114
        return;
237
        reset(content, filename);
238
    }
239
    
240
    final void makeToken(int left_token, int right_token, int kind)
241
    {
242
        lexStream.makeToken(left_token, right_token, kind);
115
    }
243
    }
116
    
244
    
117
    final void makeToken(int kind)
245
    final void makeToken(int kind)
118
    {
246
    {
119
        int startOffset = getLeftSpan(),
247
        int startOffset = getLeftSpan(),
120
            endOffset = getRightSpan();
248
            endOffset = getRightSpan();
121
        makeToken(startOffset, endOffset, kind);
249
        lexStream.makeToken(startOffset, endOffset, kind);
122
        if (printTokens) printValue(startOffset, endOffset);
250
        if (printTokens) printValue(startOffset, endOffset);
123
    }
251
    }
124
252
Lines 126-132 Link Here
126
    {
254
    {
127
        int startOffset = getLeftSpan(),
255
        int startOffset = getLeftSpan(),
128
            endOffset = getRightSpan();
256
            endOffset = getRightSpan();
129
        super.getPrsStream().makeAdjunct(startOffset, endOffset, kind);
257
        lexStream.getIPrsStream().makeAdjunct(startOffset, endOffset, kind);
130
    }
258
    }
131
259
132
    final void skipToken()
260
    final void skipToken()
Lines 138-628 Link Here
138
    {
266
    {
139
        int startOffset = getLeftSpan(),
267
        int startOffset = getLeftSpan(),
140
            endOffset = getRightSpan(),
268
            endOffset = getRightSpan(),
141
        kwKind = kwLexer.lexer(startOffset, endOffset);
269
            kwKind = kwLexer.lexer(startOffset, endOffset);
142
        makeToken(startOffset, endOffset, kwKind);
270
        lexStream.makeToken(startOffset, endOffset, kwKind);
271
        if (printTokens) printValue(startOffset, endOffset);
272
    }
273
    
274
    //
275
    // This flavor of checkForKeyWord is necessary when the default kind
276
    // (which is returned when the keyword filter doesn't match) is something
277
    // other than _IDENTIFIER.
278
    //
279
    final void checkForKeyWord(int defaultKind)
280
    {
281
        int startOffset = getLeftSpan(),
282
            endOffset = getRightSpan(),
283
            kwKind = kwLexer.lexer(startOffset, endOffset);
284
        if (kwKind == OCLParsersym.TK_IDENTIFIER)
285
            kwKind = defaultKind;
286
        lexStream.makeToken(startOffset, endOffset, kwKind);
143
        if (printTokens) printValue(startOffset, endOffset);
287
        if (printTokens) printValue(startOffset, endOffset);
144
    }
288
    }
145
    
289
    
146
    final void printValue(int startOffset, int endOffset)
290
    final void printValue(int startOffset, int endOffset)
147
    {
291
    {
148
        String s = new String(getInputChars(), startOffset, endOffset - startOffset + 1);
292
        String s = new String(lexStream.getInputChars(), startOffset, endOffset - startOffset + 1);
149
        System.out.print(s);
293
        System.out.print(s);
150
    }
294
    }
151
295
152
    //
296
    //
153
    //
297
    //
154
    //
298
    //
299
    static class OCLLexerStream extends AbstractLexerStream
300
    {
155
    public final static int tokenKind[] =
301
    public final static int tokenKind[] =
156
    {
302
    {
157
        Char_CtlCharNotWS,    // 000    0x00
303
        OCLLexersym.Char_CtlCharNotWS,    // 000    0x00
158
        Char_CtlCharNotWS,    // 001    0x01
304
        OCLLexersym.Char_CtlCharNotWS,    // 001    0x01
159
        Char_CtlCharNotWS,    // 002    0x02
305
        OCLLexersym.Char_CtlCharNotWS,    // 002    0x02
160
        Char_CtlCharNotWS,    // 003    0x03
306
        OCLLexersym.Char_CtlCharNotWS,    // 003    0x03
161
        Char_CtlCharNotWS,    // 004    0x04
307
        OCLLexersym.Char_CtlCharNotWS,    // 004    0x04
162
        Char_CtlCharNotWS,    // 005    0x05
308
        OCLLexersym.Char_CtlCharNotWS,    // 005    0x05
163
        Char_CtlCharNotWS,    // 006    0x06
309
        OCLLexersym.Char_CtlCharNotWS,    // 006    0x06
164
        Char_CtlCharNotWS,    // 007    0x07
310
        OCLLexersym.Char_CtlCharNotWS,    // 007    0x07
165
        Char_CtlCharNotWS,    // 008    0x08
311
        OCLLexersym.Char_CtlCharNotWS,    // 008    0x08
166
        Char_HT,              // 009    0x09
312
        OCLLexersym.Char_HT,              // 009    0x09
167
        Char_LF,              // 010    0x0A
313
        OCLLexersym.Char_LF,              // 010    0x0A
168
        Char_CtlCharNotWS,    // 011    0x0B
314
        OCLLexersym.Char_CtlCharNotWS,    // 011    0x0B
169
        Char_FF,              // 012    0x0C
315
        OCLLexersym.Char_FF,              // 012    0x0C
170
        Char_CR,              // 013    0x0D
316
        OCLLexersym.Char_CR,              // 013    0x0D
171
        Char_CtlCharNotWS,    // 014    0x0E
317
        OCLLexersym.Char_CtlCharNotWS,    // 014    0x0E
172
        Char_CtlCharNotWS,    // 015    0x0F
318
        OCLLexersym.Char_CtlCharNotWS,    // 015    0x0F
173
        Char_CtlCharNotWS,    // 016    0x10
319
        OCLLexersym.Char_CtlCharNotWS,    // 016    0x10
174
        Char_CtlCharNotWS,    // 017    0x11
320
        OCLLexersym.Char_CtlCharNotWS,    // 017    0x11
175
        Char_CtlCharNotWS,    // 018    0x12
321
        OCLLexersym.Char_CtlCharNotWS,    // 018    0x12
176
        Char_CtlCharNotWS,    // 019    0x13
322
        OCLLexersym.Char_CtlCharNotWS,    // 019    0x13
177
        Char_CtlCharNotWS,    // 020    0x14
323
        OCLLexersym.Char_CtlCharNotWS,    // 020    0x14
178
        Char_CtlCharNotWS,    // 021    0x15
324
        OCLLexersym.Char_CtlCharNotWS,    // 021    0x15
179
        Char_CtlCharNotWS,    // 022    0x16
325
        OCLLexersym.Char_CtlCharNotWS,    // 022    0x16
180
        Char_CtlCharNotWS,    // 023    0x17
326
        OCLLexersym.Char_CtlCharNotWS,    // 023    0x17
181
        Char_CtlCharNotWS,    // 024    0x18
327
        OCLLexersym.Char_CtlCharNotWS,    // 024    0x18
182
        Char_CtlCharNotWS,    // 025    0x19
328
        OCLLexersym.Char_CtlCharNotWS,    // 025    0x19
183
        Char_CtlCharNotWS,    // 026    0x1A
329
        OCLLexersym.Char_CtlCharNotWS,    // 026    0x1A
184
        Char_CtlCharNotWS,    // 027    0x1B
330
        OCLLexersym.Char_CtlCharNotWS,    // 027    0x1B
185
        Char_CtlCharNotWS,    // 028    0x1C
331
        OCLLexersym.Char_CtlCharNotWS,    // 028    0x1C
186
        Char_CtlCharNotWS,    // 029    0x1D
332
        OCLLexersym.Char_CtlCharNotWS,    // 029    0x1D
187
        Char_CtlCharNotWS,    // 030    0x1E
333
        OCLLexersym.Char_CtlCharNotWS,    // 030    0x1E
188
        Char_CtlCharNotWS,    // 031    0x1F
334
        OCLLexersym.Char_CtlCharNotWS,    // 031    0x1F
189
        Char_Space,           // 032    0x20
335
        OCLLexersym.Char_Space,           // 032    0x20
190
        Char_Exclamation,     // 033    0x21
336
        OCLLexersym.Char_Exclamation,     // 033    0x21
191
        Char_DoubleQuote,     // 034    0x22
337
        OCLLexersym.Char_DoubleQuote,     // 034    0x22
192
        Char_Sharp,           // 035    0x23
338
        OCLLexersym.Char_Sharp,           // 035    0x23
193
        Char_DollarSign,      // 036    0x24
339
        OCLLexersym.Char_DollarSign,      // 036    0x24
194
        Char_Percent,         // 037    0x25
340
        OCLLexersym.Char_Percent,         // 037    0x25
195
        Char_Ampersand,       // 038    0x26
341
        OCLLexersym.Char_Ampersand,       // 038    0x26
196
        Char_SingleQuote,     // 039    0x27
342
        OCLLexersym.Char_SingleQuote,     // 039    0x27
197
        Char_LeftParen,       // 040    0x28
343
        OCLLexersym.Char_LeftParen,       // 040    0x28
198
        Char_RightParen,      // 041    0x29
344
        OCLLexersym.Char_RightParen,      // 041    0x29
199
        Char_Star,            // 042    0x2A
345
        OCLLexersym.Char_Star,            // 042    0x2A
200
        Char_Plus,            // 043    0x2B
346
        OCLLexersym.Char_Plus,            // 043    0x2B
201
        Char_Comma,           // 044    0x2C
347
        OCLLexersym.Char_Comma,           // 044    0x2C
202
        Char_Minus,           // 045    0x2D
348
        OCLLexersym.Char_Minus,           // 045    0x2D
203
        Char_Dot,             // 046    0x2E
349
        OCLLexersym.Char_Dot,             // 046    0x2E
204
        Char_Slash,           // 047    0x2F
350
        OCLLexersym.Char_Slash,           // 047    0x2F
205
        Char_0,               // 048    0x30
351
        OCLLexersym.Char_0,               // 048    0x30
206
        Char_1,               // 049    0x31
352
        OCLLexersym.Char_1,               // 049    0x31
207
        Char_2,               // 050    0x32
353
        OCLLexersym.Char_2,               // 050    0x32
208
        Char_3,               // 051    0x33
354
        OCLLexersym.Char_3,               // 051    0x33
209
        Char_4,               // 052    0x34
355
        OCLLexersym.Char_4,               // 052    0x34
210
        Char_5,               // 053    0x35
356
        OCLLexersym.Char_5,               // 053    0x35
211
        Char_6,               // 054    0x36
357
        OCLLexersym.Char_6,               // 054    0x36
212
        Char_7,               // 055    0x37
358
        OCLLexersym.Char_7,               // 055    0x37
213
        Char_8,               // 056    0x38
359
        OCLLexersym.Char_8,               // 056    0x38
214
        Char_9,               // 057    0x39
360
        OCLLexersym.Char_9,               // 057    0x39
215
        Char_Colon,           // 058    0x3A
361
        OCLLexersym.Char_Colon,           // 058    0x3A
216
        Char_SemiColon,       // 059    0x3B
362
        OCLLexersym.Char_SemiColon,       // 059    0x3B
217
        Char_LessThan,        // 060    0x3C
363
        OCLLexersym.Char_LessThan,        // 060    0x3C
218
        Char_Equal,           // 061    0x3D
364
        OCLLexersym.Char_Equal,           // 061    0x3D
219
        Char_GreaterThan,     // 062    0x3E
365
        OCLLexersym.Char_GreaterThan,     // 062    0x3E
220
        Char_QuestionMark,    // 063    0x3F
366
        OCLLexersym.Char_QuestionMark,    // 063    0x3F
221
        Char_AtSign,          // 064    0x40
367
        OCLLexersym.Char_AtSign,          // 064    0x40
222
        Char_A,               // 065    0x41
368
        OCLLexersym.Char_A,               // 065    0x41
223
        Char_B,               // 066    0x42
369
        OCLLexersym.Char_B,               // 066    0x42
224
        Char_C,               // 067    0x43
370
        OCLLexersym.Char_C,               // 067    0x43
225
        Char_D,               // 068    0x44
371
        OCLLexersym.Char_D,               // 068    0x44
226
        Char_E,               // 069    0x45
372
        OCLLexersym.Char_E,               // 069    0x45
227
        Char_F,               // 070    0x46
373
        OCLLexersym.Char_F,               // 070    0x46
228
        Char_G,               // 071    0x47
374
        OCLLexersym.Char_G,               // 071    0x47
229
        Char_H,               // 072    0x48
375
        OCLLexersym.Char_H,               // 072    0x48
230
        Char_I,               // 073    0x49
376
        OCLLexersym.Char_I,               // 073    0x49
231
        Char_J,               // 074    0x4A
377
        OCLLexersym.Char_J,               // 074    0x4A
232
        Char_K,               // 075    0x4B
378
        OCLLexersym.Char_K,               // 075    0x4B
233
        Char_L,               // 076    0x4C
379
        OCLLexersym.Char_L,               // 076    0x4C
234
        Char_M,               // 077    0x4D
380
        OCLLexersym.Char_M,               // 077    0x4D
235
        Char_N,               // 078    0x4E
381
        OCLLexersym.Char_N,               // 078    0x4E
236
        Char_O,               // 079    0x4F
382
        OCLLexersym.Char_O,               // 079    0x4F
237
        Char_P,               // 080    0x50
383
        OCLLexersym.Char_P,               // 080    0x50
238
        Char_Q,               // 081    0x51
384
        OCLLexersym.Char_Q,               // 081    0x51
239
        Char_R,               // 082    0x52
385
        OCLLexersym.Char_R,               // 082    0x52
240
        Char_S,               // 083    0x53
386
        OCLLexersym.Char_S,               // 083    0x53
241
        Char_T,               // 084    0x54
387
        OCLLexersym.Char_T,               // 084    0x54
242
        Char_U,               // 085    0x55
388
        OCLLexersym.Char_U,               // 085    0x55
243
        Char_V,               // 086    0x56
389
        OCLLexersym.Char_V,               // 086    0x56
244
        Char_W,               // 087    0x57
390
        OCLLexersym.Char_W,               // 087    0x57
245
        Char_X,               // 088    0x58
391
        OCLLexersym.Char_X,               // 088    0x58
246
        Char_Y,               // 089    0x59
392
        OCLLexersym.Char_Y,               // 089    0x59
247
        Char_Z,               // 090    0x5A
393
        OCLLexersym.Char_Z,               // 090    0x5A
248
        Char_LeftBracket,     // 091    0x5B
394
        OCLLexersym.Char_LeftBracket,     // 091    0x5B
249
        Char_BackSlash,       // 092    0x5C
395
        OCLLexersym.Char_BackSlash,       // 092    0x5C
250
        Char_RightBracket,    // 093    0x5D
396
        OCLLexersym.Char_RightBracket,    // 093    0x5D
251
        Char_Caret,           // 094    0x5E
397
        OCLLexersym.Char_Caret,           // 094    0x5E
252
        Char__,               // 095    0x5F
398
        OCLLexersym.Char__,               // 095    0x5F
253
        Char_BackQuote,       // 096    0x60
399
        OCLLexersym.Char_BackQuote,       // 096    0x60
254
        Char_a,               // 097    0x61
400
        OCLLexersym.Char_a,               // 097    0x61
255
        Char_b,               // 098    0x62
401
        OCLLexersym.Char_b,               // 098    0x62
256
        Char_c,               // 099    0x63
402
        OCLLexersym.Char_c,               // 099    0x63
257
        Char_d,               // 100    0x64
403
        OCLLexersym.Char_d,               // 100    0x64
258
        Char_e,               // 101    0x65
404
        OCLLexersym.Char_e,               // 101    0x65
259
        Char_f,               // 102    0x66
405
        OCLLexersym.Char_f,               // 102    0x66
260
        Char_g,               // 103    0x67
406
        OCLLexersym.Char_g,               // 103    0x67
261
        Char_h,               // 104    0x68
407
        OCLLexersym.Char_h,               // 104    0x68
262
        Char_i,               // 105    0x69
408
        OCLLexersym.Char_i,               // 105    0x69
263
        Char_j,               // 106    0x6A
409
        OCLLexersym.Char_j,               // 106    0x6A
264
        Char_k,               // 107    0x6B
410
        OCLLexersym.Char_k,               // 107    0x6B
265
        Char_l,               // 108    0x6C
411
        OCLLexersym.Char_l,               // 108    0x6C
266
        Char_m,               // 109    0x6D
412
        OCLLexersym.Char_m,               // 109    0x6D
267
        Char_n,               // 110    0x6E
413
        OCLLexersym.Char_n,               // 110    0x6E
268
        Char_o,               // 111    0x6F
414
        OCLLexersym.Char_o,               // 111    0x6F
269
        Char_p,               // 112    0x70
415
        OCLLexersym.Char_p,               // 112    0x70
270
        Char_q,               // 113    0x71
416
        OCLLexersym.Char_q,               // 113    0x71
271
        Char_r,               // 114    0x72
417
        OCLLexersym.Char_r,               // 114    0x72
272
        Char_s,               // 115    0x73
418
        OCLLexersym.Char_s,               // 115    0x73
273
        Char_t,               // 116    0x74
419
        OCLLexersym.Char_t,               // 116    0x74
274
        Char_u,               // 117    0x75
420
        OCLLexersym.Char_u,               // 117    0x75
275
        Char_v,               // 118    0x76
421
        OCLLexersym.Char_v,               // 118    0x76
276
        Char_w,               // 119    0x77
422
        OCLLexersym.Char_w,               // 119    0x77
277
        Char_x,               // 120    0x78
423
        OCLLexersym.Char_x,               // 120    0x78
278
        Char_y,               // 121    0x79
424
        OCLLexersym.Char_y,               // 121    0x79
279
        Char_z,               // 122    0x7A
425
        OCLLexersym.Char_z,               // 122    0x7A
280
        Char_LeftBrace,       // 123    0x7B
426
        OCLLexersym.Char_LeftBrace,       // 123    0x7B
281
        Char_VerticalBar,     // 124    0x7C
427
        OCLLexersym.Char_VerticalBar,     // 124    0x7C
282
        Char_RightBrace,      // 125    0x7D
428
        OCLLexersym.Char_RightBrace,      // 125    0x7D
283
        Char_Tilde,           // 126    0x7E
429
        OCLLexersym.Char_Tilde,           // 126    0x7E
284
        Char_CtlCharNotWS,    // 127    0x7F
430
        OCLLexersym.Char_CtlCharNotWS,    // 127    0x7F
285
431
286
        Char_Acute,           // for the acute accent 0xb4
432
        OCLLexersym.Char_Acute,           // for the acute accent 0xb4
287
        Char_AfterASCIINotAcute,  // for all chars in range 0x80..0xfffe excluding the acute accent
433
        OCLLexersym.Char_AfterASCIINotAcute,      // for all chars in range 0x80..0xfffe excluding the acute accent
288
        Char_EOF              // for '\uffff' or 65535 
434
        OCLLexersym.Char_EOF              // for '\uffff' or 65535 
289
    };
435
    };
290
            
436
            
291
    @Override public final int getKind(int i)  // Classify character at ith location
437
    public final int getKind(int i)  // Classify character at ith location
292
    {
438
    {
293
        char c = (i >= getStreamLength() ? '\uffff' : getCharValue(i));
439
        char c = (i >= getStreamLength() ? '\uffff' : getCharValue(i));
294
        return (c < 128)? // ASCII Character
440
        return (c < 128) // ASCII Character
295
                  tokenKind[c] :
441
                  ? tokenKind[c] 
296
                  (c == '\uffff')?
442
                  : (c == '\uffff')
297
                       Char_EOF :
443
                      ?OCLLexersym.Char_EOF
298
                       (c == '\u00b4')?
444
                      : (c == '\u00b4')
299
                       Char_Acute :
445
                            ? OCLLexersym.Char_EOF
300
                           Char_AfterASCIINotAcute;
446
                            : OCLLexersym.Char_AfterASCIINotAcute;
447
    }
448
449
    public String[] orderedExportedSymbols() { return OCLParsersym.orderedTerminalSymbols; }
450
451
    public OCLLexerStream(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, String filename, int tab) throws java.io.IOException
452
    {
453
        super(OCLUtil.getAdapter(environment, BasicEnvironment.class), filename, tab);
454
    }
455
456
    public OCLLexerStream(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, char[] input_chars, String filename, int tab)
457
    {
458
        super(OCLUtil.getAdapter(environment, BasicEnvironment.class), input_chars, filename, tab);
459
    }
460
461
    public OCLLexerStream(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, char[] input_chars, String filename)
462
    {
463
        super(OCLUtil.getAdapter(environment, BasicEnvironment.class), input_chars, filename, 1);
464
    }
301
    }
465
    }
302
466
303
    public void ruleAction( int ruleNumber)
467
    public void ruleAction(int ruleNumber)
304
    {
468
    {
305
        switch(ruleNumber)
469
        switch(ruleNumber)
306
        {
470
        {
307
 
471
308
            //
472
            //
309
            // Rule 1:  Token ::= Identifier
473
            // Rule 1:  Token ::= Identifier
310
            //
474
            //
311
            case 1: { 
475
            case 1: { 
312
				checkForKeyWord();
476
				checkForKeyWord();
313
	            break;
477
	              break;
314
            }
478
            }
315
	 
479
	
316
            //
480
            //
317
            // Rule 2:  Token ::= EscapedSQ
481
            // Rule 2:  Token ::= EscapedSQ
318
            //
482
            //
319
            case 2: { 
483
            case 2: { 
320
				makeToken(TK_STRING_LITERAL);
484
				makeToken(OCLParsersym.TK_STRING_LITERAL);
321
	            break;
485
	              break;
322
            }
486
            }
323
	 
487
	
324
            //
488
            //
325
            // Rule 3:  Token ::= SingleQuote SLNotSQ SingleQuote
489
            // Rule 3:  Token ::= SingleQuote SLNotSQ SingleQuote
326
            //
490
            //
327
            case 3: { 
491
            case 3: { 
328
				makeToken(TK_STRING_LITERAL);
492
				makeToken(OCLParsersym.TK_STRING_LITERAL);
329
	            break;
493
	              break;
330
            }
494
            }
331
	 
495
	
332
            //
496
            //
333
            // Rule 4:  Token ::= Acute SLNotSQOpt Acute
497
            // Rule 4:  Token ::= Acute SLNotSQOpt Acute
334
            //
498
            //
335
            case 4: { 
499
            case 4: { 
336
				makeToken(TK_STRING_LITERAL);
500
				makeToken(OCLParsersym.TK_STRING_LITERAL);
337
	            break;
501
	              break;
338
            }
502
            }
339
	 
503
	
340
            //
504
            //
341
            // Rule 5:  Token ::= BackQuote SLNotSQOpt Acute
505
            // Rule 5:  Token ::= BackQuote SLNotSQOpt Acute
342
            //
506
            //
343
            case 5: { 
507
            case 5: { 
344
				makeToken(TK_STRING_LITERAL);
508
				makeToken(OCLParsersym.TK_STRING_LITERAL);
345
	            break;
509
	              break;
346
            }
510
            }
347
	 
511
	
348
            //
512
            //
349
            // Rule 6:  Token ::= IntegerLiteral
513
            // Rule 6:  Token ::= IntegerLiteral
350
            //
514
            //
351
            case 6: { 
515
            case 6: { 
352
				makeToken(TK_INTEGER_LITERAL);
516
				makeToken(OCLParsersym.TK_INTEGER_LITERAL);
353
	            break;
517
	              break;
354
            }
518
            }
355
	 
519
	
356
            //
520
            //
357
            // Rule 7:  Token ::= RealLiteral
521
            // Rule 7:  Token ::= RealLiteral
358
            //
522
            //
359
            case 7: { 
523
            case 7: { 
360
				makeToken(TK_REAL_LITERAL);
524
				makeToken(OCLParsersym.TK_REAL_LITERAL);
361
	            break;
525
	              break;
362
            }
526
            }
363
	 
527
	
364
            //
528
            //
365
            // Rule 8:  Token ::= NumericOperation
529
            // Rule 8:  Token ::= NumericOperation
366
            //
530
            //
367
            case 8: { 
531
            case 8: { 
368
				makeToken(TK_NUMERIC_OPERATION);
532
				makeToken(OCLParsersym.TK_NUMERIC_OPERATION);
369
	            break;
533
	              break;
370
            }
534
            }
371
	 
535
	
372
            //
536
            //
373
            // Rule 9:  Token ::= IntegerRangeStart
537
            // Rule 9:  Token ::= IntegerRangeStart
374
            //
538
            //
375
            case 9: { 
539
            case 9: { 
376
				makeToken(TK_INTEGER_RANGE_START);
540
				makeToken(OCLParsersym.TK_INTEGER_RANGE_START);
377
	            break;
541
	              break;
378
            }
542
            }
379
	 
543
	
380
            //
544
            //
381
            // Rule 10:  Token ::= SLC
545
            // Rule 10:  Token ::= SLC
382
            //
546
            //
383
            case 10: { 
547
            case 10: { 
384
				makeComment(TK_SINGLE_LINE_COMMENT);
548
				makeComment(OCLParsersym.TK_SINGLE_LINE_COMMENT);
385
	            break;
549
	              break;
386
            }
550
            }
387
	 
551
	
388
            //
552
            //
389
            // Rule 11:  Token ::= / * Inside Stars /
553
            // Rule 11:  Token ::= / * Inside Stars /
390
            //
554
            //
391
            case 11: { 
555
            case 11: { 
392
                makeComment(TK_MULTI_LINE_COMMENT);
556
                makeComment(OCLParsersym.TK_MULTI_LINE_COMMENT);
393
                break;
557
                  break;
394
            }
558
            }
395
     
559
    
396
            //
560
            //
397
            // Rule 12:  Token ::= WS
561
            // Rule 12:  Token ::= WS
398
            //
562
            //
399
            case 12: { 
563
            case 12: { 
400
				skipToken();
564
				skipToken();
401
	            break;
565
	              break;
402
            }
566
            }
403
	 
567
	
404
            //
568
            //
405
            // Rule 13:  Token ::= +
569
            // Rule 13:  Token ::= +
406
            //
570
            //
407
            case 13: { 
571
            case 13: { 
408
				makeToken(TK_PLUS);
572
				makeToken(OCLParsersym.TK_PLUS);
409
	            break;
573
	              break;
410
            }
574
            }
411
	 
575
	
412
            //
576
            //
413
            // Rule 14:  Token ::= -
577
            // Rule 14:  Token ::= -
414
            //
578
            //
415
            case 14: { 
579
            case 14: { 
416
				makeToken(TK_MINUS);
580
				makeToken(OCLParsersym.TK_MINUS);
417
	            break;
581
	              break;
418
            }
582
            }
419
	 
583
	
420
            //
584
            //
421
            // Rule 15:  Token ::= *
585
            // Rule 15:  Token ::= *
422
            //
586
            //
423
            case 15: { 
587
            case 15: { 
424
				makeToken(TK_MULTIPLY);
588
				makeToken(OCLParsersym.TK_MULTIPLY);
425
	            break;
589
	              break;
426
            }
590
            }
427
	 
591
	
428
            //
592
            //
429
            // Rule 16:  Token ::= /
593
            // Rule 16:  Token ::= /
430
            //
594
            //
431
            case 16: { 
595
            case 16: { 
432
				makeToken(TK_DIVIDE);
596
				makeToken(OCLParsersym.TK_DIVIDE);
433
	            break;
597
	              break;
434
            }
598
            }
435
	 
599
	
436
            //
600
            //
437
            // Rule 17:  Token ::= (
601
            // Rule 17:  Token ::= (
438
            //
602
            //
439
            case 17: { 
603
            case 17: { 
440
				makeToken(TK_LPAREN);
604
				makeToken(OCLParsersym.TK_LPAREN);
441
	            break;
605
	              break;
442
            }
606
            }
443
	 
607
	
444
            //
608
            //
445
            // Rule 18:  Token ::= )
609
            // Rule 18:  Token ::= )
446
            //
610
            //
447
            case 18: { 
611
            case 18: { 
448
				makeToken(TK_RPAREN);
612
				makeToken(OCLParsersym.TK_RPAREN);
449
	            break;
613
	              break;
450
            }
614
            }
451
	 
615
	
452
            //
616
            //
453
            // Rule 19:  Token ::= >
617
            // Rule 19:  Token ::= >
454
            //
618
            //
455
            case 19: { 
619
            case 19: { 
456
				makeToken(TK_GREATER);
620
				makeToken(OCLParsersym.TK_GREATER);
457
	            break;
621
	              break;
458
            }
622
            }
459
	 
623
	
460
            //
624
            //
461
            // Rule 20:  Token ::= <
625
            // Rule 20:  Token ::= <
462
            //
626
            //
463
            case 20: { 
627
            case 20: { 
464
				makeToken(TK_LESS);
628
				makeToken(OCLParsersym.TK_LESS);
465
	            break;
629
	              break;
466
            }
630
            }
467
	 
631
	
468
            //
632
            //
469
            // Rule 21:  Token ::= =
633
            // Rule 21:  Token ::= =
470
            //
634
            //
471
            case 21: { 
635
            case 21: { 
472
				makeToken(TK_EQUAL);
636
				makeToken(OCLParsersym.TK_EQUAL);
473
	            break;
637
	              break;
474
            }
638
            }
475
	 
639
	
476
            //
640
            //
477
            // Rule 22:  Token ::= > =
641
            // Rule 22:  Token ::= > =
478
            //
642
            //
479
            case 22: { 
643
            case 22: { 
480
				makeToken(TK_GREATER_EQUAL);
644
				makeToken(OCLParsersym.TK_GREATER_EQUAL);
481
	            break;
645
	              break;
482
            }
646
            }
483
	 
647
	
484
            //
648
            //
485
            // Rule 23:  Token ::= < =
649
            // Rule 23:  Token ::= < =
486
            //
650
            //
487
            case 23: { 
651
            case 23: { 
488
				makeToken(TK_LESS_EQUAL);
652
				makeToken(OCLParsersym.TK_LESS_EQUAL);
489
	            break;
653
	              break;
490
            }
654
            }
491
	 
655
	
492
            //
656
            //
493
            // Rule 24:  Token ::= < >
657
            // Rule 24:  Token ::= < >
494
            //
658
            //
495
            case 24: { 
659
            case 24: { 
496
				makeToken(TK_NOT_EQUAL);
660
				makeToken(OCLParsersym.TK_NOT_EQUAL);
497
	            break;
661
	              break;
498
            }
662
            }
499
	 
663
	
500
            //
664
            //
501
            // Rule 25:  Token ::= [
665
            // Rule 25:  Token ::= [
502
            //
666
            //
503
            case 25: { 
667
            case 25: { 
504
				makeToken(TK_LBRACKET);
668
				makeToken(OCLParsersym.TK_LBRACKET);
505
	            break;
669
	              break;
506
            }
670
            }
507
	 
671
	
508
            //
672
            //
509
            // Rule 26:  Token ::= ]
673
            // Rule 26:  Token ::= ]
510
            //
674
            //
511
            case 26: { 
675
            case 26: { 
512
				makeToken(TK_RBRACKET);
676
				makeToken(OCLParsersym.TK_RBRACKET);
513
	            break;
677
	              break;
514
            }
678
            }
515
	 
679
	
516
            //
680
            //
517
            // Rule 27:  Token ::= {
681
            // Rule 27:  Token ::= {
518
            //
682
            //
519
            case 27: { 
683
            case 27: { 
520
				makeToken(TK_LBRACE);
684
				makeToken(OCLParsersym.TK_LBRACE);
521
	            break;
685
	              break;
522
            }
686
            }
523
	 
687
	
524
            //
688
            //
525
            // Rule 28:  Token ::= }
689
            // Rule 28:  Token ::= }
526
            //
690
            //
527
            case 28: { 
691
            case 28: { 
528
				makeToken(TK_RBRACE);
692
				makeToken(OCLParsersym.TK_RBRACE);
529
	            break;
693
	              break;
530
            }
694
            }
531
	 
695
	
532
            //
696
            //
533
            // Rule 29:  Token ::= - >
697
            // Rule 29:  Token ::= - >
534
            //
698
            //
535
            case 29: { 
699
            case 29: { 
536
				makeToken(TK_ARROW);
700
				makeToken(OCLParsersym.TK_ARROW);
537
	            break;
701
	              break;
538
            }
702
            }
539
	 
703
	
540
            //
704
            //
541
            // Rule 30:  Token ::= |
705
            // Rule 30:  Token ::= |
542
            //
706
            //
543
            case 30: { 
707
            case 30: { 
544
				makeToken(TK_BAR);
708
				makeToken(OCLParsersym.TK_BAR);
545
	            break;
709
	              break;
546
            }
710
            }
547
	 
711
	
548
            //
712
            //
549
            // Rule 31:  Token ::= ,
713
            // Rule 31:  Token ::= ,
550
            //
714
            //
551
            case 31: { 
715
            case 31: { 
552
				makeToken(TK_COMMA);
716
				makeToken(OCLParsersym.TK_COMMA);
553
	            break;
717
	              break;
554
            }
718
            }
555
	 
719
	
556
            //
720
            //
557
            // Rule 32:  Token ::= :
721
            // Rule 32:  Token ::= :
558
            //
722
            //
559
            case 32: { 
723
            case 32: { 
560
				makeToken(TK_COLON);
724
				makeToken(OCLParsersym.TK_COLON);
561
	            break;
725
	              break;
562
            }
726
            }
563
	 
727
	
564
            //
728
            //
565
            // Rule 33:  Token ::= : :
729
            // Rule 33:  Token ::= : :
566
            //
730
            //
567
            case 33: { 
731
            case 33: { 
568
				makeToken(TK_COLONCOLON);
732
				makeToken(OCLParsersym.TK_COLONCOLON);
569
	            break;
733
	              break;
570
            }
734
            }
571
	 
735
	
572
            //
736
            //
573
            // Rule 34:  Token ::= ;
737
            // Rule 34:  Token ::= ;
574
            //
738
            //
575
            case 34: { 
739
            case 34: { 
576
				makeToken(TK_SEMICOLON);
740
				makeToken(OCLParsersym.TK_SEMICOLON);
577
	            break;
741
	              break;
578
            }
742
            }
579
	 
743
	
580
            //
744
            //
581
            // Rule 35:  Token ::= .
745
            // Rule 35:  Token ::= .
582
            //
746
            //
583
            case 35: { 
747
            case 35: { 
584
				makeToken(TK_DOT);
748
				makeToken(OCLParsersym.TK_DOT);
585
	            break;
749
	              break;
586
            }
750
            }
587
	 
751
	
588
            //
752
            //
589
            // Rule 36:  Token ::= . .
753
            // Rule 36:  Token ::= . .
590
            //
754
            //
591
            case 36: { 
755
            case 36: { 
592
				makeToken(TK_DOTDOT);
756
				makeToken(OCLParsersym.TK_DOTDOT);
593
	            break;
757
	              break;
594
            }
758
            }
595
	 
759
	
596
            //
760
            //
597
            // Rule 37:  Token ::= @ p r e
761
            // Rule 37:  Token ::= @ p r e
598
            //
762
            //
599
            case 37: { 
763
            case 37: { 
600
				makeToken(TK_ATPRE);
764
				makeToken(OCLParsersym.TK_ATPRE);
601
	            break;
765
	              break;
602
            }
766
            }
603
	 
767
	
604
            //
768
            //
605
            // Rule 38:  Token ::= ^
769
            // Rule 38:  Token ::= ^
606
            //
770
            //
607
            case 38: { 
771
            case 38: { 
608
				makeToken(TK_CARET);
772
				makeToken(OCLParsersym.TK_CARET);
609
	            break;
773
	              break;
610
            }
774
            }
611
	 
775
	
612
            //
776
            //
613
            // Rule 39:  Token ::= ^ ^
777
            // Rule 39:  Token ::= ^ ^
614
            //
778
            //
615
            case 39: { 
779
            case 39: { 
616
				makeToken(TK_CARETCARET);
780
				makeToken(OCLParsersym.TK_CARETCARET);
617
	            break;
781
	              break;
618
            }
782
            }
619
	 
783
	
620
            //
784
            //
621
            // Rule 40:  Token ::= ?
785
            // Rule 40:  Token ::= ?
622
            //
786
            //
623
            case 40: { 
787
            case 40: { 
624
				makeToken(TK_QUESTIONMARK);
788
				makeToken(OCLParsersym.TK_QUESTIONMARK);
625
	            break;
789
	              break;
626
            }
790
            }
627
	
791
	
628
    
792
    
(-)src/org/eclipse/ocl/types/impl/MessageTypeImpl.java (-1 / +2 lines)
Lines 18-26 Link Here
18
package org.eclipse.ocl.types.impl;
18
package org.eclipse.ocl.types.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.notify.Notification;
22
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.common.util.BasicEList;
23
import org.eclipse.emf.common.util.BasicEList;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.ECollections;
25
import org.eclipse.emf.common.util.ECollections;
25
import org.eclipse.emf.common.util.EList;
26
import org.eclipse.emf.common.util.EList;
26
import org.eclipse.emf.ecore.EClass;
27
import org.eclipse.emf.ecore.EClass;
(-)src/org/eclipse/ocl/types/impl/TypesFactoryImpl.java (-2 lines)
Lines 25-32 Link Here
25
import org.eclipse.emf.ecore.EPackage;
25
import org.eclipse.emf.ecore.EPackage;
26
import org.eclipse.emf.ecore.impl.EFactoryImpl;
26
import org.eclipse.emf.ecore.impl.EFactoryImpl;
27
import org.eclipse.emf.ecore.plugin.EcorePlugin;
27
import org.eclipse.emf.ecore.plugin.EcorePlugin;
28
29
//import org.eclipse.ocl.types.*;
30
import org.eclipse.ocl.Environment;
28
import org.eclipse.ocl.Environment;
31
import org.eclipse.ocl.expressions.CollectionKind;
29
import org.eclipse.ocl.expressions.CollectionKind;
32
import org.eclipse.ocl.types.AnyType;
30
import org.eclipse.ocl.types.AnyType;
(-)src/org/eclipse/ocl/types/impl/SetTypeImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.types.impl;
18
package org.eclipse.ocl.types.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.ocl.expressions.CollectionKind;
24
import org.eclipse.ocl.expressions.CollectionKind;
(-)src/org/eclipse/ocl/types/impl/AnyTypeImpl.java (-2 lines)
Lines 24-31 Link Here
24
import org.eclipse.ocl.Environment;
24
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.types.AnyType;
25
import org.eclipse.ocl.types.AnyType;
26
import org.eclipse.ocl.types.TypesPackage;
26
import org.eclipse.ocl.types.TypesPackage;
27
28
//import org.eclipse.ocl.types.operations.AnyTypeOperations;
29
import org.eclipse.ocl.util.OCLStandardLibraryUtil;
27
import org.eclipse.ocl.util.OCLStandardLibraryUtil;
30
28
31
/**
29
/**
(-)src/org/eclipse/ocl/types/impl/TypeTypeImpl.java (-2 lines)
Lines 28-35 Link Here
28
import org.eclipse.ocl.Environment;
28
import org.eclipse.ocl.Environment;
29
import org.eclipse.ocl.types.TypeType;
29
import org.eclipse.ocl.types.TypeType;
30
import org.eclipse.ocl.types.TypesPackage;
30
import org.eclipse.ocl.types.TypesPackage;
31
32
//import org.eclipse.ocl.types.operations.TypeTypeOperations;
33
import org.eclipse.ocl.util.OCLStandardLibraryUtil;
31
import org.eclipse.ocl.util.OCLStandardLibraryUtil;
34
32
35
/**
33
/**
(-)src/org/eclipse/ocl/types/impl/OrderedSetTypeImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.types.impl;
18
package org.eclipse.ocl.types.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.ocl.expressions.CollectionKind;
24
import org.eclipse.ocl.expressions.CollectionKind;
(-)src/org/eclipse/ocl/types/impl/BagTypeImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.types.impl;
18
package org.eclipse.ocl.types.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.ocl.expressions.CollectionKind;
24
import org.eclipse.ocl.expressions.CollectionKind;
(-)src/org/eclipse/ocl/types/impl/SequenceTypeImpl.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.types.impl;
18
package org.eclipse.ocl.types.impl;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.ocl.expressions.CollectionKind;
24
import org.eclipse.ocl.expressions.CollectionKind;
(-)src/org/eclipse/ocl/types/impl/TupleTypeImpl.java (-2 / +2 lines)
Lines 17-27 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.types.impl;
18
package org.eclipse.ocl.types.impl;
19
19
20
import java.util.Map;
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import java.util.Iterator;
20
import java.util.Iterator;
21
import java.util.Map;
23
22
24
import org.eclipse.emf.common.util.BasicEList;
23
import org.eclipse.emf.common.util.BasicEList;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
import org.eclipse.emf.common.util.EList;
25
import org.eclipse.emf.common.util.EList;
26
import org.eclipse.emf.ecore.EClass;
26
import org.eclipse.emf.ecore.EClass;
27
import org.eclipse.emf.ecore.impl.EObjectImpl;
27
import org.eclipse.emf.ecore.impl.EObjectImpl;
(-)src/org/eclipse/ocl/types/impl/CollectionTypeImpl.java (-2 / +2 lines)
Lines 17-28 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.types.impl;
18
package org.eclipse.ocl.types.impl;
19
19
20
import java.util.Map;
21
import java.util.List;
20
import java.util.List;
21
import java.util.Map;
22
22
23
import org.eclipse.emf.common.notify.Notification;
23
import org.eclipse.emf.common.notify.Notification;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
import org.eclipse.emf.common.util.BasicEList;
24
import org.eclipse.emf.common.util.BasicEList;
25
import org.eclipse.emf.common.util.DiagnosticChain;
26
import org.eclipse.emf.common.util.EList;
26
import org.eclipse.emf.common.util.EList;
27
import org.eclipse.emf.ecore.EClass;
27
import org.eclipse.emf.ecore.EClass;
28
import org.eclipse.emf.ecore.EObject;
28
import org.eclipse.emf.ecore.EObject;
(-)src/org/eclipse/ocl/types/impl/VoidTypeImpl.java (-2 lines)
Lines 24-31 Link Here
24
import org.eclipse.ocl.Environment;
24
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.types.TypesPackage;
25
import org.eclipse.ocl.types.TypesPackage;
26
import org.eclipse.ocl.types.VoidType;
26
import org.eclipse.ocl.types.VoidType;
27
28
//import org.eclipse.ocl.types.operations.VoidTypeOperations;
29
import org.eclipse.ocl.util.OCLStandardLibraryUtil;
27
import org.eclipse.ocl.util.OCLStandardLibraryUtil;
30
28
31
/**
29
/**
(-)src/org/eclipse/ocl/types/impl/InvalidTypeImpl.java (-2 lines)
Lines 24-31 Link Here
24
import org.eclipse.ocl.Environment;
24
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.types.InvalidType;
25
import org.eclipse.ocl.types.InvalidType;
26
import org.eclipse.ocl.types.TypesPackage;
26
import org.eclipse.ocl.types.TypesPackage;
27
28
//import org.eclipse.ocl.types.operations.InvalidTypeOperations;
29
import org.eclipse.ocl.util.OCLStandardLibraryUtil;
27
import org.eclipse.ocl.util.OCLStandardLibraryUtil;
30
28
31
/**
29
/**
(-)src/org/eclipse/ocl/expressions/operations/BooleanLiteralExpOperations.java (-2 lines)
Lines 22-31 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.expressions.BooleanLiteralExp;
26
import org.eclipse.ocl.expressions.BooleanLiteralExp;
28
29
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
27
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
30
import org.eclipse.ocl.internal.l10n.OCLMessages;
28
import org.eclipse.ocl.internal.l10n.OCLMessages;
31
import org.eclipse.ocl.util.OCLUtil;
29
import org.eclipse.ocl.util.OCLUtil;
(-)src/org/eclipse/ocl/expressions/operations/IterateExpOperations.java (-2 lines)
Lines 22-33 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.expressions.IterateExp;
26
import org.eclipse.ocl.expressions.IterateExp;
28
import org.eclipse.ocl.expressions.OCLExpression;
27
import org.eclipse.ocl.expressions.OCLExpression;
29
import org.eclipse.ocl.expressions.Variable;
28
import org.eclipse.ocl.expressions.Variable;
30
31
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
29
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
32
import org.eclipse.ocl.internal.l10n.OCLMessages;
30
import org.eclipse.ocl.internal.l10n.OCLMessages;
33
import org.eclipse.ocl.util.OCLUtil;
31
import org.eclipse.ocl.util.OCLUtil;
(-)src/org/eclipse/ocl/expressions/operations/IfExpOperations.java (-2 lines)
Lines 22-32 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.expressions.IfExp;
26
import org.eclipse.ocl.expressions.IfExp;
28
import org.eclipse.ocl.expressions.OCLExpression;
27
import org.eclipse.ocl.expressions.OCLExpression;
29
30
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
28
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
31
import org.eclipse.ocl.internal.l10n.OCLMessages;
29
import org.eclipse.ocl.internal.l10n.OCLMessages;
32
import org.eclipse.ocl.util.OCLUtil;
30
import org.eclipse.ocl.util.OCLUtil;
(-)src/org/eclipse/ocl/expressions/operations/IteratorExpOperations.java (-2 lines)
Lines 22-32 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.expressions.IteratorExp;
26
import org.eclipse.ocl.expressions.IteratorExp;
28
import org.eclipse.ocl.expressions.OCLExpression;
27
import org.eclipse.ocl.expressions.OCLExpression;
29
30
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
28
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
31
import org.eclipse.ocl.internal.l10n.OCLMessages;
29
import org.eclipse.ocl.internal.l10n.OCLMessages;
32
import org.eclipse.ocl.types.BagType;
30
import org.eclipse.ocl.types.BagType;
(-)src/org/eclipse/ocl/expressions/operations/OCLExpressionOperations.java (-1 lines)
Lines 17-23 Link Here
17
package org.eclipse.ocl.expressions.operations;
17
package org.eclipse.ocl.expressions.operations;
18
18
19
import org.eclipse.ocl.expressions.OCLExpression;
19
import org.eclipse.ocl.expressions.OCLExpression;
20
21
import org.eclipse.ocl.utilities.Visitor;
20
import org.eclipse.ocl.utilities.Visitor;
22
21
23
/**
22
/**
(-)src/org/eclipse/ocl/expressions/operations/VariableExpOperations.java (-2 lines)
Lines 22-32 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.expressions.Variable;
26
import org.eclipse.ocl.expressions.Variable;
28
import org.eclipse.ocl.expressions.VariableExp;
27
import org.eclipse.ocl.expressions.VariableExp;
29
30
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
28
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
31
import org.eclipse.ocl.internal.l10n.OCLMessages;
29
import org.eclipse.ocl.internal.l10n.OCLMessages;
32
import org.eclipse.ocl.util.OCLUtil;
30
import org.eclipse.ocl.util.OCLUtil;
(-)src/org/eclipse/ocl/expressions/operations/CollectionItemOperations.java (-2 lines)
Lines 22-32 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.expressions.CollectionItem;
26
import org.eclipse.ocl.expressions.CollectionItem;
28
import org.eclipse.ocl.expressions.OCLExpression;
27
import org.eclipse.ocl.expressions.OCLExpression;
29
30
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
28
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
31
import org.eclipse.ocl.util.OCLUtil;
29
import org.eclipse.ocl.util.OCLUtil;
32
import org.eclipse.ocl.util.TypeUtil;
30
import org.eclipse.ocl.util.TypeUtil;
(-)src/org/eclipse/ocl/expressions/operations/CollectionLiteralExpOperations.java (-2 lines)
Lines 23-34 Link Here
23
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.BasicDiagnostic;
24
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.Diagnostic;
25
import org.eclipse.emf.common.util.DiagnosticChain;
25
import org.eclipse.emf.common.util.DiagnosticChain;
26
27
import org.eclipse.ocl.Environment;
26
import org.eclipse.ocl.Environment;
28
import org.eclipse.ocl.expressions.CollectionKind;
27
import org.eclipse.ocl.expressions.CollectionKind;
29
import org.eclipse.ocl.expressions.CollectionLiteralExp;
28
import org.eclipse.ocl.expressions.CollectionLiteralExp;
30
import org.eclipse.ocl.expressions.CollectionLiteralPart;
29
import org.eclipse.ocl.expressions.CollectionLiteralPart;
31
32
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
30
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
33
import org.eclipse.ocl.internal.l10n.OCLMessages;
31
import org.eclipse.ocl.internal.l10n.OCLMessages;
34
import org.eclipse.ocl.types.CollectionType;
32
import org.eclipse.ocl.types.CollectionType;
(-)src/org/eclipse/ocl/expressions/operations/PropertyCallExpOperations.java (-2 lines)
Lines 22-32 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.expressions.OCLExpression;
26
import org.eclipse.ocl.expressions.OCLExpression;
28
import org.eclipse.ocl.expressions.PropertyCallExp;
27
import org.eclipse.ocl.expressions.PropertyCallExp;
29
30
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
28
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
31
import org.eclipse.ocl.util.OCLUtil;
29
import org.eclipse.ocl.util.OCLUtil;
32
import org.eclipse.ocl.util.TypeUtil;
30
import org.eclipse.ocl.util.TypeUtil;
(-)src/org/eclipse/ocl/expressions/operations/EnumLiteralExpOperations.java (-2 lines)
Lines 22-31 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.expressions.EnumLiteralExp;
26
import org.eclipse.ocl.expressions.EnumLiteralExp;
28
29
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
27
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
30
import org.eclipse.ocl.internal.l10n.OCLMessages;
28
import org.eclipse.ocl.internal.l10n.OCLMessages;
31
import org.eclipse.ocl.util.OCLUtil;
29
import org.eclipse.ocl.util.OCLUtil;
(-)src/org/eclipse/ocl/expressions/operations/CollectionLiteralPartOperations.java (-1 lines)
Lines 17-23 Link Here
17
package org.eclipse.ocl.expressions.operations;
17
package org.eclipse.ocl.expressions.operations;
18
18
19
import org.eclipse.ocl.expressions.CollectionLiteralPart;
19
import org.eclipse.ocl.expressions.CollectionLiteralPart;
20
21
import org.eclipse.ocl.utilities.Visitor;
20
import org.eclipse.ocl.utilities.Visitor;
22
21
23
/**
22
/**
(-)src/org/eclipse/ocl/expressions/operations/MessageExpOperations.java (-2 lines)
Lines 24-34 Link Here
24
import org.eclipse.emf.common.util.BasicDiagnostic;
24
import org.eclipse.emf.common.util.BasicDiagnostic;
25
import org.eclipse.emf.common.util.Diagnostic;
25
import org.eclipse.emf.common.util.Diagnostic;
26
import org.eclipse.emf.common.util.DiagnosticChain;
26
import org.eclipse.emf.common.util.DiagnosticChain;
27
28
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.Environment;
29
import org.eclipse.ocl.expressions.MessageExp;
28
import org.eclipse.ocl.expressions.MessageExp;
30
import org.eclipse.ocl.expressions.OCLExpression;
29
import org.eclipse.ocl.expressions.OCLExpression;
31
32
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
30
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
33
import org.eclipse.ocl.internal.l10n.OCLMessages;
31
import org.eclipse.ocl.internal.l10n.OCLMessages;
34
import org.eclipse.ocl.types.CollectionType;
32
import org.eclipse.ocl.types.CollectionType;
(-)src/org/eclipse/ocl/expressions/operations/UnlimitedNaturalLiteralExpOperations.java (-2 lines)
Lines 22-31 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp;
26
import org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp;
28
29
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
27
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
30
import org.eclipse.ocl.internal.l10n.OCLMessages;
28
import org.eclipse.ocl.internal.l10n.OCLMessages;
31
import org.eclipse.ocl.util.OCLUtil;
29
import org.eclipse.ocl.util.OCLUtil;
(-)src/org/eclipse/ocl/expressions/operations/IntegerLiteralExpOperations.java (-2 lines)
Lines 22-31 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.expressions.IntegerLiteralExp;
26
import org.eclipse.ocl.expressions.IntegerLiteralExp;
28
29
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
27
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
30
import org.eclipse.ocl.internal.l10n.OCLMessages;
28
import org.eclipse.ocl.internal.l10n.OCLMessages;
31
import org.eclipse.ocl.util.OCLUtil;
29
import org.eclipse.ocl.util.OCLUtil;
(-)src/org/eclipse/ocl/expressions/operations/TupleLiteralExpOperations.java (-2 lines)
Lines 24-34 Link Here
24
import org.eclipse.emf.common.util.BasicDiagnostic;
24
import org.eclipse.emf.common.util.BasicDiagnostic;
25
import org.eclipse.emf.common.util.Diagnostic;
25
import org.eclipse.emf.common.util.Diagnostic;
26
import org.eclipse.emf.common.util.DiagnosticChain;
26
import org.eclipse.emf.common.util.DiagnosticChain;
27
28
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.Environment;
29
import org.eclipse.ocl.expressions.TupleLiteralExp;
28
import org.eclipse.ocl.expressions.TupleLiteralExp;
30
import org.eclipse.ocl.expressions.TupleLiteralPart;
29
import org.eclipse.ocl.expressions.TupleLiteralPart;
31
32
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
30
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
33
import org.eclipse.ocl.internal.l10n.OCLMessages;
31
import org.eclipse.ocl.internal.l10n.OCLMessages;
34
import org.eclipse.ocl.types.TupleType;
32
import org.eclipse.ocl.types.TupleType;
(-)src/org/eclipse/ocl/expressions/operations/LoopExpOperations.java (-2 lines)
Lines 22-33 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.expressions.LoopExp;
26
import org.eclipse.ocl.expressions.LoopExp;
28
import org.eclipse.ocl.expressions.OCLExpression;
27
import org.eclipse.ocl.expressions.OCLExpression;
29
import org.eclipse.ocl.expressions.Variable;
28
import org.eclipse.ocl.expressions.Variable;
30
31
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
29
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
32
import org.eclipse.ocl.internal.l10n.OCLMessages;
30
import org.eclipse.ocl.internal.l10n.OCLMessages;
33
import org.eclipse.ocl.types.CollectionType;
31
import org.eclipse.ocl.types.CollectionType;
(-)src/org/eclipse/ocl/expressions/operations/OperationCallExpOperations.java (-2 lines)
Lines 25-35 Link Here
25
import org.eclipse.emf.common.util.BasicDiagnostic;
25
import org.eclipse.emf.common.util.BasicDiagnostic;
26
import org.eclipse.emf.common.util.Diagnostic;
26
import org.eclipse.emf.common.util.Diagnostic;
27
import org.eclipse.emf.common.util.DiagnosticChain;
27
import org.eclipse.emf.common.util.DiagnosticChain;
28
29
import org.eclipse.ocl.Environment;
28
import org.eclipse.ocl.Environment;
30
import org.eclipse.ocl.expressions.OCLExpression;
29
import org.eclipse.ocl.expressions.OCLExpression;
31
import org.eclipse.ocl.expressions.OperationCallExp;
30
import org.eclipse.ocl.expressions.OperationCallExp;
32
33
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
31
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
34
import org.eclipse.ocl.internal.l10n.OCLMessages;
32
import org.eclipse.ocl.internal.l10n.OCLMessages;
35
import org.eclipse.ocl.util.OCLUtil;
33
import org.eclipse.ocl.util.OCLUtil;
(-)src/org/eclipse/ocl/expressions/operations/RealLiteralExpOperations.java (-2 lines)
Lines 22-31 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.expressions.RealLiteralExp;
26
import org.eclipse.ocl.expressions.RealLiteralExp;
28
29
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
27
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
30
import org.eclipse.ocl.internal.l10n.OCLMessages;
28
import org.eclipse.ocl.internal.l10n.OCLMessages;
31
import org.eclipse.ocl.util.OCLUtil;
29
import org.eclipse.ocl.util.OCLUtil;
(-)src/org/eclipse/ocl/expressions/operations/TupleLiteralPartOperations.java (-3 / +1 lines)
Lines 22-38 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.expressions.OCLExpression;
26
import org.eclipse.ocl.expressions.OCLExpression;
28
import org.eclipse.ocl.expressions.TupleLiteralExp;
27
import org.eclipse.ocl.expressions.TupleLiteralExp;
29
import org.eclipse.ocl.expressions.TupleLiteralPart;
28
import org.eclipse.ocl.expressions.TupleLiteralPart;
30
31
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
29
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
32
import org.eclipse.ocl.utilities.Visitor;
33
import org.eclipse.ocl.internal.l10n.OCLMessages;
30
import org.eclipse.ocl.internal.l10n.OCLMessages;
34
import org.eclipse.ocl.util.OCLUtil;
31
import org.eclipse.ocl.util.OCLUtil;
35
import org.eclipse.ocl.util.TypeUtil;
32
import org.eclipse.ocl.util.TypeUtil;
33
import org.eclipse.ocl.utilities.Visitor;
36
34
37
/**
35
/**
38
 * <!-- begin-user-doc -->
36
 * <!-- begin-user-doc -->
(-)src/org/eclipse/ocl/expressions/operations/VariableOperations.java (-3 / +1 lines)
Lines 22-37 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.expressions.OCLExpression;
26
import org.eclipse.ocl.expressions.OCLExpression;
28
import org.eclipse.ocl.expressions.Variable;
27
import org.eclipse.ocl.expressions.Variable;
29
30
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
28
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
31
import org.eclipse.ocl.utilities.Visitor;
32
import org.eclipse.ocl.internal.l10n.OCLMessages;
29
import org.eclipse.ocl.internal.l10n.OCLMessages;
33
import org.eclipse.ocl.util.OCLUtil;
30
import org.eclipse.ocl.util.OCLUtil;
34
import org.eclipse.ocl.util.TypeUtil;
31
import org.eclipse.ocl.util.TypeUtil;
32
import org.eclipse.ocl.utilities.Visitor;
35
33
36
/**
34
/**
37
 * <!-- begin-user-doc -->
35
 * <!-- begin-user-doc -->
(-)src/org/eclipse/ocl/expressions/operations/LetExpOperations.java (-2 lines)
Lines 22-32 Link Here
22
import org.eclipse.emf.common.util.BasicDiagnostic;
22
import org.eclipse.emf.common.util.BasicDiagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.Diagnostic;
24
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.DiagnosticChain;
25
26
import org.eclipse.ocl.Environment;
25
import org.eclipse.ocl.Environment;
27
import org.eclipse.ocl.expressions.LetExp;
26
import org.eclipse.ocl.expressions.LetExp;
28
import org.eclipse.ocl.expressions.OCLExpression;
27
import org.eclipse.ocl.expressions.OCLExpression;
29
30
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
28
import org.eclipse.ocl.expressions.util.ExpressionsValidator;
31
import org.eclipse.ocl.internal.l10n.OCLMessages;
29
import org.eclipse.ocl.internal.l10n.OCLMessages;
32
import org.eclipse.ocl.util.OCLUtil;
30
import org.eclipse.ocl.util.OCLUtil;
(-)src/org/eclipse/ocl/lpg/AbstractAnalyzer.java (-5 / +38 lines)
Lines 79-85 Link Here
79
	}
79
	}
80
80
81
	public void dumpTokens() {
81
	public void dumpTokens() {
82
		parser.dumpTokens();
82
		parser.getIPrsStream().dumpTokens();
83
	}
83
	}
84
84
85
	public String formatClass(Object object) {
85
	public String formatClass(Object object) {
Lines 276-282 Link Here
276
	}
276
	}
277
277
278
	public void setFileName(String filename) {
278
	public void setFileName(String filename) {
279
		getLexer().setFileName(filename);
279
		getLexer().getILexStream().setFileName(filename);
280
	}
280
	}
281
281
282
	/**
282
	/**
Lines 284-292 Link Here
284
	 * 
284
	 * 
285
	 * @param buffer
285
	 * @param buffer
286
	 *            the characters
286
	 *            the characters
287
	 * 
288
	 * @deprecated clients should invoke {@link #reset(char[], String)}
287
	 */
289
	 */
288
	public void initialize(char[] buffer) {
290
	public void initialize(char[] buffer) {
289
		getLexer().initialize(buffer);
291
		reset(buffer, null);
290
	}
292
	}
291
293
292
	/**
294
	/**
Lines 296-309 Link Here
296
	 *            providing the source text
298
	 *            providing the source text
297
	 * @throws IOException
299
	 * @throws IOException
298
	 *             if reading fails
300
	 *             if reading fails
301
	 * 
302
	 * @deprecated clients should invoke {@link #reset(Reader, String)}
299
	 */
303
	 */
300
	public void initialize(Reader reader)
304
	public void initialize(Reader reader)
301
			throws IOException {
305
			throws IOException {
302
		getLexer().initialize(reader);
306
		reset(reader, null);
307
	}
308
	
309
	/**
310
	 *  Define the input text as a given array of characters.
311
     *
312
	 * @param buffer
313
	 *            the characters
314
	 * @param fileName
315
     *            the associated finleName of the input, or <code>null</code> if none.
316
	 * @since 3.0
317
	 */
318
	public void reset(char[] buffer, String fileName) {
319
		getLexer().reset(buffer, fileName);
320
	}
321
322
	/**
323
	 * Define the input text by reading from a reader.
324
	 * 
325
	 * @param reader
326
	 *            providing the source text
327
	 * @param fileName
328
     *            the associated finleName of the input, or <code>null</code> if none.
329
	 * @throws IOException
330
	 *             if reading fails
331
	 * @since 3.0
332
	 */
333
	public void reset(Reader reader, String fileName)
334
			throws IOException {
335
		getLexer().reset(reader, fileName);
303
	}
336
	}
304
337
305
	public void setTab(int tab) {
338
	public void setTab(int tab) {
306
		getLexer().setTab(tab);
339
		getLexer().getILexStream().setTab(tab);
307
	}
340
	}
308
341
309
	public void setTraceFlag(boolean flag) {
342
	public void setTraceFlag(boolean flag) {
(-)src/org/eclipse/ocl/lpg/AbstractBasicEnvironment.java (-5 / +5 lines)
Lines 25-32 Link Here
25
import java.util.List;
25
import java.util.List;
26
import java.util.Map;
26
import java.util.Map;
27
27
28
import lpg.lpgjavaruntime.IToken;
28
import lpg.runtime.IToken;
29
import lpg.lpgjavaruntime.ParseErrorCodes;
29
import lpg.runtime.ParseErrorCodes;
30
30
31
import org.eclipse.ocl.cst.CSTNode;
31
import org.eclipse.ocl.cst.CSTNode;
32
import org.eclipse.ocl.internal.OCLDebugOptions;
32
import org.eclipse.ocl.internal.OCLDebugOptions;
Lines 238-246 Link Here
238
        }
238
        }
239
		int leftTokenLoc = (leftToken > rightToken ? rightToken : leftToken);
239
		int leftTokenLoc = (leftToken > rightToken ? rightToken : leftToken);
240
		int rightTokenLoc = rightToken;
240
		int rightTokenLoc = rightToken;
241
		int startOffset = parser.getStartOffset(leftTokenLoc);
241
		int startOffset = parser.getIPrsStream().getStartOffset(leftTokenLoc);
242
		int endOffset = parser.getEndOffset(rightTokenLoc);
242
		int endOffset = parser.getIPrsStream().getEndOffset(rightTokenLoc);
243
		int line = leftTokenLoc >= 0 ? parser.getLine(leftTokenLoc) : -1;
243
		int line = leftTokenLoc >= 0 ? parser.getIPrsStream().getLine(leftTokenLoc) : -1;
244
		String message;
244
		String message;
245
        if (line <= 0) {
245
        if (line <= 0) {
246
        	message = OCLMessages.InvalidOCL_ERROR_;
246
        	message = OCLMessages.InvalidOCL_ERROR_;
(-)src/org/eclipse/ocl/lpg/AbstractParser.java (-173 / +207 lines)
Lines 19-33 Link Here
19
 */
19
 */
20
package org.eclipse.ocl.lpg;
20
package org.eclipse.ocl.lpg;
21
21
22
import java.util.ArrayList;
22
import lpg.runtime.ErrorToken;
23
23
import lpg.runtime.ILexStream;
24
import lpg.lpgjavaruntime.ErrorToken;
24
import lpg.runtime.IToken;
25
import lpg.lpgjavaruntime.IToken;
25
import lpg.runtime.Monitor;
26
import lpg.lpgjavaruntime.LexStream;
26
import lpg.runtime.ParseErrorCodes;
27
import lpg.lpgjavaruntime.Monitor;
27
import lpg.runtime.ParseTable;
28
import lpg.lpgjavaruntime.ParseErrorCodes;
28
import lpg.runtime.PrsStream;
29
import lpg.lpgjavaruntime.PrsStream;
30
import lpg.lpgjavaruntime.Token;
31
29
32
import org.eclipse.ocl.cst.CSTNode;
30
import org.eclipse.ocl.cst.CSTNode;
33
import org.eclipse.ocl.internal.l10n.OCLMessages;
31
import org.eclipse.ocl.internal.l10n.OCLMessages;
Lines 43-66 Link Here
43
 * tokens from text parsing and analysis to support the AST and CST classes
41
 * tokens from text parsing and analysis to support the AST and CST classes
44
 * appropriate to a particular language.
42
 * appropriate to a particular language.
45
 */
43
 */
46
public abstract class AbstractParser
44
public abstract class AbstractParser {
47
		extends PrsStream {
45
	
48
49
	private final BasicEnvironment environment;
46
	private final BasicEnvironment environment;
50
47
51
	private int defaultRepairCount = 0;
48
	private int defaultRepairCount = 0;
49
	
50
	private AbstractLexer lexer;
52
51
53
	public AbstractParser(BasicEnvironment environment) {
52
	/*public AbstractParser(BasicEnvironment environment) {
54
		this.environment = environment;
53
		this.environment = environment;
55
		environment.setParser(this);
54
		environment.setParser(this);
56
	}
55
	}*/
57
56
58
	public AbstractParser(AbstractLexer lexer) {
57
	public AbstractParser(AbstractLexer lexer) {
59
		super(lexer);
58
		this.lexer = lexer;
60
		this.environment = lexer.getEnvironment();
59
		this.environment = lexer.getEnvironment();
61
		environment.setParser(this);
60
		environment.setParser(this);		
61
	}
62
	
63
	public AbstractLexer getLexer() {
64
		return lexer;
62
	}
65
	}
63
64
	/**
66
	/**
65
	 * Returns a single line string representation of the input chars for the
67
	 * Returns a single line string representation of the input chars for the
66
	 * given range.
68
	 * given range.
Lines 73-79 Link Here
73
	 */
75
	 */
74
	public String computeInputString(int left, int right) {
76
	public String computeInputString(int left, int right) {
75
		StringBuffer result = new StringBuffer(right - left + 1);
77
		StringBuffer result = new StringBuffer(right - left + 1);
76
		char[] chars = getInputChars();
78
		char[] chars = getIPrsStream().getInputChars();
77
		if (chars.length > 0) {
79
		if (chars.length > 0) {
78
			for (int i = left; i <= right; i++) {
80
			for (int i = left; i <= right; i++) {
79
				if (chars[i] == '\t') {
81
				if (chars[i] == '\t') {
Lines 97-244 Link Here
97
	public BasicEnvironment getEnvironment() {
99
	public BasicEnvironment getEnvironment() {
98
		return environment;
100
		return environment;
99
	}
101
	}
100
102
	
101
	/**
102
	 * This function returns the index of the token element containing the
103
	 * offset specified. If such a token does not exist, it returns the negation
104
	 * of the index of the element immediately preceding the offset.
105
	 * 
106
	 * @since 1.3
107
	 */
108
	public ErrorToken getErrorTokenAtCharacter(int offset) {
109
		ErrorToken bestToken = null;
110
		for (int i = getSize(); --i >= 0;) {
111
			IToken token = getTokenAt(i);
112
			if (!(token instanceof ErrorToken)) {
113
				break;
114
			}
115
			IToken errorToken = ((ErrorToken) token).getErrorToken();
116
			if (offset >= errorToken.getStartOffset()
117
				&& offset <= errorToken.getEndOffset()) {
118
				if ((bestToken == null)
119
					|| ((bestToken.getStartOffset() <= errorToken
120
						.getStartOffset()) && (token.getEndOffset() <= errorToken
121
						.getEndOffset()))) {
122
					bestToken = (ErrorToken) token;
123
				}
124
			}
125
		}
126
		return bestToken;
127
	}
128
129
	/**
130
	 * @since 1.3
131
	 */
132
	public int getDefaultRepairCount() {
133
		return defaultRepairCount;
134
	}
135
136
	/**
137
	 * @since 1.3
138
	 */
139
	public int getErrorTokens() {
140
		return getTokens().size() - getStreamLength();
141
	}
142
143
	public AbstractLexer getLexer() {
144
		return (AbstractLexer) super.getLexStream();
145
	}
146
147
	/**
148
	 * Overridden to search only the non-Error nodes, which are the only tokens
149
	 * in monotonic order.
150
	 */
151
	@Override
152
	public int getTokenIndexAtCharacter(int offset) {
153
		int low = 0;
154
		int high = getSize();
155
		while (high > low) {
156
			IToken highToken = getTokenAt(high - 1);
157
			if (!(highToken instanceof ErrorToken)) {
158
				break;
159
			}
160
			high--;
161
		}
162
		while (high > low) {
163
			int mid = (high + low) / 2;
164
			IToken mid_element = getTokenAt(mid);
165
			if (offset >= mid_element.getStartOffset()
166
				&& offset <= mid_element.getEndOffset()) {
167
				return mid;
168
			} else if (offset < mid_element.getStartOffset()) {
169
				high = mid;
170
			} else {
171
				low = mid + 1;
172
			}
173
		}
174
175
		return -(low - 1);
176
	}
177
178
	@Override
179
	public int makeErrorToken(int firsttok, int lasttok, int errortok, int kind) {
180
		@SuppressWarnings("unchecked")
181
		ArrayList<IToken> tokens = getTokens();
182
		int index = tokens.size(); // the next index
183
184
		//
185
		// Note that when creating an error token, we do not remap its kind.
186
		// Since this is not a lexical operation, it is the responsibility of
187
		// the calling program (a parser driver) to pass to us the proper kind
188
		// that it wants for an error token.
189
		//
190
		Token token = new ErrorToken(getIToken(firsttok), getIToken(lasttok),
191
			getIToken(errortok), getStartOffset(firsttok),
192
			getEndOffset(lasttok), kind) {
193
194
			@Override
195
			public String toString() {
196
				if (getPrsStream() == null) {
197
					return "<toString>"; //$NON-NLS-1$
198
				}
199
				int startOffset = getStartOffset();
200
				int length = getEndOffset() - startOffset;
201
				if (length < 0) {
202
					length = -length - 1;
203
					startOffset = getEndOffset();
204
				}
205
				if ((startOffset + length) > getPrsStream().getInputChars().length) {
206
					return String.valueOf(IToken.EOF);
207
				}
208
				return new String(getPrsStream().getInputChars(), startOffset,
209
					length);
210
			}
211
212
		};
213
		token.setTokenIndex(index);
214
		tokens.add(token);
215
		token.setAdjunctIndex(getAdjuncts().size());
216
		return index;
217
	}
218
219
	public CSTNode parseTokensToCST() {
220
		return parseTokensToCST(null, defaultRepairCount);
221
	}
222
223
	public abstract CSTNode parseTokensToCST(Monitor monitor,
224
			int error_repair_count);
225
226
	@Override
227
	public void reportError(int errorCode, String locationInfo, int leftToken,
228
			int rightToken, String tokenText) {
229
		BasicEnvironment environment = getEnvironment();
230
		if (environment == null) {
231
			super.reportError(errorCode, locationInfo, leftToken, rightToken,
232
				tokenText);
233
		} else {
234
			if (errorCode == DELETION_CODE || errorCode == MISPLACED_CODE) {
235
				tokenText = ""; //$NON-NLS-1$
236
			}
237
			environment
238
				.parserError(errorCode, leftToken, rightToken, tokenText);
239
		}
240
	}
241
242
	/**
103
	/**
243
	 * Report error message for given error_token.
104
	 * Report error message for given error_token.
244
	 * 
105
	 * 
Lines 250-278 Link Here
250
	 * @since 1.3
111
	 * @since 1.3
251
	 */
112
	 */
252
	public final void reportErrorTokenMessage(int error_token, String msg) {
113
	public final void reportErrorTokenMessage(int error_token, String msg) {
253
		int firsttok = super.getFirstRealToken(error_token);
114
		int firsttok = getIPrsStream().getFirstRealToken(error_token);
254
		int lasttok = super.getLastRealToken(error_token);
115
		int lasttok = getIPrsStream().getLastRealToken(error_token);
255
		if (firsttok > lasttok) {
116
		if (firsttok > lasttok) {
256
			String location = super.getFileName() + ':'
117
			/*String location = super.getFileName() + ':'
257
				+ super.getEndLine(lasttok) + ':' + super.getEndColumn(lasttok)
118
				+ super.getEndLine(lasttok) + ':' + super.getEndColumn(lasttok)
258
				+ ": "; //$NON-NLS-1$
119
				+ ": "; //$NON-NLS-1$*/
259
			reportError(ParseErrorCodes.INSERTION_CODE, location, lasttok,
120
			getIPrsStream().reportError(ParseErrorCodes.INSERTION_CODE, lasttok,
260
				lasttok, msg);
121
				lasttok, msg);
261
		} else {
122
		} else {
262
			String location = super.getFileName() + ':'
123
			/*String location = super.getFileName() + ':'
263
				+ super.getLine(error_token) + ':'
124
				+ super.getLine(error_token) + ':'
264
				+ super.getColumn(error_token) + ':'
125
				+ super.getColumn(error_token) + ':'
265
				+ super.getEndLine(error_token) + ':'
126
				+ super.getEndLine(error_token) + ':'
266
				+ super.getEndColumn(error_token) + ": "; //$NON-NLS-1$
127
				+ super.getEndColumn(error_token) + ": "; //$NON-NLS-1$*/
267
			reportError(ParseErrorCodes.SUBSTITUTION_CODE, location, firsttok,
128
			getIPrsStream().reportError(ParseErrorCodes.SUBSTITUTION_CODE, firsttok,
268
				lasttok, msg);
129
				lasttok, msg);
269
		}
130
		}
270
	}
131
	}
271
132
272
	@Override
133
	/**
134
	 * @return
135
	 * @deprecated clients should invoke {@link #parser()}
136
	 */
137
	public CSTNode parseTokensToCST() {
138
		return parser(null, defaultRepairCount);
139
	}
140
141
	/**
142
	 * @param monitor
143
	 * @param error_repair_count
144
	 * @return
145
	 * 
146
	 * @deprecated clients should invoke {@link #parser(Monitor, int)}
147
	 * @since 3.0
148
	 */
149
	public CSTNode parseTokensToCST(Monitor monitor,
150
			int error_repair_count) {
151
		return parser(monitor, error_repair_count);	
152
	}
153
154
	/*@Override
273
	public void resetLexStream(LexStream lexStream) {
155
	public void resetLexStream(LexStream lexStream) {
274
		setLexStream((AbstractLexer) lexStream);
156
		setLexStream((AbstractLexer) lexStream);
275
	}
157
	}*/
276
158
277
	/**
159
	/**
278
	 * Sets the number of repairs to be performed by a parser capable of
160
	 * Sets the number of repairs to be performed by a parser capable of
Lines 294-302 Link Here
294
176
295
		this.defaultRepairCount = defaultRepairCount;
177
		this.defaultRepairCount = defaultRepairCount;
296
	}
178
	}
297
179
	
298
	public void setLexStream(AbstractLexer lexStream) {
180
	/**
299
		super.resetLexStream(lexStream);
181
	 * @since 1.3
182
	 */
183
	public int getDefaultRepairCount() {
184
		return defaultRepairCount;
300
	}
185
	}
301
186
302
	/**
187
	/**
Lines 307-312 Link Here
307
	 *            <code>CSTNode</code> to set offsets
192
	 *            <code>CSTNode</code> to set offsets
308
	 * @param startEnd
193
	 * @param startEnd
309
	 *            <code>IToken</code> to retrieve offsets from
194
	 *            <code>IToken</code> to retrieve offsets from
195
	 * @since 3.0
310
	 */
196
	 */
311
	protected void setOffsets(CSTNode cstNode, IToken startEnd) {
197
	protected void setOffsets(CSTNode cstNode, IToken startEnd) {
312
		cstNode.setStartToken(startEnd);
198
		cstNode.setStartToken(startEnd);
Lines 368-373 Link Here
368
	 *            <code>CSTNode</code> to retrieve start offset from
254
	 *            <code>CSTNode</code> to retrieve start offset from
369
	 * @param end
255
	 * @param end
370
	 *            <code>IToken</code> to retrieve end offset from
256
	 *            <code>IToken</code> to retrieve end offset from
257
	 * @since 3.0
371
	 */
258
	 */
372
	protected void setOffsets(CSTNode cstNode, CSTNode start, IToken end) {
259
	protected void setOffsets(CSTNode cstNode, CSTNode start, IToken end) {
373
		cstNode.setStartToken(start.getStartToken());
260
		cstNode.setStartToken(start.getStartToken());
Lines 387-392 Link Here
387
	 *            <code>IToken</code> to retrieve start offset from
274
	 *            <code>IToken</code> to retrieve start offset from
388
	 * @param end
275
	 * @param end
389
	 *            <code>CSTNode</code> to retrieve end offset from
276
	 *            <code>CSTNode</code> to retrieve end offset from
277
	 * @since 3.0
390
	 */
278
	 */
391
	protected void setOffsets(CSTNode cstNode, IToken start, CSTNode end) {
279
	protected void setOffsets(CSTNode cstNode, IToken start, CSTNode end) {
392
		cstNode.setStartToken(start);
280
		cstNode.setStartToken(start);
Lines 406-411 Link Here
406
	 *            <code>IToken</code> to retrieve start offset from
294
	 *            <code>IToken</code> to retrieve start offset from
407
	 * @param end
295
	 * @param end
408
	 *            <code>IToken</code> to retrieve end offset from
296
	 *            <code>IToken</code> to retrieve end offset from
297
	 * @since 3.0
409
	 */
298
	 */
410
	protected void setOffsets(CSTNode cstNode, IToken start, IToken end) {
299
	protected void setOffsets(CSTNode cstNode, IToken start, IToken end) {
411
		cstNode.setStartToken(start);
300
		cstNode.setStartToken(start);
Lines 413-418 Link Here
413
		cstNode.setStartOffset(start.getStartOffset());
302
		cstNode.setStartOffset(start.getStartOffset());
414
		cstNode.setEndOffset(end.getEndOffset());
303
		cstNode.setEndOffset(end.getEndOffset());
415
	}
304
	}
305
	
306
    /**
307
     * <p>
308
     * Initializes a concrete-syntax node's start and end offsets from the
309
     * current token in the parser stream.
310
     * <p>
311
     * 
312
     * <p>
313
     * <b>Note:</b> this method resided in the OCLEssential.g template since 1.2 
314
     * It has been incorporated in the abstract parser since 3.0
315
     * </p>
316
     * 
317
     * @param cstNode a concrete-syntax node
318
     * 
319
     * @since 3.0
320
     */
321
	protected void setOffsets(CSTNode cstNode) {
322
		IToken firstToken = getRhsIToken(1);
323
		cstNode.setStartToken(firstToken);
324
		cstNode.setEndToken(firstToken);
325
		cstNode.setStartOffset(firstToken.getStartOffset());
326
		cstNode.setEndOffset(firstToken.getEndOffset()-1);
327
	}
416
328
417
	/**
329
	/**
418
	 * Removes the "s surrounding a quoted string, if any.
330
	 * Removes the "s surrounding a quoted string, if any.
Lines 457-460 Link Here
457
369
458
		return result;
370
		return result;
459
	}
371
	}
372
	
373
	// Some useful methods which will be implemented in the generated Parser
374
	abstract public String[] orderedTerminalSymbols();
375
	
376
	/**
377
	 * @since 3.0
378
	 */
379
	abstract public OCLParserStream getIPrsStream();
380
	
381
	/**
382
	 * @since 3.0
383
	 */
384
	abstract public void reset(ILexStream lexStream);
385
	
386
	/**
387
	 * @since 3.0
388
	 */
389
	abstract public CSTNode parser();
390
        
391
	/**
392
	 * @since 3.0
393
	 */
394
	abstract public CSTNode parser(Monitor monitor);
395
        
396
	/**
397
	 * @since 3.0
398
	 */
399
	abstract public CSTNode parser(int error_repair_count);
400
        
401
	/**
402
	 * @since 3.0
403
	 */
404
	abstract public CSTNode parser(Monitor monitor, int error_repair_count);
405
	
406
	/**
407
	 * @since 3.0
408
	 */
409
	abstract public ParseTable getParseTable();
410
	
411
	/**
412
	 * @since 3.0
413
	 */
414
	abstract public Object getRhsSym(int i);
415
416
	/**
417
	 * @since 3.0
418
	 */
419
	abstract public int getRhsTokenIndex(int i);
420
	
421
	/**
422
	 * @since 3.0
423
	 */
424
	abstract public IToken getRhsIToken(int i);
425
    
426
	/**
427
	 * @since 3.0
428
	 */
429
	abstract public int getRhsFirstTokenIndex(int i);
430
	
431
	/**
432
	 * @since 3.0
433
	 */
434
	abstract public IToken getRhsFirstIToken(int i);
435
436
	/**
437
	 * @since 3.0
438
	 */
439
	abstract public int getRhsLastTokenIndex(int i);
440
	
441
	/**
442
	 * @since 3.0
443
	 */
444
	abstract public IToken getRhsLastIToken(int i);
445
446
	/**
447
	 * @since 3.0
448
	 */
449
	abstract public int getLeftSpan();
450
	
451
	/**
452
	 * @since 3.0
453
	 */
454
	abstract public IToken getLeftIToken();
455
456
	/**
457
	 * @since 3.0
458
	 */
459
	abstract public int getRightSpan();
460
	
461
	/**
462
	 * @since 3.0
463
	 */
464
	abstract public IToken getRightIToken();
465
466
	/**
467
	 * @since 3.0
468
	 */
469
	abstract public int getRhsErrorTokenIndex(int i);
470
	
471
	/**
472
	 * @since 3.0
473
	 */
474
	abstract public ErrorToken getRhsErrorIToken(int i);
475
476
    /**
477
     * @deprecated replaced by {@link #getIPrsStream()}
478
     * @since 3.0
479
     *
480
     */
481
	abstract public PrsStream getPrsStream();
482
483
    /**
484
     * @deprecated replaced by {@link #getIPrsStream()}
485
     * @since 3.0
486
     *
487
     */
488
	abstract public PrsStream getParseStream();
489
    
490
    /**
491
     * @since 3.0
492
	 */
493
	abstract public int numTokenKinds();
460
}
494
}
(-)src/org/eclipse/ocl/lpg/AbstractLexer.java (-64 / +124 lines)
Lines 23-31 Link Here
23
import java.io.IOException;
23
import java.io.IOException;
24
import java.io.Reader;
24
import java.io.Reader;
25
25
26
import lpg.lpgjavaruntime.LpgLexStream;
26
import lpg.runtime.ILexStream;
27
import lpg.lpgjavaruntime.Monitor;
27
import lpg.runtime.LexParser;
28
import lpg.lpgjavaruntime.RuleAction;
28
import lpg.runtime.Monitor;
29
import lpg.runtime.ParseTable;
29
30
30
31
31
/**
32
/**
Lines 36-45 Link Here
36
 * 
37
 * 
37
 * Derived classes should extend the abstract support for AST from CST from tokens from text
38
 * Derived classes should extend the abstract support for AST from CST from tokens from text
38
 * parsing and analysis to support the AST and CST classes appropriate to a particular language.
39
 * parsing and analysis to support the AST and CST classes appropriate to a particular language.
40
 * @since 3.0
39
 */
41
 */
40
public abstract class AbstractLexer extends LpgLexStream implements RuleAction
42
public abstract class AbstractLexer 
41
{
43
{
42
    protected final static int ECLIPSE_TAB_VALUE = 4;
44
    
43
    
45
    
44
    /**
46
    /**
45
 	 * Read all input characters from a reader.
47
 	 * Read all input characters from a reader.
Lines 70-107 Link Here
70
		return buffer;
72
		return buffer;
71
	}  
73
	}  
72
    
74
    
73
	private final BasicEnvironment environment;
75
	private final BasicEnvironment environment;    
74
	
76
    
75
    public AbstractLexer(BasicEnvironment environment, String filename, int tab) throws java.io.IOException 
77
    // Constructor
78
    public AbstractLexer(BasicEnvironment environment) 
76
    {
79
    {
77
        super(filename, tab);
78
        this.environment = environment;
80
        this.environment = environment;
79
    }
81
    }
80
82
81
    public AbstractLexer(BasicEnvironment environment, char[] input_chars, String filename, int tab)
83
	public BasicEnvironment getEnvironment() {
82
    {
84
		return environment;
83
        super(input_chars, filename, tab);
85
	}	
84
        this.environment = environment;
85
    }
86
86
87
    public AbstractLexer(BasicEnvironment environment) {
87
    /**
88
    	setTab(ECLIPSE_TAB_VALUE);
88
	 * Define the input text as a given array of characters.
89
        this.environment = environment;
89
     * @param buffer the characters
90
     * @deprecated clients should use {@link #reset(char[], String)}
91
     */
92
	public void initialize(char[] inputChars) {
93
		/*setInputChars(inputChars);
94
        setStreamLength(inputChars.length);
95
        computeLineOffsets();*/
96
		reset(inputChars, null);
97
	}
98
99
	/**
100
	 * Define the input text by reading from a reader.
101
     * @param reader providing the source text
102
     * @throws IOException if reading fails
103
     * 
104
     * @deprecated clients should invoke {@link #reset(Reader, String)}
105
     */
106
	public void initialize(Reader reader) throws IOException {
107
    	char[] buffer = getInputChars(reader);
108
    	reset(buffer, null);
90
    }
109
    }
91
110
92
	protected int computeErrorCode(int leftToken, int rightToken) {
111
	/**
93
		if (rightToken >= getStreamLength())
112
	 * @param parser the {@link OCLParserStream} instance
94
		    return EOF_CODE;
113
	 * @deprecated clients should invoke {@link #lexer(OCLParserStream)}
95
		else if (leftToken == rightToken)
114
	 * @since 3.0
96
		    return LEX_ERROR_CODE;
115
	 */
97
		else
116
	public void lexToTokens(OCLParserStream parser) {
98
			return INVALID_TOKEN_CODE;
117
		lexer(parser);
99
	}
118
	}
100
119
101
	public BasicEnvironment getEnvironment() {
120
	/**
102
		return environment;
121
	 * @param parser the {@link OCLParserStream} instance
103
	}
122
	 * @deprecated clients should invoke {@link #lexer(Monitor, OCLParserStream)}
104
	
123
	 * @since 3.0
124
	 */
125
	public void lexToTokens(Monitor monitor, OCLParserStream prsStream)
126
    {
127
        lexer(monitor, prsStream);
128
    }
129
130
	// Some methods which will be implemented by the generated lexer
105
	/**
131
	/**
106
	 * Queries the token kinds, as defined by my keyword lexer, of tokens that
132
	 * Queries the token kinds, as defined by my keyword lexer, of tokens that
107
	 * are keywords in by grammar.
133
	 * are keywords in by grammar.
Lines 110-157 Link Here
110
	 * 
136
	 * 
111
	 * @since 1.3
137
	 * @since 1.3
112
	 */
138
	 */
113
    public int [] getKeywordKinds() {
139
    public abstract int [] getKeywordKinds();
114
    	return new int[0];
140
    
115
    }
141
	/**
116
142
	 * @since 3.0
117
	public void lexToTokens(AbstractParser parser) {
143
	 */
118
		lexToTokens(null, parser);
144
	public abstract AbstractLexerStream getILexStream();	
119
	}
120
	
145
	
121
	public abstract void lexToTokens(Monitor monitor, AbstractParser parser);
122
123
	/**
146
	/**
124
	 * Errors generated within the lexer are redirected to the error handler if there is one.
147
	 * @since 3.0
125
	 * 
126
	 * Note that other variants of reportError either feed this one, are fed from a default implementation
127
	 * of this one or originate in the parser, where a ParserErrorHandler can intercept them.
128
	 */
148
	 */
129
	@Override public void reportError(int leftToken, int rightToken) {
149
	public abstract void reset(String filename, int tab) throws java.io.IOException;
130
		BasicEnvironment environment = getEnvironment();
131
		if (environment != null)
132
			environment.lexerError(computeErrorCode(leftToken, rightToken), leftToken, rightToken);
133
		else
134
			super.reportError(leftToken, rightToken);
135
	}
136
150
137
    /**
151
    /**
138
	 * Define the input text as a given array of characters.
152
	 * @since 3.0
139
     * @param buffer the characters
153
	 */
140
     */
154
    public abstract void reset(char[] input_chars, String filename);
141
	public void initialize(char[] inputChars) {
155
  
142
		setInputChars(inputChars);
156
    /**
143
        setStreamLength(inputChars.length);
157
	 * @since 3.0
144
        computeLineOffsets();        
158
	 */
145
	}
159
    public abstract void reset(char[] input_chars, String filename, int tab);
146
160
161
    /**
162
	 * @since 3.0
163
	 */
164
    public abstract void reset(Reader reader, String filename) throws java.io.IOException;
165
    
147
	/**
166
	/**
148
	 * Define the input text by reading from a reader.
167
	 * @since 3.0
149
     * @param reader providing the source text
168
	 */
150
     * @throws IOException if reading fails
169
	public abstract void reset(Reader reader, String filename, int tab) throws java.io.IOException;
151
     */
170
	
152
	public void initialize(Reader reader) throws IOException {
171
    /**
153
    	char[] buffer = getInputChars(reader);
172
	 * @since 3.0
154
    	initialize(buffer);
173
	 */
155
    }
174
    public abstract void lexer(OCLParserStream prsStream);
175
    
176
    /**
177
	 * @since 3.0
178
	 */
179
    public abstract void lexer(Monitor monitor, OCLParserStream prsStream);
180
181
    /**
182
	 * @since 3.0
183
	 */
184
    public abstract void lexer(OCLParserStream prsStream, int start_offset, int end_offset);
185
    
186
    /**
187
	 * @since 3.0
188
	 */
189
    public abstract void lexer(Monitor monitor, OCLParserStream prsStream, int start_offset, int end_offset);
190
    
191
    // We also include some new 3.0 methods in order not to change the template with the @since
192
    /**
193
	 * @since 3.0
194
	 */
195
    public abstract ParseTable getParseTable();
196
    
197
    /**
198
	 * @since 3.0
199
	 */
200
    public abstract LexParser getParser();
201
    
202
    /**
203
	 * @since 3.0
204
	 */
205
    public abstract void resetKeywordLexer();
206
    
207
    /**
208
	 * @since 3.0
209
	 */
210
	public abstract ILexStream getLexStream();
211
	
212
	/**
213
	 * @since 3.0
214
	 */
215
	public abstract void reportLexicalError(int startLoc, int endLoc);
156
}
216
}
157
217
(-)src/org/eclipse/ocl/lpg/AbstractProblemHandler.java (-2 / +2 lines)
Lines 17-23 Link Here
17
 */
17
 */
18
package org.eclipse.ocl.lpg;
18
package org.eclipse.ocl.lpg;
19
19
20
import lpg.lpgjavaruntime.ParseErrorCodes;
20
import lpg.runtime.ParseErrorCodes;
21
21
22
import org.eclipse.emf.common.util.Monitor;
22
import org.eclipse.emf.common.util.Monitor;
23
import org.eclipse.ocl.internal.l10n.OCLMessages;
23
import org.eclipse.ocl.internal.l10n.OCLMessages;
Lines 102-108 Link Here
102
	 */
102
	 */
103
	public void handleProblem(Severity problemSeverity, Phase processingPhase,
103
	public void handleProblem(Severity problemSeverity, Phase processingPhase,
104
			String problemMessage, String processingContext, int startOffset, int endOffset) {
104
			String problemMessage, String processingContext, int startOffset, int endOffset) {
105
		int lineNumber = parser.getTokenAtCharacter(startOffset).getLine();
105
		int lineNumber = parser.getIPrsStream().getTokenAtCharacter(startOffset).getLine();
106
		String message = OCLMessages.bind(
106
		String message = OCLMessages.bind(
107
				OCLMessages.ProblemMessage_ERROR_,
107
				OCLMessages.ProblemMessage_ERROR_,
108
				new Object[] {
108
				new Object[] {
(-)model/OCLCST.ecore (-1 / +1 lines)
Lines 15-21 Link Here
15
          eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"
15
          eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EJavaObject"
16
          transient="true"/>
16
          transient="true"/>
17
    </eClassifiers>
17
    </eClassifiers>
18
    <eClassifiers xsi:type="ecore:EDataType" name="IToken" instanceClassName="lpg.lpgjavaruntime.IToken"/>
18
    <eClassifiers xsi:type="ecore:EDataType" name="IToken" instanceClassName="lpg.runtime.IToken"/>
19
    <eClassifiers xsi:type="ecore:EClass" name="PackageDeclarationCS" eSuperTypes="#//cst/CSTNode">
19
    <eClassifiers xsi:type="ecore:EClass" name="PackageDeclarationCS" eSuperTypes="#//cst/CSTNode">
20
      <eStructuralFeatures xsi:type="ecore:EReference" name="pathNameCS" eType="#//cst/PathNameCS"
20
      <eStructuralFeatures xsi:type="ecore:EReference" name="pathNameCS" eType="#//cst/PathNameCS"
21
          containment="true"/>
21
          containment="true"/>
(-)model/OCLCST.uml (-1 / +1 lines)
Lines 874-880 Link Here
874
  <Ecore:EClass xmi:id="_qf-8J_8fEduhWtVvKtiQ7w" base_Class="_qdx-Vf8fEduhWtVvKtiQ7w"/>
874
  <Ecore:EClass xmi:id="_qf-8J_8fEduhWtVvKtiQ7w" base_Class="_qdx-Vf8fEduhWtVvKtiQ7w"/>
875
  <Ecore:EClass xmi:id="_qf-8KP8fEduhWtVvKtiQ7w" base_Class="_qdx-V_8fEduhWtVvKtiQ7w"/>
875
  <Ecore:EClass xmi:id="_qf-8KP8fEduhWtVvKtiQ7w" base_Class="_qdx-V_8fEduhWtVvKtiQ7w"/>
876
  <Ecore:EAttribute xmi:id="_qf-8Kf8fEduhWtVvKtiQ7w" base_Property="_qdx-Wf8fEduhWtVvKtiQ7w"/>
876
  <Ecore:EAttribute xmi:id="_qf-8Kf8fEduhWtVvKtiQ7w" base_Property="_qdx-Wf8fEduhWtVvKtiQ7w"/>
877
  <Ecore:EDataType xmi:id="_wn-44I2FEd2mlKUM3HGxZg" instanceClassName="lpg.lpgjavaruntime.IToken" base_PrimitiveType="_tvVQwI2FEd2mlKUM3HGxZg"/>
877
  <Ecore:EDataType xmi:id="_wn-44I2FEd2mlKUM3HGxZg" instanceClassName="lpg.runtime.IToken" base_PrimitiveType="_tvVQwI2FEd2mlKUM3HGxZg"/>
878
  <Ecore:EAttribute xmi:id="_qkehgI2JEd2mlKUM3HGxZg" isTransient="true" base_Property="_PkTnII2GEd2mlKUM3HGxZg"/>
878
  <Ecore:EAttribute xmi:id="_qkehgI2JEd2mlKUM3HGxZg" isTransient="true" base_Property="_PkTnII2GEd2mlKUM3HGxZg"/>
879
  <Ecore:EAttribute xmi:id="_na5BwI2GEd2mlKUM3HGxZg" isTransient="true" base_Property="_kTt1cI2GEd2mlKUM3HGxZg"/>
879
  <Ecore:EAttribute xmi:id="_na5BwI2GEd2mlKUM3HGxZg" isTransient="true" base_Property="_kTt1cI2GEd2mlKUM3HGxZg"/>
880
  <Ecore:EAttribute xmi:id="_CoEkwI2HEd2mlKUM3HGxZg" isTransient="true" base_Property="_xJpmEI2GEd2mlKUM3HGxZg"/>
880
  <Ecore:EAttribute xmi:id="_CoEkwI2HEd2mlKUM3HGxZg" isTransient="true" base_Property="_xJpmEI2GEd2mlKUM3HGxZg"/>
(-)src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingKWLexer.java (-123 / +188 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2007 IBM Corporation and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc, Open Canarias S.L., and others.
5
* All rights reserved.   This program and the accompanying materials
5
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
6
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
7
* which accompanies this distribution, and is available at
Lines 10-26 Link Here
10
* Contributors:
10
* Contributors:
11
*   IBM - Initial API and implementation
11
*   IBM - Initial API and implementation
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
13
*   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
13
*
14
*
14
* </copyright>
15
* </copyright>
15
*
16
*
16
* $Id: OCLBacktrackingKWLexer.java,v 1.2 2009/08/28 20:43:11 ewillink Exp $
17
* 
17
*/
18
*/
18
19
19
package org.eclipse.ocl.parser.backtracking;
20
package org.eclipse.ocl.parser.backtracking;
20
21
21
22
22
23
23
public class OCLBacktrackingKWLexer extends OCLBacktrackingKWLexerprs implements OCLBacktrackingParsersym
24
public class OCLBacktrackingKWLexer extends OCLBacktrackingKWLexerprs
24
{
25
{
25
    private char[] inputChars;
26
    private char[] inputChars;
26
    private final int keywordKind[] = new int[63 + 1];
27
    private final int keywordKind[] = new int[63 + 1];
Lines 57-122 Link Here
57
    final static int tokenKind[] = new int[128];
58
    final static int tokenKind[] = new int[128];
58
    static
59
    static
59
    {
60
    {
60
        tokenKind['$'] = Char_DollarSign;
61
        tokenKind['$'] = OCLBacktrackingKWLexersym.Char_DollarSign;
61
62
        tokenKind['%'] = OCLBacktrackingKWLexersym.Char_Percent;
62
        tokenKind['a'] = Char_a;
63
        tokenKind['_'] = OCLBacktrackingKWLexersym.Char__;
63
        tokenKind['b'] = Char_b;
64
64
        tokenKind['c'] = Char_c;
65
        tokenKind['a'] = OCLBacktrackingKWLexersym.Char_a;
65
        tokenKind['d'] = Char_d;
66
        tokenKind['b'] = OCLBacktrackingKWLexersym.Char_b;
66
        tokenKind['e'] = Char_e;
67
        tokenKind['c'] = OCLBacktrackingKWLexersym.Char_c;
67
        tokenKind['f'] = Char_f;
68
        tokenKind['d'] = OCLBacktrackingKWLexersym.Char_d;
68
        tokenKind['g'] = Char_g;
69
        tokenKind['e'] = OCLBacktrackingKWLexersym.Char_e;
69
        tokenKind['h'] = Char_h;
70
        tokenKind['f'] = OCLBacktrackingKWLexersym.Char_f;
70
        tokenKind['i'] = Char_i;
71
        tokenKind['g'] = OCLBacktrackingKWLexersym.Char_g;
71
        tokenKind['j'] = Char_j;
72
        tokenKind['h'] = OCLBacktrackingKWLexersym.Char_h;
72
        tokenKind['k'] = Char_k;
73
        tokenKind['i'] = OCLBacktrackingKWLexersym.Char_i;
73
        tokenKind['l'] = Char_l;
74
        tokenKind['j'] = OCLBacktrackingKWLexersym.Char_j;
74
        tokenKind['m'] = Char_m;
75
        tokenKind['k'] = OCLBacktrackingKWLexersym.Char_k;
75
        tokenKind['n'] = Char_n;
76
        tokenKind['l'] = OCLBacktrackingKWLexersym.Char_l;
76
        tokenKind['o'] = Char_o;
77
        tokenKind['m'] = OCLBacktrackingKWLexersym.Char_m;
77
        tokenKind['p'] = Char_p;
78
        tokenKind['n'] = OCLBacktrackingKWLexersym.Char_n;
78
        tokenKind['q'] = Char_q;
79
        tokenKind['o'] = OCLBacktrackingKWLexersym.Char_o;
79
        tokenKind['r'] = Char_r;
80
        tokenKind['p'] = OCLBacktrackingKWLexersym.Char_p;
80
        tokenKind['s'] = Char_s;
81
        tokenKind['q'] = OCLBacktrackingKWLexersym.Char_q;
81
        tokenKind['t'] = Char_t;
82
        tokenKind['r'] = OCLBacktrackingKWLexersym.Char_r;
82
        tokenKind['u'] = Char_u;
83
        tokenKind['s'] = OCLBacktrackingKWLexersym.Char_s;
83
        tokenKind['v'] = Char_v;
84
        tokenKind['t'] = OCLBacktrackingKWLexersym.Char_t;
84
        tokenKind['w'] = Char_w;
85
        tokenKind['u'] = OCLBacktrackingKWLexersym.Char_u;
85
        tokenKind['x'] = Char_x;
86
        tokenKind['v'] = OCLBacktrackingKWLexersym.Char_v;
86
        tokenKind['y'] = Char_y;
87
        tokenKind['w'] = OCLBacktrackingKWLexersym.Char_w;
87
        tokenKind['z'] = Char_z;
88
        tokenKind['x'] = OCLBacktrackingKWLexersym.Char_x;
88
89
        tokenKind['y'] = OCLBacktrackingKWLexersym.Char_y;
89
        tokenKind['A'] = Char_A;
90
        tokenKind['z'] = OCLBacktrackingKWLexersym.Char_z;
90
        tokenKind['B'] = Char_B;
91
91
        tokenKind['C'] = Char_C;
92
        tokenKind['A'] = OCLBacktrackingKWLexersym.Char_A;
92
        tokenKind['D'] = Char_D;
93
        tokenKind['B'] = OCLBacktrackingKWLexersym.Char_B;
93
        tokenKind['E'] = Char_E;
94
        tokenKind['C'] = OCLBacktrackingKWLexersym.Char_C;
94
        tokenKind['F'] = Char_F;
95
        tokenKind['D'] = OCLBacktrackingKWLexersym.Char_D;
95
        tokenKind['G'] = Char_G;
96
        tokenKind['E'] = OCLBacktrackingKWLexersym.Char_E;
96
        tokenKind['H'] = Char_H;
97
        tokenKind['F'] = OCLBacktrackingKWLexersym.Char_F;
97
        tokenKind['I'] = Char_I;
98
        tokenKind['G'] = OCLBacktrackingKWLexersym.Char_G;
98
        tokenKind['J'] = Char_J;
99
        tokenKind['H'] = OCLBacktrackingKWLexersym.Char_H;
99
        tokenKind['K'] = Char_K;
100
        tokenKind['I'] = OCLBacktrackingKWLexersym.Char_I;
100
        tokenKind['L'] = Char_L;
101
        tokenKind['J'] = OCLBacktrackingKWLexersym.Char_J;
101
        tokenKind['M'] = Char_M;
102
        tokenKind['K'] = OCLBacktrackingKWLexersym.Char_K;
102
        tokenKind['N'] = Char_N;
103
        tokenKind['L'] = OCLBacktrackingKWLexersym.Char_L;
103
        tokenKind['O'] = Char_O;
104
        tokenKind['M'] = OCLBacktrackingKWLexersym.Char_M;
104
        tokenKind['P'] = Char_P;
105
        tokenKind['N'] = OCLBacktrackingKWLexersym.Char_N;
105
        tokenKind['Q'] = Char_Q;
106
        tokenKind['O'] = OCLBacktrackingKWLexersym.Char_O;
106
        tokenKind['R'] = Char_R;
107
        tokenKind['P'] = OCLBacktrackingKWLexersym.Char_P;
107
        tokenKind['S'] = Char_S;
108
        tokenKind['Q'] = OCLBacktrackingKWLexersym.Char_Q;
108
        tokenKind['T'] = Char_T;
109
        tokenKind['R'] = OCLBacktrackingKWLexersym.Char_R;
109
        tokenKind['U'] = Char_U;
110
        tokenKind['S'] = OCLBacktrackingKWLexersym.Char_S;
110
        tokenKind['V'] = Char_V;
111
        tokenKind['T'] = OCLBacktrackingKWLexersym.Char_T;
111
        tokenKind['W'] = Char_W;
112
        tokenKind['U'] = OCLBacktrackingKWLexersym.Char_U;
112
        tokenKind['X'] = Char_X;
113
        tokenKind['V'] = OCLBacktrackingKWLexersym.Char_V;
113
        tokenKind['Y'] = Char_Y;
114
        tokenKind['W'] = OCLBacktrackingKWLexersym.Char_W;
114
        tokenKind['Z'] = Char_Z;
115
        tokenKind['X'] = OCLBacktrackingKWLexersym.Char_X;
116
        tokenKind['Y'] = OCLBacktrackingKWLexersym.Char_Y;
117
        tokenKind['Z'] = OCLBacktrackingKWLexersym.Char_Z;
115
    };
118
    };
116
119
117
    final int getKind(char c)
120
    final int getKind(char c)
118
    {
121
    {
119
        return (c < 128 ? tokenKind[c] : 0);
122
        return (((c & 0xFFFFFF80) == 0) /* 0 <= c < 128? */ ? tokenKind[c] : 0);
120
    }
123
    }
121
124
122
125
Lines 128-509 Link Here
128
        //
131
        //
129
        // Rule 1:  KeyWord ::= s e l f
132
        // Rule 1:  KeyWord ::= s e l f
130
        //
133
        //
131
		keywordKind[1] = (TK_self);
134
        
135
		keywordKind[1] = (OCLBacktrackingParsersym.TK_self);
132
	  
136
	  
133
	
137
	
134
        //
138
        //
135
        // Rule 2:  KeyWord ::= i n v
139
        // Rule 2:  KeyWord ::= i n v
136
        //
140
        //
137
		keywordKind[2] = (TK_inv);
141
        
142
		keywordKind[2] = (OCLBacktrackingParsersym.TK_inv);
138
	  
143
	  
139
	
144
	
140
        //
145
        //
141
        // Rule 3:  KeyWord ::= p r e
146
        // Rule 3:  KeyWord ::= p r e
142
        //
147
        //
143
		keywordKind[3] = (TK_pre);
148
        
149
		keywordKind[3] = (OCLBacktrackingParsersym.TK_pre);
144
	  
150
	  
145
	
151
	
146
        //
152
        //
147
        // Rule 4:  KeyWord ::= p o s t
153
        // Rule 4:  KeyWord ::= p o s t
148
        //
154
        //
149
		keywordKind[4] = (TK_post);
155
        
156
		keywordKind[4] = (OCLBacktrackingParsersym.TK_post);
150
	  
157
	  
151
	
158
	
152
        //
159
        //
153
        // Rule 5:  KeyWord ::= b o d y
160
        // Rule 5:  KeyWord ::= b o d y
154
        //
161
        //
155
		keywordKind[5] = (TK_body);
162
        
163
		keywordKind[5] = (OCLBacktrackingParsersym.TK_body);
156
	  
164
	  
157
	
165
	
158
        //
166
        //
159
        // Rule 6:  KeyWord ::= c o n t e x t
167
        // Rule 6:  KeyWord ::= c o n t e x t
160
        //
168
        //
161
		keywordKind[6] = (TK_context);
169
        
170
		keywordKind[6] = (OCLBacktrackingParsersym.TK_context);
162
	  
171
	  
163
	
172
	
164
        //
173
        //
165
        // Rule 7:  KeyWord ::= p a c k a g e
174
        // Rule 7:  KeyWord ::= p a c k a g e
166
        //
175
        //
167
		keywordKind[7] = (TK_package);
176
        
177
		keywordKind[7] = (OCLBacktrackingParsersym.TK_package);
168
	  
178
	  
169
	
179
	
170
        //
180
        //
171
        // Rule 8:  KeyWord ::= e n d p a c k a g e
181
        // Rule 8:  KeyWord ::= e n d p a c k a g e
172
        //
182
        //
173
		keywordKind[8] = (TK_endpackage);
183
        
184
		keywordKind[8] = (OCLBacktrackingParsersym.TK_endpackage);
174
	  
185
	  
175
	
186
	
176
        //
187
        //
177
        // Rule 9:  KeyWord ::= d e f
188
        // Rule 9:  KeyWord ::= d e f
178
        //
189
        //
179
		keywordKind[9] = (TK_def);
190
        
191
		keywordKind[9] = (OCLBacktrackingParsersym.TK_def);
180
	  
192
	  
181
	
193
	
182
        //
194
        //
183
        // Rule 10:  KeyWord ::= d e r i v e
195
        // Rule 10:  KeyWord ::= d e r i v e
184
        //
196
        //
185
		keywordKind[10] = (TK_derive);
197
        
198
		keywordKind[10] = (OCLBacktrackingParsersym.TK_derive);
186
	  
199
	  
187
	
200
	
188
        //
201
        //
189
        // Rule 11:  KeyWord ::= i n i t
202
        // Rule 11:  KeyWord ::= i n i t
190
        //
203
        //
191
		keywordKind[11] = (TK_init);
204
        
205
		keywordKind[11] = (OCLBacktrackingParsersym.TK_init);
192
	  
206
	  
193
	
207
	
194
        //
208
        //
195
        // Rule 12:  KeyWord ::= i f
209
        // Rule 12:  KeyWord ::= i f
196
        //
210
        //
197
		keywordKind[12] = (TK_if);
211
        
212
		keywordKind[12] = (OCLBacktrackingParsersym.TK_if);
198
	  
213
	  
199
	
214
	
200
        //
215
        //
201
        // Rule 13:  KeyWord ::= t h e n
216
        // Rule 13:  KeyWord ::= t h e n
202
        //
217
        //
203
		keywordKind[13] = (TK_then);
218
        
219
		keywordKind[13] = (OCLBacktrackingParsersym.TK_then);
204
	  
220
	  
205
	
221
	
206
        //
222
        //
207
        // Rule 14:  KeyWord ::= e l s e
223
        // Rule 14:  KeyWord ::= e l s e
208
        //
224
        //
209
		keywordKind[14] = (TK_else);
225
        
226
		keywordKind[14] = (OCLBacktrackingParsersym.TK_else);
210
	  
227
	  
211
	
228
	
212
        //
229
        //
213
        // Rule 15:  KeyWord ::= e n d i f
230
        // Rule 15:  KeyWord ::= e n d i f
214
        //
231
        //
215
		keywordKind[15] = (TK_endif);
232
        
233
		keywordKind[15] = (OCLBacktrackingParsersym.TK_endif);
216
	  
234
	  
217
	
235
	
218
        //
236
        //
219
        // Rule 16:  KeyWord ::= a n d
237
        // Rule 16:  KeyWord ::= a n d
220
        //
238
        //
221
		keywordKind[16] = (TK_and);
239
        
240
		keywordKind[16] = (OCLBacktrackingParsersym.TK_and);
222
	  
241
	  
223
	
242
	
224
        //
243
        //
225
        // Rule 17:  KeyWord ::= o r
244
        // Rule 17:  KeyWord ::= o r
226
        //
245
        //
227
		keywordKind[17] = (TK_or);
246
        
247
		keywordKind[17] = (OCLBacktrackingParsersym.TK_or);
228
	  
248
	  
229
	
249
	
230
        //
250
        //
231
        // Rule 18:  KeyWord ::= x o r
251
        // Rule 18:  KeyWord ::= x o r
232
        //
252
        //
233
		keywordKind[18] = (TK_xor);
253
        
254
		keywordKind[18] = (OCLBacktrackingParsersym.TK_xor);
234
	  
255
	  
235
	
256
	
236
        //
257
        //
237
        // Rule 19:  KeyWord ::= n o t
258
        // Rule 19:  KeyWord ::= n o t
238
        //
259
        //
239
		keywordKind[19] = (TK_not);
260
        
261
		keywordKind[19] = (OCLBacktrackingParsersym.TK_not);
240
	  
262
	  
241
	
263
	
242
        //
264
        //
243
        // Rule 20:  KeyWord ::= i m p l i e s
265
        // Rule 20:  KeyWord ::= i m p l i e s
244
        //
266
        //
245
		keywordKind[20] = (TK_implies);
267
        
268
		keywordKind[20] = (OCLBacktrackingParsersym.TK_implies);
246
	  
269
	  
247
	
270
	
248
        //
271
        //
249
        // Rule 21:  KeyWord ::= l e t
272
        // Rule 21:  KeyWord ::= l e t
250
        //
273
        //
251
		keywordKind[21] = (TK_let);
274
        
275
		keywordKind[21] = (OCLBacktrackingParsersym.TK_let);
252
	  
276
	  
253
	
277
	
254
        //
278
        //
255
        // Rule 22:  KeyWord ::= i n
279
        // Rule 22:  KeyWord ::= i n
256
        //
280
        //
257
		keywordKind[22] = (TK_in);
281
        
282
		keywordKind[22] = (OCLBacktrackingParsersym.TK_in);
258
	  
283
	  
259
	
284
	
260
        //
285
        //
261
        // Rule 23:  KeyWord ::= t r u e
286
        // Rule 23:  KeyWord ::= t r u e
262
        //
287
        //
263
		keywordKind[23] = (TK_true);
288
        
289
		keywordKind[23] = (OCLBacktrackingParsersym.TK_true);
264
	  
290
	  
265
	
291
	
266
        //
292
        //
267
        // Rule 24:  KeyWord ::= f a l s e
293
        // Rule 24:  KeyWord ::= f a l s e
268
        //
294
        //
269
		keywordKind[24] = (TK_false);
295
        
296
		keywordKind[24] = (OCLBacktrackingParsersym.TK_false);
270
	  
297
	  
271
	
298
	
272
        //
299
        //
273
        // Rule 25:  KeyWord ::= S e t
300
        // Rule 25:  KeyWord ::= S e t
274
        //
301
        //
275
		keywordKind[25] = (TK_Set);
302
        
303
		keywordKind[25] = (OCLBacktrackingParsersym.TK_Set);
276
	  
304
	  
277
	
305
	
278
        //
306
        //
279
        // Rule 26:  KeyWord ::= B a g
307
        // Rule 26:  KeyWord ::= B a g
280
        //
308
        //
281
		keywordKind[26] = (TK_Bag);
309
        
310
		keywordKind[26] = (OCLBacktrackingParsersym.TK_Bag);
282
	  
311
	  
283
	
312
	
284
        //
313
        //
285
        // Rule 27:  KeyWord ::= S e q u e n c e
314
        // Rule 27:  KeyWord ::= S e q u e n c e
286
        //
315
        //
287
		keywordKind[27] = (TK_Sequence);
316
        
317
		keywordKind[27] = (OCLBacktrackingParsersym.TK_Sequence);
288
	  
318
	  
289
	
319
	
290
        //
320
        //
291
        // Rule 28:  KeyWord ::= C o l l e c t i o n
321
        // Rule 28:  KeyWord ::= C o l l e c t i o n
292
        //
322
        //
293
		keywordKind[28] = (TK_Collection);
323
        
324
		keywordKind[28] = (OCLBacktrackingParsersym.TK_Collection);
294
	  
325
	  
295
	
326
	
296
        //
327
        //
297
        // Rule 29:  KeyWord ::= O r d e r e d S e t
328
        // Rule 29:  KeyWord ::= O r d e r e d S e t
298
        //
329
        //
299
		keywordKind[29] = (TK_OrderedSet);
330
        
331
		keywordKind[29] = (OCLBacktrackingParsersym.TK_OrderedSet);
300
	  
332
	  
301
	
333
	
302
        //
334
        //
303
        // Rule 30:  KeyWord ::= i t e r a t e
335
        // Rule 30:  KeyWord ::= i t e r a t e
304
        //
336
        //
305
		keywordKind[30] = (TK_iterate);
337
        
338
		keywordKind[30] = (OCLBacktrackingParsersym.TK_iterate);
306
	  
339
	  
307
	
340
	
308
        //
341
        //
309
        // Rule 31:  KeyWord ::= f o r A l l
342
        // Rule 31:  KeyWord ::= f o r A l l
310
        //
343
        //
311
		keywordKind[31] = (TK_forAll);
344
        
345
		keywordKind[31] = (OCLBacktrackingParsersym.TK_forAll);
312
	  
346
	  
313
	
347
	
314
        //
348
        //
315
        // Rule 32:  KeyWord ::= e x i s t s
349
        // Rule 32:  KeyWord ::= e x i s t s
316
        //
350
        //
317
		keywordKind[32] = (TK_exists);
351
        
352
		keywordKind[32] = (OCLBacktrackingParsersym.TK_exists);
318
	  
353
	  
319
	
354
	
320
        //
355
        //
321
        // Rule 33:  KeyWord ::= i s U n i q u e
356
        // Rule 33:  KeyWord ::= i s U n i q u e
322
        //
357
        //
323
		keywordKind[33] = (TK_isUnique);
358
        
359
		keywordKind[33] = (OCLBacktrackingParsersym.TK_isUnique);
324
	  
360
	  
325
	
361
	
326
        //
362
        //
327
        // Rule 34:  KeyWord ::= a n y
363
        // Rule 34:  KeyWord ::= a n y
328
        //
364
        //
329
		keywordKind[34] = (TK_any);
365
        
366
		keywordKind[34] = (OCLBacktrackingParsersym.TK_any);
330
	  
367
	  
331
	
368
	
332
        //
369
        //
333
        // Rule 35:  KeyWord ::= o n e
370
        // Rule 35:  KeyWord ::= o n e
334
        //
371
        //
335
		keywordKind[35] = (TK_one);
372
        
373
		keywordKind[35] = (OCLBacktrackingParsersym.TK_one);
336
	  
374
	  
337
	
375
	
338
        //
376
        //
339
        // Rule 36:  KeyWord ::= c o l l e c t
377
        // Rule 36:  KeyWord ::= c o l l e c t
340
        //
378
        //
341
		keywordKind[36] = (TK_collect);
379
        
380
		keywordKind[36] = (OCLBacktrackingParsersym.TK_collect);
342
	  
381
	  
343
	
382
	
344
        //
383
        //
345
        // Rule 37:  KeyWord ::= s e l e c t
384
        // Rule 37:  KeyWord ::= s e l e c t
346
        //
385
        //
347
		keywordKind[37] = (TK_select);
386
        
387
		keywordKind[37] = (OCLBacktrackingParsersym.TK_select);
348
	  
388
	  
349
	
389
	
350
        //
390
        //
351
        // Rule 38:  KeyWord ::= r e j e c t
391
        // Rule 38:  KeyWord ::= r e j e c t
352
        //
392
        //
353
		keywordKind[38] = (TK_reject);
393
        
394
		keywordKind[38] = (OCLBacktrackingParsersym.TK_reject);
354
	  
395
	  
355
	
396
	
356
        //
397
        //
357
        // Rule 39:  KeyWord ::= c o l l e c t N e s t e d
398
        // Rule 39:  KeyWord ::= c o l l e c t N e s t e d
358
        //
399
        //
359
		keywordKind[39] = (TK_collectNested);
400
        
401
		keywordKind[39] = (OCLBacktrackingParsersym.TK_collectNested);
360
	  
402
	  
361
	
403
	
362
        //
404
        //
363
        // Rule 40:  KeyWord ::= s o r t e d B y
405
        // Rule 40:  KeyWord ::= s o r t e d B y
364
        //
406
        //
365
		keywordKind[40] = (TK_sortedBy);
407
        
408
		keywordKind[40] = (OCLBacktrackingParsersym.TK_sortedBy);
366
	  
409
	  
367
	
410
	
368
        //
411
        //
369
        // Rule 41:  KeyWord ::= c l o s u r e
412
        // Rule 41:  KeyWord ::= c l o s u r e
370
        //
413
        //
371
		keywordKind[41] = (TK_closure);
414
        
415
		keywordKind[41] = (OCLBacktrackingParsersym.TK_closure);
372
	  
416
	  
373
	
417
	
374
        //
418
        //
375
        // Rule 42:  KeyWord ::= o c l I s K i n d O f
419
        // Rule 42:  KeyWord ::= o c l I s K i n d O f
376
        //
420
        //
377
		keywordKind[42] = (TK_oclIsKindOf);
421
        
422
		keywordKind[42] = (OCLBacktrackingParsersym.TK_oclIsKindOf);
378
	  
423
	  
379
	
424
	
380
        //
425
        //
381
        // Rule 43:  KeyWord ::= o c l I s T y p e O f
426
        // Rule 43:  KeyWord ::= o c l I s T y p e O f
382
        //
427
        //
383
		keywordKind[43] = (TK_oclIsTypeOf);
428
        
429
		keywordKind[43] = (OCLBacktrackingParsersym.TK_oclIsTypeOf);
384
	  
430
	  
385
	
431
	
386
        //
432
        //
387
        // Rule 44:  KeyWord ::= o c l A s T y p e
433
        // Rule 44:  KeyWord ::= o c l A s T y p e
388
        //
434
        //
389
		keywordKind[44] = (TK_oclAsType);
435
        
436
		keywordKind[44] = (OCLBacktrackingParsersym.TK_oclAsType);
390
	  
437
	  
391
	
438
	
392
        //
439
        //
393
        // Rule 45:  KeyWord ::= o c l I s N e w
440
        // Rule 45:  KeyWord ::= o c l I s N e w
394
        //
441
        //
395
		keywordKind[45] = (TK_oclIsNew);
442
        
443
		keywordKind[45] = (OCLBacktrackingParsersym.TK_oclIsNew);
396
	  
444
	  
397
	
445
	
398
        //
446
        //
399
        // Rule 46:  KeyWord ::= o c l I s U n d e f i n e d
447
        // Rule 46:  KeyWord ::= o c l I s U n d e f i n e d
400
        //
448
        //
401
		keywordKind[46] = (TK_oclIsUndefined);
449
        
450
		keywordKind[46] = (OCLBacktrackingParsersym.TK_oclIsUndefined);
402
	  
451
	  
403
	
452
	
404
        //
453
        //
405
        // Rule 47:  KeyWord ::= o c l I s I n v a l i d
454
        // Rule 47:  KeyWord ::= o c l I s I n v a l i d
406
        //
455
        //
407
		keywordKind[47] = (TK_oclIsInvalid);
456
        
457
		keywordKind[47] = (OCLBacktrackingParsersym.TK_oclIsInvalid);
408
	  
458
	  
409
	
459
	
410
        //
460
        //
411
        // Rule 48:  KeyWord ::= o c l I s I n S t a t e
461
        // Rule 48:  KeyWord ::= o c l I s I n S t a t e
412
        //
462
        //
413
		keywordKind[48] = (TK_oclIsInState);
463
        
464
		keywordKind[48] = (OCLBacktrackingParsersym.TK_oclIsInState);
414
	  
465
	  
415
	
466
	
416
        //
467
        //
417
        // Rule 49:  KeyWord ::= a l l I n s t a n c e s
468
        // Rule 49:  KeyWord ::= a l l I n s t a n c e s
418
        //
469
        //
419
		keywordKind[49] = (TK_allInstances);
470
        
471
		keywordKind[49] = (OCLBacktrackingParsersym.TK_allInstances);
420
	  
472
	  
421
	
473
	
422
        //
474
        //
423
        // Rule 50:  KeyWord ::= S t r i n g
475
        // Rule 50:  KeyWord ::= S t r i n g
424
        //
476
        //
425
		keywordKind[50] = (TK_String);
477
        
478
		keywordKind[50] = (OCLBacktrackingParsersym.TK_String);
426
	  
479
	  
427
	
480
	
428
        //
481
        //
429
        // Rule 51:  KeyWord ::= I n t e g e r
482
        // Rule 51:  KeyWord ::= I n t e g e r
430
        //
483
        //
431
		keywordKind[51] = (TK_Integer);
484
        
485
		keywordKind[51] = (OCLBacktrackingParsersym.TK_Integer);
432
	  
486
	  
433
	
487
	
434
        //
488
        //
435
        // Rule 52:  KeyWord ::= U n l i m i t e d N a t u r a l
489
        // Rule 52:  KeyWord ::= U n l i m i t e d N a t u r a l
436
        //
490
        //
437
		keywordKind[52] = (TK_UnlimitedNatural);
491
        
492
		keywordKind[52] = (OCLBacktrackingParsersym.TK_UnlimitedNatural);
438
	  
493
	  
439
	
494
	
440
        //
495
        //
441
        // Rule 53:  KeyWord ::= R e a l
496
        // Rule 53:  KeyWord ::= R e a l
442
        //
497
        //
443
		keywordKind[53] = (TK_Real);
498
        
499
		keywordKind[53] = (OCLBacktrackingParsersym.TK_Real);
444
	  
500
	  
445
	
501
	
446
        //
502
        //
447
        // Rule 54:  KeyWord ::= B o o l e a n
503
        // Rule 54:  KeyWord ::= B o o l e a n
448
        //
504
        //
449
		keywordKind[54] = (TK_Boolean);
505
        
506
		keywordKind[54] = (OCLBacktrackingParsersym.TK_Boolean);
450
	  
507
	  
451
	
508
	
452
        //
509
        //
453
        // Rule 55:  KeyWord ::= T u p l e
510
        // Rule 55:  KeyWord ::= T u p l e
454
        //
511
        //
455
		keywordKind[55] = (TK_Tuple);
512
        
513
		keywordKind[55] = (OCLBacktrackingParsersym.TK_Tuple);
456
	  
514
	  
457
	
515
	
458
        //
516
        //
459
        // Rule 56:  KeyWord ::= O c l A n y
517
        // Rule 56:  KeyWord ::= O c l A n y
460
        //
518
        //
461
		keywordKind[56] = (TK_OclAny);
519
        
520
		keywordKind[56] = (OCLBacktrackingParsersym.TK_OclAny);
462
	  
521
	  
463
	
522
	
464
        //
523
        //
465
        // Rule 57:  KeyWord ::= O c l V o i d
524
        // Rule 57:  KeyWord ::= O c l V o i d
466
        //
525
        //
467
		keywordKind[57] = (TK_OclVoid);
526
        
527
		keywordKind[57] = (OCLBacktrackingParsersym.TK_OclVoid);
468
	  
528
	  
469
	
529
	
470
        //
530
        //
471
        // Rule 58:  KeyWord ::= I n v a l i d
531
        // Rule 58:  KeyWord ::= I n v a l i d
472
        //
532
        //
473
		keywordKind[58] = (TK_Invalid);
533
        
534
		keywordKind[58] = (OCLBacktrackingParsersym.TK_Invalid);
474
	  
535
	  
475
	
536
	
476
        //
537
        //
477
        // Rule 59:  KeyWord ::= O c l M e s s a g e
538
        // Rule 59:  KeyWord ::= O c l M e s s a g e
478
        //
539
        //
479
		keywordKind[59] = (TK_OclMessage);
540
        
541
		keywordKind[59] = (OCLBacktrackingParsersym.TK_OclMessage);
480
	  
542
	  
481
	
543
	
482
        //
544
        //
483
        // Rule 60:  KeyWord ::= n u l l
545
        // Rule 60:  KeyWord ::= n u l l
484
        //
546
        //
485
		keywordKind[60] = (TK_null);
547
        
548
		keywordKind[60] = (OCLBacktrackingParsersym.TK_null);
486
	  
549
	  
487
	
550
	
488
        //
551
        //
489
        // Rule 61:  KeyWord ::= O c l I n v a l i d
552
        // Rule 61:  KeyWord ::= O c l I n v a l i d
490
        //
553
        //
491
		keywordKind[61] = (TK_OclInvalid);
554
        
555
		keywordKind[61] = (OCLBacktrackingParsersym.TK_OclInvalid);
492
	  
556
	  
493
	
557
	
494
        //
558
        //
495
        // Rule 62:  KeyWord ::= a t t r
559
        // Rule 62:  KeyWord ::= a t t r
496
        //
560
        //
497
		keywordKind[62] = (TK_attr);
561
        
562
		keywordKind[62] = (OCLBacktrackingParsersym.TK_attr);
498
	  
563
	  
499
	
564
	
500
        //
565
        //
501
        // Rule 63:  KeyWord ::= o p e r
566
        // Rule 63:  KeyWord ::= o p e r
502
        //
567
        //
503
		keywordKind[63] = (TK_oper);
568
        
569
		keywordKind[63] = (OCLBacktrackingParsersym.TK_oper);
504
	  
570
	  
505
	
571
	
506
507
        for (int i = 0; i < keywordKind.length; i++)
572
        for (int i = 0; i < keywordKind.length; i++)
508
        {
573
        {
509
            if (keywordKind[i] == 0)
574
            if (keywordKind[i] == 0)
(-)src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingParsersym.java (-12 / +6 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., 
5
* Open Canarias S.L. and others.
5
* All rights reserved.   This program and the accompanying materials
6
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
7
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
8
* which accompanies this distribution, and is available at
Lines 14-36 Link Here
14
*   E.D.Willink - Bugs 225493, 243976, 259818
15
*   E.D.Willink - Bugs 225493, 243976, 259818
15
*   Zeligsoft - Bug 243976
16
*   Zeligsoft - Bug 243976
16
*   Borland - Bug 242880
17
*   Borland - Bug 242880
18
*   Adolfo Sanchez- Barbudo Herrera - LPG v 2.0.17 adoption
17
*
19
*
18
* </copyright>
20
* </copyright>
19
*
21
*
20
* $Id: OCLBacktrackingParsersym.java,v 1.2 2009/08/28 20:43:11 ewillink Exp $
22
* $Id: EssentialOCL.g,v 1.7 2009/03/05 14:12:14 cdamus Exp $
21
*/
23
*/
22
24
23
package org.eclipse.ocl.parser.backtracking;
25
package org.eclipse.ocl.parser.backtracking;
24
26
25
/**
26
 * The backtracking variant of the OCL parser symbol table.
27
 * 
28
 * @noimplement This interface is not intended to be implemented by clients.
29
 * @noextend This interface is not intended to be extended by clients.
30
 * 
31
 * @since 1.3
32
 */
33
@SuppressWarnings("nls")
34
public interface OCLBacktrackingParsersym {
27
public interface OCLBacktrackingParsersym {
35
    public final static int
28
    public final static int
36
      TK_NUMERIC_OPERATION = 61,
29
      TK_NUMERIC_OPERATION = 61,
Lines 135-141 Link Here
135
      TK_MULTI_LINE_COMMENT = 101,
128
      TK_MULTI_LINE_COMMENT = 101,
136
      TK_ERROR_TOKEN = 1;
129
      TK_ERROR_TOKEN = 1;
137
130
138
      public final static String orderedTerminalSymbols[] = {
131
    public final static String orderedTerminalSymbols[] = {
139
                 "",
132
                 "",
140
                 "ERROR_TOKEN",
133
                 "ERROR_TOKEN",
141
                 "LPAREN",
134
                 "LPAREN",
Lines 240-244 Link Here
240
                 "MULTI_LINE_COMMENT"
233
                 "MULTI_LINE_COMMENT"
241
             };
234
             };
242
235
236
    public final static int numTokenKinds = orderedTerminalSymbols.length;
243
    public final static boolean isValidForParser = true;
237
    public final static boolean isValidForParser = true;
244
}
238
}
(-)src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingLexerprs.java (-44 / +105 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2009 IBM Corporation, Borland Software Corp.,  and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Borland Software Corp., Open Canarias S.L. and others.
5
* All rights reserved.   This program and the accompanying materials
5
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
6
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
7
* which accompanies this distribution, and is available at
Lines 10-25 Link Here
10
* Contributors:
10
* Contributors:
11
*   IBM - Initial API and implementation
11
*   IBM - Initial API and implementation
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
13
*               - Bug 259818
13
*   Borland - Bug 242880
14
*   Borland - Bug 242880
15
*   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
14
*
16
*
15
* </copyright>
17
* </copyright>
16
*
18
*
17
* $Id: OCLBacktrackingLexerprs.java,v 1.2 2009/08/28 20:43:11 ewillink Exp $
19
* $Id$
18
*/
20
*/
19
21
20
package org.eclipse.ocl.parser.backtracking;
22
package org.eclipse.ocl.parser.backtracking;
21
23
22
public class OCLBacktrackingLexerprs implements lpg.lpgjavaruntime.ParseTable, OCLBacktrackingLexersym {
24
public class OCLBacktrackingLexerprs implements lpg.runtime.ParseTable, OCLBacktrackingLexersym {
25
    public final static int ERROR_SYMBOL = 0;
26
    public final int getErrorSymbol() { return ERROR_SYMBOL; }
27
28
    public final static int SCOPE_UBOUND = 0;
29
    public final int getScopeUbound() { return SCOPE_UBOUND; }
30
31
    public final static int SCOPE_SIZE = 0;
32
    public final int getScopeSize() { return SCOPE_SIZE; }
33
34
    public final static int MAX_NAME_LENGTH = 0;
35
    public final int getMaxNameLength() { return MAX_NAME_LENGTH; }
36
37
    public final static int NUM_STATES = 50;
38
    public final int getNumStates() { return NUM_STATES; }
39
40
    public final static int NT_OFFSET = 103;
41
    public final int getNtOffset() { return NT_OFFSET; }
42
43
    public final static int LA_STATE_OFFSET = 824;
44
    public final int getLaStateOffset() { return LA_STATE_OFFSET; }
45
46
    public final static int MAX_LA = 1;
47
    public final int getMaxLa() { return MAX_LA; }
48
49
    public final static int NUM_RULES = 309;
50
    public final int getNumRules() { return NUM_RULES; }
51
52
    public final static int NUM_NONTERMINALS = 44;
53
    public final int getNumNonterminals() { return NUM_NONTERMINALS; }
54
55
    public final static int NUM_SYMBOLS = 147;
56
    public final int getNumSymbols() { return NUM_SYMBOLS; }
57
58
    public final static int SEGMENT_SIZE = 8192;
59
    public final int getSegmentSize() { return SEGMENT_SIZE; }
60
61
    public final static int START_STATE = 310;
62
    public final int getStartState() { return START_STATE; }
63
64
    public final static int IDENTIFIER_SYMBOL = 0;
65
    public final int getIdentifier_SYMBOL() { return IDENTIFIER_SYMBOL; }
66
67
    public final static int EOFT_SYMBOL = 99;
68
    public final int getEoftSymbol() { return EOFT_SYMBOL; }
69
70
    public final static int EOLT_SYMBOL = 104;
71
    public final int getEoltSymbol() { return EOLT_SYMBOL; }
72
73
    public final static int ACCEPT_ACTION = 514;
74
    public final int getAcceptAction() { return ACCEPT_ACTION; }
75
76
    public final static int ERROR_ACTION = 515;
77
    public final int getErrorAction() { return ERROR_ACTION; }
78
79
    public final static boolean BACKTRACK = false;
80
    public final boolean getBacktrack() { return BACKTRACK; }
81
82
    public final int getStartSymbol() { return lhs(0); }
83
    public final boolean isValidForParser() { return OCLBacktrackingLexersym.isValidForParser; }
84
85
86
    public interface IsNullable {
87
        public final static byte isNullable[] = {0,
88
            0,0,0,0,0,0,0,0,0,0,
89
            0,0,0,0,0,0,0,0,0,0,
90
            0,0,0,0,0,0,0,0,0,0,
91
            0,0,0,0,0,0,0,0,0,0,
92
            0,0,0,0,0,0,0,0,0,0,
93
            0,0,0,0,0,0,0,0,0,0,
94
            0,0,0,0,0,0,0,0,0,0,
95
            0,0,0,0,0,0,0,0,0,0,
96
            0,0,0,0,0,0,0,0,0,0,
97
            0,0,0,0,0,0,0,0,0,0,
98
            0,0,0,0,0,0,0,0,0,0,
99
            0,0,0,0,0,0,1,0,0,0,
100
            0,0,0,0,0,0,0,0,0,0,
101
            0,1,0,0,0,0,0,0,0,0,
102
            0,0,0,0,0,0,0
103
        };
104
    };
105
    public final static byte isNullable[] = IsNullable.isNullable;
106
    public final boolean isNullable(int index) { return isNullable[index] != 0; }
107
108
    public interface ProsthesesIndex {
109
        public final static byte prosthesesIndex[] = {0,
110
            20,25,26,27,35,4,15,37,40,43,
111
            24,5,3,6,17,18,23,32,34,36,
112
            41,42,2,7,8,9,10,11,12,13,
113
            14,16,19,33,38,39,44,1,21,22,
114
            28,29,30,31
115
        };
116
    };
117
    public final static byte prosthesesIndex[] = ProsthesesIndex.prosthesesIndex;
118
    public final int prosthesesIndex(int index) { return prosthesesIndex[index]; }
23
119
24
    public interface IsKeyword {
120
    public interface IsKeyword {
25
        public final static byte isKeyword[] = {0,
121
        public final static byte isKeyword[] = {0,
Lines 476-531 Link Here
476
    public final int scopeState(int index) { return 0;}
572
    public final int scopeState(int index) { return 0;}
477
    public final int inSymb(int index) { return 0;}
573
    public final int inSymb(int index) { return 0;}
478
    public final String name(int index) { return null; }
574
    public final String name(int index) { return null; }
479
    public final int getErrorSymbol() { return 0; }
480
    public final int getScopeUbound() { return 0; }
481
    public final int getScopeSize() { return 0; }
482
    public final int getMaxNameLength() { return 0; }
483
484
    public final static int
485
           NUM_STATES        = 50,
486
           NT_OFFSET         = 103,
487
           LA_STATE_OFFSET   = 824,
488
           MAX_LA            = 1,
489
           NUM_RULES         = 309,
490
           NUM_NONTERMINALS  = 44,
491
           NUM_SYMBOLS       = 147,
492
           SEGMENT_SIZE      = 8192,
493
           START_STATE       = 310,
494
           IDENTIFIER_SYMBOL = 0,
495
           EOFT_SYMBOL       = 99,
496
           EOLT_SYMBOL       = 104,
497
           ACCEPT_ACTION     = 514,
498
           ERROR_ACTION      = 515;
499
500
    public final static boolean BACKTRACK = false;
501
502
    public final int getNumStates() { return NUM_STATES; }
503
    public final int getNtOffset() { return NT_OFFSET; }
504
    public final int getLaStateOffset() { return LA_STATE_OFFSET; }
505
    public final int getMaxLa() { return MAX_LA; }
506
    public final int getNumRules() { return NUM_RULES; }
507
    public final int getNumNonterminals() { return NUM_NONTERMINALS; }
508
    public final int getNumSymbols() { return NUM_SYMBOLS; }
509
    public final int getSegmentSize() { return SEGMENT_SIZE; }
510
    public final int getStartState() { return START_STATE; }
511
    public final int getStartSymbol() { return lhs[0]; }
512
    public final int getIdentifierSymbol() { return IDENTIFIER_SYMBOL; }
513
    public final int getEoftSymbol() { return EOFT_SYMBOL; }
514
    public final int getEoltSymbol() { return EOLT_SYMBOL; }
515
    public final int getAcceptAction() { return ACCEPT_ACTION; }
516
    public final int getErrorAction() { return ERROR_ACTION; }
517
    public final boolean isValidForParser() { return isValidForParser; }
518
    public final boolean getBacktrack() { return BACKTRACK; }
519
520
    public final int originalState(int state) { return 0; }
575
    public final int originalState(int state) { return 0; }
521
    public final int asi(int state) { return 0; }
576
    public final int asi(int state) { return 0; }
522
    public final int nasi(int state) { return 0; }
577
    public final int nasi(int state) { return 0; }
523
    public final int inSymbol(int state) { return 0; }
578
    public final int inSymbol(int state) { return 0; }
524
579
580
    /**
581
     * assert(! goto_default);
582
     */
525
    public final int ntAction(int state, int sym) {
583
    public final int ntAction(int state, int sym) {
526
        return baseAction[state + sym];
584
        return baseAction[state + sym];
527
    }
585
    }
528
586
587
    /**
588
     * assert(! shift_default);
589
     */
529
    public final int tAction(int state, int sym) {
590
    public final int tAction(int state, int sym) {
530
        int i = baseAction[state],
591
        int i = baseAction[state],
531
            k = i + sym;
592
            k = i + sym;
(-)src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingParser.java (-1236 / +2100 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., 
5
* Open Canarias S.L. and others.
5
* All rights reserved.   This program and the accompanying materials
6
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
7
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
8
* which accompanies this distribution, and is available at
Lines 14-23 Link Here
14
*   E.D.Willink - Bugs 225493, 243976, 259818
15
*   E.D.Willink - Bugs 225493, 243976, 259818
15
*   Zeligsoft - Bug 243976
16
*   Zeligsoft - Bug 243976
16
*   Borland - Bug 242880
17
*   Borland - Bug 242880
18
*   Adolfo Sanchez- Barbudo Herrera - LPG v 2.0.17 adoption
17
*
19
*
18
* </copyright>
20
* </copyright>
19
*
21
*
20
* $Id: OCLBacktrackingParser.java,v 1.3 2009/08/28 20:43:11 ewillink Exp $
22
* $Id: EssentialOCL.g,v 1.7 2009/03/05 14:12:14 cdamus Exp $
21
*/
23
*/
22
24
23
package org.eclipse.ocl.parser.backtracking;
25
package org.eclipse.ocl.parser.backtracking;
Lines 43-58 Link Here
43
import org.eclipse.ocl.cst.VariableCS;
45
import org.eclipse.ocl.cst.VariableCS;
44
import org.eclipse.ocl.util.OCLStandardLibraryUtil;
46
import org.eclipse.ocl.util.OCLStandardLibraryUtil;
45
import org.eclipse.ocl.utilities.PredefinedType;
47
import org.eclipse.ocl.utilities.PredefinedType;
48
import org.eclipse.ocl.lpg.OCLParserStream;
46
49
47
import lpg.lpgjavaruntime.BadParseException;
50
import lpg.runtime.BadParseException;
48
import lpg.lpgjavaruntime.BadParseSymFileException;
51
import lpg.runtime.BadParseSymFileException;
49
import lpg.lpgjavaruntime.BacktrackingParser;
52
import lpg.runtime.BacktrackingParser;
50
import lpg.lpgjavaruntime.DiagnoseParser;
53
import lpg.runtime.DiagnoseParser;
51
import lpg.lpgjavaruntime.IToken;
54
import lpg.runtime.ErrorToken;
52
import lpg.lpgjavaruntime.Monitor;
55
import lpg.runtime.IToken;
53
import lpg.lpgjavaruntime.NotBacktrackParseTableException;
56
import lpg.runtime.ILexStream;
54
import lpg.lpgjavaruntime.ParseTable;
57
import lpg.runtime.Monitor;
55
import lpg.lpgjavaruntime.RuleAction;
58
import lpg.runtime.NotBacktrackParseTableException;
59
import lpg.runtime.NullExportedSymbolsException;
60
import lpg.runtime.NullTerminalSymbolsException;
61
import lpg.runtime.ParseTable;
62
import lpg.runtime.PrsStream;
63
import lpg.runtime.RuleAction;
64
import lpg.runtime.UndefinedEofSymbolException;
65
import lpg.runtime.UnimplementedTerminalsException;	
56
66
57
import org.eclipse.ocl.Environment;
67
import org.eclipse.ocl.Environment;
58
import org.eclipse.ocl.cst.DefExpressionCS;
68
import org.eclipse.ocl.cst.DefExpressionCS;
Lines 66-161 Link Here
66
76
67
public class OCLBacktrackingParser extends AbstractOCLParser implements RuleAction
77
public class OCLBacktrackingParser extends AbstractOCLParser implements RuleAction
68
{
78
{
69
	protected static ParseTable prs = new OCLBacktrackingParserprs();
79
	private OCLParserStream prsStream = null;
70
	private BacktrackingParser dtParser;
80
	
71
81
	private boolean unimplementedSymbolsWarning = false;
72
	public OCLBacktrackingParser(OCLBacktrackingLexer lexer) {
73
		super(lexer);
74
	}
75
76
	public int getEOFTokenKind() { return OCLBacktrackingParserprs.EOFT_SYMBOL; }
77
82
78
	public Environment<?,?,?,?,?,?,?,?,?,?,?,?> getOCLEnvironment() {
83
	private static ParseTable prsTable = new OCLBacktrackingParserprs();
79
		return getLexer().getOCLEnvironment();
84
	public ParseTable getParseTable() { return prsTable; }
80
	}
81
	
85
	
82
	@Override 
86
	private BacktrackingParser dtParser = null;
83
	public OCLBacktrackingLexer getLexer() {
87
	public BacktrackingParser getParser() { return dtParser; }
84
		return (OCLBacktrackingLexer)super.getLexer();
88
	
85
	}
89
	 private void setResult(Object object) { dtParser.setSym1(object); }
90
    public Object getRhsSym(int i) { return dtParser.getSym(i); }
86
91
87
	public String getTokenKindName(int kind) { return OCLBacktrackingParsersym.orderedTerminalSymbols[kind]; }			
92
    public int getRhsTokenIndex(int i) { return dtParser.getToken(i); }
93
    public IToken getRhsIToken(int i) { return prsStream.getIToken(getRhsTokenIndex(i)); }
94
    
95
    public int getRhsFirstTokenIndex(int i) { return dtParser.getFirstToken(i); }
96
    public IToken getRhsFirstIToken(int i) { return prsStream.getIToken(getRhsFirstTokenIndex(i)); }
97
98
    public int getRhsLastTokenIndex(int i) { return dtParser.getLastToken(i); }
99
    public IToken getRhsLastIToken(int i) { return prsStream.getIToken(getRhsLastTokenIndex(i)); }
100
101
    public int getLeftSpan() { return dtParser.getFirstToken(); }
102
    public IToken getLeftIToken()  { return prsStream.getIToken(getLeftSpan()); }
103
104
    public int getRightSpan() { return dtParser.getLastToken(); }
105
    public IToken getRightIToken() { return prsStream.getIToken(getRightSpan()); }
106
107
    public int getRhsErrorTokenIndex(int i)
108
    {
109
        int index = dtParser.getToken(i);
110
        IToken err = prsStream.getIToken(index);
111
        return (err instanceof ErrorToken ? index : 0);
112
    }
113
    public ErrorToken getRhsErrorIToken(int i)
114
    {
115
        int index = dtParser.getToken(i);
116
        IToken err = prsStream.getIToken(index);
117
        return (ErrorToken) (err instanceof ErrorToken ? err : null);
118
    }
119
120
	public void reset(ILexStream lexStream)
121
    {
122
        prsStream = new OCLParserStream(getEnvironment(), lexStream);
123
        dtParser.reset(prsStream);
124
125
        try
126
        {
127
            prsStream.remapTerminalSymbols(orderedTerminalSymbols(), prsTable.getEoftSymbol());
128
        }
129
        catch(NullExportedSymbolsException e) {
130
        }
131
        catch(NullTerminalSymbolsException e) {
132
        }
133
        catch(UnimplementedTerminalsException e)
134
        {
135
            if (unimplementedSymbolsWarning) {
136
                java.util.ArrayList<?> unimplemented_symbols = e.getSymbols();
137
                System.out.println("The Lexer will not scan the following token(s):");
138
                for (int i = 0; i < unimplemented_symbols.size(); i++)
139
                {
140
                    Integer id = (Integer) unimplemented_symbols.get(i);
141
                    System.out.println("    " + OCLBacktrackingParsersym.orderedTerminalSymbols[id.intValue()]);               
142
                }
143
                System.out.println();
144
            }
145
        }
146
        catch(UndefinedEofSymbolException e)
147
        {
148
            throw new Error(new UndefinedEofSymbolException
149
                                ("The Lexer does not implement the Eof symbol " +
150
                                 OCLBacktrackingParsersym.orderedTerminalSymbols[prsTable.getEoftSymbol()]));
151
        }
152
    }
153
154
    public OCLBacktrackingParser(OCLBacktrackingLexer lexer)
155
    {
156
    		super(lexer);        		
157
        try
158
        {
159
            dtParser = new BacktrackingParser(prsStream, prsTable, this);
160
        }
161
        catch (NotBacktrackParseTableException e)
162
        {
163
            throw new RuntimeException("****Error: Regenerate OCLBacktrackingParserprs.java with -BACKTRACK option");
164
        }
165
        catch (BadParseSymFileException e)
166
        {
167
            throw new Error(new BadParseSymFileException("Bad Parser Symbol File -- OCLBacktrackingParsersym.java. Regenerate OCLBacktrackingParserprs.java"));
168
        }
169
        
170
        reset(lexer.getILexStream());
171
    }		
172
173
    public int numTokenKinds() { return OCLBacktrackingParsersym.numTokenKinds; }
174
    public String[] orderedTerminalSymbols() { return OCLBacktrackingParsersym.orderedTerminalSymbols; }
175
    public String getTokenKindName(int kind) { return OCLBacktrackingParsersym.orderedTerminalSymbols[kind]; }            
176
    public int getEOFTokenKind() { return prsTable.getEoftSymbol(); }
177
    public OCLParserStream getIPrsStream() { return prsStream; }
88
178
89
	@Override
179
    /**
90
	public String[] orderedTerminalSymbols() { return OCLBacktrackingParsersym.orderedTerminalSymbols; }
180
     * @deprecated replaced by {@link #getIPrsStream()}
91
		
181
     *
92
	@SuppressWarnings("nls")
182
     */
93
	@Override
183
    public PrsStream getPrsStream() { return prsStream; }
94
	public CSTNode parseTokensToCST(Monitor monitor, int error_repair_count) {
95
		ParseTable prsTable = new OCLBacktrackingParserprs();
96
184
97
		try {
185
    /**
98
			dtParser = new BacktrackingParser(monitor, this, prsTable, this);
186
     * @deprecated replaced by {@link #getIPrsStream()}
99
		}
187
     *
100
		catch (NotBacktrackParseTableException e) {
188
     */
101
            throw new RuntimeException("****Error: Regenerate OCLBacktrackingParserprs.java with -BACKTRACK option");
189
    public PrsStream getParseStream() { return prsStream; }
102
		}
103
		catch (BadParseSymFileException e) {
104
			throw new RuntimeException("****Error: Bad Parser Symbol File -- OCLBacktrackingParsersym.java. Regenerate OCLBacktrackingParserprs.java");
105
		}
106
190
107
		try {
191
    public CSTNode parser()
108
			return (CSTNode) dtParser.parse(error_repair_count);
192
    {
109
		}
193
        return parser(null, getDefaultRepairCount());
110
		catch (BadParseException e) {
194
    }
111
			reset(e.error_token); // point to error token
195
        
196
    public CSTNode parser(Monitor monitor)
197
    {
198
        return parser(monitor, getDefaultRepairCount());
199
    }
200
        
201
    public CSTNode parser(int error_repair_count)
202
    {
203
        return parser(null, error_repair_count);
204
    }
205
        
206
    public CSTNode parser(Monitor monitor, int error_repair_count)
207
    {
208
        dtParser.setMonitor(monitor);
209
210
        try
211
        {
212
            return (CSTNode) dtParser.parse();
213
        }
214
        catch (BadParseException e)
215
        {
216
            prsStream.reset(e.error_token); // point to error token
217
218
            DiagnoseParser diagnoseParser = new DiagnoseParser(prsStream, prsTable);
219
            diagnoseParser.diagnose(e.error_token);
220
        }
221
222
        return null;
223
    }
224
225
    //
226
    // Additional entry points, if any
227
    //
228
    
112
229
113
			DiagnoseParser diagnoseParser = new DiagnoseParser(this, prsTable);
230
    // OCL Additions
114
			diagnoseParser.diagnose(e.error_token);
115
		}
116
231
117
		return null;
232
	public Environment<?,?,?,?,?,?,?,?,?,?,?,?> getOCLEnvironment() {
233
		return getLexer().getOCLEnvironment();
118
	}
234
	}
119
235
	
120
    /**
236
	@Override
121
     * Initializes a concrete-syntax node's start and end offsets from the
237
	public OCLBacktrackingLexer getLexer() {
122
     * current token in the parser stream.
238
		return (OCLBacktrackingLexer) super.getLexer();
123
     * 
124
     * @param cstNode a concrete-syntax node
125
     * 
126
     * @since 1.2
127
     */
128
	protected void setOffsets(CSTNode cstNode) {
129
		IToken firstToken = getIToken(dtParser.getToken(1));
130
		cstNode.setStartToken(firstToken);
131
		cstNode.setEndToken(firstToken);
132
		cstNode.setStartOffset(firstToken.getStartOffset());
133
		cstNode.setEndOffset(firstToken.getEndOffset()-1);
134
	}
239
	}
135
240
136
241
242
// Some methods to keep compatibility backwards
243
/**
244
* @since 3.0
245
*/
246
protected IToken getIToken(int i) {
247
	return prsStream.getIToken(i);
248
}
249
	
250
protected String getTokenText(int i) {
251
	return prsStream.getTokenText(i);
252
}
253
137
254
138
	@SuppressWarnings("unchecked")
255
	@SuppressWarnings("unchecked")
139
	public void ruleAction(int ruleNumber)
256
    public void ruleAction(int ruleNumber)
140
	{
257
    {
141
		switch (ruleNumber) {
258
        switch (ruleNumber)
142
		
259
        {
143
 
260
 
144
			//
261
			//
145
			// Rule 46:  binaryName ::= binaryIdentifier
262
			// Rule 46:  binaryName ::= binaryIdentifier
146
			//
263
			//
264
			
147
			case 46:
265
			case 46:
148
 
266
 
149
			//
267
			//
150
			// Rule 47:  keywordAsName ::= keywordAsIdentifier
268
			// Rule 47:  keywordAsName ::= keywordAsIdentifier
151
			//
269
			//
270
			
152
			case 47:
271
			case 47:
153
 
272
 
154
			//
273
			//
155
			// Rule 48:  keywordAsName1 ::= keywordAsIdentifier1
274
			// Rule 48:  keywordAsName1 ::= keywordAsIdentifier1
156
			//
275
			//
276
			
157
			case 48:
277
			case 48:
158
 
278
159
			//
279
			//
160
			// Rule 49:  unaryName ::= unaryIdentifier
280
			// Rule 49:  unaryName ::= unaryIdentifier
161
			//
281
			//
Lines 163-185 Link Here
163
				
283
				
164
				SimpleNameCS result = createSimpleNameCS(
284
				SimpleNameCS result = createSimpleNameCS(
165
							SimpleTypeEnum.IDENTIFIER_LITERAL,
285
							SimpleTypeEnum.IDENTIFIER_LITERAL,
166
							getTokenText(dtParser.getToken(1))
286
							getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
287
            getParser().getToken(1))
167
						);
288
						);
168
				setOffsets(result, getIToken(dtParser.getToken(1)));
289
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
169
				dtParser.setSym1(result);
290
            getParser().getToken(1)));
170
	  		  break;
291
				 // macro setResult is deprecated. Use function setResult
171
			}
292
             getParser().setSym1(result);
293
	                  break;
294
            }
172
	 
295
	 
173
			//
296
			//
174
			// Rule 50:  iterateName ::= iterate
297
			// Rule 50:  iterateName ::= iterate
175
			//
298
			//
299
			
176
			case 50:
300
			case 50:
177
 
301
 
178
			//
302
			//
179
			// Rule 51:  iteratorName ::= iteratorIdentifier
303
			// Rule 51:  iteratorName ::= iteratorIdentifier
180
			//
304
			//
305
			
181
			case 51:
306
			case 51:
182
 
307
183
			//
308
			//
184
			// Rule 52:  oclIsInStateName ::= oclIsInState
309
			// Rule 52:  oclIsInStateName ::= oclIsInState
185
			//
310
			//
Lines 187-309 Link Here
187
				
312
				
188
				SimpleNameCS result = createSimpleNameCS(
313
				SimpleNameCS result = createSimpleNameCS(
189
							SimpleTypeEnum.KEYWORD_LITERAL,
314
							SimpleTypeEnum.KEYWORD_LITERAL,
190
							getTokenText(dtParser.getToken(1))
315
							getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
316
            getParser().getToken(1))
191
						);
317
						);
192
				setOffsets(result, getIToken(dtParser.getToken(1)));
318
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
193
				dtParser.setSym1(result);
319
            getParser().getToken(1)));
194
	  		  break;
320
				 // macro setResult is deprecated. Use function setResult
195
			}
321
             getParser().setSym1(result);
196
	 
322
	                  break;
323
            }
324
	
197
			//
325
			//
198
			// Rule 55:  operationCS1 ::= IDENTIFIER ( parametersCSopt ) : typeCSopt
326
			// Rule 55:  operationCS1 ::= IDENTIFIER ( parametersCSopt ) : typeCSopt
199
			//
327
			//
200
			case 55: {
328
			case 55: {
201
				
329
				
202
				CSTNode result = createOperationCS(
330
				CSTNode result = createOperationCS(
203
						getTokenText(dtParser.getToken(1)),
331
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
204
						(EList)dtParser.getSym(3),
332
            getParser().getToken(1)),
205
						(TypeCS)dtParser.getSym(6)
333
						(EList) // macro getSym is deprecated. Use function getRhsSym
206
					);
334
          getParser().getSym(3),
207
				if (dtParser.getSym(6) != null) {
335
						(TypeCS) // macro getSym is deprecated. Use function getRhsSym
208
					setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(6));
336
          getParser().getSym(6)
337
					);
338
				if ( // macro getSym is deprecated. Use function getRhsSym
339
          getParser().getSym(6) != null) {
340
					setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
341
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
342
          getParser().getSym(6));
209
				} else {
343
				} else {
210
					setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(5)));
344
					setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
345
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
346
            getParser().getToken(5)));
211
				}
347
				}
212
				dtParser.setSym1(result);
348
				 // macro setResult is deprecated. Use function setResult
213
	  		  break;
349
             getParser().setSym1(result);
214
			}
350
	                  break;
215
	 
351
            }
352
	
216
			//
353
			//
217
			// Rule 56:  operationCS2 ::= pathNameCS :: simpleNameCS ( parametersCSopt ) : typeCSopt
354
			// Rule 56:  operationCS2 ::= pathNameCS :: simpleNameCS ( parametersCSopt ) : typeCSopt
218
			//
355
			//
219
			case 56: {
356
			case 56: {
220
				
357
				
221
				CSTNode result = createOperationCS(
358
				CSTNode result = createOperationCS(
222
						(PathNameCS)dtParser.getSym(1),
359
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
223
						(SimpleNameCS)dtParser.getSym(3),
360
          getParser().getSym(1),
224
						(EList)dtParser.getSym(5),
361
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
225
						(TypeCS)dtParser.getSym(8)
362
          getParser().getSym(3),
226
					);
363
						(EList) // macro getSym is deprecated. Use function getRhsSym
227
				if (dtParser.getSym(8) != null) {
364
          getParser().getSym(5),
228
					setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(8));
365
						(TypeCS) // macro getSym is deprecated. Use function getRhsSym
366
          getParser().getSym(8)
367
					);
368
				if ( // macro getSym is deprecated. Use function getRhsSym
369
          getParser().getSym(8) != null) {
370
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
371
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
372
          getParser().getSym(8));
229
				} else {
373
				} else {
230
					setOffsets(result, (CSTNode)dtParser.getSym(1), getIToken(dtParser.getToken(7)));
374
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
375
          getParser().getSym(1), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
376
            getParser().getToken(7)));
231
				}
377
				}
232
				dtParser.setSym1(result);
378
				 // macro setResult is deprecated. Use function setResult
233
	  		  break;
379
             getParser().setSym1(result);
234
			}
380
	                  break;
381
            }
235
	 
382
	 
236
			//
383
			//
237
			// Rule 57:  parametersCSopt ::= $Empty
384
			// Rule 57:  parametersCSopt ::= $Empty
238
			//
385
			//
386
			
239
			case 57:
387
			case 57:
240
				dtParser.setSym1(new BasicEList());
388
				setResult(new BasicEList());
241
				break;
389
				break;
242
 
390
243
			//
391
			//
244
			// Rule 59:  parametersCS ::= variableCS
392
			// Rule 59:  parametersCS ::= variableCS
245
			//
393
			//
246
			case 59: {
394
			case 59: {
247
				
395
				
248
				EList result = new BasicEList();
396
				EList result = new BasicEList();
249
				result.add(dtParser.getSym(1));
397
				result.add( // macro getSym is deprecated. Use function getRhsSym
250
				dtParser.setSym1(result);
398
          getParser().getSym(1));
251
	  		  break;
399
				 // macro setResult is deprecated. Use function setResult
252
			}
400
             getParser().setSym1(result);
253
	 
401
	                  break;
402
            }
403
	
254
			//
404
			//
255
			// Rule 60:  parametersCS ::= parametersCS , variableCS
405
			// Rule 60:  parametersCS ::= parametersCS , variableCS
256
			//
406
			//
257
			case 60: {
407
			case 60: {
258
				
408
				
259
				EList result = (EList)dtParser.getSym(1);
409
				EList result = (EList) // macro getSym is deprecated. Use function getRhsSym
260
				result.add(dtParser.getSym(3));
410
          getParser().getSym(1);
261
				dtParser.setSym1(result);
411
				result.add( // macro getSym is deprecated. Use function getRhsSym
262
	  		  break;
412
          getParser().getSym(3));
263
			}
413
				 // macro setResult is deprecated. Use function setResult
264
	 
414
             getParser().setSym1(result);
415
	                  break;
416
            }
417
	
265
			//
418
			//
266
			// Rule 61:  simpleNameCSopt ::= $Empty
419
			// Rule 61:  simpleNameCSopt ::= $Empty
267
			//
420
			//
268
			case 61:
421
			case 61:
269
				dtParser.setSym1(null);
422
                setResult(null);
270
				break;
423
                break;
271
 
424
 
272
			//
425
			//
273
			// Rule 67:  impliesExpCS ::= impliesExpCS implies andOrXorExpCS
426
			// Rule 67:  impliesExpCS ::= impliesExpCS implies andOrXorExpCS
274
			//
427
			//
428
			
275
			case 67:
429
			case 67:
276
 
430
 
277
			//
431
			//
278
			// Rule 68:  impliesWithLet ::= impliesExpCS implies andOrXorWithLet
432
			// Rule 68:  impliesWithLet ::= impliesExpCS implies andOrXorWithLet
279
			//
433
			//
434
			
280
			case 68:
435
			case 68:
281
 
436
 
282
			//
437
			//
283
			// Rule 71:  andOrXorExpCS ::= andOrXorExpCS and equalityExpCS
438
			// Rule 71:  andOrXorExpCS ::= andOrXorExpCS and equalityExpCS
284
			//
439
			//
440
			
285
			case 71:
441
			case 71:
286
 
442
 
287
			//
443
			//
288
			// Rule 72:  andOrXorExpCS ::= andOrXorExpCS or equalityExpCS
444
			// Rule 72:  andOrXorExpCS ::= andOrXorExpCS or equalityExpCS
289
			//
445
			//
446
			
290
			case 72:
447
			case 72:
291
 
448
 
292
			//
449
			//
293
			// Rule 73:  andOrXorExpCS ::= andOrXorExpCS xor equalityExpCS
450
			// Rule 73:  andOrXorExpCS ::= andOrXorExpCS xor equalityExpCS
294
			//
451
			//
452
			
295
			case 73:
453
			case 73:
296
 
454
 
297
			//
455
			//
298
			// Rule 74:  andOrXorWithLet ::= andOrXorExpCS and equalityWithLet
456
			// Rule 74:  andOrXorWithLet ::= andOrXorExpCS and equalityWithLet
299
			//
457
			//
458
			
300
			case 74:
459
			case 74:
301
 
460
 
302
			//
461
			//
303
			// Rule 75:  andOrXorWithLet ::= andOrXorExpCS or equalityWithLet
462
			// Rule 75:  andOrXorWithLet ::= andOrXorExpCS or equalityWithLet
304
			//
463
			//
464
			
305
			case 75:
465
			case 75:
306
 
466
307
			//
467
			//
308
			// Rule 76:  andOrXorWithLet ::= andOrXorExpCS xor equalityWithLet
468
			// Rule 76:  andOrXorWithLet ::= andOrXorExpCS xor equalityWithLet
309
			//
469
			//
Lines 311-336 Link Here
311
				
471
				
312
				SimpleNameCS simpleNameCS = createSimpleNameCS(
472
				SimpleNameCS simpleNameCS = createSimpleNameCS(
313
							SimpleTypeEnum.STRING_LITERAL,
473
							SimpleTypeEnum.STRING_LITERAL,
314
							getTokenText(dtParser.getToken(2))
474
							getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
475
            getParser().getToken(2))
315
						);
476
						);
316
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
477
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
478
            getParser().getToken(2)));
317
				EList args = new BasicEList();
479
				EList args = new BasicEList();
318
				args.add(dtParser.getSym(3));
480
				args.add( // macro getSym is deprecated. Use function getRhsSym
481
          getParser().getSym(3));
319
				CSTNode result = createOperationCallExpCS(
482
				CSTNode result = createOperationCallExpCS(
320
						(OCLExpressionCS)dtParser.getSym(1),
483
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
484
          getParser().getSym(1),
321
						simpleNameCS,
485
						simpleNameCS,
322
						args
486
						args
323
					);
487
					);
324
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
488
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
325
				dtParser.setSym1(result);
489
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
326
	  		  break;
490
          getParser().getSym(3));
327
			}
491
				 // macro setResult is deprecated. Use function setResult
492
             getParser().setSym1(result);
493
	                  break;
494
            }
328
	 
495
	 
329
			//
496
			//
330
			// Rule 79:  equalityExpCS ::= equalityExpCS = relationalExpCS
497
			// Rule 79:  equalityExpCS ::= equalityExpCS = relationalExpCS
331
			//
498
			//
499
			
332
			case 79:
500
			case 79:
333
 
501
334
			//
502
			//
335
			// Rule 80:  equalityWithLet ::= equalityExpCS = relationalWithLet
503
			// Rule 80:  equalityWithLet ::= equalityExpCS = relationalWithLet
336
			//
504
			//
Lines 340-363 Link Here
340
							SimpleTypeEnum.STRING_LITERAL,
508
							SimpleTypeEnum.STRING_LITERAL,
341
							OCLStandardLibraryUtil.getOperationName(PredefinedType.EQUAL)
509
							OCLStandardLibraryUtil.getOperationName(PredefinedType.EQUAL)
342
						);
510
						);
343
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
511
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
512
            getParser().getToken(2)));
344
				EList args = new BasicEList();
513
				EList args = new BasicEList();
345
				args.add(dtParser.getSym(3));
514
				args.add( // macro getSym is deprecated. Use function getRhsSym
515
          getParser().getSym(3));
346
				CSTNode result = createOperationCallExpCS(
516
				CSTNode result = createOperationCallExpCS(
347
						(OCLExpressionCS)dtParser.getSym(1),
517
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
518
          getParser().getSym(1),
348
						simpleNameCS,
519
						simpleNameCS,
349
						args
520
						args
350
					);
521
					);
351
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
522
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
352
				dtParser.setSym1(result);
523
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
353
	  		  break;
524
          getParser().getSym(3));
354
			}
525
				 // macro setResult is deprecated. Use function setResult
526
             getParser().setSym1(result);
527
	                  break;
528
            }
355
	 
529
	 
356
			//
530
			//
357
			// Rule 81:  equalityExpCS ::= equalityExpCS <> relationalExpCS
531
			// Rule 81:  equalityExpCS ::= equalityExpCS <> relationalExpCS
358
			//
532
			//
533
			
359
			case 81:
534
			case 81:
360
 
535
361
			//
536
			//
362
			// Rule 82:  equalityWithLet ::= equalityExpCS <> relationalWithLet
537
			// Rule 82:  equalityWithLet ::= equalityExpCS <> relationalWithLet
363
			//
538
			//
Lines 367-390 Link Here
367
							SimpleTypeEnum.STRING_LITERAL,
542
							SimpleTypeEnum.STRING_LITERAL,
368
							OCLStandardLibraryUtil.getOperationName(PredefinedType.NOT_EQUAL)
543
							OCLStandardLibraryUtil.getOperationName(PredefinedType.NOT_EQUAL)
369
						);
544
						);
370
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
545
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
546
            getParser().getToken(2)));
371
				EList args = new BasicEList();
547
				EList args = new BasicEList();
372
				args.add(dtParser.getSym(3));
548
				args.add( // macro getSym is deprecated. Use function getRhsSym
549
          getParser().getSym(3));
373
				CSTNode result = createOperationCallExpCS(
550
				CSTNode result = createOperationCallExpCS(
374
						(OCLExpressionCS)dtParser.getSym(1),
551
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
552
          getParser().getSym(1),
375
						simpleNameCS,
553
						simpleNameCS,
376
						args
554
						args
377
					);
555
					);
378
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
556
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
379
				dtParser.setSym1(result);
557
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
380
	  		  break;
558
          getParser().getSym(3));
381
			}
559
				 // macro setResult is deprecated. Use function setResult
560
             getParser().setSym1(result);
561
	                  break;
562
            }
382
	 
563
	 
383
			//
564
			//
384
			// Rule 85:  relationalExpCS ::= relationalExpCS > ifExpCSPrec
565
			// Rule 85:  relationalExpCS ::= relationalExpCS > ifExpCSPrec
385
			//
566
			//
567
			
386
			case 85:
568
			case 85:
387
 
569
388
			//
570
			//
389
			// Rule 86:  relationalWithLet ::= relationalExpCS > additiveWithLet
571
			// Rule 86:  relationalWithLet ::= relationalExpCS > additiveWithLet
390
			//
572
			//
Lines 394-417 Link Here
394
							SimpleTypeEnum.STRING_LITERAL,
576
							SimpleTypeEnum.STRING_LITERAL,
395
							OCLStandardLibraryUtil.getOperationName(PredefinedType.GREATER_THAN)
577
							OCLStandardLibraryUtil.getOperationName(PredefinedType.GREATER_THAN)
396
						);
578
						);
397
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
579
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
580
            getParser().getToken(2)));
398
				EList args = new BasicEList();
581
				EList args = new BasicEList();
399
				args.add(dtParser.getSym(3));
582
				args.add( // macro getSym is deprecated. Use function getRhsSym
583
          getParser().getSym(3));
400
				CSTNode result = createOperationCallExpCS(
584
				CSTNode result = createOperationCallExpCS(
401
						(OCLExpressionCS)dtParser.getSym(1),
585
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
586
          getParser().getSym(1),
402
						simpleNameCS,
587
						simpleNameCS,
403
						args
588
						args
404
					);
589
					);
405
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
590
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
406
				dtParser.setSym1(result);
591
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
407
	  		  break;
592
          getParser().getSym(3));
408
			}
593
				 // macro setResult is deprecated. Use function setResult
594
             getParser().setSym1(result);
595
	                  break;
596
            }
409
	 
597
	 
410
			//
598
			//
411
			// Rule 87:  relationalExpCS ::= relationalExpCS < ifExpCSPrec
599
			// Rule 87:  relationalExpCS ::= relationalExpCS < ifExpCSPrec
412
			//
600
			//
601
			
413
			case 87:
602
			case 87:
414
 
603
415
			//
604
			//
416
			// Rule 88:  relationalWithLet ::= relationalExpCS < additiveWithLet
605
			// Rule 88:  relationalWithLet ::= relationalExpCS < additiveWithLet
417
			//
606
			//
Lines 421-444 Link Here
421
							SimpleTypeEnum.STRING_LITERAL,
610
							SimpleTypeEnum.STRING_LITERAL,
422
							OCLStandardLibraryUtil.getOperationName(PredefinedType.LESS_THAN)
611
							OCLStandardLibraryUtil.getOperationName(PredefinedType.LESS_THAN)
423
						);
612
						);
424
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
613
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
614
            getParser().getToken(2)));
425
				EList args = new BasicEList();
615
				EList args = new BasicEList();
426
				args.add(dtParser.getSym(3));
616
				args.add( // macro getSym is deprecated. Use function getRhsSym
617
          getParser().getSym(3));
427
				CSTNode result = createOperationCallExpCS(
618
				CSTNode result = createOperationCallExpCS(
428
						(OCLExpressionCS)dtParser.getSym(1),
619
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
620
          getParser().getSym(1),
429
						simpleNameCS,
621
						simpleNameCS,
430
						args
622
						args
431
					);
623
					);
432
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
624
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
433
				dtParser.setSym1(result);
625
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
434
	  		  break;
626
          getParser().getSym(3));
435
			}
627
				 // macro setResult is deprecated. Use function setResult
628
             getParser().setSym1(result);
629
	                  break;
630
            }
436
	 
631
	 
437
			//
632
			//
438
			// Rule 89:  relationalExpCS ::= relationalExpCS >= ifExpCSPrec
633
			// Rule 89:  relationalExpCS ::= relationalExpCS >= ifExpCSPrec
439
			//
634
			//
635
			
440
			case 89:
636
			case 89:
441
 
637
442
			//
638
			//
443
			// Rule 90:  relationalWithLet ::= relationalExpCS >= additiveWithLet
639
			// Rule 90:  relationalWithLet ::= relationalExpCS >= additiveWithLet
444
			//
640
			//
Lines 448-471 Link Here
448
							SimpleTypeEnum.STRING_LITERAL,
644
							SimpleTypeEnum.STRING_LITERAL,
449
							OCLStandardLibraryUtil.getOperationName(PredefinedType.GREATER_THAN_EQUAL)
645
							OCLStandardLibraryUtil.getOperationName(PredefinedType.GREATER_THAN_EQUAL)
450
						);
646
						);
451
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
647
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
648
            getParser().getToken(2)));
452
				EList args = new BasicEList();
649
				EList args = new BasicEList();
453
				args.add(dtParser.getSym(3));
650
				args.add( // macro getSym is deprecated. Use function getRhsSym
651
          getParser().getSym(3));
454
				CSTNode result = createOperationCallExpCS(
652
				CSTNode result = createOperationCallExpCS(
455
						(OCLExpressionCS)dtParser.getSym(1),
653
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
654
          getParser().getSym(1),
456
						simpleNameCS,
655
						simpleNameCS,
457
						args
656
						args
458
					);
657
					);
459
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
658
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
460
				dtParser.setSym1(result);
659
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
461
	  		  break;
660
          getParser().getSym(3));
462
			}
661
				 // macro setResult is deprecated. Use function setResult
662
             getParser().setSym1(result);
663
	                  break;
664
            }
463
	 
665
	 
464
			//
666
			//
465
			// Rule 91:  relationalExpCS ::= relationalExpCS <= ifExpCSPrec
667
			// Rule 91:  relationalExpCS ::= relationalExpCS <= ifExpCSPrec
466
			//
668
			//
669
			
467
			case 91:
670
			case 91:
468
 
671
469
			//
672
			//
470
			// Rule 92:  relationalWithLet ::= relationalExpCS <= additiveWithLet
673
			// Rule 92:  relationalWithLet ::= relationalExpCS <= additiveWithLet
471
			//
674
			//
Lines 475-498 Link Here
475
							SimpleTypeEnum.STRING_LITERAL,
678
							SimpleTypeEnum.STRING_LITERAL,
476
							OCLStandardLibraryUtil.getOperationName(PredefinedType.LESS_THAN_EQUAL)
679
							OCLStandardLibraryUtil.getOperationName(PredefinedType.LESS_THAN_EQUAL)
477
						);
680
						);
478
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
681
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
682
            getParser().getToken(2)));
479
				EList args = new BasicEList();
683
				EList args = new BasicEList();
480
				args.add(dtParser.getSym(3));
684
				args.add( // macro getSym is deprecated. Use function getRhsSym
685
          getParser().getSym(3));
481
				CSTNode result = createOperationCallExpCS(
686
				CSTNode result = createOperationCallExpCS(
482
						(OCLExpressionCS)dtParser.getSym(1),
687
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
688
          getParser().getSym(1),
483
						simpleNameCS,
689
						simpleNameCS,
484
						args
690
						args
485
					);
691
					);
486
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
692
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
487
				dtParser.setSym1(result);
693
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
488
	  		  break;
694
          getParser().getSym(3));
489
			}
695
				 // macro setResult is deprecated. Use function setResult
696
             getParser().setSym1(result);
697
	                  break;
698
            }
490
	 
699
	 
491
			//
700
			//
492
			// Rule 97:  additiveExpCS ::= additiveExpCS + multiplicativeExpCS
701
			// Rule 97:  additiveExpCS ::= additiveExpCS + multiplicativeExpCS
493
			//
702
			//
703
			
494
			case 97:
704
			case 97:
495
 
705
496
			//
706
			//
497
			// Rule 98:  additiveWithLet ::= additiveExpCS + multiplicativeWithLet
707
			// Rule 98:  additiveWithLet ::= additiveExpCS + multiplicativeWithLet
498
			//
708
			//
Lines 502-525 Link Here
502
							SimpleTypeEnum.STRING_LITERAL,
712
							SimpleTypeEnum.STRING_LITERAL,
503
							OCLStandardLibraryUtil.getOperationName(PredefinedType.PLUS)
713
							OCLStandardLibraryUtil.getOperationName(PredefinedType.PLUS)
504
						);
714
						);
505
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
715
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
716
            getParser().getToken(2)));
506
				EList args = new BasicEList();
717
				EList args = new BasicEList();
507
				args.add(dtParser.getSym(3));
718
				args.add( // macro getSym is deprecated. Use function getRhsSym
719
          getParser().getSym(3));
508
				CSTNode result = createOperationCallExpCS(
720
				CSTNode result = createOperationCallExpCS(
509
						(OCLExpressionCS)dtParser.getSym(1),
721
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
722
          getParser().getSym(1),
510
						simpleNameCS,
723
						simpleNameCS,
511
						args
724
						args
512
					);
725
					);
513
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
726
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
514
				dtParser.setSym1(result);
727
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
515
	  		  break;
728
          getParser().getSym(3));
516
			}
729
				 // macro setResult is deprecated. Use function setResult
730
             getParser().setSym1(result);
731
	                  break;
732
            }
517
	 
733
	 
518
			//
734
			//
519
			// Rule 99:  additiveExpCS ::= additiveExpCS - multiplicativeExpCS
735
			// Rule 99:  additiveExpCS ::= additiveExpCS - multiplicativeExpCS
520
			//
736
			//
737
			
521
			case 99:
738
			case 99:
522
 
739
523
			//
740
			//
524
			// Rule 100:  additiveWithLet ::= additiveExpCS - multiplicativeWithLet
741
			// Rule 100:  additiveWithLet ::= additiveExpCS - multiplicativeWithLet
525
			//
742
			//
Lines 529-552 Link Here
529
							SimpleTypeEnum.STRING_LITERAL,
746
							SimpleTypeEnum.STRING_LITERAL,
530
							OCLStandardLibraryUtil.getOperationName(PredefinedType.MINUS)
747
							OCLStandardLibraryUtil.getOperationName(PredefinedType.MINUS)
531
						);
748
						);
532
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
749
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
750
            getParser().getToken(2)));
533
				EList args = new BasicEList();
751
				EList args = new BasicEList();
534
				args.add(dtParser.getSym(3));
752
				args.add( // macro getSym is deprecated. Use function getRhsSym
753
          getParser().getSym(3));
535
				CSTNode result = createOperationCallExpCS(
754
				CSTNode result = createOperationCallExpCS(
536
						(OCLExpressionCS)dtParser.getSym(1),
755
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
756
          getParser().getSym(1),
537
						simpleNameCS,
757
						simpleNameCS,
538
						args
758
						args
539
					);
759
					);
540
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
760
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
541
				dtParser.setSym1(result);
761
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
542
	  		  break;
762
          getParser().getSym(3));
543
			}
763
				 // macro setResult is deprecated. Use function setResult
764
             getParser().setSym1(result);
765
	                  break;
766
            }
544
	 
767
	 
545
			//
768
			//
546
			// Rule 103:  multiplicativeExpCS ::= multiplicativeExpCS * unaryExpCS
769
			// Rule 103:  multiplicativeExpCS ::= multiplicativeExpCS * unaryExpCS
547
			//
770
			//
771
			
548
			case 103:
772
			case 103:
549
 
773
550
			//
774
			//
551
			// Rule 104:  multiplicativeWithLet ::= multiplicativeExpCS * unaryWithLet
775
			// Rule 104:  multiplicativeWithLet ::= multiplicativeExpCS * unaryWithLet
552
			//
776
			//
Lines 556-579 Link Here
556
							SimpleTypeEnum.STRING_LITERAL,
780
							SimpleTypeEnum.STRING_LITERAL,
557
							OCLStandardLibraryUtil.getOperationName(PredefinedType.TIMES)
781
							OCLStandardLibraryUtil.getOperationName(PredefinedType.TIMES)
558
						);
782
						);
559
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
783
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
784
            getParser().getToken(2)));
560
				EList args = new BasicEList();
785
				EList args = new BasicEList();
561
				args.add(dtParser.getSym(3));
786
				args.add( // macro getSym is deprecated. Use function getRhsSym
787
          getParser().getSym(3));
562
				CSTNode result = createOperationCallExpCS(
788
				CSTNode result = createOperationCallExpCS(
563
						(OCLExpressionCS)dtParser.getSym(1),
789
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
790
          getParser().getSym(1),
564
						simpleNameCS,
791
						simpleNameCS,
565
						args
792
						args
566
					);
793
					);
567
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
794
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
568
				dtParser.setSym1(result);
795
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
569
	  		  break;
796
          getParser().getSym(3));
570
			}
797
				 // macro setResult is deprecated. Use function setResult
798
             getParser().setSym1(result);
799
	                  break;
800
            }
571
	 
801
	 
572
			//
802
			//
573
			// Rule 105:  multiplicativeExpCS ::= multiplicativeExpCS / unaryExpCS
803
			// Rule 105:  multiplicativeExpCS ::= multiplicativeExpCS / unaryExpCS
574
			//
804
			//
805
			
575
			case 105:
806
			case 105:
576
 
807
577
			//
808
			//
578
			// Rule 106:  multiplicativeWithLet ::= multiplicativeExpCS / unaryWithLet
809
			// Rule 106:  multiplicativeWithLet ::= multiplicativeExpCS / unaryWithLet
579
			//
810
			//
Lines 583-601 Link Here
583
							SimpleTypeEnum.STRING_LITERAL,
814
							SimpleTypeEnum.STRING_LITERAL,
584
							OCLStandardLibraryUtil.getOperationName(PredefinedType.DIVIDE)
815
							OCLStandardLibraryUtil.getOperationName(PredefinedType.DIVIDE)
585
						);
816
						);
586
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(2)));
817
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
818
            getParser().getToken(2)));
587
				EList args = new BasicEList();
819
				EList args = new BasicEList();
588
				args.add(dtParser.getSym(3));
820
				args.add( // macro getSym is deprecated. Use function getRhsSym
821
          getParser().getSym(3));
589
				CSTNode result = createOperationCallExpCS(
822
				CSTNode result = createOperationCallExpCS(
590
						(OCLExpressionCS)dtParser.getSym(1),
823
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
824
          getParser().getSym(1),
591
						simpleNameCS,
825
						simpleNameCS,
592
						args
826
						args
593
					);
827
					);
594
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
828
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
595
				dtParser.setSym1(result);
829
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
596
	  		  break;
830
          getParser().getSym(3));
597
			}
831
				 // macro setResult is deprecated. Use function setResult
598
	 
832
             getParser().setSym1(result);
833
	                  break;
834
            }
835
	
599
			//
836
			//
600
			// Rule 109:  unaryExpCS ::= - unaryExpCS
837
			// Rule 109:  unaryExpCS ::= - unaryExpCS
601
			//
838
			//
Lines 605-621 Link Here
605
							SimpleTypeEnum.STRING_LITERAL,
842
							SimpleTypeEnum.STRING_LITERAL,
606
							OCLStandardLibraryUtil.getOperationName(PredefinedType.MINUS)
843
							OCLStandardLibraryUtil.getOperationName(PredefinedType.MINUS)
607
						);
844
						);
608
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(1)));
845
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
846
            getParser().getToken(1)));
609
				CSTNode result = createOperationCallExpCS(
847
				CSTNode result = createOperationCallExpCS(
610
						(OCLExpressionCS)dtParser.getSym(2),
848
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
849
          getParser().getSym(2),
611
						simpleNameCS,
850
						simpleNameCS,
612
						new BasicEList()
851
						new BasicEList()
613
					);
852
					);
614
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(2));
853
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
615
				dtParser.setSym1(result);
854
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
616
	  		  break;
855
          getParser().getSym(2));
617
			}
856
				 // macro setResult is deprecated. Use function setResult
618
	 
857
             getParser().setSym1(result);
858
	                  break;
859
            }
860
	
619
			//
861
			//
620
			// Rule 110:  unaryExpCS ::= not unaryExpCS
862
			// Rule 110:  unaryExpCS ::= not unaryExpCS
621
			//
863
			//
Lines 623-665 Link Here
623
				
865
				
624
				SimpleNameCS simpleNameCS = createSimpleNameCS(
866
				SimpleNameCS simpleNameCS = createSimpleNameCS(
625
							SimpleTypeEnum.STRING_LITERAL,
867
							SimpleTypeEnum.STRING_LITERAL,
626
							getTokenText(dtParser.getToken(1))
868
							getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
869
            getParser().getToken(1))
627
						);
870
						);
628
				setOffsets(simpleNameCS, getIToken(dtParser.getToken(1)));
871
				setOffsets(simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
872
            getParser().getToken(1)));
629
				CSTNode result = createOperationCallExpCS(
873
				CSTNode result = createOperationCallExpCS(
630
						(OCLExpressionCS)dtParser.getSym(2),
874
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
875
          getParser().getSym(2),
631
						simpleNameCS,
876
						simpleNameCS,
632
						new BasicEList()
877
						new BasicEList()
633
					);
878
					);
634
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(2));
879
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
635
				dtParser.setSym1(result);
880
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
636
	  		  break;
881
          getParser().getSym(2));
637
			}
882
				 // macro setResult is deprecated. Use function setResult
638
	 
883
             getParser().setSym1(result);
884
	                  break;
885
            }
886
	
639
			//
887
			//
640
			// Rule 112:  dotArrowExpCS ::= dotArrowExpCS callExpCS
888
			// Rule 112:  dotArrowExpCS ::= dotArrowExpCS callExpCS
641
			//
889
			//
642
			case 112: {
890
			case 112: {
643
				
891
				
644
				CallExpCS result = (CallExpCS)dtParser.getSym(2);
892
				CallExpCS result = (CallExpCS) // macro getSym is deprecated. Use function getRhsSym
645
				result.setSource((OCLExpressionCS)dtParser.getSym(1));
893
          getParser().getSym(2);
646
				setOffsets(result, (CSTNode)dtParser.getSym(1), result);
894
				result.setSource((OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
647
				dtParser.setSym1(result);
895
          getParser().getSym(1));
648
	  		  break;
896
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
649
			}
897
          getParser().getSym(1), result);
650
	 
898
				 // macro setResult is deprecated. Use function setResult
899
             getParser().setSym1(result);
900
	                  break;
901
            }
902
	
651
			//
903
			//
652
			// Rule 113:  dotArrowExpCS ::= dotArrowExpCS messageExpCS
904
			// Rule 113:  dotArrowExpCS ::= dotArrowExpCS messageExpCS
653
			//
905
			//
654
			case 113: {
906
			case 113: {
655
				
907
				
656
				MessageExpCS result = (MessageExpCS)dtParser.getSym(2);
908
				MessageExpCS result = (MessageExpCS) // macro getSym is deprecated. Use function getRhsSym
657
				result.setTarget((OCLExpressionCS)dtParser.getSym(1));
909
          getParser().getSym(2);
658
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(2));
910
				result.setTarget((OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
659
				dtParser.setSym1(result);
911
          getParser().getSym(1));
660
	  		  break;
912
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
661
			}
913
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
662
	 
914
          getParser().getSym(2));
915
				 // macro setResult is deprecated. Use function setResult
916
             getParser().setSym1(result);
917
	                  break;
918
            }
919
	
663
			//
920
			//
664
			// Rule 114:  dotArrowExpCS ::= NUMERIC_OPERATION ( argumentsCSopt )
921
			// Rule 114:  dotArrowExpCS ::= NUMERIC_OPERATION ( argumentsCSopt )
665
			//
922
			//
Lines 672-678 Link Here
672
				String simpleName = text.substring(index + 1);
929
				String simpleName = text.substring(index + 1);
673
930
674
				// create the IntegerLiteralExpCS
931
				// create the IntegerLiteralExpCS
675
				IToken numericToken = getIToken(dtParser.getToken(1));
932
				IToken numericToken = getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
933
            getParser().getToken(1));
676
				int startOffset = numericToken.getStartOffset();
934
				int startOffset = numericToken.getStartOffset();
677
				int endOffset = startOffset + integer.length() - 1; // inclusive
935
				int endOffset = startOffset + integer.length() - 1; // inclusive
678
936
Lines 683-689 Link Here
683
				integerLiteralExpCS.setEndToken(numericToken);
941
				integerLiteralExpCS.setEndToken(numericToken);
684
942
685
				startOffset = endOffset + 2; // end of integerLiteral + 1('.') + 1(start of simpleName)
943
				startOffset = endOffset + 2; // end of integerLiteral + 1('.') + 1(start of simpleName)
686
				endOffset = getIToken(dtParser.getToken(1)).getEndOffset();
944
				endOffset = getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
945
            getParser().getToken(1)).getEndOffset();
687
946
688
				// create the SimpleNameCS
947
				// create the SimpleNameCS
689
				SimpleNameCS simpleNameCS = createSimpleNameCS(
948
				SimpleNameCS simpleNameCS = createSimpleNameCS(
Lines 699-788 Link Here
699
				CSTNode result = createOperationCallExpCS(
958
				CSTNode result = createOperationCallExpCS(
700
						integerLiteralExpCS,
959
						integerLiteralExpCS,
701
						simpleNameCS,
960
						simpleNameCS,
702
						(EList)dtParser.getSym(3)
961
						(EList) // macro getSym is deprecated. Use function getRhsSym
962
          getParser().getSym(3)
703
					);
963
					);
704
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
964
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
705
				dtParser.setSym1(result);
965
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
706
	  		  break;
966
            getParser().getToken(4)));
707
			}
967
				 // macro setResult is deprecated. Use function setResult
708
	 
968
             getParser().setSym1(result);
969
	                  break;
970
            }
971
	
709
			//
972
			//
710
			// Rule 115:  dotArrowExpCS ::= pathNameCS :: simpleNameCS ( argumentsCSopt )
973
			// Rule 115:  dotArrowExpCS ::= pathNameCS :: simpleNameCS ( argumentsCSopt )
711
			//
974
			//
712
			case 115: {
975
			case 115: {
713
				
976
				
714
				OperationCallExpCS result = createOperationCallExpCS(
977
				OperationCallExpCS result = createOperationCallExpCS(
715
						(PathNameCS)dtParser.getSym(1),
978
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
716
						(SimpleNameCS)dtParser.getSym(3),
979
          getParser().getSym(1),
717
						(EList)dtParser.getSym(5)
980
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
718
					);
981
          getParser().getSym(3),
719
				setOffsets(result, (CSTNode)dtParser.getSym(1), getIToken(dtParser.getToken(6)));
982
						(EList) // macro getSym is deprecated. Use function getRhsSym
983
          getParser().getSym(5)
984
					);
985
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
986
          getParser().getSym(1), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
987
            getParser().getToken(6)));
720
				result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
988
				result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
721
				dtParser.setSym1(result);
989
				 // macro setResult is deprecated. Use function setResult
722
	  		  break;
990
             getParser().setSym1(result);
723
			}
991
	                  break;
724
	 
992
            }
993
	
725
			//
994
			//
726
			// Rule 120:  oclExpCS ::= ( oclExpressionCS )
995
			// Rule 120:  oclExpCS ::= ( oclExpressionCS )
727
			//
996
			//
728
			case 120: {
997
			case 120: {
729
				
998
				
730
				CSTNode result = (CSTNode)dtParser.getSym(2);
999
				CSTNode result = (CSTNode) // macro getSym is deprecated. Use function getRhsSym
731
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
1000
          getParser().getSym(2);
732
				dtParser.setSym1(result);
1001
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
733
	  		  break;
1002
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
734
			}
1003
            getParser().getToken(3)));
1004
				 // macro setResult is deprecated. Use function setResult
1005
             getParser().setSym1(result);
1006
	                  break;
1007
            }
735
	 
1008
	 
736
			//
1009
			//
737
			// Rule 121:  variableExpCS ::= simpleNameCS isMarkedPreCS
1010
			// Rule 121:  variableExpCS ::= simpleNameCS isMarkedPreCS
738
			//
1011
			//
1012
			
739
			case 121:
1013
			case 121:
740
 
1014
741
			//
1015
			//
742
			// Rule 122:  variableExpCS ::= keywordAsName1 isMarkedPreCS
1016
			// Rule 122:  variableExpCS ::= keywordAsName1 isMarkedPreCS
743
			//
1017
			//
744
			case 122: {
1018
			case 122: {
745
				
1019
				
746
				IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)dtParser.getSym(2);
1020
				IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS) // macro getSym is deprecated. Use function getRhsSym
1021
          getParser().getSym(2);
747
				CSTNode result = createVariableExpCS(
1022
				CSTNode result = createVariableExpCS(
748
						(SimpleNameCS)dtParser.getSym(1),
1023
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1024
          getParser().getSym(1),
749
						new BasicEList(),
1025
						new BasicEList(),
750
						isMarkedPreCS
1026
						isMarkedPreCS
751
					);
1027
					);
752
				if (isMarkedPreCS.isPre()) {
1028
				if (isMarkedPreCS.isPre()) {
753
					setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(2));
1029
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1030
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1031
          getParser().getSym(2));
754
				} else {
1032
				} else {
755
					setOffsets(result, (CSTNode)dtParser.getSym(1));
1033
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1034
          getParser().getSym(1));
756
				}
1035
				}
757
				dtParser.setSym1(result);
1036
				 // macro setResult is deprecated. Use function setResult
758
	  		  break;
1037
             getParser().setSym1(result);
759
			}
1038
	                  break;
1039
            }
760
	 
1040
	 
761
			//
1041
			//
762
			// Rule 123:  variableExpCS ::= simpleNameCS [ argumentsCS ] isMarkedPreCS
1042
			// Rule 123:  variableExpCS ::= simpleNameCS [ argumentsCS ] isMarkedPreCS
763
			//
1043
			//
1044
			
764
			case 123:
1045
			case 123:
765
 
1046
766
			//
1047
			//
767
			// Rule 124:  variableExpCS ::= keywordAsName1 [ argumentsCS ] isMarkedPreCS
1048
			// Rule 124:  variableExpCS ::= keywordAsName1 [ argumentsCS ] isMarkedPreCS
768
			//
1049
			//
769
			case 124: {
1050
			case 124: {
770
				
1051
				
771
				IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)dtParser.getSym(5);
1052
				IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS) // macro getSym is deprecated. Use function getRhsSym
1053
          getParser().getSym(5);
772
				CSTNode result = createVariableExpCS(
1054
				CSTNode result = createVariableExpCS(
773
						(SimpleNameCS)dtParser.getSym(1),
1055
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
774
						(EList)dtParser.getSym(3),
1056
          getParser().getSym(1),
1057
						(EList) // macro getSym is deprecated. Use function getRhsSym
1058
          getParser().getSym(3),
775
						isMarkedPreCS
1059
						isMarkedPreCS
776
					);
1060
					);
777
				if (isMarkedPreCS.isPre()) {
1061
				if (isMarkedPreCS.isPre()) {
778
					setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(5));
1062
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1063
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1064
          getParser().getSym(5));
779
				} else {
1065
				} else {
780
					setOffsets(result, (CSTNode)dtParser.getSym(1), getIToken(dtParser.getToken(4)));
1066
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1067
          getParser().getSym(1), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1068
            getParser().getToken(4)));
781
				}
1069
				}
782
				dtParser.setSym1(result);
1070
				 // macro setResult is deprecated. Use function setResult
783
	  		  break;
1071
             getParser().setSym1(result);
784
			}
1072
	                  break;
785
	 
1073
            }
1074
	
786
			//
1075
			//
787
			// Rule 126:  simpleNameCS ::= self
1076
			// Rule 126:  simpleNameCS ::= self
788
			//
1077
			//
Lines 790-802 Link Here
790
				
1079
				
791
				CSTNode result = createSimpleNameCS(
1080
				CSTNode result = createSimpleNameCS(
792
						SimpleTypeEnum.SELF_LITERAL,
1081
						SimpleTypeEnum.SELF_LITERAL,
793
						getTokenText(dtParser.getToken(1))
1082
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1083
            getParser().getToken(1))
794
					);
1084
					);
795
				setOffsets(result, getIToken(dtParser.getToken(1)));
1085
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
796
				dtParser.setSym1(result);
1086
            getParser().getToken(1)));
797
	  		  break;
1087
				 // macro setResult is deprecated. Use function setResult
798
			}
1088
             getParser().setSym1(result);
799
	 
1089
	                  break;
1090
            }
1091
	
800
			//
1092
			//
801
			// Rule 127:  simpleNameCS ::= IDENTIFIER
1093
			// Rule 127:  simpleNameCS ::= IDENTIFIER
802
			//
1094
			//
Lines 804-816 Link Here
804
				
1096
				
805
				CSTNode result = createSimpleNameCS(
1097
				CSTNode result = createSimpleNameCS(
806
						SimpleTypeEnum.IDENTIFIER_LITERAL,
1098
						SimpleTypeEnum.IDENTIFIER_LITERAL,
807
						getTokenText(dtParser.getToken(1))
1099
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1100
            getParser().getToken(1))
808
					);
1101
					);
809
				setOffsets(result, getIToken(dtParser.getToken(1)));
1102
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
810
				dtParser.setSym1(result);
1103
            getParser().getToken(1)));
811
	  		  break;
1104
				 // macro setResult is deprecated. Use function setResult
812
			}
1105
             getParser().setSym1(result);
813
	 
1106
	                  break;
1107
            }
1108
	
814
			//
1109
			//
815
			// Rule 128:  primitiveTypeCS ::= Integer
1110
			// Rule 128:  primitiveTypeCS ::= Integer
816
			//
1111
			//
Lines 818-830 Link Here
818
				
1113
				
819
				CSTNode result = createPrimitiveTypeCS(
1114
				CSTNode result = createPrimitiveTypeCS(
820
						SimpleTypeEnum.INTEGER_LITERAL,
1115
						SimpleTypeEnum.INTEGER_LITERAL,
821
						getTokenText(dtParser.getToken(1))
1116
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1117
            getParser().getToken(1))
822
					);
1118
					);
823
				setOffsets(result, getIToken(dtParser.getToken(1)));
1119
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
824
				dtParser.setSym1(result);
1120
            getParser().getToken(1)));
825
	  		  break;
1121
				 // macro setResult is deprecated. Use function setResult
826
			}
1122
             getParser().setSym1(result);
827
	 
1123
	                  break;
1124
            }
1125
	
828
			//
1126
			//
829
			// Rule 129:  primitiveTypeCS ::= UnlimitedNatural
1127
			// Rule 129:  primitiveTypeCS ::= UnlimitedNatural
830
			//
1128
			//
Lines 832-844 Link Here
832
				
1130
				
833
				CSTNode result = createPrimitiveTypeCS(
1131
				CSTNode result = createPrimitiveTypeCS(
834
						SimpleTypeEnum.UNLIMITED_NATURAL_LITERAL,
1132
						SimpleTypeEnum.UNLIMITED_NATURAL_LITERAL,
835
						getTokenText(dtParser.getToken(1))
1133
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1134
            getParser().getToken(1))
836
					);
1135
					);
837
				setOffsets(result, getIToken(dtParser.getToken(1)));
1136
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
838
				dtParser.setSym1(result);
1137
            getParser().getToken(1)));
839
	  		  break;
1138
				 // macro setResult is deprecated. Use function setResult
840
			}
1139
             getParser().setSym1(result);
841
	 
1140
	                  break;
1141
            }
1142
	
842
			//
1143
			//
843
			// Rule 130:  primitiveTypeCS ::= String
1144
			// Rule 130:  primitiveTypeCS ::= String
844
			//
1145
			//
Lines 846-858 Link Here
846
				
1147
				
847
				CSTNode result = createPrimitiveTypeCS(
1148
				CSTNode result = createPrimitiveTypeCS(
848
						SimpleTypeEnum.STRING_LITERAL,
1149
						SimpleTypeEnum.STRING_LITERAL,
849
						getTokenText(dtParser.getToken(1))
1150
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1151
            getParser().getToken(1))
850
					);
1152
					);
851
				setOffsets(result, getIToken(dtParser.getToken(1)));
1153
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
852
				dtParser.setSym1(result);
1154
            getParser().getToken(1)));
853
	  		  break;
1155
				 // macro setResult is deprecated. Use function setResult
854
			}
1156
             getParser().setSym1(result);
855
	 
1157
	                  break;
1158
            }
1159
	
856
			//
1160
			//
857
			// Rule 131:  primitiveTypeCS ::= Real
1161
			// Rule 131:  primitiveTypeCS ::= Real
858
			//
1162
			//
Lines 860-872 Link Here
860
				
1164
				
861
				CSTNode result = createPrimitiveTypeCS(
1165
				CSTNode result = createPrimitiveTypeCS(
862
						SimpleTypeEnum.REAL_LITERAL,
1166
						SimpleTypeEnum.REAL_LITERAL,
863
						getTokenText(dtParser.getToken(1))
1167
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1168
            getParser().getToken(1))
864
					);
1169
					);
865
				setOffsets(result, getIToken(dtParser.getToken(1)));
1170
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
866
				dtParser.setSym1(result);
1171
            getParser().getToken(1)));
867
	  		  break;
1172
				 // macro setResult is deprecated. Use function setResult
868
			}
1173
             getParser().setSym1(result);
869
	 
1174
	                  break;
1175
            }
1176
	
870
			//
1177
			//
871
			// Rule 132:  primitiveTypeCS ::= Boolean
1178
			// Rule 132:  primitiveTypeCS ::= Boolean
872
			//
1179
			//
Lines 874-886 Link Here
874
				
1181
				
875
				CSTNode result = createPrimitiveTypeCS(
1182
				CSTNode result = createPrimitiveTypeCS(
876
						SimpleTypeEnum.BOOLEAN_LITERAL,
1183
						SimpleTypeEnum.BOOLEAN_LITERAL,
877
						getTokenText(dtParser.getToken(1))
1184
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1185
            getParser().getToken(1))
878
					);
1186
					);
879
				setOffsets(result, getIToken(dtParser.getToken(1)));
1187
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
880
				dtParser.setSym1(result);
1188
            getParser().getToken(1)));
881
	  		  break;
1189
				 // macro setResult is deprecated. Use function setResult
882
			}
1190
             getParser().setSym1(result);
883
	 
1191
	                  break;
1192
            }
1193
	
884
			//
1194
			//
885
			// Rule 133:  primitiveTypeCS ::= OclAny
1195
			// Rule 133:  primitiveTypeCS ::= OclAny
886
			//
1196
			//
Lines 888-900 Link Here
888
				
1198
				
889
				CSTNode result = createPrimitiveTypeCS(
1199
				CSTNode result = createPrimitiveTypeCS(
890
						SimpleTypeEnum.OCL_ANY_LITERAL,
1200
						SimpleTypeEnum.OCL_ANY_LITERAL,
891
						getTokenText(dtParser.getToken(1))
1201
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1202
            getParser().getToken(1))
892
					);
1203
					);
893
				setOffsets(result, getIToken(dtParser.getToken(1)));
1204
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
894
				dtParser.setSym1(result);
1205
            getParser().getToken(1)));
895
	  		  break;
1206
				 // macro setResult is deprecated. Use function setResult
896
			}
1207
             getParser().setSym1(result);
897
	 
1208
	                  break;
1209
            }
1210
	
898
			//
1211
			//
899
			// Rule 134:  primitiveTypeCS ::= OclVoid
1212
			// Rule 134:  primitiveTypeCS ::= OclVoid
900
			//
1213
			//
Lines 902-914 Link Here
902
				
1215
				
903
				CSTNode result = createPrimitiveTypeCS(
1216
				CSTNode result = createPrimitiveTypeCS(
904
						SimpleTypeEnum.OCL_VOID_LITERAL,
1217
						SimpleTypeEnum.OCL_VOID_LITERAL,
905
						getTokenText(dtParser.getToken(1))
1218
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1219
            getParser().getToken(1))
906
					);
1220
					);
907
				setOffsets(result, getIToken(dtParser.getToken(1)));
1221
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
908
				dtParser.setSym1(result);
1222
            getParser().getToken(1)));
909
	  		  break;
1223
				 // macro setResult is deprecated. Use function setResult
910
			}
1224
             getParser().setSym1(result);
911
	 
1225
	                  break;
1226
            }
1227
	
912
			//
1228
			//
913
			// Rule 135:  primitiveTypeCS ::= Invalid
1229
			// Rule 135:  primitiveTypeCS ::= Invalid
914
			//
1230
			//
Lines 916-928 Link Here
916
				
1232
				
917
				CSTNode result = createPrimitiveTypeCS(
1233
				CSTNode result = createPrimitiveTypeCS(
918
						SimpleTypeEnum.INVALID_LITERAL,
1234
						SimpleTypeEnum.INVALID_LITERAL,
919
						getTokenText(dtParser.getToken(1))
1235
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1236
            getParser().getToken(1))
920
					);
1237
					);
921
				setOffsets(result, getIToken(dtParser.getToken(1)));
1238
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
922
				dtParser.setSym1(result);
1239
            getParser().getToken(1)));
923
	  		  break;
1240
				 // macro setResult is deprecated. Use function setResult
924
			}
1241
             getParser().setSym1(result);
925
	 
1242
	                  break;
1243
            }
1244
	
926
			//
1245
			//
927
			// Rule 136:  primitiveTypeCS ::= OclMessage
1246
			// Rule 136:  primitiveTypeCS ::= OclMessage
928
			//
1247
			//
Lines 930-1741 Link Here
930
				
1249
				
931
				CSTNode result = createPrimitiveTypeCS(
1250
				CSTNode result = createPrimitiveTypeCS(
932
						SimpleTypeEnum.OCL_MESSAGE_LITERAL,
1251
						SimpleTypeEnum.OCL_MESSAGE_LITERAL,
933
						getTokenText(dtParser.getToken(1))
1252
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1253
            getParser().getToken(1))
934
					);
1254
					);
935
				setOffsets(result, getIToken(dtParser.getToken(1)));
1255
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
936
				dtParser.setSym1(result);
1256
            getParser().getToken(1)));
937
	  		  break;
1257
				 // macro setResult is deprecated. Use function setResult
938
			}
1258
             getParser().setSym1(result);
939
	 
1259
	                  break;
1260
            }
1261
	
940
			//
1262
			//
941
			// Rule 137:  pathNameCS ::= IDENTIFIER
1263
			// Rule 137:  pathNameCS ::= IDENTIFIER
942
			//
1264
			//
943
			case 137: {
1265
			case 137: {
944
				
1266
				
945
				CSTNode result = createPathNameCS(getTokenText(dtParser.getToken(1)));
1267
				CSTNode result = createPathNameCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
946
				setOffsets(result, getIToken(dtParser.getToken(1)));
1268
            getParser().getToken(1)));
947
				dtParser.setSym1(result);
1269
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
948
	  		  break;
1270
            getParser().getToken(1)));
949
			}
1271
				 // macro setResult is deprecated. Use function setResult
950
	 
1272
             getParser().setSym1(result);
1273
	                  break;
1274
            }
1275
	
951
			//
1276
			//
952
			// Rule 138:  pathNameCS ::= pathNameCS :: simpleNameCS
1277
			// Rule 138:  pathNameCS ::= pathNameCS :: simpleNameCS
953
			//
1278
			//
954
			case 138: {
1279
			case 138: {
955
				
1280
				
956
				PathNameCS result = (PathNameCS)dtParser.getSym(1);
1281
				PathNameCS result = (PathNameCS) // macro getSym is deprecated. Use function getRhsSym
1282
          getParser().getSym(1);
957
				result = extendPathNameCS(result, getTokenText(dtParser.getToken(3)));
1283
				result = extendPathNameCS(result, getTokenText(dtParser.getToken(3)));
958
				setOffsets(result, result, (CSTNode)dtParser.getSym(3));
1284
				setOffsets(result, result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
959
				dtParser.setSym1(result);
1285
          getParser().getSym(3));
960
	  		  break;
1286
				 // macro setResult is deprecated. Use function setResult
961
			}
1287
             getParser().setSym1(result);
962
	 
1288
	                  break;
1289
            }
1290
	
963
			//
1291
			//
964
			// Rule 139:  pathNameCSOpt ::= $Empty
1292
			// Rule 139:  pathNameCSOpt ::= $Empty
965
			//
1293
			//
966
			case 139: {
1294
			case 139: {
967
				
1295
				
968
				CSTNode result = createPathNameCS();
1296
				CSTNode result = createPathNameCS();
969
				dtParser.setSym1(result);
1297
				 // macro setResult is deprecated. Use function setResult
970
	  		  break;
1298
             getParser().setSym1(result);
971
			}
1299
	                  break;
1300
            }
972
	 
1301
	 
973
			//
1302
			//
974
			// Rule 147:  enumLiteralExpCS ::= pathNameCS :: keywordAsName
1303
			// Rule 147:  enumLiteralExpCS ::= pathNameCS :: keywordAsName
975
			//
1304
			//
1305
			
976
			case 147:
1306
			case 147:
977
 
1307
978
			//
1308
			//
979
			// Rule 148:  enumLiteralExpCS ::= pathNameCS :: simpleNameCS
1309
			// Rule 148:  enumLiteralExpCS ::= pathNameCS :: simpleNameCS
980
			//
1310
			//
981
			case 148: {
1311
			case 148: {
982
				
1312
				
983
				CSTNode result = createEnumLiteralExpCS(
1313
				CSTNode result = createEnumLiteralExpCS(
984
						(PathNameCS)dtParser.getSym(1),
1314
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
985
						(SimpleNameCS)dtParser.getSym(3)
1315
          getParser().getSym(1),
986
					);
1316
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
987
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
1317
          getParser().getSym(3)
988
				dtParser.setSym1(result);
1318
					);
989
	  		  break;
1319
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
990
			}
1320
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
991
	 
1321
          getParser().getSym(3));
1322
				 // macro setResult is deprecated. Use function setResult
1323
             getParser().setSym1(result);
1324
	                  break;
1325
            }
1326
	
992
			//
1327
			//
993
			// Rule 149:  collectionLiteralExpCS ::= collectionTypeIdentifierCS { collectionLiteralPartsCSopt }
1328
			// Rule 149:  collectionLiteralExpCS ::= collectionTypeIdentifierCS { collectionLiteralPartsCSopt }
994
			//
1329
			//
995
			case 149: {
1330
			case 149: {
996
				
1331
				
997
				Object[] objs = (Object[])dtParser.getSym(1);
1332
				Object[] objs = (Object[]) // macro getSym is deprecated. Use function getRhsSym
1333
          getParser().getSym(1);
998
				CSTNode result = createCollectionLiteralExpCS(
1334
				CSTNode result = createCollectionLiteralExpCS(
999
						(CollectionTypeIdentifierEnum)objs[1],
1335
						(CollectionTypeIdentifierEnum)objs[1],
1000
						(EList)dtParser.getSym(3)
1336
						(EList) // macro getSym is deprecated. Use function getRhsSym
1337
          getParser().getSym(3)
1001
					);
1338
					);
1002
				setOffsets(result, (IToken)objs[0], getIToken(dtParser.getToken(4)));
1339
				setOffsets(result, (IToken)objs[0], getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1003
				dtParser.setSym1(result);
1340
            getParser().getToken(4)));
1004
	  		  break;
1341
				 // macro setResult is deprecated. Use function setResult
1005
			}
1342
             getParser().setSym1(result);
1006
	 
1343
	                  break;
1344
            }
1345
	
1007
			//
1346
			//
1008
			// Rule 150:  collectionTypeIdentifierCS ::= Set
1347
			// Rule 150:  collectionTypeIdentifierCS ::= Set
1009
			//
1348
			//
1010
			case 150: {
1349
			case 150: {
1011
				
1350
				
1012
				dtParser.setSym1(new Object[]{getIToken(dtParser.getToken(1)), CollectionTypeIdentifierEnum.SET_LITERAL});
1351
				 // macro setResult is deprecated. Use function setResult
1013
	  		  break;
1352
             getParser().setSym1(new Object[]{getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1014
			}
1353
            getParser().getToken(1)), CollectionTypeIdentifierEnum.SET_LITERAL});
1015
	 
1354
	                  break;
1355
            }
1356
	
1016
			//
1357
			//
1017
			// Rule 151:  collectionTypeIdentifierCS ::= Bag
1358
			// Rule 151:  collectionTypeIdentifierCS ::= Bag
1018
			//
1359
			//
1019
			case 151: {
1360
			case 151: {
1020
				
1361
				
1021
				dtParser.setSym1(new Object[]{getIToken(dtParser.getToken(1)), CollectionTypeIdentifierEnum.BAG_LITERAL});
1362
				 // macro setResult is deprecated. Use function setResult
1022
	  		  break;
1363
             getParser().setSym1(new Object[]{getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1023
			}
1364
            getParser().getToken(1)), CollectionTypeIdentifierEnum.BAG_LITERAL});
1024
	 
1365
	                  break;
1366
            }
1367
	
1025
			//
1368
			//
1026
			// Rule 152:  collectionTypeIdentifierCS ::= Sequence
1369
			// Rule 152:  collectionTypeIdentifierCS ::= Sequence
1027
			//
1370
			//
1028
			case 152: {
1371
			case 152: {
1029
				
1372
				
1030
				dtParser.setSym1(new Object[]{getIToken(dtParser.getToken(1)), CollectionTypeIdentifierEnum.SEQUENCE_LITERAL});
1373
				 // macro setResult is deprecated. Use function setResult
1031
	  		  break;
1374
             getParser().setSym1(new Object[]{getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1032
			}
1375
            getParser().getToken(1)), CollectionTypeIdentifierEnum.SEQUENCE_LITERAL});
1033
	 
1376
	                  break;
1377
            }
1378
	
1034
			//
1379
			//
1035
			// Rule 153:  collectionTypeIdentifierCS ::= Collection
1380
			// Rule 153:  collectionTypeIdentifierCS ::= Collection
1036
			//
1381
			//
1037
			case 153: {
1382
			case 153: {
1038
				
1383
				
1039
				dtParser.setSym1(new Object[]{getIToken(dtParser.getToken(1)), CollectionTypeIdentifierEnum.COLLECTION_LITERAL});
1384
				 // macro setResult is deprecated. Use function setResult
1040
	  		  break;
1385
             getParser().setSym1(new Object[]{getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1041
			}
1386
            getParser().getToken(1)), CollectionTypeIdentifierEnum.COLLECTION_LITERAL});
1042
	 
1387
	                  break;
1388
            }
1389
	
1043
			//
1390
			//
1044
			// Rule 154:  collectionTypeIdentifierCS ::= OrderedSet
1391
			// Rule 154:  collectionTypeIdentifierCS ::= OrderedSet
1045
			//
1392
			//
1046
			case 154: {
1393
			case 154: {
1047
				
1394
				
1048
				dtParser.setSym1(new Object[]{getIToken(dtParser.getToken(1)), CollectionTypeIdentifierEnum.ORDERED_SET_LITERAL});
1395
				 // macro setResult is deprecated. Use function setResult
1049
	  		  break;
1396
             getParser().setSym1(new Object[]{getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1050
			}
1397
            getParser().getToken(1)), CollectionTypeIdentifierEnum.ORDERED_SET_LITERAL});
1398
	                  break;
1399
            }
1051
	 
1400
	 
1052
			//
1401
			//
1053
			// Rule 155:  collectionLiteralPartsCSopt ::= $Empty
1402
			// Rule 155:  collectionLiteralPartsCSopt ::= $Empty
1054
			//
1403
			//
1404
			
1055
			case 155:
1405
			case 155:
1056
				dtParser.setSym1(new BasicEList());
1406
				setResult(new BasicEList());
1057
				break;
1407
				break;
1058
 
1408
1059
			//
1409
			//
1060
			// Rule 157:  collectionLiteralPartsCS ::= collectionLiteralPartCS
1410
			// Rule 157:  collectionLiteralPartsCS ::= collectionLiteralPartCS
1061
			//
1411
			//
1062
			case 157: {
1412
			case 157: {
1063
				
1413
				
1064
				EList result = new BasicEList();
1414
				EList result = new BasicEList();
1065
				result.add(dtParser.getSym(1));
1415
				result.add( // macro getSym is deprecated. Use function getRhsSym
1066
				dtParser.setSym1(result);
1416
          getParser().getSym(1));
1067
	  		  break;
1417
				 // macro setResult is deprecated. Use function setResult
1068
			}
1418
             getParser().setSym1(result);
1069
	 
1419
	                  break;
1420
            }
1421
	
1070
			//
1422
			//
1071
			// Rule 158:  collectionLiteralPartsCS ::= collectionLiteralPartsCS , collectionLiteralPartCS
1423
			// Rule 158:  collectionLiteralPartsCS ::= collectionLiteralPartsCS , collectionLiteralPartCS
1072
			//
1424
			//
1073
			case 158: {
1425
			case 158: {
1074
				
1426
				
1075
				EList result = (EList)dtParser.getSym(1);
1427
				EList result = (EList) // macro getSym is deprecated. Use function getRhsSym
1076
				result.add(dtParser.getSym(3));
1428
          getParser().getSym(1);
1077
				dtParser.setSym1(result);
1429
				result.add( // macro getSym is deprecated. Use function getRhsSym
1078
	  		  break;
1430
          getParser().getSym(3));
1079
			}
1431
				 // macro setResult is deprecated. Use function setResult
1080
	 
1432
             getParser().setSym1(result);
1433
	                  break;
1434
            }
1435
	
1081
			//
1436
			//
1082
			// Rule 160:  collectionLiteralPartCS ::= oclExpressionCS
1437
			// Rule 160:  collectionLiteralPartCS ::= oclExpressionCS
1083
			//
1438
			//
1084
			case 160: {
1439
			case 160: {
1085
				
1440
				
1086
				CSTNode result = createCollectionLiteralPartCS(
1441
				CSTNode result = createCollectionLiteralPartCS(
1087
						(OCLExpressionCS)dtParser.getSym(1)
1442
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1443
          getParser().getSym(1)
1088
					);
1444
					);
1089
				setOffsets(result, (CSTNode)dtParser.getSym(1));
1445
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1090
				dtParser.setSym1(result);
1446
          getParser().getSym(1));
1091
	  		  break;
1447
				 // macro setResult is deprecated. Use function setResult
1092
			}
1448
             getParser().setSym1(result);
1093
	 
1449
	                  break;
1450
            }
1451
	
1094
			//
1452
			//
1095
			// Rule 161:  collectionRangeCS ::= - INTEGER_RANGE_START oclExpressionCS
1453
			// Rule 161:  collectionRangeCS ::= - INTEGER_RANGE_START oclExpressionCS
1096
			//
1454
			//
1097
			case 161: {
1455
			case 161: {
1098
				
1456
				
1099
				OCLExpressionCS rangeStart = createRangeStart(
1457
				OCLExpressionCS rangeStart = createRangeStart(
1100
						getTokenText(dtParser.getToken(2)), true);
1458
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1459
            getParser().getToken(2)), true);
1101
				CSTNode result = createCollectionRangeCS(
1460
				CSTNode result = createCollectionRangeCS(
1102
						rangeStart,
1461
						rangeStart,
1103
						(OCLExpressionCS)dtParser.getSym(3)
1462
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1463
          getParser().getSym(3)
1104
					);
1464
					);
1105
				setOffsets(result, rangeStart, (CSTNode)dtParser.getSym(3));
1465
				setOffsets(result, rangeStart, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1106
				dtParser.setSym1(result);
1466
          getParser().getSym(3));
1107
	  		  break;
1467
				 // macro setResult is deprecated. Use function setResult
1108
			}
1468
             getParser().setSym1(result);
1109
	 
1469
	                  break;
1470
            }
1471
	
1110
			//
1472
			//
1111
			// Rule 162:  collectionRangeCS ::= INTEGER_RANGE_START oclExpressionCS
1473
			// Rule 162:  collectionRangeCS ::= INTEGER_RANGE_START oclExpressionCS
1112
			//
1474
			//
1113
			case 162: {
1475
			case 162: {
1114
				
1476
				
1115
				OCLExpressionCS rangeStart = createRangeStart(
1477
				OCLExpressionCS rangeStart = createRangeStart(
1116
						getTokenText(dtParser.getToken(1)), false);
1478
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1479
            getParser().getToken(1)), false);
1117
				CSTNode result = createCollectionRangeCS(
1480
				CSTNode result = createCollectionRangeCS(
1118
						rangeStart,
1481
						rangeStart,
1119
						(OCLExpressionCS)dtParser.getSym(2)
1482
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1483
          getParser().getSym(2)
1120
					);
1484
					);
1121
				setOffsets(result, rangeStart, (CSTNode)dtParser.getSym(2));
1485
				setOffsets(result, rangeStart, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1122
				dtParser.setSym1(result);
1486
          getParser().getSym(2));
1123
	  		  break;
1487
				 // macro setResult is deprecated. Use function setResult
1124
			}
1488
             getParser().setSym1(result);
1125
	 
1489
	                  break;
1490
            }
1491
	
1126
			//
1492
			//
1127
			// Rule 163:  collectionRangeCS ::= oclExpressionCS .. oclExpressionCS
1493
			// Rule 163:  collectionRangeCS ::= oclExpressionCS .. oclExpressionCS
1128
			//
1494
			//
1129
			case 163: {
1495
			case 163: {
1130
				
1496
				
1131
				CSTNode result = createCollectionRangeCS(
1497
				CSTNode result = createCollectionRangeCS(
1132
						(OCLExpressionCS)dtParser.getSym(1),
1498
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1133
						(OCLExpressionCS)dtParser.getSym(3)
1499
          getParser().getSym(1),
1134
					);
1500
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1135
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
1501
          getParser().getSym(3)
1136
				dtParser.setSym1(result);
1502
					);
1137
	  		  break;
1503
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1138
			}
1504
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1139
	 
1505
          getParser().getSym(3));
1506
				 // macro setResult is deprecated. Use function setResult
1507
             getParser().setSym1(result);
1508
	                  break;
1509
            }
1510
	
1140
			//
1511
			//
1141
			// Rule 169:  tupleLiteralExpCS ::= Tuple { variableListCS2 }
1512
			// Rule 169:  tupleLiteralExpCS ::= Tuple { variableListCS2 }
1142
			//
1513
			//
1143
			case 169: {
1514
			case 169: {
1144
				
1515
				
1145
				CSTNode result = createTupleLiteralExpCS((EList)dtParser.getSym(3));
1516
				CSTNode result = createTupleLiteralExpCS((EList) // macro getSym is deprecated. Use function getRhsSym
1146
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
1517
          getParser().getSym(3));
1147
				dtParser.setSym1(result);
1518
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1148
	  		  break;
1519
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1149
			}
1520
            getParser().getToken(4)));
1150
	 
1521
				 // macro setResult is deprecated. Use function setResult
1522
             getParser().setSym1(result);
1523
	                  break;
1524
            }
1525
	
1151
			//
1526
			//
1152
			// Rule 170:  integerLiteralExpCS ::= INTEGER_LITERAL
1527
			// Rule 170:  integerLiteralExpCS ::= INTEGER_LITERAL
1153
			//
1528
			//
1154
			case 170: {
1529
			case 170: {
1155
				
1530
				
1156
				CSTNode result = createIntegerLiteralExpCS(getTokenText(dtParser.getToken(1)));
1531
				CSTNode result = createIntegerLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1157
				setOffsets(result, getIToken(dtParser.getToken(1)));
1532
            getParser().getToken(1)));
1158
				dtParser.setSym1(result);
1533
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1159
	  		  break;
1534
            getParser().getToken(1)));
1160
			}
1535
				 // macro setResult is deprecated. Use function setResult
1161
	 
1536
             getParser().setSym1(result);
1537
	                  break;
1538
            }
1539
	
1162
			//
1540
			//
1163
			// Rule 171:  unlimitedNaturalLiteralExpCS ::= *
1541
			// Rule 171:  unlimitedNaturalLiteralExpCS ::= *
1164
			//
1542
			//
1165
			case 171: {
1543
			case 171: {
1166
				
1544
				
1167
				CSTNode result = createUnlimitedNaturalLiteralExpCS(getTokenText(dtParser.getToken(1)));
1545
				CSTNode result = createUnlimitedNaturalLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1168
				setOffsets(result, getIToken(dtParser.getToken(1)));
1546
            getParser().getToken(1)));
1169
				dtParser.setSym1(result);
1547
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1170
	  		  break;
1548
            getParser().getToken(1)));
1171
			}
1549
				 // macro setResult is deprecated. Use function setResult
1172
	 
1550
             getParser().setSym1(result);
1551
	                  break;
1552
            }
1553
	
1173
			//
1554
			//
1174
			// Rule 172:  realLiteralExpCS ::= REAL_LITERAL
1555
			// Rule 172:  realLiteralExpCS ::= REAL_LITERAL
1175
			//
1556
			//
1176
			case 172: {
1557
			case 172: {
1177
				
1558
				
1178
				CSTNode result = createRealLiteralExpCS(getTokenText(dtParser.getToken(1)));
1559
				CSTNode result = createRealLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1179
				setOffsets(result, getIToken(dtParser.getToken(1)));
1560
            getParser().getToken(1)));
1180
				dtParser.setSym1(result);
1561
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1181
	  		  break;
1562
            getParser().getToken(1)));
1182
			}
1563
				 // macro setResult is deprecated. Use function setResult
1183
	 
1564
             getParser().setSym1(result);
1565
	                  break;
1566
            }
1567
	
1184
			//
1568
			//
1185
			// Rule 173:  stringLiteralExpCS ::= STRING_LITERAL
1569
			// Rule 173:  stringLiteralExpCS ::= STRING_LITERAL
1186
			//
1570
			//
1187
			case 173: {
1571
			case 173: {
1188
				
1572
				
1189
				IToken literalToken = getIToken(dtParser.getToken(1));
1573
				IToken literalToken = getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1574
            getParser().getToken(1));
1190
				StringLiteralExpCS result = createStringLiteralExpCS(literalToken.toString());
1575
				StringLiteralExpCS result = createStringLiteralExpCS(literalToken.toString());
1191
				result.setUnescapedStringSymbol(unescape(literalToken));
1576
				result.setUnescapedStringSymbol(unescape(literalToken));
1192
				setOffsets(result, literalToken);
1577
				setOffsets(result, literalToken);
1193
				dtParser.setSym1(result);
1578
				 // macro setResult is deprecated. Use function setResult
1194
	  		  break;
1579
             getParser().setSym1(result);
1195
			}
1580
	                  break;
1196
	 
1581
            }
1582
	
1197
			//
1583
			//
1198
			// Rule 174:  booleanLiteralExpCS ::= true
1584
			// Rule 174:  booleanLiteralExpCS ::= true
1199
			//
1585
			//
1200
			case 174: {
1586
			case 174: {
1201
				
1587
				
1202
				CSTNode result = createBooleanLiteralExpCS(getTokenText(dtParser.getToken(1)));
1588
				CSTNode result = createBooleanLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1203
				setOffsets(result, getIToken(dtParser.getToken(1)));
1589
            getParser().getToken(1)));
1204
				dtParser.setSym1(result);
1590
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1205
	  		  break;
1591
            getParser().getToken(1)));
1206
			}
1592
				 // macro setResult is deprecated. Use function setResult
1207
	 
1593
             getParser().setSym1(result);
1594
	                  break;
1595
            }
1596
	
1208
			//
1597
			//
1209
			// Rule 175:  booleanLiteralExpCS ::= false
1598
			// Rule 175:  booleanLiteralExpCS ::= false
1210
			//
1599
			//
1211
			case 175: {
1600
			case 175: {
1212
				
1601
				
1213
				CSTNode result = createBooleanLiteralExpCS(getTokenText(dtParser.getToken(1)));
1602
				CSTNode result = createBooleanLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1214
				setOffsets(result, getIToken(dtParser.getToken(1)));
1603
            getParser().getToken(1)));
1215
				dtParser.setSym1(result);
1604
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1216
	  		  break;
1605
            getParser().getToken(1)));
1217
			}
1606
				 // macro setResult is deprecated. Use function setResult
1218
	 
1607
             getParser().setSym1(result);
1608
	                  break;
1609
            }
1610
	
1219
			//
1611
			//
1220
			// Rule 176:  nullLiteralExpCS ::= null
1612
			// Rule 176:  nullLiteralExpCS ::= null
1221
			//
1613
			//
1222
			case 176: {
1614
			case 176: {
1223
				
1615
				
1224
				CSTNode result = createNullLiteralExpCS(getTokenText(dtParser.getToken(1)));
1616
				CSTNode result = createNullLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1225
				setOffsets(result, getIToken(dtParser.getToken(1)));
1617
            getParser().getToken(1)));
1226
				dtParser.setSym1(result);
1618
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1227
	  		  break;
1619
            getParser().getToken(1)));
1228
			}
1620
				 // macro setResult is deprecated. Use function setResult
1229
	 
1621
             getParser().setSym1(result);
1622
	                  break;
1623
            }
1624
	
1230
			//
1625
			//
1231
			// Rule 177:  invalidLiteralExpCS ::= OclInvalid
1626
			// Rule 177:  invalidLiteralExpCS ::= OclInvalid
1232
			//
1627
			//
1233
			case 177: {
1628
			case 177: {
1234
				
1629
				
1235
				CSTNode result = createInvalidLiteralExpCS(getTokenText(dtParser.getToken(1)));
1630
				CSTNode result = createInvalidLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1236
				setOffsets(result, getIToken(dtParser.getToken(1)));
1631
            getParser().getToken(1)));
1237
				dtParser.setSym1(result);
1632
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1238
	  		  break;
1633
            getParser().getToken(1)));
1239
			}
1634
				 // macro setResult is deprecated. Use function setResult
1635
             getParser().setSym1(result);
1636
	                  break;
1637
            }
1240
	 
1638
	 
1241
			//
1639
			//
1242
			// Rule 178:  callExpCS ::= -> featureCallExpCS
1640
			// Rule 178:  callExpCS ::= -> featureCallExpCS
1243
			//
1641
			//
1642
			
1244
			case 178:
1643
			case 178:
1245
 
1644
1246
			//
1645
			//
1247
			// Rule 179:  callExpCS ::= -> loopExpCS
1646
			// Rule 179:  callExpCS ::= -> loopExpCS
1248
			//
1647
			//
1249
			case 179: {
1648
			case 179: {
1250
				
1649
				
1251
				CallExpCS result = (CallExpCS)dtParser.getSym(2);
1650
				CallExpCS result = (CallExpCS) // macro getSym is deprecated. Use function getRhsSym
1651
          getParser().getSym(2);
1252
				result.setAccessor(DotOrArrowEnum.ARROW_LITERAL);
1652
				result.setAccessor(DotOrArrowEnum.ARROW_LITERAL);
1253
				dtParser.setSym1(result);
1653
				 // macro setResult is deprecated. Use function setResult
1254
	  		  break;
1654
             getParser().setSym1(result);
1255
			}
1655
	                  break;
1656
            }
1256
	 
1657
	 
1257
			//
1658
			//
1258
			// Rule 180:  callExpCS ::= . keywordOperationCallExpCS
1659
			// Rule 180:  callExpCS ::= . keywordOperationCallExpCS
1259
			//
1660
			//
1661
			
1260
			case 180:
1662
			case 180:
1261
 
1663
1262
			//
1664
			//
1263
			// Rule 181:  callExpCS ::= . featureCallExpCS
1665
			// Rule 181:  callExpCS ::= . featureCallExpCS
1264
			//
1666
			//
1265
			case 181: {
1667
			case 181: {
1266
				
1668
				
1267
				CallExpCS result = (CallExpCS)dtParser.getSym(2);
1669
				CallExpCS result = (CallExpCS) // macro getSym is deprecated. Use function getRhsSym
1670
          getParser().getSym(2);
1268
				result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
1671
				result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
1269
				dtParser.setSym1(result);
1672
				 // macro setResult is deprecated. Use function setResult
1270
	  		  break;
1673
             getParser().setSym1(result);
1271
			}
1674
	                  break;
1272
	 
1675
            }
1676
	
1273
			//
1677
			//
1274
			// Rule 184:  iteratorExpCS ::= iteratorName ( oclExpressionCS )
1678
			// Rule 184:  iteratorExpCS ::= iteratorName ( oclExpressionCS )
1275
			//
1679
			//
1276
			case 184: {
1680
			case 184: {
1277
				
1681
				
1278
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(1);
1682
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1683
          getParser().getSym(1);
1279
				CSTNode result = createIteratorExpCS(
1684
				CSTNode result = createIteratorExpCS(
1280
						simpleNameCS,
1685
						simpleNameCS,
1281
						null,
1686
						null,
1282
						null,
1687
						null,
1283
						(OCLExpressionCS)dtParser.getSym(3)
1688
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1689
          getParser().getSym(3)
1284
					);
1690
					);
1285
				setOffsets(result, simpleNameCS, getIToken(dtParser.getToken(4)));
1691
				setOffsets(result, simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1286
				dtParser.setSym1(result);
1692
            getParser().getToken(4)));
1287
	  		  break;
1693
				 // macro setResult is deprecated. Use function setResult
1288
			}
1694
             getParser().setSym1(result);
1289
	 
1695
	                  break;
1696
            }
1697
	
1290
			//
1698
			//
1291
			// Rule 185:  iteratorExpCS ::= iteratorName ( variableCS | oclExpressionCS )
1699
			// Rule 185:  iteratorExpCS ::= iteratorName ( variableCS | oclExpressionCS )
1292
			//
1700
			//
1293
			case 185: {
1701
			case 185: {
1294
				
1702
				
1295
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(1);
1703
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1704
          getParser().getSym(1);
1296
				CSTNode result = createIteratorExpCS(
1705
				CSTNode result = createIteratorExpCS(
1297
						simpleNameCS,
1706
						simpleNameCS,
1298
						(VariableCS)dtParser.getSym(3),
1707
						(VariableCS) // macro getSym is deprecated. Use function getRhsSym
1708
          getParser().getSym(3),
1299
						null,
1709
						null,
1300
						(OCLExpressionCS)dtParser.getSym(5)
1710
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1711
          getParser().getSym(5)
1301
					);
1712
					);
1302
				setOffsets(result, simpleNameCS, getIToken(dtParser.getToken(6)));
1713
				setOffsets(result, simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1303
				dtParser.setSym1(result);
1714
            getParser().getToken(6)));
1304
	  		  break;
1715
				 // macro setResult is deprecated. Use function setResult
1305
			}
1716
             getParser().setSym1(result);
1306
	 
1717
	                  break;
1718
            }
1719
	
1307
			//
1720
			//
1308
			// Rule 186:  iteratorExpCS ::= iteratorName ( variableCS , variableCS | oclExpressionCS )
1721
			// Rule 186:  iteratorExpCS ::= iteratorName ( variableCS , variableCS | oclExpressionCS )
1309
			//
1722
			//
1310
			case 186: {
1723
			case 186: {
1311
				
1724
				
1312
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(1);
1725
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1726
          getParser().getSym(1);
1313
				CSTNode result = createIteratorExpCS(
1727
				CSTNode result = createIteratorExpCS(
1314
						simpleNameCS,
1728
						simpleNameCS,
1315
						(VariableCS)dtParser.getSym(3),
1729
						(VariableCS) // macro getSym is deprecated. Use function getRhsSym
1316
						(VariableCS)dtParser.getSym(5),
1730
          getParser().getSym(3),
1317
						(OCLExpressionCS)dtParser.getSym(7)
1731
						(VariableCS) // macro getSym is deprecated. Use function getRhsSym
1318
					);
1732
          getParser().getSym(5),
1319
				setOffsets(result, simpleNameCS, getIToken(dtParser.getToken(8)));
1733
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1320
				dtParser.setSym1(result);
1734
          getParser().getSym(7)
1321
	  		  break;
1735
					);
1322
			}
1736
				setOffsets(result, simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1323
	 
1737
            getParser().getToken(8)));
1738
				 // macro setResult is deprecated. Use function setResult
1739
             getParser().setSym1(result);
1740
	                  break;
1741
            }
1742
	
1324
			//
1743
			//
1325
			// Rule 187:  iterateExpCS ::= iterateName ( variableCS | oclExpressionCS )
1744
			// Rule 187:  iterateExpCS ::= iterateName ( variableCS | oclExpressionCS )
1326
			//
1745
			//
1327
			case 187: {
1746
			case 187: {
1328
				
1747
				
1329
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(1);
1748
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1749
          getParser().getSym(1);
1330
				CSTNode result = createIterateExpCS(
1750
				CSTNode result = createIterateExpCS(
1331
						simpleNameCS,
1751
						simpleNameCS,
1332
						(VariableCS)dtParser.getSym(3),
1752
						(VariableCS) // macro getSym is deprecated. Use function getRhsSym
1753
          getParser().getSym(3),
1333
						null,
1754
						null,
1334
						(OCLExpressionCS)dtParser.getSym(5)
1755
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1756
          getParser().getSym(5)
1335
					);
1757
					);
1336
				setOffsets(result, simpleNameCS, getIToken(dtParser.getToken(6)));
1758
				setOffsets(result, simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1337
				dtParser.setSym1(result);
1759
            getParser().getToken(6)));
1338
	  		  break;
1760
				 // macro setResult is deprecated. Use function setResult
1339
			}
1761
             getParser().setSym1(result);
1340
	 
1762
	                  break;
1763
            }
1764
	
1341
			//
1765
			//
1342
			// Rule 188:  iterateExpCS ::= iterateName ( variableCS ; variableCS | oclExpressionCS )
1766
			// Rule 188:  iterateExpCS ::= iterateName ( variableCS ; variableCS | oclExpressionCS )
1343
			//
1767
			//
1344
			case 188: {
1768
			case 188: {
1345
				
1769
				
1346
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(1);
1770
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1771
          getParser().getSym(1);
1347
				CSTNode result = createIterateExpCS(
1772
				CSTNode result = createIterateExpCS(
1348
						simpleNameCS,
1773
						simpleNameCS,
1349
						(VariableCS)dtParser.getSym(3),
1774
						(VariableCS) // macro getSym is deprecated. Use function getRhsSym
1350
						(VariableCS)dtParser.getSym(5),
1775
          getParser().getSym(3),
1351
						(OCLExpressionCS)dtParser.getSym(7)
1776
						(VariableCS) // macro getSym is deprecated. Use function getRhsSym
1352
					);
1777
          getParser().getSym(5),
1353
				setOffsets(result, simpleNameCS, getIToken(dtParser.getToken(8)));
1778
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1354
				dtParser.setSym1(result);
1779
          getParser().getSym(7)
1355
	  		  break;
1780
					);
1356
			}
1781
				setOffsets(result, simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1357
	 
1782
            getParser().getToken(8)));
1783
				 // macro setResult is deprecated. Use function setResult
1784
             getParser().setSym1(result);
1785
	                  break;
1786
            }
1787
	
1358
			//
1788
			//
1359
			// Rule 189:  variableCS ::= IDENTIFIER
1789
			// Rule 189:  variableCS ::= IDENTIFIER
1360
			//
1790
			//
1361
			case 189: {
1791
			case 189: {
1362
				
1792
				
1363
				CSTNode result = createVariableCS(
1793
				CSTNode result = createVariableCS(
1364
						getTokenText(dtParser.getToken(1)),
1794
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1795
            getParser().getToken(1)),
1365
						null,
1796
						null,
1366
						null
1797
						null
1367
					);
1798
					);
1368
				setOffsets(result, getIToken(dtParser.getToken(1)));
1799
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1369
				dtParser.setSym1(result);
1800
            getParser().getToken(1)));
1370
	  		  break;
1801
				 // macro setResult is deprecated. Use function setResult
1371
			}
1802
             getParser().setSym1(result);
1372
	 
1803
	                  break;
1804
            }
1805
	
1373
			//
1806
			//
1374
			// Rule 190:  typedVariableCS ::= IDENTIFIER : typeCS
1807
			// Rule 190:  typedVariableCS ::= IDENTIFIER : typeCS
1375
			//
1808
			//
1376
			case 190: {
1809
			case 190: {
1377
				
1810
				
1378
				CSTNode result = createVariableCS(
1811
				CSTNode result = createVariableCS(
1379
						getTokenText(dtParser.getToken(1)),
1812
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1380
						(TypeCS)dtParser.getSym(3),
1813
            getParser().getToken(1)),
1814
						(TypeCS) // macro getSym is deprecated. Use function getRhsSym
1815
          getParser().getSym(3),
1381
						null
1816
						null
1382
					);
1817
					);
1383
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(3));
1818
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1384
				dtParser.setSym1(result);
1819
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1385
	  		  break;
1820
          getParser().getSym(3));
1386
			}
1821
				 // macro setResult is deprecated. Use function setResult
1387
	 
1822
             getParser().setSym1(result);
1823
	                  break;
1824
            }
1825
	
1388
			//
1826
			//
1389
			// Rule 192:  variableCS ::= IDENTIFIER : typeCS = oclExpressionCS
1827
			// Rule 192:  variableCS ::= IDENTIFIER : typeCS = oclExpressionCS
1390
			//
1828
			//
1391
			case 192: {
1829
			case 192: {
1392
				
1830
				
1393
				CSTNode result = createVariableCS(
1831
				CSTNode result = createVariableCS(
1394
						getTokenText(dtParser.getToken(1)),
1832
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1395
						(TypeCS)dtParser.getSym(3),
1833
            getParser().getToken(1)),
1396
						(OCLExpressionCS)dtParser.getSym(5)
1834
						(TypeCS) // macro getSym is deprecated. Use function getRhsSym
1397
					);
1835
          getParser().getSym(3),
1398
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(5));
1836
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1399
				dtParser.setSym1(result);
1837
          getParser().getSym(5)
1400
	  		  break;
1838
					);
1401
			}
1839
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1402
	 
1840
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1841
          getParser().getSym(5));
1842
				 // macro setResult is deprecated. Use function setResult
1843
             getParser().setSym1(result);
1844
	                  break;
1845
            }
1846
	
1403
			//
1847
			//
1404
			// Rule 193:  variableCS2 ::= IDENTIFIER = oclExpressionCS
1848
			// Rule 193:  variableCS2 ::= IDENTIFIER = oclExpressionCS
1405
			//
1849
			//
1406
			case 193: {
1850
			case 193: {
1407
				
1851
				
1408
				CSTNode result = createVariableCS(
1852
				CSTNode result = createVariableCS(
1409
						getTokenText(dtParser.getToken(1)),
1853
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
1854
            getParser().getToken(1)),
1410
						null,
1855
						null,
1411
						(OCLExpressionCS)dtParser.getSym(3)
1856
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1857
          getParser().getSym(3)
1412
					);
1858
					);
1413
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(3));
1859
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1414
				dtParser.setSym1(result);
1860
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1415
	  		  break;
1861
          getParser().getSym(3));
1416
			}
1862
				 // macro setResult is deprecated. Use function setResult
1417
	 
1863
             getParser().setSym1(result);
1864
	                  break;
1865
            }
1866
	
1418
			//
1867
			//
1419
			// Rule 194:  typeCSopt ::= $Empty
1868
			// Rule 194:  typeCSopt ::= $Empty
1420
			//
1869
			//
1421
			case 194:
1870
			case 194:
1422
				dtParser.setSym1(null);
1871
                setResult(null);
1423
				break;
1872
                break;
1424
 
1873
1425
			//
1874
			//
1426
			// Rule 200:  collectionTypeCS ::= collectionTypeIdentifierCS ( typeCS )
1875
			// Rule 200:  collectionTypeCS ::= collectionTypeIdentifierCS ( typeCS )
1427
			//
1876
			//
1428
			case 200: {
1877
			case 200: {
1429
				
1878
				
1430
				Object[] objs = (Object[])dtParser.getSym(1);
1879
				Object[] objs = (Object[]) // macro getSym is deprecated. Use function getRhsSym
1880
          getParser().getSym(1);
1431
				CSTNode result = createCollectionTypeCS(
1881
				CSTNode result = createCollectionTypeCS(
1432
						(CollectionTypeIdentifierEnum)objs[1],
1882
						(CollectionTypeIdentifierEnum)objs[1],
1433
						(TypeCS)dtParser.getSym(3)
1883
						(TypeCS) // macro getSym is deprecated. Use function getRhsSym
1884
          getParser().getSym(3)
1434
					);
1885
					);
1435
				setOffsets(result, (IToken)objs[0], getIToken(dtParser.getToken(4)));
1886
				setOffsets(result, (IToken)objs[0], getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1436
				dtParser.setSym1(result);
1887
            getParser().getToken(4)));
1437
	  		  break;
1888
				 // macro setResult is deprecated. Use function setResult
1438
			}
1889
             getParser().setSym1(result);
1439
	 
1890
	                  break;
1891
            }
1892
	
1440
			//
1893
			//
1441
			// Rule 201:  tupleTypeCS ::= Tuple ( variableListCSopt )
1894
			// Rule 201:  tupleTypeCS ::= Tuple ( variableListCSopt )
1442
			//
1895
			//
1443
			case 201: {
1896
			case 201: {
1444
				
1897
				
1445
				CSTNode result = createTupleTypeCS((EList)dtParser.getSym(3));
1898
				CSTNode result = createTupleTypeCS((EList) // macro getSym is deprecated. Use function getRhsSym
1446
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
1899
          getParser().getSym(3));
1447
				dtParser.setSym1(result);
1900
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1448
	  		  break;
1901
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1449
			}
1902
            getParser().getToken(4)));
1903
				 // macro setResult is deprecated. Use function setResult
1904
             getParser().setSym1(result);
1905
	                  break;
1906
            }
1450
	 
1907
	 
1451
			//
1908
			//
1452
			// Rule 202:  variableListCSopt ::= $Empty
1909
			// Rule 202:  variableListCSopt ::= $Empty
1453
			//
1910
			//
1911
			
1454
			case 202:
1912
			case 202:
1455
				dtParser.setSym1(new BasicEList());
1913
				setResult(new BasicEList());
1456
				break;
1914
				break;
1457
 
1915
1458
			//
1916
			//
1459
			// Rule 204:  variableListCS ::= variableCS
1917
			// Rule 204:  variableListCS ::= variableCS
1460
			//
1918
			//
1461
			case 204: {
1919
			case 204: {
1462
				
1920
				
1463
				EList result = new BasicEList();
1921
				EList result = new BasicEList();
1464
				result.add(dtParser.getSym(1));
1922
				result.add( // macro getSym is deprecated. Use function getRhsSym
1465
				dtParser.setSym1(result);
1923
          getParser().getSym(1));
1466
	  		  break;
1924
				 // macro setResult is deprecated. Use function setResult
1467
			}
1925
             getParser().setSym1(result);
1468
	 
1926
	                  break;
1927
            }
1928
	
1469
			//
1929
			//
1470
			// Rule 205:  variableListCS ::= variableListCS , variableCS
1930
			// Rule 205:  variableListCS ::= variableListCS , variableCS
1471
			//
1931
			//
1472
			case 205: {
1932
			case 205: {
1473
				
1933
				
1474
				EList result = (EList)dtParser.getSym(1);
1934
				EList result = (EList) // macro getSym is deprecated. Use function getRhsSym
1475
				result.add(dtParser.getSym(3));
1935
          getParser().getSym(1);
1476
				dtParser.setSym1(result);
1936
				result.add( // macro getSym is deprecated. Use function getRhsSym
1477
	  		  break;
1937
          getParser().getSym(3));
1478
			}
1938
				 // macro setResult is deprecated. Use function setResult
1939
             getParser().setSym1(result);
1940
	                  break;
1941
            }
1479
	 
1942
	 
1480
			//
1943
			//
1481
			// Rule 206:  variableListCS2 ::= variableCS2
1944
			// Rule 206:  variableListCS2 ::= variableCS2
1482
			//
1945
			//
1946
			
1483
			case 206:
1947
			case 206:
1484
 
1948
1485
			//
1949
			//
1486
			// Rule 207:  variableListCS2 ::= variableCS
1950
			// Rule 207:  variableListCS2 ::= variableCS
1487
			//
1951
			//
1488
			case 207: {
1952
			case 207: {
1489
				
1953
				
1490
				EList result = new BasicEList();
1954
				EList result = new BasicEList();
1491
				result.add(dtParser.getSym(1));
1955
				result.add( // macro getSym is deprecated. Use function getRhsSym
1492
				dtParser.setSym1(result);
1956
          getParser().getSym(1));
1493
	  		  break;
1957
				 // macro setResult is deprecated. Use function setResult
1494
			}
1958
             getParser().setSym1(result);
1959
	                  break;
1960
            }
1495
	 
1961
	 
1496
			//
1962
			//
1497
			// Rule 208:  variableListCS2 ::= variableListCS2 , variableCS2
1963
			// Rule 208:  variableListCS2 ::= variableListCS2 , variableCS2
1498
			//
1964
			//
1965
			
1499
			case 208:
1966
			case 208:
1500
 
1967
1501
			//
1968
			//
1502
			// Rule 209:  variableListCS2 ::= variableListCS2 , variableCS
1969
			// Rule 209:  variableListCS2 ::= variableListCS2 , variableCS
1503
			//
1970
			//
1504
			case 209: {
1971
			case 209: {
1505
				
1972
				
1506
				EList result = (EList)dtParser.getSym(1);
1973
				EList result = (EList) // macro getSym is deprecated. Use function getRhsSym
1507
				result.add(dtParser.getSym(3));
1974
          getParser().getSym(1);
1508
				dtParser.setSym1(result);
1975
				result.add( // macro getSym is deprecated. Use function getRhsSym
1509
	  		  break;
1976
          getParser().getSym(3));
1510
			}
1977
				 // macro setResult is deprecated. Use function setResult
1978
             getParser().setSym1(result);
1979
	                  break;
1980
            }
1511
	 
1981
	 
1512
			//
1982
			//
1513
			// Rule 212:  featureCallExpCS ::= unaryName isMarkedPreCS ( argumentsCSopt )
1983
			// Rule 212:  featureCallExpCS ::= unaryName isMarkedPreCS ( argumentsCSopt )
1514
			//
1984
			//
1985
			
1515
			case 212:
1986
			case 212:
1516
 
1987
 
1517
			//
1988
			//
1518
			// Rule 213:  operationCallExpCS ::= binaryName isMarkedPreCS ( argumentsCSopt )
1989
			// Rule 213:  operationCallExpCS ::= binaryName isMarkedPreCS ( argumentsCSopt )
1519
			//
1990
			//
1991
			
1520
			case 213:
1992
			case 213:
1521
 
1993
1522
			//
1994
			//
1523
			// Rule 214:  keywordOperationCallExpCS ::= keywordAsName isMarkedPreCS ( argumentsCSopt )
1995
			// Rule 214:  keywordOperationCallExpCS ::= keywordAsName isMarkedPreCS ( argumentsCSopt )
1524
			//
1996
			//
1525
			case 214: {
1997
			case 214: {
1526
				
1998
				
1527
				CSTNode result = createOperationCallExpCS(
1999
				CSTNode result = createOperationCallExpCS(
1528
						(SimpleNameCS)dtParser.getSym(1),
2000
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1529
						(IsMarkedPreCS)dtParser.getSym(2),
2001
          getParser().getSym(1),
1530
						(EList)dtParser.getSym(4)
2002
						(IsMarkedPreCS) // macro getSym is deprecated. Use function getRhsSym
1531
					);
2003
          getParser().getSym(2),
1532
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(5)));
2004
						(EList) // macro getSym is deprecated. Use function getRhsSym
1533
				dtParser.setSym1(result);
2005
          getParser().getSym(4)
1534
	  		  break;
2006
					);
1535
			}
2007
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1536
	 
2008
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2009
            getParser().getToken(5)));
2010
				 // macro setResult is deprecated. Use function setResult
2011
             getParser().setSym1(result);
2012
	                  break;
2013
            }
2014
	
1537
			//
2015
			//
1538
			// Rule 215:  stateExpCS ::= pathNameCSOpt
2016
			// Rule 215:  stateExpCS ::= pathNameCSOpt
1539
			//
2017
			//
1540
			case 215: {
2018
			case 215: {
1541
				
2019
				
1542
				PathNameCS pathNameCS = (PathNameCS)dtParser.getSym(1);
2020
				PathNameCS pathNameCS = (PathNameCS) // macro getSym is deprecated. Use function getRhsSym
2021
          getParser().getSym(1);
1543
				StateExpCS result = createStateExpCS(pathNameCS);
2022
				StateExpCS result = createStateExpCS(pathNameCS);
1544
				setOffsets(result, pathNameCS);
2023
				setOffsets(result, pathNameCS);
1545
				dtParser.setSym1(result);
2024
				 // macro setResult is deprecated. Use function setResult
1546
	  		  break;
2025
             getParser().setSym1(result);
1547
			}
2026
	                  break;
1548
	 
2027
            }
2028
	
1549
			//
2029
			//
1550
			// Rule 216:  operationCallExpCS ::= oclIsInStateName isMarkedPreCS ( stateExpCS )
2030
			// Rule 216:  operationCallExpCS ::= oclIsInStateName isMarkedPreCS ( stateExpCS )
1551
			//
2031
			//
1552
			case 216: {
2032
			case 216: {
1553
				
2033
				
1554
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(1);
2034
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2035
          getParser().getSym(1);
1555
				CSTNode result = createOperationCallExpCS(
2036
				CSTNode result = createOperationCallExpCS(
1556
						simpleNameCS,
2037
						simpleNameCS,
1557
						(IsMarkedPreCS)dtParser.getSym(2),
2038
						(IsMarkedPreCS) // macro getSym is deprecated. Use function getRhsSym
1558
						(StateExpCS)dtParser.getSym(4)
2039
          getParser().getSym(2),
1559
					);
2040
						(StateExpCS) // macro getSym is deprecated. Use function getRhsSym
1560
				setOffsets(result, simpleNameCS, getIToken(dtParser.getToken(5)));
2041
          getParser().getSym(4)
1561
				dtParser.setSym1(result);
2042
					);
1562
	  		  break;
2043
				setOffsets(result, simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1563
			}
2044
            getParser().getToken(5)));
2045
				 // macro setResult is deprecated. Use function setResult
2046
             getParser().setSym1(result);
2047
	                  break;
2048
            }
1564
	 
2049
	 
1565
			//
2050
			//
1566
			// Rule 217:  attrOrNavCallExpCS ::= simpleNameCS isMarkedPreCS
2051
			// Rule 217:  attrOrNavCallExpCS ::= simpleNameCS isMarkedPreCS
1567
			//
2052
			//
2053
			
1568
			case 217:
2054
			case 217:
1569
 
2055
1570
			//
2056
			//
1571
			// Rule 218:  attrOrNavCallExpCS ::= keywordAsName isMarkedPreCS
2057
			// Rule 218:  attrOrNavCallExpCS ::= keywordAsName isMarkedPreCS
1572
			//
2058
			//
1573
			case 218: {
2059
			case 218: {
1574
				
2060
				
1575
				IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)dtParser.getSym(2);
2061
				IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS) // macro getSym is deprecated. Use function getRhsSym
2062
          getParser().getSym(2);
1576
				CSTNode result = createFeatureCallExpCS(
2063
				CSTNode result = createFeatureCallExpCS(
1577
						(SimpleNameCS)dtParser.getSym(1),
2064
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2065
          getParser().getSym(1),
1578
						new BasicEList(),
2066
						new BasicEList(),
1579
						isMarkedPreCS
2067
						isMarkedPreCS
1580
					);
2068
					);
1581
				if (isMarkedPreCS.isPre()) {
2069
				if (isMarkedPreCS.isPre()) {
1582
					setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(2));
2070
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2071
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2072
          getParser().getSym(2));
1583
				} else {
2073
				} else {
1584
					setOffsets(result, (CSTNode)dtParser.getSym(1));
2074
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2075
          getParser().getSym(1));
1585
				}
2076
				}
1586
				dtParser.setSym1(result);
2077
				 // macro setResult is deprecated. Use function setResult
1587
	  		  break;
2078
             getParser().setSym1(result);
1588
			}
2079
	                  break;
1589
	 
2080
            }
2081
	
1590
			//
2082
			//
1591
			// Rule 219:  attrOrNavCallExpCS ::= simpleNameCS [ argumentsCS ] isMarkedPreCS
2083
			// Rule 219:  attrOrNavCallExpCS ::= simpleNameCS [ argumentsCS ] isMarkedPreCS
1592
			//
2084
			//
1593
			case 219: {
2085
			case 219: {
1594
				
2086
				
1595
				IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)dtParser.getSym(5);
2087
				IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS) // macro getSym is deprecated. Use function getRhsSym
2088
          getParser().getSym(5);
1596
				CSTNode result = createFeatureCallExpCS(
2089
				CSTNode result = createFeatureCallExpCS(
1597
						(SimpleNameCS)dtParser.getSym(1),
2090
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1598
						(EList)dtParser.getSym(3),
2091
          getParser().getSym(1),
2092
						(EList) // macro getSym is deprecated. Use function getRhsSym
2093
          getParser().getSym(3),
1599
						isMarkedPreCS
2094
						isMarkedPreCS
1600
					);
2095
					);
1601
				if (isMarkedPreCS.isPre()) {
2096
				if (isMarkedPreCS.isPre()) {
1602
					setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(5));
2097
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2098
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2099
          getParser().getSym(5));
1603
				} else {
2100
				} else {
1604
					setOffsets(result, (CSTNode)dtParser.getSym(1), getIToken(dtParser.getToken(4)));
2101
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2102
          getParser().getSym(1), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2103
            getParser().getToken(4)));
1605
				}
2104
				}
1606
				dtParser.setSym1(result);
2105
				 // macro setResult is deprecated. Use function setResult
1607
	  		  break;
2106
             getParser().setSym1(result);
1608
			}
2107
	                  break;
1609
	 
2108
            }
2109
	
1610
			//
2110
			//
1611
			// Rule 220:  isMarkedPreCS ::= $Empty
2111
			// Rule 220:  isMarkedPreCS ::= $Empty
1612
			//
2112
			//
1613
			case 220: {
2113
			case 220: {
1614
				
2114
				
1615
				CSTNode result = createIsMarkedPreCS(false);
2115
				CSTNode result = createIsMarkedPreCS(false);
1616
				setOffsets(result, getIToken(dtParser.getToken(1)));
2116
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1617
				dtParser.setSym1(result);
2117
            getParser().getToken(1)));
1618
	  		  break;
2118
				 // macro setResult is deprecated. Use function setResult
1619
			}
2119
             getParser().setSym1(result);
1620
	 
2120
	                  break;
2121
            }
2122
	
1621
			//
2123
			//
1622
			// Rule 221:  isMarkedPreCS ::= @pre
2124
			// Rule 221:  isMarkedPreCS ::= @pre
1623
			//
2125
			//
1624
			case 221: {
2126
			case 221: {
1625
				
2127
				
1626
				CSTNode result = createIsMarkedPreCS(true);
2128
				CSTNode result = createIsMarkedPreCS(true);
1627
				setOffsets(result, getIToken(dtParser.getToken(1)));
2129
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1628
				dtParser.setSym1(result);
2130
            getParser().getToken(1)));
1629
	  		  break;
2131
				 // macro setResult is deprecated. Use function setResult
1630
			}
2132
             getParser().setSym1(result);
2133
	                  break;
2134
            }
1631
	 
2135
	 
1632
			//
2136
			//
1633
			// Rule 222:  argumentsCSopt ::= $Empty
2137
			// Rule 222:  argumentsCSopt ::= $Empty
1634
			//
2138
			//
2139
			
1635
			case 222:
2140
			case 222:
1636
				dtParser.setSym1(new BasicEList());
2141
				setResult(new BasicEList());
1637
				break;
2142
				break;
1638
 
2143
1639
			//
2144
			//
1640
			// Rule 224:  argumentsCS ::= oclExpressionCS
2145
			// Rule 224:  argumentsCS ::= oclExpressionCS
1641
			//
2146
			//
1642
			case 224: {
2147
			case 224: {
1643
				
2148
				
1644
				EList result = new BasicEList();
2149
				EList result = new BasicEList();
1645
				result.add(dtParser.getSym(1));
2150
				result.add( // macro getSym is deprecated. Use function getRhsSym
1646
				dtParser.setSym1(result);
2151
          getParser().getSym(1));
1647
	  		  break;
2152
				 // macro setResult is deprecated. Use function setResult
1648
			}
2153
             getParser().setSym1(result);
1649
	 
2154
	                  break;
2155
            }
2156
	
1650
			//
2157
			//
1651
			// Rule 225:  argumentsCS ::= argumentsCS , oclExpressionCS
2158
			// Rule 225:  argumentsCS ::= argumentsCS , oclExpressionCS
1652
			//
2159
			//
1653
			case 225: {
2160
			case 225: {
1654
				
2161
				
1655
				EList result = (EList)dtParser.getSym(1);
2162
				EList result = (EList) // macro getSym is deprecated. Use function getRhsSym
1656
				result.add(dtParser.getSym(3));
2163
          getParser().getSym(1);
1657
				dtParser.setSym1(result);
2164
				result.add( // macro getSym is deprecated. Use function getRhsSym
1658
	  		  break;
2165
          getParser().getSym(3));
1659
			}
2166
				 // macro setResult is deprecated. Use function setResult
1660
	 
2167
             getParser().setSym1(result);
2168
	                  break;
2169
            }
2170
	
1661
			//
2171
			//
1662
			// Rule 226:  letExpCS ::= let variableListCS in oclExpressionCS
2172
			// Rule 226:  letExpCS ::= let variableListCS in oclExpressionCS
1663
			//
2173
			//
1664
			case 226: {
2174
			case 226: {
1665
				
2175
				
1666
				CSTNode result = createLetExpCS(
2176
				CSTNode result = createLetExpCS(
1667
						(EList)dtParser.getSym(2),
2177
						(EList) // macro getSym is deprecated. Use function getRhsSym
1668
						(OCLExpressionCS)dtParser.getSym(4)
2178
          getParser().getSym(2),
1669
					);
2179
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1670
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(4));
2180
          getParser().getSym(4)
1671
				dtParser.setSym1(result);
2181
					);
1672
	  		  break;
2182
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1673
			}
2183
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1674
	 
2184
          getParser().getSym(4));
2185
				 // macro setResult is deprecated. Use function setResult
2186
             getParser().setSym1(result);
2187
	                  break;
2188
            }
2189
	
1675
			//
2190
			//
1676
			// Rule 227:  ifExpCS ::= if oclExpressionCS then oclExpressionCS else oclExpressionCS endif
2191
			// Rule 227:  ifExpCS ::= if oclExpressionCS then oclExpressionCS else oclExpressionCS endif
1677
			//
2192
			//
1678
			case 227: {
2193
			case 227: {
1679
				
2194
				
1680
				CSTNode result = createIfExpCS(
2195
				CSTNode result = createIfExpCS(
1681
						(OCLExpressionCS)dtParser.getSym(2),
2196
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1682
						(OCLExpressionCS)dtParser.getSym(4),
2197
          getParser().getSym(2),
1683
						(OCLExpressionCS)dtParser.getSym(6)
2198
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1684
					);
2199
          getParser().getSym(4),
1685
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(7)));
2200
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1686
				dtParser.setSym1(result);
2201
          getParser().getSym(6)
1687
	  		  break;
2202
					);
1688
			}
2203
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2204
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2205
            getParser().getToken(7)));
2206
				 // macro setResult is deprecated. Use function setResult
2207
             getParser().setSym1(result);
2208
	                  break;
2209
            }
1689
	 
2210
	 
1690
			//
2211
			//
1691
			// Rule 228:  messageExpCS ::= ^ simpleNameCS ( oclMessageArgumentsCSopt )
2212
			// Rule 228:  messageExpCS ::= ^ simpleNameCS ( oclMessageArgumentsCSopt )
1692
			//
2213
			//
2214
			
1693
			case 228:
2215
			case 228:
1694
 
2216
1695
			//
2217
			//
1696
			// Rule 229:  messageExpCS ::= ^^ simpleNameCS ( oclMessageArgumentsCSopt )
2218
			// Rule 229:  messageExpCS ::= ^^ simpleNameCS ( oclMessageArgumentsCSopt )
1697
			//
2219
			//
1698
			case 229: {
2220
			case 229: {
1699
				
2221
				
1700
				CSTNode result = createMessageExpCS(
2222
				CSTNode result = createMessageExpCS(
1701
						getIToken(dtParser.getToken(1)).getKind() == OCLBacktrackingParsersym.TK_CARET,
2223
						getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1702
						(SimpleNameCS)dtParser.getSym(2),
2224
            getParser().getToken(1)).getKind() == OCLBacktrackingParsersym.TK_CARET,
1703
						(EList<OCLMessageArgCS>)dtParser.getSym(4)
2225
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1704
					);
2226
          getParser().getSym(2),
1705
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(5)));
2227
						(EList<OCLMessageArgCS>) // macro getSym is deprecated. Use function getRhsSym
1706
				dtParser.setSym1(result);
2228
          getParser().getSym(4)
1707
	  		  break;
2229
					);
1708
			}
2230
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2231
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2232
            getParser().getToken(5)));
2233
				 // macro setResult is deprecated. Use function setResult
2234
             getParser().setSym1(result);
2235
	                  break;
2236
            }
1709
	 
2237
	 
1710
			//
2238
			//
1711
			// Rule 230:  oclMessageArgumentsCSopt ::= $Empty
2239
			// Rule 230:  oclMessageArgumentsCSopt ::= $Empty
1712
			//
2240
			//
2241
			
1713
			case 230:
2242
			case 230:
1714
				dtParser.setSym1(new BasicEList());
2243
				setResult(new BasicEList());
1715
				break;
2244
				break;
1716
 
2245
1717
			//
2246
			//
1718
			// Rule 232:  oclMessageArgumentsCS ::= oclMessageArgCS
2247
			// Rule 232:  oclMessageArgumentsCS ::= oclMessageArgCS
1719
			//
2248
			//
1720
			case 232: {
2249
			case 232: {
1721
				
2250
				
1722
				EList result = new BasicEList();
2251
				EList result = new BasicEList();
1723
				result.add(dtParser.getSym(1));
2252
				result.add( // macro getSym is deprecated. Use function getRhsSym
1724
				dtParser.setSym1(result);
2253
          getParser().getSym(1));
1725
	  		  break;
2254
				 // macro setResult is deprecated. Use function setResult
1726
			}
2255
             getParser().setSym1(result);
1727
	 
2256
	                  break;
2257
            }
2258
	
1728
			//
2259
			//
1729
			// Rule 233:  oclMessageArgumentsCS ::= oclMessageArgumentsCS , oclMessageArgCS
2260
			// Rule 233:  oclMessageArgumentsCS ::= oclMessageArgumentsCS , oclMessageArgCS
1730
			//
2261
			//
1731
			case 233: {
2262
			case 233: {
1732
				
2263
				
1733
				EList result = (EList)dtParser.getSym(1);
2264
				EList result = (EList) // macro getSym is deprecated. Use function getRhsSym
1734
				result.add(dtParser.getSym(3));
2265
          getParser().getSym(1);
1735
				dtParser.setSym1(result);
2266
				result.add( // macro getSym is deprecated. Use function getRhsSym
1736
	  		  break;
2267
          getParser().getSym(3));
1737
			}
2268
				 // macro setResult is deprecated. Use function setResult
1738
	 
2269
             getParser().setSym1(result);
2270
	                  break;
2271
            }
2272
	
1739
			//
2273
			//
1740
			// Rule 234:  oclMessageArgCS ::= oclExpressionCS
2274
			// Rule 234:  oclMessageArgCS ::= oclExpressionCS
1741
			//
2275
			//
Lines 1743-1755 Link Here
1743
				
2277
				
1744
				CSTNode result = createOCLMessageArgCS(
2278
				CSTNode result = createOCLMessageArgCS(
1745
						null,
2279
						null,
1746
						(OCLExpressionCS)dtParser.getSym(1)
2280
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
2281
          getParser().getSym(1)
1747
					);
2282
					);
1748
				setOffsets(result, (CSTNode)dtParser.getSym(1));
2283
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1749
				dtParser.setSym1(result);
2284
          getParser().getSym(1));
1750
	  		  break;
2285
				 // macro setResult is deprecated. Use function setResult
1751
			}
2286
             getParser().setSym1(result);
1752
	 
2287
	                  break;
2288
            }
2289
	
1753
			//
2290
			//
1754
			// Rule 235:  oclMessageArgCS ::= ?
2291
			// Rule 235:  oclMessageArgCS ::= ?
1755
			//
2292
			//
Lines 1759-1992 Link Here
1759
						null,
2296
						null,
1760
						null
2297
						null
1761
					);
2298
					);
1762
				setOffsets(result, getIToken(dtParser.getToken(1)));
2299
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1763
				dtParser.setSym1(result);
2300
            getParser().getToken(1)));
1764
	  		  break;
2301
				 // macro setResult is deprecated. Use function setResult
1765
			}
2302
             getParser().setSym1(result);
1766
	 
2303
	                  break;
2304
            }
2305
	
1767
			//
2306
			//
1768
			// Rule 236:  oclMessageArgCS ::= ? : typeCS
2307
			// Rule 236:  oclMessageArgCS ::= ? : typeCS
1769
			//
2308
			//
1770
			case 236: {
2309
			case 236: {
1771
				
2310
				
1772
				CSTNode result = createOCLMessageArgCS(
2311
				CSTNode result = createOCLMessageArgCS(
1773
						(TypeCS)dtParser.getSym(3),
2312
						(TypeCS) // macro getSym is deprecated. Use function getRhsSym
2313
          getParser().getSym(3),
1774
						null
2314
						null
1775
					);
2315
					);
1776
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(3));
2316
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1777
				dtParser.setSym1(result);
2317
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1778
	  		  break;
2318
          getParser().getSym(3));
1779
			}
2319
				 // macro setResult is deprecated. Use function setResult
1780
	 
2320
             getParser().setSym1(result);
2321
	                  break;
2322
            }
2323
	
1781
			//
2324
			//
1782
			// Rule 245:  packageDeclarationCSm ::= packageDeclarationCSm packageDeclarationCS
2325
			// Rule 245:  packageDeclarationCSm ::= packageDeclarationCSm packageDeclarationCS
1783
			//
2326
			//
1784
			case 245: {
2327
			case 245: {
1785
				
2328
				
1786
				PackageDeclarationCS result = (PackageDeclarationCS)dtParser.getSym(2);
2329
				PackageDeclarationCS result = (PackageDeclarationCS) // macro getSym is deprecated. Use function getRhsSym
1787
				result.setPackageDeclarationCS((PackageDeclarationCS) dtParser.getSym(1));
2330
          getParser().getSym(2);
1788
				dtParser.setSym1(result);
2331
				result.setPackageDeclarationCS((PackageDeclarationCS)  // macro getSym is deprecated. Use function getRhsSym
1789
	  		  break;
2332
          getParser().getSym(1));
1790
			}
2333
				 // macro setResult is deprecated. Use function setResult
1791
	 
2334
             getParser().setSym1(result);
2335
	                  break;
2336
            }
2337
	
1792
			//
2338
			//
1793
			// Rule 246:  packageDeclarationCS ::= package pathNameCS contextDeclCSmopt endpackage
2339
			// Rule 246:  packageDeclarationCS ::= package pathNameCS contextDeclCSmopt endpackage
1794
			//
2340
			//
1795
			case 246: {
2341
			case 246: {
1796
				
2342
				
1797
				CSTNode result = createPackageDeclarationCS(
2343
				CSTNode result = createPackageDeclarationCS(
1798
						(PathNameCS)dtParser.getSym(2),
2344
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
1799
						(EList)dtParser.getSym(3)
2345
          getParser().getSym(2),
1800
					);
2346
						(EList) // macro getSym is deprecated. Use function getRhsSym
1801
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
2347
          getParser().getSym(3)
1802
				dtParser.setSym1(result);
2348
					);
1803
	  		  break;
2349
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1804
			}
2350
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1805
	 
2351
            getParser().getToken(4)));
2352
				 // macro setResult is deprecated. Use function setResult
2353
             getParser().setSym1(result);
2354
	                  break;
2355
            }
2356
	
1806
			//
2357
			//
1807
			// Rule 247:  packageDeclarationCS1 ::= contextDeclCSm
2358
			// Rule 247:  packageDeclarationCS1 ::= contextDeclCSm
1808
			//
2359
			//
1809
			case 247: {
2360
			case 247: {
1810
				
2361
				
1811
				EList contextDecls = (EList)dtParser.getSym(1);
2362
				EList contextDecls = (EList) // macro getSym is deprecated. Use function getRhsSym
2363
          getParser().getSym(1);
1812
				CSTNode result = createPackageDeclarationCS(null, contextDecls);
2364
				CSTNode result = createPackageDeclarationCS(null, contextDecls);
1813
				if (!contextDecls.isEmpty()) {
2365
				if (!contextDecls.isEmpty()) {
1814
					setOffsets(result, (CSTNode)contextDecls.get(0), (CSTNode)contextDecls.get(contextDecls.size()-1));
2366
					setOffsets(result, (CSTNode)contextDecls.get(0), (CSTNode)contextDecls.get(contextDecls.size()-1));
1815
				}
2367
				}
1816
				dtParser.setSym1(result);
2368
				 // macro setResult is deprecated. Use function setResult
1817
	  		  break;
2369
             getParser().setSym1(result);
1818
			}
2370
	                  break;
2371
            }
1819
	 
2372
	 
1820
			//
2373
			//
1821
			// Rule 248:  contextDeclCSmopt ::= $Empty
2374
			// Rule 248:  contextDeclCSmopt ::= $Empty
1822
			//
2375
			//
2376
			
1823
			case 248:
2377
			case 248:
1824
				dtParser.setSym1(new BasicEList());
2378
				setResult(new BasicEList());
1825
				break;
2379
				break;
1826
 
2380
1827
			//
2381
			//
1828
			// Rule 250:  contextDeclCSm ::= contextDeclCS
2382
			// Rule 250:  contextDeclCSm ::= contextDeclCS
1829
			//
2383
			//
1830
			case 250: {
2384
			case 250: {
1831
				
2385
				
1832
				EList result = new BasicEList();
2386
				EList result = new BasicEList();
1833
				result.add(dtParser.getSym(1));
2387
				result.add( // macro getSym is deprecated. Use function getRhsSym
1834
				dtParser.setSym1(result);
2388
          getParser().getSym(1));
1835
	  		  break;
2389
				 // macro setResult is deprecated. Use function setResult
1836
			}
2390
             getParser().setSym1(result);
1837
	 
2391
	                  break;
2392
            }
2393
	
1838
			//
2394
			//
1839
			// Rule 251:  contextDeclCSm ::= contextDeclCSm contextDeclCS
2395
			// Rule 251:  contextDeclCSm ::= contextDeclCSm contextDeclCS
1840
			//
2396
			//
1841
			case 251: {
2397
			case 251: {
1842
				
2398
				
1843
				EList result = (EList)dtParser.getSym(1);
2399
				EList result = (EList) // macro getSym is deprecated. Use function getRhsSym
1844
				result.add(dtParser.getSym(2));
2400
          getParser().getSym(1);
1845
				dtParser.setSym1(result);
2401
				result.add( // macro getSym is deprecated. Use function getRhsSym
1846
	  		  break;
2402
          getParser().getSym(2));
1847
			}
2403
				 // macro setResult is deprecated. Use function setResult
1848
	 
2404
             getParser().setSym1(result);
2405
	                  break;
2406
            }
2407
	
1849
			//
2408
			//
1850
			// Rule 255:  propertyContextCS ::= context pathNameCS :: simpleNameCS : typeCS initOrDerValueCS
2409
			// Rule 255:  propertyContextCS ::= context pathNameCS :: simpleNameCS : typeCS initOrDerValueCS
1851
			//
2410
			//
1852
			case 255: {
2411
			case 255: {
1853
				
2412
				
1854
				CSTNode result = createPropertyContextCS(
2413
				CSTNode result = createPropertyContextCS(
1855
						(PathNameCS)dtParser.getSym(2),
2414
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
1856
						(SimpleNameCS)dtParser.getSym(4),
2415
          getParser().getSym(2),
1857
						(TypeCS)dtParser.getSym(6),
2416
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1858
						(InitOrDerValueCS)dtParser.getSym(7)
2417
          getParser().getSym(4),
1859
					);
2418
						(TypeCS) // macro getSym is deprecated. Use function getRhsSym
1860
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(7));
2419
          getParser().getSym(6),
1861
				dtParser.setSym1(result);
2420
						(InitOrDerValueCS) // macro getSym is deprecated. Use function getRhsSym
1862
	  		  break;
2421
          getParser().getSym(7)
1863
			}
2422
					);
1864
	 
2423
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2424
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2425
          getParser().getSym(7));
2426
				 // macro setResult is deprecated. Use function setResult
2427
             getParser().setSym1(result);
2428
	                  break;
2429
            }
2430
	
1865
			//
2431
			//
1866
			// Rule 256:  initOrDerValueCS ::= initOrDerValueCSopt init : oclExpressionCS
2432
			// Rule 256:  initOrDerValueCS ::= initOrDerValueCSopt init : oclExpressionCS
1867
			//
2433
			//
1868
			case 256: {
2434
			case 256: {
1869
				
2435
				
1870
				CSTNode result = createInitValueCS(
2436
				CSTNode result = createInitValueCS(
1871
						(InitOrDerValueCS)dtParser.getSym(1),
2437
						(InitOrDerValueCS) // macro getSym is deprecated. Use function getRhsSym
1872
						(OCLExpressionCS)dtParser.getSym(4)
2438
          getParser().getSym(1),
1873
					);
2439
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1874
				if (dtParser.getSym(1) != null) {
2440
          getParser().getSym(4)
1875
					setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(4));
2441
					);
2442
				if ( // macro getSym is deprecated. Use function getRhsSym
2443
          getParser().getSym(1) != null) {
2444
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2445
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2446
          getParser().getSym(4));
1876
				} else {
2447
				} else {
1877
					setOffsets(result, getIToken(dtParser.getToken(2)), (CSTNode)dtParser.getSym(4));
2448
					setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2449
            getParser().getToken(2)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2450
          getParser().getSym(4));
1878
				}
2451
				}
1879
				dtParser.setSym1(result);
2452
				 // macro setResult is deprecated. Use function setResult
1880
	  		  break;
2453
             getParser().setSym1(result);
1881
			}
2454
	                  break;
1882
	 
2455
            }
2456
	
1883
			//
2457
			//
1884
			// Rule 257:  initOrDerValueCS ::= initOrDerValueCSopt derive : oclExpressionCS
2458
			// Rule 257:  initOrDerValueCS ::= initOrDerValueCSopt derive : oclExpressionCS
1885
			//
2459
			//
1886
			case 257: {
2460
			case 257: {
1887
				
2461
				
1888
				CSTNode result = createDerValueCS(
2462
				CSTNode result = createDerValueCS(
1889
						(InitOrDerValueCS)dtParser.getSym(1),
2463
						(InitOrDerValueCS) // macro getSym is deprecated. Use function getRhsSym
1890
						(OCLExpressionCS)dtParser.getSym(4)
2464
          getParser().getSym(1),
1891
					);
2465
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1892
				if (dtParser.getSym(1) != null) {
2466
          getParser().getSym(4)
1893
					setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(4));
2467
					);
2468
				if ( // macro getSym is deprecated. Use function getRhsSym
2469
          getParser().getSym(1) != null) {
2470
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2471
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2472
          getParser().getSym(4));
1894
				} else {
2473
				} else {
1895
					setOffsets(result, getIToken(dtParser.getToken(2)), (CSTNode)dtParser.getSym(4));
2474
					setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2475
            getParser().getToken(2)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2476
          getParser().getSym(4));
1896
				}
2477
				}
1897
				dtParser.setSym1(result);
2478
				 // macro setResult is deprecated. Use function setResult
1898
	  		  break;
2479
             getParser().setSym1(result);
1899
			}
2480
	                  break;
1900
	 
2481
            }
2482
	
1901
			//
2483
			//
1902
			// Rule 258:  initOrDerValueCSopt ::= $Empty
2484
			// Rule 258:  initOrDerValueCSopt ::= $Empty
1903
			//
2485
			//
1904
			case 258:
2486
			case 258:
1905
				dtParser.setSym1(null);
2487
                setResult(null);
1906
				break;
2488
                break;
1907
 
2489
1908
			//
2490
			//
1909
			// Rule 260:  classifierContextDeclCS ::= context pathNameCS invOrDefCSm
2491
			// Rule 260:  classifierContextDeclCS ::= context pathNameCS invOrDefCSm
1910
			//
2492
			//
1911
			case 260: {
2493
			case 260: {
1912
				
2494
				
1913
				EList<InvOrDefCS> list = (EList<InvOrDefCS>)dtParser.getSym(3);
2495
				EList<InvOrDefCS> list = (EList<InvOrDefCS>) // macro getSym is deprecated. Use function getRhsSym
2496
          getParser().getSym(3);
1914
				CSTNode result = createClassifierContextDeclCS(
2497
				CSTNode result = createClassifierContextDeclCS(
1915
						(PathNameCS)dtParser.getSym(2),
2498
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
2499
          getParser().getSym(2),
1916
						list
2500
						list
1917
					);
2501
					);
1918
				setOffsets(result, getIToken(dtParser.getToken(1)), list.get(list.size()-1));
2502
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1919
				dtParser.setSym1(result);
2503
            getParser().getToken(1)), list.get(list.size()-1));
1920
	  		  break;
2504
				 // macro setResult is deprecated. Use function setResult
1921
			}
2505
             getParser().setSym1(result);
1922
	 
2506
	                  break;
2507
            }
2508
	
1923
			//
2509
			//
1924
			// Rule 261:  invOrDefCSm ::= invOrDefCS
2510
			// Rule 261:  invOrDefCSm ::= invOrDefCS
1925
			//
2511
			//
1926
			case 261: {
2512
			case 261: {
1927
				
2513
				
1928
				EList<InvOrDefCS> result = new BasicEList<InvOrDefCS>();
2514
				EList<InvOrDefCS> result = new BasicEList<InvOrDefCS>();
1929
				result.add((InvOrDefCS)dtParser.getSym(1));
2515
				result.add((InvOrDefCS) // macro getSym is deprecated. Use function getRhsSym
1930
				dtParser.setSym1(result);
2516
          getParser().getSym(1));
1931
	  		  break;
2517
				 // macro setResult is deprecated. Use function setResult
1932
			}
2518
             getParser().setSym1(result);
1933
	 
2519
	                  break;
2520
            }
2521
	
1934
			//
2522
			//
1935
			// Rule 262:  invOrDefCSm ::= invOrDefCSm invOrDefCS
2523
			// Rule 262:  invOrDefCSm ::= invOrDefCSm invOrDefCS
1936
			//
2524
			//
1937
			case 262: {
2525
			case 262: {
1938
				
2526
				
1939
				EList<InvOrDefCS> result = (EList<InvOrDefCS>)dtParser.getSym(1);
2527
				EList<InvOrDefCS> result = (EList<InvOrDefCS>) // macro getSym is deprecated. Use function getRhsSym
1940
				result.add((InvOrDefCS)dtParser.getSym(2));
2528
          getParser().getSym(1);
1941
				dtParser.setSym1(result);
2529
				result.add((InvOrDefCS) // macro getSym is deprecated. Use function getRhsSym
1942
	  		  break;
2530
          getParser().getSym(2));
1943
			}
2531
				 // macro setResult is deprecated. Use function setResult
1944
	 
2532
             getParser().setSym1(result);
2533
	                  break;
2534
            }
2535
	
1945
			//
2536
			//
1946
			// Rule 263:  invOrDefCS ::= inv simpleNameCSopt : oclExpressionCS
2537
			// Rule 263:  invOrDefCS ::= inv simpleNameCSopt : oclExpressionCS
1947
			//
2538
			//
1948
			case 263: {
2539
			case 263: {
1949
				
2540
				
1950
				CSTNode result = createInvCS(
2541
				CSTNode result = createInvCS(
1951
						(SimpleNameCS)dtParser.getSym(2),
2542
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1952
						(OCLExpressionCS)dtParser.getSym(4)
2543
          getParser().getSym(2),
1953
					);
2544
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1954
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(4));
2545
          getParser().getSym(4)
1955
				dtParser.setSym1(result);
2546
					);
1956
	  		  break;
2547
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1957
			}
2548
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1958
	 
2549
          getParser().getSym(4));
2550
				 // macro setResult is deprecated. Use function setResult
2551
             getParser().setSym1(result);
2552
	                  break;
2553
            }
2554
	
1959
			//
2555
			//
1960
			// Rule 264:  invOrDefCS ::= def simpleNameCSopt : defExpressionCS
2556
			// Rule 264:  invOrDefCS ::= def simpleNameCSopt : defExpressionCS
1961
			//
2557
			//
1962
			case 264: {
2558
			case 264: {
1963
				
2559
				
1964
				CSTNode result = createDefCS(
2560
				CSTNode result = createDefCS(
1965
						(SimpleNameCS)dtParser.getSym(2),
2561
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
1966
						(DefExpressionCS)dtParser.getSym(4)
2562
          getParser().getSym(2),
1967
					);
2563
						(DefExpressionCS) // macro getSym is deprecated. Use function getRhsSym
1968
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(4));
2564
          getParser().getSym(4)
1969
				dtParser.setSym1(result);
2565
					);
1970
	  		  break;
2566
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
1971
			}
2567
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
1972
	 
2568
          getParser().getSym(4));
2569
				 // macro setResult is deprecated. Use function setResult
2570
             getParser().setSym1(result);
2571
	                  break;
2572
            }
2573
	
1973
			//
2574
			//
1974
			// Rule 265:  defExpressionCS ::= typedVariableCS = oclExpressionCS
2575
			// Rule 265:  defExpressionCS ::= typedVariableCS = oclExpressionCS
1975
			//
2576
			//
1976
			case 265: {
2577
			case 265: {
1977
				
2578
				
1978
				VariableCS variableCS = (VariableCS)dtParser.getSym(1);
2579
				VariableCS variableCS = (VariableCS) // macro getSym is deprecated. Use function getRhsSym
1979
				OCLExpressionCS expressionCS = (OCLExpressionCS)dtParser.getSym(3);
2580
          getParser().getSym(1);
2581
				OCLExpressionCS expressionCS = (OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
2582
          getParser().getSym(3);
1980
				CSTNode result = createDefExpressionCS(
2583
				CSTNode result = createDefExpressionCS(
1981
						variableCS,
2584
						variableCS,
1982
						null,
2585
						null,
1983
						expressionCS
2586
						expressionCS
1984
					);
2587
					);
1985
				setOffsets(result, variableCS, expressionCS);
2588
				setOffsets(result, variableCS, expressionCS);
1986
				dtParser.setSym1(result);
2589
				 // macro setResult is deprecated. Use function setResult
1987
	  		  break;
2590
             getParser().setSym1(result);
1988
			}
2591
	                  break;
1989
	 
2592
            }
2593
	
1990
			//
2594
			//
1991
			// Rule 266:  defExpressionCS ::= operationCS1 = oclExpressionCS
2595
			// Rule 266:  defExpressionCS ::= operationCS1 = oclExpressionCS
1992
			//
2596
			//
Lines 1994-2044 Link Here
1994
				
2598
				
1995
				CSTNode result = createDefExpressionCS(
2599
				CSTNode result = createDefExpressionCS(
1996
						null,
2600
						null,
1997
						(OperationCS)dtParser.getSym(1),
2601
						(OperationCS) // macro getSym is deprecated. Use function getRhsSym
1998
						(OCLExpressionCS)dtParser.getSym(3)
2602
          getParser().getSym(1),
1999
					);
2603
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
2000
				setOffsets(result, (CSTNode)dtParser.getSym(1), (CSTNode)dtParser.getSym(3));
2604
          getParser().getSym(3)
2001
				dtParser.setSym1(result);
2605
					);
2002
	  		  break;
2606
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2003
			}
2607
          getParser().getSym(1), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2004
	 
2608
          getParser().getSym(3));
2609
				 // macro setResult is deprecated. Use function setResult
2610
             getParser().setSym1(result);
2611
	                  break;
2612
            }
2613
	
2005
			//
2614
			//
2006
			// Rule 267:  operationContextDeclCS ::= context operationCS2 prePostOrBodyDeclCSm
2615
			// Rule 267:  operationContextDeclCS ::= context operationCS2 prePostOrBodyDeclCSm
2007
			//
2616
			//
2008
			case 267: {
2617
			case 267: {
2009
				
2618
				
2010
				EList prePostOrBodyDecls = (EList)dtParser.getSym(3);
2619
				EList prePostOrBodyDecls = (EList) // macro getSym is deprecated. Use function getRhsSym
2620
          getParser().getSym(3);
2011
				CSTNode result = createOperationContextDeclCS(
2621
				CSTNode result = createOperationContextDeclCS(
2012
						(OperationCS)dtParser.getSym(2),
2622
						(OperationCS) // macro getSym is deprecated. Use function getRhsSym
2623
          getParser().getSym(2),
2013
						prePostOrBodyDecls
2624
						prePostOrBodyDecls
2014
					);
2625
					);
2015
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)prePostOrBodyDecls.get(prePostOrBodyDecls.size()-1));
2626
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2016
				dtParser.setSym1(result);
2627
            getParser().getToken(1)), (CSTNode)prePostOrBodyDecls.get(prePostOrBodyDecls.size()-1));
2017
	  		  break;
2628
				 // macro setResult is deprecated. Use function setResult
2018
			}
2629
             getParser().setSym1(result);
2019
	 
2630
	                  break;
2631
            }
2632
	
2020
			//
2633
			//
2021
			// Rule 268:  prePostOrBodyDeclCSm ::= prePostOrBodyDeclCS
2634
			// Rule 268:  prePostOrBodyDeclCSm ::= prePostOrBodyDeclCS
2022
			//
2635
			//
2023
			case 268: {
2636
			case 268: {
2024
				
2637
				
2025
				EList result = new BasicEList();
2638
				EList result = new BasicEList();
2026
				result.add(dtParser.getSym(1));
2639
				result.add( // macro getSym is deprecated. Use function getRhsSym
2027
				dtParser.setSym1(result);
2640
          getParser().getSym(1));
2028
	  		  break;
2641
				 // macro setResult is deprecated. Use function setResult
2029
			}
2642
             getParser().setSym1(result);
2030
	 
2643
	                  break;
2644
            }
2645
	
2031
			//
2646
			//
2032
			// Rule 269:  prePostOrBodyDeclCSm ::= prePostOrBodyDeclCSm prePostOrBodyDeclCS
2647
			// Rule 269:  prePostOrBodyDeclCSm ::= prePostOrBodyDeclCSm prePostOrBodyDeclCS
2033
			//
2648
			//
2034
			case 269: {
2649
			case 269: {
2035
				
2650
				
2036
				EList result = (EList)dtParser.getSym(1);
2651
				EList result = (EList) // macro getSym is deprecated. Use function getRhsSym
2037
				result.add(dtParser.getSym(2));
2652
          getParser().getSym(1);
2038
				dtParser.setSym1(result);
2653
				result.add( // macro getSym is deprecated. Use function getRhsSym
2039
	  		  break;
2654
          getParser().getSym(2));
2040
			}
2655
				 // macro setResult is deprecated. Use function setResult
2041
	 
2656
             getParser().setSym1(result);
2657
	                  break;
2658
            }
2659
	
2042
			//
2660
			//
2043
			// Rule 270:  prePostOrBodyDeclCS ::= pre simpleNameCSopt : oclExpressionCS
2661
			// Rule 270:  prePostOrBodyDeclCS ::= pre simpleNameCSopt : oclExpressionCS
2044
			//
2662
			//
Lines 2046-2059 Link Here
2046
				
2664
				
2047
				CSTNode result = createPrePostOrBodyDeclCS(
2665
				CSTNode result = createPrePostOrBodyDeclCS(
2048
						PrePostOrBodyEnum.PRE_LITERAL,
2666
						PrePostOrBodyEnum.PRE_LITERAL,
2049
						(SimpleNameCS)dtParser.getSym(2),
2667
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2050
						(OCLExpressionCS)dtParser.getSym(4)
2668
          getParser().getSym(2),
2051
					);
2669
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
2052
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(4));
2670
          getParser().getSym(4)
2053
				dtParser.setSym1(result);
2671
					);
2054
	  		  break;
2672
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2055
			}
2673
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2056
	 
2674
          getParser().getSym(4));
2675
				 // macro setResult is deprecated. Use function setResult
2676
             getParser().setSym1(result);
2677
	                  break;
2678
            }
2679
	
2057
			//
2680
			//
2058
			// Rule 271:  prePostOrBodyDeclCS ::= post simpleNameCSopt : oclExpressionCS
2681
			// Rule 271:  prePostOrBodyDeclCS ::= post simpleNameCSopt : oclExpressionCS
2059
			//
2682
			//
Lines 2061-2074 Link Here
2061
				
2684
				
2062
				CSTNode result = createPrePostOrBodyDeclCS(
2685
				CSTNode result = createPrePostOrBodyDeclCS(
2063
						PrePostOrBodyEnum.POST_LITERAL,
2686
						PrePostOrBodyEnum.POST_LITERAL,
2064
						(SimpleNameCS)dtParser.getSym(2),
2687
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2065
						(OCLExpressionCS)dtParser.getSym(4)
2688
          getParser().getSym(2),
2066
					);
2689
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
2067
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(4));
2690
          getParser().getSym(4)
2068
				dtParser.setSym1(result);
2691
					);
2069
	  		  break;
2692
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2070
			}
2693
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2071
	 
2694
          getParser().getSym(4));
2695
				 // macro setResult is deprecated. Use function setResult
2696
             getParser().setSym1(result);
2697
	                  break;
2698
            }
2699
	
2072
			//
2700
			//
2073
			// Rule 272:  prePostOrBodyDeclCS ::= body simpleNameCSopt : oclExpressionCS
2701
			// Rule 272:  prePostOrBodyDeclCS ::= body simpleNameCSopt : oclExpressionCS
2074
			//
2702
			//
Lines 2076-2521 Link Here
2076
				
2704
				
2077
				CSTNode result = createPrePostOrBodyDeclCS(
2705
				CSTNode result = createPrePostOrBodyDeclCS(
2078
						PrePostOrBodyEnum.BODY_LITERAL,
2706
						PrePostOrBodyEnum.BODY_LITERAL,
2079
						(SimpleNameCS)dtParser.getSym(2),
2707
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2080
						(OCLExpressionCS)dtParser.getSym(4)
2708
          getParser().getSym(2),
2081
					);
2709
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
2082
				setOffsets(result, getIToken(dtParser.getToken(1)), (CSTNode)dtParser.getSym(4));
2710
          getParser().getSym(4)
2083
				dtParser.setSym1(result);
2711
					);
2084
	  		  break;
2712
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2085
			}
2713
            getParser().getToken(1)), (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2086
	 
2714
          getParser().getSym(4));
2715
				 // macro setResult is deprecated. Use function setResult
2716
             getParser().setSym1(result);
2717
	                  break;
2718
            }
2719
	
2087
			//
2720
			//
2088
			// Rule 273:  ERROR_Colon ::= ERROR_TOKEN
2721
			// Rule 273:  ERROR_Colon ::= ERROR_TOKEN
2089
			//
2722
			//
2090
			case 273: {
2723
			case 273: {
2091
				
2724
				
2092
				reportErrorTokenMessage(dtParser.getToken(1), OCLParserErrors.MISSING_COLON);
2725
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
2093
	  		  break;
2726
            getParser().getToken(1), OCLParserErrors.MISSING_COLON);
2094
			}
2727
	                  break;
2095
	 
2728
            }
2729
	
2096
			//
2730
			//
2097
			// Rule 274:  ERROR_Empty ::= ERROR_TOKEN
2731
			// Rule 274:  ERROR_Empty ::= ERROR_TOKEN
2098
			//
2732
			//
2099
			case 274: {
2733
			case 274: {
2100
				
2734
				
2101
				reportErrorTokenMessage(dtParser.getToken(1), OCLParserErrors.EXTRA_TOKENS);
2735
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
2102
	  		  break;
2736
            getParser().getToken(1), OCLParserErrors.EXTRA_TOKENS);
2103
			}
2737
	                  break;
2104
	 
2738
            }
2739
	
2105
			//
2740
			//
2106
			// Rule 275:  ERROR_IsMarkedPreCS ::= ERROR_TOKEN
2741
			// Rule 275:  ERROR_IsMarkedPreCS ::= ERROR_TOKEN
2107
			//
2742
			//
2108
			case 275: {
2743
			case 275: {
2109
				
2744
				
2110
				reportErrorTokenMessage(dtParser.getToken(1), OCLParserErrors.MISSING_AT_PRE);
2745
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
2746
            getParser().getToken(1), OCLParserErrors.MISSING_AT_PRE);
2111
				IsMarkedPreCS result = createIsMarkedPreCS(false);
2747
				IsMarkedPreCS result = createIsMarkedPreCS(false);
2112
				setOffsets(result, getIToken(dtParser.getToken(1)));
2748
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2113
				dtParser.setSym1(result);
2749
            getParser().getToken(1)));
2114
	  		  break;
2750
				 // macro setResult is deprecated. Use function setResult
2115
			}
2751
             getParser().setSym1(result);
2116
	 
2752
	                  break;
2753
            }
2754
	
2117
			//
2755
			//
2118
			// Rule 276:  ERROR_PathNameCS ::= ERROR_TOKEN
2756
			// Rule 276:  ERROR_PathNameCS ::= ERROR_TOKEN
2119
			//
2757
			//
2120
			case 276: {
2758
			case 276: {
2121
				
2759
				
2122
				reportErrorTokenMessage(dtParser.getToken(1), OCLParserErrors.MISSING_PATH_NAME);
2760
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
2123
				CSTNode result = createPathNameCS(getTokenText(dtParser.getToken(1)));
2761
            getParser().getToken(1), OCLParserErrors.MISSING_PATH_NAME);
2124
				setOffsets(result, getIToken(dtParser.getToken(1)));
2762
				CSTNode result = createPathNameCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
2125
				dtParser.setSym1(result);
2763
            getParser().getToken(1)));
2126
	  		  break;
2764
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2127
			}
2765
            getParser().getToken(1)));
2128
	 
2766
				 // macro setResult is deprecated. Use function setResult
2767
             getParser().setSym1(result);
2768
	                  break;
2769
            }
2770
	
2129
			//
2771
			//
2130
			// Rule 277:  ERROR_SimpleNameCS ::= ERROR_TOKEN
2772
			// Rule 277:  ERROR_SimpleNameCS ::= ERROR_TOKEN
2131
			//
2773
			//
2132
			case 277: {
2774
			case 277: {
2133
				
2775
				
2134
				reportErrorTokenMessage(dtParser.getToken(1), OCLParserErrors.MISSING_SIMPLE_NAME);
2776
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
2777
            getParser().getToken(1), OCLParserErrors.MISSING_SIMPLE_NAME);
2135
				SimpleNameCS result = createSimpleNameCS(
2778
				SimpleNameCS result = createSimpleNameCS(
2136
						SimpleTypeEnum.IDENTIFIER_LITERAL,
2779
						SimpleTypeEnum.IDENTIFIER_LITERAL,
2137
						getTokenText(dtParser.getToken(1))
2780
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
2781
            getParser().getToken(1))
2138
					);
2782
					);
2139
				setOffsets(result, getIToken(dtParser.getToken(1)));
2783
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2140
				dtParser.setSym1(result);
2784
            getParser().getToken(1)));
2141
	  		  break;
2785
				 // macro setResult is deprecated. Use function setResult
2142
			}
2786
             getParser().setSym1(result);
2143
	 
2787
	                  break;
2788
            }
2789
	
2144
			//
2790
			//
2145
			// Rule 278:  attrOrNavCallExpCS ::= simpleNameCS [ argumentsCS ERROR_TOKEN
2791
			// Rule 278:  attrOrNavCallExpCS ::= simpleNameCS [ argumentsCS ERROR_TOKEN
2146
			//
2792
			//
2147
			case 278: {
2793
			case 278: {
2148
				
2794
				
2149
				reportErrorTokenMessage(dtParser.getToken(4), OCLParserErrors.MISSING_RBRACK);
2795
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
2796
            getParser().getToken(4), OCLParserErrors.MISSING_RBRACK);
2150
				CSTNode result = createFeatureCallExpCS(
2797
				CSTNode result = createFeatureCallExpCS(
2151
						(SimpleNameCS)dtParser.getSym(1),
2798
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2152
						(EList)dtParser.getSym(3),
2799
          getParser().getSym(1),
2800
						(EList) // macro getSym is deprecated. Use function getRhsSym
2801
          getParser().getSym(3),
2153
						createIsMarkedPreCS(false)
2802
						createIsMarkedPreCS(false)
2154
					);
2803
					);
2155
				setOffsets(result, (CSTNode)dtParser.getSym(1), getIToken(dtParser.getToken(4)));
2804
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2156
				dtParser.setSym1(result);
2805
          getParser().getSym(1), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2157
	  		  break;
2806
            getParser().getToken(4)));
2158
			}
2807
				 // macro setResult is deprecated. Use function setResult
2159
	 
2808
             getParser().setSym1(result);
2809
	                  break;
2810
            }
2811
	
2160
			//
2812
			//
2161
			// Rule 279:  collectionTypeCS ::= collectionTypeIdentifierCS ( typeCS ERROR_TOKEN
2813
			// Rule 279:  collectionTypeCS ::= collectionTypeIdentifierCS ( typeCS ERROR_TOKEN
2162
			//
2814
			//
2163
			case 279: {
2815
			case 279: {
2164
				
2816
				
2165
				reportErrorTokenMessage(dtParser.getToken(4), OCLParserErrors.MISSING_RPAREN);
2817
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
2166
				Object[] objs = (Object[])dtParser.getSym(1);
2818
            getParser().getToken(4), OCLParserErrors.MISSING_RPAREN);
2819
				Object[] objs = (Object[]) // macro getSym is deprecated. Use function getRhsSym
2820
          getParser().getSym(1);
2167
				CSTNode result = createCollectionTypeCS(
2821
				CSTNode result = createCollectionTypeCS(
2168
						(CollectionTypeIdentifierEnum)objs[1],
2822
						(CollectionTypeIdentifierEnum)objs[1],
2169
						(TypeCS)dtParser.getSym(3)
2823
						(TypeCS) // macro getSym is deprecated. Use function getRhsSym
2824
          getParser().getSym(3)
2170
					);
2825
					);
2171
				setOffsets(result, (IToken)objs[0], getIToken(dtParser.getToken(4)));
2826
				setOffsets(result, (IToken)objs[0], getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2172
				dtParser.setSym1(result);
2827
            getParser().getToken(4)));
2173
	  		  break;
2828
				 // macro setResult is deprecated. Use function setResult
2174
			}
2829
             getParser().setSym1(result);
2175
	 
2830
	                  break;
2831
            }
2832
	
2176
			//
2833
			//
2177
			// Rule 280:  collectionTypeCS ::= collectionTypeIdentifierCS ERROR_TOKEN
2834
			// Rule 280:  collectionTypeCS ::= collectionTypeIdentifierCS ERROR_TOKEN
2178
			//
2835
			//
2179
			case 280: {
2836
			case 280: {
2180
				
2837
				
2181
				reportErrorTokenMessage(dtParser.getToken(2), OCLParserErrors.MISSING_LPAREN);
2838
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
2182
				Object[] objs = (Object[])dtParser.getSym(1);
2839
            getParser().getToken(2), OCLParserErrors.MISSING_LPAREN);
2840
				Object[] objs = (Object[]) // macro getSym is deprecated. Use function getRhsSym
2841
          getParser().getSym(1);
2183
				CSTNode result = createCollectionTypeCS(
2842
				CSTNode result = createCollectionTypeCS(
2184
						(CollectionTypeIdentifierEnum)objs[1],
2843
						(CollectionTypeIdentifierEnum)objs[1],
2185
						null
2844
						null
2186
					);
2845
					);
2187
				setOffsets(result, (IToken)objs[0], getIToken(dtParser.getToken(2)));
2846
				setOffsets(result, (IToken)objs[0], getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2188
				dtParser.setSym1(result);
2847
            getParser().getToken(2)));
2189
	  		  break;
2848
				 // macro setResult is deprecated. Use function setResult
2190
			}
2849
             getParser().setSym1(result);
2191
	 
2850
	                  break;
2851
            }
2852
	
2192
			//
2853
			//
2193
			// Rule 281:  dotArrowExpCS ::= pathNameCS :: ERROR_SimpleNameCS ( argumentsCSopt )
2854
			// Rule 281:  dotArrowExpCS ::= pathNameCS :: ERROR_SimpleNameCS ( argumentsCSopt )
2194
			//
2855
			//
2195
			case 281: {
2856
			case 281: {
2196
				
2857
				
2197
				OperationCallExpCS result = createOperationCallExpCS(
2858
				OperationCallExpCS result = createOperationCallExpCS(
2198
						(PathNameCS)dtParser.getSym(1),
2859
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
2199
						(SimpleNameCS)dtParser.getSym(3),
2860
          getParser().getSym(1),
2200
						(EList)dtParser.getSym(5)
2861
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2201
					);
2862
          getParser().getSym(3),
2202
				setOffsets(result, (CSTNode)dtParser.getSym(1), getIToken(dtParser.getToken(6)));
2863
						(EList) // macro getSym is deprecated. Use function getRhsSym
2864
          getParser().getSym(5)
2865
					);
2866
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2867
          getParser().getSym(1), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2868
            getParser().getToken(6)));
2203
				result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
2869
				result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
2204
				dtParser.setSym1(result);
2870
				 // macro setResult is deprecated. Use function setResult
2205
	  		  break;
2871
             getParser().setSym1(result);
2206
			}
2872
	                  break;
2207
	 
2873
            }
2874
	
2208
			//
2875
			//
2209
			// Rule 282:  enumLiteralExpCS ::= pathNameCS :: ERROR_SimpleNameCS
2876
			// Rule 282:  enumLiteralExpCS ::= pathNameCS :: ERROR_SimpleNameCS
2210
			//
2877
			//
2211
			case 282: {
2878
			case 282: {
2212
				
2879
				
2213
				PathNameCS pathNameCS = (PathNameCS)dtParser.getSym(1);
2880
				PathNameCS pathNameCS = (PathNameCS) // macro getSym is deprecated. Use function getRhsSym
2214
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(3);
2881
          getParser().getSym(1);
2882
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2883
          getParser().getSym(3);
2215
				CSTNode result = createEnumLiteralExpCS(
2884
				CSTNode result = createEnumLiteralExpCS(
2216
						pathNameCS,
2885
						pathNameCS,
2217
						simpleNameCS
2886
						simpleNameCS
2218
					);
2887
					);
2219
				setOffsets(result, pathNameCS, simpleNameCS);
2888
				setOffsets(result, pathNameCS, simpleNameCS);
2220
				dtParser.setSym1(result);
2889
				 // macro setResult is deprecated. Use function setResult
2221
	  		  break;
2890
             getParser().setSym1(result);
2222
			}
2891
	                  break;
2892
            }
2223
	 
2893
	 
2224
			//
2894
			//
2225
			// Rule 283:  featureCallExpCS ::= unaryName ERROR_IsMarkedPreCS ( argumentsCSopt )
2895
			// Rule 283:  featureCallExpCS ::= unaryName ERROR_IsMarkedPreCS ( argumentsCSopt )
2226
			//
2896
			//
2897
			
2227
			case 283:
2898
			case 283:
2228
 
2899
 
2229
			//
2900
			//
2230
			// Rule 284:  keywordOperationCallExpCS ::= keywordAsName ERROR_IsMarkedPreCS ( argumentsCSopt )
2901
			// Rule 284:  keywordOperationCallExpCS ::= keywordAsName ERROR_IsMarkedPreCS ( argumentsCSopt )
2231
			//
2902
			//
2903
			
2232
			case 284:
2904
			case 284:
2233
 
2905
2234
			//
2906
			//
2235
			// Rule 285:  operationCallExpCS ::= binaryName ERROR_IsMarkedPreCS ( argumentsCSopt )
2907
			// Rule 285:  operationCallExpCS ::= binaryName ERROR_IsMarkedPreCS ( argumentsCSopt )
2236
			//
2908
			//
2237
			case 285: {
2909
			case 285: {
2238
				
2910
				
2239
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(1);
2911
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2912
          getParser().getSym(1);
2240
				CSTNode result = createOperationCallExpCS(
2913
				CSTNode result = createOperationCallExpCS(
2241
						simpleNameCS,
2914
						simpleNameCS,
2242
						(IsMarkedPreCS)dtParser.getSym(2),
2915
						(IsMarkedPreCS) // macro getSym is deprecated. Use function getRhsSym
2243
						(EList)dtParser.getSym(4)
2916
          getParser().getSym(2),
2244
					);
2917
						(EList) // macro getSym is deprecated. Use function getRhsSym
2245
				setOffsets(result, simpleNameCS, getIToken(dtParser.getToken(5)));
2918
          getParser().getSym(4)
2246
				dtParser.setSym1(result);
2919
					);
2247
	  		  break;
2920
				setOffsets(result, simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2248
			}
2921
            getParser().getToken(5)));
2249
	 
2922
				 // macro setResult is deprecated. Use function setResult
2923
             getParser().setSym1(result);
2924
	                  break;
2925
            }
2926
	
2250
			//
2927
			//
2251
			// Rule 286:  operationCallExpCS ::= oclIsInStateName ERROR_IsMarkedPreCS ( stateExpCS )
2928
			// Rule 286:  operationCallExpCS ::= oclIsInStateName ERROR_IsMarkedPreCS ( stateExpCS )
2252
			//
2929
			//
2253
			case 286: {
2930
			case 286: {
2254
				
2931
				
2255
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(1);
2932
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2933
          getParser().getSym(1);
2256
				CSTNode result = createOperationCallExpCS(
2934
				CSTNode result = createOperationCallExpCS(
2257
						simpleNameCS,
2935
						simpleNameCS,
2258
						(IsMarkedPreCS)dtParser.getSym(2),
2936
						(IsMarkedPreCS) // macro getSym is deprecated. Use function getRhsSym
2259
						(StateExpCS)dtParser.getSym(4)
2937
          getParser().getSym(2),
2260
					);
2938
						(StateExpCS) // macro getSym is deprecated. Use function getRhsSym
2261
				setOffsets(result, simpleNameCS, getIToken(dtParser.getToken(5)));
2939
          getParser().getSym(4)
2262
				dtParser.setSym1(result);
2940
					);
2263
	  		  break;
2941
				setOffsets(result, simpleNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2264
			}
2942
            getParser().getToken(5)));
2265
	 
2943
				 // macro setResult is deprecated. Use function setResult
2944
             getParser().setSym1(result);
2945
	                  break;
2946
            }
2947
	
2266
			//
2948
			//
2267
			// Rule 287:  ifExpCS ::= if oclExpressionCS then oclExpressionCS else oclExpressionCS ERROR_TOKEN
2949
			// Rule 287:  ifExpCS ::= if oclExpressionCS then oclExpressionCS else oclExpressionCS ERROR_TOKEN
2268
			//
2950
			//
2269
			case 287: {
2951
			case 287: {
2270
				
2952
				
2271
				reportErrorTokenMessage(dtParser.getToken(7), OCLParserErrors.MISSING_ENDIF);
2953
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
2954
            getParser().getToken(7), OCLParserErrors.MISSING_ENDIF);
2272
				CSTNode result = createIfExpCS(
2955
				CSTNode result = createIfExpCS(
2273
						(OCLExpressionCS)dtParser.getSym(2),
2956
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
2274
						(OCLExpressionCS)dtParser.getSym(4),
2957
          getParser().getSym(2),
2275
						(OCLExpressionCS)dtParser.getSym(6)
2958
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
2276
					);
2959
          getParser().getSym(4),
2277
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(7)));
2960
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
2278
				dtParser.setSym1(result);
2961
          getParser().getSym(6)
2279
	  		  break;
2962
					);
2280
			}
2963
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2281
	 
2964
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2965
            getParser().getToken(7)));
2966
				 // macro setResult is deprecated. Use function setResult
2967
             getParser().setSym1(result);
2968
	                  break;
2969
            }
2970
	
2282
			//
2971
			//
2283
			// Rule 288:  ifExpCS ::= if oclExpressionCS then oclExpressionCS ERROR_TOKEN
2972
			// Rule 288:  ifExpCS ::= if oclExpressionCS then oclExpressionCS ERROR_TOKEN
2284
			//
2973
			//
2285
			case 288: {
2974
			case 288: {
2286
				
2975
				
2287
				reportErrorTokenMessage(dtParser.getToken(5), OCLParserErrors.MISSING_ELSE_ENDIF);
2976
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
2977
            getParser().getToken(5), OCLParserErrors.MISSING_ELSE_ENDIF);
2288
				CSTNode result = createIfExpCS(
2978
				CSTNode result = createIfExpCS(
2289
						(OCLExpressionCS)dtParser.getSym(2),
2979
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
2290
						(OCLExpressionCS)dtParser.getSym(4),
2980
          getParser().getSym(2),
2291
						createInvalidLiteralExpCS(getTokenText(dtParser.getToken(5)))
2981
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
2292
					);
2982
          getParser().getSym(4),
2293
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(5)));
2983
						createInvalidLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
2294
				dtParser.setSym1(result);
2984
            getParser().getToken(5)))
2295
	  		  break;
2985
					);
2296
			}
2986
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2297
	 
2987
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2988
            getParser().getToken(5)));
2989
				 // macro setResult is deprecated. Use function setResult
2990
             getParser().setSym1(result);
2991
	                  break;
2992
            }
2993
	
2298
			//
2994
			//
2299
			// Rule 289:  ifExpCS ::= if oclExpressionCS ERROR_TOKEN
2995
			// Rule 289:  ifExpCS ::= if oclExpressionCS ERROR_TOKEN
2300
			//
2996
			//
2301
			case 289: {
2997
			case 289: {
2302
				
2998
				
2303
				reportErrorTokenMessage(dtParser.getToken(3), OCLParserErrors.MISSING_THEN_ELSE_ENDIF);
2999
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
3000
            getParser().getToken(3), OCLParserErrors.MISSING_THEN_ELSE_ENDIF);
2304
				CSTNode result = createIfExpCS(
3001
				CSTNode result = createIfExpCS(
2305
						(OCLExpressionCS)dtParser.getSym(2),
3002
						(OCLExpressionCS) // macro getSym is deprecated. Use function getRhsSym
2306
						createInvalidLiteralExpCS(getTokenText(dtParser.getToken(3))),
3003
          getParser().getSym(2),
2307
						createInvalidLiteralExpCS(getTokenText(dtParser.getToken(3)))
3004
						createInvalidLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
2308
					);
3005
            getParser().getToken(3))),
2309
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
3006
						createInvalidLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
2310
				dtParser.setSym1(result);
3007
            getParser().getToken(3)))
2311
	  		  break;
3008
					);
2312
			}
3009
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2313
	 
3010
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
3011
            getParser().getToken(3)));
3012
				 // macro setResult is deprecated. Use function setResult
3013
             getParser().setSym1(result);
3014
	                  break;
3015
            }
3016
	
2314
			//
3017
			//
2315
			// Rule 290:  ifExpCS ::= if ERROR_TOKEN endif
3018
			// Rule 290:  ifExpCS ::= if ERROR_TOKEN endif
2316
			//
3019
			//
2317
			case 290: {
3020
			case 290: {
2318
				
3021
				
2319
				reportErrorTokenMessage(dtParser.getToken(3), OCLParserErrors.MISSING_THEN_ELSE);
3022
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
3023
            getParser().getToken(3), OCLParserErrors.MISSING_THEN_ELSE);
2320
				CSTNode result = createIfExpCS(
3024
				CSTNode result = createIfExpCS(
2321
						createInvalidLiteralExpCS(getTokenText(dtParser.getToken(2))),
3025
						createInvalidLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
2322
						createInvalidLiteralExpCS(getTokenText(dtParser.getToken(2))),
3026
            getParser().getToken(2))),
2323
						createInvalidLiteralExpCS(getTokenText(dtParser.getToken(2)))
3027
						createInvalidLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
2324
					);
3028
            getParser().getToken(2))),
2325
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
3029
						createInvalidLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
2326
				dtParser.setSym1(result);
3030
            getParser().getToken(2)))
2327
	  		  break;
3031
					);
2328
			}
3032
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
3033
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
3034
            getParser().getToken(3)));
3035
				 // macro setResult is deprecated. Use function setResult
3036
             getParser().setSym1(result);
3037
	                  break;
3038
            }
2329
	 
3039
	 
2330
			//
3040
			//
2331
			// Rule 291:  messageExpCS ::= ^ simpleNameCS ERROR_TOKEN
3041
			// Rule 291:  messageExpCS ::= ^ simpleNameCS ERROR_TOKEN
2332
			//
3042
			//
3043
			
2333
			case 291:
3044
			case 291:
2334
 
3045
2335
			//
3046
			//
2336
			// Rule 292:  messageExpCS ::= ^^ simpleNameCS ERROR_TOKEN
3047
			// Rule 292:  messageExpCS ::= ^^ simpleNameCS ERROR_TOKEN
2337
			//
3048
			//
2338
			case 292: {
3049
			case 292: {
2339
				
3050
				
2340
				reportErrorTokenMessage(dtParser.getToken(1), OCLParserErrors.MISSING_MESSAGE_ARGUMENTS);
3051
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
3052
            getParser().getToken(1), OCLParserErrors.MISSING_MESSAGE_ARGUMENTS);
2341
				CSTNode result = createMessageExpCS(
3053
				CSTNode result = createMessageExpCS(
2342
						getIToken(dtParser.getToken(1)).getKind() == OCLBacktrackingParsersym.TK_CARET,
3054
						getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2343
						(SimpleNameCS)dtParser.getSym(2),
3055
            getParser().getToken(1)).getKind() == OCLBacktrackingParsersym.TK_CARET,
3056
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
3057
          getParser().getSym(2),
2344
						new BasicEList<OCLMessageArgCS>()
3058
						new BasicEList<OCLMessageArgCS>()
2345
					);
3059
					);
2346
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
3060
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2347
				dtParser.setSym1(result);
3061
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2348
	  		  break;
3062
            getParser().getToken(3)));
2349
			}
3063
				 // macro setResult is deprecated. Use function setResult
3064
             getParser().setSym1(result);
3065
	                  break;
3066
            }
2350
	 
3067
	 
2351
			//
3068
			//
2352
			// Rule 293:  messageExpCS ::= ^ ERROR_SimpleNameCS
3069
			// Rule 293:  messageExpCS ::= ^ ERROR_SimpleNameCS
2353
			//
3070
			//
3071
			
2354
			case 293:
3072
			case 293:
2355
 
3073
2356
			//
3074
			//
2357
			// Rule 294:  messageExpCS ::= ^^ ERROR_SimpleNameCS
3075
			// Rule 294:  messageExpCS ::= ^^ ERROR_SimpleNameCS
2358
			//
3076
			//
2359
			case 294: {
3077
			case 294: {
2360
				
3078
				
2361
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(2);
3079
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
3080
          getParser().getSym(2);
2362
				CSTNode result = createMessageExpCS(
3081
				CSTNode result = createMessageExpCS(
2363
						getIToken(dtParser.getToken(1)).getKind() == OCLBacktrackingParsersym.TK_CARET,
3082
						getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
3083
            getParser().getToken(1)).getKind() == OCLBacktrackingParsersym.TK_CARET,
2364
						simpleNameCS,
3084
						simpleNameCS,
2365
						new BasicEList<OCLMessageArgCS>()
3085
						new BasicEList<OCLMessageArgCS>()
2366
					);
3086
					);
2367
				setOffsets(result, getIToken(dtParser.getToken(1)), simpleNameCS);
3087
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2368
				dtParser.setSym1(result);
3088
            getParser().getToken(1)), simpleNameCS);
2369
	  		  break;
3089
				 // macro setResult is deprecated. Use function setResult
2370
			}
3090
             getParser().setSym1(result);
2371
	 
3091
	                  break;
3092
            }
3093
	
2372
			//
3094
			//
2373
			// Rule 295:  oclExpCS ::= ERROR_TOKEN
3095
			// Rule 295:  oclExpCS ::= ERROR_TOKEN
2374
			//
3096
			//
2375
			case 295: {
3097
			case 295: {
2376
				
3098
				
2377
				reportErrorTokenMessage(dtParser.getToken(1), OCLParserErrors.MISSING_EXPR);
3099
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
2378
				CSTNode result = createInvalidLiteralExpCS(getTokenText(dtParser.getToken(1)));
3100
            getParser().getToken(1), OCLParserErrors.MISSING_EXPR);
2379
				setOffsets(result, getIToken(dtParser.getToken(1)));
3101
				CSTNode result = createInvalidLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
2380
				dtParser.setSym1(result);
3102
            getParser().getToken(1)));
2381
	  		  break;
3103
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2382
			}
3104
            getParser().getToken(1)));
2383
	 
3105
				 // macro setResult is deprecated. Use function setResult
3106
             getParser().setSym1(result);
3107
	                  break;
3108
            }
3109
	
2384
			//
3110
			//
2385
			// Rule 296:  oclExpCS ::= ( oclExpressionCS ERROR_TOKEN
3111
			// Rule 296:  oclExpCS ::= ( oclExpressionCS ERROR_TOKEN
2386
			//
3112
			//
2387
			case 296: {
3113
			case 296: {
2388
				
3114
				
2389
				reportErrorTokenMessage(dtParser.getToken(3), OCLParserErrors.MISSING_RPAREN);
3115
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
2390
				CSTNode result = (CSTNode)dtParser.getSym(2);
3116
            getParser().getToken(3), OCLParserErrors.MISSING_RPAREN);
2391
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
3117
				CSTNode result = (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2392
				dtParser.setSym1(result);
3118
          getParser().getSym(2);
2393
	  		  break;
3119
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2394
			}
3120
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2395
	 
3121
            getParser().getToken(3)));
3122
				 // macro setResult is deprecated. Use function setResult
3123
             getParser().setSym1(result);
3124
	                  break;
3125
            }
3126
	
2396
			//
3127
			//
2397
			// Rule 297:  operationCS1 ::= IDENTIFIER ( parametersCSopt ) ERROR_Colon
3128
			// Rule 297:  operationCS1 ::= IDENTIFIER ( parametersCSopt ) ERROR_Colon
2398
			//
3129
			//
2399
			case 297: {
3130
			case 297: {
2400
				
3131
				
2401
				CSTNode result = createOperationCS(
3132
				CSTNode result = createOperationCS(
2402
						getTokenText(dtParser.getToken(1)),
3133
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
2403
						(EList)dtParser.getSym(3),
3134
            getParser().getToken(1)),
3135
						(EList) // macro getSym is deprecated. Use function getRhsSym
3136
          getParser().getSym(3),
2404
						null
3137
						null
2405
					);
3138
					);
2406
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(5)));
3139
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2407
				dtParser.setSym1(result);
3140
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2408
	  		  break;
3141
            getParser().getToken(5)));
2409
			}
3142
				 // macro setResult is deprecated. Use function setResult
2410
	 
3143
             getParser().setSym1(result);
3144
	                  break;
3145
            }
3146
	
2411
			//
3147
			//
2412
			// Rule 298:  operationCS1 ::= IDENTIFIER ( parametersCSopt ERROR_TOKEN
3148
			// Rule 298:  operationCS1 ::= IDENTIFIER ( parametersCSopt ERROR_TOKEN
2413
			//
3149
			//
2414
			case 298: {
3150
			case 298: {
2415
				
3151
				
2416
				reportErrorTokenMessage(dtParser.getToken(4), OCLParserErrors.MISSING_RPAREN);
3152
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
3153
            getParser().getToken(4), OCLParserErrors.MISSING_RPAREN);
2417
				CSTNode result = createOperationCS(
3154
				CSTNode result = createOperationCS(
2418
						getTokenText(dtParser.getToken(1)),
3155
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
2419
						(EList)dtParser.getSym(3),
3156
            getParser().getToken(1)),
3157
						(EList) // macro getSym is deprecated. Use function getRhsSym
3158
          getParser().getSym(3),
2420
						null
3159
						null
2421
					);
3160
					);
2422
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
3161
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2423
				dtParser.setSym1(result);
3162
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2424
	  		  break;
3163
            getParser().getToken(4)));
2425
			}
3164
				 // macro setResult is deprecated. Use function setResult
2426
	 
3165
             getParser().setSym1(result);
3166
	                  break;
3167
            }
3168
	
2427
			//
3169
			//
2428
			// Rule 299:  operationCS1 ::= IDENTIFIER ERROR_TOKEN
3170
			// Rule 299:  operationCS1 ::= IDENTIFIER ERROR_TOKEN
2429
			//
3171
			//
2430
			case 299: {
3172
			case 299: {
2431
				
3173
				
2432
				reportErrorTokenMessage(dtParser.getToken(2), OCLParserErrors.MISSING_LPAREN);
3174
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
3175
            getParser().getToken(2), OCLParserErrors.MISSING_LPAREN);
2433
				CSTNode result = createOperationCS(
3176
				CSTNode result = createOperationCS(
2434
						getTokenText(dtParser.getToken(1)),
3177
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
3178
            getParser().getToken(1)),
2435
						new BasicEList(),
3179
						new BasicEList(),
2436
						null
3180
						null
2437
					);
3181
					);
2438
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(2)));
3182
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2439
				dtParser.setSym1(result);
3183
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2440
	  		  break;
3184
            getParser().getToken(2)));
2441
			}
3185
				 // macro setResult is deprecated. Use function setResult
2442
	 
3186
             getParser().setSym1(result);
3187
	                  break;
3188
            }
3189
	
2443
			//
3190
			//
2444
			// Rule 300:  operationCS1 ::= ERROR_TOKEN
3191
			// Rule 300:  operationCS1 ::= ERROR_TOKEN
2445
			//
3192
			//
2446
			case 300: {
3193
			case 300: {
2447
				
3194
				
2448
				reportErrorTokenMessage(dtParser.getToken(1), OCLParserErrors.MISSING_IDENTIFIER);
3195
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
3196
            getParser().getToken(1), OCLParserErrors.MISSING_IDENTIFIER);
2449
				CSTNode result = createOperationCS(
3197
				CSTNode result = createOperationCS(
2450
						getTokenText(dtParser.getToken(1)),
3198
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
3199
            getParser().getToken(1)),
2451
						new BasicEList(),
3200
						new BasicEList(),
2452
						null
3201
						null
2453
					);
3202
					);
2454
				setOffsets(result, getIToken(dtParser.getToken(1)));
3203
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2455
				dtParser.setSym1(result);
3204
            getParser().getToken(1)));
2456
	  		  break;
3205
				 // macro setResult is deprecated. Use function setResult
2457
			}
3206
             getParser().setSym1(result);
2458
	 
3207
	                  break;
3208
            }
3209
	
2459
			//
3210
			//
2460
			// Rule 301:  operationCS2 ::= pathNameCS :: simpleNameCS ( parametersCSopt ) ERROR_Colon
3211
			// Rule 301:  operationCS2 ::= pathNameCS :: simpleNameCS ( parametersCSopt ) ERROR_Colon
2461
			//
3212
			//
2462
			case 301: {
3213
			case 301: {
2463
				
3214
				
2464
				PathNameCS pathNameCS = (PathNameCS)dtParser.getSym(1);
3215
				PathNameCS pathNameCS = (PathNameCS) // macro getSym is deprecated. Use function getRhsSym
3216
          getParser().getSym(1);
2465
				CSTNode result = createOperationCS(
3217
				CSTNode result = createOperationCS(
2466
						pathNameCS,
3218
						pathNameCS,
2467
						(SimpleNameCS)dtParser.getSym(3),
3219
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2468
						(EList)dtParser.getSym(5),
3220
          getParser().getSym(3),
2469
						(TypeCS)dtParser.getSym(8)
3221
						(EList) // macro getSym is deprecated. Use function getRhsSym
2470
					);
3222
          getParser().getSym(5),
2471
				setOffsets(result, pathNameCS, getIToken(dtParser.getToken(7)));
3223
						(TypeCS) // macro getSym is deprecated. Use function getRhsSym
2472
				dtParser.setSym1(result);
3224
          getParser().getSym(8)
2473
	  		  break;
3225
					);
2474
			}
3226
				setOffsets(result, pathNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2475
	 
3227
            getParser().getToken(7)));
3228
				 // macro setResult is deprecated. Use function setResult
3229
             getParser().setSym1(result);
3230
	                  break;
3231
            }
3232
	
2476
			//
3233
			//
2477
			// Rule 302:  operationCS2 ::= pathNameCS :: simpleNameCS ( parametersCSopt ERROR_TOKEN
3234
			// Rule 302:  operationCS2 ::= pathNameCS :: simpleNameCS ( parametersCSopt ERROR_TOKEN
2478
			//
3235
			//
2479
			case 302: {
3236
			case 302: {
2480
				
3237
				
2481
				reportErrorTokenMessage(dtParser.getToken(6), OCLParserErrors.MISSING_RPAREN);
3238
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
2482
				PathNameCS pathNameCS = (PathNameCS)dtParser.getSym(1);
3239
            getParser().getToken(6), OCLParserErrors.MISSING_RPAREN);
3240
				PathNameCS pathNameCS = (PathNameCS) // macro getSym is deprecated. Use function getRhsSym
3241
          getParser().getSym(1);
2483
				CSTNode result = createOperationCS(
3242
				CSTNode result = createOperationCS(
2484
						pathNameCS,
3243
						pathNameCS,
2485
						(SimpleNameCS)dtParser.getSym(3),
3244
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2486
						(EList)dtParser.getSym(5),
3245
          getParser().getSym(3),
3246
						(EList) // macro getSym is deprecated. Use function getRhsSym
3247
          getParser().getSym(5),
2487
						null
3248
						null
2488
					);
3249
					);
2489
				setOffsets(result, pathNameCS, getIToken(dtParser.getToken(7)));
3250
				setOffsets(result, pathNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2490
				dtParser.setSym1(result);
3251
            getParser().getToken(7)));
2491
	  		  break;
3252
				 // macro setResult is deprecated. Use function setResult
2492
			}
3253
             getParser().setSym1(result);
2493
	 
3254
	                  break;
3255
            }
3256
	
2494
			//
3257
			//
2495
			// Rule 303:  operationCS2 ::= pathNameCS :: simpleNameCS ERROR_TOKEN
3258
			// Rule 303:  operationCS2 ::= pathNameCS :: simpleNameCS ERROR_TOKEN
2496
			//
3259
			//
2497
			case 303: {
3260
			case 303: {
2498
				
3261
				
2499
				reportErrorTokenMessage(dtParser.getToken(4), OCLParserErrors.MISSING_LPAREN);
3262
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
2500
				PathNameCS pathNameCS = (PathNameCS)dtParser.getSym(1);
3263
            getParser().getToken(4), OCLParserErrors.MISSING_LPAREN);
3264
				PathNameCS pathNameCS = (PathNameCS) // macro getSym is deprecated. Use function getRhsSym
3265
          getParser().getSym(1);
2501
				CSTNode result = createOperationCS(
3266
				CSTNode result = createOperationCS(
2502
						pathNameCS,
3267
						pathNameCS,
2503
						(SimpleNameCS)dtParser.getSym(3),
3268
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
3269
          getParser().getSym(3),
2504
						new BasicEList(),
3270
						new BasicEList(),
2505
						null
3271
						null
2506
					);
3272
					);
2507
				setOffsets(result, pathNameCS, getIToken(dtParser.getToken(4)));
3273
				setOffsets(result, pathNameCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2508
				dtParser.setSym1(result);
3274
            getParser().getToken(4)));
2509
	  		  break;
3275
				 // macro setResult is deprecated. Use function setResult
2510
			}
3276
             getParser().setSym1(result);
2511
	 
3277
	                  break;
3278
            }
3279
	
2512
			//
3280
			//
2513
			// Rule 304:  operationCS2 ::= pathNameCS :: ERROR_SimpleNameCS
3281
			// Rule 304:  operationCS2 ::= pathNameCS :: ERROR_SimpleNameCS
2514
			//
3282
			//
2515
			case 304: {
3283
			case 304: {
2516
				
3284
				
2517
				PathNameCS pathNameCS = (PathNameCS)dtParser.getSym(1);
3285
				PathNameCS pathNameCS = (PathNameCS) // macro getSym is deprecated. Use function getRhsSym
2518
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(3);
3286
          getParser().getSym(1);
3287
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
3288
          getParser().getSym(3);
2519
				CSTNode result = createOperationCS(
3289
				CSTNode result = createOperationCS(
2520
						pathNameCS,
3290
						pathNameCS,
2521
						simpleNameCS,
3291
						simpleNameCS,
Lines 2523-2777 Link Here
2523
						null
3293
						null
2524
					);
3294
					);
2525
				setOffsets(result, pathNameCS, simpleNameCS);
3295
				setOffsets(result, pathNameCS, simpleNameCS);
2526
				dtParser.setSym1(result);
3296
				 // macro setResult is deprecated. Use function setResult
2527
	  		  break;
3297
             getParser().setSym1(result);
2528
			}
3298
	                  break;
2529
	 
3299
            }
3300
	
2530
			//
3301
			//
2531
			// Rule 305:  parametersCS ::= ERROR_TOKEN
3302
			// Rule 305:  parametersCS ::= ERROR_TOKEN
2532
			//
3303
			//
2533
			case 305: {
3304
			case 305: {
2534
				
3305
				
2535
				reportErrorTokenMessage(dtParser.getToken(1), OCLParserErrors.MISSING_PARAMETERS);
3306
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
3307
            getParser().getToken(1), OCLParserErrors.MISSING_PARAMETERS);
2536
				EList result = new BasicEList();
3308
				EList result = new BasicEList();
2537
				dtParser.setSym1(result);
3309
				 // macro setResult is deprecated. Use function setResult
2538
	  		  break;
3310
             getParser().setSym1(result);
2539
			}
3311
	                  break;
2540
	 
3312
            }
3313
	
2541
			//
3314
			//
2542
			// Rule 306:  parametersCS ::= parametersCS , ERROR_TOKEN
3315
			// Rule 306:  parametersCS ::= parametersCS , ERROR_TOKEN
2543
			//
3316
			//
2544
			case 306: {
3317
			case 306: {
2545
				
3318
				
2546
				reportErrorTokenMessage(dtParser.getToken(3), OCLParserErrors.MISSING_PARAMETER);
3319
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
2547
	  		  break;
3320
            getParser().getToken(3), OCLParserErrors.MISSING_PARAMETER);
2548
			}
3321
	                  break;
2549
	 
3322
            }
3323
	
2550
			//
3324
			//
2551
			// Rule 309:  tupleLiteralExpCS ::= Tuple ERROR_TOKEN
3325
			// Rule 309:  tupleLiteralExpCS ::= Tuple ERROR_TOKEN
2552
			//
3326
			//
2553
			case 309: {
3327
			case 309: {
2554
				
3328
				
2555
				reportErrorTokenMessage(dtParser.getToken(7), OCLParserErrors.MISSING_LBRACE);
3329
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
2556
				CSTNode result = createTupleLiteralExpCS((EList)dtParser.getSym(3));
3330
            getParser().getToken(7), OCLParserErrors.MISSING_LBRACE);
2557
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
3331
				CSTNode result = createTupleLiteralExpCS((EList) // macro getSym is deprecated. Use function getRhsSym
2558
				dtParser.setSym1(result);
3332
          getParser().getSym(3));
2559
	  		  break;
3333
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2560
			}
3334
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2561
	 
3335
            getParser().getToken(4)));
3336
				 // macro setResult is deprecated. Use function setResult
3337
             getParser().setSym1(result);
3338
	                  break;
3339
            }
3340
	
2562
			//
3341
			//
2563
			// Rule 310:  variableCS ::= IDENTIFIER ERROR_TOKEN
3342
			// Rule 310:  variableCS ::= IDENTIFIER ERROR_TOKEN
2564
			//
3343
			//
2565
			case 310: {
3344
			case 310: {
2566
				
3345
				
2567
				reportErrorTokenMessage(dtParser.getToken(2), OCLParserErrors.MISSING_VARIABLE_TYPE);
3346
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
3347
            getParser().getToken(2), OCLParserErrors.MISSING_VARIABLE_TYPE);
2568
				CSTNode result = createVariableCS(
3348
				CSTNode result = createVariableCS(
2569
						getTokenText(dtParser.getToken(1)),
3349
						getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
3350
            getParser().getToken(1)),
2570
						null,
3351
						null,
2571
						null
3352
						null
2572
					);
3353
					);
2573
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(2)));
3354
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2574
				dtParser.setSym1(result);
3355
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2575
	  		  break;
3356
            getParser().getToken(2)));
2576
			}
3357
				 // macro setResult is deprecated. Use function setResult
3358
             getParser().setSym1(result);
3359
	                  break;
3360
            }
2577
	 
3361
	 
2578
			//
3362
			//
2579
			// Rule 311:  variableExpCS ::= simpleNameCS [ argumentsCS ERROR_TOKEN
3363
			// Rule 311:  variableExpCS ::= simpleNameCS [ argumentsCS ERROR_TOKEN
2580
			//
3364
			//
3365
			
2581
			case 311:
3366
			case 311:
2582
 
3367
2583
			//
3368
			//
2584
			// Rule 312:  variableExpCS ::= keywordAsName1 [ argumentsCS ERROR_TOKEN
3369
			// Rule 312:  variableExpCS ::= keywordAsName1 [ argumentsCS ERROR_TOKEN
2585
			//
3370
			//
2586
			case 312: {
3371
			case 312: {
2587
				
3372
				
2588
				reportErrorTokenMessage(dtParser.getToken(4), OCLParserErrors.MISSING_RBRACK);
3373
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
3374
            getParser().getToken(4), OCLParserErrors.MISSING_RBRACK);
2589
				CSTNode result = createVariableExpCS(
3375
				CSTNode result = createVariableExpCS(
2590
						(SimpleNameCS)dtParser.getSym(1),
3376
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2591
						(EList)dtParser.getSym(3),
3377
          getParser().getSym(1),
3378
						(EList) // macro getSym is deprecated. Use function getRhsSym
3379
          getParser().getSym(3),
2592
						createIsMarkedPreCS(false)
3380
						createIsMarkedPreCS(false)
2593
					);
3381
					);
2594
				setOffsets(result, (CSTNode)dtParser.getSym(1), getIToken(dtParser.getToken(4)));
3382
				setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
2595
				dtParser.setSym1(result);
3383
          getParser().getSym(1), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2596
	  		  break;
3384
            getParser().getToken(4)));
2597
			}
3385
				 // macro setResult is deprecated. Use function setResult
3386
             getParser().setSym1(result);
3387
	                  break;
3388
            }
2598
	 
3389
	 
2599
			//
3390
			//
2600
			// Rule 313:  variableListCS ::= ERROR_TOKEN
3391
			// Rule 313:  variableListCS ::= ERROR_TOKEN
2601
			//
3392
			//
3393
			
2602
			case 313:
3394
			case 313:
2603
 
3395
2604
			//
3396
			//
2605
			// Rule 314:  variableListCS2 ::= ERROR_TOKEN
3397
			// Rule 314:  variableListCS2 ::= ERROR_TOKEN
2606
			//
3398
			//
2607
			case 314: {
3399
			case 314: {
2608
				
3400
				
2609
				reportErrorTokenMessage(dtParser.getToken(1), OCLParserErrors.MISSING_VARIABLES);
3401
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
3402
            getParser().getToken(1), OCLParserErrors.MISSING_VARIABLES);
2610
				EList result = new BasicEList();
3403
				EList result = new BasicEList();
2611
				dtParser.setSym1(result);
3404
				 // macro setResult is deprecated. Use function setResult
2612
	  		  break;
3405
             getParser().setSym1(result);
2613
			}
3406
	                  break;
2614
	 
3407
            }
3408
	
2615
			//
3409
			//
2616
			// Rule 315:  classifierContextDeclCS ::= context pathNameCS ERROR_TOKEN
3410
			// Rule 315:  classifierContextDeclCS ::= context pathNameCS ERROR_TOKEN
2617
			//
3411
			//
2618
			case 315: {
3412
			case 315: {
2619
				
3413
				
2620
				reportErrorTokenMessage(dtParser.getToken(3), OCLParserErrors.MISSING_INV_OR_DEF);
3414
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
3415
            getParser().getToken(3), OCLParserErrors.MISSING_INV_OR_DEF);
2621
				CSTNode result = createClassifierContextDeclCS(
3416
				CSTNode result = createClassifierContextDeclCS(
2622
						(PathNameCS)dtParser.getSym(2),
3417
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
3418
          getParser().getSym(2),
2623
						new BasicEList<InvOrDefCS>()
3419
						new BasicEList<InvOrDefCS>()
2624
					);
3420
					);
2625
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
3421
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2626
				dtParser.setSym1(result);
3422
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2627
	  		  break;
3423
            getParser().getToken(3)));
2628
			}
3424
				 // macro setResult is deprecated. Use function setResult
2629
	 
3425
             getParser().setSym1(result);
3426
	                  break;
3427
            }
3428
	
2630
			//
3429
			//
2631
			// Rule 316:  defExpressionCS ::= typedVariableCS ERROR_TOKEN
3430
			// Rule 316:  defExpressionCS ::= typedVariableCS ERROR_TOKEN
2632
			//
3431
			//
2633
			case 316: {
3432
			case 316: {
2634
				
3433
				
2635
				reportErrorTokenMessage(dtParser.getToken(2), OCLParserErrors.MISSING_EQUALS);
3434
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
2636
				VariableCS variableCS = (VariableCS)dtParser.getSym(1);
3435
            getParser().getToken(2), OCLParserErrors.MISSING_EQUALS);
3436
				VariableCS variableCS = (VariableCS) // macro getSym is deprecated. Use function getRhsSym
3437
          getParser().getSym(1);
2637
				CSTNode result = createDefExpressionCS(
3438
				CSTNode result = createDefExpressionCS(
2638
						variableCS,
3439
						variableCS,
2639
						null,
3440
						null,
2640
						null
3441
						null
2641
					);
3442
					);
2642
				setOffsets(result, variableCS, getIToken(dtParser.getToken(2)));
3443
				setOffsets(result, variableCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2643
				dtParser.setSym1(result);
3444
            getParser().getToken(2)));
2644
	  		  break;
3445
				 // macro setResult is deprecated. Use function setResult
2645
			}
3446
             getParser().setSym1(result);
2646
	 
3447
	                  break;
3448
            }
3449
	
2647
			//
3450
			//
2648
			// Rule 317:  defExpressionCS ::= IDENTIFIER ERROR_Colon
3451
			// Rule 317:  defExpressionCS ::= IDENTIFIER ERROR_Colon
2649
			//
3452
			//
2650
			case 317: {
3453
			case 317: {
2651
				
3454
				
2652
				VariableCS variableCS = createVariableCS(
3455
				VariableCS variableCS = createVariableCS(
2653
							getTokenText(dtParser.getToken(1)),
3456
							getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
3457
            getParser().getToken(1)),
2654
							null,
3458
							null,
2655
							null
3459
							null
2656
						);
3460
						);
2657
				setOffsets(variableCS, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(2)));
3461
				setOffsets(variableCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
3462
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
3463
            getParser().getToken(2)));
2658
				CSTNode result = createDefExpressionCS(
3464
				CSTNode result = createDefExpressionCS(
2659
						variableCS,
3465
						variableCS,
2660
						null,
3466
						null,
2661
						null
3467
						null
2662
					);
3468
					);
2663
				setOffsets(result, variableCS, getIToken(dtParser.getToken(2)));
3469
				setOffsets(result, variableCS, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2664
				dtParser.setSym1(result);
3470
            getParser().getToken(2)));
2665
	  		  break;
3471
				 // macro setResult is deprecated. Use function setResult
2666
			}
3472
             getParser().setSym1(result);
2667
	 
3473
	                  break;
3474
            }
3475
	
2668
			//
3476
			//
2669
			// Rule 318:  initOrDerValueCS ::= initOrDerValueCSopt init ERROR_Colon
3477
			// Rule 318:  initOrDerValueCS ::= initOrDerValueCSopt init ERROR_Colon
2670
			//
3478
			//
2671
			case 318: {
3479
			case 318: {
2672
				
3480
				
2673
				CSTNode result = createInitValueCS(
3481
				CSTNode result = createInitValueCS(
2674
						(InitOrDerValueCS)dtParser.getSym(1),
3482
						(InitOrDerValueCS) // macro getSym is deprecated. Use function getRhsSym
3483
          getParser().getSym(1),
2675
						null
3484
						null
2676
					);
3485
					);
2677
				if (dtParser.getSym(1) != null) {
3486
				if ( // macro getSym is deprecated. Use function getRhsSym
2678
					setOffsets(result, (CSTNode)dtParser.getSym(1), getIToken(dtParser.getToken(3)));
3487
          getParser().getSym(1) != null) {
3488
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
3489
          getParser().getSym(1), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
3490
            getParser().getToken(3)));
2679
				} else {
3491
				} else {
2680
					setOffsets(result, getIToken(dtParser.getToken(2)), getIToken(dtParser.getToken(3)));
3492
					setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
3493
            getParser().getToken(2)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
3494
            getParser().getToken(3)));
2681
				}
3495
				}
2682
				dtParser.setSym1(result);
3496
				 // macro setResult is deprecated. Use function setResult
2683
	  		  break;
3497
             getParser().setSym1(result);
2684
			}
3498
	                  break;
2685
	 
3499
            }
3500
	
2686
			//
3501
			//
2687
			// Rule 319:  initOrDerValueCS ::= initOrDerValueCSopt derive ERROR_Colon
3502
			// Rule 319:  initOrDerValueCS ::= initOrDerValueCSopt derive ERROR_Colon
2688
			//
3503
			//
2689
			case 319: {
3504
			case 319: {
2690
				
3505
				
2691
				CSTNode result = createDerValueCS(
3506
				CSTNode result = createDerValueCS(
2692
						(InitOrDerValueCS)dtParser.getSym(1),
3507
						(InitOrDerValueCS) // macro getSym is deprecated. Use function getRhsSym
3508
          getParser().getSym(1),
2693
						null
3509
						null
2694
					);
3510
					);
2695
				if (dtParser.getSym(1) != null) {
3511
				if ( // macro getSym is deprecated. Use function getRhsSym
2696
					setOffsets(result, (CSTNode)dtParser.getSym(1), getIToken(dtParser.getToken(3)));
3512
          getParser().getSym(1) != null) {
3513
					setOffsets(result, (CSTNode) // macro getSym is deprecated. Use function getRhsSym
3514
          getParser().getSym(1), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
3515
            getParser().getToken(3)));
2697
				} else {
3516
				} else {
2698
					setOffsets(result, getIToken(dtParser.getToken(2)), getIToken(dtParser.getToken(3)));
3517
					setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
3518
            getParser().getToken(2)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
3519
            getParser().getToken(3)));
2699
				}
3520
				}
2700
				dtParser.setSym1(result);
3521
				 // macro setResult is deprecated. Use function setResult
2701
	  		  break;
3522
             getParser().setSym1(result);
2702
			}
3523
	                  break;
2703
	 
3524
            }
3525
	
2704
			//
3526
			//
2705
			// Rule 320:  invOrDefCS ::= inv simpleNameCS ERROR_Colon
3527
			// Rule 320:  invOrDefCS ::= inv simpleNameCS ERROR_Colon
2706
			//
3528
			//
2707
			case 320: {
3529
			case 320: {
2708
				
3530
				
2709
				CSTNode result = createInvCS(
3531
				CSTNode result = createInvCS(
2710
						(SimpleNameCS)dtParser.getSym(2),
3532
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
3533
          getParser().getSym(2),
2711
						null
3534
						null
2712
					);
3535
					);
2713
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
3536
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2714
				dtParser.setSym1(result);
3537
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2715
	  		  break;
3538
            getParser().getToken(3)));
2716
			}
3539
				 // macro setResult is deprecated. Use function setResult
2717
	 
3540
             getParser().setSym1(result);
3541
	                  break;
3542
            }
3543
	
2718
			//
3544
			//
2719
			// Rule 321:  invOrDefCS ::= def simpleNameCS ERROR_Colon
3545
			// Rule 321:  invOrDefCS ::= def simpleNameCS ERROR_Colon
2720
			//
3546
			//
2721
			case 321: {
3547
			case 321: {
2722
				
3548
				
2723
				CSTNode result = createDefCS(
3549
				CSTNode result = createDefCS(
2724
						(SimpleNameCS)dtParser.getSym(2),
3550
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
3551
          getParser().getSym(2),
2725
						null
3552
						null
2726
					);
3553
					);
2727
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
3554
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2728
				dtParser.setSym1(result);
3555
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2729
	  		  break;
3556
            getParser().getToken(3)));
2730
			}
3557
				 // macro setResult is deprecated. Use function setResult
2731
	 
3558
             getParser().setSym1(result);
3559
	                  break;
3560
            }
3561
	
2732
			//
3562
			//
2733
			// Rule 322:  packageDeclarationCS ::= package pathNameCS contextDeclCSmopt ERROR_Empty endpackage
3563
			// Rule 322:  packageDeclarationCS ::= package pathNameCS contextDeclCSmopt ERROR_Empty endpackage
2734
			//
3564
			//
2735
			case 322: {
3565
			case 322: {
2736
				
3566
				
2737
				CSTNode result = createPackageDeclarationCS(
3567
				CSTNode result = createPackageDeclarationCS(
2738
						(PathNameCS)dtParser.getSym(2),
3568
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
2739
						(EList)dtParser.getSym(3)
3569
          getParser().getSym(2),
2740
					);
3570
						(EList) // macro getSym is deprecated. Use function getRhsSym
2741
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(5)));
3571
          getParser().getSym(3)
2742
				dtParser.setSym1(result);
3572
					);
2743
	  		  break;
3573
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2744
			}
3574
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2745
	 
3575
            getParser().getToken(5)));
3576
				 // macro setResult is deprecated. Use function setResult
3577
             getParser().setSym1(result);
3578
	                  break;
3579
            }
3580
	
2746
			//
3581
			//
2747
			// Rule 323:  packageDeclarationCS ::= package pathNameCS contextDeclCSmopt ERROR_TOKEN
3582
			// Rule 323:  packageDeclarationCS ::= package pathNameCS contextDeclCSmopt ERROR_TOKEN
2748
			//
3583
			//
2749
			case 323: {
3584
			case 323: {
2750
				
3585
				
2751
				reportErrorTokenMessage(dtParser.getToken(4), OCLParserErrors.MISSING_ENDPACKAGE);
3586
				reportErrorTokenMessage( // macro getToken is deprecated. Use function getRhsTokenIndex
3587
            getParser().getToken(4), OCLParserErrors.MISSING_ENDPACKAGE);
2752
				CSTNode result = createPackageDeclarationCS(
3588
				CSTNode result = createPackageDeclarationCS(
2753
						(PathNameCS)dtParser.getSym(2),
3589
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
2754
						(EList)dtParser.getSym(3)
3590
          getParser().getSym(2),
2755
					);
3591
						(EList) // macro getSym is deprecated. Use function getRhsSym
2756
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(4)));
3592
          getParser().getSym(3)
2757
				dtParser.setSym1(result);
3593
					);
2758
	  		  break;
3594
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2759
			}
3595
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2760
	 
3596
            getParser().getToken(4)));
3597
				 // macro setResult is deprecated. Use function setResult
3598
             getParser().setSym1(result);
3599
	                  break;
3600
            }
3601
	
2761
			//
3602
			//
2762
			// Rule 324:  packageDeclarationCS ::= package ERROR_PathNameCS
3603
			// Rule 324:  packageDeclarationCS ::= package ERROR_PathNameCS
2763
			//
3604
			//
2764
			case 324: {
3605
			case 324: {
2765
				
3606
				
2766
				CSTNode result = createPackageDeclarationCS(
3607
				CSTNode result = createPackageDeclarationCS(
2767
						(PathNameCS)dtParser.getSym(2),
3608
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
3609
          getParser().getSym(2),
2768
						new BasicEList()
3610
						new BasicEList()
2769
					);
3611
					);
2770
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(2)));
3612
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2771
				dtParser.setSym1(result);
3613
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2772
	  		  break;
3614
            getParser().getToken(2)));
2773
			}
3615
				 // macro setResult is deprecated. Use function setResult
2774
	 
3616
             getParser().setSym1(result);
3617
	                  break;
3618
            }
3619
	
2775
			//
3620
			//
2776
			// Rule 325:  prePostOrBodyDeclCS ::= pre simpleNameCS ERROR_Colon
3621
			// Rule 325:  prePostOrBodyDeclCS ::= pre simpleNameCS ERROR_Colon
2777
			//
3622
			//
Lines 2779-2792 Link Here
2779
				
3624
				
2780
				CSTNode result = createPrePostOrBodyDeclCS(
3625
				CSTNode result = createPrePostOrBodyDeclCS(
2781
						PrePostOrBodyEnum.PRE_LITERAL,
3626
						PrePostOrBodyEnum.PRE_LITERAL,
2782
						(SimpleNameCS)dtParser.getSym(2),
3627
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2783
						createInvalidLiteralExpCS(getTokenText(dtParser.getToken(3)))
3628
          getParser().getSym(2),
2784
					);
3629
						createInvalidLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
2785
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
3630
            getParser().getToken(3)))
2786
				dtParser.setSym1(result);
3631
					);
2787
	  		  break;
3632
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2788
			}
3633
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2789
	 
3634
            getParser().getToken(3)));
3635
				 // macro setResult is deprecated. Use function setResult
3636
             getParser().setSym1(result);
3637
	                  break;
3638
            }
3639
	
2790
			//
3640
			//
2791
			// Rule 326:  prePostOrBodyDeclCS ::= post simpleNameCS ERROR_Colon
3641
			// Rule 326:  prePostOrBodyDeclCS ::= post simpleNameCS ERROR_Colon
2792
			//
3642
			//
Lines 2794-2807 Link Here
2794
				
3644
				
2795
				CSTNode result = createPrePostOrBodyDeclCS(
3645
				CSTNode result = createPrePostOrBodyDeclCS(
2796
						PrePostOrBodyEnum.POST_LITERAL,
3646
						PrePostOrBodyEnum.POST_LITERAL,
2797
						(SimpleNameCS)dtParser.getSym(2),
3647
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2798
						createInvalidLiteralExpCS(getTokenText(dtParser.getToken(3)))
3648
          getParser().getSym(2),
2799
					);
3649
						createInvalidLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
2800
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
3650
            getParser().getToken(3)))
2801
				dtParser.setSym1(result);
3651
					);
2802
	  		  break;
3652
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2803
			}
3653
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2804
	 
3654
            getParser().getToken(3)));
3655
				 // macro setResult is deprecated. Use function setResult
3656
             getParser().setSym1(result);
3657
	                  break;
3658
            }
3659
	
2805
			//
3660
			//
2806
			// Rule 327:  prePostOrBodyDeclCS ::= body simpleNameCS ERROR_Colon
3661
			// Rule 327:  prePostOrBodyDeclCS ::= body simpleNameCS ERROR_Colon
2807
			//
3662
			//
Lines 2809-2840 Link Here
2809
				
3664
				
2810
				CSTNode result = createPrePostOrBodyDeclCS(
3665
				CSTNode result = createPrePostOrBodyDeclCS(
2811
						PrePostOrBodyEnum.BODY_LITERAL,
3666
						PrePostOrBodyEnum.BODY_LITERAL,
2812
						(SimpleNameCS)dtParser.getSym(2),
3667
						(SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
2813
						createInvalidLiteralExpCS(getTokenText(dtParser.getToken(3)))
3668
          getParser().getSym(2),
2814
					);
3669
						createInvalidLiteralExpCS(getTokenText( // macro getToken is deprecated. Use function getRhsTokenIndex
2815
				setOffsets(result, getIToken(dtParser.getToken(1)), getIToken(dtParser.getToken(3)));
3670
            getParser().getToken(3)))
2816
				dtParser.setSym1(result);
3671
					);
2817
	  		  break;
3672
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2818
			}
3673
            getParser().getToken(1)), getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2819
	 
3674
            getParser().getToken(3)));
3675
				 // macro setResult is deprecated. Use function setResult
3676
             getParser().setSym1(result);
3677
	                  break;
3678
            }
3679
	
2820
			//
3680
			//
2821
			// Rule 328:  propertyContextCS ::= context pathNameCS :: ERROR_SimpleNameCS
3681
			// Rule 328:  propertyContextCS ::= context pathNameCS :: ERROR_SimpleNameCS
2822
			//
3682
			//
2823
			case 328: {
3683
			case 328: {
2824
				
3684
				
2825
				SimpleNameCS simpleNameCS = (SimpleNameCS)dtParser.getSym(4);
3685
				SimpleNameCS simpleNameCS = (SimpleNameCS) // macro getSym is deprecated. Use function getRhsSym
3686
          getParser().getSym(4);
2826
				CSTNode result = createPropertyContextCS(
3687
				CSTNode result = createPropertyContextCS(
2827
						(PathNameCS)dtParser.getSym(2),
3688
						(PathNameCS) // macro getSym is deprecated. Use function getRhsSym
3689
          getParser().getSym(2),
2828
						simpleNameCS,
3690
						simpleNameCS,
2829
						null,
3691
						null,
2830
						null
3692
						null
2831
					);
3693
					);
2832
				setOffsets(result, getIToken(dtParser.getToken(1)), simpleNameCS);
3694
				setOffsets(result, getIToken( // macro getToken is deprecated. Use function getRhsTokenIndex
2833
				dtParser.setSym1(result);
3695
            getParser().getToken(1)), simpleNameCS);
2834
	  		  break;
3696
				 // macro setResult is deprecated. Use function setResult
2835
			}
3697
             getParser().setSym1(result);
2836
	
3698
	                  break;
3699
            }
2837
	
3700
	
3701
    
2838
			default:
3702
			default:
2839
				break;
3703
				break;
2840
		}
3704
		}
(-)src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingParser.g
Lines 1-7 Link Here
1
--/**
1
--/**
2
-- * <copyright>
2
-- * <copyright>
3
-- *
3
-- *
(-)* Copyright (c) 2008, 2009 Eclipse.org and others. (-15 / +12 lines)
Lines 9-14 Link Here
9
-- *
9
-- *
10
-- * Contributors:
10
-- * Contributors:
11
-- *   E.D. Willink - Initial API and implementation
11
-- *   E.D. Willink - Initial API and implementation
12
-- *   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
12
-- *
13
-- *
13
-- * </copyright>
14
-- * </copyright>
14
-- *
15
-- *
Lines 25-59 Link Here
25
26
26
%options escape=$
27
%options escape=$
27
%options la=2
28
%options la=2
28
%options table=java
29
%options fp=OCLBacktrackingParser,prefix=TK_
29
%options fp=OCLBacktrackingParser,prefix=TK_
30
%options error-maps
31
%options scopes
32
%options margin=4
33
%options backtrack
30
%options backtrack
34
%options noserialize
31
%options noserialize
35
%options package=org.eclipse.ocl.parser.backtracking
32
%options package=org.eclipse.ocl.parser.backtracking
36
%options import_terminals=OCLBacktrackingLexer.g
33
%options import_terminals=OCLBacktrackingLexer.gi
37
%options ast_type=CSTNode
34
%options ast_type=CSTNode
38
%options programming_language=java
35
%options ParseTable=lpg.runtime.ParseTable
39
%options action=("*.java", "/.", "./")
36
%options template=dtParserTemplateF.gi
40
%options ParseTable=lpg.lpgjavaruntime.ParseTable
41
%options include_directory=".;..;../../lpg"
37
%options include_directory=".;..;../../lpg"
42
38
43
$Include
39
%Import
44
	OCLParserErrors.g
40
	OCLParserErrors.gi
45
$End
41
%End
46
42
47
$Globals
43
%Globals
48
	/.
44
	/.
49
		import org.eclipse.ocl.parser.AbstractOCLParser;
45
		import org.eclipse.ocl.parser.AbstractOCLParser;
50
	./
46
	./
51
$End
47
%End
52
48
53
$Define
49
%Define
54
	$lex_stream_class /.OCLBacktrackingLexer./
50
	$lex_stream_class /.OCLBacktrackingLexer./
55
	$prs_parser_class /.BacktrackingParser./
51
	$prs_parser_class /.BacktrackingParser./
56
	$prs_parser_exception /.NotBacktrackParseTableException./
52
	$prs_parser_exception /.NotBacktrackParseTableException./
57
	$prs_parser_throw /.throw new RuntimeException("****Error: Regenerate $prs_type.java with -BACKTRACK option")./
53
	$prs_parser_throw /.throw new RuntimeException("****Error: Regenerate $prs_type.java with -BACKTRACK option")./
58
	$prs_parse_args /.error_repair_count./
54
	$prs_parse_args /.error_repair_count./
59
$End
55
%End
56
(-)src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingLexer.java (-328 / +492 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2009 IBM Corporation, Borland Software Corp.,  and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Borland Software Corp., Open Canarias S.L. and others.
5
* All rights reserved.   This program and the accompanying materials
5
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
6
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
7
* which accompanies this distribution, and is available at
Lines 10-124 Link Here
10
* Contributors:
10
* Contributors:
11
*   IBM - Initial API and implementation
11
*   IBM - Initial API and implementation
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
13
*               - Bug 259818
13
*   Borland - Bug 242880
14
*   Borland - Bug 242880
15
*   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
14
*
16
*
15
* </copyright>
17
* </copyright>
16
*
18
*
17
* $Id: OCLBacktrackingLexer.java,v 1.2 2009/08/28 20:43:11 ewillink Exp $
19
* $Id$
18
*/
20
*/
19
21
20
package org.eclipse.ocl.parser.backtracking;
22
package org.eclipse.ocl.parser.backtracking;
21
23
22
import lpg.lpgjavaruntime.*;
24
import lpg.runtime.*;
23
import org.eclipse.ocl.lpg.AbstractLexer;
25
import org.eclipse.ocl.lpg.AbstractLexer;
24
import org.eclipse.ocl.lpg.AbstractParser;
26
import org.eclipse.ocl.lpg.AbstractLexerStream;
27
import org.eclipse.ocl.lpg.OCLParserStream;
28
29
import java.io.Reader;
30
25
import org.eclipse.ocl.Environment;
31
import org.eclipse.ocl.Environment;
26
import org.eclipse.ocl.lpg.BasicEnvironment;
32
import org.eclipse.ocl.lpg.BasicEnvironment;
27
import org.eclipse.ocl.util.OCLUtil;
33
import org.eclipse.ocl.util.OCLUtil;
28
34
29
@SuppressWarnings("nls")
35
@SuppressWarnings("nls")
30
public class OCLBacktrackingLexer extends AbstractLexer implements OCLBacktrackingParsersym, OCLBacktrackingLexersym, RuleAction
36
public class OCLBacktrackingLexer extends AbstractLexer implements RuleAction
31
{
37
{
38
    private OCLBacktrackingLexerStream lexStream;
39
32
    private static ParseTable prs = new OCLBacktrackingLexerprs();
40
    private static ParseTable prs = new OCLBacktrackingLexerprs();
33
    //
41
    public ParseTable getParseTable() { return prs; }
34
    // The Lexer contains an array of characters as the input stream to be parsed.
42
35
    // There are methods to retrieve and classify characters.
43
    private LexParser lexParser = new LexParser();
36
    // The lexparser "token" is implemented simply as the index of the next character in the array.
44
    public LexParser getParser() { return lexParser; }
37
    // The Lexer extends the abstract class LpgLexStream with an implementation of the abstract
45
38
    // method getKind.  The template defines the Lexer class and the lexer() method.
46
    public int getToken(int i) { return lexParser.getToken(i); }
39
    // A driver creates the action class, "Lexer", passing an Option object to the constructor.
47
    public int getRhsFirstTokenIndex(int i) { return lexParser.getFirstToken(i); }
40
    //
48
    public int getRhsLastTokenIndex(int i) { return lexParser.getLastToken(i); }
41
    protected OCLBacktrackingKWLexer kwLexer;
49
42
    protected boolean printTokens;
50
    public int getLeftSpan() { return lexParser.getToken(1); }
43
    private AbstractParser parser;
51
    public int getRightSpan() { return lexParser.getLastToken(); }
44
    private LexParser lexParser = new LexParser(this, prs, this);
52
53
    public void resetKeywordLexer()
54
    {
55
        if (kwLexer == null)
56
              this.kwLexer = new OCLBacktrackingKWLexer(lexStream.getInputChars(), OCLBacktrackingParsersym.TK_IDENTIFIER);
57
        else this.kwLexer.setInputChars(lexStream.getInputChars());
58
    }
59
60
    public void reset(String filename, int tab) throws java.io.IOException
61
    {
62
        lexStream = new OCLBacktrackingLexerStream(getOCLEnvironment(), filename, tab);
63
        lexParser.reset(lexStream, prs, this);
64
        resetKeywordLexer();
65
    }
66
67
    public void reset(char[] input_chars, String filename)
68
    {
69
        reset(input_chars, filename, ECLIPSE_TAB_VALUE);
70
    }
71
72
    public void reset(char[] input_chars, String filename, int tab)
73
    {
74
        lexStream = new OCLBacktrackingLexerStream(getOCLEnvironment(), input_chars, filename, tab);
75
        lexParser.reset(lexStream, prs, this);
76
        resetKeywordLexer();
77
    }
78
79
    // OCL addition to reset the lexer stream from an input reader
80
    public void reset(Reader reader, String filename) throws java.io.IOException {
81
        reset(reader, filename, ECLIPSE_TAB_VALUE);
82
    }
45
    
83
    
46
    private final Environment<?,?,?,?,?,?,?,?,?,?,?,?> oclEnvironment;
84
    // OCL addition to reset the lexer stream from an input reader
85
	  public void reset(Reader reader, String filename, int tab) throws java.io.IOException {
86
    		char[] input_chars = getInputChars(reader);
87
        reset(input_chars, filename, tab);
88
    }
47
89
48
    public OCLBacktrackingLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment) {
90
	  /**
91
	   * @since 3.0
92
	   */
93
    public OCLBacktrackingLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, String filename, int tab) throws java.io.IOException {
49
        super(OCLUtil.getAdapter(environment, BasicEnvironment.class));
94
        super(OCLUtil.getAdapter(environment, BasicEnvironment.class));
95
        reset(filename, tab);
50
        oclEnvironment = environment;
96
        oclEnvironment = environment;
51
    }
97
    }
52
    
53
	public OCLBacktrackingLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, char[] chars) {
54
		this(environment, chars, "OCL", ECLIPSE_TAB_VALUE);
55
		kwLexer = new OCLBacktrackingKWLexer(getInputChars(), TK_IDENTIFIER);
56
	}
57
98
58
    public OCLBacktrackingLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, char[] input_chars, String filename, int tab)  {
99
	  /**
59
        super(OCLUtil.getAdapter(environment, BasicEnvironment.class), input_chars, filename, tab);
100
	   * @since 3.0
101
	   */
102
    public OCLBacktrackingLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, String filename) throws java.io.IOException{
103
        this(environment, filename, ECLIPSE_TAB_VALUE);
104
    }
105
106
    public OCLBacktrackingLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, char[] input_chars, String filename, int tab) {
107
        super(OCLUtil.getAdapter(environment, BasicEnvironment.class));
108
        reset(input_chars, filename, tab);
60
        oclEnvironment = environment;
109
        oclEnvironment = environment;
61
    }
110
    }
111
112
	  public OCLBacktrackingLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, char[] chars) {
113
        this(environment, chars, "OCL", ECLIPSE_TAB_VALUE);
114
	  }
115
116
	  /**
117
	   * @since 3.0
118
	   */
119
	  public OCLBacktrackingLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, Reader reader) throws java.io.IOException {
120
        this(environment, reader, "OCL");
121
	  }
122
123
	  /**
124
	   * @since 3.0
125
	   */
126
    public OCLBacktrackingLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, Reader reader, String filename) throws java.io.IOException {
127
			this(environment, reader, filename, ECLIPSE_TAB_VALUE);
128
	  }
129
	  
130
	  /**
131
	   * @since 3.0
132
	   */
133
	  public OCLBacktrackingLexer(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, Reader reader, String filename, int tab) throws java.io.IOException {
134
			super(OCLUtil.getAdapter(environment, BasicEnvironment.class));
135
			reset(reader, filename, tab);
136
			oclEnvironment = environment;
137
	  }
138
    
139
    private final Environment<?,?,?,?,?,?,?,?,?,?,?,?> oclEnvironment;
62
    
140
    
63
	public Environment<?,?,?,?,?,?,?,?,?,?,?,?> getOCLEnvironment() {
141
    public Environment<?,?,?,?,?,?,?,?,?,?,?,?> getOCLEnvironment() {
64
    	return oclEnvironment;
142
    	return oclEnvironment;
65
    }
143
    }
66
144
67
    @Override
145
    public AbstractLexerStream getILexStream() { return lexStream; }
68
    public int [] getKeywordKinds() { return kwLexer.getKeywordKinds(); }
69
146
70
    public int getLeftSpan() { return lexParser.getFirstToken(); }
147
    /**
71
    public AbstractParser getParser() { return parser; }
148
     * @deprecated replaced by {@link #getILexStream()}
72
    public int getRhsFirstTokenIndex(int i) { return lexParser.getFirstToken(i); }
149
     */
73
    public int getRhsLastTokenIndex(int i) { return lexParser.getLastToken(i); }
150
    public ILexStream getLexStream() { return lexStream; }
74
    public int getRightSpan() { return lexParser.getLastToken(); }
75
151
76
    @Override
152
    private void initializeLexer(OCLParserStream prsStream, int start_offset, int end_offset)
77
    public int getToken(int i) { return lexParser.getToken(i); }
153
    {
154
        if (lexStream.getInputChars() == null)
155
            throw new NullPointerException("LexStream was not initialized");
156
        lexStream.setPrsStream(prsStream);
157
        prsStream.makeToken(start_offset, end_offset, 0); // Token list must start with a bad token
158
    }
78
159
79
    @Override
160
    private void addEOF(OCLParserStream prsStream, int end_offset)
80
    public void initialize(char [] content, String filename)
81
    {
161
    {
82
        super.initialize(content, filename);
162
        prsStream.makeToken(end_offset, end_offset, OCLBacktrackingParsersym.TK_EOF_TOKEN); // and end with the end of file token
83
        if (kwLexer == null)
163
        prsStream.setStreamLength(prsStream.getSize());
84
             kwLexer = new OCLBacktrackingKWLexer(getInputChars(), TK_IDENTIFIER);
85
        else
86
             kwLexer.setInputChars(getInputChars());
87
    }
164
    }
88
165
89
    @Override
166
    public void lexer(OCLParserStream prsStream)
90
    public String[] orderedExportedSymbols() { return OCLBacktrackingParsersym.orderedTerminalSymbols; }
167
    {
168
        lexer(null, prsStream);
169
    }
91
    
170
    
92
    @Override
171
    public void lexer(Monitor monitor, OCLParserStream prsStream)
93
    public void setInputChars(char[] inputChars) {
172
    {
94
		super.setInputChars(inputChars);
173
        initializeLexer(prsStream, 0, -1);
95
		kwLexer = new OCLBacktrackingKWLexer(getInputChars(), TK_IDENTIFIER);
174
        lexParser.parseCharacters(monitor);  // Lex the input characters
96
	}
175
        addEOF(prsStream, lexStream.getStreamIndex());
176
    }
177
178
    public void lexer(OCLParserStream prsStream, int start_offset, int end_offset)
179
    {
180
        lexer(null, prsStream, start_offset, end_offset);
181
    }
97
    
182
    
98
    @Override
183
    public void lexer(Monitor monitor, OCLParserStream prsStream, int start_offset, int end_offset)
99
    public void lexToTokens(Monitor monitor, AbstractParser parser)
100
    {
184
    {
101
        if (getInputChars() == null)
185
        if (start_offset <= 1)
102
            throw new NullPointerException("LexStream was not initialized");
186
             initializeLexer(prsStream, 0, -1);
187
        else initializeLexer(prsStream, start_offset - 1, start_offset - 1);
188
189
        lexParser.parseCharacters(monitor, start_offset, end_offset);
190
191
        addEOF(prsStream, (end_offset >= lexStream.getStreamIndex() ? lexStream.getStreamIndex() : end_offset + 1));
192
    }
193
194
    /**
195
     * If a parse stream was not passed to this Lexical analyser then we
196
     * simply report a lexical error. Otherwise, we produce a bad token.
197
     */
198
    public void reportLexicalError(int startLoc, int endLoc) {
199
        IPrsStream prs_stream = lexStream.getIPrsStream();
200
        if (prs_stream == null)
201
            lexStream.reportLexicalError(startLoc, endLoc);
202
        else {
203
            //
204
            // Remove any token that may have been processed that fall in the
205
            // range of the lexical error... then add one error token that spans
206
            // the error range.
207
            //
208
            for (int i = prs_stream.getSize() - 1; i > 0; i--) {
209
                if (prs_stream.getStartOffset(i) >= startLoc)
210
                     prs_stream.removeLastToken();
211
                else break;
212
            }
213
            prs_stream.makeToken(startLoc, endLoc, 0); // add an error token to the prsStream
214
        }        
215
    }
103
216
104
        this.parser = parser;
217
    //
218
    // The Lexer contains an array of characters as the input stream to be parsed.
219
    // There are methods to retrieve and classify characters.
220
    // The lexparser "token" is implemented simply as the index of the next character in the array.
221
    // The Lexer extends the abstract class LpgLexStream with an implementation of the abstract
222
    // method getKind.  The template defines the Lexer class and the lexer() method.
223
    // A driver creates the action class, "Lexer", passing an Option object to the constructor.
224
    //
225
    OCLBacktrackingKWLexer kwLexer;
226
    boolean printTokens;
227
    private final static int ECLIPSE_TAB_VALUE = 4;
105
228
106
        parser.makeToken(0, 0, 0); // Token list must start with a bad token
229
    public int [] getKeywordKinds() { return kwLexer.getKeywordKinds(); }
107
            
230
108
        lexParser.parseCharacters(monitor);  // Lex the input characters
231
109
            
232
    /**
110
        int i = getStreamIndex();
233
     * @deprecated function replaced by {@link #reset(char [] content, String filename)}
111
        parser.makeToken(i, i, TK_EOF_TOKEN); // and end with the end of file token
234
     */
112
        parser.setStreamLength(parser.getSize());
235
    public void initialize(char [] content, String filename)
113
            
236
    {
114
        return;
237
        reset(content, filename);
238
    }
239
    
240
    final void makeToken(int left_token, int right_token, int kind)
241
    {
242
        lexStream.makeToken(left_token, right_token, kind);
115
    }
243
    }
116
    
244
    
117
    final void makeToken(int kind)
245
    final void makeToken(int kind)
118
    {
246
    {
119
        int startOffset = getLeftSpan(),
247
        int startOffset = getLeftSpan(),
120
            endOffset = getRightSpan();
248
            endOffset = getRightSpan();
121
        makeToken(startOffset, endOffset, kind);
249
        lexStream.makeToken(startOffset, endOffset, kind);
122
        if (printTokens) printValue(startOffset, endOffset);
250
        if (printTokens) printValue(startOffset, endOffset);
123
    }
251
    }
124
252
Lines 126-132 Link Here
126
    {
254
    {
127
        int startOffset = getLeftSpan(),
255
        int startOffset = getLeftSpan(),
128
            endOffset = getRightSpan();
256
            endOffset = getRightSpan();
129
        super.getPrsStream().makeAdjunct(startOffset, endOffset, kind);
257
        lexStream.getIPrsStream().makeAdjunct(startOffset, endOffset, kind);
130
    }
258
    }
131
259
132
    final void skipToken()
260
    final void skipToken()
Lines 138-628 Link Here
138
    {
266
    {
139
        int startOffset = getLeftSpan(),
267
        int startOffset = getLeftSpan(),
140
            endOffset = getRightSpan(),
268
            endOffset = getRightSpan(),
141
        kwKind = kwLexer.lexer(startOffset, endOffset);
269
            kwKind = kwLexer.lexer(startOffset, endOffset);
142
        makeToken(startOffset, endOffset, kwKind);
270
        lexStream.makeToken(startOffset, endOffset, kwKind);
271
        if (printTokens) printValue(startOffset, endOffset);
272
    }
273
    
274
    //
275
    // This flavor of checkForKeyWord is necessary when the default kind
276
    // (which is returned when the keyword filter doesn't match) is something
277
    // other than _IDENTIFIER.
278
    //
279
    final void checkForKeyWord(int defaultKind)
280
    {
281
        int startOffset = getLeftSpan(),
282
            endOffset = getRightSpan(),
283
            kwKind = kwLexer.lexer(startOffset, endOffset);
284
        if (kwKind == OCLBacktrackingParsersym.TK_IDENTIFIER)
285
            kwKind = defaultKind;
286
        lexStream.makeToken(startOffset, endOffset, kwKind);
143
        if (printTokens) printValue(startOffset, endOffset);
287
        if (printTokens) printValue(startOffset, endOffset);
144
    }
288
    }
145
    
289
    
146
    final void printValue(int startOffset, int endOffset)
290
    final void printValue(int startOffset, int endOffset)
147
    {
291
    {
148
        String s = new String(getInputChars(), startOffset, endOffset - startOffset + 1);
292
        String s = new String(lexStream.getInputChars(), startOffset, endOffset - startOffset + 1);
149
        System.out.print(s);
293
        System.out.print(s);
150
    }
294
    }
151
295
152
    //
296
    //
153
    //
297
    //
154
    //
298
    //
299
    static class OCLBacktrackingLexerStream extends AbstractLexerStream
300
    {
155
    public final static int tokenKind[] =
301
    public final static int tokenKind[] =
156
    {
302
    {
157
        Char_CtlCharNotWS,    // 000    0x00
303
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 000    0x00
158
        Char_CtlCharNotWS,    // 001    0x01
304
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 001    0x01
159
        Char_CtlCharNotWS,    // 002    0x02
305
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 002    0x02
160
        Char_CtlCharNotWS,    // 003    0x03
306
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 003    0x03
161
        Char_CtlCharNotWS,    // 004    0x04
307
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 004    0x04
162
        Char_CtlCharNotWS,    // 005    0x05
308
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 005    0x05
163
        Char_CtlCharNotWS,    // 006    0x06
309
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 006    0x06
164
        Char_CtlCharNotWS,    // 007    0x07
310
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 007    0x07
165
        Char_CtlCharNotWS,    // 008    0x08
311
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 008    0x08
166
        Char_HT,              // 009    0x09
312
        OCLBacktrackingLexersym.Char_HT,              // 009    0x09
167
        Char_LF,              // 010    0x0A
313
        OCLBacktrackingLexersym.Char_LF,              // 010    0x0A
168
        Char_CtlCharNotWS,    // 011    0x0B
314
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 011    0x0B
169
        Char_FF,              // 012    0x0C
315
        OCLBacktrackingLexersym.Char_FF,              // 012    0x0C
170
        Char_CR,              // 013    0x0D
316
        OCLBacktrackingLexersym.Char_CR,              // 013    0x0D
171
        Char_CtlCharNotWS,    // 014    0x0E
317
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 014    0x0E
172
        Char_CtlCharNotWS,    // 015    0x0F
318
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 015    0x0F
173
        Char_CtlCharNotWS,    // 016    0x10
319
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 016    0x10
174
        Char_CtlCharNotWS,    // 017    0x11
320
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 017    0x11
175
        Char_CtlCharNotWS,    // 018    0x12
321
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 018    0x12
176
        Char_CtlCharNotWS,    // 019    0x13
322
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 019    0x13
177
        Char_CtlCharNotWS,    // 020    0x14
323
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 020    0x14
178
        Char_CtlCharNotWS,    // 021    0x15
324
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 021    0x15
179
        Char_CtlCharNotWS,    // 022    0x16
325
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 022    0x16
180
        Char_CtlCharNotWS,    // 023    0x17
326
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 023    0x17
181
        Char_CtlCharNotWS,    // 024    0x18
327
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 024    0x18
182
        Char_CtlCharNotWS,    // 025    0x19
328
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 025    0x19
183
        Char_CtlCharNotWS,    // 026    0x1A
329
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 026    0x1A
184
        Char_CtlCharNotWS,    // 027    0x1B
330
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 027    0x1B
185
        Char_CtlCharNotWS,    // 028    0x1C
331
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 028    0x1C
186
        Char_CtlCharNotWS,    // 029    0x1D
332
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 029    0x1D
187
        Char_CtlCharNotWS,    // 030    0x1E
333
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 030    0x1E
188
        Char_CtlCharNotWS,    // 031    0x1F
334
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 031    0x1F
189
        Char_Space,           // 032    0x20
335
        OCLBacktrackingLexersym.Char_Space,           // 032    0x20
190
        Char_Exclamation,     // 033    0x21
336
        OCLBacktrackingLexersym.Char_Exclamation,     // 033    0x21
191
        Char_DoubleQuote,     // 034    0x22
337
        OCLBacktrackingLexersym.Char_DoubleQuote,     // 034    0x22
192
        Char_Sharp,           // 035    0x23
338
        OCLBacktrackingLexersym.Char_Sharp,           // 035    0x23
193
        Char_DollarSign,      // 036    0x24
339
        OCLBacktrackingLexersym.Char_DollarSign,      // 036    0x24
194
        Char_Percent,         // 037    0x25
340
        OCLBacktrackingLexersym.Char_Percent,         // 037    0x25
195
        Char_Ampersand,       // 038    0x26
341
        OCLBacktrackingLexersym.Char_Ampersand,       // 038    0x26
196
        Char_SingleQuote,     // 039    0x27
342
        OCLBacktrackingLexersym.Char_SingleQuote,     // 039    0x27
197
        Char_LeftParen,       // 040    0x28
343
        OCLBacktrackingLexersym.Char_LeftParen,       // 040    0x28
198
        Char_RightParen,      // 041    0x29
344
        OCLBacktrackingLexersym.Char_RightParen,      // 041    0x29
199
        Char_Star,            // 042    0x2A
345
        OCLBacktrackingLexersym.Char_Star,            // 042    0x2A
200
        Char_Plus,            // 043    0x2B
346
        OCLBacktrackingLexersym.Char_Plus,            // 043    0x2B
201
        Char_Comma,           // 044    0x2C
347
        OCLBacktrackingLexersym.Char_Comma,           // 044    0x2C
202
        Char_Minus,           // 045    0x2D
348
        OCLBacktrackingLexersym.Char_Minus,           // 045    0x2D
203
        Char_Dot,             // 046    0x2E
349
        OCLBacktrackingLexersym.Char_Dot,             // 046    0x2E
204
        Char_Slash,           // 047    0x2F
350
        OCLBacktrackingLexersym.Char_Slash,           // 047    0x2F
205
        Char_0,               // 048    0x30
351
        OCLBacktrackingLexersym.Char_0,               // 048    0x30
206
        Char_1,               // 049    0x31
352
        OCLBacktrackingLexersym.Char_1,               // 049    0x31
207
        Char_2,               // 050    0x32
353
        OCLBacktrackingLexersym.Char_2,               // 050    0x32
208
        Char_3,               // 051    0x33
354
        OCLBacktrackingLexersym.Char_3,               // 051    0x33
209
        Char_4,               // 052    0x34
355
        OCLBacktrackingLexersym.Char_4,               // 052    0x34
210
        Char_5,               // 053    0x35
356
        OCLBacktrackingLexersym.Char_5,               // 053    0x35
211
        Char_6,               // 054    0x36
357
        OCLBacktrackingLexersym.Char_6,               // 054    0x36
212
        Char_7,               // 055    0x37
358
        OCLBacktrackingLexersym.Char_7,               // 055    0x37
213
        Char_8,               // 056    0x38
359
        OCLBacktrackingLexersym.Char_8,               // 056    0x38
214
        Char_9,               // 057    0x39
360
        OCLBacktrackingLexersym.Char_9,               // 057    0x39
215
        Char_Colon,           // 058    0x3A
361
        OCLBacktrackingLexersym.Char_Colon,           // 058    0x3A
216
        Char_SemiColon,       // 059    0x3B
362
        OCLBacktrackingLexersym.Char_SemiColon,       // 059    0x3B
217
        Char_LessThan,        // 060    0x3C
363
        OCLBacktrackingLexersym.Char_LessThan,        // 060    0x3C
218
        Char_Equal,           // 061    0x3D
364
        OCLBacktrackingLexersym.Char_Equal,           // 061    0x3D
219
        Char_GreaterThan,     // 062    0x3E
365
        OCLBacktrackingLexersym.Char_GreaterThan,     // 062    0x3E
220
        Char_QuestionMark,    // 063    0x3F
366
        OCLBacktrackingLexersym.Char_QuestionMark,    // 063    0x3F
221
        Char_AtSign,          // 064    0x40
367
        OCLBacktrackingLexersym.Char_AtSign,          // 064    0x40
222
        Char_A,               // 065    0x41
368
        OCLBacktrackingLexersym.Char_A,               // 065    0x41
223
        Char_B,               // 066    0x42
369
        OCLBacktrackingLexersym.Char_B,               // 066    0x42
224
        Char_C,               // 067    0x43
370
        OCLBacktrackingLexersym.Char_C,               // 067    0x43
225
        Char_D,               // 068    0x44
371
        OCLBacktrackingLexersym.Char_D,               // 068    0x44
226
        Char_E,               // 069    0x45
372
        OCLBacktrackingLexersym.Char_E,               // 069    0x45
227
        Char_F,               // 070    0x46
373
        OCLBacktrackingLexersym.Char_F,               // 070    0x46
228
        Char_G,               // 071    0x47
374
        OCLBacktrackingLexersym.Char_G,               // 071    0x47
229
        Char_H,               // 072    0x48
375
        OCLBacktrackingLexersym.Char_H,               // 072    0x48
230
        Char_I,               // 073    0x49
376
        OCLBacktrackingLexersym.Char_I,               // 073    0x49
231
        Char_J,               // 074    0x4A
377
        OCLBacktrackingLexersym.Char_J,               // 074    0x4A
232
        Char_K,               // 075    0x4B
378
        OCLBacktrackingLexersym.Char_K,               // 075    0x4B
233
        Char_L,               // 076    0x4C
379
        OCLBacktrackingLexersym.Char_L,               // 076    0x4C
234
        Char_M,               // 077    0x4D
380
        OCLBacktrackingLexersym.Char_M,               // 077    0x4D
235
        Char_N,               // 078    0x4E
381
        OCLBacktrackingLexersym.Char_N,               // 078    0x4E
236
        Char_O,               // 079    0x4F
382
        OCLBacktrackingLexersym.Char_O,               // 079    0x4F
237
        Char_P,               // 080    0x50
383
        OCLBacktrackingLexersym.Char_P,               // 080    0x50
238
        Char_Q,               // 081    0x51
384
        OCLBacktrackingLexersym.Char_Q,               // 081    0x51
239
        Char_R,               // 082    0x52
385
        OCLBacktrackingLexersym.Char_R,               // 082    0x52
240
        Char_S,               // 083    0x53
386
        OCLBacktrackingLexersym.Char_S,               // 083    0x53
241
        Char_T,               // 084    0x54
387
        OCLBacktrackingLexersym.Char_T,               // 084    0x54
242
        Char_U,               // 085    0x55
388
        OCLBacktrackingLexersym.Char_U,               // 085    0x55
243
        Char_V,               // 086    0x56
389
        OCLBacktrackingLexersym.Char_V,               // 086    0x56
244
        Char_W,               // 087    0x57
390
        OCLBacktrackingLexersym.Char_W,               // 087    0x57
245
        Char_X,               // 088    0x58
391
        OCLBacktrackingLexersym.Char_X,               // 088    0x58
246
        Char_Y,               // 089    0x59
392
        OCLBacktrackingLexersym.Char_Y,               // 089    0x59
247
        Char_Z,               // 090    0x5A
393
        OCLBacktrackingLexersym.Char_Z,               // 090    0x5A
248
        Char_LeftBracket,     // 091    0x5B
394
        OCLBacktrackingLexersym.Char_LeftBracket,     // 091    0x5B
249
        Char_BackSlash,       // 092    0x5C
395
        OCLBacktrackingLexersym.Char_BackSlash,       // 092    0x5C
250
        Char_RightBracket,    // 093    0x5D
396
        OCLBacktrackingLexersym.Char_RightBracket,    // 093    0x5D
251
        Char_Caret,           // 094    0x5E
397
        OCLBacktrackingLexersym.Char_Caret,           // 094    0x5E
252
        Char__,               // 095    0x5F
398
        OCLBacktrackingLexersym.Char__,               // 095    0x5F
253
        Char_BackQuote,       // 096    0x60
399
        OCLBacktrackingLexersym.Char_BackQuote,       // 096    0x60
254
        Char_a,               // 097    0x61
400
        OCLBacktrackingLexersym.Char_a,               // 097    0x61
255
        Char_b,               // 098    0x62
401
        OCLBacktrackingLexersym.Char_b,               // 098    0x62
256
        Char_c,               // 099    0x63
402
        OCLBacktrackingLexersym.Char_c,               // 099    0x63
257
        Char_d,               // 100    0x64
403
        OCLBacktrackingLexersym.Char_d,               // 100    0x64
258
        Char_e,               // 101    0x65
404
        OCLBacktrackingLexersym.Char_e,               // 101    0x65
259
        Char_f,               // 102    0x66
405
        OCLBacktrackingLexersym.Char_f,               // 102    0x66
260
        Char_g,               // 103    0x67
406
        OCLBacktrackingLexersym.Char_g,               // 103    0x67
261
        Char_h,               // 104    0x68
407
        OCLBacktrackingLexersym.Char_h,               // 104    0x68
262
        Char_i,               // 105    0x69
408
        OCLBacktrackingLexersym.Char_i,               // 105    0x69
263
        Char_j,               // 106    0x6A
409
        OCLBacktrackingLexersym.Char_j,               // 106    0x6A
264
        Char_k,               // 107    0x6B
410
        OCLBacktrackingLexersym.Char_k,               // 107    0x6B
265
        Char_l,               // 108    0x6C
411
        OCLBacktrackingLexersym.Char_l,               // 108    0x6C
266
        Char_m,               // 109    0x6D
412
        OCLBacktrackingLexersym.Char_m,               // 109    0x6D
267
        Char_n,               // 110    0x6E
413
        OCLBacktrackingLexersym.Char_n,               // 110    0x6E
268
        Char_o,               // 111    0x6F
414
        OCLBacktrackingLexersym.Char_o,               // 111    0x6F
269
        Char_p,               // 112    0x70
415
        OCLBacktrackingLexersym.Char_p,               // 112    0x70
270
        Char_q,               // 113    0x71
416
        OCLBacktrackingLexersym.Char_q,               // 113    0x71
271
        Char_r,               // 114    0x72
417
        OCLBacktrackingLexersym.Char_r,               // 114    0x72
272
        Char_s,               // 115    0x73
418
        OCLBacktrackingLexersym.Char_s,               // 115    0x73
273
        Char_t,               // 116    0x74
419
        OCLBacktrackingLexersym.Char_t,               // 116    0x74
274
        Char_u,               // 117    0x75
420
        OCLBacktrackingLexersym.Char_u,               // 117    0x75
275
        Char_v,               // 118    0x76
421
        OCLBacktrackingLexersym.Char_v,               // 118    0x76
276
        Char_w,               // 119    0x77
422
        OCLBacktrackingLexersym.Char_w,               // 119    0x77
277
        Char_x,               // 120    0x78
423
        OCLBacktrackingLexersym.Char_x,               // 120    0x78
278
        Char_y,               // 121    0x79
424
        OCLBacktrackingLexersym.Char_y,               // 121    0x79
279
        Char_z,               // 122    0x7A
425
        OCLBacktrackingLexersym.Char_z,               // 122    0x7A
280
        Char_LeftBrace,       // 123    0x7B
426
        OCLBacktrackingLexersym.Char_LeftBrace,       // 123    0x7B
281
        Char_VerticalBar,     // 124    0x7C
427
        OCLBacktrackingLexersym.Char_VerticalBar,     // 124    0x7C
282
        Char_RightBrace,      // 125    0x7D
428
        OCLBacktrackingLexersym.Char_RightBrace,      // 125    0x7D
283
        Char_Tilde,           // 126    0x7E
429
        OCLBacktrackingLexersym.Char_Tilde,           // 126    0x7E
284
        Char_CtlCharNotWS,    // 127    0x7F
430
        OCLBacktrackingLexersym.Char_CtlCharNotWS,    // 127    0x7F
285
431
286
        Char_Acute,           // for the acute accent 0xb4
432
        OCLBacktrackingLexersym.Char_Acute,           // for the acute accent 0xb4
287
        Char_AfterASCIINotAcute,  // for all chars in range 0x80..0xfffe excluding the acute accent
433
        OCLBacktrackingLexersym.Char_AfterASCIINotAcute,      // for all chars in range 0x80..0xfffe excluding the acute accent
288
        Char_EOF              // for '\uffff' or 65535 
434
        OCLBacktrackingLexersym.Char_EOF              // for '\uffff' or 65535 
289
    };
435
    };
290
            
436
            
291
    @Override public final int getKind(int i)  // Classify character at ith location
437
    public final int getKind(int i)  // Classify character at ith location
292
    {
438
    {
293
        char c = (i >= getStreamLength() ? '\uffff' : getCharValue(i));
439
        char c = (i >= getStreamLength() ? '\uffff' : getCharValue(i));
294
        return (c < 128)? // ASCII Character
440
        return (c < 128) // ASCII Character
295
                  tokenKind[c] :
441
                  ? tokenKind[c] 
296
                  (c == '\uffff')?
442
                  : (c == '\uffff')
297
                       Char_EOF :
443
                      ?OCLBacktrackingLexersym.Char_EOF
298
                       (c == '\u00b4')?
444
                      : (c == '\u00b4')
299
                       Char_Acute :
445
                            ? OCLBacktrackingLexersym.Char_EOF
300
                           Char_AfterASCIINotAcute;
446
                            : OCLBacktrackingLexersym.Char_AfterASCIINotAcute;
447
    }
448
449
    public String[] orderedExportedSymbols() { return OCLBacktrackingParsersym.orderedTerminalSymbols; }
450
451
    public OCLBacktrackingLexerStream(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, String filename, int tab) throws java.io.IOException
452
    {
453
        super(OCLUtil.getAdapter(environment, BasicEnvironment.class), filename, tab);
454
    }
455
456
    public OCLBacktrackingLexerStream(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, char[] input_chars, String filename, int tab)
457
    {
458
        super(OCLUtil.getAdapter(environment, BasicEnvironment.class), input_chars, filename, tab);
459
    }
460
461
    public OCLBacktrackingLexerStream(Environment<?,?,?,?,?,?,?,?,?,?,?,?> environment, char[] input_chars, String filename)
462
    {
463
        super(OCLUtil.getAdapter(environment, BasicEnvironment.class), input_chars, filename, 1);
464
    }
301
    }
465
    }
302
466
303
    public void ruleAction( int ruleNumber)
467
    public void ruleAction(int ruleNumber)
304
    {
468
    {
305
        switch(ruleNumber)
469
        switch(ruleNumber)
306
        {
470
        {
307
 
471
308
            //
472
            //
309
            // Rule 1:  Token ::= Identifier
473
            // Rule 1:  Token ::= Identifier
310
            //
474
            //
311
            case 1: { 
475
            case 1: { 
312
				checkForKeyWord();
476
				checkForKeyWord();
313
	            break;
477
	              break;
314
            }
478
            }
315
	 
479
	
316
            //
480
            //
317
            // Rule 2:  Token ::= EscapedSQ
481
            // Rule 2:  Token ::= EscapedSQ
318
            //
482
            //
319
            case 2: { 
483
            case 2: { 
320
				makeToken(TK_STRING_LITERAL);
484
				makeToken(OCLBacktrackingParsersym.TK_STRING_LITERAL);
321
	            break;
485
	              break;
322
            }
486
            }
323
	 
487
	
324
            //
488
            //
325
            // Rule 3:  Token ::= SingleQuote SLNotSQ SingleQuote
489
            // Rule 3:  Token ::= SingleQuote SLNotSQ SingleQuote
326
            //
490
            //
327
            case 3: { 
491
            case 3: { 
328
				makeToken(TK_STRING_LITERAL);
492
				makeToken(OCLBacktrackingParsersym.TK_STRING_LITERAL);
329
	            break;
493
	              break;
330
            }
494
            }
331
	 
495
	
332
            //
496
            //
333
            // Rule 4:  Token ::= Acute SLNotSQOpt Acute
497
            // Rule 4:  Token ::= Acute SLNotSQOpt Acute
334
            //
498
            //
335
            case 4: { 
499
            case 4: { 
336
				makeToken(TK_STRING_LITERAL);
500
				makeToken(OCLBacktrackingParsersym.TK_STRING_LITERAL);
337
	            break;
501
	              break;
338
            }
502
            }
339
	 
503
	
340
            //
504
            //
341
            // Rule 5:  Token ::= BackQuote SLNotSQOpt Acute
505
            // Rule 5:  Token ::= BackQuote SLNotSQOpt Acute
342
            //
506
            //
343
            case 5: { 
507
            case 5: { 
344
				makeToken(TK_STRING_LITERAL);
508
				makeToken(OCLBacktrackingParsersym.TK_STRING_LITERAL);
345
	            break;
509
	              break;
346
            }
510
            }
347
	 
511
	
348
            //
512
            //
349
            // Rule 6:  Token ::= IntegerLiteral
513
            // Rule 6:  Token ::= IntegerLiteral
350
            //
514
            //
351
            case 6: { 
515
            case 6: { 
352
				makeToken(TK_INTEGER_LITERAL);
516
				makeToken(OCLBacktrackingParsersym.TK_INTEGER_LITERAL);
353
	            break;
517
	              break;
354
            }
518
            }
355
	 
519
	
356
            //
520
            //
357
            // Rule 7:  Token ::= RealLiteral
521
            // Rule 7:  Token ::= RealLiteral
358
            //
522
            //
359
            case 7: { 
523
            case 7: { 
360
				makeToken(TK_REAL_LITERAL);
524
				makeToken(OCLBacktrackingParsersym.TK_REAL_LITERAL);
361
	            break;
525
	              break;
362
            }
526
            }
363
	 
527
	
364
            //
528
            //
365
            // Rule 8:  Token ::= NumericOperation
529
            // Rule 8:  Token ::= NumericOperation
366
            //
530
            //
367
            case 8: { 
531
            case 8: { 
368
				makeToken(TK_NUMERIC_OPERATION);
532
				makeToken(OCLBacktrackingParsersym.TK_NUMERIC_OPERATION);
369
	            break;
533
	              break;
370
            }
534
            }
371
	 
535
	
372
            //
536
            //
373
            // Rule 9:  Token ::= IntegerRangeStart
537
            // Rule 9:  Token ::= IntegerRangeStart
374
            //
538
            //
375
            case 9: { 
539
            case 9: { 
376
				makeToken(TK_INTEGER_RANGE_START);
540
				makeToken(OCLBacktrackingParsersym.TK_INTEGER_RANGE_START);
377
	            break;
541
	              break;
378
            }
542
            }
379
	 
543
	
380
            //
544
            //
381
            // Rule 10:  Token ::= SLC
545
            // Rule 10:  Token ::= SLC
382
            //
546
            //
383
            case 10: { 
547
            case 10: { 
384
				makeComment(TK_SINGLE_LINE_COMMENT);
548
				makeComment(OCLBacktrackingParsersym.TK_SINGLE_LINE_COMMENT);
385
	            break;
549
	              break;
386
            }
550
            }
387
	 
551
	
388
            //
552
            //
389
            // Rule 11:  Token ::= / * Inside Stars /
553
            // Rule 11:  Token ::= / * Inside Stars /
390
            //
554
            //
391
            case 11: { 
555
            case 11: { 
392
                makeComment(TK_MULTI_LINE_COMMENT);
556
                makeComment(OCLBacktrackingParsersym.TK_MULTI_LINE_COMMENT);
393
                break;
557
                  break;
394
            }
558
            }
395
     
559
    
396
            //
560
            //
397
            // Rule 12:  Token ::= WS
561
            // Rule 12:  Token ::= WS
398
            //
562
            //
399
            case 12: { 
563
            case 12: { 
400
				skipToken();
564
				skipToken();
401
	            break;
565
	              break;
402
            }
566
            }
403
	 
567
	
404
            //
568
            //
405
            // Rule 13:  Token ::= +
569
            // Rule 13:  Token ::= +
406
            //
570
            //
407
            case 13: { 
571
            case 13: { 
408
				makeToken(TK_PLUS);
572
				makeToken(OCLBacktrackingParsersym.TK_PLUS);
409
	            break;
573
	              break;
410
            }
574
            }
411
	 
575
	
412
            //
576
            //
413
            // Rule 14:  Token ::= -
577
            // Rule 14:  Token ::= -
414
            //
578
            //
415
            case 14: { 
579
            case 14: { 
416
				makeToken(TK_MINUS);
580
				makeToken(OCLBacktrackingParsersym.TK_MINUS);
417
	            break;
581
	              break;
418
            }
582
            }
419
	 
583
	
420
            //
584
            //
421
            // Rule 15:  Token ::= *
585
            // Rule 15:  Token ::= *
422
            //
586
            //
423
            case 15: { 
587
            case 15: { 
424
				makeToken(TK_MULTIPLY);
588
				makeToken(OCLBacktrackingParsersym.TK_MULTIPLY);
425
	            break;
589
	              break;
426
            }
590
            }
427
	 
591
	
428
            //
592
            //
429
            // Rule 16:  Token ::= /
593
            // Rule 16:  Token ::= /
430
            //
594
            //
431
            case 16: { 
595
            case 16: { 
432
				makeToken(TK_DIVIDE);
596
				makeToken(OCLBacktrackingParsersym.TK_DIVIDE);
433
	            break;
597
	              break;
434
            }
598
            }
435
	 
599
	
436
            //
600
            //
437
            // Rule 17:  Token ::= (
601
            // Rule 17:  Token ::= (
438
            //
602
            //
439
            case 17: { 
603
            case 17: { 
440
				makeToken(TK_LPAREN);
604
				makeToken(OCLBacktrackingParsersym.TK_LPAREN);
441
	            break;
605
	              break;
442
            }
606
            }
443
	 
607
	
444
            //
608
            //
445
            // Rule 18:  Token ::= )
609
            // Rule 18:  Token ::= )
446
            //
610
            //
447
            case 18: { 
611
            case 18: { 
448
				makeToken(TK_RPAREN);
612
				makeToken(OCLBacktrackingParsersym.TK_RPAREN);
449
	            break;
613
	              break;
450
            }
614
            }
451
	 
615
	
452
            //
616
            //
453
            // Rule 19:  Token ::= >
617
            // Rule 19:  Token ::= >
454
            //
618
            //
455
            case 19: { 
619
            case 19: { 
456
				makeToken(TK_GREATER);
620
				makeToken(OCLBacktrackingParsersym.TK_GREATER);
457
	            break;
621
	              break;
458
            }
622
            }
459
	 
623
	
460
            //
624
            //
461
            // Rule 20:  Token ::= <
625
            // Rule 20:  Token ::= <
462
            //
626
            //
463
            case 20: { 
627
            case 20: { 
464
				makeToken(TK_LESS);
628
				makeToken(OCLBacktrackingParsersym.TK_LESS);
465
	            break;
629
	              break;
466
            }
630
            }
467
	 
631
	
468
            //
632
            //
469
            // Rule 21:  Token ::= =
633
            // Rule 21:  Token ::= =
470
            //
634
            //
471
            case 21: { 
635
            case 21: { 
472
				makeToken(TK_EQUAL);
636
				makeToken(OCLBacktrackingParsersym.TK_EQUAL);
473
	            break;
637
	              break;
474
            }
638
            }
475
	 
639
	
476
            //
640
            //
477
            // Rule 22:  Token ::= > =
641
            // Rule 22:  Token ::= > =
478
            //
642
            //
479
            case 22: { 
643
            case 22: { 
480
				makeToken(TK_GREATER_EQUAL);
644
				makeToken(OCLBacktrackingParsersym.TK_GREATER_EQUAL);
481
	            break;
645
	              break;
482
            }
646
            }
483
	 
647
	
484
            //
648
            //
485
            // Rule 23:  Token ::= < =
649
            // Rule 23:  Token ::= < =
486
            //
650
            //
487
            case 23: { 
651
            case 23: { 
488
				makeToken(TK_LESS_EQUAL);
652
				makeToken(OCLBacktrackingParsersym.TK_LESS_EQUAL);
489
	            break;
653
	              break;
490
            }
654
            }
491
	 
655
	
492
            //
656
            //
493
            // Rule 24:  Token ::= < >
657
            // Rule 24:  Token ::= < >
494
            //
658
            //
495
            case 24: { 
659
            case 24: { 
496
				makeToken(TK_NOT_EQUAL);
660
				makeToken(OCLBacktrackingParsersym.TK_NOT_EQUAL);
497
	            break;
661
	              break;
498
            }
662
            }
499
	 
663
	
500
            //
664
            //
501
            // Rule 25:  Token ::= [
665
            // Rule 25:  Token ::= [
502
            //
666
            //
503
            case 25: { 
667
            case 25: { 
504
				makeToken(TK_LBRACKET);
668
				makeToken(OCLBacktrackingParsersym.TK_LBRACKET);
505
	            break;
669
	              break;
506
            }
670
            }
507
	 
671
	
508
            //
672
            //
509
            // Rule 26:  Token ::= ]
673
            // Rule 26:  Token ::= ]
510
            //
674
            //
511
            case 26: { 
675
            case 26: { 
512
				makeToken(TK_RBRACKET);
676
				makeToken(OCLBacktrackingParsersym.TK_RBRACKET);
513
	            break;
677
	              break;
514
            }
678
            }
515
	 
679
	
516
            //
680
            //
517
            // Rule 27:  Token ::= {
681
            // Rule 27:  Token ::= {
518
            //
682
            //
519
            case 27: { 
683
            case 27: { 
520
				makeToken(TK_LBRACE);
684
				makeToken(OCLBacktrackingParsersym.TK_LBRACE);
521
	            break;
685
	              break;
522
            }
686
            }
523
	 
687
	
524
            //
688
            //
525
            // Rule 28:  Token ::= }
689
            // Rule 28:  Token ::= }
526
            //
690
            //
527
            case 28: { 
691
            case 28: { 
528
				makeToken(TK_RBRACE);
692
				makeToken(OCLBacktrackingParsersym.TK_RBRACE);
529
	            break;
693
	              break;
530
            }
694
            }
531
	 
695
	
532
            //
696
            //
533
            // Rule 29:  Token ::= - >
697
            // Rule 29:  Token ::= - >
534
            //
698
            //
535
            case 29: { 
699
            case 29: { 
536
				makeToken(TK_ARROW);
700
				makeToken(OCLBacktrackingParsersym.TK_ARROW);
537
	            break;
701
	              break;
538
            }
702
            }
539
	 
703
	
540
            //
704
            //
541
            // Rule 30:  Token ::= |
705
            // Rule 30:  Token ::= |
542
            //
706
            //
543
            case 30: { 
707
            case 30: { 
544
				makeToken(TK_BAR);
708
				makeToken(OCLBacktrackingParsersym.TK_BAR);
545
	            break;
709
	              break;
546
            }
710
            }
547
	 
711
	
548
            //
712
            //
549
            // Rule 31:  Token ::= ,
713
            // Rule 31:  Token ::= ,
550
            //
714
            //
551
            case 31: { 
715
            case 31: { 
552
				makeToken(TK_COMMA);
716
				makeToken(OCLBacktrackingParsersym.TK_COMMA);
553
	            break;
717
	              break;
554
            }
718
            }
555
	 
719
	
556
            //
720
            //
557
            // Rule 32:  Token ::= :
721
            // Rule 32:  Token ::= :
558
            //
722
            //
559
            case 32: { 
723
            case 32: { 
560
				makeToken(TK_COLON);
724
				makeToken(OCLBacktrackingParsersym.TK_COLON);
561
	            break;
725
	              break;
562
            }
726
            }
563
	 
727
	
564
            //
728
            //
565
            // Rule 33:  Token ::= : :
729
            // Rule 33:  Token ::= : :
566
            //
730
            //
567
            case 33: { 
731
            case 33: { 
568
				makeToken(TK_COLONCOLON);
732
				makeToken(OCLBacktrackingParsersym.TK_COLONCOLON);
569
	            break;
733
	              break;
570
            }
734
            }
571
	 
735
	
572
            //
736
            //
573
            // Rule 34:  Token ::= ;
737
            // Rule 34:  Token ::= ;
574
            //
738
            //
575
            case 34: { 
739
            case 34: { 
576
				makeToken(TK_SEMICOLON);
740
				makeToken(OCLBacktrackingParsersym.TK_SEMICOLON);
577
	            break;
741
	              break;
578
            }
742
            }
579
	 
743
	
580
            //
744
            //
581
            // Rule 35:  Token ::= .
745
            // Rule 35:  Token ::= .
582
            //
746
            //
583
            case 35: { 
747
            case 35: { 
584
				makeToken(TK_DOT);
748
				makeToken(OCLBacktrackingParsersym.TK_DOT);
585
	            break;
749
	              break;
586
            }
750
            }
587
	 
751
	
588
            //
752
            //
589
            // Rule 36:  Token ::= . .
753
            // Rule 36:  Token ::= . .
590
            //
754
            //
591
            case 36: { 
755
            case 36: { 
592
				makeToken(TK_DOTDOT);
756
				makeToken(OCLBacktrackingParsersym.TK_DOTDOT);
593
	            break;
757
	              break;
594
            }
758
            }
595
	 
759
	
596
            //
760
            //
597
            // Rule 37:  Token ::= @ p r e
761
            // Rule 37:  Token ::= @ p r e
598
            //
762
            //
599
            case 37: { 
763
            case 37: { 
600
				makeToken(TK_ATPRE);
764
				makeToken(OCLBacktrackingParsersym.TK_ATPRE);
601
	            break;
765
	              break;
602
            }
766
            }
603
	 
767
	
604
            //
768
            //
605
            // Rule 38:  Token ::= ^
769
            // Rule 38:  Token ::= ^
606
            //
770
            //
607
            case 38: { 
771
            case 38: { 
608
				makeToken(TK_CARET);
772
				makeToken(OCLBacktrackingParsersym.TK_CARET);
609
	            break;
773
	              break;
610
            }
774
            }
611
	 
775
	
612
            //
776
            //
613
            // Rule 39:  Token ::= ^ ^
777
            // Rule 39:  Token ::= ^ ^
614
            //
778
            //
615
            case 39: { 
779
            case 39: { 
616
				makeToken(TK_CARETCARET);
780
				makeToken(OCLBacktrackingParsersym.TK_CARETCARET);
617
	            break;
781
	              break;
618
            }
782
            }
619
	 
783
	
620
            //
784
            //
621
            // Rule 40:  Token ::= ?
785
            // Rule 40:  Token ::= ?
622
            //
786
            //
623
            case 40: { 
787
            case 40: { 
624
				makeToken(TK_QUESTIONMARK);
788
				makeToken(OCLBacktrackingParsersym.TK_QUESTIONMARK);
625
	            break;
789
	              break;
626
            }
790
            }
627
	
791
	
628
    
792
    
(-)src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingParserprs.java (-77 / +136 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., 
5
* Open Canarias S.L. and others.
5
* All rights reserved.   This program and the accompanying materials
6
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
7
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
8
* which accompanies this distribution, and is available at
Lines 14-36 Link Here
14
*   E.D.Willink - Bugs 225493, 243976, 259818
15
*   E.D.Willink - Bugs 225493, 243976, 259818
15
*   Zeligsoft - Bug 243976
16
*   Zeligsoft - Bug 243976
16
*   Borland - Bug 242880
17
*   Borland - Bug 242880
18
*   Adolfo Sanchez- Barbudo Herrera - LPG v 2.0.17 adoption
17
*
19
*
18
* </copyright>
20
* </copyright>
19
*
21
*
20
* $Id: OCLBacktrackingParserprs.java,v 1.2 2009/08/28 20:43:11 ewillink Exp $
22
* $Id: EssentialOCL.g,v 1.7 2009/03/05 14:12:14 cdamus Exp $
21
*/
23
*/
22
24
23
package org.eclipse.ocl.parser.backtracking;
25
package org.eclipse.ocl.parser.backtracking;
24
26
25
/**
27
public class OCLBacktrackingParserprs implements lpg.runtime.ParseTable, OCLBacktrackingParsersym {
26
 * The backtracking variant of the OCL parser parse table.
28
    public final static int ERROR_SYMBOL = 1;
27
 * 
29
    public final int getErrorSymbol() { return ERROR_SYMBOL; }
28
 * @noextend This class is not intended to be subclassed by clients.
30
29
 * 
31
    public final static int SCOPE_UBOUND = 58;
30
 * @since 1.3
32
    public final int getScopeUbound() { return SCOPE_UBOUND; }
31
 */
33
32
@SuppressWarnings("nls")
34
    public final static int SCOPE_SIZE = 59;
33
public class OCLBacktrackingParserprs implements lpg.lpgjavaruntime.ParseTable, OCLBacktrackingParsersym {
35
    public final int getScopeSize() { return SCOPE_SIZE; }
36
37
    public final static int MAX_NAME_LENGTH = 26;
38
    public final int getMaxNameLength() { return MAX_NAME_LENGTH; }
39
40
    public final static int NUM_STATES = 241;
41
    public final int getNumStates() { return NUM_STATES; }
42
43
    public final static int NT_OFFSET = 101;
44
    public final int getNtOffset() { return NT_OFFSET; }
45
46
    public final static int LA_STATE_OFFSET = 3795;
47
    public final int getLaStateOffset() { return LA_STATE_OFFSET; }
48
49
    public final static int MAX_LA = 2;
50
    public final int getMaxLa() { return MAX_LA; }
51
52
    public final static int NUM_RULES = 328;
53
    public final int getNumRules() { return NUM_RULES; }
54
55
    public final static int NUM_NONTERMINALS = 109;
56
    public final int getNumNonterminals() { return NUM_NONTERMINALS; }
57
58
    public final static int NUM_SYMBOLS = 210;
59
    public final int getNumSymbols() { return NUM_SYMBOLS; }
60
61
    public final static int SEGMENT_SIZE = 8192;
62
    public final int getSegmentSize() { return SEGMENT_SIZE; }
63
64
    public final static int START_STATE = 3223;
65
    public final int getStartState() { return START_STATE; }
66
67
    public final static int IDENTIFIER_SYMBOL = 4;
68
    public final int getIdentifier_SYMBOL() { return IDENTIFIER_SYMBOL; }
69
70
    public final static int EOFT_SYMBOL = 73;
71
    public final int getEoftSymbol() { return EOFT_SYMBOL; }
72
73
    public final static int EOLT_SYMBOL = 73;
74
    public final int getEoltSymbol() { return EOLT_SYMBOL; }
75
76
    public final static int ACCEPT_ACTION = 3466;
77
    public final int getAcceptAction() { return ACCEPT_ACTION; }
78
79
    public final static int ERROR_ACTION = 3467;
80
    public final int getErrorAction() { return ERROR_ACTION; }
81
82
    public final static boolean BACKTRACK = true;
83
    public final boolean getBacktrack() { return BACKTRACK; }
84
85
    public final int getStartSymbol() { return lhs(0); }
86
    public final boolean isValidForParser() { return OCLBacktrackingParsersym.isValidForParser; }
87
88
89
    public interface IsNullable {
90
        public final static byte isNullable[] = {0,
91
            0,0,0,0,0,0,0,0,0,0,
92
            0,0,0,0,0,0,0,0,0,0,
93
            0,0,0,0,0,0,0,0,0,0,
94
            0,0,0,0,0,0,0,0,0,0,
95
            0,0,0,0,0,0,0,0,0,0,
96
            0,0,0,0,0,0,0,0,0,0,
97
            0,0,0,0,0,0,0,0,0,0,
98
            0,0,0,0,0,0,0,0,0,0,
99
            0,0,0,0,0,0,0,0,0,0,
100
            0,0,0,0,0,0,0,0,0,0,
101
            0,0,0,0,0,0,0,0,0,0,
102
            0,0,0,0,0,0,0,0,0,0,
103
            0,0,0,0,0,0,0,0,0,0,
104
            0,0,0,0,0,0,0,0,0,0,
105
            0,0,0,0,0,0,0,0,0,0,
106
            0,1,0,0,1,0,0,0,0,1,
107
            0,0,0,0,0,0,0,0,0,0,
108
            1,1,0,1,0,0,0,0,0,0,
109
            1,1,0,0,0,0,1,1,0,0,
110
            0,0,0,0,1,0,0,0,0,0,
111
            1,0,0,1,0,0,0,0,0,0
112
        };
113
    };
114
    public final static byte isNullable[] = IsNullable.isNullable;
115
    public final boolean isNullable(int index) { return isNullable[index] != 0; }
116
117
    public interface ProsthesesIndex {
118
        public final static byte prosthesesIndex[] = {0,
119
            54,9,21,108,62,5,6,7,10,3,
120
            8,15,50,51,11,40,42,44,48,49,
121
            56,57,58,59,60,61,67,68,69,70,
122
            71,41,43,38,39,34,35,36,37,32,
123
            33,30,31,28,29,25,26,27,77,23,
124
            52,53,105,47,109,78,80,81,24,107,
125
            97,98,99,100,88,91,92,4,12,19,
126
            20,22,55,65,66,73,79,83,84,85,
127
            86,87,93,94,96,101,2,13,14,17,
128
            18,45,46,63,64,72,74,75,76,82,
129
            89,90,95,102,103,104,106,1,16
130
        };
131
    };
132
    public final static byte prosthesesIndex[] = ProsthesesIndex.prosthesesIndex;
133
    public final int prosthesesIndex(int index) { return prosthesesIndex[index]; }
34
134
35
    public interface IsKeyword {
135
    public interface IsKeyword {
36
        public final static byte isKeyword[] = {0,
136
        public final static byte isKeyword[] = {0,
Lines 1545-1577 Link Here
1545
1645
1546
    public interface ScopeRhs {
1646
    public interface ScopeRhs {
1547
        public final static char scopeRhs[] = {0,
1647
        public final static char scopeRhs[] = {0,
1548
            153,94,116,0,102,0,153,94,103,0,
1648
            153,94,116,0,1,0,153,94,103,0,
1549
            147,2,0,147,69,0,147,90,147,69,
1649
            147,2,0,147,69,0,147,90,147,69,
1550
            0,43,118,102,0,147,91,147,90,147,
1650
            0,90,147,1,0,147,91,147,90,147,
1551
            69,0,44,118,102,0,43,118,44,118,
1651
            69,0,91,147,1,0,90,147,91,147,
1552
            102,0,155,2,161,112,0,12,0,155,
1652
            1,0,155,2,161,112,0,3,0,155,
1553
            2,161,110,0,155,2,161,170,0,155,
1653
            2,161,110,0,155,2,161,170,0,155,
1554
            2,156,80,104,0,157,2,106,0,182,
1654
            2,156,80,104,0,157,2,106,0,182,
1555
            2,103,89,0,182,2,103,88,0,45,
1655
            2,103,89,0,182,2,103,88,0,84,
1556
            0,44,118,45,0,43,118,44,118,45,
1656
            0,91,147,84,0,90,147,91,147,84,
1557
            0,179,68,0,52,118,0,16,0,0,
1657
            0,179,68,0,83,147,0,79,152,0,
1558
            155,2,152,110,0,155,2,152,112,0,
1658
            155,2,152,110,0,155,2,152,112,0,
1559
            155,2,152,170,0,201,2,52,0,157,
1659
            155,2,152,170,0,201,2,52,0,157,
1560
            37,4,0,7,118,0,147,70,151,81,
1660
            37,4,0,5,147,0,147,70,151,81,
1561
            151,2,189,0,151,81,151,2,189,0,
1661
            151,2,189,0,151,81,151,2,189,0,
1562
            18,118,12,0,151,2,189,0,22,117,
1662
            70,147,3,0,151,2,189,0,81,151,
1563
            18,118,12,0,147,70,151,2,189,0,
1663
            70,147,3,0,147,70,151,2,189,0,
1564
            147,70,151,31,151,2,190,0,151,31,
1664
            147,70,151,31,151,2,190,0,151,31,
1565
            151,2,190,0,151,2,190,0,19,117,
1665
            151,2,190,0,151,2,190,0,31,151,
1566
            18,118,12,0,147,70,151,2,190,0,
1666
            70,147,3,0,147,70,151,2,190,0,
1567
            147,2,190,0,197,93,52,0,14,0,
1667
            147,2,190,0,197,93,52,0,74,0,
1568
            195,93,106,0,155,2,103,80,104,0,
1668
            195,93,106,0,155,2,103,80,104,0,
1569
            155,2,61,0,135,0,4,132,0,3,
1669
            155,2,61,0,135,0,9,133,0,8,
1570
            132,0,139,0,2,130,0,1,130,0,
1670
            133,0,139,0,29,136,0,28,136,0,
1571
            141,0,9,127,0,8,127,0,6,127,
1671
            141,0,13,138,0,12,138,0,11,138,
1572
            0,5,127,0,143,0,10,125,0,7,
1672
            0,10,138,0,143,0,7,142,0,5,
1573
            125,0,145,0,48,123,0,47,123,0,
1673
            142,0,145,0,27,144,0,26,144,0,
1574
            46,123,0
1674
            25,144,0
1575
        };
1675
        };
1576
    };
1676
    };
1577
    public final static char scopeRhs[] = ScopeRhs.scopeRhs;
1677
    public final static char scopeRhs[] = ScopeRhs.scopeRhs;
Lines 1797-1849 Link Here
1797
    public final static String name[] = Name.name;
1897
    public final static String name[] = Name.name;
1798
    public final String name(int index) { return name[index]; }
1898
    public final String name(int index) { return name[index]; }
1799
1899
1800
    public final static int
1801
           ERROR_SYMBOL      = 1,
1802
           SCOPE_UBOUND      = 58,
1803
           SCOPE_SIZE        = 59,
1804
           MAX_NAME_LENGTH   = 26;
1805
1806
    public final int getErrorSymbol() { return ERROR_SYMBOL; }
1807
    public final int getScopeUbound() { return SCOPE_UBOUND; }
1808
    public final int getScopeSize() { return SCOPE_SIZE; }
1809
    public final int getMaxNameLength() { return MAX_NAME_LENGTH; }
1810
1811
    public final static int
1812
           NUM_STATES        = 241,
1813
           NT_OFFSET         = 101,
1814
           LA_STATE_OFFSET   = 3795,
1815
           MAX_LA            = 2,
1816
           NUM_RULES         = 328,
1817
           NUM_NONTERMINALS  = 109,
1818
           NUM_SYMBOLS       = 210,
1819
           SEGMENT_SIZE      = 8192,
1820
           START_STATE       = 3223,
1821
           IDENTIFIER_SYMBOL = 4,
1822
           EOFT_SYMBOL       = 73,
1823
           EOLT_SYMBOL       = 73,
1824
           ACCEPT_ACTION     = 3466,
1825
           ERROR_ACTION      = 3467;
1826
1827
    public final static boolean BACKTRACK = true;
1828
1829
    public final int getNumStates() { return NUM_STATES; }
1830
    public final int getNtOffset() { return NT_OFFSET; }
1831
    public final int getLaStateOffset() { return LA_STATE_OFFSET; }
1832
    public final int getMaxLa() { return MAX_LA; }
1833
    public final int getNumRules() { return NUM_RULES; }
1834
    public final int getNumNonterminals() { return NUM_NONTERMINALS; }
1835
    public final int getNumSymbols() { return NUM_SYMBOLS; }
1836
    public final int getSegmentSize() { return SEGMENT_SIZE; }
1837
    public final int getStartState() { return START_STATE; }
1838
    public final int getStartSymbol() { return lhs[0]; }
1839
    public final int getIdentifierSymbol() { return IDENTIFIER_SYMBOL; }
1840
    public final int getEoftSymbol() { return EOFT_SYMBOL; }
1841
    public final int getEoltSymbol() { return EOLT_SYMBOL; }
1842
    public final int getAcceptAction() { return ACCEPT_ACTION; }
1843
    public final int getErrorAction() { return ERROR_ACTION; }
1844
    public final boolean isValidForParser() { return isValidForParser; }
1845
    public final boolean getBacktrack() { return BACKTRACK; }
1846
1847
    public final int originalState(int state) {
1900
    public final int originalState(int state) {
1848
        return -baseCheck[state];
1901
        return -baseCheck[state];
1849
    }
1902
    }
Lines 1857-1866 Link Here
1857
        return inSymb[originalState(state)];
1910
        return inSymb[originalState(state)];
1858
    }
1911
    }
1859
1912
1913
    /**
1914
     * assert(! goto_default);
1915
     */
1860
    public final int ntAction(int state, int sym) {
1916
    public final int ntAction(int state, int sym) {
1861
        return baseAction[state + sym];
1917
        return baseAction[state + sym];
1862
    }
1918
    }
1863
1919
1920
    /**
1921
     * assert(! shift_default);
1922
     */
1864
    public final int tAction(int state, int sym) {
1923
    public final int tAction(int state, int sym) {
1865
        int i = baseAction[state],
1924
        int i = baseAction[state],
1866
            k = i + sym;
1925
            k = i + sym;
(-)src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingKWLexersym.java (-26 / +23 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2007 IBM Corporation and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc, Open Canarias S.L., and others.
5
* All rights reserved.   This program and the accompanying materials
5
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
6
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
7
* which accompanies this distribution, and is available at
Lines 10-35 Link Here
10
* Contributors:
10
* Contributors:
11
*   IBM - Initial API and implementation
11
*   IBM - Initial API and implementation
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
13
*   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
13
*
14
*
14
* </copyright>
15
* </copyright>
15
*
16
*
16
* $Id: OCLBacktrackingKWLexersym.java,v 1.2 2009/08/28 20:43:11 ewillink Exp $
17
* 
17
*/
18
*/
18
19
19
package org.eclipse.ocl.parser.backtracking;
20
package org.eclipse.ocl.parser.backtracking;
20
21
21
/**
22
 * The backtracking variant of the OCL keyword lexer symbol table.
23
 * 
24
 * @noimplement This interface is not intended to be implemented by clients.
25
 * @noextend This interface is not intended to be extended by clients.
26
 * 
27
 * @since 1.3
28
 */
29
@SuppressWarnings("nls")
30
public interface OCLBacktrackingKWLexersym {
22
public interface OCLBacktrackingKWLexersym {
31
    public final static int
23
    public final static int
32
      Char_DollarSign = 40,
24
      Char_DollarSign = 40,
25
      Char_Percent = 41,
26
      Char__ = 42,
33
      Char_a = 5,
27
      Char_a = 5,
34
      Char_b = 30,
28
      Char_b = 30,
35
      Char_c = 11,
29
      Char_c = 11,
Lines 55-90 Link Here
55
      Char_w = 33,
49
      Char_w = 33,
56
      Char_x = 19,
50
      Char_x = 19,
57
      Char_y = 16,
51
      Char_y = 16,
58
      Char_z = 41,
52
      Char_z = 43,
59
      Char_A = 20,
53
      Char_A = 20,
60
      Char_B = 29,
54
      Char_B = 29,
61
      Char_C = 34,
55
      Char_C = 34,
62
      Char_D = 42,
56
      Char_D = 44,
63
      Char_E = 43,
57
      Char_E = 45,
64
      Char_F = 44,
58
      Char_F = 46,
65
      Char_G = 45,
59
      Char_G = 47,
66
      Char_H = 46,
60
      Char_H = 48,
67
      Char_I = 18,
61
      Char_I = 18,
68
      Char_J = 47,
62
      Char_J = 49,
69
      Char_K = 35,
63
      Char_K = 35,
70
      Char_L = 48,
64
      Char_L = 50,
71
      Char_M = 36,
65
      Char_M = 36,
72
      Char_N = 21,
66
      Char_N = 21,
73
      Char_O = 22,
67
      Char_O = 22,
74
      Char_P = 49,
68
      Char_P = 51,
75
      Char_Q = 50,
69
      Char_Q = 52,
76
      Char_R = 37,
70
      Char_R = 37,
77
      Char_S = 23,
71
      Char_S = 23,
78
      Char_T = 24,
72
      Char_T = 24,
79
      Char_U = 25,
73
      Char_U = 25,
80
      Char_V = 38,
74
      Char_V = 38,
81
      Char_W = 51,
75
      Char_W = 53,
82
      Char_X = 52,
76
      Char_X = 54,
83
      Char_Y = 53,
77
      Char_Y = 55,
84
      Char_Z = 54,
78
      Char_Z = 56,
85
      Char_EOF = 39;
79
      Char_EOF = 39;
86
80
87
      public final static String orderedTerminalSymbols[] = {
81
    public final static String orderedTerminalSymbols[] = {
88
                 "",
82
                 "",
89
                 "e",
83
                 "e",
90
                 "t",
84
                 "t",
Lines 126-131 Link Here
126
                 "V",
120
                 "V",
127
                 "EOF",
121
                 "EOF",
128
                 "DollarSign",
122
                 "DollarSign",
123
                 "Percent",
124
                 "_",
129
                 "z",
125
                 "z",
130
                 "D",
126
                 "D",
131
                 "E",
127
                 "E",
Lines 142-146 Link Here
142
                 "Z"
138
                 "Z"
143
             };
139
             };
144
140
141
    public final static int numTokenKinds = orderedTerminalSymbols.length;
145
    public final static boolean isValidForParser = true;
142
    public final static boolean isValidForParser = true;
146
}
143
}
(-)src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingLexersym.java (-12 / +6 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2009 IBM Corporation, Borland Software Corp.,  and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Borland Software Corp., Open Canarias S.L. and others.
5
* All rights reserved.   This program and the accompanying materials
5
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
6
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
7
* which accompanies this distribution, and is available at
Lines 10-33 Link Here
10
* Contributors:
10
* Contributors:
11
*   IBM - Initial API and implementation
11
*   IBM - Initial API and implementation
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
13
*               - Bug 259818
13
*   Borland - Bug 242880
14
*   Borland - Bug 242880
15
*   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
14
*
16
*
15
* </copyright>
17
* </copyright>
16
*
18
*
17
* $Id: OCLBacktrackingLexersym.java,v 1.2 2009/08/28 20:43:11 ewillink Exp $
19
* $Id$
18
*/
20
*/
19
21
20
package org.eclipse.ocl.parser.backtracking;
22
package org.eclipse.ocl.parser.backtracking;
21
23
22
/**
23
 * The backtracking variant of the OCL lexer symbol table.
24
 * 
25
 * @noimplement This interface is not intended to be implemented by clients.
26
 * @noextend This interface is not intended to be extended by clients.
27
 * 
28
 * @since 1.3
29
 */
30
@SuppressWarnings("nls")
31
public interface OCLBacktrackingLexersym {
24
public interface OCLBacktrackingLexersym {
32
    public final static int
25
    public final static int
33
      Char_CtlCharNotWS = 103,
26
      Char_CtlCharNotWS = 103,
Lines 134-140 Link Here
134
      Char_Equal = 15,
127
      Char_Equal = 15,
135
      Char_EOF = 99;
128
      Char_EOF = 99;
136
129
137
      public final static String orderedTerminalSymbols[] = {
130
    public final static String orderedTerminalSymbols[] = {
138
                 "",
131
                 "",
139
                 "0",
132
                 "0",
140
                 "1",
133
                 "1",
Lines 241-245 Link Here
241
                 "CtlCharNotWS"
234
                 "CtlCharNotWS"
242
             };
235
             };
243
236
237
    public final static int numTokenKinds = orderedTerminalSymbols.length;
244
    public final static boolean isValidForParser = true;
238
    public final static boolean isValidForParser = true;
245
}
239
}
(-)src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingKWLexerprs.java (-46 / +93 lines)
Lines 1-7 Link Here
1
/**
1
/**
2
* <copyright>
2
* <copyright>
3
*
3
*
4
* Copyright (c) 2005, 2007 IBM Corporation and others.
4
* Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc, Open Canarias S.L., and others.
5
* All rights reserved.   This program and the accompanying materials
5
* All rights reserved.   This program and the accompanying materials
6
* are made available under the terms of the Eclipse Public License v1.0
6
* are made available under the terms of the Eclipse Public License v1.0
7
* which accompanies this distribution, and is available at
7
* which accompanies this distribution, and is available at
Lines 10-24 Link Here
10
* Contributors:
10
* Contributors:
11
*   IBM - Initial API and implementation
11
*   IBM - Initial API and implementation
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
12
*   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
13
*   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
13
*
14
*
14
* </copyright>
15
* </copyright>
15
*
16
*
16
* $Id: OCLBacktrackingKWLexerprs.java,v 1.2 2009/08/28 20:43:11 ewillink Exp $
17
* 
17
*/
18
*/
18
19
19
package org.eclipse.ocl.parser.backtracking;
20
package org.eclipse.ocl.parser.backtracking;
20
21
21
public class OCLBacktrackingKWLexerprs implements lpg.lpgjavaruntime.ParseTable, OCLBacktrackingKWLexersym {
22
public class OCLBacktrackingKWLexerprs implements lpg.runtime.ParseTable, OCLBacktrackingKWLexersym {
23
    public final static int ERROR_SYMBOL = 0;
24
    public final int getErrorSymbol() { return ERROR_SYMBOL; }
25
26
    public final static int SCOPE_UBOUND = 0;
27
    public final int getScopeUbound() { return SCOPE_UBOUND; }
28
29
    public final static int SCOPE_SIZE = 0;
30
    public final int getScopeSize() { return SCOPE_SIZE; }
31
32
    public final static int MAX_NAME_LENGTH = 0;
33
    public final int getMaxNameLength() { return MAX_NAME_LENGTH; }
34
35
    public final static int NUM_STATES = 256;
36
    public final int getNumStates() { return NUM_STATES; }
37
38
    public final static int NT_OFFSET = 56;
39
    public final int getNtOffset() { return NT_OFFSET; }
40
41
    public final static int LA_STATE_OFFSET = 386;
42
    public final int getLaStateOffset() { return LA_STATE_OFFSET; }
43
44
    public final static int MAX_LA = 1;
45
    public final int getMaxLa() { return MAX_LA; }
46
47
    public final static int NUM_RULES = 63;
48
    public final int getNumRules() { return NUM_RULES; }
49
50
    public final static int NUM_NONTERMINALS = 2;
51
    public final int getNumNonterminals() { return NUM_NONTERMINALS; }
52
53
    public final static int NUM_SYMBOLS = 58;
54
    public final int getNumSymbols() { return NUM_SYMBOLS; }
55
56
    public final static int SEGMENT_SIZE = 8192;
57
    public final int getSegmentSize() { return SEGMENT_SIZE; }
58
59
    public final static int START_STATE = 64;
60
    public final int getStartState() { return START_STATE; }
61
62
    public final static int IDENTIFIER_SYMBOL = 0;
63
    public final int getIdentifier_SYMBOL() { return IDENTIFIER_SYMBOL; }
64
65
    public final static int EOFT_SYMBOL = 39;
66
    public final int getEoftSymbol() { return EOFT_SYMBOL; }
67
68
    public final static int EOLT_SYMBOL = 57;
69
    public final int getEoltSymbol() { return EOLT_SYMBOL; }
70
71
    public final static int ACCEPT_ACTION = 322;
72
    public final int getAcceptAction() { return ACCEPT_ACTION; }
73
74
    public final static int ERROR_ACTION = 323;
75
    public final int getErrorAction() { return ERROR_ACTION; }
76
77
    public final static boolean BACKTRACK = false;
78
    public final boolean getBacktrack() { return BACKTRACK; }
79
80
    public final int getStartSymbol() { return lhs(0); }
81
    public final boolean isValidForParser() { return OCLBacktrackingKWLexersym.isValidForParser; }
82
83
84
    public interface IsNullable {
85
        public final static byte isNullable[] = {0,
86
            0,0,0,0,0,0,0,0,0,0,
87
            0,0,0,0,0,0,0,0,0,0,
88
            0,0,0,0,0,0,0,0,0,0,
89
            0,0,0,0,0,0,0,0,0,0,
90
            0,0,0,0,0,0,0,0,0,0,
91
            0,0,0,0,0,0,0,0
92
        };
93
    };
94
    public final static byte isNullable[] = IsNullable.isNullable;
95
    public final boolean isNullable(int index) { return isNullable[index] != 0; }
96
97
    public interface ProsthesesIndex {
98
        public final static byte prosthesesIndex[] = {0,
99
            2,1
100
        };
101
    };
102
    public final static byte prosthesesIndex[] = ProsthesesIndex.prosthesesIndex;
103
    public final int prosthesesIndex(int index) { return prosthesesIndex[index]; }
22
104
23
    public interface IsKeyword {
105
    public interface IsKeyword {
24
        public final static byte isKeyword[] = {0,
106
        public final static byte isKeyword[] = {0,
Lines 27-33 Link Here
27
            0,0,0,0,0,0,0,0,0,0,
109
            0,0,0,0,0,0,0,0,0,0,
28
            0,0,0,0,0,0,0,0,0,0,
110
            0,0,0,0,0,0,0,0,0,0,
29
            0,0,0,0,0,0,0,0,0,0,
111
            0,0,0,0,0,0,0,0,0,0,
30
            0,0,0,0
112
            0,0,0,0,0,0
31
        };
113
        };
32
    };
114
    };
33
    public final static byte isKeyword[] = IsKeyword.isKeyword;
115
    public final static byte isKeyword[] = IsKeyword.isKeyword;
Lines 156-162 Link Here
156
            0,0,0,0,0,0,0,0,0,0,
238
            0,0,0,0,0,0,0,0,0,0,
157
            0,0,0,0,0,0,0,0,0,0,
239
            0,0,0,0,0,0,0,0,0,0,
158
            0,0,0,0,0,0,0,0,0,0,
240
            0,0,0,0,0,0,0,0,0,0,
159
            0,0,0,0,0
241
            0,0,0,0,0,0,0
160
        };
242
        };
161
    };
243
    };
162
    public final static byte termCheck[] = TermCheck.termCheck;
244
    public final static byte termCheck[] = TermCheck.termCheck;
Lines 242-297 Link Here
242
    public final int scopeState(int index) { return 0;}
324
    public final int scopeState(int index) { return 0;}
243
    public final int inSymb(int index) { return 0;}
325
    public final int inSymb(int index) { return 0;}
244
    public final String name(int index) { return null; }
326
    public final String name(int index) { return null; }
245
    public final int getErrorSymbol() { return 0; }
246
    public final int getScopeUbound() { return 0; }
247
    public final int getScopeSize() { return 0; }
248
    public final int getMaxNameLength() { return 0; }
249
250
    public final static int
251
           NUM_STATES        = 256,
252
           NT_OFFSET         = 54,
253
           LA_STATE_OFFSET   = 386,
254
           MAX_LA            = 1,
255
           NUM_RULES         = 63,
256
           NUM_NONTERMINALS  = 2,
257
           NUM_SYMBOLS       = 56,
258
           SEGMENT_SIZE      = 8192,
259
           START_STATE       = 64,
260
           IDENTIFIER_SYMBOL = 0,
261
           EOFT_SYMBOL       = 39,
262
           EOLT_SYMBOL       = 55,
263
           ACCEPT_ACTION     = 322,
264
           ERROR_ACTION      = 323;
265
266
    public final static boolean BACKTRACK = false;
267
268
    public final int getNumStates() { return NUM_STATES; }
269
    public final int getNtOffset() { return NT_OFFSET; }
270
    public final int getLaStateOffset() { return LA_STATE_OFFSET; }
271
    public final int getMaxLa() { return MAX_LA; }
272
    public final int getNumRules() { return NUM_RULES; }
273
    public final int getNumNonterminals() { return NUM_NONTERMINALS; }
274
    public final int getNumSymbols() { return NUM_SYMBOLS; }
275
    public final int getSegmentSize() { return SEGMENT_SIZE; }
276
    public final int getStartState() { return START_STATE; }
277
    public final int getStartSymbol() { return lhs[0]; }
278
    public final int getIdentifierSymbol() { return IDENTIFIER_SYMBOL; }
279
    public final int getEoftSymbol() { return EOFT_SYMBOL; }
280
    public final int getEoltSymbol() { return EOLT_SYMBOL; }
281
    public final int getAcceptAction() { return ACCEPT_ACTION; }
282
    public final int getErrorAction() { return ERROR_ACTION; }
283
    public final boolean isValidForParser() { return isValidForParser; }
284
    public final boolean getBacktrack() { return BACKTRACK; }
285
286
    public final int originalState(int state) { return 0; }
327
    public final int originalState(int state) { return 0; }
287
    public final int asi(int state) { return 0; }
328
    public final int asi(int state) { return 0; }
288
    public final int nasi(int state) { return 0; }
329
    public final int nasi(int state) { return 0; }
289
    public final int inSymbol(int state) { return 0; }
330
    public final int inSymbol(int state) { return 0; }
290
331
332
    /**
333
     * assert(! goto_default);
334
     */
291
    public final int ntAction(int state, int sym) {
335
    public final int ntAction(int state, int sym) {
292
        return baseAction[state + sym];
336
        return baseAction[state + sym];
293
    }
337
    }
294
338
339
    /**
340
     * assert(! shift_default);
341
     */
295
    public final int tAction(int state, int sym) {
342
    public final int tAction(int state, int sym) {
296
        int i = baseAction[state],
343
        int i = baseAction[state],
297
            k = i + sym;
344
            k = i + sym;
(-)META-INF/MANIFEST.MF (-1 / +1 lines)
Lines 32-38 Link Here
32
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
32
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
33
 org.eclipse.emf.ecore;bundle-version="[2.4.0,3.0.0)";visibility:=reexport,
33
 org.eclipse.emf.ecore;bundle-version="[2.4.0,3.0.0)";visibility:=reexport,
34
 org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)";visibility:=reexport,
34
 org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)";visibility:=reexport,
35
 net.sourceforge.lpg.lpgjavaruntime;version="[1.0.0,1.2.0)";visibility:=reexport
35
 lpg.runtime;bundle-version="2.0.17";visibility:=reexport
36
Bundle-Activator: org.eclipse.ocl.internal.OCLPlugin$Implementation
36
Bundle-Activator: org.eclipse.ocl.internal.OCLPlugin$Implementation
37
Eclipse-LazyStart: true
37
Eclipse-LazyStart: true
38
Bundle-ActivationPolicy: lazy
38
Bundle-ActivationPolicy: lazy
(-)src/org/eclipse/ocl/util/TypeUtil.java (-1 / +2 lines)
Lines 12-18 Link Here
12
 *   E.D.Willink - Refactoring to support extensibility and flexible error handling
12
 *   E.D.Willink - Refactoring to support extensibility and flexible error handling
13
 *   Zeligsoft - Bugs 244886, 245619, 233673, 179990, 242236
13
 *   Zeligsoft - Bugs 244886, 245619, 233673, 179990, 242236
14
 *   Stefan Schulze - Bug 245619
14
 *   Stefan Schulze - Bug 245619
15
 *   Adolfo Sánchez-Barbudo Herrera - Bug 233673
15
 *   Adolfo S�nchez-Barbudo Herrera - Bug 233673
16
 * 
16
 * 
17
 * </copyright>
17
 * </copyright>
18
 * 
18
 * 
Lines 33-38 Link Here
33
import org.eclipse.ocl.SemanticException;
33
import org.eclipse.ocl.SemanticException;
34
import org.eclipse.ocl.TypeChecker;
34
import org.eclipse.ocl.TypeChecker;
35
import org.eclipse.ocl.expressions.CollectionKind;
35
import org.eclipse.ocl.expressions.CollectionKind;
36
import org.eclipse.ocl.expressions.OCLExpression;
36
import org.eclipse.ocl.expressions.Variable;
37
import org.eclipse.ocl.expressions.Variable;
37
import org.eclipse.ocl.internal.OCLPlugin;
38
import org.eclipse.ocl.internal.OCLPlugin;
38
import org.eclipse.ocl.internal.l10n.OCLMessages;
39
import org.eclipse.ocl.internal.l10n.OCLMessages;
(-)src/org/eclipse/ocl/internal/helper/OCLSyntaxHelper.java (-7 / +7 lines)
Lines 28-34 Link Here
28
import java.util.ListIterator;
28
import java.util.ListIterator;
29
import java.util.Set;
29
import java.util.Set;
30
30
31
import lpg.lpgjavaruntime.IToken;
31
import lpg.runtime.IPrsStream;
32
import lpg.runtime.IToken;
32
33
33
import org.eclipse.emf.ecore.EObject;
34
import org.eclipse.emf.ecore.EObject;
34
import org.eclipse.emf.ecore.util.EcoreUtil;
35
import org.eclipse.emf.ecore.util.EcoreUtil;
Lines 69-75 Link Here
69
import org.eclipse.ocl.helper.Choice;
70
import org.eclipse.ocl.helper.Choice;
70
import org.eclipse.ocl.helper.ChoiceKind;
71
import org.eclipse.ocl.helper.ChoiceKind;
71
import org.eclipse.ocl.helper.ConstraintKind;
72
import org.eclipse.ocl.helper.ConstraintKind;
72
import org.eclipse.ocl.lpg.AbstractParser;
73
import org.eclipse.ocl.lpg.ProblemHandler;
73
import org.eclipse.ocl.lpg.ProblemHandler;
74
import org.eclipse.ocl.parser.AbstractOCLAnalyzer;
74
import org.eclipse.ocl.parser.AbstractOCLAnalyzer;
75
import org.eclipse.ocl.parser.OCLAnalyzer;
75
import org.eclipse.ocl.parser.OCLAnalyzer;
Lines 865-871 Link Here
865
	private List<IToken> tokenize(OCLAnalyzer<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> analyzer) {
865
	private List<IToken> tokenize(OCLAnalyzer<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> analyzer) {
866
		IToken token = null;
866
		IToken token = null;
867
		List<IToken> result = new ArrayList<IToken>();
867
		List<IToken> result = new ArrayList<IToken>();
868
		AbstractParser parser = analyzer.getAbstractParser();
868
		IPrsStream parser = analyzer.getAbstractParser().getIPrsStream();
869
		for (;;) {
869
		for (;;) {
870
			try {
870
			try {
871
				token = parser.getIToken(parser.getToken());
871
				token = parser.getIToken(parser.getToken());
Lines 949-955 Link Here
949
				OCLAnalyzer<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> analyzer =
949
				OCLAnalyzer<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> analyzer =
950
					new OCLAnalyzer<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E>(
950
					new OCLAnalyzer<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E>(
951
							environment, txt);
951
							environment, txt);
952
				AbstractParser parser = analyzer.getAbstractParser();		
952
				IPrsStream parser = analyzer.getAbstractParser().getIPrsStream();		
953
				List<IToken> tokens = tokenize(analyzer);
953
				List<IToken> tokens = tokenize(analyzer);
954
				
954
				
955
				ListIterator<IToken> iter = tokens.listIterator(tokens.size());
955
				ListIterator<IToken> iter = tokens.listIterator(tokens.size());
Lines 1100-1106 Link Here
1100
	private List<String> parseTokensPathNameCS(
1100
	private List<String> parseTokensPathNameCS(
1101
			OCLAnalyzer<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> analyzer,
1101
			OCLAnalyzer<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> analyzer,
1102
			List<IToken> tokens) {
1102
			List<IToken> tokens) {
1103
		AbstractParser parser = analyzer.getAbstractParser();		
1103
		IPrsStream parser = analyzer.getAbstractParser().getIPrsStream();		
1104
		ArrayList<String> path = new ArrayList<String>();
1104
		ArrayList<String> path = new ArrayList<String>();
1105
		IToken token;
1105
		IToken token;
1106
		int index = tokens.size() - 1;
1106
		int index = tokens.size() - 1;
Lines 1145-1151 Link Here
1145
        // right-most subexpression that parses
1145
        // right-most subexpression that parses
1146
        
1146
        
1147
        // initialize the token list
1147
        // initialize the token list
1148
        analyzer.getLexer().reset();
1148
        analyzer.getLexer().getILexStream().reset();
1149
        List<IToken> tokens = tokenize(analyzer);
1149
        List<IToken> tokens = tokenize(analyzer);
1150
        
1150
        
1151
        ListIterator<IToken> it = tokens.listIterator(tokens.size());
1151
        ListIterator<IToken> it = tokens.listIterator(tokens.size());
Lines 1350-1356 Link Here
1350
					env, variables);
1350
					env, variables);
1351
		
1351
		
1352
		if (!parseVariableDeclaration(env, mainAnalyzer)) {
1352
		if (!parseVariableDeclaration(env, mainAnalyzer)) {
1353
			AbstractParser parser = mainAnalyzer.getAbstractParser();		
1353
			IPrsStream parser = mainAnalyzer.getAbstractParser().getIPrsStream();		
1354
			parser.reset();
1354
			parser.reset();
1355
			OCLAnalyzer<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> analyzer;
1355
			OCLAnalyzer<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> analyzer;
1356
			String newTxt;
1356
			String newTxt;
(-)src/org/eclipse/ocl/cst/util/CSTSwitch.java (-2 lines)
Lines 21-28 Link Here
21
21
22
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EObject;
24
25
//import org.eclipse.ocl.cst.*;
26
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
24
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
27
import org.eclipse.ocl.cst.CSTNode;
25
import org.eclipse.ocl.cst.CSTNode;
28
import org.eclipse.ocl.cst.CSTPackage;
26
import org.eclipse.ocl.cst.CSTPackage;
(-)src/org/eclipse/ocl/cst/util/CSTAdapterFactory.java (-2 lines)
Lines 21-28 Link Here
21
import org.eclipse.emf.common.notify.Notifier;
21
import org.eclipse.emf.common.notify.Notifier;
22
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
22
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
23
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EObject;
24
25
//import org.eclipse.ocl.cst.*;
26
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
24
import org.eclipse.ocl.cst.BooleanLiteralExpCS;
27
import org.eclipse.ocl.cst.CSTNode;
25
import org.eclipse.ocl.cst.CSTNode;
28
import org.eclipse.ocl.cst.CSTPackage;
26
import org.eclipse.ocl.cst.CSTPackage;
(-)src/org/eclipse/ocl/types/TupleType.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.types;
18
package org.eclipse.ocl.types;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.EList;
23
import org.eclipse.emf.common.util.EList;
23
import org.eclipse.ocl.utilities.PredefinedType;
24
import org.eclipse.ocl.utilities.PredefinedType;
(-)src/org/eclipse/ocl/types/MessageType.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.types;
18
package org.eclipse.ocl.types;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.EList;
23
import org.eclipse.emf.common.util.EList;
23
import org.eclipse.ocl.utilities.PredefinedType;
24
import org.eclipse.ocl.utilities.PredefinedType;
(-)src/org/eclipse/ocl/types/CollectionType.java (+1 lines)
Lines 18-23 Link Here
18
package org.eclipse.ocl.types;
18
package org.eclipse.ocl.types;
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.EList;
23
import org.eclipse.emf.common.util.EList;
23
import org.eclipse.ocl.expressions.CollectionKind;
24
import org.eclipse.ocl.expressions.CollectionKind;
(-).settings/.api_filters (+398 lines)
Lines 1-8 Link Here
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
<component id="org.eclipse.ocl" version="2">
2
<component id="org.eclipse.ocl" version="2">
3
    <resource path="src/org/eclipse/ocl/parser/OCLKWLexerprs.java" type="org.eclipse.ocl.parser.OCLKWLexerprs">
4
        <filter id="1143996420">
5
            <message_arguments>
6
                <message_argument value="MAX_NAME_LENGTH"/>
7
            </message_arguments>
8
        </filter>
9
        <filter id="1143996420">
10
            <message_arguments>
11
                <message_argument value="isNullable"/>
12
            </message_arguments>
13
        </filter>
14
        <filter id="1143996420">
15
            <message_arguments>
16
                <message_argument value="SCOPE_SIZE"/>
17
            </message_arguments>
18
        </filter>
19
        <filter id="1143996420">
20
            <message_arguments>
21
                <message_argument value="SCOPE_UBOUND"/>
22
            </message_arguments>
23
        </filter>
24
        <filter id="1143996420">
25
            <message_arguments>
26
                <message_argument value="prosthesesIndex"/>
27
            </message_arguments>
28
        </filter>
29
        <filter id="1143996420">
30
            <message_arguments>
31
                <message_argument value="isNullable(int)"/>
32
            </message_arguments>
33
        </filter>
34
        <filter id="1143996420">
35
            <message_arguments>
36
                <message_argument value="getIdentifier_SYMBOL()"/>
37
            </message_arguments>
38
        </filter>
39
        <filter id="1143996420">
40
            <message_arguments>
41
                <message_argument value="ERROR_SYMBOL"/>
42
            </message_arguments>
43
        </filter>
44
        <filter id="1143996420">
45
            <message_arguments>
46
                <message_argument value="prosthesesIndex(int)"/>
47
            </message_arguments>
48
        </filter>
49
    </resource>
50
    <resource path="src/org/eclipse/ocl/parser/OCLKWLexerprs.java" type="org.eclipse.ocl.parser.OCLKWLexerprs$IsNullable">
51
        <filter id="1143996420">
52
            <message_arguments>
53
                <message_argument value="IsNullable"/>
54
            </message_arguments>
55
        </filter>
56
    </resource>
57
    <resource path="src/org/eclipse/ocl/parser/OCLKWLexerprs.java" type="org.eclipse.ocl.parser.OCLKWLexerprs$ProsthesesIndex">
58
        <filter id="1143996420">
59
            <message_arguments>
60
                <message_argument value="ProsthesesIndex"/>
61
            </message_arguments>
62
        </filter>
63
    </resource>
64
    <resource path="src/org/eclipse/ocl/parser/OCLKWLexersym.java" type="org.eclipse.ocl.parser.OCLKWLexersym">
65
        <filter id="1211105284">
66
            <message_arguments>
67
                <message_argument value="Char__"/>
68
            </message_arguments>
69
        </filter>
70
        <filter id="1211105284">
71
            <message_arguments>
72
                <message_argument value="numTokenKinds"/>
73
            </message_arguments>
74
        </filter>
75
        <filter id="1211105284">
76
            <message_arguments>
77
                <message_argument value="Char_Percent"/>
78
            </message_arguments>
79
        </filter>
80
    </resource>
81
    <resource path="src/org/eclipse/ocl/parser/OCLLexerprs.java" type="org.eclipse.ocl.parser.OCLLexerprs">
82
        <filter id="1143996420">
83
            <message_arguments>
84
                <message_argument value="SCOPE_UBOUND"/>
85
            </message_arguments>
86
        </filter>
87
        <filter id="1143996420">
88
            <message_arguments>
89
                <message_argument value="MAX_NAME_LENGTH"/>
90
            </message_arguments>
91
        </filter>
92
        <filter id="1143996420">
93
            <message_arguments>
94
                <message_argument value="isNullable(int)"/>
95
            </message_arguments>
96
        </filter>
97
        <filter id="1143996420">
98
            <message_arguments>
99
                <message_argument value="getIdentifier_SYMBOL()"/>
100
            </message_arguments>
101
        </filter>
102
        <filter id="1143996420">
103
            <message_arguments>
104
                <message_argument value="SCOPE_SIZE"/>
105
            </message_arguments>
106
        </filter>
107
        <filter id="1143996420">
108
            <message_arguments>
109
                <message_argument value="isNullable"/>
110
            </message_arguments>
111
        </filter>
112
        <filter id="1143996420">
113
            <message_arguments>
114
                <message_argument value="prosthesesIndex(int)"/>
115
            </message_arguments>
116
        </filter>
117
        <filter id="1143996420">
118
            <message_arguments>
119
                <message_argument value="ERROR_SYMBOL"/>
120
            </message_arguments>
121
        </filter>
122
        <filter id="1143996420">
123
            <message_arguments>
124
                <message_argument value="prosthesesIndex"/>
125
            </message_arguments>
126
        </filter>
127
    </resource>
128
    <resource path="src/org/eclipse/ocl/parser/OCLLexerprs.java" type="org.eclipse.ocl.parser.OCLLexerprs$IsNullable">
129
        <filter id="1143996420">
130
            <message_arguments>
131
                <message_argument value="IsNullable"/>
132
            </message_arguments>
133
        </filter>
134
    </resource>
135
    <resource path="src/org/eclipse/ocl/parser/OCLLexerprs.java" type="org.eclipse.ocl.parser.OCLLexerprs$ProsthesesIndex">
136
        <filter id="1143996420">
137
            <message_arguments>
138
                <message_argument value="ProsthesesIndex"/>
139
            </message_arguments>
140
        </filter>
141
    </resource>
142
    <resource path="src/org/eclipse/ocl/parser/OCLLexersym.java" type="org.eclipse.ocl.parser.OCLLexersym">
143
        <filter id="1211105284">
144
            <message_arguments>
145
                <message_argument value="numTokenKinds"/>
146
            </message_arguments>
147
        </filter>
148
    </resource>
149
    <resource path="src/org/eclipse/ocl/parser/OCLParser.java" type="org.eclipse.ocl.parser.OCLParser">
150
        <filter id="1143996420">
151
            <message_arguments>
152
                <message_argument value="getParser()"/>
153
            </message_arguments>
154
        </filter>
155
    </resource>
156
    <resource path="src/org/eclipse/ocl/parser/OCLParserprs.java" type="org.eclipse.ocl.parser.OCLParserprs">
157
        <filter id="1143996420">
158
            <message_arguments>
159
                <message_argument value="prosthesesIndex(int)"/>
160
            </message_arguments>
161
        </filter>
162
        <filter id="1143996420">
163
            <message_arguments>
164
                <message_argument value="prosthesesIndex"/>
165
            </message_arguments>
166
        </filter>
167
        <filter id="1143996420">
168
            <message_arguments>
169
                <message_argument value="isNullable(int)"/>
170
            </message_arguments>
171
        </filter>
172
        <filter id="1143996420">
173
            <message_arguments>
174
                <message_argument value="isNullable"/>
175
            </message_arguments>
176
        </filter>
177
        <filter id="1143996420">
178
            <message_arguments>
179
                <message_argument value="getIdentifier_SYMBOL()"/>
180
            </message_arguments>
181
        </filter>
182
    </resource>
183
    <resource path="src/org/eclipse/ocl/parser/OCLParserprs.java" type="org.eclipse.ocl.parser.OCLParserprs$IsNullable">
184
        <filter id="1143996420">
185
            <message_arguments>
186
                <message_argument value="IsNullable"/>
187
            </message_arguments>
188
        </filter>
189
    </resource>
190
    <resource path="src/org/eclipse/ocl/parser/OCLParserprs.java" type="org.eclipse.ocl.parser.OCLParserprs$ProsthesesIndex">
191
        <filter id="1143996420">
192
            <message_arguments>
193
                <message_argument value="ProsthesesIndex"/>
194
            </message_arguments>
195
        </filter>
196
    </resource>
3
    <resource path="src/org/eclipse/ocl/parser/OCLParsersym.java" type="org.eclipse.ocl.parser.OCLParsersym">
197
    <resource path="src/org/eclipse/ocl/parser/OCLParsersym.java" type="org.eclipse.ocl.parser.OCLParsersym">
4
        <filter id="1211105284">
198
        <filter id="1211105284">
5
            <message_arguments>
199
            <message_arguments>
200
                <message_argument value="numTokenKinds"/>
201
            </message_arguments>
202
        </filter>
203
        <filter id="1211105284">
204
            <message_arguments>
6
                <message_argument value="TK_MULTI_LINE_COMMENT"/>
205
                <message_argument value="TK_MULTI_LINE_COMMENT"/>
7
            </message_arguments>
206
            </message_arguments>
8
        </filter>
207
        </filter>
Lines 12-17 Link Here
12
            </message_arguments>
211
            </message_arguments>
13
        </filter>
212
        </filter>
14
    </resource>
213
    </resource>
214
    <resource path="src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingKWLexerprs.java" type="org.eclipse.ocl.parser.backtracking.OCLBacktrackingKWLexerprs">
215
        <filter id="1143996420">
216
            <message_arguments>
217
                <message_argument value="MAX_NAME_LENGTH"/>
218
            </message_arguments>
219
        </filter>
220
        <filter id="1143996420">
221
            <message_arguments>
222
                <message_argument value="prosthesesIndex"/>
223
            </message_arguments>
224
        </filter>
225
        <filter id="1143996420">
226
            <message_arguments>
227
                <message_argument value="isNullable"/>
228
            </message_arguments>
229
        </filter>
230
        <filter id="1143996420">
231
            <message_arguments>
232
                <message_argument value="ERROR_SYMBOL"/>
233
            </message_arguments>
234
        </filter>
235
        <filter id="1143996420">
236
            <message_arguments>
237
                <message_argument value="getIdentifier_SYMBOL()"/>
238
            </message_arguments>
239
        </filter>
240
        <filter id="1143996420">
241
            <message_arguments>
242
                <message_argument value="SCOPE_SIZE"/>
243
            </message_arguments>
244
        </filter>
245
        <filter id="1143996420">
246
            <message_arguments>
247
                <message_argument value="SCOPE_UBOUND"/>
248
            </message_arguments>
249
        </filter>
250
        <filter id="1143996420">
251
            <message_arguments>
252
                <message_argument value="prosthesesIndex(int)"/>
253
            </message_arguments>
254
        </filter>
255
        <filter id="1143996420">
256
            <message_arguments>
257
                <message_argument value="isNullable(int)"/>
258
            </message_arguments>
259
        </filter>
260
    </resource>
261
    <resource path="src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingKWLexerprs.java" type="org.eclipse.ocl.parser.backtracking.OCLBacktrackingKWLexerprs$IsNullable">
262
        <filter id="1143996420">
263
            <message_arguments>
264
                <message_argument value="IsNullable"/>
265
            </message_arguments>
266
        </filter>
267
    </resource>
268
    <resource path="src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingKWLexerprs.java" type="org.eclipse.ocl.parser.backtracking.OCLBacktrackingKWLexerprs$ProsthesesIndex">
269
        <filter id="1143996420">
270
            <message_arguments>
271
                <message_argument value="ProsthesesIndex"/>
272
            </message_arguments>
273
        </filter>
274
    </resource>
275
    <resource path="src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingKWLexersym.java" type="org.eclipse.ocl.parser.backtracking.OCLBacktrackingKWLexersym">
276
        <filter id="1211105284">
277
            <message_arguments>
278
                <message_argument value="Char__"/>
279
            </message_arguments>
280
        </filter>
281
        <filter id="1211105284">
282
            <message_arguments>
283
                <message_argument value="Char_Percent"/>
284
            </message_arguments>
285
        </filter>
286
        <filter id="1211105284">
287
            <message_arguments>
288
                <message_argument value="numTokenKinds"/>
289
            </message_arguments>
290
        </filter>
291
    </resource>
292
    <resource path="src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingLexerprs.java" type="org.eclipse.ocl.parser.backtracking.OCLBacktrackingLexerprs">
293
        <filter id="1143996420">
294
            <message_arguments>
295
                <message_argument value="isNullable"/>
296
            </message_arguments>
297
        </filter>
298
        <filter id="1143996420">
299
            <message_arguments>
300
                <message_argument value="isNullable(int)"/>
301
            </message_arguments>
302
        </filter>
303
        <filter id="1143996420">
304
            <message_arguments>
305
                <message_argument value="getIdentifier_SYMBOL()"/>
306
            </message_arguments>
307
        </filter>
308
        <filter id="1143996420">
309
            <message_arguments>
310
                <message_argument value="MAX_NAME_LENGTH"/>
311
            </message_arguments>
312
        </filter>
313
        <filter id="1143996420">
314
            <message_arguments>
315
                <message_argument value="ERROR_SYMBOL"/>
316
            </message_arguments>
317
        </filter>
318
        <filter id="1143996420">
319
            <message_arguments>
320
                <message_argument value="prosthesesIndex"/>
321
            </message_arguments>
322
        </filter>
323
        <filter id="1143996420">
324
            <message_arguments>
325
                <message_argument value="SCOPE_SIZE"/>
326
            </message_arguments>
327
        </filter>
328
        <filter id="1143996420">
329
            <message_arguments>
330
                <message_argument value="SCOPE_UBOUND"/>
331
            </message_arguments>
332
        </filter>
333
        <filter id="1143996420">
334
            <message_arguments>
335
                <message_argument value="prosthesesIndex(int)"/>
336
            </message_arguments>
337
        </filter>
338
    </resource>
339
    <resource path="src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingLexerprs.java" type="org.eclipse.ocl.parser.backtracking.OCLBacktrackingLexerprs$IsNullable">
340
        <filter id="1143996420">
341
            <message_arguments>
342
                <message_argument value="IsNullable"/>
343
            </message_arguments>
344
        </filter>
345
    </resource>
346
    <resource path="src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingLexerprs.java" type="org.eclipse.ocl.parser.backtracking.OCLBacktrackingLexerprs$ProsthesesIndex">
347
        <filter id="1143996420">
348
            <message_arguments>
349
                <message_argument value="ProsthesesIndex"/>
350
            </message_arguments>
351
        </filter>
352
    </resource>
353
    <resource path="src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingLexersym.java" type="org.eclipse.ocl.parser.backtracking.OCLBacktrackingLexersym">
354
        <filter id="1211105284">
355
            <message_arguments>
356
                <message_argument value="numTokenKinds"/>
357
            </message_arguments>
358
        </filter>
359
    </resource>
360
    <resource path="src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingParser.java" type="org.eclipse.ocl.parser.backtracking.OCLBacktrackingParser">
361
        <filter id="1143996420">
362
            <message_arguments>
363
                <message_argument value="getParser()"/>
364
            </message_arguments>
365
        </filter>
366
    </resource>
367
    <resource path="src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingParserprs.java" type="org.eclipse.ocl.parser.backtracking.OCLBacktrackingParserprs">
368
        <filter id="1143996420">
369
            <message_arguments>
370
                <message_argument value="prosthesesIndex(int)"/>
371
            </message_arguments>
372
        </filter>
373
        <filter id="1143996420">
374
            <message_arguments>
375
                <message_argument value="prosthesesIndex"/>
376
            </message_arguments>
377
        </filter>
378
        <filter id="1143996420">
379
            <message_arguments>
380
                <message_argument value="getIdentifier_SYMBOL()"/>
381
            </message_arguments>
382
        </filter>
383
        <filter id="1143996420">
384
            <message_arguments>
385
                <message_argument value="isNullable(int)"/>
386
            </message_arguments>
387
        </filter>
388
        <filter id="1143996420">
389
            <message_arguments>
390
                <message_argument value="isNullable"/>
391
            </message_arguments>
392
        </filter>
393
    </resource>
394
    <resource path="src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingParserprs.java" type="org.eclipse.ocl.parser.backtracking.OCLBacktrackingParserprs$IsNullable">
395
        <filter id="1143996420">
396
            <message_arguments>
397
                <message_argument value="IsNullable"/>
398
            </message_arguments>
399
        </filter>
400
    </resource>
401
    <resource path="src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingParserprs.java" type="org.eclipse.ocl.parser.backtracking.OCLBacktrackingParserprs$ProsthesesIndex">
402
        <filter id="1143996420">
403
            <message_arguments>
404
                <message_argument value="ProsthesesIndex"/>
405
            </message_arguments>
406
        </filter>
407
    </resource>
15
    <resource path="src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingParsersym.java" type="org.eclipse.ocl.parser.backtracking.OCLBacktrackingParsersym">
408
    <resource path="src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingParsersym.java" type="org.eclipse.ocl.parser.backtracking.OCLBacktrackingParsersym">
16
        <filter id="1211105284">
409
        <filter id="1211105284">
17
            <message_arguments>
410
            <message_arguments>
Lines 23-27 Link Here
23
                <message_argument value="TK_SINGLE_LINE_COMMENT"/>
416
                <message_argument value="TK_SINGLE_LINE_COMMENT"/>
24
            </message_arguments>
417
            </message_arguments>
25
        </filter>
418
        </filter>
419
        <filter id="1211105284">
420
            <message_arguments>
421
                <message_argument value="numTokenKinds"/>
422
            </message_arguments>
423
        </filter>
26
    </resource>
424
    </resource>
27
</component>
425
</component>
(-)src/org/eclipse/ocl/utilities/util/UtilitiesSwitch.java (-2 lines)
Lines 19-26 Link Here
19
19
20
import org.eclipse.emf.ecore.EClass;
20
import org.eclipse.emf.ecore.EClass;
21
import org.eclipse.emf.ecore.EObject;
21
import org.eclipse.emf.ecore.EObject;
22
23
//import org.eclipse.ocl.utilities.*;
24
import org.eclipse.ocl.utilities.ASTNode;
22
import org.eclipse.ocl.utilities.ASTNode;
25
import org.eclipse.ocl.utilities.CallingASTNode;
23
import org.eclipse.ocl.utilities.CallingASTNode;
26
import org.eclipse.ocl.utilities.ExpressionInOCL;
24
import org.eclipse.ocl.utilities.ExpressionInOCL;
(-)src/org/eclipse/ocl/utilities/util/UtilitiesAdapterFactory.java (-2 lines)
Lines 19-26 Link Here
19
import org.eclipse.emf.common.notify.Notifier;
19
import org.eclipse.emf.common.notify.Notifier;
20
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
20
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
21
import org.eclipse.emf.ecore.EObject;
21
import org.eclipse.emf.ecore.EObject;
22
23
//import org.eclipse.ocl.utilities.*;
24
import org.eclipse.ocl.utilities.ASTNode;
22
import org.eclipse.ocl.utilities.ASTNode;
25
import org.eclipse.ocl.utilities.CallingASTNode;
23
import org.eclipse.ocl.utilities.CallingASTNode;
26
import org.eclipse.ocl.utilities.ExpressionInOCL;
24
import org.eclipse.ocl.utilities.ExpressionInOCL;
(-)src/org/eclipse/ocl/utilities/impl/UtilitiesFactoryImpl.java (-2 lines)
Lines 20-27 Link Here
20
import org.eclipse.emf.ecore.EPackage;
20
import org.eclipse.emf.ecore.EPackage;
21
import org.eclipse.emf.ecore.impl.EFactoryImpl;
21
import org.eclipse.emf.ecore.impl.EFactoryImpl;
22
import org.eclipse.emf.ecore.plugin.EcorePlugin;
22
import org.eclipse.emf.ecore.plugin.EcorePlugin;
23
24
//import org.eclipse.ocl.utilities.*;
25
import org.eclipse.ocl.utilities.UtilitiesFactory;
23
import org.eclipse.ocl.utilities.UtilitiesFactory;
26
import org.eclipse.ocl.utilities.UtilitiesPackage;
24
import org.eclipse.ocl.utilities.UtilitiesPackage;
27
25
(-)src/org/eclipse/ocl/types/util/TypesSwitch.java (-2 lines)
Lines 20-27 Link Here
20
//import java.util.List;
20
//import java.util.List;
21
import org.eclipse.emf.ecore.EClass;
21
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.EObject;
22
import org.eclipse.emf.ecore.EObject;
23
24
//import org.eclipse.ocl.types.*;
25
import org.eclipse.ocl.types.AnyType;
23
import org.eclipse.ocl.types.AnyType;
26
import org.eclipse.ocl.types.BagType;
24
import org.eclipse.ocl.types.BagType;
27
import org.eclipse.ocl.types.CollectionType;
25
import org.eclipse.ocl.types.CollectionType;
(-)src/org/eclipse/ocl/types/util/TypesValidator.java (-3 lines)
Lines 19-32 Link Here
19
19
20
import java.util.Map;
20
import java.util.Map;
21
21
22
//import org.eclipse.emf.common.util.Diagnostic;
23
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
24
import org.eclipse.emf.common.util.ResourceLocator;
23
import org.eclipse.emf.common.util.ResourceLocator;
25
import org.eclipse.emf.ecore.EPackage;
24
import org.eclipse.emf.ecore.EPackage;
26
import org.eclipse.emf.ecore.util.EObjectValidator;
25
import org.eclipse.emf.ecore.util.EObjectValidator;
27
import org.eclipse.ocl.internal.OCLPlugin;
26
import org.eclipse.ocl.internal.OCLPlugin;
28
29
//import org.eclipse.ocl.types.*;
30
import org.eclipse.ocl.types.AnyType;
27
import org.eclipse.ocl.types.AnyType;
31
import org.eclipse.ocl.types.BagType;
28
import org.eclipse.ocl.types.BagType;
32
import org.eclipse.ocl.types.CollectionType;
29
import org.eclipse.ocl.types.CollectionType;
(-)src/org/eclipse/ocl/types/util/TypesAdapterFactory.java (-2 lines)
Lines 21-28 Link Here
21
import org.eclipse.emf.common.notify.Notifier;
21
import org.eclipse.emf.common.notify.Notifier;
22
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
22
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
23
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EObject;
24
25
//import org.eclipse.ocl.types.*;
26
import org.eclipse.ocl.types.AnyType;
24
import org.eclipse.ocl.types.AnyType;
27
import org.eclipse.ocl.types.BagType;
25
import org.eclipse.ocl.types.BagType;
28
import org.eclipse.ocl.types.CollectionType;
26
import org.eclipse.ocl.types.CollectionType;
(-)src/org/eclipse/ocl/expressions/util/ExpressionsValidator.java (-4 / +37 lines)
Lines 21-32 Link Here
21
21
22
import org.eclipse.emf.common.util.DiagnosticChain;
22
import org.eclipse.emf.common.util.DiagnosticChain;
23
import org.eclipse.emf.common.util.ResourceLocator;
23
import org.eclipse.emf.common.util.ResourceLocator;
24
25
import org.eclipse.emf.ecore.EPackage;
24
import org.eclipse.emf.ecore.EPackage;
26
27
import org.eclipse.emf.ecore.util.EObjectValidator;
25
import org.eclipse.emf.ecore.util.EObjectValidator;
28
26
import org.eclipse.ocl.expressions.AssociationClassCallExp;
29
import org.eclipse.ocl.expressions.*;
27
import org.eclipse.ocl.expressions.BooleanLiteralExp;
28
import org.eclipse.ocl.expressions.CallExp;
29
import org.eclipse.ocl.expressions.CollectionItem;
30
import org.eclipse.ocl.expressions.CollectionKind;
31
import org.eclipse.ocl.expressions.CollectionLiteralExp;
32
import org.eclipse.ocl.expressions.CollectionLiteralPart;
33
import org.eclipse.ocl.expressions.CollectionRange;
34
import org.eclipse.ocl.expressions.EnumLiteralExp;
35
import org.eclipse.ocl.expressions.ExpressionsPackage;
36
import org.eclipse.ocl.expressions.FeatureCallExp;
37
import org.eclipse.ocl.expressions.IfExp;
38
import org.eclipse.ocl.expressions.IntegerLiteralExp;
39
import org.eclipse.ocl.expressions.InvalidLiteralExp;
40
import org.eclipse.ocl.expressions.IterateExp;
41
import org.eclipse.ocl.expressions.IteratorExp;
42
import org.eclipse.ocl.expressions.LetExp;
43
import org.eclipse.ocl.expressions.LiteralExp;
44
import org.eclipse.ocl.expressions.LoopExp;
45
import org.eclipse.ocl.expressions.MessageExp;
46
import org.eclipse.ocl.expressions.NavigationCallExp;
47
import org.eclipse.ocl.expressions.NullLiteralExp;
48
import org.eclipse.ocl.expressions.NumericLiteralExp;
49
import org.eclipse.ocl.expressions.OCLExpression;
50
import org.eclipse.ocl.expressions.OperationCallExp;
51
import org.eclipse.ocl.expressions.PrimitiveLiteralExp;
52
import org.eclipse.ocl.expressions.PropertyCallExp;
53
import org.eclipse.ocl.expressions.RealLiteralExp;
54
import org.eclipse.ocl.expressions.StateExp;
55
import org.eclipse.ocl.expressions.StringLiteralExp;
56
import org.eclipse.ocl.expressions.TupleLiteralExp;
57
import org.eclipse.ocl.expressions.TupleLiteralPart;
58
import org.eclipse.ocl.expressions.TypeExp;
59
import org.eclipse.ocl.expressions.UnlimitedNaturalLiteralExp;
60
import org.eclipse.ocl.expressions.UnspecifiedValueExp;
61
import org.eclipse.ocl.expressions.Variable;
62
import org.eclipse.ocl.expressions.VariableExp;
30
import org.eclipse.ocl.internal.OCLPlugin;
63
import org.eclipse.ocl.internal.OCLPlugin;
31
64
32
/**
65
/**
(-)src/org/eclipse/ocl/expressions/util/ExpressionsSwitch.java (-2 lines)
Lines 21-28 Link Here
21
21
22
import org.eclipse.emf.ecore.EClass;
22
import org.eclipse.emf.ecore.EClass;
23
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EObject;
24
25
//import org.eclipse.ocl.expressions.*;
26
import org.eclipse.ocl.expressions.AssociationClassCallExp;
24
import org.eclipse.ocl.expressions.AssociationClassCallExp;
27
import org.eclipse.ocl.expressions.BooleanLiteralExp;
25
import org.eclipse.ocl.expressions.BooleanLiteralExp;
28
import org.eclipse.ocl.expressions.CallExp;
26
import org.eclipse.ocl.expressions.CallExp;
(-)src/org/eclipse/ocl/expressions/util/ExpressionsAdapterFactory.java (-2 lines)
Lines 21-28 Link Here
21
import org.eclipse.emf.common.notify.Notifier;
21
import org.eclipse.emf.common.notify.Notifier;
22
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
22
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
23
import org.eclipse.emf.ecore.EObject;
23
import org.eclipse.emf.ecore.EObject;
24
25
//import org.eclipse.ocl.expressions.*;
26
import org.eclipse.ocl.expressions.AssociationClassCallExp;
24
import org.eclipse.ocl.expressions.AssociationClassCallExp;
27
import org.eclipse.ocl.expressions.BooleanLiteralExp;
25
import org.eclipse.ocl.expressions.BooleanLiteralExp;
28
import org.eclipse.ocl.expressions.CallExp;
26
import org.eclipse.ocl.expressions.CallExp;
(-)src/org/eclipse/ocl/lpg/KeywordTemplateF.gi (+119 lines)
Added Link Here
1
--
2
-- An LPG Lexer Template Using lpg.jar
3
--
4
-- An instance of this template must have a $Export section and the export_terminals option
5
-- There must be only one non-terminal, the start symbol, for the keywords
6
-- The action for each keyword should be a call to $setResult(terminal_symbol)
7
--
8
-- Macro that may be redefined in an instance of this template
9
--
10
--     $eof_char
11
--
12
-- B E G I N N I N G   O F   T E M P L A T E   KeywordTemplateF (Similar to KeywordTemplateD)
13
--
14
%Options Programming_Language=java,margin=4
15
%Options table
16
%options action-block=("*.java", "/.", "./")
17
%options ParseTable=lpg.runtime.ParseTable
18
%Options prefix=Char_
19
%Options single-productions
20
21
--
22
-- This template requires that the name of the EOF token be set
23
-- to EOF and that the prefix be "Char_" to be consistent with
24
-- LexerTemplateD.
25
--
26
%Eof
27
    EOF
28
%End
29
30
%Define
31
    --
32
    -- Macro that may be respecified in an instance of this template
33
    --
34
    $eof_char /.$sym_type$.$prefix$EOF$suffix$./
35
36
    --
37
    -- Macros useful for specifying actions
38
    --
39
    $setResult /.keywordKind[$rule_number] = ./
40
41
    $Header
42
    /.
43
            //
44
            // Rule $rule_number:  $rule_text
45
            //
46
            ./
47
48
    $BeginAction /.$Header./
49
50
    $EndAction /../
51
52
    $BeginJava /.$BeginAction./
53
54
    $EndJava /.$EndAction./
55
%End
56
57
%Headers
58
    /.
59
    public class $action_type extends $prs_type
60
    {
61
        private char[] inputChars;
62
        private final int keywordKind[] = new int[$num_rules + 1];
63
64
        public int[] getKeywordKinds() { return keywordKind; }
65
66
        public int lexer(int curtok, int lasttok)
67
        {
68
            int current_kind = getKind(inputChars[curtok]),
69
                act;
70
71
            for (act = tAction(START_STATE, current_kind);
72
                 act > NUM_RULES && act < ACCEPT_ACTION;
73
                 act = tAction(act, current_kind))
74
            {
75
                curtok++;
76
                current_kind = (curtok > lasttok
77
                                       ? $eof_char
78
                                       : getKind(inputChars[curtok]));
79
            }
80
81
            if (act > ERROR_ACTION)
82
            {
83
                curtok++;
84
                act -= ERROR_ACTION;
85
            }
86
87
            return keywordKind[act == ERROR_ACTION  || curtok <= lasttok ? 0 : act];
88
        }
89
90
        public void setInputChars(char[] inputChars) { this.inputChars = inputChars; }
91
92
    ./
93
%End
94
95
%Rules
96
    /.
97
98
        public $action_type(char[] inputChars, int identifierKind)
99
        {
100
            this.inputChars = inputChars;
101
            keywordKind[0] = identifierKind;
102
    ./
103
%End
104
105
%Trailers
106
    /.
107
            for (int i = 0; i < keywordKind.length; i++)
108
            {
109
                if (keywordKind[i] == 0)
110
                    keywordKind[i] = identifierKind;
111
            }
112
        }
113
    }
114
    ./
115
%End
116
117
--
118
-- E N D   O F   T E M P L A T E
119
--
(-)src/org/eclipse/ocl/parser/backtracking/OCLParserErrors.gi (+205 lines)
Added Link Here
1
--/**
2
-- * <copyright>
3
-- *
4
-- * Copyright (c) 2008 Eclipse.org, Open Canarias S.L. and others.
5
-- * All rights reserved.   This program and the accompanying materials
6
-- * are made available under the terms of the Eclipse Public License v1.0
7
-- * which accompanies this distribution, and is available at
8
-- * http://www.eclipse.org/legal/epl-v10.html
9
-- *
10
-- * Contributors:
11
-- *   E.D. Willink - Initial API and implementation
12
-- *   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
13
-- *
14
-- * </copyright>
15
-- *
16
-- * $Id: OCLParserErrors.g,v 1.1 2009/01/13 20:31:30 cdamus Exp $
17
-- */
18
--
19
-- Additional ERROR_TOKEN rules for The OCL Parser
20
--
21
22
%Import
23
	OCLParser.g
24
%End
25
26
%Import
27
	EssentialOCLErrors.gi
28
%End
29
30
%Rules
31
32
	classifierContextDeclCS ::= context pathNameCS ERROR_TOKEN
33
		/.$BeginCode
34
					reportErrorTokenMessage($getToken(3), OCLParserErrors.MISSING_INV_OR_DEF);
35
					CSTNode result = createClassifierContextDeclCS(
36
							(PathNameCS)$getSym(2),
37
							new BasicEList<InvOrDefCS>()
38
						);
39
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(3)));
40
					$setResult(result);
41
		  $EndCode
42
		./
43
		
44
	defExpressionCS ::= typedVariableCS ERROR_TOKEN
45
		/.$BeginCode
46
					reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_EQUALS);
47
					VariableCS variableCS = (VariableCS)$getSym(1);
48
					CSTNode result = createDefExpressionCS(
49
							variableCS,
50
							null,
51
							null
52
						);
53
					setOffsets(result, variableCS, getIToken($getToken(2)));
54
					$setResult(result);
55
		  $EndCode
56
		./
57
	defExpressionCS ::= IDENTIFIER ERROR_Colon
58
		/.$BeginCode
59
					VariableCS variableCS = createVariableCS(
60
								getTokenText($getToken(1)),
61
								null,
62
								null
63
							);
64
					setOffsets(variableCS, getIToken($getToken(1)), getIToken($getToken(2)));
65
					CSTNode result = createDefExpressionCS(
66
							variableCS,
67
							null,
68
							null
69
						);
70
					setOffsets(result, variableCS, getIToken($getToken(2)));
71
					$setResult(result);
72
		  $EndCode
73
		./
74
75
	initOrDerValueCS ::= initOrDerValueCSopt init ERROR_Colon
76
		/.$BeginCode
77
					CSTNode result = createInitValueCS(
78
							(InitOrDerValueCS)$getSym(1),
79
							null
80
						);
81
					if ($getSym(1) != null) {
82
						setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(3)));
83
					} else {
84
						setOffsets(result, getIToken($getToken(2)), getIToken($getToken(3)));
85
					}
86
					$setResult(result);
87
		  $EndCode
88
		./
89
	initOrDerValueCS ::= initOrDerValueCSopt derive ERROR_Colon
90
		/.$BeginCode
91
					CSTNode result = createDerValueCS(
92
							(InitOrDerValueCS)$getSym(1),
93
							null
94
						);
95
					if ($getSym(1) != null) {
96
						setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(3)));
97
					} else {
98
						setOffsets(result, getIToken($getToken(2)), getIToken($getToken(3)));
99
					}
100
					$setResult(result);
101
		  $EndCode
102
		./
103
		
104
	invOrDefCS ::= inv simpleNameCS ERROR_Colon
105
		/.$BeginCode
106
					CSTNode result = createInvCS(
107
							(SimpleNameCS)$getSym(2),
108
							null
109
						);
110
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(3)));
111
					$setResult(result);
112
		  $EndCode
113
		./	
114
	invOrDefCS ::= def simpleNameCS ERROR_Colon
115
		/.$BeginCode
116
					CSTNode result = createDefCS(
117
							(SimpleNameCS)$getSym(2),
118
							null
119
						);
120
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(3)));
121
					$setResult(result);
122
		  $EndCode
123
		./
124
125
	packageDeclarationCS ::= package pathNameCS contextDeclCSmopt ERROR_Empty endpackage
126
		/.$BeginCode
127
					CSTNode result = createPackageDeclarationCS(
128
							(PathNameCS)$getSym(2),
129
							(EList)$getSym(3)
130
						);
131
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(5)));
132
					$setResult(result);
133
		  $EndCode
134
		./
135
	packageDeclarationCS ::= package pathNameCS contextDeclCSmopt ERROR_TOKEN
136
		/.$BeginCode
137
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_ENDPACKAGE);
138
					CSTNode result = createPackageDeclarationCS(
139
							(PathNameCS)$getSym(2),
140
							(EList)$getSym(3)
141
						);
142
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(4)));
143
					$setResult(result);
144
		  $EndCode
145
		./
146
	packageDeclarationCS ::= package ERROR_PathNameCS
147
		/.$BeginCode
148
					CSTNode result = createPackageDeclarationCS(
149
							(PathNameCS)$getSym(2),
150
							new BasicEList()
151
						);
152
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(2)));
153
					$setResult(result);
154
		  $EndCode
155
		./
156
		
157
	prePostOrBodyDeclCS ::= pre simpleNameCS ERROR_Colon
158
		/.$BeginCode
159
					CSTNode result = createPrePostOrBodyDeclCS(
160
							PrePostOrBodyEnum.PRE_LITERAL,
161
							(SimpleNameCS)$getSym(2),
162
							createInvalidLiteralExpCS(getTokenText($getToken(3)))
163
						);
164
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(3)));
165
					$setResult(result);
166
		  $EndCode
167
		./
168
	prePostOrBodyDeclCS ::= post simpleNameCS ERROR_Colon
169
		/.$BeginCode
170
					CSTNode result = createPrePostOrBodyDeclCS(
171
							PrePostOrBodyEnum.POST_LITERAL,
172
							(SimpleNameCS)$getSym(2),
173
							createInvalidLiteralExpCS(getTokenText($getToken(3)))
174
						);
175
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(3)));
176
					$setResult(result);
177
		  $EndCode
178
		./
179
	prePostOrBodyDeclCS ::= body simpleNameCS ERROR_Colon
180
		/.$BeginCode
181
					CSTNode result = createPrePostOrBodyDeclCS(
182
							PrePostOrBodyEnum.BODY_LITERAL,
183
							(SimpleNameCS)$getSym(2),
184
							createInvalidLiteralExpCS(getTokenText($getToken(3)))
185
						);
186
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(3)));
187
					$setResult(result);
188
		  $EndCode
189
		./
190
		
191
	propertyContextCS ::= context pathNameCS '::' ERROR_SimpleNameCS
192
		/.$BeginCode
193
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(4);
194
					CSTNode result = createPropertyContextCS(
195
							(PathNameCS)$getSym(2),
196
							simpleNameCS,
197
							null,
198
							null
199
						);
200
					setOffsets(result, getIToken($getToken(1)), simpleNameCS);
201
					$setResult(result);
202
		  $EndCode
203
		./
204
		
205
%End
(-)src/org/eclipse/ocl/parser/OCLKWLexer.gi (+548 lines)
Added Link Here
1
--/**
2
-- * <copyright>
3
-- *
4
-- * Copyright (c) 2005, 2009 IBM Corporation  Zeligsoft Inc, Open Canarias S.L., and others.
5
-- * All rights reserved.   This program and the accompanying materials
6
-- * are made available under the terms of the Eclipse Public License v1.0
7
-- * which accompanies this distribution, and is available at
8
-- * http://www.eclipse.org/legal/epl-v10.html
9
-- *
10
-- * Contributors:
11
-- *   IBM - Initial API and implementation
12
-- *   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
13
-- *   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
14
-- *
15
-- * </copyright>
16
-- *
17
-- * $Id: OCLKWLexer.g,v 1.1 2007/10/11 23:05:00 cdamus Exp $
18
-- */
19
--
20
-- The OCL KeyWord Lexer
21
--
22
23
%Options slr
24
%Options fp=OCLKWLexer,prefix=Char_
25
%options noserialize
26
%options package=org.eclipse.ocl.parser
27
%options template=../lpg/KeywordTemplateF.gi
28
%options export_terminals=("OCLParsersym.java", "TK_")
29
%options include_directory="../lpg"
30
31
%Define
32
33
	--
34
	-- Definition of macros used in the template
35
	--
36
	$action_class /.$file_prefix./
37
	$eof_char /.Char_EOF./
38
	$copyright_contributions /.*./
39
	
40
%End
41
42
%Notice
43
	/./**
44
 * <copyright>
45
 *
46
 * Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc, Open Canarias S.L., and others.
47
 * All rights reserved.   This program and the accompanying materials
48
 * are made available under the terms of the Eclipse Public License v1.0
49
 * which accompanies this distribution, and is available at
50
 * http://www.eclipse.org/legal/epl-v10.html
51
 *
52
 * Contributors:
53
 *   IBM - Initial API and implementation
54
 *   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
55
 *   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
56
$copyright_contributions
57
 * </copyright>
58
 *
59
 * 
60
 */
61
	./
62
%End
63
64
%Globals
65
	/../
66
%End
67
68
%Import
69
	KWLexerMapF.gi
70
%End
71
72
%Export
73
	self
74
	inv
75
	pre
76
	post
77
	context
78
	package
79
	endpackage
80
	def
81
	if
82
	then
83
	else
84
	endif
85
	and
86
	or
87
	xor
88
	not
89
	implies
90
	let
91
	in
92
	true
93
	false
94
95
	--
96
	-- the following appear to have been omitted from the list of
97
	-- OCL reserved words in Section 7.4.9.  They will be treated 
98
	-- as unreserved for compliance
99
	--
100
	body
101
	derive
102
	init
103
	null
104
--  return  -- don't need a keyword for LPG purposes
105
	
106
	--
107
	-- the following are not used in the OCL concrete syntax, but
108
	-- are defined as reserved words in the Spec 7.4.9
109
	--
110
	attr
111
	oper
112
113
	--
114
	-- the remainder of the LPG keywords are defined as such for the
115
	-- purpose of constructing the CST grammar.  They are not OCL
116
	-- reserved words
117
	--		
118
	Set
119
	Bag
120
	Sequence
121
	Collection
122
	OrderedSet
123
124
	iterate
125
	forAll
126
	exists
127
	isUnique
128
	any
129
	one
130
131
	collect
132
	select
133
	reject
134
	collectNested
135
	sortedBy
136
137
	closure
138
139
	oclIsKindOf
140
	oclIsTypeOf
141
	oclAsType
142
	oclIsNew
143
	oclIsUndefined
144
	oclIsInvalid
145
	oclIsInState
146
	allInstances
147
148
	String
149
	Integer
150
	UnlimitedNatural
151
	Real
152
	Boolean
153
	Tuple
154
	OclAny
155
	OclVoid
156
	Invalid
157
	OclMessage
158
159
	OclInvalid
160
%End
161
162
%Start
163
	KeyWord
164
%End
165
166
%Rules
167
168
-- The Goal for the parser is a single Keyword
169
170
	KeyWord ::=
171
		s e l f
172
		/.$BeginAction
173
			$setResult($_self);
174
		  $EndAction
175
		./
176
177
		| i n v
178
		/.$BeginAction
179
			$setResult($_inv);
180
		  $EndAction
181
		./
182
183
		| p r e
184
		/.$BeginAction
185
			$setResult($_pre);
186
		  $EndAction
187
		./
188
189
		| p o s t
190
		/.$BeginAction
191
			$setResult($_post);
192
		  $EndAction
193
		./
194
		
195
		| b o d y
196
		/.$BeginAction
197
			$setResult($_body);
198
		  $EndAction
199
		./
200
		
201
		| c o n t e x t
202
		/.$BeginAction
203
			$setResult($_context);
204
		  $EndAction
205
		./
206
		
207
		| p a c k a g e
208
		/.$BeginAction
209
			$setResult($_package);
210
		  $EndAction
211
		./
212
		
213
		| e n d p a c k a g e
214
		/.$BeginAction
215
			$setResult($_endpackage);
216
		  $EndAction
217
		./
218
		
219
		| d e f
220
		/.$BeginAction
221
			$setResult($_def);
222
		  $EndAction
223
		./
224
		
225
		| d e r i v e
226
		/.$BeginAction
227
			$setResult($_derive);
228
		  $EndAction
229
		./
230
		
231
		| i n i t
232
		/.$BeginAction
233
			$setResult($_init);
234
		  $EndAction
235
		./
236
		
237
		| i f
238
		/.$BeginAction
239
			$setResult($_if);
240
		  $EndAction
241
		./
242
		
243
		| t h e n
244
		/.$BeginAction
245
			$setResult($_then);
246
		  $EndAction
247
		./
248
		
249
		| e l s e
250
		/.$BeginAction
251
			$setResult($_else);
252
		  $EndAction
253
		./
254
		
255
		| e n d i f
256
		/.$BeginAction
257
			$setResult($_endif);
258
		  $EndAction
259
		./
260
		
261
		| a n d
262
		/.$BeginAction
263
			$setResult($_and);
264
		  $EndAction
265
		./
266
		
267
		| o r
268
		/.$BeginAction
269
			$setResult($_or);
270
		  $EndAction
271
		./
272
		
273
		| x o r
274
		/.$BeginAction
275
			$setResult($_xor);
276
		  $EndAction
277
		./
278
		
279
		| n o t
280
		/.$BeginAction
281
			$setResult($_not);
282
		  $EndAction
283
		./
284
		
285
		| i m p l i e s
286
		/.$BeginAction
287
			$setResult($_implies);
288
		  $EndAction
289
		./
290
		
291
		| l e t
292
		/.$BeginAction
293
			$setResult($_let);
294
		  $EndAction
295
		./
296
		
297
		| i n
298
		/.$BeginAction
299
			$setResult($_in);
300
		  $EndAction
301
		./
302
		
303
		| t r u e
304
		/.$BeginAction
305
			$setResult($_true);
306
		  $EndAction
307
		./
308
		
309
		| f a l s e
310
		/.$BeginAction
311
			$setResult($_false);
312
		  $EndAction
313
		./
314
		
315
		| S e t
316
		/.$BeginAction
317
			$setResult($_Set);
318
		  $EndAction
319
		./
320
		
321
		| B a g
322
		/.$BeginAction
323
			$setResult($_Bag);
324
		  $EndAction
325
		./
326
		
327
		| S e q u e n c e
328
		/.$BeginAction
329
			$setResult($_Sequence);
330
		  $EndAction
331
		./
332
		
333
		| C o l l e c t i o n
334
		/.$BeginAction
335
			$setResult($_Collection);
336
		  $EndAction
337
		./
338
339
		| O r d e r e d S e t
340
		/.$BeginAction
341
			$setResult($_OrderedSet);
342
		  $EndAction
343
		./
344
345
		| i t e r a t e
346
		/.$BeginAction
347
			$setResult($_iterate);
348
		  $EndAction
349
		./
350
		
351
		| f o r A l l
352
		/.$BeginAction
353
			$setResult($_forAll);
354
		  $EndAction
355
		./
356
		
357
		| e x i s t s
358
		/.$BeginAction
359
			$setResult($_exists);
360
		  $EndAction
361
		./
362
		
363
		| i s U n i q u e
364
		/.$BeginAction
365
			$setResult($_isUnique);
366
		  $EndAction
367
		./
368
		
369
		| a n y
370
		/.$BeginAction
371
			$setResult($_any);
372
		  $EndAction
373
		./
374
		
375
		| o n e
376
		/.$BeginAction
377
			$setResult($_one);
378
		  $EndAction
379
		./
380
381
		| c o l l e c t
382
		/.$BeginAction
383
			$setResult($_collect);
384
		  $EndAction
385
		./
386
		
387
		| s e l e c t
388
		/.$BeginAction
389
			$setResult($_select);
390
		  $EndAction
391
		./
392
		
393
		| r e j e c t
394
		/.$BeginAction
395
			$setResult($_reject);
396
		  $EndAction
397
		./
398
		
399
		| c o l l e c t N e s t e d
400
		/.$BeginAction
401
			$setResult($_collectNested);
402
		  $EndAction
403
		./
404
		
405
		| s o r t e d B y
406
		/.$BeginAction
407
			$setResult($_sortedBy);
408
		  $EndAction
409
		./
410
411
		| c l o s u r e
412
		/.$BeginAction
413
			$setResult($_closure);
414
		  $EndAction
415
		./
416
		
417
		| o c l I s K i n d O f
418
		/.$BeginAction
419
			$setResult($_oclIsKindOf);
420
		  $EndAction
421
		./
422
423
		| o c l I s T y p e O f
424
		/.$BeginAction
425
			$setResult($_oclIsTypeOf);
426
		  $EndAction
427
		./
428
		
429
		| o c l A s T y p e
430
		/.$BeginAction
431
			$setResult($_oclAsType);
432
		  $EndAction
433
		./
434
		
435
		| o c l I s N e w
436
		/.$BeginAction
437
			$setResult($_oclIsNew);
438
		  $EndAction
439
		./
440
		
441
		| o c l I s U n d e f i n e d
442
		/.$BeginAction
443
			$setResult($_oclIsUndefined);
444
		  $EndAction
445
		./
446
		
447
		| o c l I s I n v a l i d
448
		/.$BeginAction
449
			$setResult($_oclIsInvalid);
450
		  $EndAction
451
		./
452
		
453
		| o c l I s I n S t a t e
454
		/.$BeginAction
455
			$setResult($_oclIsInState);
456
		  $EndAction
457
		./
458
		
459
		| a l l I n s t a n c e s
460
		/.$BeginAction
461
			$setResult($_allInstances);
462
		  $EndAction
463
		./
464
465
		| S t r i n g
466
		/.$BeginAction
467
			$setResult($_String);
468
		  $EndAction
469
		./
470
471
		| I n t e g e r
472
		/.$BeginAction
473
			$setResult($_Integer);
474
		  $EndAction
475
		./
476
		
477
		| U n l i m i t e d N a t u r a l
478
		/.$BeginAction
479
			$setResult($_UnlimitedNatural);
480
		  $EndAction
481
		./
482
		
483
		| R e a l
484
		/.$BeginAction
485
			$setResult($_Real);
486
		  $EndAction
487
		./
488
		
489
		| B o o l e a n
490
		/.$BeginAction
491
			$setResult($_Boolean);
492
		  $EndAction
493
		./
494
495
		| T u p l e
496
		/.$BeginAction
497
			$setResult($_Tuple);
498
		  $EndAction
499
		./
500
501
		| O c l A n y
502
		/.$BeginAction
503
			$setResult($_OclAny);
504
		  $EndAction
505
		./
506
507
		| O c l V o i d
508
		/.$BeginAction
509
			$setResult($_OclVoid);
510
		  $EndAction
511
		./
512
513
		| I n v a l i d
514
		/.$BeginAction
515
			$setResult($_Invalid);
516
		  $EndAction
517
		./
518
519
		| O c l M e s s a g e
520
		/.$BeginAction
521
			$setResult($_OclMessage);
522
		  $EndAction
523
		./
524
525
		| n u l l
526
		/.$BeginAction
527
			$setResult($_null);
528
		  $EndAction
529
		./
530
531
		| O c l I n v a l i d
532
		/.$BeginAction
533
			$setResult($_OclInvalid);
534
		  $EndAction
535
		./
536
537
		| a t t r
538
		/.$BeginAction
539
			$setResult($_attr);
540
		  $EndAction
541
		./
542
543
		| o p e r
544
		/.$BeginAction
545
			$setResult($_oper);
546
		  $EndAction
547
		./
548
%End
(-)src/org/eclipse/ocl/lpg/KWLexerMapF.gi (+78 lines)
Added Link Here
1
%Terminals
2
    DollarSign ::= '$'
3
    Percent ::= '%'
4
    _
5
    a b c d e f g h i j k l m n o p q r s t u v w x y z
6
    A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
7
%End
8
9
%Headers
10
    /.
11
        final static int tokenKind[] = new int[128];
12
        static
13
        {
14
            tokenKind['$'] = $sym_type.$prefix$DollarSign$suffix$;
15
            tokenKind['%'] = $sym_type.$prefix$Percent$suffix$;
16
            tokenKind['_'] = $sym_type.$prefix$_$suffix$;
17
18
            tokenKind['a'] = $sym_type.$prefix$a$suffix$;
19
            tokenKind['b'] = $sym_type.$prefix$b$suffix$;
20
            tokenKind['c'] = $sym_type.$prefix$c$suffix$;
21
            tokenKind['d'] = $sym_type.$prefix$d$suffix$;
22
            tokenKind['e'] = $sym_type.$prefix$e$suffix$;
23
            tokenKind['f'] = $sym_type.$prefix$f$suffix$;
24
            tokenKind['g'] = $sym_type.$prefix$g$suffix$;
25
            tokenKind['h'] = $sym_type.$prefix$h$suffix$;
26
            tokenKind['i'] = $sym_type.$prefix$i$suffix$;
27
            tokenKind['j'] = $sym_type.$prefix$j$suffix$;
28
            tokenKind['k'] = $sym_type.$prefix$k$suffix$;
29
            tokenKind['l'] = $sym_type.$prefix$l$suffix$;
30
            tokenKind['m'] = $sym_type.$prefix$m$suffix$;
31
            tokenKind['n'] = $sym_type.$prefix$n$suffix$;
32
            tokenKind['o'] = $sym_type.$prefix$o$suffix$;
33
            tokenKind['p'] = $sym_type.$prefix$p$suffix$;
34
            tokenKind['q'] = $sym_type.$prefix$q$suffix$;
35
            tokenKind['r'] = $sym_type.$prefix$r$suffix$;
36
            tokenKind['s'] = $sym_type.$prefix$s$suffix$;
37
            tokenKind['t'] = $sym_type.$prefix$t$suffix$;
38
            tokenKind['u'] = $sym_type.$prefix$u$suffix$;
39
            tokenKind['v'] = $sym_type.$prefix$v$suffix$;
40
            tokenKind['w'] = $sym_type.$prefix$w$suffix$;
41
            tokenKind['x'] = $sym_type.$prefix$x$suffix$;
42
            tokenKind['y'] = $sym_type.$prefix$y$suffix$;
43
            tokenKind['z'] = $sym_type.$prefix$z$suffix$;
44
45
            tokenKind['A'] = $sym_type.$prefix$A$suffix$;
46
            tokenKind['B'] = $sym_type.$prefix$B$suffix$;
47
            tokenKind['C'] = $sym_type.$prefix$C$suffix$;
48
            tokenKind['D'] = $sym_type.$prefix$D$suffix$;
49
            tokenKind['E'] = $sym_type.$prefix$E$suffix$;
50
            tokenKind['F'] = $sym_type.$prefix$F$suffix$;
51
            tokenKind['G'] = $sym_type.$prefix$G$suffix$;
52
            tokenKind['H'] = $sym_type.$prefix$H$suffix$;
53
            tokenKind['I'] = $sym_type.$prefix$I$suffix$;
54
            tokenKind['J'] = $sym_type.$prefix$J$suffix$;
55
            tokenKind['K'] = $sym_type.$prefix$K$suffix$;
56
            tokenKind['L'] = $sym_type.$prefix$L$suffix$;
57
            tokenKind['M'] = $sym_type.$prefix$M$suffix$;
58
            tokenKind['N'] = $sym_type.$prefix$N$suffix$;
59
            tokenKind['O'] = $sym_type.$prefix$O$suffix$;
60
            tokenKind['P'] = $sym_type.$prefix$P$suffix$;
61
            tokenKind['Q'] = $sym_type.$prefix$Q$suffix$;
62
            tokenKind['R'] = $sym_type.$prefix$R$suffix$;
63
            tokenKind['S'] = $sym_type.$prefix$S$suffix$;
64
            tokenKind['T'] = $sym_type.$prefix$T$suffix$;
65
            tokenKind['U'] = $sym_type.$prefix$U$suffix$;
66
            tokenKind['V'] = $sym_type.$prefix$V$suffix$;
67
            tokenKind['W'] = $sym_type.$prefix$W$suffix$;
68
            tokenKind['X'] = $sym_type.$prefix$X$suffix$;
69
            tokenKind['Y'] = $sym_type.$prefix$Y$suffix$;
70
            tokenKind['Z'] = $sym_type.$prefix$Z$suffix$;
71
        };
72
    
73
        final int getKind(char c)
74
        {
75
            return (((c & 0xFFFFFF80) == 0) /* 0 <= c < 128? */ ? tokenKind[c] : 0);
76
        }
77
    ./
78
%End
(-)src/org/eclipse/ocl/lpg/LexerBasicMapF.gi (+269 lines)
Added Link Here
1
%Headers
2
    --
3
    -- Additional methods for the action class not provided in the template
4
    --
5
    
6
	--
7
	-- In grammar file including this .gi file should define the following macros
8
	--        $kw_lexeR_class  => the keyword lexer class
9
	--        $super_stream_class => the class which the generated lexer inherits from
10
	--
11
    -- [cwd] Template provided by LPG defines a constructor that uses an Option
12
    --       class that does not exist in LPG Runtime.  Deleted this constructor
13
    
14
    -- [adolfosbh] The previous old cwd's comment has been corrected in this
15
    --       template version   
16
17
    -- [adolfosbh] a constructor method has been moved to LexerTemplate D.gi file	
18
    /.
19
        //
20
        // The Lexer contains an array of characters as the input stream to be parsed.
21
        // There are methods to retrieve and classify characters.
22
        // The lexparser "token" is implemented simply as the index of the next character in the array.
23
        // The Lexer extends the abstract class LpgLexStream with an implementation of the abstract
24
        // method getKind.  The template defines the Lexer class and the lexer() method.
25
        // A driver creates the action class, "Lexer", passing an Option object to the constructor.
26
        //
27
        $kw_lexer_class kwLexer;
28
        boolean printTokens;
29
        private final static int ECLIPSE_TAB_VALUE = 4;
30
31
        public int [] getKeywordKinds() { return kwLexer.getKeywordKinds(); }
32
33
34
        /**
35
         * @deprecated function replaced by {@link #reset(char [] content, String filename)}
36
         */
37
        public void initialize(char [] content, String filename)
38
        {
39
            reset(content, filename);
40
        }
41
        
42
        final void makeToken(int left_token, int right_token, int kind)
43
        {
44
            lexStream.makeToken(left_token, right_token, kind);
45
        }
46
        
47
        final void makeToken(int kind)
48
        {
49
            int startOffset = getLeftSpan(),
50
                endOffset = getRightSpan();
51
            lexStream.makeToken(startOffset, endOffset, kind);
52
            if (printTokens) printValue(startOffset, endOffset);
53
        }
54
55
        final void makeComment(int kind)
56
        {
57
            int startOffset = getLeftSpan(),
58
                endOffset = getRightSpan();
59
            lexStream.getIPrsStream().makeAdjunct(startOffset, endOffset, kind);
60
        }
61
62
        final void skipToken()
63
        {
64
            if (printTokens) printValue(getLeftSpan(), getRightSpan());
65
        }
66
        
67
        final void checkForKeyWord()
68
        {
69
            int startOffset = getLeftSpan(),
70
                endOffset = getRightSpan(),
71
                kwKind = kwLexer.lexer(startOffset, endOffset);
72
            lexStream.makeToken(startOffset, endOffset, kwKind);
73
            if (printTokens) printValue(startOffset, endOffset);
74
        }
75
        
76
        //
77
        // This flavor of checkForKeyWord is necessary when the default kind
78
        // (which is returned when the keyword filter doesn't match) is something
79
        // other than _IDENTIFIER.
80
        //
81
        final void checkForKeyWord(int defaultKind)
82
        {
83
            int startOffset = getLeftSpan(),
84
                endOffset = getRightSpan(),
85
                kwKind = kwLexer.lexer(startOffset, endOffset);
86
            if (kwKind == $_IDENTIFIER)
87
                kwKind = defaultKind;
88
            lexStream.makeToken(startOffset, endOffset, kwKind);
89
            if (printTokens) printValue(startOffset, endOffset);
90
        }
91
        
92
        final void printValue(int startOffset, int endOffset)
93
        {
94
            String s = new String(lexStream.getInputChars(), startOffset, endOffset - startOffset + 1);
95
            System.out.print(s);
96
        }
97
98
        //
99
        //
100
        //
101
        static class $super_stream_class extends AbstractLexerStream
102
        {
103
        public final static int tokenKind[] =
104
        {
105
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 000    0x00
106
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 001    0x01
107
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 002    0x02
108
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 003    0x03
109
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 004    0x04
110
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 005    0x05
111
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 006    0x06
112
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 007    0x07
113
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 008    0x08
114
            $sym_type.$prefix$HT$suffix$,              // 009    0x09
115
            $sym_type.$prefix$LF$suffix$,              // 010    0x0A
116
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 011    0x0B
117
            $sym_type.$prefix$FF$suffix$,              // 012    0x0C
118
            $sym_type.$prefix$CR$suffix$,              // 013    0x0D
119
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 014    0x0E
120
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 015    0x0F
121
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 016    0x10
122
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 017    0x11
123
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 018    0x12
124
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 019    0x13
125
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 020    0x14
126
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 021    0x15
127
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 022    0x16
128
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 023    0x17
129
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 024    0x18
130
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 025    0x19
131
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 026    0x1A
132
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 027    0x1B
133
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 028    0x1C
134
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 029    0x1D
135
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 030    0x1E
136
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 031    0x1F
137
            $sym_type.$prefix$Space$suffix$,           // 032    0x20
138
            $sym_type.$prefix$Exclamation$suffix$,     // 033    0x21
139
            $sym_type.$prefix$DoubleQuote$suffix$,     // 034    0x22
140
            $sym_type.$prefix$Sharp$suffix$,           // 035    0x23
141
            $sym_type.$prefix$DollarSign$suffix$,      // 036    0x24
142
            $sym_type.$prefix$Percent$suffix$,         // 037    0x25
143
            $sym_type.$prefix$Ampersand$suffix$,       // 038    0x26
144
            $sym_type.$prefix$SingleQuote$suffix$,     // 039    0x27
145
            $sym_type.$prefix$LeftParen$suffix$,       // 040    0x28
146
            $sym_type.$prefix$RightParen$suffix$,      // 041    0x29
147
            $sym_type.$prefix$Star$suffix$,            // 042    0x2A
148
            $sym_type.$prefix$Plus$suffix$,            // 043    0x2B
149
            $sym_type.$prefix$Comma$suffix$,           // 044    0x2C
150
            $sym_type.$prefix$Minus$suffix$,           // 045    0x2D
151
            $sym_type.$prefix$Dot$suffix$,             // 046    0x2E
152
            $sym_type.$prefix$Slash$suffix$,           // 047    0x2F
153
            $sym_type.$prefix$0$suffix$,               // 048    0x30
154
            $sym_type.$prefix$1$suffix$,               // 049    0x31
155
            $sym_type.$prefix$2$suffix$,               // 050    0x32
156
            $sym_type.$prefix$3$suffix$,               // 051    0x33
157
            $sym_type.$prefix$4$suffix$,               // 052    0x34
158
            $sym_type.$prefix$5$suffix$,               // 053    0x35
159
            $sym_type.$prefix$6$suffix$,               // 054    0x36
160
            $sym_type.$prefix$7$suffix$,               // 055    0x37
161
            $sym_type.$prefix$8$suffix$,               // 056    0x38
162
            $sym_type.$prefix$9$suffix$,               // 057    0x39
163
            $sym_type.$prefix$Colon$suffix$,           // 058    0x3A
164
            $sym_type.$prefix$SemiColon$suffix$,       // 059    0x3B
165
            $sym_type.$prefix$LessThan$suffix$,        // 060    0x3C
166
            $sym_type.$prefix$Equal$suffix$,           // 061    0x3D
167
            $sym_type.$prefix$GreaterThan$suffix$,     // 062    0x3E
168
            $sym_type.$prefix$QuestionMark$suffix$,    // 063    0x3F
169
            $sym_type.$prefix$AtSign$suffix$,          // 064    0x40
170
            $sym_type.$prefix$A$suffix$,               // 065    0x41
171
            $sym_type.$prefix$B$suffix$,               // 066    0x42
172
            $sym_type.$prefix$C$suffix$,               // 067    0x43
173
            $sym_type.$prefix$D$suffix$,               // 068    0x44
174
            $sym_type.$prefix$E$suffix$,               // 069    0x45
175
            $sym_type.$prefix$F$suffix$,               // 070    0x46
176
            $sym_type.$prefix$G$suffix$,               // 071    0x47
177
            $sym_type.$prefix$H$suffix$,               // 072    0x48
178
            $sym_type.$prefix$I$suffix$,               // 073    0x49
179
            $sym_type.$prefix$J$suffix$,               // 074    0x4A
180
            $sym_type.$prefix$K$suffix$,               // 075    0x4B
181
            $sym_type.$prefix$L$suffix$,               // 076    0x4C
182
            $sym_type.$prefix$M$suffix$,               // 077    0x4D
183
            $sym_type.$prefix$N$suffix$,               // 078    0x4E
184
            $sym_type.$prefix$O$suffix$,               // 079    0x4F
185
            $sym_type.$prefix$P$suffix$,               // 080    0x50
186
            $sym_type.$prefix$Q$suffix$,               // 081    0x51
187
            $sym_type.$prefix$R$suffix$,               // 082    0x52
188
            $sym_type.$prefix$S$suffix$,               // 083    0x53
189
            $sym_type.$prefix$T$suffix$,               // 084    0x54
190
            $sym_type.$prefix$U$suffix$,               // 085    0x55
191
            $sym_type.$prefix$V$suffix$,               // 086    0x56
192
            $sym_type.$prefix$W$suffix$,               // 087    0x57
193
            $sym_type.$prefix$X$suffix$,               // 088    0x58
194
            $sym_type.$prefix$Y$suffix$,               // 089    0x59
195
            $sym_type.$prefix$Z$suffix$,               // 090    0x5A
196
            $sym_type.$prefix$LeftBracket$suffix$,     // 091    0x5B
197
            $sym_type.$prefix$BackSlash$suffix$,       // 092    0x5C
198
            $sym_type.$prefix$RightBracket$suffix$,    // 093    0x5D
199
            $sym_type.$prefix$Caret$suffix$,           // 094    0x5E
200
            $sym_type.$prefix$_$suffix$,               // 095    0x5F
201
            $sym_type.$prefix$BackQuote$suffix$,       // 096    0x60
202
            $sym_type.$prefix$a$suffix$,               // 097    0x61
203
            $sym_type.$prefix$b$suffix$,               // 098    0x62
204
            $sym_type.$prefix$c$suffix$,               // 099    0x63
205
            $sym_type.$prefix$d$suffix$,               // 100    0x64
206
            $sym_type.$prefix$e$suffix$,               // 101    0x65
207
            $sym_type.$prefix$f$suffix$,               // 102    0x66
208
            $sym_type.$prefix$g$suffix$,               // 103    0x67
209
            $sym_type.$prefix$h$suffix$,               // 104    0x68
210
            $sym_type.$prefix$i$suffix$,               // 105    0x69
211
            $sym_type.$prefix$j$suffix$,               // 106    0x6A
212
            $sym_type.$prefix$k$suffix$,               // 107    0x6B
213
            $sym_type.$prefix$l$suffix$,               // 108    0x6C
214
            $sym_type.$prefix$m$suffix$,               // 109    0x6D
215
            $sym_type.$prefix$n$suffix$,               // 110    0x6E
216
            $sym_type.$prefix$o$suffix$,               // 111    0x6F
217
            $sym_type.$prefix$p$suffix$,               // 112    0x70
218
            $sym_type.$prefix$q$suffix$,               // 113    0x71
219
            $sym_type.$prefix$r$suffix$,               // 114    0x72
220
            $sym_type.$prefix$s$suffix$,               // 115    0x73
221
            $sym_type.$prefix$t$suffix$,               // 116    0x74
222
            $sym_type.$prefix$u$suffix$,               // 117    0x75
223
            $sym_type.$prefix$v$suffix$,               // 118    0x76
224
            $sym_type.$prefix$w$suffix$,               // 119    0x77
225
            $sym_type.$prefix$x$suffix$,               // 120    0x78
226
            $sym_type.$prefix$y$suffix$,               // 121    0x79
227
            $sym_type.$prefix$z$suffix$,               // 122    0x7A
228
            $sym_type.$prefix$LeftBrace$suffix$,       // 123    0x7B
229
            $sym_type.$prefix$VerticalBar$suffix$,     // 124    0x7C
230
            $sym_type.$prefix$RightBrace$suffix$,      // 125    0x7D
231
            $sym_type.$prefix$Tilde$suffix$,           // 126    0x7E
232
            $sym_type.$prefix$CtlCharNotWS$suffix$,    // 127    0x7F
233
234
            $sym_type.$prefix$Acute$suffix$,           // for the acute accent 0xb4
235
            $sym_type.$prefix$AfterASCIINotAcute$suffix$,      // for all chars in range 0x80..0xfffe excluding the acute accent
236
            $sym_type.$prefix$EOF$suffix$              // for '\uffff' or 65535 
237
        };
238
                
239
        public final int getKind(int i)  // Classify character at ith location
240
        {
241
            char c = (i >= getStreamLength() ? '\uffff' : getCharValue(i));
242
            return (c < 128) // ASCII Character
243
                      ? tokenKind[c] 
244
                      : (c == '\uffff')
245
	                      ?$sym_type.$prefix$EOF$suffix$
246
	                      : (c == '\u00b4')
247
                                ? $sym_type.$prefix$EOF$suffix$
248
                                : $sym_type.$prefix$AfterASCIINotAcute$suffix$;
249
        }
250
251
        public String[] orderedExportedSymbols() { return $exp_type.orderedTerminalSymbols; }
252
253
        public $super_stream_class($environment_class environment, String filename, int tab) throws java.io.IOException
254
        {
255
            super($adapt_environment, filename, tab);
256
        }
257
258
        public $super_stream_class($environment_class environment, char[] input_chars, String filename, int tab)
259
        {
260
            super($adapt_environment, input_chars, filename, tab);
261
        }
262
    
263
        public $super_stream_class($environment_class environment, char[] input_chars, String filename)
264
        {
265
            super($adapt_environment, input_chars, filename, 1);
266
        }
267
        }
268
    ./
269
%End
(-)src/org/eclipse/ocl/lpg/AbstractLexerStream.java (+63 lines)
Added Link Here
1
package org.eclipse.ocl.lpg;
2
3
import lpg.runtime.LpgLexStream;
4
5
6
/**
7
 * @since 3.0
8
 */
9
public abstract class AbstractLexerStream extends LpgLexStream {
10
	
11
	protected final static int ECLIPSE_TAB_VALUE = 4;	
12
	private BasicEnvironment environment;
13
	
14
    public AbstractLexerStream(BasicEnvironment environment, String filename, int tab) throws java.io.IOException 
15
    {
16
        super(filename, tab);
17
        this.environment = environment;
18
    }
19
20
    public AbstractLexerStream(BasicEnvironment environment, char[] input_chars, String filename, int tab)
21
    {
22
        super(input_chars, filename, tab);
23
        this.environment = environment;
24
    }
25
26
    public AbstractLexerStream() {
27
    	super();
28
    	setTab(ECLIPSE_TAB_VALUE);
29
    }
30
    
31
	protected int computeErrorCode(int leftToken, int rightToken) {
32
		if (rightToken >= getStreamLength())
33
		    return EOF_CODE;
34
		else if (leftToken == rightToken)
35
		    return LEX_ERROR_CODE;
36
		else
37
			return INVALID_TOKEN_CODE;
38
	}
39
	
40
    /**
41
	 * Define the input text as a given array of characters.
42
     * @param buffer the characters
43
     */
44
	public void initialize(char[] inputChars) {	
45
		setInputChars(inputChars);
46
        setStreamLength(inputChars.length);
47
        computeLineOffsets();
48
	}
49
	
50
	/**
51
	 * Errors generated within the lexer are redirected to the error handler if there is one.
52
	 * 
53
	 * Note that other variants of reportError either feed this one, are fed from a default implementation
54
	 * of this one or originate in the parser, where a ParserErrorHandler can intercept them.
55
	 */
56
	public void reportError(int errorCode, int leftToken, int errorToken,
57
			int rightToken, String[] errorInfo) {
58
		if (environment != null)
59
			environment.lexerError(errorCode, errorToken, rightToken);
60
		reportError(errorCode, leftToken, errorToken, rightToken, errorInfo);
61
	}
62
63
}
(-)src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingKWLexer.gi (+35 lines)
Added Link Here
1
--/**
2
-- * <copyright>
3
-- *
4
-- * Copyright (c) 2008, 2009 IBM Corporation, Open Canarias S.L. and others.
5
-- * All rights reserved.   This program and the accompanying materials
6
-- * are made available under the terms of the Eclipse Public License v1.0
7
-- * which accompanies this distribution, and is available at
8
-- * http://www.eclipse.org/legal/epl-v10.html
9
-- *
10
-- * Contributors:
11
-- *   IBM - Initial API and implementation
12
-- *   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
13
-- *   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
14
-- *
15
-- * </copyright>
16
-- *
17
-- * $Id: OCLBacktrackingKWLexer.g,v 1.1 2009/01/13 20:31:30 cdamus Exp $
18
-- */
19
--
20
-- The OCL Backtracking KeyWord Lexer, which is nominally identical to the
21
-- normal KeyWord Lexer, however the extra ERROR_TOKEN symbol makes it difficult
22
-- to share reliably.
23
--
24
25
%options slr
26
%options fp=OCLBacktrackingKWLexer,prefix=Char_
27
%options noserialize
28
%options package=org.eclipse.ocl.parser.backtracking
29
%options template=../../lpg/KeywordTemplateF.gi
30
%options export_terminals=("OCLBacktrackingParsersym.java", "TK_")
31
%options include_directory="..;../../lpg"
32
33
%Import
34
	OCLKWLexer.gi
35
%End
(-)src/org/eclipse/ocl/lpg/OCLParserStream.java (+150 lines)
Added Link Here
1
package org.eclipse.ocl.lpg;
2
3
import java.util.ArrayList;
4
5
import lpg.runtime.ErrorToken;
6
import lpg.runtime.ILexStream;
7
import lpg.runtime.IToken;
8
import lpg.runtime.PrsStream;
9
import lpg.runtime.Token;
10
11
12
/**
13
 * @since 3.0
14
 */
15
public class OCLParserStream extends PrsStream {
16
	
17
	 private BasicEnvironment environment;
18
	 
19
	 public OCLParserStream(BasicEnvironment env, ILexStream iLexStream) {
20
		 super(iLexStream);
21
		 this.environment = env;
22
	 }
23
	 
24
	 @Override
25
		public void reportError(int errorCode, int leftToken, int errorToken,
26
				int rightToken, String errorInfo[]) {		
27
			if (environment == null) {
28
				super.reportError(errorCode, leftToken, errorToken, rightToken, errorInfo);
29
			} else {
30
				// TODO Revise this. BasicEnvironment.parserError doesn't have a String[] argument
31
				String tokenText = errorInfo.length > 0 ? errorInfo[0] : ""; //$NON-NLS-1$		
32
				if (errorCode == PrsStream.DELETION_CODE || errorCode == PrsStream.MISPLACED_CODE) {
33
					tokenText = ""; //$NON-NLS-1$
34
				}
35
				environment
36
					.parserError(errorCode, leftToken, rightToken, tokenText); 
37
			}
38
		}
39
	/**
40
	 * Overridden to search only the non-Error nodes, which are the only tokens
41
	 * in monotonic order.
42
	 */
43
	@Override
44
	public int getTokenIndexAtCharacter(int offset) {
45
		int low = 0;
46
		int high = getSize();
47
		while (high > low) {
48
			IToken highToken = getTokenAt(high - 1);
49
			if (!(highToken instanceof ErrorToken)) {
50
				break;
51
			}
52
			high--;
53
		}
54
		while (high > low) {
55
			int mid = (high + low) / 2;
56
			IToken mid_element = getTokenAt(mid);
57
			if (offset >= mid_element.getStartOffset()
58
				&& offset <= mid_element.getEndOffset()) {
59
				return mid;
60
			} else if (offset < mid_element.getStartOffset()) {
61
				high = mid;
62
			} else {
63
				low = mid + 1;
64
			}
65
		}
66
67
		return -(low - 1);
68
	}
69
	
70
	@Override
71
	public int makeErrorToken(int firsttok, int lasttok, int errortok, int kind) {
72
		@SuppressWarnings("unchecked")
73
		ArrayList<IToken> tokens = getTokens();
74
		int index = tokens.size(); // the next index
75
76
		//
77
		// Note that when creating an error token, we do not remap its kind.
78
		// Since this is not a lexical operation, it is the responsibility of
79
		// the calling program (a parser driver) to pass to us the proper kind
80
		// that it wants for an error token.
81
		//
82
		Token token = new ErrorToken(getIToken(firsttok), getIToken(lasttok),
83
			getIToken(errortok), getStartOffset(firsttok),
84
			getEndOffset(lasttok), kind) {
85
86
			@Override
87
			public String toString() {
88
				if (getIPrsStream() == null) {
89
					return "<toString>"; //$NON-NLS-1$
90
				}
91
				int startOffset = getStartOffset();
92
				int length = getEndOffset() - startOffset;
93
				if (length < 0) {
94
					length = -length - 1;
95
					startOffset = getEndOffset();
96
				}
97
				if ((startOffset + length) > getIPrsStream().getInputChars().length) {
98
					return String.valueOf(IToken.EOF);
99
				}
100
				return new String(getIPrsStream().getInputChars(), startOffset,
101
					length);
102
			}
103
104
		};
105
		token.setTokenIndex(index);
106
		tokens.add(token);
107
		token.setAdjunctIndex(getAdjuncts().size());
108
		return index;
109
	}
110
111
	/**
112
	 * @since 1.3
113
	 */
114
	public int getErrorTokens() {
115
		return getTokens().size() - getStreamLength();
116
	}
117
118
	/**
119
	 * This function returns the index of the token element containing the
120
	 * offset specified. If such a token does not exist, it returns the negation
121
	 * of the index of the element immediately preceding the offset.
122
	 * 
123
	 * @since 1.3
124
	 */
125
	public ErrorToken getErrorTokenAtCharacter(int offset) {
126
		ErrorToken bestToken = null;
127
		for (int i = getSize(); --i >= 0;) {
128
			IToken token = getTokenAt(i);
129
			if (!(token instanceof ErrorToken)) {
130
				break;
131
			}
132
			IToken errorToken = ((ErrorToken) token).getErrorToken();
133
			if (offset >= errorToken.getStartOffset()
134
				&& offset <= errorToken.getEndOffset()) {
135
				if ((bestToken == null)
136
					|| ((bestToken.getStartOffset() <= errorToken
137
						.getStartOffset()) && (token.getEndOffset() <= errorToken
138
						.getEndOffset()))) {
139
					bestToken = (ErrorToken) token;
140
				}
141
			}
142
		}
143
		return bestToken;
144
	}
145
	public AbstractLexer getLexer() {
146
		return (AbstractLexer) super.getILexStream();
147
	}
148
	
149
	
150
}
(-)src/org/eclipse/ocl/lpg/dtParserTemplateF.gi (+377 lines)
Added Link Here
1
--
2
-- In a parser using this template, the following macro may be redefined:
3
--
4
--     $additional_interfaces
5
--     $ast_class
6
--
7
-- B E G I N N I N G   O F   T E M P L A T E   dtParserTemplateF
8
--
9
%Options programming_language=java,margin=4
10
%Options table,error_maps,scopes
11
%Options prefix=TK_
12
%Options action-block=("*.java", "/.", "./")
13
%Options ParseTable=lpg.runtime.ParseTable
14
15
--
16
-- This template requires that the name of the EOF token be set
17
-- to EOF_TOKEN to be consistent with LexerTemplateD and LexerTemplateE
18
--
19
%EOF
20
    EOF_TOKEN
21
%End
22
23
%ERROR
24
    ERROR_TOKEN
25
%End
26
27
%Define
28
	$Header
29
	/.
30
				//
31
				// Rule $rule_number:  $rule_text
32
				//
33
				./
34
35
    $BeginAction
36
    /.$Header$case $rule_number: {./
37
38
    $EndAction
39
    /.                break;
40
                }./
41
42
	-- BeginJava does nothing
43
	-- block-actions should call BeginCode, instead
44
    $BeginJava /../
45
    
46
  	-- EndJava does nothing
47
	-- block-actions should call EndCode, instead
48
	$EndJava /../
49
	
50
	$BeginCode
51
	/.$BeginAction
52
					$symbol_declarations./
53
54
	$EndCode /.$EndAction./
55
56
    $NoAction
57
    /.$Header$case $rule_number:
58
                    break;./
59
60
    $BadAction
61
    /.$Header$case $rule_number:
62
                    throw new Error("No action specified for rule " + $rule_number);./
63
64
    $NullAction
65
    /.$Header$case $rule_number:
66
                    setResult(null);
67
                    break;./
68
69
	$EmptyListAction
70
	/. $Header
71
				case $rule_number:
72
					setResult(new BasicEList());
73
					break;./
74
	
75
	$BeginActions
76
	/.
77
		@SuppressWarnings("unchecked")
78
        public void ruleAction(int ruleNumber)
79
        {
80
            switch (ruleNumber)
81
            {./
82
            
83
    $SplitActions
84
    /.
85
	            default:
86
	                ruleAction$rule_number(ruleNumber);
87
	                break;
88
	        }
89
	        return;
90
	    }
91
	
92
	    public void ruleAction$rule_number(int ruleNumber)
93
	    {
94
	        switch (ruleNumber)
95
	        {./
96
97
	$EndActions
98
	/.
99
				default:
100
					break;
101
			}
102
			return;
103
		}./
104
105
    $entry_declarations
106
    /.
107
        public $ast_class parse$entry_name()
108
        {
109
            return parse$entry_name(null, getDefaultRepairCount());
110
        }
111
            
112
        public $ast_class parse$entry_name(Monitor monitor)
113
        {
114
            return parse$entry_name(monitor, getDefaultRepairCount());
115
        }
116
            
117
        public $ast_class parse$entry_name(int error_repair_count)
118
        {
119
            return parse$entry_name(null, error_repair_count);
120
        }
121
            
122
        public void resetParse$entry_name()
123
        {
124
            dtParser.resetParserEntry($sym_type.$entry_marker);
125
        }
126
        
127
        public $ast_class parse$entry_name(Monitor monitor, int error_repair_count)
128
        {
129
            dtParser.setMonitor(monitor);
130
            
131
            try
132
            {
133
                return ($ast_class) dtParser.parseEntry($sym_type.$entry_marker);
134
            }
135
            catch (BadParseException e)
136
            {
137
                prsStream.reset(e.error_token); // point to error token
138
139
                DiagnoseParser diagnoseParser = new DiagnoseParser(prsStream, prsTable);
140
                diagnoseParser.diagnoseEntry($sym_type.$entry_marker, e.error_token);
141
            }
142
143
            return null;
144
        }
145
    ./
146
        
147
	$additional_interfaces /../
148
	$ast_class /.$ast_type./
149
	$unimplemented_symbols_warning /.false./
150
151
    $setSym1 /. // macro setSym1 is deprecated. Use function setResult
152
                getParser().setSym1./
153
    $setResult /. // macro setResult is deprecated. Use function setResult
154
                 getParser().setSym1./
155
    $getSym /. // macro getSym is deprecated. Use function getRhsSym
156
              getParser().getSym./
157
    $getToken /. // macro getToken is deprecated. Use function getRhsTokenIndex
158
                getParser().getToken./
159
    $getIToken /. // macro getIToken is deprecated. Use function getRhsIToken
160
                 prsStream.getIToken./
161
    $getLeftSpan /. // macro getLeftSpan is deprecated. Use function getLeftSpan
162
                   getParser().getFirstToken./
163
    $getRightSpan /. // macro getRightSpan is deprecated. Use function getRightSpan
164
                    getParser().getLastToken./
165
	
166
	$prs_stream /.prsStream./ -- DEPRECATED
167
	
168
	-- modified to include throwing exceptions
169
	$parserCore
170
	/.
171
172
	./
173
	-- OCL ADDITIONS
174
	
175
	-- Definition of macros used in the parser template
176
	--
177
	$super_parser_class /.AbstractOCLParser./
178
	$prs_stream_class /.OCLParserStream./		
179
	$prs_parser_class /.DeterministicParser./	
180
	$prs_parser_exception /.NotDeterministicParseTableException./
181
	$prs_parser_throw /.throw new RuntimeException("****Error: Regenerate $prs_type.java with -NOBACKTRACK option")./
182
	$prs_parse_args /../
183
	$lex_stream_class /.AbstractLexer./
184
	$action_class /.$file_prefix./  -- DEPRECATED
185
	$copyright_contributions /.*./
186
187
	-- package namespace of the LPG Runtime API
188
	$lpg_ns /.lpg.runtime./
189
190
	$NewCase
191
	/. $Header
192
				case $rule_number:./
193
%End
194
195
%Headers
196
    /.
197
   	public class $action_type extends $super_parser_class implements RuleAction$additional_interfaces
198
	{
199
		private $prs_stream_class prsStream = null;
200
		
201
		private boolean unimplementedSymbolsWarning = $unimplemented_symbols_warning;
202
203
		private static ParseTable prsTable = new $prs_type();
204
		public ParseTable getParseTable() { return prsTable; }
205
		
206
		private $prs_parser_class dtParser = null;
207
		public $prs_parser_class getParser() { return dtParser; }
208
		
209
		 private void setResult(Object object) { dtParser.setSym1(object); }
210
        public Object getRhsSym(int i) { return dtParser.getSym(i); }
211
212
        public int getRhsTokenIndex(int i) { return dtParser.getToken(i); }
213
        public IToken getRhsIToken(int i) { return prsStream.getIToken(getRhsTokenIndex(i)); }
214
        
215
        public int getRhsFirstTokenIndex(int i) { return dtParser.getFirstToken(i); }
216
        public IToken getRhsFirstIToken(int i) { return prsStream.getIToken(getRhsFirstTokenIndex(i)); }
217
218
        public int getRhsLastTokenIndex(int i) { return dtParser.getLastToken(i); }
219
        public IToken getRhsLastIToken(int i) { return prsStream.getIToken(getRhsLastTokenIndex(i)); }
220
221
        public int getLeftSpan() { return dtParser.getFirstToken(); }
222
        public IToken getLeftIToken()  { return prsStream.getIToken(getLeftSpan()); }
223
224
        public int getRightSpan() { return dtParser.getLastToken(); }
225
        public IToken getRightIToken() { return prsStream.getIToken(getRightSpan()); }
226
227
        public int getRhsErrorTokenIndex(int i)
228
        {
229
            int index = dtParser.getToken(i);
230
            IToken err = prsStream.getIToken(index);
231
            return (err instanceof ErrorToken ? index : 0);
232
        }
233
        public ErrorToken getRhsErrorIToken(int i)
234
        {
235
            int index = dtParser.getToken(i);
236
            IToken err = prsStream.getIToken(index);
237
            return (ErrorToken) (err instanceof ErrorToken ? err : null);
238
        }
239
240
		public void reset(ILexStream lexStream)
241
        {
242
            prsStream = new $prs_stream_class(getEnvironment(), lexStream);
243
            dtParser.reset(prsStream);
244
245
            try
246
            {
247
                prsStream.remapTerminalSymbols(orderedTerminalSymbols(), prsTable.getEoftSymbol());
248
            }
249
            catch(NullExportedSymbolsException e) {
250
            }
251
            catch(NullTerminalSymbolsException e) {
252
            }
253
            catch(UnimplementedTerminalsException e)
254
            {
255
                if (unimplementedSymbolsWarning) {
256
                    java.util.ArrayList<?> unimplemented_symbols = e.getSymbols();
257
                    System.out.println("The Lexer will not scan the following token(s):");
258
                    for (int i = 0; i < unimplemented_symbols.size(); i++)
259
                    {
260
                        Integer id = (Integer) unimplemented_symbols.get(i);
261
                        System.out.println("    " + $sym_type.orderedTerminalSymbols[id.intValue()]);               
262
                    }
263
                    System.out.println();
264
                }
265
            }
266
            catch(UndefinedEofSymbolException e)
267
            {
268
                throw new Error(new UndefinedEofSymbolException
269
                                    ("The Lexer does not implement the Eof symbol " +
270
                                     $sym_type.orderedTerminalSymbols[prsTable.getEoftSymbol()]));
271
            }
272
        }
273
	
274
        public $action_type($lex_stream_class lexer)
275
        {
276
        		super(lexer);        		
277
            try
278
            {
279
                dtParser = new $prs_parser_class(prsStream, prsTable, this);
280
            }
281
            catch ($prs_parser_exception e)
282
            {
283
                $prs_parser_throw;
284
            }
285
            catch (BadParseSymFileException e)
286
            {
287
                throw new Error(new BadParseSymFileException("Bad Parser Symbol File -- $sym_type.java. Regenerate $prs_type.java"));
288
            }
289
            
290
            reset(lexer.getILexStream());
291
        }		
292
293
        public int numTokenKinds() { return $sym_type.numTokenKinds; }
294
        public String[] orderedTerminalSymbols() { return $sym_type.orderedTerminalSymbols; }
295
        public String getTokenKindName(int kind) { return $sym_type.orderedTerminalSymbols[kind]; }            
296
        public int getEOFTokenKind() { return prsTable.getEoftSymbol(); }
297
        public $prs_stream_class getIPrsStream() { return prsStream; }
298
299
        /**
300
         * @deprecated replaced by {@link #getIPrsStream()}
301
         *
302
         */
303
        public PrsStream getPrsStream() { return prsStream; }
304
305
        /**
306
         * @deprecated replaced by {@link #getIPrsStream()}
307
         *
308
         */
309
        public PrsStream getParseStream() { return prsStream; }
310
311
        public $ast_class parser()
312
        {
313
            return parser(null, getDefaultRepairCount());
314
        }
315
            
316
        public $ast_class parser(Monitor monitor)
317
        {
318
            return parser(monitor, getDefaultRepairCount());
319
        }
320
            
321
        public $ast_class parser(int error_repair_count)
322
        {
323
            return parser(null, error_repair_count);
324
        }
325
            
326
        public $ast_class parser(Monitor monitor, int error_repair_count)
327
        {
328
            dtParser.setMonitor(monitor);
329
330
            try
331
            {
332
                return ($ast_class) dtParser.parse();
333
            }
334
            catch (BadParseException e)
335
            {
336
                prsStream.reset(e.error_token); // point to error token
337
338
                DiagnoseParser diagnoseParser = new DiagnoseParser(prsStream, prsTable);
339
                diagnoseParser.diagnose(e.error_token);
340
            }
341
342
            return null;
343
        }
344
345
        //
346
        // Additional entry points, if any
347
        //
348
        $entry_declarations
349
   
350
        // OCL Additions
351
352
		public $environment_class getOCLEnvironment() {
353
			return getLexer().getOCLEnvironment();
354
		}
355
		
356
		@Override
357
		public $lex_stream_class getLexer() {
358
			return ($lex_stream_class) super.getLexer();
359
		}
360
    ./
361
362
%End
363
364
%Rules
365
    /.$BeginActions./
366
%End
367
368
%Trailers
369
    /.
370
        $EndActions
371
    }
372
    ./
373
%End
374
375
--
376
-- E N D   O F   T E M P L A T E
377
--
(-)src/org/eclipse/ocl/parser/EssentialOCL.gi (+1572 lines)
Added Link Here
1
--/**
2
-- * <copyright>
3
-- *
4
-- * Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., 
5
-- * Open Canarias S.L and others.
6
-- * All rights reserved.   This program and the accompanying materials
7
-- * are made available under the terms of the Eclipse Public License v1.0
8
-- * which accompanies this distribution, and is available at
9
-- * http://www.eclipse.org/legal/epl-v10.html
10
-- *
11
-- * Contributors:
12
-- *   IBM - Initial API and implementation
13
-- *   E.D.Willink - Elimination of some shift-reduce conflicts
14
-- *   E.D.Willink - Remove unnecessary warning suppression
15
-- *   E.D.Willink - Bugs 225493, 243976, 259818
16
-- *   Zeligsoft - Bug 243976
17
-- *   Borland - Bug 242880
18
-- *   Adolfo Sanchez-Barbudo Herrera - LPG v 2.0.17 adoption
19
-- *
20
-- * </copyright>
21
-- *
22
-- * $Id: EssentialOCL.gi,v 1.7 2009/03/05 14:12:14 cdamus Exp $
23
-- */
24
--
25
-- The EssentialOCL Parser
26
--
27
28
29
%Notice
30
	/./**
31
 * <copyright>
32
 *
33
 * Copyright (c) 2005, 2009 IBM Corporation, Zeligsoft Inc., Borland Software Corp., 
34
 * Open Canarias S.L. and others.
35
 * All rights reserved.   This program and the accompanying materials
36
 * are made available under the terms of the Eclipse Public License v1.0
37
 * which accompanies this distribution, and is available at
38
 * http://www.eclipse.org/legal/epl-v10.html
39
 *
40
 * Contributors:
41
 *   IBM - Initial API and implementation
42
 *   E.D.Willink - Elimination of some shift-reduce conflicts
43
 *   E.D.Willink - Remove unnecessary warning suppression
44
 *   E.D.Willink - Bugs 225493, 243976, 259818
45
 *   Zeligsoft - Bug 243976
46
 *   Borland - Bug 242880
47
 *   Adolfo Sanchez- Barbudo Herrera - LPG v 2.0.17 adoption
48
$copyright_contributions
49
 * </copyright>
50
 *
51
 * $Id: EssentialOCL.g,v 1.7 2009/03/05 14:12:14 cdamus Exp $
52
 */
53
	./
54
%End
55
56
%Globals
57
	/.import org.eclipse.emf.common.util.BasicEList;
58
	import org.eclipse.emf.common.util.EList;
59
	import org.eclipse.ocl.cst.CSTNode;
60
	import org.eclipse.ocl.cst.CallExpCS;
61
	import org.eclipse.ocl.cst.CollectionTypeIdentifierEnum;
62
	import org.eclipse.ocl.cst.DotOrArrowEnum;
63
	import org.eclipse.ocl.cst.IntegerLiteralExpCS;
64
	import org.eclipse.ocl.cst.IsMarkedPreCS;
65
	import org.eclipse.ocl.cst.MessageExpCS;
66
	import org.eclipse.ocl.cst.OCLExpressionCS;
67
	import org.eclipse.ocl.cst.OCLMessageArgCS;
68
	import org.eclipse.ocl.cst.OperationCallExpCS;
69
	import org.eclipse.ocl.cst.PathNameCS;
70
	import org.eclipse.ocl.cst.SimpleNameCS;
71
	import org.eclipse.ocl.cst.SimpleTypeEnum;
72
	import org.eclipse.ocl.cst.StateExpCS;
73
	import org.eclipse.ocl.cst.StringLiteralExpCS;
74
	import org.eclipse.ocl.cst.TypeCS;
75
	import org.eclipse.ocl.cst.VariableCS;
76
	import org.eclipse.ocl.util.OCLStandardLibraryUtil;
77
	import org.eclipse.ocl.utilities.PredefinedType;
78
	import org.eclipse.ocl.lpg.OCLParserStream;
79
	
80
	import $lpg_ns.BadParseException;
81
	import $lpg_ns.BadParseSymFileException;
82
	import $lpg_ns.$prs_parser_class;
83
	import $lpg_ns.DiagnoseParser;
84
	import $lpg_ns.ErrorToken;
85
	import $lpg_ns.IToken;
86
	import $lpg_ns.ILexStream;
87
	import $lpg_ns.Monitor;
88
	import $lpg_ns.$prs_parser_exception;
89
	import $lpg_ns.NullExportedSymbolsException;
90
	import $lpg_ns.NullTerminalSymbolsException;
91
	import $lpg_ns.ParseTable;
92
	import $lpg_ns.PrsStream;
93
	import $lpg_ns.RuleAction;
94
	import $lpg_ns.UndefinedEofSymbolException;
95
	import $lpg_ns.UnimplementedTerminalsException;	
96
	./
97
%End
98
99
%KeyWords
100
	self
101
	inv
102
	pre
103
	post
104
	endpackage
105
	def
106
	if
107
	then
108
	else
109
	endif
110
	and
111
	or
112
	xor
113
	not
114
	implies
115
	let
116
	in
117
	true
118
	false
119
120
	--
121
	-- the following appear to have been omitted from the list of
122
	-- OCL reserved words in Section 7.4.9.  They will be treated 
123
	-- as unreserved for compliance
124
	--
125
	body
126
	derive
127
	init
128
	null
129
--  return  -- don't need a keyword for LPG purposes
130
131
	--
132
	-- the remainder of the LPG keywords are defined as such for the
133
	-- purpose of constructing the CST grammar.  They are not OCL
134
	-- reserved words
135
	--		
136
	Set
137
	Bag
138
	Sequence
139
	Collection
140
	OrderedSet
141
142
	iterate
143
	forAll
144
	exists
145
	isUnique
146
	any
147
	one
148
149
	collect
150
	select
151
	reject
152
	collectNested
153
	sortedBy
154
155
	closure
156
157
	oclIsKindOf
158
	oclIsTypeOf
159
	oclAsType
160
	oclIsNew
161
	oclIsUndefined
162
	oclIsInvalid
163
	oclIsInState
164
	allInstances
165
166
	String
167
	Integer
168
	UnlimitedNatural
169
	Real
170
	Boolean
171
	Tuple
172
	OclAny
173
	OclVoid
174
	Invalid
175
	OclMessage
176
	
177
	OclInvalid
178
%End
179
180
%Identifier
181
	IDENTIFIER
182
%End
183
184
%Terminals
185
	
186
	NUMERIC_OPERATION
187
188
	STRING_LITERAL
189
	INTEGER_LITERAL
190
	REAL_LITERAL
191
	
192
	PLUS     ::= '+'
193
	MINUS    ::= '-'
194
	MULTIPLY ::= '*'
195
	DIVIDE   ::= '/'
196
197
	GREATER       ::= '>'
198
	LESS          ::= '<'
199
	EQUAL         ::= '='
200
	GREATER_EQUAL ::= '>='
201
	LESS_EQUAL    ::= '<='
202
	NOT_EQUAL     ::= '<>'
203
204
	LPAREN   ::= '('
205
	RPAREN   ::= ')'
206
	LBRACE   ::= '{'
207
	RBRACE   ::= '}'
208
	LBRACKET ::= '['
209
	RBRACKET ::= ']'
210
211
	ARROW      ::= '->'
212
	BAR        ::= '|'
213
	COMMA      ::= ','
214
	COLON      ::= ':'
215
	COLONCOLON ::= '::'
216
	SEMICOLON  ::= ';'
217
	DOT        ::= '.'
218
	DOTDOT     ::= '..'
219
	ATPRE      ::= '@pre'
220
221
	CARET        ::= '^'
222
	CARETCARET   ::= '^^'
223
	QUESTIONMARK ::= '?'
224
225
%End
226
227
--$EOL
228
--	SEMICOLON
229
--$End
230
231
--$Start
232
--    goal
233
--$End
234
235
%Headers
236
	/.
237
	
238
	// Some methods to keep compatibility backwards
239
   /**
240
    * @since 3.0
241
    */
242
   protected IToken getIToken(int i) {
243
		return prsStream.getIToken(i);
244
	}
245
		
246
	protected String getTokenText(int i) {
247
		return prsStream.getTokenText(i);
248
	}
249
250
	./
251
%End
252
253
%Rules
254
255
	-- opt = optional
256
	-- m = multiple
257
258
	--
259
	-- Define a group of names that we define as keywords for the purpose
260
	-- of constructing an LPG grammar, but that are not reserved by OCL
261
	-- and are commonly used in models such as the UML metamodel, itself
262
	--
263
	
264
	binaryIdentifier -> oclIsUndefined
265
	binaryIdentifier -> oclIsInvalid
266
	binaryIdentifier -> oclIsNew
267
	binaryIdentifier -> oclAsType
268
	binaryIdentifier -> oclIsKindOf
269
	binaryIdentifier -> oclIsTypeOf
270
	binaryIdentifier -> EQUAL
271
	binaryIdentifier -> NOT_EQUAL
272
	binaryIdentifier -> PLUS
273
	binaryIdentifier -> MULTIPLY
274
	binaryIdentifier -> DIVIDE
275
	binaryIdentifier -> GREATER
276
	binaryIdentifier -> LESS
277
	binaryIdentifier -> GREATER_EQUAL
278
	binaryIdentifier -> LESS_EQUAL
279
	binaryIdentifier -> and
280
	binaryIdentifier -> or
281
	binaryIdentifier -> xor
282
283
	unaryIdentifier -> MINUS
284
	unaryIdentifier -> not
285
286
	iteratorIdentifier -> forAll
287
	iteratorIdentifier -> exists
288
	iteratorIdentifier -> isUnique
289
	iteratorIdentifier -> any
290
	iteratorIdentifier -> one
291
	iteratorIdentifier -> collect
292
	iteratorIdentifier -> select
293
	iteratorIdentifier -> reject
294
	iteratorIdentifier -> collectNested
295
	iteratorIdentifier -> sortedBy
296
	iteratorIdentifier -> closure
297
298
	keywordAsIdentifier1 -> iterate
299
	keywordAsIdentifier1 -> iteratorIdentifier
300
	keywordAsIdentifier1 -> allInstances
301
	keywordAsIdentifier1 -> body
302
	keywordAsIdentifier1 -> derive
303
	keywordAsIdentifier1 -> init
304
	keywordAsIdentifier1 -> Set
305
	keywordAsIdentifier1 -> Bag
306
	keywordAsIdentifier1 -> Sequence
307
	keywordAsIdentifier1 -> Collection
308
	keywordAsIdentifier1 -> OrderedSet
309
	--------
310
	keywordAsIdentifier -> keywordAsIdentifier1
311
	keywordAsIdentifier -> null
312
313
	binaryName -> simpleNameCS
314
	binaryName ::= binaryIdentifier
315
		/.$NewCase./
316
	keywordAsName ::= keywordAsIdentifier
317
		/.$NewCase./
318
	keywordAsName1 ::= keywordAsIdentifier1
319
		/.$NewCase./
320
	unaryName ::= unaryIdentifier
321
		/.$BeginCode
322
					SimpleNameCS result = createSimpleNameCS(
323
								SimpleTypeEnum.IDENTIFIER_LITERAL,
324
								getTokenText($getToken(1))
325
							);
326
					setOffsets(result, getIToken($getToken(1)));
327
					$setResult(result);
328
		  $EndCode
329
		./
330
		
331
	iterateName ::= iterate
332
		/.$NewCase./
333
	iteratorName ::= iteratorIdentifier
334
		/.$NewCase./
335
	oclIsInStateName ::= oclIsInState
336
		/.$BeginCode
337
					SimpleNameCS result = createSimpleNameCS(
338
								SimpleTypeEnum.KEYWORD_LITERAL,
339
								getTokenText($getToken(1))
340
							);
341
					setOffsets(result, getIToken($getToken(1)));
342
					$setResult(result);
343
		  $EndCode
344
		./
345
346
	--
347
	-- the 'operationCS' non-terminal is not referenced in this grammar
348
	--
349
	operationCS -> operationCS1
350
	operationCS -> operationCS2
351
	operationCS1 ::= IDENTIFIER '(' parametersCSopt ')' ':' typeCSopt
352
		/.$BeginCode
353
					CSTNode result = createOperationCS(
354
							getTokenText($getToken(1)),
355
							(EList)$getSym(3),
356
							(TypeCS)$getSym(6)
357
						);
358
					if ($getSym(6) != null) {
359
						setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(6));
360
					} else {
361
						setOffsets(result, getIToken($getToken(1)), getIToken($getToken(5)));
362
					}
363
					$setResult(result);
364
		  $EndCode
365
		./
366
	operationCS2 ::= pathNameCS '::' simpleNameCS '(' parametersCSopt ')' ':' typeCSopt
367
		/.$BeginCode
368
					CSTNode result = createOperationCS(
369
							(PathNameCS)$getSym(1),
370
							(SimpleNameCS)$getSym(3),
371
							(EList)$getSym(5),
372
							(TypeCS)$getSym(8)
373
						);
374
					if ($getSym(8) != null) {
375
						setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(8));
376
					} else {
377
						setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(7)));
378
					}
379
					$setResult(result);
380
		  $EndCode
381
		./
382
383
384
	parametersCSopt ::= %empty
385
		/.$EmptyListAction./
386
	parametersCSopt -> parametersCS
387
	parametersCS ::= variableCS
388
		/.$BeginCode
389
					EList result = new BasicEList();
390
					result.add($getSym(1));
391
					$setResult(result);
392
		  $EndCode
393
		./
394
	parametersCS ::= parametersCS ',' variableCS
395
		/.$BeginCode
396
					EList result = (EList)$getSym(1);
397
					result.add($getSym(3));
398
					$setResult(result);
399
		  $EndCode
400
		./
401
402
	simpleNameCSopt ::= %empty
403
		/.$NullAction./
404
	simpleNameCSopt -> simpleNameCS	
405
406
	oclExpressionCS -> impliesExpCS
407
	oclExpressionCS -> impliesWithLet
408
	
409
	impliesExpCS -> andOrXorExpCS
410
	impliesWithLet -> andOrXorWithLet
411
	impliesExpCS ::= impliesExpCS implies andOrXorExpCS
412
		/.$NewCase./
413
	impliesWithLet ::= impliesExpCS implies andOrXorWithLet
414
		/.$NewCase./
415
416
	andOrXorExpCS -> equalityExpCS
417
	andOrXorWithLet -> equalityWithLet
418
	andOrXorExpCS ::= andOrXorExpCS and equalityExpCS
419
		/.$NewCase./
420
	andOrXorExpCS ::= andOrXorExpCS or equalityExpCS
421
		/.$NewCase./
422
	andOrXorExpCS ::= andOrXorExpCS xor equalityExpCS
423
		/.$NewCase./
424
	andOrXorWithLet ::= andOrXorExpCS and equalityWithLet
425
		/.$NewCase./
426
	andOrXorWithLet ::= andOrXorExpCS or equalityWithLet
427
		/.$NewCase./
428
	andOrXorWithLet ::= andOrXorExpCS xor equalityWithLet
429
		/.$BeginCode
430
					SimpleNameCS simpleNameCS = createSimpleNameCS(
431
								SimpleTypeEnum.STRING_LITERAL,
432
								getTokenText($getToken(2))
433
							);
434
					setOffsets(simpleNameCS, getIToken($getToken(2)));
435
					EList args = new BasicEList();
436
					args.add($getSym(3));
437
					CSTNode result = createOperationCallExpCS(
438
							(OCLExpressionCS)$getSym(1),
439
							simpleNameCS,
440
							args
441
						);
442
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3));
443
					$setResult(result);
444
		  $EndCode
445
		./
446
447
	equalityExpCS -> relationalExpCS
448
	equalityWithLet -> relationalWithLet
449
	equalityExpCS ::= equalityExpCS '=' relationalExpCS
450
		/.$NewCase./
451
	equalityWithLet ::= equalityExpCS '=' relationalWithLet
452
		/.$BeginCode
453
					SimpleNameCS simpleNameCS = createSimpleNameCS(
454
								SimpleTypeEnum.STRING_LITERAL,
455
								OCLStandardLibraryUtil.getOperationName(PredefinedType.EQUAL)
456
							);
457
					setOffsets(simpleNameCS, getIToken($getToken(2)));
458
					EList args = new BasicEList();
459
					args.add($getSym(3));
460
					CSTNode result = createOperationCallExpCS(
461
							(OCLExpressionCS)$getSym(1),
462
							simpleNameCS,
463
							args
464
						);
465
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3));
466
					$setResult(result);
467
		  $EndCode
468
		./
469
	equalityExpCS ::= equalityExpCS '<>' relationalExpCS
470
		/.$NewCase./
471
	equalityWithLet ::= equalityExpCS '<>' relationalWithLet
472
		/.$BeginCode
473
					SimpleNameCS simpleNameCS = createSimpleNameCS(
474
								SimpleTypeEnum.STRING_LITERAL,
475
								OCLStandardLibraryUtil.getOperationName(PredefinedType.NOT_EQUAL)
476
							);
477
					setOffsets(simpleNameCS, getIToken($getToken(2)));
478
					EList args = new BasicEList();
479
					args.add($getSym(3));
480
					CSTNode result = createOperationCallExpCS(
481
							(OCLExpressionCS)$getSym(1),
482
							simpleNameCS,
483
							args
484
						);
485
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3));
486
					$setResult(result);
487
		  $EndCode
488
		./
489
	
490
	relationalExpCS -> ifExpCSPrec
491
	-- Note that ifExp already embeds let, so we needn't deal with it here
492
	relationalWithLet -> additiveWithLet
493
	relationalExpCS ::= relationalExpCS '>' ifExpCSPrec
494
		/.$NewCase./
495
	relationalWithLet ::= relationalExpCS '>' additiveWithLet
496
		/.$BeginCode
497
					SimpleNameCS simpleNameCS = createSimpleNameCS(
498
								SimpleTypeEnum.STRING_LITERAL,
499
								OCLStandardLibraryUtil.getOperationName(PredefinedType.GREATER_THAN)
500
							);
501
					setOffsets(simpleNameCS, getIToken($getToken(2)));
502
					EList args = new BasicEList();
503
					args.add($getSym(3));
504
					CSTNode result = createOperationCallExpCS(
505
							(OCLExpressionCS)$getSym(1),
506
							simpleNameCS,
507
							args
508
						);
509
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3));
510
					$setResult(result);
511
		  $EndCode
512
		./
513
	relationalExpCS ::= relationalExpCS '<' ifExpCSPrec
514
		/.$NewCase./
515
	relationalWithLet ::= relationalExpCS '<' additiveWithLet
516
		/.$BeginCode
517
					SimpleNameCS simpleNameCS = createSimpleNameCS(
518
								SimpleTypeEnum.STRING_LITERAL,
519
								OCLStandardLibraryUtil.getOperationName(PredefinedType.LESS_THAN)
520
							);
521
					setOffsets(simpleNameCS, getIToken($getToken(2)));
522
					EList args = new BasicEList();
523
					args.add($getSym(3));
524
					CSTNode result = createOperationCallExpCS(
525
							(OCLExpressionCS)$getSym(1),
526
							simpleNameCS,
527
							args
528
						);
529
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3));
530
					$setResult(result);
531
		  $EndCode
532
		./
533
	relationalExpCS ::= relationalExpCS '>=' ifExpCSPrec
534
		/.$NewCase./
535
	relationalWithLet ::= relationalExpCS '>=' additiveWithLet
536
		/.$BeginCode
537
					SimpleNameCS simpleNameCS = createSimpleNameCS(
538
								SimpleTypeEnum.STRING_LITERAL,
539
								OCLStandardLibraryUtil.getOperationName(PredefinedType.GREATER_THAN_EQUAL)
540
							);
541
					setOffsets(simpleNameCS, getIToken($getToken(2)));
542
					EList args = new BasicEList();
543
					args.add($getSym(3));
544
					CSTNode result = createOperationCallExpCS(
545
							(OCLExpressionCS)$getSym(1),
546
							simpleNameCS,
547
							args
548
						);
549
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3));
550
					$setResult(result);
551
		  $EndCode
552
		./
553
	relationalExpCS ::= relationalExpCS '<=' ifExpCSPrec
554
		/.$NewCase./
555
	relationalWithLet ::= relationalExpCS '<=' additiveWithLet
556
		/.$BeginCode
557
					SimpleNameCS simpleNameCS = createSimpleNameCS(
558
								SimpleTypeEnum.STRING_LITERAL,
559
								OCLStandardLibraryUtil.getOperationName(PredefinedType.LESS_THAN_EQUAL)
560
							);
561
					setOffsets(simpleNameCS, getIToken($getToken(2)));
562
					EList args = new BasicEList();
563
					args.add($getSym(3));
564
					CSTNode result = createOperationCallExpCS(
565
							(OCLExpressionCS)$getSym(1),
566
							simpleNameCS,
567
							args
568
						);
569
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3));
570
					$setResult(result);
571
		  $EndCode
572
		./
573
	
574
	ifExpCSPrec -> additiveExpCS
575
	ifExpCSPrec -> ifExpCS
576
577
	additiveExpCS -> multiplicativeExpCS
578
	additiveWithLet -> multiplicativeWithLet
579
	additiveExpCS ::= additiveExpCS '+' multiplicativeExpCS
580
		/.$NewCase./
581
	additiveWithLet ::= additiveExpCS '+' multiplicativeWithLet
582
		/.$BeginCode
583
					SimpleNameCS simpleNameCS = createSimpleNameCS(
584
								SimpleTypeEnum.STRING_LITERAL,
585
								OCLStandardLibraryUtil.getOperationName(PredefinedType.PLUS)
586
							);
587
					setOffsets(simpleNameCS, getIToken($getToken(2)));
588
					EList args = new BasicEList();
589
					args.add($getSym(3));
590
					CSTNode result = createOperationCallExpCS(
591
							(OCLExpressionCS)$getSym(1),
592
							simpleNameCS,
593
							args
594
						);
595
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3));
596
					$setResult(result);
597
		  $EndCode
598
		./
599
	additiveExpCS ::= additiveExpCS '-' multiplicativeExpCS
600
		/.$NewCase./
601
	additiveWithLet ::= additiveExpCS '-' multiplicativeWithLet
602
		/.$BeginCode
603
					SimpleNameCS simpleNameCS = createSimpleNameCS(
604
								SimpleTypeEnum.STRING_LITERAL,
605
								OCLStandardLibraryUtil.getOperationName(PredefinedType.MINUS)
606
							);
607
					setOffsets(simpleNameCS, getIToken($getToken(2)));
608
					EList args = new BasicEList();
609
					args.add($getSym(3));
610
					CSTNode result = createOperationCallExpCS(
611
							(OCLExpressionCS)$getSym(1),
612
							simpleNameCS,
613
							args
614
						);
615
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3));
616
					$setResult(result);
617
		  $EndCode
618
		./
619
	
620
	multiplicativeExpCS -> unaryExpCS
621
	multiplicativeWithLet -> unaryWithLet
622
	multiplicativeExpCS ::= multiplicativeExpCS '*' unaryExpCS
623
		/.$NewCase./
624
	multiplicativeWithLet ::= multiplicativeExpCS '*' unaryWithLet
625
		/.$BeginCode
626
					SimpleNameCS simpleNameCS = createSimpleNameCS(
627
								SimpleTypeEnum.STRING_LITERAL,
628
								OCLStandardLibraryUtil.getOperationName(PredefinedType.TIMES)
629
							);
630
					setOffsets(simpleNameCS, getIToken($getToken(2)));
631
					EList args = new BasicEList();
632
					args.add($getSym(3));
633
					CSTNode result = createOperationCallExpCS(
634
							(OCLExpressionCS)$getSym(1),
635
							simpleNameCS,
636
							args
637
						);
638
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3));
639
					$setResult(result);
640
		  $EndCode
641
		./
642
	multiplicativeExpCS ::= multiplicativeExpCS '/' unaryExpCS
643
		/.$NewCase./
644
	multiplicativeWithLet ::= multiplicativeExpCS '/' unaryWithLet
645
		/.$BeginCode
646
					SimpleNameCS simpleNameCS = createSimpleNameCS(
647
								SimpleTypeEnum.STRING_LITERAL,
648
								OCLStandardLibraryUtil.getOperationName(PredefinedType.DIVIDE)
649
							);
650
					setOffsets(simpleNameCS, getIToken($getToken(2)));
651
					EList args = new BasicEList();
652
					args.add($getSym(3));
653
					CSTNode result = createOperationCallExpCS(
654
							(OCLExpressionCS)$getSym(1),
655
							simpleNameCS,
656
							args
657
						);
658
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3));
659
					$setResult(result);
660
		  $EndCode
661
		./
662
	
663
	unaryExpCS -> dotArrowExpCS
664
	unaryWithLet -> letExpCS
665
	unaryExpCS ::= '-' unaryExpCS
666
		/.$BeginCode
667
					SimpleNameCS simpleNameCS = createSimpleNameCS(
668
								SimpleTypeEnum.STRING_LITERAL,
669
								OCLStandardLibraryUtil.getOperationName(PredefinedType.MINUS)
670
							);
671
					setOffsets(simpleNameCS, getIToken($getToken(1)));
672
					CSTNode result = createOperationCallExpCS(
673
							(OCLExpressionCS)$getSym(2),
674
							simpleNameCS,
675
							new BasicEList()
676
						);
677
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(2));
678
					$setResult(result);
679
		  $EndCode
680
		./
681
	unaryExpCS ::= not unaryExpCS
682
		/.$BeginCode
683
					SimpleNameCS simpleNameCS = createSimpleNameCS(
684
								SimpleTypeEnum.STRING_LITERAL,
685
								getTokenText($getToken(1))
686
							);
687
					setOffsets(simpleNameCS, getIToken($getToken(1)));
688
					CSTNode result = createOperationCallExpCS(
689
							(OCLExpressionCS)$getSym(2),
690
							simpleNameCS,
691
							new BasicEList()
692
						);
693
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(2));
694
					$setResult(result);
695
		  $EndCode
696
		./
697
698
	dotArrowExpCS -> oclExpCS
699
	dotArrowExpCS ::= dotArrowExpCS callExpCS
700
		/.$BeginCode
701
					CallExpCS result = (CallExpCS)$getSym(2);
702
					result.setSource((OCLExpressionCS)$getSym(1));
703
					setOffsets(result, (CSTNode)$getSym(1), result);
704
					$setResult(result);
705
		  $EndCode
706
		./
707
	dotArrowExpCS ::= dotArrowExpCS messageExpCS
708
		/.$BeginCode
709
					MessageExpCS result = (MessageExpCS)$getSym(2);
710
					result.setTarget((OCLExpressionCS)$getSym(1));
711
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(2));
712
					$setResult(result);
713
		  $EndCode
714
		./
715
	dotArrowExpCS ::= NUMERIC_OPERATION '(' argumentsCSopt ')'
716
		/.$BeginCode
717
					// NUMERIC_OPERATION -> Integer '.' Identifier
718
					String text = getTokenText(dtParser.getToken(1));
719
					int index = text.indexOf('.');
720
					String integer = text.substring(0, index);
721
					String simpleName = text.substring(index + 1);
722
723
					// create the IntegerLiteralExpCS
724
					IToken numericToken = getIToken($getToken(1));
725
					int startOffset = numericToken.getStartOffset();
726
					int endOffset = startOffset + integer.length() - 1; // inclusive
727
728
					IntegerLiteralExpCS integerLiteralExpCS = createIntegerLiteralExpCS(integer);
729
					integerLiteralExpCS.setStartOffset(startOffset);
730
					integerLiteralExpCS.setEndOffset(endOffset);
731
					integerLiteralExpCS.setStartToken(numericToken);
732
					integerLiteralExpCS.setEndToken(numericToken);
733
734
					startOffset = endOffset + 2; // end of integerLiteral + 1('.') + 1(start of simpleName)
735
					endOffset = getIToken($getToken(1)).getEndOffset();
736
737
					// create the SimpleNameCS
738
					SimpleNameCS simpleNameCS = createSimpleNameCS(
739
								SimpleTypeEnum.IDENTIFIER_LITERAL,
740
								simpleName
741
							);
742
					simpleNameCS.setStartOffset(startOffset);
743
					simpleNameCS.setEndOffset(endOffset);
744
					simpleNameCS.setStartToken(numericToken);
745
					simpleNameCS.setEndToken(numericToken);
746
747
					// create the OperationCallExpCS
748
					CSTNode result = createOperationCallExpCS(
749
							integerLiteralExpCS,
750
							simpleNameCS,
751
							(EList)$getSym(3)
752
						);
753
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(4)));
754
					$setResult(result);
755
		  $EndCode
756
		./
757
758
    -- static operation call (@pre is not permitted in this context)
759
	dotArrowExpCS ::=  pathNameCS '::' simpleNameCS '(' argumentsCSopt ')'
760
		/.$BeginCode
761
					OperationCallExpCS result = createOperationCallExpCS(
762
							(PathNameCS)$getSym(1),
763
							(SimpleNameCS)$getSym(3),
764
							(EList)$getSym(5)
765
						);
766
					setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(6)));
767
					result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
768
					$setResult(result);
769
		  $EndCode
770
		./
771
772
773
	oclExpCS -> variableExpCS
774
	oclExpCS -> literalExpCS
775
	oclExpCS -> operationCallExpCS
776
	oclExpCS -> keywordOperationCallExpCS
777
778
	oclExpCS ::= '(' oclExpressionCS ')'
779
		/.$BeginCode
780
					CSTNode result = (CSTNode)$getSym(2);
781
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(3)));
782
					$setResult(result);
783
		  $EndCode
784
		./
785
786
	variableExpCS ::= simpleNameCS isMarkedPreCS
787
		/.$NewCase./
788
	variableExpCS ::= keywordAsName1 isMarkedPreCS
789
		/.$BeginCode
790
					IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(2);
791
					CSTNode result = createVariableExpCS(
792
							(SimpleNameCS)$getSym(1),
793
							new BasicEList(),
794
							isMarkedPreCS
795
						);
796
					if (isMarkedPreCS.isPre()) {
797
						setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(2));
798
					} else {
799
						setOffsets(result, (CSTNode)$getSym(1));
800
					}
801
					$setResult(result);
802
		  $EndCode
803
		./
804
	variableExpCS ::= simpleNameCS '[' argumentsCS ']' isMarkedPreCS
805
		/.$NewCase./
806
	variableExpCS ::= keywordAsName1 '[' argumentsCS ']' isMarkedPreCS
807
		/.$BeginCode
808
					IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(5);
809
					CSTNode result = createVariableExpCS(
810
							(SimpleNameCS)$getSym(1),
811
							(EList)$getSym(3),
812
							isMarkedPreCS
813
						);
814
					if (isMarkedPreCS.isPre()) {
815
						setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(5));
816
					} else {
817
						setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(4)));
818
					}
819
					$setResult(result);
820
		  $EndCode
821
		./
822
823
824
	simpleNameCS -> primitiveTypeCS
825
	simpleNameCS ::= self
826
		/.$BeginCode
827
					CSTNode result = createSimpleNameCS(
828
							SimpleTypeEnum.SELF_LITERAL,
829
							getTokenText($getToken(1))
830
						);
831
					setOffsets(result, getIToken($getToken(1)));
832
					$setResult(result);
833
		  $EndCode
834
		./
835
	simpleNameCS ::= IDENTIFIER
836
		/.$BeginCode
837
					CSTNode result = createSimpleNameCS(
838
							SimpleTypeEnum.IDENTIFIER_LITERAL,
839
							getTokenText($getToken(1))
840
						);
841
					setOffsets(result, getIToken($getToken(1)));
842
					$setResult(result);
843
		  $EndCode
844
		./
845
846
	primitiveTypeCS ::= Integer
847
		/.$BeginCode
848
					CSTNode result = createPrimitiveTypeCS(
849
							SimpleTypeEnum.INTEGER_LITERAL,
850
							getTokenText($getToken(1))
851
						);
852
					setOffsets(result, getIToken($getToken(1)));
853
					$setResult(result);
854
		  $EndCode
855
		./
856
	primitiveTypeCS ::= UnlimitedNatural
857
		/.$BeginCode
858
					CSTNode result = createPrimitiveTypeCS(
859
							SimpleTypeEnum.UNLIMITED_NATURAL_LITERAL,
860
							getTokenText($getToken(1))
861
						);
862
					setOffsets(result, getIToken($getToken(1)));
863
					$setResult(result);
864
		  $EndCode
865
		./
866
	primitiveTypeCS ::= String
867
		/.$BeginCode
868
					CSTNode result = createPrimitiveTypeCS(
869
							SimpleTypeEnum.STRING_LITERAL,
870
							getTokenText($getToken(1))
871
						);
872
					setOffsets(result, getIToken($getToken(1)));
873
					$setResult(result);
874
		  $EndCode
875
		./
876
	primitiveTypeCS ::= Real
877
		/.$BeginCode
878
					CSTNode result = createPrimitiveTypeCS(
879
							SimpleTypeEnum.REAL_LITERAL,
880
							getTokenText($getToken(1))
881
						);
882
					setOffsets(result, getIToken($getToken(1)));
883
					$setResult(result);
884
		  $EndCode
885
		./
886
	primitiveTypeCS ::= Boolean
887
		/.$BeginCode
888
					CSTNode result = createPrimitiveTypeCS(
889
							SimpleTypeEnum.BOOLEAN_LITERAL,
890
							getTokenText($getToken(1))
891
						);
892
					setOffsets(result, getIToken($getToken(1)));
893
					$setResult(result);
894
		  $EndCode
895
		./
896
	primitiveTypeCS ::= OclAny
897
		/.$BeginCode
898
					CSTNode result = createPrimitiveTypeCS(
899
							SimpleTypeEnum.OCL_ANY_LITERAL,
900
							getTokenText($getToken(1))
901
						);
902
					setOffsets(result, getIToken($getToken(1)));
903
					$setResult(result);
904
		  $EndCode
905
		./
906
	primitiveTypeCS ::= OclVoid
907
		/.$BeginCode
908
					CSTNode result = createPrimitiveTypeCS(
909
							SimpleTypeEnum.OCL_VOID_LITERAL,
910
							getTokenText($getToken(1))
911
						);
912
					setOffsets(result, getIToken($getToken(1)));
913
					$setResult(result);
914
		  $EndCode
915
		./
916
	primitiveTypeCS ::= Invalid
917
		/.$BeginCode
918
					CSTNode result = createPrimitiveTypeCS(
919
							SimpleTypeEnum.INVALID_LITERAL,
920
							getTokenText($getToken(1))
921
						);
922
					setOffsets(result, getIToken($getToken(1)));
923
					$setResult(result);
924
		  $EndCode
925
		./
926
	primitiveTypeCS ::= OclMessage
927
		/.$BeginCode
928
					CSTNode result = createPrimitiveTypeCS(
929
							SimpleTypeEnum.OCL_MESSAGE_LITERAL,
930
							getTokenText($getToken(1))
931
						);
932
					setOffsets(result, getIToken($getToken(1)));
933
					$setResult(result);
934
		  $EndCode
935
		./
936
937
	pathNameCS ::= IDENTIFIER
938
		/.$BeginCode
939
					CSTNode result = createPathNameCS(getTokenText($getToken(1)));
940
					setOffsets(result, getIToken($getToken(1)));
941
					$setResult(result);
942
		  $EndCode
943
		./
944
	pathNameCS ::= pathNameCS '::' simpleNameCS
945
		/.$BeginCode
946
					PathNameCS result = (PathNameCS)$getSym(1);
947
					result = extendPathNameCS(result, getTokenText(dtParser.getToken(3)));
948
					setOffsets(result, result, (CSTNode)$getSym(3));
949
					$setResult(result);
950
		  $EndCode
951
		./
952
953
	pathNameCSOpt ::= %empty
954
		/.$BeginCode
955
					CSTNode result = createPathNameCS();
956
					$setResult(result);
957
		  $EndCode
958
		./
959
	pathNameCSOpt -> pathNameCS
960
961
	literalExpCS -> enumLiteralExpCS
962
	literalExpCS -> collectionLiteralExpCS
963
	literalExpCS -> tupleLiteralExpCS
964
	literalExpCS -> primitiveLiteralExpCS
965
	literalExpCS -> nullLiteralExpCS
966
	literalExpCS -> invalidLiteralExpCS
967
968
    -- also covers the case of static attribute call, in which
969
    --    case @pre is not allowed anyway
970
	enumLiteralExpCS ::= pathNameCS '::' keywordAsName
971
		/.$NewCase./
972
	enumLiteralExpCS ::= pathNameCS '::' simpleNameCS
973
		/.$BeginCode
974
					CSTNode result = createEnumLiteralExpCS(
975
							(PathNameCS)$getSym(1),
976
							(SimpleNameCS)$getSym(3)
977
						);
978
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3));
979
					$setResult(result);
980
		  $EndCode
981
		./
982
983
	collectionLiteralExpCS ::= collectionTypeIdentifierCS '{' collectionLiteralPartsCSopt '}'
984
		/.$BeginCode
985
					Object[] objs = (Object[])$getSym(1);
986
					CSTNode result = createCollectionLiteralExpCS(
987
							(CollectionTypeIdentifierEnum)objs[1],
988
							(EList)$getSym(3)
989
						);
990
					setOffsets(result, (IToken)objs[0], getIToken($getToken(4)));
991
					$setResult(result);
992
		  $EndCode
993
		./
994
995
	collectionTypeIdentifierCS ::= Set
996
		/.$BeginCode
997
					$setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.SET_LITERAL});
998
		  $EndCode
999
		./
1000
	collectionTypeIdentifierCS ::= Bag
1001
		/.$BeginCode
1002
					$setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.BAG_LITERAL});
1003
		  $EndCode
1004
		./
1005
	collectionTypeIdentifierCS ::= Sequence
1006
		/.$BeginCode
1007
					$setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.SEQUENCE_LITERAL});
1008
		  $EndCode
1009
		./
1010
	collectionTypeIdentifierCS ::= Collection
1011
		/.$BeginCode
1012
					$setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.COLLECTION_LITERAL});
1013
		  $EndCode
1014
		./
1015
	collectionTypeIdentifierCS ::= OrderedSet
1016
		/.$BeginCode
1017
					$setResult(new Object[]{getIToken($getToken(1)), CollectionTypeIdentifierEnum.ORDERED_SET_LITERAL});
1018
		  $EndCode
1019
		./
1020
1021
	collectionLiteralPartsCSopt ::= %empty
1022
		/.$EmptyListAction./
1023
	collectionLiteralPartsCSopt -> collectionLiteralPartsCS
1024
1025
	collectionLiteralPartsCS ::= collectionLiteralPartCS
1026
		/.$BeginCode
1027
					EList result = new BasicEList();
1028
					result.add($getSym(1));
1029
					$setResult(result);
1030
		  $EndCode
1031
		./
1032
	collectionLiteralPartsCS ::= collectionLiteralPartsCS ',' collectionLiteralPartCS
1033
		/.$BeginCode
1034
					EList result = (EList)$getSym(1);
1035
					result.add($getSym(3));
1036
					$setResult(result);
1037
		  $EndCode
1038
		./
1039
1040
	collectionLiteralPartCS -> collectionRangeCS
1041
	collectionLiteralPartCS ::= oclExpressionCS
1042
		/.$BeginCode
1043
					CSTNode result = createCollectionLiteralPartCS(
1044
							(OCLExpressionCS)$getSym(1)
1045
						);
1046
					setOffsets(result, (CSTNode)$getSym(1));
1047
					$setResult(result);
1048
		  $EndCode
1049
		./
1050
1051
	collectionRangeCS ::= '-' INTEGER_RANGE_START oclExpressionCS
1052
		/.$BeginCode
1053
					OCLExpressionCS rangeStart = createRangeStart(
1054
							getTokenText($getToken(2)), true);
1055
					CSTNode result = createCollectionRangeCS(
1056
							rangeStart,
1057
							(OCLExpressionCS)$getSym(3)
1058
						);
1059
					setOffsets(result, rangeStart, (CSTNode)$getSym(3));
1060
					$setResult(result);
1061
		  $EndCode
1062
		./
1063
	collectionRangeCS ::= INTEGER_RANGE_START oclExpressionCS
1064
		/.$BeginCode
1065
					OCLExpressionCS rangeStart = createRangeStart(
1066
							getTokenText($getToken(1)), false);
1067
					CSTNode result = createCollectionRangeCS(
1068
							rangeStart,
1069
							(OCLExpressionCS)$getSym(2)
1070
						);
1071
					setOffsets(result, rangeStart, (CSTNode)$getSym(2));
1072
					$setResult(result);
1073
		  $EndCode
1074
		./
1075
	collectionRangeCS ::= oclExpressionCS '..' oclExpressionCS
1076
		/.$BeginCode
1077
					CSTNode result = createCollectionRangeCS(
1078
							(OCLExpressionCS)$getSym(1),
1079
							(OCLExpressionCS)$getSym(3)
1080
						);
1081
					setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(3));
1082
					$setResult(result);
1083
		  $EndCode
1084
		./
1085
1086
	primitiveLiteralExpCS -> integerLiteralExpCS
1087
	primitiveLiteralExpCS -> unlimitedNaturalLiteralExpCS
1088
	primitiveLiteralExpCS -> realLiteralExpCS
1089
	primitiveLiteralExpCS -> stringLiteralExpCS
1090
	primitiveLiteralExpCS -> booleanLiteralExpCS
1091
1092
	tupleLiteralExpCS ::= Tuple '{' variableListCS2 '}'
1093
		/.$BeginCode
1094
					CSTNode result = createTupleLiteralExpCS((EList)$getSym(3));
1095
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(4)));
1096
					$setResult(result);
1097
		  $EndCode
1098
		./
1099
	integerLiteralExpCS ::= INTEGER_LITERAL
1100
		/.$BeginCode
1101
					CSTNode result = createIntegerLiteralExpCS(getTokenText($getToken(1)));
1102
					setOffsets(result, getIToken($getToken(1)));
1103
					$setResult(result);
1104
		  $EndCode
1105
		./
1106
	unlimitedNaturalLiteralExpCS ::= '*'
1107
		/.$BeginCode
1108
					CSTNode result = createUnlimitedNaturalLiteralExpCS(getTokenText($getToken(1)));
1109
					setOffsets(result, getIToken($getToken(1)));
1110
					$setResult(result);
1111
		  $EndCode
1112
		./
1113
	realLiteralExpCS ::= REAL_LITERAL
1114
		/.$BeginCode
1115
					CSTNode result = createRealLiteralExpCS(getTokenText($getToken(1)));
1116
					setOffsets(result, getIToken($getToken(1)));
1117
					$setResult(result);
1118
		  $EndCode
1119
		./
1120
	stringLiteralExpCS ::= STRING_LITERAL
1121
		/.$BeginCode
1122
					IToken literalToken = getIToken($getToken(1));
1123
					StringLiteralExpCS result = createStringLiteralExpCS(literalToken.toString());
1124
					result.setUnescapedStringSymbol(unescape(literalToken));
1125
					setOffsets(result, literalToken);
1126
					$setResult(result);
1127
		  $EndCode
1128
		./
1129
	booleanLiteralExpCS ::= true
1130
		/.$BeginCode
1131
					CSTNode result = createBooleanLiteralExpCS(getTokenText($getToken(1)));
1132
					setOffsets(result, getIToken($getToken(1)));
1133
					$setResult(result);
1134
		  $EndCode
1135
		./
1136
	booleanLiteralExpCS ::= false
1137
		/.$BeginCode
1138
					CSTNode result = createBooleanLiteralExpCS(getTokenText($getToken(1)));
1139
					setOffsets(result, getIToken($getToken(1)));
1140
					$setResult(result);
1141
		  $EndCode
1142
		./
1143
1144
	nullLiteralExpCS ::= null
1145
		/.$BeginCode
1146
					CSTNode result = createNullLiteralExpCS(getTokenText($getToken(1)));
1147
					setOffsets(result, getIToken($getToken(1)));
1148
					$setResult(result);
1149
		  $EndCode
1150
		./
1151
1152
	invalidLiteralExpCS ::= OclInvalid
1153
		/.$BeginCode
1154
					CSTNode result = createInvalidLiteralExpCS(getTokenText($getToken(1)));
1155
					setOffsets(result, getIToken($getToken(1)));
1156
					$setResult(result);
1157
		  $EndCode
1158
		./
1159
1160
1161
	callExpCS ::= '->' featureCallExpCS
1162
		/.$NewCase./
1163
	callExpCS ::= '->' loopExpCS
1164
		/.$BeginCode
1165
					CallExpCS result = (CallExpCS)$getSym(2);
1166
					result.setAccessor(DotOrArrowEnum.ARROW_LITERAL);
1167
					$setResult(result);
1168
		  $EndCode
1169
		./
1170
	callExpCS ::= '.' keywordOperationCallExpCS
1171
		/.$NewCase./
1172
	callExpCS ::= '.' featureCallExpCS
1173
		/.$BeginCode
1174
					CallExpCS result = (CallExpCS)$getSym(2);
1175
					result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
1176
					$setResult(result);
1177
		  $EndCode
1178
		./
1179
1180
	loopExpCS -> iteratorExpCS
1181
	loopExpCS -> iterateExpCS
1182
1183
	iteratorExpCS ::= iteratorName '(' oclExpressionCS ')'
1184
		/.$BeginCode
1185
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
1186
					CSTNode result = createIteratorExpCS(
1187
							simpleNameCS,
1188
							null,
1189
							null,
1190
							(OCLExpressionCS)$getSym(3)
1191
						);
1192
					setOffsets(result, simpleNameCS, getIToken($getToken(4)));
1193
					$setResult(result);
1194
		  $EndCode
1195
		./
1196
	iteratorExpCS ::= iteratorName '(' variableCS '|' oclExpressionCS ')'
1197
		/.$BeginCode
1198
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
1199
					CSTNode result = createIteratorExpCS(
1200
							simpleNameCS,
1201
							(VariableCS)$getSym(3),
1202
							null,
1203
							(OCLExpressionCS)$getSym(5)
1204
						);
1205
					setOffsets(result, simpleNameCS, getIToken($getToken(6)));
1206
					$setResult(result);
1207
		  $EndCode
1208
		./
1209
	iteratorExpCS ::= iteratorName '(' variableCS ',' variableCS '|' oclExpressionCS ')'
1210
		/.$BeginCode
1211
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
1212
					CSTNode result = createIteratorExpCS(
1213
							simpleNameCS,
1214
							(VariableCS)$getSym(3),
1215
							(VariableCS)$getSym(5),
1216
							(OCLExpressionCS)$getSym(7)
1217
						);
1218
					setOffsets(result, simpleNameCS, getIToken($getToken(8)));
1219
					$setResult(result);
1220
		  $EndCode
1221
		./
1222
1223
	iterateExpCS ::= iterateName '(' variableCS '|' oclExpressionCS ')'
1224
		/.$BeginCode
1225
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
1226
					CSTNode result = createIterateExpCS(
1227
							simpleNameCS,
1228
							(VariableCS)$getSym(3),
1229
							null,
1230
							(OCLExpressionCS)$getSym(5)
1231
						);
1232
					setOffsets(result, simpleNameCS, getIToken($getToken(6)));
1233
					$setResult(result);
1234
		  $EndCode
1235
		./
1236
	iterateExpCS ::= iterateName '(' variableCS ';' variableCS '|' oclExpressionCS ')'
1237
		/.$BeginCode
1238
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
1239
					CSTNode result = createIterateExpCS(
1240
							simpleNameCS,
1241
							(VariableCS)$getSym(3),
1242
							(VariableCS)$getSym(5),
1243
							(OCLExpressionCS)$getSym(7)
1244
						);
1245
					setOffsets(result, simpleNameCS, getIToken($getToken(8)));
1246
					$setResult(result);
1247
		  $EndCode
1248
		./
1249
1250
	variableCS ::= IDENTIFIER
1251
		/.$BeginCode
1252
					CSTNode result = createVariableCS(
1253
							getTokenText($getToken(1)),
1254
							null,
1255
							null
1256
						);
1257
					setOffsets(result, getIToken($getToken(1)));
1258
					$setResult(result);
1259
		  $EndCode
1260
		./
1261
	typedVariableCS ::= IDENTIFIER ':' typeCS
1262
		/.$BeginCode
1263
					CSTNode result = createVariableCS(
1264
							getTokenText($getToken(1)),
1265
							(TypeCS)$getSym(3),
1266
							null
1267
						);
1268
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(3));
1269
					$setResult(result);
1270
		  $EndCode
1271
		./
1272
	variableCS -> typedVariableCS
1273
	variableCS ::= IDENTIFIER ':' typeCS '=' oclExpressionCS
1274
		/.$BeginCode
1275
					CSTNode result = createVariableCS(
1276
							getTokenText($getToken(1)),
1277
							(TypeCS)$getSym(3),
1278
							(OCLExpressionCS)$getSym(5)
1279
						);
1280
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(5));
1281
					$setResult(result);
1282
		  $EndCode
1283
		./
1284
1285
	-- this form of variable declaration is only used in tuple literals
1286
	variableCS2 ::= IDENTIFIER '=' oclExpressionCS
1287
		/.$BeginCode
1288
					CSTNode result = createVariableCS(
1289
							getTokenText($getToken(1)),
1290
							null,
1291
							(OCLExpressionCS)$getSym(3)
1292
						);
1293
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(3));
1294
					$setResult(result);
1295
		  $EndCode
1296
		./
1297
1298
	typeCSopt ::= %empty
1299
		/.$NullAction./
1300
	typeCSopt -> typeCS
1301
1302
	-- the order of these rules is important!  Try to match primitives
1303
	--   first, then tuples (more complex), and finally collections.
1304
	--   Looking for type names in the Ecore model is a last resort
1305
	typeCS -> primitiveTypeCS
1306
	typeCS -> tupleTypeCS
1307
	typeCS -> collectionTypeCS
1308
	typeCS -> pathNameCS
1309
1310
	collectionTypeCS ::= collectionTypeIdentifierCS '(' typeCS ')'
1311
		/.$BeginCode
1312
					Object[] objs = (Object[])$getSym(1);
1313
					CSTNode result = createCollectionTypeCS(
1314
							(CollectionTypeIdentifierEnum)objs[1],
1315
							(TypeCS)$getSym(3)
1316
						);
1317
					setOffsets(result, (IToken)objs[0], getIToken($getToken(4)));
1318
					$setResult(result);
1319
		  $EndCode
1320
		./
1321
1322
	tupleTypeCS ::= Tuple '(' variableListCSopt ')'
1323
		/.$BeginCode
1324
					CSTNode result = createTupleTypeCS((EList)$getSym(3));
1325
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(4)));
1326
					$setResult(result);
1327
		  $EndCode
1328
		./
1329
1330
	
1331
	variableListCSopt ::= %empty
1332
		/.$EmptyListAction./
1333
	variableListCSopt -> variableListCS
1334
	variableListCS ::= variableCS 
1335
		/.$BeginCode
1336
					EList result = new BasicEList();
1337
					result.add($getSym(1));
1338
					$setResult(result);
1339
		  $EndCode
1340
		./
1341
	variableListCS ::= variableListCS ',' variableCS
1342
		/.$BeginCode
1343
					EList result = (EList)$getSym(1);
1344
					result.add($getSym(3));
1345
					$setResult(result);
1346
		  $EndCode
1347
		./
1348
	
1349
	-- this form of variable declaration list is only used in tuple literals
1350
	variableListCS2 ::= variableCS2
1351
		/.$NewCase./
1352
	variableListCS2 ::= variableCS
1353
		/.$BeginCode
1354
					EList result = new BasicEList();
1355
					result.add($getSym(1));
1356
					$setResult(result);
1357
		  $EndCode
1358
		./
1359
	variableListCS2 ::= variableListCS2 ',' variableCS2
1360
		/.$NewCase./
1361
	variableListCS2 ::= variableListCS2 ',' variableCS
1362
		/.$BeginCode
1363
					EList result = (EList)$getSym(1);
1364
					result.add($getSym(3));
1365
					$setResult(result);
1366
		  $EndCode
1367
		./
1368
	
1369
	-- covers attributeCallExpCS and navigationCallExpCS
1370
	featureCallExpCS -> attrOrNavCallExpCS
1371
1372
	featureCallExpCS -> operationCallExpCS
1373
	featureCallExpCS ::= unaryName isMarkedPreCS '(' argumentsCSopt ')'
1374
		/.$NewCase./
1375
	-- even though these operations do not use @pre or do not accept multiple arguments
1376
	-- in order to get better error reporting, the rule signature must comply with
1377
	-- the full rule of an operationCallExpCS
1378
	-- the alternative would be to remove these as keywords, but then the parser
1379
	-- would accept variable declarations where the var can be named "oclIsNew" for example
1380
	operationCallExpCS ::= binaryName isMarkedPreCS '(' argumentsCSopt ')'
1381
		/.$NewCase./
1382
	keywordOperationCallExpCS ::= keywordAsName isMarkedPreCS '(' argumentsCSopt ')'
1383
		/.$BeginCode
1384
					CSTNode result = createOperationCallExpCS(
1385
							(SimpleNameCS)$getSym(1),
1386
							(IsMarkedPreCS)$getSym(2),
1387
							(EList)$getSym(4)
1388
						);
1389
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(5)));
1390
					$setResult(result);
1391
		  $EndCode
1392
		./
1393
1394
	stateExpCS ::= pathNameCSOpt
1395
		/.$BeginCode
1396
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
1397
					StateExpCS result = createStateExpCS(pathNameCS);
1398
					setOffsets(result, pathNameCS);
1399
					$setResult(result);
1400
		  $EndCode
1401
		./
1402
	-- FIXME StateExpCS creates a needless irregularity; unwrap its content as an argument list
1403
	operationCallExpCS ::= oclIsInStateName isMarkedPreCS '(' stateExpCS ')'
1404
		/.$BeginCode
1405
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
1406
					CSTNode result = createOperationCallExpCS(
1407
							simpleNameCS,
1408
							(IsMarkedPreCS)$getSym(2),
1409
							(StateExpCS)$getSym(4)
1410
						);
1411
					setOffsets(result, simpleNameCS, getIToken($getToken(5)));
1412
					$setResult(result);
1413
		  $EndCode
1414
		./
1415
1416
	attrOrNavCallExpCS ::= simpleNameCS isMarkedPreCS
1417
		/.$NewCase./
1418
	attrOrNavCallExpCS ::= keywordAsName isMarkedPreCS
1419
		/.$BeginCode
1420
					IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(2);
1421
					CSTNode result = createFeatureCallExpCS(
1422
							(SimpleNameCS)$getSym(1),
1423
							new BasicEList(),
1424
							isMarkedPreCS
1425
						);
1426
					if (isMarkedPreCS.isPre()) {
1427
						setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(2));
1428
					} else {
1429
						setOffsets(result, (CSTNode)$getSym(1));
1430
					}
1431
					$setResult(result);
1432
		  $EndCode
1433
		./
1434
	attrOrNavCallExpCS ::= simpleNameCS '[' argumentsCS ']' isMarkedPreCS
1435
		/.$BeginCode
1436
					IsMarkedPreCS isMarkedPreCS = (IsMarkedPreCS)$getSym(5);
1437
					CSTNode result = createFeatureCallExpCS(
1438
							(SimpleNameCS)$getSym(1),
1439
							(EList)$getSym(3),
1440
							isMarkedPreCS
1441
						);
1442
					if (isMarkedPreCS.isPre()) {
1443
						setOffsets(result, (CSTNode)$getSym(1), (CSTNode)$getSym(5));
1444
					} else {
1445
						setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(4)));
1446
					}
1447
					$setResult(result);
1448
		  $EndCode
1449
		./
1450
1451
	isMarkedPreCS ::= %empty
1452
		/.$BeginCode
1453
					CSTNode result = createIsMarkedPreCS(false);
1454
					setOffsets(result, getIToken($getToken(1)));
1455
					$setResult(result);
1456
		  $EndCode
1457
		./
1458
	isMarkedPreCS ::= '@pre'
1459
		/.$BeginCode
1460
					CSTNode result = createIsMarkedPreCS(true);
1461
					setOffsets(result, getIToken($getToken(1)));
1462
					$setResult(result);
1463
		  $EndCode
1464
		./
1465
1466
	argumentsCSopt ::= %empty
1467
		/.$EmptyListAction./
1468
	argumentsCSopt -> argumentsCS
1469
1470
	argumentsCS ::= oclExpressionCS
1471
		/.$BeginCode
1472
					EList result = new BasicEList();
1473
					result.add($getSym(1));
1474
					$setResult(result);
1475
		  $EndCode
1476
		./
1477
	argumentsCS ::= argumentsCS ',' oclExpressionCS
1478
		/.$BeginCode
1479
					EList result = (EList)$getSym(1);
1480
					result.add($getSym(3));
1481
					$setResult(result);
1482
		  $EndCode
1483
		./
1484
1485
	letExpCS ::= let variableListCS in oclExpressionCS
1486
		/.$BeginCode
1487
					CSTNode result = createLetExpCS(
1488
							(EList)$getSym(2),
1489
							(OCLExpressionCS)$getSym(4)
1490
						);
1491
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(4));
1492
					$setResult(result);
1493
		  $EndCode
1494
		./
1495
1496
	ifExpCS ::= if oclExpressionCS then oclExpressionCS else oclExpressionCS endif
1497
		/.$BeginCode
1498
					CSTNode result = createIfExpCS(
1499
							(OCLExpressionCS)$getSym(2),
1500
							(OCLExpressionCS)$getSym(4),
1501
							(OCLExpressionCS)$getSym(6)
1502
						);
1503
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(7)));
1504
					$setResult(result);
1505
		  $EndCode
1506
		./
1507
1508
	messageExpCS ::= '^' simpleNameCS '(' oclMessageArgumentsCSopt ')'
1509
		/.$NewCase./
1510
	messageExpCS ::= '^^' simpleNameCS '(' oclMessageArgumentsCSopt ')'
1511
		/.$BeginCode
1512
					CSTNode result = createMessageExpCS(
1513
							getIToken($getToken(1)).getKind() == $sym_type.TK_CARET,
1514
							(SimpleNameCS)$getSym(2),
1515
							(EList<OCLMessageArgCS>)$getSym(4)
1516
						);
1517
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(5)));
1518
					$setResult(result);
1519
		  $EndCode
1520
		./
1521
1522
	oclMessageArgumentsCSopt ::= %empty
1523
		/.$EmptyListAction./
1524
	oclMessageArgumentsCSopt -> oclMessageArgumentsCS
1525
1526
	oclMessageArgumentsCS ::= oclMessageArgCS
1527
		/.$BeginCode
1528
					EList result = new BasicEList();
1529
					result.add($getSym(1));
1530
					$setResult(result);
1531
		  $EndCode
1532
		./
1533
	oclMessageArgumentsCS ::= oclMessageArgumentsCS ',' oclMessageArgCS
1534
		/.$BeginCode
1535
					EList result = (EList)$getSym(1);
1536
					result.add($getSym(3));
1537
					$setResult(result);
1538
		  $EndCode
1539
		./
1540
1541
	oclMessageArgCS ::= oclExpressionCS
1542
		/.$BeginCode
1543
					CSTNode result = createOCLMessageArgCS(
1544
							null,
1545
							(OCLExpressionCS)$getSym(1)
1546
						);
1547
					setOffsets(result, (CSTNode)$getSym(1));
1548
					$setResult(result);
1549
		  $EndCode
1550
		./
1551
	oclMessageArgCS ::= '?'
1552
		/.$BeginCode
1553
					CSTNode result = createOCLMessageArgCS(
1554
							null,
1555
							null
1556
						);
1557
					setOffsets(result, getIToken($getToken(1)));
1558
					$setResult(result);
1559
		  $EndCode
1560
		./
1561
	oclMessageArgCS ::= '?' ':' typeCS
1562
		/.$BeginCode
1563
					CSTNode result = createOCLMessageArgCS(
1564
							(TypeCS)$getSym(3),
1565
							null
1566
						);
1567
					setOffsets(result, getIToken($getToken(1)), (CSTNode)$getSym(3));
1568
					$setResult(result);
1569
		  $EndCode
1570
		./
1571
1572
%End
(-)src/org/eclipse/ocl/parser/backtracking/OCLBacktrackingLexer.gi (+42 lines)
Added Link Here
1
--/**
2
-- * <copyright>
3
-- *
4
-- * Copyright (c) 2008, 2009 Eclipse.org, Open Canarias S.L., and others.
5
-- * All rights reserved.   This program and the accompanying materials
6
-- * are made available under the terms of the Eclipse Public License v1.0
7
-- * which accompanies this distribution, and is available at
8
-- * http://www.eclipse.org/legal/epl-v10.html
9
-- *
10
-- * Contributors:
11
-- *   IBM - Initial API and implementation
12
-- *   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
13
-- *   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
14
-- *
15
-- * </copyright>
16
-- *
17
-- * $Id: OCLBacktrackingLexer.g,v 1.1 2009/01/13 20:31:30 cdamus Exp $
18
-- */
19
--
20
-- The OCL Backtracking Lexer, which is nominally identical to the
21
-- normal Lexer, however the extra ERROR_TOKEN symbol makes it difficult
22
-- to share reliably.
23
--
24
25
%options escape=$
26
%options la=2
27
%options fp=OCLBacktrackingLexer,prefix=Char_
28
%options single-productions
29
%options noserialize
30
%options package=org.eclipse.ocl.parser.backtracking
31
%options template=../../lpg/LexerTemplateF.gi
32
%options filter=OCLBacktrackingKWLexer.gi
33
%options export_terminals=("OCLBacktrackingParsersym.java", "TK_")
34
%options include_directory="..;../../lpg"
35
36
%Import
37
	OCLLexer.gi
38
%End
39
40
%Define
41
	$kw_lexer_class /.OCLBacktrackingKWLexer./
42
%End
(-)src/org/eclipse/ocl/parser/backtracking/EssentialOCLErrors.gi (+419 lines)
Added Link Here
1
--/**
2
-- * <copyright>
3
-- *
4
-- * Copyright (c) 2008, 2009 Eclipse.org, Open Canarias S.L, and others.
5
-- * All rights reserved.   This program and the accompanying materials
6
-- * are made available under the terms of the Eclipse Public License v1.0
7
-- * which accompanies this distribution, and is available at
8
-- * http://www.eclipse.org/legal/epl-v10.html
9
-- *
10
-- * Contributors:
11
-- *   E.D.Willink - Initial API and implementation
12
-- *   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
13
-- *
14
-- * </copyright>
15
-- *
16
-- * $Id: EssentialOCLErrors.g,v 1.1 2009/01/13 20:31:30 cdamus Exp $
17
-- */
18
--
19
-- Additional ERROR_TOKEN rules for The EssentialOCL Backtracking Parser
20
--
21
22
%Rules
23
	ERROR_Colon ::= ERROR_TOKEN
24
		/.$BeginCode
25
					reportErrorTokenMessage($getToken(1), OCLParserErrors.MISSING_COLON);
26
		  $EndCode
27
		./
28
	ERROR_Empty ::= ERROR_TOKEN
29
		/.$BeginCode
30
					reportErrorTokenMessage($getToken(1), OCLParserErrors.EXTRA_TOKENS);
31
		  $EndCode
32
		./
33
	ERROR_IsMarkedPreCS ::= ERROR_TOKEN
34
		/.$BeginCode
35
					reportErrorTokenMessage($getToken(1), OCLParserErrors.MISSING_AT_PRE);
36
					IsMarkedPreCS result = createIsMarkedPreCS(false);
37
					setOffsets(result, getIToken($getToken(1)));
38
					$setResult(result);
39
		  $EndCode
40
		./
41
42
	ERROR_PathNameCS ::= ERROR_TOKEN
43
		/.$BeginCode
44
					reportErrorTokenMessage($getToken(1), OCLParserErrors.MISSING_PATH_NAME);
45
					CSTNode result = createPathNameCS(getTokenText($getToken(1)));
46
					setOffsets(result, getIToken($getToken(1)));
47
					$setResult(result);
48
		  $EndCode
49
		./
50
		
51
	ERROR_SimpleNameCS ::= ERROR_TOKEN
52
		/.$BeginCode
53
					reportErrorTokenMessage($getToken(1), OCLParserErrors.MISSING_SIMPLE_NAME);
54
					SimpleNameCS result = createSimpleNameCS(
55
							SimpleTypeEnum.IDENTIFIER_LITERAL,
56
							getTokenText($getToken(1))
57
						);
58
					setOffsets(result, getIToken($getToken(1)));
59
					$setResult(result);
60
		  $EndCode
61
		./
62
63
	attrOrNavCallExpCS ::= simpleNameCS '[' argumentsCS ERROR_TOKEN
64
		/.$BeginCode
65
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RBRACK);
66
					CSTNode result = createFeatureCallExpCS(
67
							(SimpleNameCS)$getSym(1),
68
							(EList)$getSym(3),
69
							createIsMarkedPreCS(false)
70
						);
71
					setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(4)));
72
					$setResult(result);
73
		  $EndCode
74
		./
75
		
76
	collectionTypeCS ::= collectionTypeIdentifierCS '(' typeCS ERROR_TOKEN
77
		/.$BeginCode
78
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RPAREN);
79
					Object[] objs = (Object[])$getSym(1);
80
					CSTNode result = createCollectionTypeCS(
81
							(CollectionTypeIdentifierEnum)objs[1],
82
							(TypeCS)$getSym(3)
83
						);
84
					setOffsets(result, (IToken)objs[0], getIToken($getToken(4)));
85
					$setResult(result);
86
		  $EndCode
87
		./
88
	collectionTypeCS ::= collectionTypeIdentifierCS ERROR_TOKEN
89
		/.$BeginCode
90
					reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_LPAREN);
91
					Object[] objs = (Object[])$getSym(1);
92
					CSTNode result = createCollectionTypeCS(
93
							(CollectionTypeIdentifierEnum)objs[1],
94
							null
95
						);
96
					setOffsets(result, (IToken)objs[0], getIToken($getToken(2)));
97
					$setResult(result);
98
		  $EndCode
99
		./
100
101
	dotArrowExpCS ::=  pathNameCS '::' ERROR_SimpleNameCS '(' argumentsCSopt ')'
102
		/.$BeginCode
103
					OperationCallExpCS result = createOperationCallExpCS(
104
							(PathNameCS)$getSym(1),
105
							(SimpleNameCS)$getSym(3),
106
							(EList)$getSym(5)
107
						);
108
					setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(6)));
109
					result.setAccessor(DotOrArrowEnum.DOT_LITERAL);
110
					$setResult(result);
111
		  $EndCode
112
		./
113
-- FIXME	dotArrowExpCS ::= NUMERIC_OPERATION ERROR_SimpleNameCS
114
115
	enumLiteralExpCS ::= pathNameCS '::' ERROR_SimpleNameCS
116
		/.$BeginCode
117
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
118
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3);
119
					CSTNode result = createEnumLiteralExpCS(
120
							pathNameCS,
121
							simpleNameCS
122
						);
123
					setOffsets(result, pathNameCS, simpleNameCS);
124
					$setResult(result);
125
		  $EndCode
126
		./
127
		
128
	featureCallExpCS ::= unaryName ERROR_IsMarkedPreCS '(' argumentsCSopt ')'
129
		/.$NewCase./
130
	keywordOperationCallExpCS ::= keywordAsName ERROR_IsMarkedPreCS '(' argumentsCSopt ')'
131
		/.$NewCase./
132
	operationCallExpCS ::= binaryName ERROR_IsMarkedPreCS '(' argumentsCSopt ')'
133
		/.$BeginCode
134
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
135
					CSTNode result = createOperationCallExpCS(
136
							simpleNameCS,
137
							(IsMarkedPreCS)$getSym(2),
138
							(EList)$getSym(4)
139
						);
140
					setOffsets(result, simpleNameCS, getIToken($getToken(5)));
141
					$setResult(result);
142
		  $EndCode
143
		./
144
	operationCallExpCS ::= oclIsInStateName ERROR_IsMarkedPreCS '(' stateExpCS ')'
145
		/.$BeginCode
146
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(1);
147
					CSTNode result = createOperationCallExpCS(
148
							simpleNameCS,
149
							(IsMarkedPreCS)$getSym(2),
150
							(StateExpCS)$getSym(4)
151
						);
152
					setOffsets(result, simpleNameCS, getIToken($getToken(5)));
153
					$setResult(result);
154
		  $EndCode
155
		./
156
157
	ifExpCS ::= if oclExpressionCS then oclExpressionCS else oclExpressionCS ERROR_TOKEN
158
		/.$BeginCode
159
					reportErrorTokenMessage($getToken(7), OCLParserErrors.MISSING_ENDIF);
160
					CSTNode result = createIfExpCS(
161
							(OCLExpressionCS)$getSym(2),
162
							(OCLExpressionCS)$getSym(4),
163
							(OCLExpressionCS)$getSym(6)
164
						);
165
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(7)));
166
					$setResult(result);
167
		  $EndCode
168
		./
169
	ifExpCS ::= if oclExpressionCS then oclExpressionCS ERROR_TOKEN
170
		/.$BeginCode
171
					reportErrorTokenMessage($getToken(5), OCLParserErrors.MISSING_ELSE_ENDIF);
172
					CSTNode result = createIfExpCS(
173
							(OCLExpressionCS)$getSym(2),
174
							(OCLExpressionCS)$getSym(4),
175
							createInvalidLiteralExpCS(getTokenText($getToken(5)))
176
						);
177
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(5)));
178
					$setResult(result);
179
		  $EndCode
180
		./
181
	ifExpCS ::= if oclExpressionCS ERROR_TOKEN
182
		/.$BeginCode
183
					reportErrorTokenMessage($getToken(3), OCLParserErrors.MISSING_THEN_ELSE_ENDIF);
184
					CSTNode result = createIfExpCS(
185
							(OCLExpressionCS)$getSym(2),
186
							createInvalidLiteralExpCS(getTokenText($getToken(3))),
187
							createInvalidLiteralExpCS(getTokenText($getToken(3)))
188
						);
189
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(3)));
190
					$setResult(result);
191
		  $EndCode
192
		./
193
	ifExpCS ::= if ERROR_TOKEN endif
194
		/.$BeginCode
195
					reportErrorTokenMessage($getToken(3), OCLParserErrors.MISSING_THEN_ELSE);
196
					CSTNode result = createIfExpCS(
197
							createInvalidLiteralExpCS(getTokenText($getToken(2))),
198
							createInvalidLiteralExpCS(getTokenText($getToken(2))),
199
							createInvalidLiteralExpCS(getTokenText($getToken(2)))
200
						);
201
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(3)));
202
					$setResult(result);
203
		  $EndCode
204
		./
205
		
206
	messageExpCS ::= '^' simpleNameCS ERROR_TOKEN
207
		/.$NewCase./
208
	messageExpCS ::= '^^' simpleNameCS ERROR_TOKEN
209
		/.$BeginCode
210
					reportErrorTokenMessage($getToken(1), OCLParserErrors.MISSING_MESSAGE_ARGUMENTS);
211
					CSTNode result = createMessageExpCS(
212
							getIToken($getToken(1)).getKind() == $sym_type.TK_CARET,
213
							(SimpleNameCS)$getSym(2),
214
							new BasicEList<OCLMessageArgCS>()
215
						);
216
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(3)));
217
					$setResult(result);
218
		  $EndCode
219
		./
220
	messageExpCS ::= '^' ERROR_SimpleNameCS
221
		/.$NewCase./
222
	messageExpCS ::= '^^' ERROR_SimpleNameCS
223
		/.$BeginCode
224
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(2);
225
					CSTNode result = createMessageExpCS(
226
							getIToken($getToken(1)).getKind() == $sym_type.TK_CARET,
227
							simpleNameCS,
228
							new BasicEList<OCLMessageArgCS>()
229
						);
230
					setOffsets(result, getIToken($getToken(1)), simpleNameCS);
231
					$setResult(result);
232
		  $EndCode
233
		./
234
235
	oclExpCS ::= ERROR_TOKEN
236
		/.$BeginCode
237
					reportErrorTokenMessage($getToken(1), OCLParserErrors.MISSING_EXPR);
238
					CSTNode result = createInvalidLiteralExpCS(getTokenText($getToken(1)));
239
					setOffsets(result, getIToken($getToken(1)));
240
					$setResult(result);
241
		  $EndCode
242
		./
243
	oclExpCS ::= '(' oclExpressionCS ERROR_TOKEN
244
		/.$BeginCode
245
					reportErrorTokenMessage($getToken(3), OCLParserErrors.MISSING_RPAREN);
246
					CSTNode result = (CSTNode)$getSym(2);
247
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(3)));
248
					$setResult(result);
249
		  $EndCode
250
		./
251
252
	operationCS1 ::= IDENTIFIER '(' parametersCSopt ')' ERROR_Colon
253
		/.$BeginCode
254
					CSTNode result = createOperationCS(
255
							getTokenText($getToken(1)),
256
							(EList)$getSym(3),
257
							null
258
						);
259
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(5)));
260
					$setResult(result);
261
		  $EndCode
262
		./
263
	operationCS1 ::= IDENTIFIER '(' parametersCSopt ERROR_TOKEN
264
		/.$BeginCode
265
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RPAREN);
266
					CSTNode result = createOperationCS(
267
							getTokenText($getToken(1)),
268
							(EList)$getSym(3),
269
							null
270
						);
271
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(4)));
272
					$setResult(result);
273
		  $EndCode
274
		./
275
	operationCS1 ::= IDENTIFIER ERROR_TOKEN
276
		/.$BeginCode
277
					reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_LPAREN);
278
					CSTNode result = createOperationCS(
279
							getTokenText($getToken(1)),
280
							new BasicEList(),
281
							null
282
						);
283
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(2)));
284
					$setResult(result);
285
		  $EndCode
286
		./
287
	operationCS1 ::= ERROR_TOKEN
288
		/.$BeginCode
289
					reportErrorTokenMessage($getToken(1), OCLParserErrors.MISSING_IDENTIFIER);
290
					CSTNode result = createOperationCS(
291
							getTokenText($getToken(1)),
292
							new BasicEList(),
293
							null
294
						);
295
					setOffsets(result, getIToken($getToken(1)));
296
					$setResult(result);
297
		  $EndCode
298
		./
299
	operationCS2 ::= pathNameCS '::' simpleNameCS '(' parametersCSopt ')' ERROR_Colon
300
		/.$BeginCode
301
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
302
					CSTNode result = createOperationCS(
303
							pathNameCS,
304
							(SimpleNameCS)$getSym(3),
305
							(EList)$getSym(5),
306
							(TypeCS)$getSym(8)
307
						);
308
					setOffsets(result, pathNameCS, getIToken($getToken(7)));
309
					$setResult(result);
310
		  $EndCode
311
		./
312
	operationCS2 ::= pathNameCS '::' simpleNameCS '(' parametersCSopt ERROR_TOKEN
313
		/.$BeginCode
314
					reportErrorTokenMessage($getToken(6), OCLParserErrors.MISSING_RPAREN);
315
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
316
					CSTNode result = createOperationCS(
317
							pathNameCS,
318
							(SimpleNameCS)$getSym(3),
319
							(EList)$getSym(5),
320
							null
321
						);
322
					setOffsets(result, pathNameCS, getIToken($getToken(7)));
323
					$setResult(result);
324
		  $EndCode
325
		./
326
	operationCS2 ::= pathNameCS '::' simpleNameCS ERROR_TOKEN
327
		/.$BeginCode
328
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_LPAREN);
329
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
330
					CSTNode result = createOperationCS(
331
							pathNameCS,
332
							(SimpleNameCS)$getSym(3),
333
							new BasicEList(),
334
							null
335
						);
336
					setOffsets(result, pathNameCS, getIToken($getToken(4)));
337
					$setResult(result);
338
		  $EndCode
339
		./
340
	operationCS2 ::= pathNameCS '::' ERROR_SimpleNameCS
341
		/.$BeginCode
342
					PathNameCS pathNameCS = (PathNameCS)$getSym(1);
343
					SimpleNameCS simpleNameCS = (SimpleNameCS)$getSym(3);
344
					CSTNode result = createOperationCS(
345
							pathNameCS,
346
							simpleNameCS,
347
							new BasicEList(),
348
							null
349
						);
350
					setOffsets(result, pathNameCS, simpleNameCS);
351
					$setResult(result);
352
		  $EndCode
353
		./
354
355
	parametersCS ::= ERROR_TOKEN
356
		/.$BeginCode
357
					reportErrorTokenMessage($getToken(1), OCLParserErrors.MISSING_PARAMETERS);
358
					EList result = new BasicEList();
359
					$setResult(result);
360
		  $EndCode
361
		./
362
	parametersCS ::= parametersCS ',' ERROR_TOKEN
363
		/.$BeginCode
364
					reportErrorTokenMessage($getToken(3), OCLParserErrors.MISSING_PARAMETER);
365
		  $EndCode
366
		./
367
368
	pathNameCS -> ERROR_PathNameCS
369
		
370
	simpleNameCSopt -> ERROR_SimpleNameCS
371
372
	tupleLiteralExpCS ::= Tuple ERROR_TOKEN
373
		/.$BeginCode
374
					reportErrorTokenMessage($getToken(7), OCLParserErrors.MISSING_LBRACE);
375
					CSTNode result = createTupleLiteralExpCS((EList)$getSym(3));
376
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(4)));
377
					$setResult(result);
378
		  $EndCode
379
		./
380
381
	variableCS ::= IDENTIFIER ERROR_TOKEN
382
		/.$BeginCode
383
					reportErrorTokenMessage($getToken(2), OCLParserErrors.MISSING_VARIABLE_TYPE);
384
					CSTNode result = createVariableCS(
385
							getTokenText($getToken(1)),
386
							null,
387
							null
388
						);
389
					setOffsets(result, getIToken($getToken(1)), getIToken($getToken(2)));
390
					$setResult(result);
391
		  $EndCode
392
		./
393
394
	variableExpCS ::= simpleNameCS '[' argumentsCS ERROR_TOKEN
395
		/.$NewCase./
396
	variableExpCS ::= keywordAsName1 '[' argumentsCS ERROR_TOKEN
397
		/.$BeginCode
398
					reportErrorTokenMessage($getToken(4), OCLParserErrors.MISSING_RBRACK);
399
					CSTNode result = createVariableExpCS(
400
							(SimpleNameCS)$getSym(1),
401
							(EList)$getSym(3),
402
							createIsMarkedPreCS(false)
403
						);
404
					setOffsets(result, (CSTNode)$getSym(1), getIToken($getToken(4)));
405
					$setResult(result);
406
		  $EndCode
407
		./
408
409
	variableListCS ::= ERROR_TOKEN
410
		/.$NewCase./
411
	variableListCS2 ::= ERROR_TOKEN
412
		/.$BeginCode
413
					reportErrorTokenMessage($getToken(1), OCLParserErrors.MISSING_VARIABLES);
414
					EList result = new BasicEList();
415
					$setResult(result);
416
		  $EndCode
417
		./
418
419
%End
(-)src/org/eclipse/ocl/lpg/LexerTemplateF.gi (+331 lines)
Added Link Here
1
--
2
-- An instance of this template must have a $Export section and the export_terminals option
3
--
4
-- Macros that may be redefined in an instance of this template
5
--
6
--     $eof_token
7
--     $additional_interfaces
8
--     $super_stream_class -- subclass com.ibm.lpg.LpgLexStream for getKind
9
--     $prs_stream_class -- use /.PrsStream./ if not subclassing
10
--
11
-- B E G I N N I N G   O F   T E M P L A T E   LexerTemplateF
12
--
13
%Options programming_language=java,margin=4
14
%Options table
15
%options action-block=("*.java", "/.", "./")
16
%options ParseTable=lpg.runtime.ParseTable
17
%Options prefix=Char_
18
19
--
20
-- This template requires that the name of the EOF token be set
21
-- to EOF and that the prefix be "Char_" to be consistent with
22
-- KeywordTemplateD.
23
--
24
%Eof
25
    EOF
26
%End
27
28
--
29
-- This template also requires that the name of the parser EOF
30
-- Token to be exported be set to EOF_TOKEN
31
--
32
%Export
33
    EOF_TOKEN
34
%End
35
36
%Define
37
    --
38
    -- Macros that are be needed in an instance of this template
39
    --
40
    $eof_token /.$_EOF_TOKEN./
41
    
42
    $additional_interfaces /../
43
    $super_lexer_class  /.AbstractLexer./    
44
    $super_stream_class /.$file_prefix$Stream./
45
    $prs_stream_class /.OCLParserStream./    
46
47
    $environment_class /.BasicEnvironment./
48
    $adapt_environment /.environment./
49
50
    $prs_stream /. // macro prs_stream is deprecated. Use function getPrsStream
51
                  getPrsStream()./
52
    $setSym1 /. // macro setSym1 is deprecated. Use function setResult
53
               lexParser.setSym1./
54
    $setResult /. // macro setResult is deprecated. Use function setResult
55
                 lexParser.setSym1./
56
    $getSym /. // macro getSym is deprecated. Use function getLastToken
57
              lexParser.getSym./
58
    $getToken /. // macro getToken is deprecated. Use function getToken
59
                lexParser.getToken./
60
    $getLeftSpan /. // macro getLeftSpan is deprecated. Use function getLeftSpan
61
                   lexParser.getFirstToken./
62
    $getRightSpan /. // macro getRightSpan is deprecated. Use function getRightSpan
63
                    lexParser.getLastToken./
64
65
    --
66
    -- Macros useful for specifying actions
67
    --
68
    $Header
69
    /.
70
                //
71
                // Rule $rule_number:  $rule_text
72
                //
73
                ./
74
75
    $DefaultAction
76
    /.$Header$case $rule_number: { ./
77
78
    $BeginAction /.$DefaultAction./
79
80
    $EndAction
81
    /.            break;
82
                }./
83
84
    $BeginJava
85
    /.$BeginAction
86
                $symbol_declarations./
87
88
    $EndJava /.$EndAction./
89
90
    $NoAction
91
    /.$Header$case $rule_number:
92
                    break; ./
93
94
    $BeginActions
95
    /.
96
        public void ruleAction(int ruleNumber)
97
        {
98
            switch(ruleNumber)
99
            {./
100
101
    $SplitActions
102
    /.
103
                    default:
104
                        ruleAction$rule_number(ruleNumber);
105
                        break;
106
                }
107
                return;
108
            }
109
110
            public void ruleAction$rule_number(int ruleNumber)
111
            {
112
                switch (ruleNumber)
113
                {./
114
115
    $EndActions
116
    /.
117
                default:
118
                    break;
119
            }
120
            return;
121
        }./
122
%End
123
124
%Globals
125
    /.import lpg.runtime.*;
126
    import org.eclipse.ocl.lpg.AbstractLexer;
127
    import org.eclipse.ocl.lpg.AbstractLexerStream;
128
    import org.eclipse.ocl.lpg.OCLParserStream;
129
    ./
130
%End
131
132
%Headers
133
    /.
134
    @SuppressWarnings("nls")
135
    public class $action_type extends $super_lexer_class implements RuleAction$additional_interfaces
136
    {
137
        private $super_stream_class lexStream;
138
139
        private static ParseTable prs = new $prs_type();
140
        public ParseTable getParseTable() { return prs; }
141
142
        private LexParser lexParser = new LexParser();
143
        public LexParser getParser() { return lexParser; }
144
145
        public int getToken(int i) { return lexParser.getToken(i); }
146
        public int getRhsFirstTokenIndex(int i) { return lexParser.getFirstToken(i); }
147
        public int getRhsLastTokenIndex(int i) { return lexParser.getLastToken(i); }
148
149
        public int getLeftSpan() { return lexParser.getToken(1); }
150
        public int getRightSpan() { return lexParser.getLastToken(); }
151
152
        public void resetKeywordLexer()
153
        {
154
            if (kwLexer == null)
155
                  this.kwLexer = new $kw_lexer_class(lexStream.getInputChars(), $_IDENTIFIER);
156
            else this.kwLexer.setInputChars(lexStream.getInputChars());
157
        }
158
159
        public void reset(String filename, int tab) throws java.io.IOException
160
        {
161
            lexStream = new $super_stream_class(getOCLEnvironment(), filename, tab);
162
            lexParser.reset(lexStream, prs, this);
163
            resetKeywordLexer();
164
        }
165
166
        public void reset(char[] input_chars, String filename)
167
        {
168
            reset(input_chars, filename, ECLIPSE_TAB_VALUE);
169
        }
170
171
        public void reset(char[] input_chars, String filename, int tab)
172
        {
173
            lexStream = new $super_stream_class(getOCLEnvironment(), input_chars, filename, tab);
174
            lexParser.reset(lexStream, prs, this);
175
            resetKeywordLexer();
176
        }
177
178
        // OCL addition to reset the lexer stream from an input reader
179
        public void reset(Reader reader, String filename) throws java.io.IOException {
180
            reset(reader, filename, ECLIPSE_TAB_VALUE);
181
        }
182
        
183
        // OCL addition to reset the lexer stream from an input reader
184
		  public void reset(Reader reader, String filename, int tab) throws java.io.IOException {
185
        		char[] input_chars = getInputChars(reader);
186
            reset(input_chars, filename, tab);
187
        }
188
189
		  /**
190
		   * @since 3.0
191
		   */
192
        public $action_type($environment_class environment, String filename, int tab) throws java.io.IOException {
193
            super($adapt_environment);
194
            reset(filename, tab);
195
            oclEnvironment = environment;
196
        }
197
198
		  /**
199
		   * @since 3.0
200
		   */
201
        public $action_type($environment_class environment, String filename) throws java.io.IOException{
202
            this(environment, filename, ECLIPSE_TAB_VALUE);
203
        }
204
205
        public $action_type($environment_class environment, char[] input_chars, String filename, int tab) {
206
            super($adapt_environment);
207
            reset(input_chars, filename, tab);
208
            oclEnvironment = environment;
209
        }
210
211
		  public $action_type($environment_class environment, char[] chars) {
212
            this(environment, chars, "OCL", ECLIPSE_TAB_VALUE);
213
		  }
214
215
		  /**
216
		   * @since 3.0
217
		   */
218
		  public $action_type($environment_class environment, Reader reader) throws java.io.IOException {
219
            this(environment, reader, "OCL");
220
		  }
221
222
		  /**
223
		   * @since 3.0
224
		   */
225
        public $action_type($environment_class environment, Reader reader, String filename) throws java.io.IOException {
226
				this(environment, reader, filename, ECLIPSE_TAB_VALUE);
227
		  }
228
		  
229
		  /**
230
		   * @since 3.0
231
		   */
232
		  public $action_type($environment_class environment, Reader reader, String filename, int tab) throws java.io.IOException {
233
				super($adapt_environment);
234
				reset(reader, filename, tab);
235
				oclEnvironment = environment;
236
		  }
237
        
238
        private final $environment_class oclEnvironment;
239
        
240
        public $environment_class getOCLEnvironment() {
241
        	return oclEnvironment;
242
        }
243
244
        public AbstractLexerStream getILexStream() { return lexStream; }
245
246
        /**
247
         * @deprecated replaced by {@link #getILexStream()}
248
         */
249
        public ILexStream getLexStream() { return lexStream; }
250
251
        private void initializeLexer($prs_stream_class prsStream, int start_offset, int end_offset)
252
        {
253
            if (lexStream.getInputChars() == null)
254
                throw new NullPointerException("LexStream was not initialized");
255
            lexStream.setPrsStream(prsStream);
256
            prsStream.makeToken(start_offset, end_offset, 0); // Token list must start with a bad token
257
        }
258
259
        private void addEOF($prs_stream_class prsStream, int end_offset)
260
        {
261
            prsStream.makeToken(end_offset, end_offset, $eof_token); // and end with the end of file token
262
            prsStream.setStreamLength(prsStream.getSize());
263
        }
264
265
        public void lexer($prs_stream_class prsStream)
266
        {
267
            lexer(null, prsStream);
268
        }
269
        
270
        public void lexer(Monitor monitor, $prs_stream_class prsStream)
271
        {
272
            initializeLexer(prsStream, 0, -1);
273
            lexParser.parseCharacters(monitor);  // Lex the input characters
274
            addEOF(prsStream, lexStream.getStreamIndex());
275
        }
276
277
        public void lexer($prs_stream_class prsStream, int start_offset, int end_offset)
278
        {
279
            lexer(null, prsStream, start_offset, end_offset);
280
        }
281
        
282
        public void lexer(Monitor monitor, $prs_stream_class prsStream, int start_offset, int end_offset)
283
        {
284
            if (start_offset <= 1)
285
                 initializeLexer(prsStream, 0, -1);
286
            else initializeLexer(prsStream, start_offset - 1, start_offset - 1);
287
288
            lexParser.parseCharacters(monitor, start_offset, end_offset);
289
290
            addEOF(prsStream, (end_offset >= lexStream.getStreamIndex() ? lexStream.getStreamIndex() : end_offset + 1));
291
        }
292
293
        /**
294
         * If a parse stream was not passed to this Lexical analyser then we
295
         * simply report a lexical error. Otherwise, we produce a bad token.
296
         */
297
        public void reportLexicalError(int startLoc, int endLoc) {
298
            IPrsStream prs_stream = lexStream.getIPrsStream();
299
            if (prs_stream == null)
300
                lexStream.reportLexicalError(startLoc, endLoc);
301
            else {
302
                //
303
                // Remove any token that may have been processed that fall in the
304
                // range of the lexical error... then add one error token that spans
305
                // the error range.
306
                //
307
                for (int i = prs_stream.getSize() - 1; i > 0; i--) {
308
                    if (prs_stream.getStartOffset(i) >= startLoc)
309
                         prs_stream.removeLastToken();
310
                    else break;
311
                }
312
                prs_stream.makeToken(startLoc, endLoc, 0); // add an error token to the prsStream
313
            }        
314
        }
315
    ./
316
%End
317
318
%Rules
319
    /.$BeginActions./
320
%End
321
322
%Trailers
323
    /.
324
        $EndActions
325
    }
326
    ./
327
%End
328
329
--
330
-- E N D   O F   T E M P L A T E
331
--
(-)src/org/eclipse/ocl/parser/OCLLexer.gi (+620 lines)
Added Link Here
1
--/**
2
-- * <copyright>
3
-- *
4
-- * Copyright (c) 2005, 2009 IBM Corporation, Borland Software Corp., Open Canarias S.L. and others.
5
-- * All rights reserved.   This program and the accompanying materials
6
-- * are made available under the terms of the Eclipse Public License v1.0
7
-- * which accompanies this distribution, and is available at
8
-- * http://www.eclipse.org/legal/epl-v10.html
9
-- *
10
-- * Contributors:
11
-- *   IBM - Initial API and implementation
12
-- *   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
13
-- *               - Bug 259818
14
-- *   Borland - Bug 242880
15
-- *   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
16
-- *   
17
-- * </copyright>
18
-- *
19
-- * $Id: OCLLexer.g,v 1.2 2009/02/12 00:04:09 cdamus Exp $
20
-- */
21
--
22
-- The OCL Lexer
23
--
24
25
%options escape=$
26
%options la=2
27
%options fp=OCLLexer,prefix=Char_
28
%options single-productions
29
%options noserialize
30
%options package=org.eclipse.ocl.parser
31
%options template=../lpg/LexerTemplateF.gi
32
%options filter=OCLKWLexer.gi
33
%options export_terminals=("OCLParsersym.java", "TK_")
34
%options include_directory="../lpg"
35
36
%Define
37
38
	--
39
	-- Definition of macros used in the template
40
	--
41
	$action_class /.$file_prefix./ -- Deprecated.
42
	$eof_token /.$_EOF_TOKEN./
43
    $environment_class /.Environment<?,?,?,?,?,?,?,?,?,?,?,?>./
44
    $adapt_environment /.OCLUtil.getAdapter(environment, BasicEnvironment.class)./
45
    $environment_import /.org.eclipse.ocl.Environment./
46
 
47
	--
48
	-- Definition of macro used in the included file LexerBasicMap.g
49
	--
50
	$kw_lexer_class /.OCLKWLexer./
51
	$copyright_contributions /.*./
52
53
%End
54
55
%Notice
56
	/./**
57
 * <copyright>
58
 *
59
 * Copyright (c) 2005, 2009 IBM Corporation, Borland Software Corp., Open Canarias S.L. and others.
60
 * All rights reserved.   This program and the accompanying materials
61
 * are made available under the terms of the Eclipse Public License v1.0
62
 * which accompanies this distribution, and is available at
63
 * http://www.eclipse.org/legal/epl-v10.html
64
 *
65
 * Contributors:
66
 *   IBM - Initial API and implementation
67
 *   E.D.Willink - Lexer and Parser refactoring to support extensibility and flexible error handling
68
 *               - Bug 259818
69
 *   Borland - Bug 242880
70
 *   Adolfo Sanchez-Barbudo Herrera - LPG v2.0.17 adoption
71
 $copyright_contributions
72
 * </copyright>
73
 *
74
 * $Id$
75
 */
76
	./
77
%End
78
79
%Import
80
	LexerBasicMapF.gi
81
%End
82
83
%Globals
84
    /.
85
    import java.io.Reader;
86
    
87
    import $environment_import;
88
    import org.eclipse.ocl.lpg.BasicEnvironment;
89
    import org.eclipse.ocl.util.OCLUtil;
90
    ./
91
%End
92
93
%Export
94
95
	IDENTIFIER
96
	STRING_LITERAL
97
	INTEGER_LITERAL
98
	REAL_LITERAL
99
	NUMERIC_OPERATION
100
	INTEGER_RANGE_START
101
	
102
	PLUS
103
	MINUS
104
	MULTIPLY
105
	DIVIDE
106
107
	GREATER
108
	LESS
109
	EQUAL
110
	GREATER_EQUAL
111
	LESS_EQUAL
112
	NOT_EQUAL
113
114
	LPAREN
115
	RPAREN
116
	LBRACE
117
	RBRACE
118
	LBRACKET
119
	RBRACKET
120
121
	ARROW
122
	BAR
123
	COMMA
124
	COLON
125
	COLONCOLON
126
	SEMICOLON
127
	DOT
128
	DOTDOT
129
	ATPRE
130
	
131
	CARET
132
	CARETCARET
133
	QUESTIONMARK
134
		
135
	SINGLE_LINE_COMMENT
136
	MULTI_LINE_COMMENT
137
138
%End
139
140
%Terminals
141
	CtlCharNotWS
142
143
	LF   CR   HT   FF
144
145
	a b c d e f g h i j k l m n o p q r s t u v w x y z
146
	_
147
148
	A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
149
150
	0 1 2 3 4 5 6 7 8 9
151
152
	AfterASCIINotAcute
153
	Space        ::= ' '
154
	LF           ::= NewLine
155
	CR           ::= Return
156
	HT           ::= HorizontalTab
157
	FF           ::= FormFeed
158
	DoubleQuote  ::= '"'
159
	SingleQuote  ::= "'"
160
	Percent      ::= '%'
161
	VerticalBar  ::= '|'
162
	Exclamation  ::= '!'
163
	AtSign       ::= '@'
164
	BackQuote    ::= '`'
165
	Acute        ::= '�'
166
	Tilde        ::= '~'
167
	Sharp        ::= '#'
168
	DollarSign   ::= '$'
169
	Ampersand    ::= '&'
170
	Caret        ::= '^'
171
	Colon        ::= ':'
172
	SemiColon    ::= ';'
173
	BackSlash    ::= '\'
174
	LeftBrace    ::= '{'
175
	RightBrace   ::= '}'
176
	LeftBracket  ::= '['
177
	RightBracket ::= ']'
178
	QuestionMark ::= '?'
179
	Comma        ::= ','
180
	Dot          ::= '.'
181
	LessThan     ::= '<'
182
	GreaterThan  ::= '>'
183
	Plus         ::= '+'
184
	Minus        ::= '-'
185
	Slash        ::= '/'
186
	Star         ::= '*'
187
	LeftParen    ::= '('
188
	RightParen   ::= ')'
189
	Equal        ::= '='
190
191
%End
192
193
%Start
194
	Token
195
%End
196
197
%Rules
198
199
	---------------------  Rules for Scanned Tokens --------------------------------
200
	-- The lexer creates an array list of tokens which is defined in the PrsStream class.
201
	-- A token has three attributes: a start offset, an end offset and a kind.
202
	-- 
203
	-- Only rules that produce complete tokens have actions to create token objects.
204
	-- When making a token, calls to the methods, $getToken(1) and $getRightSpan(), 
205
	-- provide the offsets (i.e. the span) of a rule's right hand side (rhs) and thus of the token.
206
	-- For a rule of the form A ::= A1 A2 ... An, the start offset of the rhs of A is given by
207
	-- $getToken(1) or by $getLeftSpan() and the end offset by $getRightSpan().
208
	--  
209
	-- Regarding rules for parsing in general, note that for a rhs symbol Ai, the 
210
	-- method $getToken(i) returns the location of the leftmost character derived from Ai.  
211
	-- The method $getLeftSpan(i) returns the same location unless Ai produces %empty in which case
212
	-- it returns the location of the last character derived before reducing Ai to %empty. 
213
	-- The method $getRightSpan(i) returns the location of the rightmost character derived from Ai 
214
	-- unless Ai produces %empty in which case it returns the location of the last character 
215
	-- derived before reducing Ai to %empty.
216
	--------------------------------------------------------------------------------
217
	Token ::= Identifier
218
		/.$BeginAction
219
					checkForKeyWord();
220
		  $EndAction
221
		./
222
223
	-- an empty String literal looks just like an escaped single-quote
224
	Token ::= EscapedSQ
225
		/.$BeginAction
226
					makeToken($_STRING_LITERAL);
227
		  $EndAction
228
		./
229
230
	Token ::= SingleQuote SLNotSQ SingleQuote
231
		/.$BeginAction
232
					makeToken($_STRING_LITERAL);
233
		  $EndAction
234
		./
235
236
	Token ::= Acute SLNotSQOpt Acute
237
		/.$BeginAction
238
					makeToken($_STRING_LITERAL);
239
		  $EndAction
240
		./
241
242
	Token ::= BackQuote SLNotSQOpt Acute
243
		/.$BeginAction
244
					makeToken($_STRING_LITERAL);
245
		  $EndAction
246
		./
247
248
	Token ::= IntegerLiteral
249
		/.$BeginAction
250
					makeToken($_INTEGER_LITERAL);
251
		  $EndAction
252
		./
253
254
	Token ::= RealLiteral
255
		/.$BeginAction
256
					makeToken($_REAL_LITERAL);
257
		  $EndAction
258
		./
259
260
	Token ::= NumericOperation
261
		/.$BeginAction
262
					makeToken($_NUMERIC_OPERATION);
263
		  $EndAction
264
		./
265
266
	Token ::= IntegerRangeStart
267
		/.$BeginAction
268
					makeToken($_INTEGER_RANGE_START);
269
		  $EndAction
270
		./
271
272
	Token ::= SLC
273
		/.$BeginAction
274
					makeComment($_SINGLE_LINE_COMMENT);
275
		  $EndAction
276
		./
277
278
    Token ::= '/' '*' Inside Stars '/'
279
        /.$BeginAction
280
                    makeComment($_MULTI_LINE_COMMENT);
281
          $EndAction
282
        ./
283
284
	Token ::= WS -- White Space is scanned but not added to output vector
285
		/.$BeginAction
286
					skipToken();
287
		  $EndAction
288
		./
289
290
	Token ::= '+'
291
		/.$BeginAction
292
					makeToken($_PLUS);
293
		  $EndAction
294
		./
295
296
	Token ::= '-'
297
		/.$BeginAction
298
					makeToken($_MINUS);
299
		  $EndAction
300
		./
301
302
	Token ::= '*'
303
		/.$BeginAction
304
					makeToken($_MULTIPLY);
305
		  $EndAction
306
		./
307
308
	Token ::= '/'
309
		/.$BeginAction
310
					makeToken($_DIVIDE);
311
		  $EndAction
312
		./
313
314
	Token ::= '('
315
		/.$BeginAction
316
					makeToken($_LPAREN);
317
		  $EndAction
318
		./
319
320
	Token ::= ')'
321
		/.$BeginAction
322
					makeToken($_RPAREN);
323
		  $EndAction
324
		./
325
326
	Token ::= '>'
327
		/.$BeginAction
328
					makeToken($_GREATER);
329
		  $EndAction
330
		./
331
		
332
	Token ::= '<'
333
		/.$BeginAction
334
					makeToken($_LESS);
335
		  $EndAction
336
		./
337
338
	Token ::= '='
339
		/.$BeginAction
340
					makeToken($_EQUAL);
341
		  $EndAction
342
		./
343
344
	Token ::= '>' '='
345
		/.$BeginAction
346
					makeToken($_GREATER_EQUAL);
347
		  $EndAction
348
		./
349
350
	Token ::= '<' '='
351
		/.$BeginAction
352
					makeToken($_LESS_EQUAL);
353
		  $EndAction
354
		./
355
356
	Token ::= '<' '>'
357
		/.$BeginAction
358
					makeToken($_NOT_EQUAL);
359
		  $EndAction
360
		./
361
362
	Token ::= '['
363
		/.$BeginAction
364
					makeToken($_LBRACKET);
365
		  $EndAction
366
		./
367
368
	Token ::= ']'
369
		/.$BeginAction
370
					makeToken($_RBRACKET);
371
		  $EndAction
372
		./
373
374
	Token ::= '{'
375
		/.$BeginAction
376
					makeToken($_LBRACE);
377
		  $EndAction
378
		./
379
380
	Token ::= '}'
381
		/.$BeginAction
382
					makeToken($_RBRACE);
383
		  $EndAction
384
		./
385
386
	Token ::= '-' '>'
387
		/.$BeginAction
388
					makeToken($_ARROW);
389
		  $EndAction
390
		./
391
392
	Token ::= '|'
393
		/.$BeginAction
394
					makeToken($_BAR);
395
		  $EndAction
396
		./
397
398
	Token ::= ','
399
		/.$BeginAction
400
					makeToken($_COMMA);
401
		  $EndAction
402
		./
403
404
	Token ::= ':'
405
		/.$BeginAction
406
					makeToken($_COLON);
407
		  $EndAction
408
		./
409
410
	Token ::= ':' ':'
411
		/.$BeginAction
412
					makeToken($_COLONCOLON);
413
		  $EndAction
414
		./
415
416
	Token ::= ';'
417
		/.$BeginAction
418
					makeToken($_SEMICOLON);
419
		  $EndAction
420
		./
421
422
	Token ::= '.'
423
		/.$BeginAction
424
					makeToken($_DOT);
425
		  $EndAction
426
		./
427
428
	Token ::= '.' '.'
429
		/.$BeginAction
430
					makeToken($_DOTDOT);
431
		  $EndAction
432
		./
433
434
	Token ::= '@' p r e
435
		/.$BeginAction
436
					makeToken($_ATPRE);
437
		  $EndAction
438
		./
439
440
441
	Token ::= '^'
442
		/.$BeginAction
443
					makeToken($_CARET);
444
		  $EndAction
445
		./
446
447
	Token ::= '^' '^'
448
		/.$BeginAction
449
					makeToken($_CARETCARET);
450
		  $EndAction
451
		./
452
		
453
	Token ::= '?'
454
		/.$BeginAction
455
					makeToken($_QUESTIONMARK);
456
		  $EndAction
457
		./
458
459
460
    IntegerLiteral -> Integer
461
    --                | '0' LetterXx HexDigits
462
463
    RealLiteral -> Decimal
464
                 | Decimal Exponent
465
                 | Integer Exponent
466
467
    Inside ::= Inside Stars NotSlashOrStar
468
             | Inside '/'
469
             | Inside NotSlashOrStar
470
             | %empty
471
472
    Stars -> '*'
473
           | Stars '*'
474
475
    SLC -> '-' '-'
476
         | SLC NotEol
477
478
    Integer -> Digit
479
             | Integer Digit
480
481
    HexDigits -> HexDigit
482
               | HexDigits HexDigit
483
484
    Decimal -> Integer '.' Integer
485
486
    Exponent -> LetterEe Integer
487
              | LetterEe '-' Integer
488
              | LetterEe '+' Integer
489
490
    WSChar -> Space
491
            | LF
492
            | CR
493
            | HT
494
            | FF
495
496
    Letter -> LowerCaseLetter
497
            | UpperCaseLetter
498
            | _
499
            | AfterASCIINotAcute
500
501
    LowerCaseLetter -> a | b | c | d | e | f | g | h | i | j | k | l | m |
502
                       n | o | p | q | r | s | t | u | v | w | x | y | z
503
504
    UpperCaseLetter -> A | B | C | D | E | F | G | H | I | J | K | L | M |
505
                       N | O | P | Q | R | S | T | U | V | W | X | Y | Z
506
507
    Digit -> 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
508
509
    OctalDigit -> 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
510
511
    a..fA..F -> a | b | c | d | e | f | A | B | C | D | E | F
512
513
    HexDigit -> Digit
514
              | a..fA..F
515
516
    OctalDigits3 -> OctalDigit
517
                  | OctalDigit OctalDigit
518
                  | OctalDigit OctalDigit OctalDigit
519
520
    LetterEe -> 'E'
521
              | 'e'
522
523
    LetterXx -> 'X'
524
              | 'x'
525
526
    WS -> WSChar
527
        | WS WSChar
528
529
    Identifier -> Letter
530
                | Identifier Letter
531
                | Identifier Digit
532
                | Identifier DollarSign
533
                | QuotedName
534
535
    SpecialNotStar -> '+' | '-' | '/' | '(' | ')' | '"' | '!' | '@' | '`' | '~' |
536
                      '%' | '&' | '^' | ':' | ';' | "'" | '\' | '|' | '{' | '}' |
537
                      '[' | ']' | '?' | ',' | '.' | '<' | '>' | '=' | '#' | DollarSign
538
539
    SpecialNotSlash -> '+' | '-' | -- exclude the star as well
540
                       '(' | ')' | '"' | '!' | '@' | '`' | '~' |
541
                       '%' | '&' | '^' | ':' | ';' | "'" | '\' | '|' | '{' | '}' |
542
                       '[' | ']' | '?' | ',' | '.' | '<' | '>' | '=' | '#' | DollarSign
543
544
    SpecialNotSQNotDQ -> '+' | '-' | '/' | '(' | ')' | '*' | '!' | '@' | '`' | '~' |
545
                         '%' | '&' | '^' | ':' | ';' | '|' | '{' | '}' |
546
                         '[' | ']' | '?' | ',' | '.' | '<' | '>' | '=' | '#' | DollarSign
547
548
    
549
    SpecialNotDQ -> SpecialNotSQNotDQ | "'"
550
    SpecialNotSQ -> SpecialNotSQNotDQ | '"'
551
552
    EscapedSymbols -> NotSQNotDQ | '"' | "'" | '\'
553
    BackslashEscapedSymbol -> '\' EscapedSymbols
554
555
    NotSlashOrStar -> Letter
556
                    | Digit
557
                    | SpecialNotSlash
558
                    | WSChar
559
560
    NotEol -> Letter
561
            | Digit
562
            | Space
563
            | '*'
564
            | SpecialNotStar
565
            | HT
566
            | FF
567
            | CtlCharNotWS
568
569
    NotSQNotDQ -> Letter
570
           | Digit
571
           | SpecialNotSQNotDQ
572
           | Space
573
574
    NotDQ -> Letter
575
           | Digit
576
           | SpecialNotDQ
577
           | Space
578
           | EscapedDQ
579
           --| '\' u HexDigit HexDigit HexDigit HexDigit
580
           --| '\' OctalDigit
581
582
    NotSQ -> Letter
583
           | Digit
584
           | SpecialNotSQ
585
           | Space
586
           | EscapedSQ
587
           | BackslashEscapedSymbol
588
           --| '\' u HexDigit HexDigit HexDigit HexDigit
589
           --| '\' OctalDigit
590
591
	EscapedSQ -> SingleQuote SingleQuote
592
593
	-- maintain this for compatibility with the "...\"..." escapes in an
594
	-- escape mechanism (double-quotes) that isn't compliant, anyway
595
	EscapedDQ -> '\' DoubleQuote
596
597
	SLNotDQ -> NotDQ
598
	         | SLNotDQ NotDQ
599
600
	SLNotSQ -> NotSQ
601
	         | SLNotSQ NotSQ
602
603
	SLNotSQOpt -> %empty
604
	            | SLNotSQ
605
606
	QuotedName -> '"' SLNotDQ '"'
607
608
	NumericOperation -> Integer '.' Identifier
609
	NumericOperation -> Integer '.' '+'
610
	NumericOperation -> Integer '.' '-'
611
	NumericOperation -> Integer '.' '*'
612
	NumericOperation -> Integer '.' '/'
613
	NumericOperation -> Integer '.' '<'
614
	NumericOperation -> Integer '.' '<' '='
615
	NumericOperation -> Integer '.' '>' '='
616
	NumericOperation -> Integer '.' '>'
617
618
	IntegerRangeStart -> Integer '.' '.'
619
620
%End

Return to bug 242153