summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-08-29 15:23:34 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-08-29 15:23:34 +0200
commit9a5e79dfd1c6829b052ab7cf0cb7a79afd25eb72 (patch)
treedfa287746b7a714cd6c1af2c04d7e2fd4d189d08 /instance-calculator/src/VHDLArchitecture.java
parent35e6857fb09b006da9f8cc3f59f239f078cc69a1 (diff)
Should now load the model.
Diffstat (limited to 'instance-calculator/src/VHDLArchitecture.java')
-rw-r--r--instance-calculator/src/VHDLArchitecture.java74
1 files changed, 56 insertions, 18 deletions
diff --git a/instance-calculator/src/VHDLArchitecture.java b/instance-calculator/src/VHDLArchitecture.java
index 7f3be10..0a61a24 100644
--- a/instance-calculator/src/VHDLArchitecture.java
+++ b/instance-calculator/src/VHDLArchitecture.java
@@ -17,29 +17,37 @@ public class VHDLArchitecture
}
}
- public static boolean handle_belongs_to_architecture
- (
- final String unknown_id,
- final String arch_id
- )
+ public static VHDLArchitecture get_from_id (final String id)
{
- /* TODO */
- return false;
+ final VHDLArchitecture result;
+
+ result = FROM_ID.get(id);
+
+ if (result == null)
+ {
+ System.err.println
+ (
+ "[E] Element "
+ + id
+ + " is used like an architecture, but is not declared as such"
+ + " before that use."
+ );
+
+ System.exit(-1);
+ }
+
+ return result;
}
- public static boolean handle_is_architecture_of
- (
- final String arch_id,
- final String e_id
- )
+ public static VHDLArchitecture find (final String id)
{
- /* TODO */
- return false;
+ return FROM_ID.get(id);
}
/******************************************************************************/
- private final List<String> processes;
- private final List<String> components;
+ private final Collection<VHDLProcess> processes;
+ private final Collection<VHDLComponent> components;
+ private final Collection<VHDLWaveform> waveforms;
private final String id;
private VHDLEntity entity;
@@ -48,12 +56,42 @@ public class VHDLArchitecture
{
this.id = id;
- processes = new ArrayList<String>();
- components = new ArrayList<String>();
+ processes = new ArrayList<VHDLProcess>();
+ components = new ArrayList<VHDLComponent>();
+ waveforms = new ArrayList<VHDLWaveform>();
}
public VHDLEntity get_entity ()
{
return entity;
}
+
+ public void set_entity (final VHDLEntity e)
+ {
+ entity = e;
+ }
+
+ public void add_process (final VHDLProcess ps)
+ {
+ if (!processes.contains(ps))
+ {
+ processes.add(ps);
+ }
+ }
+
+ public void add_component (final VHDLComponent cmp)
+ {
+ if (!components.contains(cmp))
+ {
+ components.add(cmp);
+ }
+ }
+
+ public void add_waveform (final VHDLWaveform wfm)
+ {
+ if (!waveforms.contains(wfm))
+ {
+ waveforms.add(wfm);
+ }
+ }
}