Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors
newChildDescriptors.add(createChildParameter(AadlBaPackage.Literals.FOR_OR_FOR_ALL_STATEMENT__ITERATED_VALUES,
AadlBaFactory.eINSTANCE.createIntegerRange()));

newChildDescriptors.add(createChildParameter(AadlBaPackage.Literals.FOR_OR_FOR_ALL_STATEMENT__ITERATED_VALUES,
AadlBaFactory.eINSTANCE.createIterativeVariableHolder()));

newChildDescriptors.add(createChildParameter(AadlBaPackage.Literals.FOR_OR_FOR_ALL_STATEMENT__ITERATED_VALUES,
AadlBaFactory.eINSTANCE.createParameterHolder()));

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
error | semantic | 45 | 49 | 1 | '5' cannot be iterated: a for or forall iterates an integer range, an event data port, a parameter, or an array data component reference
error | semantic | 48 | 49 | 7 | 'reading' cannot be iterated: a for or forall iterates an integer range, an event data port, a parameter, or an array data component reference
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
annex[0] owner=Issue3226::worker.i
(AssignmentAction, <null>, 2971, 21)
(BehaviorActionBlock, <null>, 2844, 202)
(BehaviorAnnex, behavior_specification, 2629, 418)
(BehaviorState, done, 2766, 4)
(BehaviorState, start, 2731, 5)
(BehaviorStateGroup, <null>, 2731, 22)
(BehaviorStateGroup, <null>, 2766, 28)
(BehaviorTransition, <null>, 2827, 220)
(BehaviorVariable, m, 2692, 1)
(BehaviorVariable, total, 2651, 5)
(BehaviorVariableGroup, <null>, 2651, 28)
(BehaviorVariableGroup, <null>, 2692, 11)
(BinaryExpression, <null>, 2980, 12)
(ElementValues, <null>, 2880, 1)
(ElementValues, <null>, 2940, 3)
(ForStatement, <null>, 2862, 170)
(ForStatement, <null>, 2905, 109)
(Reference, <null>, 2880, 1)
(Reference, <null>, 2940, 3)
(Reference, <null>, 2971, 5)
(Reference, <null>, 2980, 4)
(Reference, <null>, 2987, 5)
(ReferenceExpression, <null>, 2880, 1)
(ReferenceExpression, <null>, 2940, 3)
(ReferenceExpression, <null>, 2980, 4)
(ReferenceExpression, <null>, 2987, 5)
(ReferenceSegment, cell, 2980, 4)
(ReferenceSegment, m, 2880, 1)
(ReferenceSegment, row, 2940, 3)
(ReferenceSegment, total, 2971, 5)
(ReferenceSegment, total, 2987, 5)
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
annex[0] owner=NonIterableValues::worker.i
(AssignmentAction, <null>, 2662, 10)
(AssignmentAction, <null>, 2771, 10)
(BehaviorActionBlock, <null>, 2587, 226)
(BehaviorActionSequence, <null>, 2605, 194)
(BehaviorAnnex, behavior_specification, 2396, 418)
(BehaviorIntegerLiteral, <null>, 2637, 1)
(BehaviorState, done, 2509, 4)
(BehaviorState, start, 2474, 5)
(BehaviorStateGroup, <null>, 2474, 22)
(BehaviorStateGroup, <null>, 2509, 28)
(BehaviorTransition, <null>, 2570, 244)
(BehaviorVariable, total, 2418, 5)
(BehaviorVariableGroup, <null>, 2418, 28)
(ElementValues, <null>, 2637, 1)
(ElementValues, <null>, 2740, 7)
(ForStatement, <null>, 2605, 85)
(ForStatement, <null>, 2708, 91)
(Reference, <null>, 2662, 5)
(Reference, <null>, 2671, 1)
(Reference, <null>, 2740, 7)
(Reference, <null>, 2771, 5)
(Reference, <null>, 2780, 1)
(ReferenceExpression, <null>, 2671, 1)
(ReferenceExpression, <null>, 2740, 7)
(ReferenceExpression, <null>, 2780, 1)
(ReferenceSegment, i, 2671, 1)
(ReferenceSegment, j, 2780, 1)
(ReferenceSegment, reading, 2740, 7)
(ReferenceSegment, total, 2662, 5)
(ReferenceSegment, total, 2771, 5)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
annex[0] owner=Issue3226::worker.i
parsedAnnexSubclause : BehaviorAnnex name=behavior_specification
variables[0] : BehaviorVariable name=total
variables[1] : BehaviorVariable name=m
states[0] : BehaviorState name=start
states[1] : BehaviorState name=done
transitions[0] : BehaviorTransition
actions[0] : BehaviorActionBlock
content : ForOrForAllStatement
behaviorActions : ForOrForAllStatement
behaviorActions : AssignmentAction
target : BehaviorVariableHolder element=total [BehaviorVariable]
valueExpression : ValueExpression
relations[0] : Relation
firstExpression : SimpleExpression
terms[0] : Term
factors[0] : Factor
firstValue : IterativeVariableHolder element=cell [IterativeVariable]
terms[1] : Term
factors[0] : Factor
firstValue : BehaviorVariableHolder element=total [BehaviorVariable]
iteratedValues : IterativeVariableHolder element=row [IterativeVariable]
iterativeVariable : IterativeVariable name=cell
iteratedValues : BehaviorVariableHolder element=m [BehaviorVariable]
iterativeVariable : IterativeVariable name=row
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
annex[0] owner=NonIterableValues::worker.i
parsedAnnexSubclause : BehaviorAnnex name=behavior_specification
variables[0] : BehaviorVariable name=total
states[0] : BehaviorState name=start
states[1] : BehaviorState name=done
transitions[0] : BehaviorTransition
actions[0] : BehaviorActionBlock
content : BehaviorActionSequence
actions[0] : ForOrForAllStatement
behaviorActions : AssignmentAction
target : BehaviorVariableHolder element=total [BehaviorVariable]
valueExpression : ValueExpression
relations[0] : Relation
firstExpression : SimpleExpression
terms[0] : Term
factors[0] : Factor
firstValue : IterativeVariableHolder element=i [IterativeVariable]
iterativeVariable : IterativeVariable name=i
actions[1] : ForOrForAllStatement
behaviorActions : AssignmentAction
target : BehaviorVariableHolder element=total [BehaviorVariable]
valueExpression : ValueExpression
relations[0] : Relation
firstExpression : SimpleExpression
terms[0] : Term
factors[0] : Factor
firstValue : IterativeVariableHolder element=j [IterativeVariable]
iterativeVariable : IterativeVariable name=j
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
===== annex[0] owner=Issue3226::worker.i =====

variables
total : Base_Types::Integer;
m : Matrix;
states
start : initial state;
done : complete final state;
transitions
start -[]-> done {
for (row : Row in m) {
for (cell : Base_Types::Integer in row) {
total := cell + total
}
}
};
\s\s\s\s
----- Xtext reparse -----
reparsed
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
===== annex[0] owner=NonIterableValues::worker.i =====

variables
total : Base_Types::Integer;
states
start : initial state;
done : complete final state;
transitions
start -[]-> done {
for (i : Base_Types::Integer in 5) {
total := i
};
for (j : Base_Types::Integer in reading) {
total := j
}
};
\s\s\s\s
----- Xtext reparse -----
reparsed
2 changes: 2 additions & 0 deletions ba/org.osate.ba.tests/models/issue3226/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.aadlbin-gen/
/instances/
18 changes: 18 additions & 0 deletions ba/org.osate.ba.tests/models/issue3226/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>issue3226</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.osate.core.aadlnature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
</projectDescription>
65 changes: 65 additions & 0 deletions ba/org.osate.ba.tests/models/issue3226/Issue3226.aadl
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
-- Copyright (c) 2004-2026 Carnegie Mellon University and others. (see Contributors file).
-- All Rights Reserved.
--
-- NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY
-- KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE
-- OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT
-- MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT.
--
-- This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0
-- which is available at https://www.eclipse.org/legal/epl-2.0/
-- SPDX-License-Identifier: EPL-2.0
--
-- Created, in part, with funding and support from the United States Government. (see Acknowledgments file).
--
-- This program includes and/or can make use of certain third party source code, object code, documentation and other
-- files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system
-- configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and
-- conditions contained in any such Third Party Software or separate license file distributed with such Third Party
-- Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party benefici-
-- aries to this license with respect to the terms applicable to their Third Party Software. Third Party Software li-
-- censes only apply to the Third Party Software and not any other portion of this program or this program as a whole.

package Issue3226
public
with Base_Types, Data_Model;

data Row
properties
Data_Model::Data_Representation => Array;
Data_Model::Base_Type => (classifier (Base_Types::Integer));
Data_Model::Dimension => (3);
end Row;

data Matrix
properties
Data_Model::Data_Representation => Array;
Data_Model::Base_Type => (classifier (Row));
Data_Model::Dimension => (2);
end Matrix;

thread worker
end worker;

-- D.6 gives the iterator of a for or forall the name scope of the construct, where it acts as a local variable, so
-- the iterated values of a nested loop can name the iterator of an enclosing one. The inner iterator then takes the
-- element type of the outer one, and 'total := cell + total' adds two integers.
thread implementation worker.i
annex behavior_specification {**
variables
total : Base_Types::Integer;
m : Matrix;
states
start : initial state;
done : complete final state;
transitions
start -[]-> done {
for (row : Row in m) {
for (cell : Base_Types::Integer in row) {
total := cell + total
}
}
};
**};
end worker.i;
end Issue3226;
54 changes: 54 additions & 0 deletions ba/org.osate.ba.tests/models/issue3226/NonIterableValues.aadl
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
-- Copyright (c) 2004-2026 Carnegie Mellon University and others. (see Contributors file).
-- All Rights Reserved.
--
-- NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY
-- KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE
-- OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT
-- MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT.
--
-- This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0
-- which is available at https://www.eclipse.org/legal/epl-2.0/
-- SPDX-License-Identifier: EPL-2.0
--
-- Created, in part, with funding and support from the United States Government. (see Acknowledgments file).
--
-- This program includes and/or can make use of certain third party source code, object code, documentation and other
-- files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system
-- configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and
-- conditions contained in any such Third Party Software or separate license file distributed with such Third Party
-- Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party benefici-
-- aries to this license with respect to the terms applicable to their Third Party Software. Third Party Software li-
-- censes only apply to the Third Party Software and not any other portion of this program or this program as a whole.

package NonIterableValues
public
with Base_Types;

thread worker
features
reading : in data port Base_Types::Integer;
end worker;

-- D.6 admits an integer range, an event data port, or an array data component reference as the iterated values of a
-- for or forall. The shared D.7 integer value grammar also accepts an integer literal, and a data port is not one of
-- the names a data component reference can start with, so the strict model has no iterated values to carry either
-- one. Both must be reported rather than translated.
thread implementation worker.i
annex behavior_specification {**
variables
total : Base_Types::Integer;
states
start : initial state;
done : complete final state;
transitions
start -[]-> done {
for (i : Base_Types::Integer in 5) {
total := i
};
for (j : Base_Types::Integer in reading) {
total := j
}
};
**};
end worker.i;
end NonIterableValues;
Loading
Loading