| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-07-24 13:40:40 +0200 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-07-24 13:40:40 +0200 |
| commit | 66cfd64a7ed0c3809e033b0976c17e95bc6c50ca (patch) | |
| tree | 0c136b72a6084115013643f4a5ebf6af6e758494 /ast-to-instr/src/VHDLNode.java | |
| parent | fb0882b5e3622b762812f4ffe4688c7a344a02cd (diff) | |
Centralizes the processing of (read) expressions.
Diffstat (limited to 'ast-to-instr/src/VHDLNode.java')
| -rw-r--r-- | ast-to-instr/src/VHDLNode.java | 59 |
1 files changed, 37 insertions, 22 deletions
diff --git a/ast-to-instr/src/VHDLNode.java b/ast-to-instr/src/VHDLNode.java index 6c49cdf..970be9a 100644 --- a/ast-to-instr/src/VHDLNode.java +++ b/ast-to-instr/src/VHDLNode.java @@ -1,49 +1,39 @@ import org.w3c.dom.Node; import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathExpression; public abstract class VHDLNode extends ParsableXML { - protected final IDs next_node; - protected final int depth; - protected final String[] attributes; - protected final OutputFile output; + /** Static *****************************************************************/ + private static XPathExpression XPE_FIND_EXPR_NAMED_ENTITIES; - public VHDLNode - ( - final OutputFile output, - final IDs parent_id, - final Node xml_node, - final IDs next_node, - final int depth, - final String[] attributes - ) + static { - super(parent_id, xml_node); - - this.output = output; - this.next_node = next_node; - this.depth = depth; - this.attributes = attributes; + XPE_FIND_EXPR_NAMED_ENTITIES = + XMLManager.compile_or_die + ( + ".//named_entity" + ); } protected void handle_expression ( final IDs local_id, - final Node expression_ref + final Node expression_start ) throws XPathExpressionException { final String ref; - ref = XMLManager.get_attribute(expression_ref, "ref"); + ref = XMLManager.get_attribute(expression_start, "ref"); if (!Main.node_is_function_or_literal(ref)) { Predicates.add_entry ( output, - predicate, + "expr_reads", local_id, Waveforms.get_associated_waveform_id ( @@ -52,4 +42,29 @@ public abstract class VHDLNode extends ParsableXML ); } } + + /** Non-Static *************************************************************/ + protected final IDs next_node; + protected final int depth; + protected final String[] attributes; + protected final OutputFile output; + + public VHDLNode + ( + final OutputFile output, + final IDs parent_id, + final Node xml_node, + final IDs next_node, + final int depth, + final String[] attributes + ) + { + super(parent_id, xml_node); + + this.output = output; + this.next_node = next_node; + this.depth = depth; + this.attributes = attributes; + } + } |


