Commit 5b6011d3 authored by Mingjun Li's avatar Mingjun Li
Browse files

small bug fixed

refs 662
parent 2ef7a30b
......@@ -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());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment