Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > Ada Code > Generating Ada code > Modeling Ada code in Modeler > Modeling with, use and use type clauses in Modeler (Ada code)
  
Modeling with, use and use type clauses in Modeler (Ada code)
ACS generates 'with' and 'use' clauses for package dependencies that are modeled through Dependencies in the Model. ACS also generates 'with' and 'use' clauses that are required to implement package dependencies in the generated files. In addition, you can include your own 'with' and 'use' clauses to packages that are not modeled in the Model.
* 
If a Dependency is stereotyped by the «Ada Ignore» stereotype, ACS ignores the Dependency.
To model a with or use clause to a package in the model:
1. If you have not done so already, add the Ada Profile package to the Model. How?
2. Create a Dependency from the Package, Class or Data Type that models the Ada package to the Package, Class or Data Type that models the withed or used Ada package:
Add the Package, Class or Data Type that models the Ada package to a Class Diagram.
Add the Package, Class or Data Type that models the withed or used Ada package to the same Class Diagram.
On the Class Diagram toolbar, click the
Dependency button.
Click the Package, Class or Data Type that models the Ada package, and then click the Package, Class or Data Type that models the withed or used Ada package.
3. Apply the «Ada Context» stereotype to the Dependency.
How?
4. Click the Ada Context tab.
5. If you want to model a with clause in the package specification or body file, set the tagged value of the Ada With tag definition accordingly, either to Specification or Body.
6. If you want to model a use clause in the package specification or body file, set the tagged value of the Ada Use tag definition accordingly, either to Specification or Body.
To model a with or use clause to a package not modeled in the Model:
1. If you have not done so already, add the Ada Profile package to the Model. How?
2. From Modeler, select the Package, Class, Data Type or Operation for which you want to model a dependency to a package not modeled in the Model.
3. Apply the «Ada Context» stereotype to the Package, Class, Data Type or Operation. How?
4. Click the Ada Context tab.
5. If you want to add package dependencies to the generated package specification file:
a. Select the Ada_Declaration_Dependencies entry, and then on the Property Pages click the Properties button.
b. In the text window, type the text you want to include in the package specification file, including the 'with' and 'uses' text.
c. On the Text Format Toolbar, click the Save button, and then close the text window.
6. If you want to add package dependencies to the generated package body file:
a. Select the Ada_Implementation_Dependencies entry, and then on the Property Pages click the Properties button.
b. In the text window, type the text you want to include in the package specification file, including the 'with' and 'uses' text.
c. On the Text Format Toolbar, click the Save button, and then close the text window.
When you generate code for the item, the text you specified will be included in the appropriate file.
To model a use type clause to a package:
1. If you have not done so already, add the Ada Profile package to the Model. How?
2. From Modeler, select the Package, Class, Data Type or Operation for which you want to model a use type dependency.
3. Apply the «Ada Context» stereotype to the Package, Class, Data Type or Operation. How?
4. Click the Ada Context tab.
5. If you want to add use type clauses to the generated package specification file:
a. Select the Ada_Declaration_Dependencies entry, and then on the Property Pages click the Properties button.
b. In the text window, type the text you want to include in the package specification file, including the 'use type' text.
c. On the Text Format Toolbar, click the Save button, and then close the text window.
6. If you want to add use type clauses to the generated package body file:
a. Select the Ada_Implementation_Dependencies entry, and then on the Property Pages click the Properties button.
b. In the text window, type the text you want to include in the package specification file, including the 'use type' text.
c. On the Text Format Toolbar, click the Save button, and then close the text window.
When you generate code for the item, the text you specified will be included in the appropriate file.