Tool bar actions

OCLEditor incorporates a tool bar which allows several actions. Although all the actions are not available for every element class, one action can be an available for different element classes.


Tool bar actions.

Below there is a description of the actions

Syntax analysis

This action does a syntax analysis of the OCL expression. If the expression is syntactically correct it will appear a confirmation message, if not it will appear an error message and the icon that represents the element in the tree viewer will have yellow colour.

Semantic analysis

This action does a semantic analysis of the OCL expression. The messages are showed in the console just like the previous case. In the same way, the icon will have yellow colour when the expression is not semantically correct.

To preserve the consistence of the stored expressions, a semantic analysis of them is always done implicitly after the edition.

Parse to Maude

This action permits the Maude code visualization as a result of the translation process of an OCL expression. It gives operational semantics (i.e. it allows its execution). This operation is available for debugging tasks.

Execute invariants / Execute group / Execute OCL

These actions permit the evaluation of every invariant associated to an element of the class Model (action Execute invariants), the evaluation of a group of invariants (action Execute group associated to an element of the class Invariant Group), or the evaluation of a specific OCL Expression (action Execute OCL associated to the elements of the classes Invariant, Query and QVT Query).

The result of the evaluation is shown in the console. When an invariant value is evaluated, the icon that represents the invariant in the tree viewer will have green colour if it is true, otherwise the icon will have red colour.

If any syntax, semantic or internal tool error is detected after the execution and evaluation of an OCL expression, the icon that represents the OCL expression in the tree viewer will have yellow colour and an error message is shown in the console.

Show AST

You can visualize a textual schema of the augmented AST associated to the result of an OCL expression translation. It will provide a structured view like this one.

An example, for the given OCL expression (specified on the Royal and Loyal model):

context LoyaltyProgram inv : self.partners.size() > 0

will give the next textual representation of the augmented AST (semantic model instance of OCL 2.0 of KMF) :

OperationCall { 
	OperationCall { 
		PropertyCall { 
			VariableExp { 
				Variable self:OclModelElementType(LoyaltyProgram) 
			} 


			Property partners:OrderedSet(OclModelElementType(ProgramPartner)) 
		}
		Operation size() 
	} 	
	Operation >() 
	Integer(0) 
} 

Type = Boolean 

Show code for transformation

This action is similar to the Parse to Maude one that is particular for de QVT Query class of the elements.

Reset OCL Tags

This action sets the boolean tags referred to the OCL expressions with the default values.

Save OCLEditor file

It permits to store a set of OCL expressions of the current file in another file. The wizard will guide you in a similar way to the creation of a mocl file, so you have to choose a folder in the current workspace and the name of the mocl target file.

You can access to this action by means of selecting a set of elements of the Model class (it will save at the same time all the elements that depend on them).

Save OCL expressions

You can save a set of expressions OCL from the current file in a text file with eocl extension. It uses a wizard which selects a folder of the current workspace and sets an eocl target file name. This type of files can be edited through a specific editor, which supplies syntax colour for the supported OCL.


OCL syntax colour editor.

View OCL expressions.

This action allows you to visualize a set of OCL expressions in the console.