|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.mtl.parser.ast.ocl.OCLParser
public class OCLParser
To parse an OCL Expression. Make sure to call dispose() once you're done with the parser.
| Field Summary | |
|---|---|
static java.lang.String |
ANNOTATION_KEY_TYPE
To set the value of the 'type' key for each MTL annotation. |
static java.lang.String |
ANNOTATION_SOURCE
To set the value of the 'Source' attribute for each MTL annotation. |
| Constructor Summary | |
|---|---|
OCLParser(org.eclipse.emf.ecore.resource.Resource oclEnvironmentResource)
Create a new OCL parser for MTL. |
|
| Method Summary | |
|---|---|
void |
addMetamodel(org.eclipse.emf.ecore.EPackage metamodel)
Add a new EPackage in the list of the metamodels considered during the parsing. |
void |
addRecursivelyBehavioralFeaturesToScope(Module oModule)
Add the behavioral features of a module in the current parsing scope. |
void |
addRecursivelyMetamodelsToScope(Module oModule)
Add all EPackage of a module in the list of the metamodels considered during the parsing. |
org.eclipse.emf.ecore.EClassifier |
addRecursivelyVariablesToScopeAndGetContextClassifierAt(Module oModule,
int offset)
Add the accessible variables (at the given index) in the current parsing scope. |
void |
addVariableToScope(org.eclipse.ocl.ecore.Variable newVariable)
Add a new variable in the current parsing scope. |
void |
dispose()
Clear all contextual information. |
org.eclipse.emf.ecore.EClassifier |
getInvalidType()
Obtains the single instance of the OCL invalid type. |
java.util.List<org.eclipse.ocl.helper.Choice> |
getSyntaxHelp(java.lang.String text)
Obtains syntax completion choices for the specified fragment of an OCL expression. |
java.util.List<org.eclipse.emf.ecore.EClassifier> |
getTypes()
Gets the meta-model types of the current module. |
org.eclipse.emf.ecore.EClassifier |
lookupClassifier(java.lang.String name)
Selects the meta-model object for the given name in the current module. |
org.eclipse.ocl.ecore.OCLExpression |
parseOCLExpression(java.lang.String text,
int realOffsetInTheBuffer)
Parse an OCL Expression and return the corresponding instance. |
void |
popContext()
Restores the previous context. |
void |
pushContext(org.eclipse.emf.ecore.EClassifier newContext)
Next OCL expressions will have this new context. |
void |
removeMetamodel(org.eclipse.emf.ecore.EPackage metamodel)
Remove a EPackage in the list of the metamodels considered during the parsing. |
void |
removeRecursivelyBehavioralFeaturesToScope(Module oModule)
Remove the behavioral features in the current parsing scope. |
void |
removeVariableFromScope(org.eclipse.ocl.ecore.Variable oldVariable)
Remove an accessible variable from the current parser scope. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ANNOTATION_SOURCE
public static final java.lang.String ANNOTATION_KEY_TYPE
| Constructor Detail |
|---|
public OCLParser(org.eclipse.emf.ecore.resource.Resource oclEnvironmentResource)
oclEnvironmentResource - resource used to keep the OCL environment.| Method Detail |
|---|
public void pushContext(org.eclipse.emf.ecore.EClassifier newContext)
newContext - is the new contextpublic void popContext()
public void addVariableToScope(org.eclipse.ocl.ecore.Variable newVariable)
newVariable - a new ocl variable to consider while parsing.
public org.eclipse.emf.ecore.EClassifier addRecursivelyVariablesToScopeAndGetContextClassifierAt(Module oModule,
int offset)
oModule - is the current moduleoffset - is the offset in the text
public void addRecursivelyBehavioralFeaturesToScope(Module oModule)
oModule - is the current modulepublic void removeRecursivelyBehavioralFeaturesToScope(Module oModule)
oModule - is the current modulepublic void addRecursivelyMetamodelsToScope(Module oModule)
EPackage of a module in the list of the metamodels considered during the parsing.
oModule - is the current modulepublic void addMetamodel(org.eclipse.emf.ecore.EPackage metamodel)
EPackage in the list of the metamodels considered during the parsing.
metamodel - EPackage to add in the current EPackage's known by the parser.public void removeMetamodel(org.eclipse.emf.ecore.EPackage metamodel)
EPackage in the list of the metamodels considered during the parsing.
metamodel - EPackage to remove in the current EPackage's known by the parser.public org.eclipse.emf.ecore.EClassifier lookupClassifier(java.lang.String name)
name - is the name of the type to search
public java.util.List<org.eclipse.emf.ecore.EClassifier> getTypes()
public org.eclipse.emf.ecore.EClassifier getInvalidType()
public org.eclipse.ocl.ecore.OCLExpression parseOCLExpression(java.lang.String text,
int realOffsetInTheBuffer)
throws org.eclipse.ocl.ParserException
text - is the OCL text to parse, just a part of the filerealOffsetInTheBuffer - beginning index of the given text in the file, this index is used to compute the real offset
of a problem...
OCLExpression instance.
org.eclipse.ocl.ParserException - if the given text is not conform to what we expect.public void dispose()
public void removeVariableFromScope(org.eclipse.ocl.ecore.Variable oldVariable)
oldVariable - oldVariable is the variable to remove.public java.util.List<org.eclipse.ocl.helper.Choice> getSyntaxHelp(java.lang.String text)
text - a partial OCL expression for which to seek choices that could be appended to it
Choices, possibly empty. The ordering of the list may or may not indicate
relative relevance or frequency of a choice
|
Copyright 2008 Obeo All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||