Changes for page SCL Extensions
Last modified by Richard Kreissig on 2023/09/14 11:13
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,5 +1,7 @@ 1 + 1 1 2 2 4 + 3 3 {{toc/}} 4 4 5 5 There are several extensions implemented to ease the work with a scl model. (de.cau.cs.kieler.scl.extensions) ... ... @@ -81,8 +81,26 @@ 81 81 82 82 = SCL Naming Extensions = 83 83 84 - //coming soon...//86 +SCL Naming Extensions provide helper functions for ID & naming services. 85 85 88 +|=((( 89 +Method 90 +)))|=((( 91 +Description 92 +))) 93 +|((( 94 +def void distributeStateIDs(Statechart) 95 +)))|((( 96 +Since yakindu does not make use of the ID field, one can use this method to make every ID in a statechart unique. 97 +))) 98 +|(% colspan="1" %)(% colspan="1" %) 99 +((( 100 +def String getHierarchicalName(SyncState, String) 101 +)))|(% colspan="1" %)(% colspan="1" %) 102 +((( 103 +Generates a (most likely unique) name for a state. The name is generated from all parent states and regions, which are separated by an underscore. If a region or state has no name, the element's hash code is used instead. 104 +))) 105 + 86 86 = SCL Ordering Extensions = 87 87 88 88 The Ordering Extensions provide functions, which can be used in the //xtend sort// context. ... ... @@ -116,7 +116,7 @@ 116 116 117 117 def AbstractThread getThread(Statement)(% style="font-size: small;" %) 118 118 )))|((( 119 -Returns the SCL thread of a SCL statement or SCL instruction 139 +Returns the SCL thread of a SCL statement or SCL instruction. 120 120 ))) 121 121 |(% colspan="1" %)(% colspan="1" %) 122 122 ((( ... ... @@ -125,7 +125,7 @@ 125 125 def AbstractThread getMainThread(Statement)(% style="font-size: small;" %) 126 126 )))|(% colspan="1" %)(% colspan="1" %) 127 127 ((( 128 -Returns the main thread of a SCL program 148 +Returns the main thread of a SCL program. 129 129 ))) 130 130 |(% colspan="1" %)(% colspan="1" %) 131 131 ((( ... ... @@ -134,7 +134,7 @@ 134 134 def **boolean** isInSameThreadAs(Statement, Statement) 135 135 )))|(% colspan="1" %)(% colspan="1" %) 136 136 ((( 137 -Returns true, if both instructions/statements are in the same thread 157 +Returns true, if both instructions/statements are in the same thread. 138 138 ))) 139 139 |(% colspan="1" %)(% colspan="1" %) 140 140 ((( ... ... @@ -143,44 +143,107 @@ 143 143 def **boolean** isInMainThread(Statement) 144 144 )))|(% colspan="1" %)(% colspan="1" %) 145 145 ((( 146 -Returns true, if the instruction/statement runs in the main thread 166 +Returns true, if the instruction/statement runs in the main thread. 147 147 ))) 148 148 |(% colspan="1" %)(% colspan="1" %) 149 149 ((( 150 -def **boolean** isInThread(Instruction, Thread) 170 +def **boolean** isInThread(Instruction, AbstractThread) 151 151 152 -def **boolean** isInThread(Statement, Thread) 172 +def **boolean** isInThread(Statement, AbstractThread) 153 153 )))|(% colspan="1" %)(% colspan="1" %) 154 154 ((( 155 -Returns true, if the instruction/statement runs in the given thread 175 +Returns true, if the instruction/statement runs in the given thread. 156 156 ))) 157 157 |(% colspan="1" %)(% colspan="1" %) 158 158 ((( 159 -def **boolean** contains(Thread, Instruction) 179 +def **boolean** contains(AbstractThread, Instruction) 160 160 161 -def **boolean** contains(Thread, Statements) 181 +def **boolean** contains(AbstractThread, Statements) 162 162 )))|(% colspan="1" %)(% colspan="1" %) 163 163 ((( 164 -Returns true, if the thread contains the given instruction/statement 184 +Returns true, if the thread contains the given instruction/statement. 165 165 ))) 166 166 |(% colspan="1" %)(% colspan="1" %) 167 167 ((( 168 -def dropPrevious(Thread, Statement) 188 +def dropPrevious(AbstractThread, Statement) 169 169 170 170 def dropPrevious(List<Statement>, Statement)(% style="font-size: small;" %) 171 171 )))|(% colspan="1" %)(% colspan="1" %) 172 172 ((( 173 -Drops all preceeding statements in a thread or a list of statements until the given statementis reached193 +Drops all preceeding statements in a thread or a list of statements before the given statement. 174 174 ))) 175 175 176 176 = SCL Goto Extensions = 177 177 178 - //coming soon...//198 +To help with the handling of the goto statement and its target instruction, use the SCL Goto Extensions. 179 179 200 +|=((( 201 +Method 202 +)))|=((( 203 +Description 204 +))) 205 +|((( 206 +def Statement getTargetStatement(Goto) 207 + 208 +def Statement getTargetStatement(Goto, AbstractThread) 209 +)))|((( 210 +Returns the target statement of a goto instruction (in the context of the (given) thread). 211 +))) 212 +|(% colspan="1" %)(% colspan="1" %) 213 +((( 214 +def boolean targetExists(Goto) 215 + 216 +def boolean targetExists(Goto, AbstractThread) 217 +)))|(% colspan="1" %)(% colspan="1" %) 218 +((( 219 +Returns true, if the target of a goto instruction exists (in the context of the (given) thread). 220 +))) 221 +|(% colspan="1" %)(% colspan="1" %) 222 +((( 223 +def InstructionStatement getInstructionStatement(Statement)(% style="font-size: small;" %) 224 +)))|(% colspan="1" %)(% colspan="1" %) 225 +((( 226 +Returns the first valid InstructionStatement in a thread after the given statement. **May return null, if no further InstructionStatement exists.** 227 + 228 +To get a valid instruction form a goto jump, one can write "goto.getTargetStatement?.getInstructionStatement?.instruction". The result value will be the instruction or null. 229 +))) 230 +|(% colspan="1" %)(% colspan="1" %) 231 +((( 232 +def getIncomingGotos(Statement) 233 +)))|(% colspan="1" %)(% colspan="1" %) 234 +((( 235 +Returns a list of all gotos that target the given statement. If you want to retrieve the count of incoming goto jumps, use "getIncomingGotos.size". 236 +))) 237 + 180 180 = SCL Expression Extensions = 181 181 182 - //comingsoon...//240 +The SCL Expression Extension holds methods to help with the manipulation and constructions of the SText (and extended) expressions. 183 183 242 +|=((( 243 +Method 244 +)))|=((( 245 +Description 246 +))) 247 +|((( 248 +def Expression toExpression(RegularEventSpec) 249 +)))|((( 250 +Transforms a SGraph RegularEventSpec to a SText Expression. The resulting expression will be an ElementReferenceExpression. 251 +))) 252 +|(% colspan="1" %)(% colspan="1" %) 253 +((( 254 +def Expression negate(Expression) 255 +)))|(% colspan="1" %)(% colspan="1" %) 256 +((( 257 +Negates the given expression. If the Expression is an ElementReferenceExpression the result will be a LogicalNotExpression containing the expression. Otherwise the result will be a LogicalNotExpression containing a ParenthesizedExpression, which then holds the original expression. 258 +))) 259 +|(% colspan="1" %)(% colspan="1" %) 260 +((( 261 +def String correctSerialization(String) 262 +)))|(% colspan="1" %)(% colspan="1" %) 263 +((( 264 +Since the actual implementation of the SText parser may parse artefacts (like linebreaks) until matching a preceding delimeter, correctSerialization removes these artifacts, when serializing an expression. 265 +))) 266 + 184 184 = SCL Dependency Extensions = 185 185 186 186 //coming soon...//
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 - 67502301 +7110868 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/ 6750230/SCL Extensions1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/7110868/SCL Extensions