VerbalizePatterns
No edit summary
No edit summary
Line 42: Line 42:


[OPERATION:if:(<ARG_1>,<ARG_2>):<T>] *** if true then <ARG_1> else <ARG_2>
[OPERATION:if:(<ARG_1>,<ARG_2>):<T>] *** if true then <ARG_1> else <ARG_2>
[OPERATION:if:(<ARG_1>,<ARG_2>):<COLLECTION(T)>] *** if true then <ARG_1> else <ARG_2>


[OPERATION::=:(<ARG_1>):<T>] *** and assign it to the result of <ARG_1>
[OPERATION::=:(<ARG_1>):<T>] *** and assign it to the result of <ARG_1>

Revision as of 14:46, 13 August 2019

This page can be downloaded from the MDrivenDesigner and act as patterns for verbalization of OCL expressions. Divider between pattern and translation is 3 stars padded by a space.

STARTMARKER

[SELF:<NAME>:<T>] *** From the current context (of type <T> )

[MULTI:<NAME>:<COLLECTION(T)>] *** take the multilink named <NAME> that holds objects of type <T>

[SINGLE:<NAME>:<T>] *** take the singlelink named <NAME> that has an object of type <T>

[OPERATION:allinstances:<COLLECTION(T)>] *** Take all exsisting objects

[ITERATION:select:<LOOPVARNAME>:<LOOPVARTYPE>:(<ARG_1>):<COLLECTION(T)>] *** filter the list by going over all objects, in each iteration we call the current object <LOOPVARNAME> and check <ARG_1> - keep the objects that evaluate to true - the result is a reduced list of objects of <T>

[ITERATION:<NAME>:<LOOPVARNAME>:<LOOPVARTYPE>:(<ARG_1>):<COLLECTION(T)>]

[LOOPVAR:<NAME>:<LOOPVARNAME>:<T>] *** current object of iteration <LOOPVARNAME> of type <T>

[ATTRIBUTE:<NAME>:<T>] *** take the attribut <NAME> that has the type <T>

[OPERATION:>:(<ARG_1>):<T>] *** if it is larger (>) than <ARG_1>

[OPERATION:<:(<ARG_1>):<T>] *** check if it is smaller (<) than <ARG_1>

[OPERATION:or:(<ARG_1>):<T>] *** or (or) the following is true: <ARG_1>

[OPERATION:and:(<ARG_1>):<T>] *** and (and) also the following is true: <ARG_1>

[OPERATION:first:<T>] *** take the first object

[CONST:<NAME>:<CONSTVALUE>:<T>] *** <CONSTVALUE> (of type <T>)

[TYPE:<NAME>:<T>] *** From type <NAME>

[OPERATION:<NAME>:(<ARG_1>):<T>] *** apply operation <NAME> with argument <ARG_1>, it will return a value of type <T>

[VAR:<NAME>:System.Boolean] *** value of <NAME>

[VAR:<NAME>:<T>] *** value of <NAME>

[VAR:<NAME>:<COLLECTION(T)>] *** <NAME> is a list of <T> objects

[OPERATION:if:(<ARG_1>,<ARG_2>):<T>] *** if true then <ARG_1> else <ARG_2>

[OPERATION:if:(<ARG_1>,<ARG_2>):<COLLECTION(T)>] *** if true then <ARG_1> else <ARG_2>

[OPERATION::=:(<ARG_1>):<T>] *** and assign it to the result of <ARG_1>

[OPERATION:=:(<ARG_1>):<T>] *** and check if it is equal to <ARG_1>

[OPERATION:;:(<ARG_1>):<T>] *** . <ARG_1>

[OPERATION:not:System.Boolean] *** avoid all that match

[OPERATION:oclsingleton:<T>] *** Get the singleton object of type <T>

[OPERATION:isnull:System.Boolean] *** is not assigned a value (null)

[OPERATION:notnull:System.Boolean] *** is assigned a value (not null)

[OPERATION:+:(<ARG_1>):System.String] *** append <ARG_1> to the string

[OPERATION:oclisinstate:(<ARG_1>):System.Boolean] *** and object is in state: <ARG_1>

[CONST:<NAME>:<CONSTVALUE>:<Enum Literal>] *** <CONSTVALUE>

[OPERATION:oclisinstate:(<ARG_1>):System.Boolean].[CONST:<NAME>:<CONSTVALUE>:<Enum Literal>] *** test1<CONSTVALUE>

[CONST:<NAME>:<CONSTVALUE>:<Enum Literal>].[OPERATION:oclisinstate:(<ARG_1>):System.Boolean] *** test2<CONSTVALUE>

[OPERATION:oclisinstate:(<[CONST:<NAME>:<CONSTVALUE>:<Enum Literal>]>):System.Boolean] *** test3<CONSTVALUE>

[OPERATION:oclisinstate:([CONST:<NAME>:<CONSTVALUE>:<Enum Literal>]):System.Boolean] *** test4<CONSTVALUE>

[LET:<NAME>:<LOOPVARTYPE>:<LETASSIGNEXP>:<LETACTEXP>:<T>] *** let <NAME> represent the result of <LETASSIGNEXP> in this expression: <LETACTEXP>

This page was edited 47 days ago on 02/10/2024. What links here