| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-07-20 17:34:51 +0200 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-07-20 17:34:51 +0200 |
| commit | 72b3069a20b8573ceff73b27936a76213aacc344 (patch) | |
| tree | eeb1842e43be53a372d09b723a51a85bcc098f3d /ast-to-instr/src/VHDLISNode.java | |
| parent | 44d19480a10924eac2191308d8842a4df1657167 (diff) | |
Adds Simple Signal Assignment Statement Node.
Diffstat (limited to 'ast-to-instr/src/VHDLISNode.java')
| -rw-r--r-- | ast-to-instr/src/VHDLISNode.java | 99 |
1 files changed, 85 insertions, 14 deletions
diff --git a/ast-to-instr/src/VHDLISNode.java b/ast-to-instr/src/VHDLISNode.java index 5dedabf..66eb52a 100644 --- a/ast-to-instr/src/VHDLISNode.java +++ b/ast-to-instr/src/VHDLISNode.java @@ -74,11 +74,10 @@ public class VHDLISNode extends VHDLNode /** Predicates **********************************************************/ handle_predicate_has_option(local_id); handle_predicate_expr_reads(local_id); - handle_predicate_is_final(local_id); /** Children ************************************************************/ - result.add(handle_true_branch(local_id)); - result.add(handle_else_branch(local_id)); + result.addAll(handle_true_branch(local_id)); + result.addAll(handle_else_branch(local_id)); return result; } @@ -190,33 +189,105 @@ public class VHDLISNode extends VHDLNode local_id, Waveforms.get_associated_waveform_id ( - IDs.get_id_from_xml_id(ref, null) + IDs.get_id_from_xml_id(ref, (String) null) ) ); } } } - private void handle_predicate_is_final + /***************************************************************************/ + /** Children ***************************************************************/ + /***************************************************************************/ + private Collection<ParsableXML> handle_true_branch ( final IDs local_id ) + throws XPathExpressionException { - /* TODO */ - /* ((next_node == null) && !(has_else)) => is_final */ + final Collection<ParsableXML> result; + final Node true_branch; + + result = new ArrayList<ParsableXML>(); + + true_branch = + (Node) XPE_FIND_TRUE_BRANCH.evaluate + ( + xml_node, + XPathConstants.NODE + ); + + + result.add + ( + new VHDLSSCNode + ( + parent_id, + true_branch, + local_id, + next_node, + (depth + 1), + new String[] {"COND_WAS_TRUE"} + ) + ); + + return result; } - /***************************************************************************/ - /** Children ***************************************************************/ - /***************************************************************************/ - private Collection<ParsableXML> handle_true_branch + private Collection<ParsableXML> handle_else_branch ( final IDs local_id ) + throws XPathExpressionException { - /* TODO */ + final Collection<ParsableXML> result; + final Node else_branch; - return null; - } + result = new ArrayList<ParsableXML>(); + + else_branch = + (Node) XPE_FIND_TRUE_BRANCH.evaluate + ( + xml_node, + XPathConstants.NODE + ); + + if (else_branch == (Node) null) + { + if (next_node == (IDs) null) + { + Predicates.add_entry + ( + "is_final", + local_id + ); + } + else + { + Predicates.add_entry + ( + "node_connect", + local_id, + next_node + ); + } + } + else + { + result.add + ( + new VHDLSSCNode + ( + parent_id, + else_branch, + local_id, + next_node, + (depth + 1), + new String[] {"COND_WAS_FALSE"} + ) + ); + } + return result; + } } |


