| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-07-21 16:50:25 +0200 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-07-21 16:50:25 +0200 |
| commit | d05bd3592050a9496dd87bcd8a49f8fdc8b6b58d (patch) | |
| tree | 13ce81449e21c48621ae0ef4dd0f451b72f1c37a /ast-to-instr/src/VHDLArchitecture.java | |
| parent | 0aa91fb542bd4e2bec97de98ab819ddd6ccbb698 (diff) | |
Adds output support.
Diffstat (limited to 'ast-to-instr/src/VHDLArchitecture.java')
| -rw-r--r-- | ast-to-instr/src/VHDLArchitecture.java | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/ast-to-instr/src/VHDLArchitecture.java b/ast-to-instr/src/VHDLArchitecture.java index c6014a8..9d559de 100644 --- a/ast-to-instr/src/VHDLArchitecture.java +++ b/ast-to-instr/src/VHDLArchitecture.java @@ -9,12 +9,19 @@ import java.util.Stack; public class VHDLArchitecture extends ParsableXML { + private static final XPathExpression XPE_FIND_ENTITY_NAME; private static final XPathExpression XPE_FIND_SIGNALS; private static final XPathExpression XPE_FIND_PROCESSES; private static final XPathExpression XPE_FIND_COMPONENTS; static { + XPE_FIND_ENTITY_NAME = + XMLManager.compile_or_die + ( + "./entity_name/named_entity" + ); + XPE_FIND_SIGNALS = XMLManager.compile_or_die ( @@ -94,8 +101,41 @@ public class VHDLArchitecture extends ParsableXML ( final IDs local_id ) + throws XPathExpressionException { - /* TODO */ + final Node entity_name; + + entity_name = + (Node) XPE_FIND_ENTITY_NAME.evaluate + ( + xml_node, + XPathConstants.NODE + ); + + if (entity_name == (Node) null) + { + System.err.println + ( + "[W] Could not find entity the associated with architecture " + + local_id + + " (XML ID: " + + XMLManager.get_attribute(xml_node, "id") + + ")." + ); + + return; + } + + Predicates.add_entry + ( + "is_architecture_of", + local_id, + IDs.get_id_from_xml_id + ( + XMLManager.get_attribute(entity_name, "ref"), + "entity" + ) + ); } |


