Wiki source code of SCL Extensions
Version 5.1 by ssm on 2013/05/03 18:30
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | |||
| 2 | |||
| 3 | {{toc/}} | ||
| 4 | |||
| 5 | There are several extensions implemented to ease the work with a scl model. (de.cau.cs.kieler.scl.extensions) | ||
| 6 | |||
| 7 | = SCL Factory Extensions = | ||
| 8 | |||
| 9 | You need several Factories to handle all aspects of Yakindu (SGraph + SText) and the extended SCChart models. The SCL Factory Extension provides you with shortcuts for all factories. | ||
| 10 | |||
| 11 | |=((( | ||
| 12 | Shortcut | ||
| 13 | )))|=((( | ||
| 14 | Factory | ||
| 15 | )))|=(% colspan="1" %)(% colspan="1" %) | ||
| 16 | ((( | ||
| 17 | Description | ||
| 18 | ))) | ||
| 19 | |((( | ||
| 20 | SGraph() | ||
| 21 | )))|((( | ||
| 22 | SGraphFactory::eINSTANCE | ||
| 23 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 24 | ((( | ||
| 25 | Factory for yakindu statechart models | ||
| 26 | ))) | ||
| 27 | |(% colspan="1" %)(% colspan="1" %) | ||
| 28 | ((( | ||
| 29 | SText() | ||
| 30 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 31 | ((( | ||
| 32 | StextFactory::eINSTANCE | ||
| 33 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 34 | ((( | ||
| 35 | Factory for yakindu expressions | ||
| 36 | ))) | ||
| 37 | |(% colspan="1" %)(% colspan="1" %) | ||
| 38 | ((( | ||
| 39 | SyncGraph() | ||
| 40 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 41 | ((( | ||
| 42 | SyncgraphFactory::eINSTANCE | ||
| 43 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 44 | ((( | ||
| 45 | Factory for sgraph extensions | ||
| 46 | ))) | ||
| 47 | |(% colspan="1" %)(% colspan="1" %) | ||
| 48 | ((( | ||
| 49 | SyncText() | ||
| 50 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 51 | ((( | ||
| 52 | SynctextFactory::eINSTANCE | ||
| 53 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 54 | ((( | ||
| 55 | Factory for stext extensions | ||
| 56 | ))) | ||
| 57 | |(% colspan="1" %)(% colspan="1" %) | ||
| 58 | ((( | ||
| 59 | SCCExp() | ||
| 60 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 61 | ((( | ||
| 62 | SCChartsExpFactory::eINSTANCE | ||
| 63 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 64 | ((( | ||
| 65 | Factory for SCCharts specific expression extensions | ||
| 66 | ))) | ||
| 67 | |(% colspan="1" %)(% colspan="1" %) | ||
| 68 | ((( | ||
| 69 | SCL() | ||
| 70 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 71 | ((( | ||
| 72 | SclFactory::eINSTANCE | ||
| 73 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 74 | ((( | ||
| 75 | Factory for SCL | ||
| 76 | ))) | ||
| 77 | |||
| 78 | = SCL Create Extensions = | ||
| 79 | |||
| 80 | //coming soon...// | ||
| 81 | |||
| 82 | = SCL Naming Extensions = | ||
| 83 | |||
| 84 | //coming soon...// | ||
| 85 | |||
| 86 | = SCL Ordering Extensions = | ||
| 87 | |||
| 88 | The Ordering Extensions provide functions, which can be used in the //xtend sort// context. | ||
| 89 | |||
| 90 | |=((( | ||
| 91 | Method | ||
| 92 | )))|=((( | ||
| 93 | Description | ||
| 94 | ))) | ||
| 95 | |((( | ||
| 96 | def **int** compareSCLRegionStateOrder(SyncState, SyncState)(% style="font-size: small;" %) | ||
| 97 | )))|((( | ||
| 98 | Sorts states according to their type. Initial states come first, final states last. | ||
| 99 | ))) | ||
| 100 | |||
| 101 | = SCL Statement Extensions = | ||
| 102 | |||
| 103 | //coming soon...// | ||
| 104 | |||
| 105 | = SCL Thread Extensions = | ||
| 106 | |||
| 107 | The Thread Extensions provide functions to ease the handling of SCL threads and statements in the context of SCL threads. | ||
| 108 | |||
| 109 | |=((( | ||
| 110 | Method | ||
| 111 | )))|=((( | ||
| 112 | Description | ||
| 113 | ))) | ||
| 114 | |((( | ||
| 115 | def AbstractThread getThread(Instruction) | ||
| 116 | |||
| 117 | def AbstractThread getThread(Statement)(% style="font-size: small;" %) | ||
| 118 | )))|((( | ||
| 119 | Returns the SCL thread of a SCL statement or SCL instruction. | ||
| 120 | ))) | ||
| 121 | |(% colspan="1" %)(% colspan="1" %) | ||
| 122 | ((( | ||
| 123 | def AbstractThread getMainThread(Instruction) | ||
| 124 | |||
| 125 | def AbstractThread getMainThread(Statement)(% style="font-size: small;" %) | ||
| 126 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 127 | ((( | ||
| 128 | Returns the main thread of a SCL program. | ||
| 129 | ))) | ||
| 130 | |(% colspan="1" %)(% colspan="1" %) | ||
| 131 | ((( | ||
| 132 | def **boolean** isInSameThreadAs(Instruction, Instruction) | ||
| 133 | |||
| 134 | def **boolean** isInSameThreadAs(Statement, Statement) | ||
| 135 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 136 | ((( | ||
| 137 | Returns true, if both instructions/statements are in the same thread. | ||
| 138 | ))) | ||
| 139 | |(% colspan="1" %)(% colspan="1" %) | ||
| 140 | ((( | ||
| 141 | def **boolean** isInMainThread(Instruction) | ||
| 142 | |||
| 143 | def **boolean** isInMainThread(Statement) | ||
| 144 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 145 | ((( | ||
| 146 | Returns true, if the instruction/statement runs in the main thread. | ||
| 147 | ))) | ||
| 148 | |(% colspan="1" %)(% colspan="1" %) | ||
| 149 | ((( | ||
| 150 | def **boolean** isInThread(Instruction, AbstractThread) | ||
| 151 | |||
| 152 | def **boolean** isInThread(Statement, AbstractThread) | ||
| 153 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 154 | ((( | ||
| 155 | Returns true, if the instruction/statement runs in the given thread. | ||
| 156 | ))) | ||
| 157 | |(% colspan="1" %)(% colspan="1" %) | ||
| 158 | ((( | ||
| 159 | def **boolean** contains(AbstractThread, Instruction) | ||
| 160 | |||
| 161 | def **boolean** contains(AbstractThread, Statements) | ||
| 162 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 163 | ((( | ||
| 164 | Returns true, if the thread contains the given instruction/statement. | ||
| 165 | ))) | ||
| 166 | |(% colspan="1" %)(% colspan="1" %) | ||
| 167 | ((( | ||
| 168 | def dropPrevious(AbstractThread, Statement) | ||
| 169 | |||
| 170 | def dropPrevious(List<Statement>, Statement)(% style="font-size: small;" %) | ||
| 171 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 172 | ((( | ||
| 173 | Drops all preceeding statements in a thread or a list of statements before the given statement. | ||
| 174 | ))) | ||
| 175 | |||
| 176 | = SCL Goto Extensions = | ||
| 177 | |||
| 178 | To help with the handling of the goto statement and its target instruction, use the SCL Goto Extensions. | ||
| 179 | |||
| 180 | |=((( | ||
| 181 | Method | ||
| 182 | )))|=((( | ||
| 183 | Description | ||
| 184 | ))) | ||
| 185 | |((( | ||
| 186 | def Statement getTargetStatement(Goto) | ||
| 187 | |||
| 188 | def Statement getTargetStatement(Goto, AbstractThread) | ||
| 189 | )))|((( | ||
| 190 | Returns the target statement of a goto instruction (in the context of the (given) thread). | ||
| 191 | ))) | ||
| 192 | |(% colspan="1" %)(% colspan="1" %) | ||
| 193 | ((( | ||
| 194 | def boolean targetExists(Goto) | ||
| 195 | |||
| 196 | def boolean targetExists(Goto, AbstractThread) | ||
| 197 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 198 | ((( | ||
| 199 | Returns true, if the target of a goto instruction exists (in the context of the (given) thread). | ||
| 200 | ))) | ||
| 201 | |(% colspan="1" %)(% colspan="1" %) | ||
| 202 | ((( | ||
| 203 | def InstructionStatement getInstructionStatement(Statement)(% style="font-size: small;" %) | ||
| 204 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 205 | ((( | ||
| 206 | Returns the first valid InstructionStatement in a thread after the given statement. **May return null, if no further InstructionStatement exists.** | ||
| 207 | |||
| 208 | 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. | ||
| 209 | ))) | ||
| 210 | |(% colspan="1" %)(% colspan="1" %) | ||
| 211 | ((( | ||
| 212 | def getIncomingGotos(Statement) | ||
| 213 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 214 | ((( | ||
| 215 | 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". | ||
| 216 | ))) | ||
| 217 | |||
| 218 | = SCL Expression Extensions = | ||
| 219 | |||
| 220 | //coming soon...// | ||
| 221 | |||
| 222 | = SCL Dependency Extensions = | ||
| 223 | |||
| 224 | //coming soon...// | ||
| 225 | |||
| 226 | = SCL Basic Block Extensions = | ||
| 227 | |||
| 228 | //coming soon...// |