| |
76 Angenommene Spezifikation UML Ocl 2,0 (VariableDeclarationCS[1]->notEmpty() und VariableDeclarationCS[1].ast.type.oclIsUndefined()) dann OclExpressionCS[1].type.oclAsType (CollectionType).elementType sonst VariableDeclarationCS[1].ast.type endif IterateExpCS.ast.iterator.initExpression->isEmpty() -- zunächst die Namensattribut- und Körper- und Resultatsverbindung des IterateExp IterateExpCS.ast.result = VariableDeclarationCS[2].ast IterateExpCS.ast.name = ' wiederholen ' IterateExpCS.ast.body = OclExpressionCS[2].ast Übernommene Attribute OclExpressionCS[1].env = IteratorExpCS.env VariableDeclarationCS[1].env = IteratorExpCS.env VariableDeclarationCS[2].env = IteratorExpCS.env -- Innere ein wiederholenausdruck der Körper wird mit einem neuen Klima ausgewertet, das umfaßt -- das iterator variabel und die Resultatsvariable. OclExpressionCS[2].env = IteratorExpCS.env.nestedEnvironment().addElement (VariableDeclarationCS[1].ast.varName, VariableDeclarationCS[1].ast, true).addElement (VariableDeclarationCS[2].ast.varName, VariableDeclarationCS[2].ast, richten Sie) aus Disambiguierende Richtlinien [ 1 ] Eine variable Erklärung des Resultats muß eine Art und einen Ausgangswert haben nicht VariableDeclarationCS[2].ast.type.oclIsUndefined() VariableDeclarationCS[2].ast.initExpression->notEmpty() [ 2 ] Wenn die erste variable Erklärung anwesend ist, kann sie möglicherweise nicht einen initausdruck haben. VariableDeclarationCS[1]->notEmpty() deutet an VariableDeclarationCS[1].ast.initExpression->isEmpty() VariableDeclarationCS In der variablen Erklärung, sind die Art und der initausdruck wahlweise freigestellt. Wenn diese angefordert werden, wird dieses in definiert Produktionsrichtlinie, in der die variable Erklärung verwendet wird. VariableDeclarationCS::= simpleNameCS (': ' typeCS)? (' = ' OclExpressionCS)? Abstract syntax Diagramm VariableDeclarationCS.ast: VariableDeclaration Synthetisierte Attribute VariableDeclarationCS.ast.name = simpleNameCS.ast VariableDeclarationCS.ast.initExpression = O clExpressionCS.ast -- ein wohlgeformtes VariableDeclaration muß eine Art entsprechend der abstract syntax haben. -- der Wert OclUndefined wird verwendet, wenn keine Art in der konkreten Syntax gegeben worden ist. -- Produktionsrichtlinien, die diese Notwendigkeit verwenden, auf diese Art zu überprüfen. |  |
|
| |
|
|