summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-07-21 11:06:12 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-07-21 11:06:12 +0200
commit878705688b42837b615067f0a479f31614910f38 (patch)
treed0d61b2f4f66baa638876f2d5641a6377979cdd1 /ast-to-instr/src/VHDLWNode.java
parentbee770032c7bf22eb897085f516f440a72dc3a9a (diff)
Optimization pass.
Diffstat (limited to 'ast-to-instr/src/VHDLWNode.java')
-rw-r--r--ast-to-instr/src/VHDLWNode.java42
1 files changed, 20 insertions, 22 deletions
diff --git a/ast-to-instr/src/VHDLWNode.java b/ast-to-instr/src/VHDLWNode.java
index 4c2b2ee..b32d2a4 100644
--- a/ast-to-instr/src/VHDLWNode.java
+++ b/ast-to-instr/src/VHDLWNode.java
@@ -5,8 +5,7 @@ import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
-import java.util.ArrayList;
-import java.util.Collection;
+import java.util.Stack;
/* When Node */
public class VHDLWNode extends VHDLNode
@@ -49,15 +48,15 @@ public class VHDLWNode extends VHDLNode
}
@Override
- public Collection<ParsableXML> parse ()
+ public void parse
+ (
+ final Stack<ParsableXML> waiting_list
+ )
throws XPathExpressionException
{
- final Collection<ParsableXML> result;
final String xml_id;
final IDs local_id;
- result = new ArrayList<ParsableXML>();
-
xml_id = XMLManager.get_attribute(xml_node, "id");
local_id = IDs.get_id_from_xml_id(xml_id, "node");
@@ -73,9 +72,7 @@ public class VHDLWNode extends VHDLNode
handle_predicate_expr_reads(local_id);
/** Children ************************************************************/
- result.add(handle_body(local_id));
-
- return result;
+ handle_body(local_id, waiting_list);
}
/***************************************************************************/
@@ -193,9 +190,10 @@ public class VHDLWNode extends VHDLNode
/** Children ***************************************************************/
/***************************************************************************/
- private ParsableXML handle_body
+ private void handle_body
(
- final IDs local_id
+ final IDs local_id,
+ final Stack<ParsableXML> waiting_list
)
throws XPathExpressionException
{
@@ -208,17 +206,17 @@ public class VHDLWNode extends VHDLNode
XPathConstants.NODE
);
- return
+ waiting_list.push
+ (
+ new VHDLSSCNode
(
- new VHDLSSCNode
- (
- parent_id,
- body,
- local_id,
- next_node,
- (depth + 1),
- new String[] {"COND_WAS_TRUE"}
- )
- );
+ parent_id,
+ body,
+ local_id,
+ next_node,
+ (depth + 1),
+ new String[] {"COND_WAS_TRUE"}
+ )
+ );
}
}