Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
AF3
Commits
5b6011d3
Commit
5b6011d3
authored
May 21, 2012
by
Mingjun Li
Browse files
small bug fixed
refs 662
parent
2ef7a30b
Changes
1
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.generator.common/trunk/src/org/fortiss/af3/generator/common/model/vhdl/VHDLPackage.java
View file @
5b6011d3
...
...
@@ -25,21 +25,25 @@ import org.fortiss.af3.generator.common.model.source.DefinitionBase;
/**
* Generates the VHDL package declaration and definition statement. Packages are
* made up of two parts, the Declarative part and the body part. In the
* declarative part are functions and component declarations(NOTICE: A package
* can contain other things like: type, subtype, constants and procedure, but
* declarative part are VHDL enumeration types, functions and component declarations(NOTICE: A
* package
* can contain other things like: sub-types, constants and procedure, but
* they are not implemented yet). The body of package is the place where
* function implementations are located.
*
* @author li
* @author $Author$
* @version $Rev$
* @ConQAT.Rating
GREEN
Hash:
CA5C1D93F33E90C66B39EEE508F00CA6
* @ConQAT.Rating
YELLOW
Hash:
39F4C416A5B5FDAABE4373035E1D83F3
*/
public
class
VHDLPackage
{
/** Package name. */
private
final
String
name
;
/** List of user defined VHDL enumeration types. */
private
final
List
<
VHDLEnumType
>
enumTypes
;
/** List of functions. */
private
final
List
<
VHDLFunction
>
functions
;
...
...
@@ -47,8 +51,10 @@ public class VHDLPackage {
private
final
List
<
VHDLComponent
>
comps
;
/** Constructor. */
public
VHDLPackage
(
String
name
,
List
<
VHDLFunction
>
functions
,
List
<
VHDLComponent
>
comps
)
{
public
VHDLPackage
(
String
name
,
List
<
VHDLEnumType
>
enumTypes
,
List
<
VHDLFunction
>
functions
,
List
<
VHDLComponent
>
comps
)
{
this
.
name
=
name
;
this
.
enumTypes
=
enumTypes
;
this
.
comps
=
comps
;
this
.
functions
=
functions
;
}
...
...
@@ -60,7 +66,13 @@ public class VHDLPackage {
public
String
toString
()
{
StringBuffer
buffer
=
new
StringBuffer
();
buffer
.
append
(
"\npackage "
+
name
+
" is\n"
);
buffer
.
append
(
"\t-- Components declarations.\n"
);
buffer
.
append
(
"\t-- User defined enumeration types declarations.\n"
);
if
(
enumTypes
!=
null
)
{
for
(
VHDLEnumType
enumType
:
enumTypes
)
{
buffer
.
append
(
"\t"
+
enumType
.
getDefinition
().
toString
()
+
"\n"
);
}
}
buffer
.
append
(
"\n\t-- Components declarations.\n"
);
if
(
comps
!=
null
)
{
for
(
VHDLComponent
comp
:
comps
)
{
buffer
.
append
(
comp
.
getDeclaration
().
toString
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment