| summaryrefslogtreecommitdiff | 
path: root/ast-to-instr
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-07-24 10:46:47 +0200 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-07-24 10:46:47 +0200 | 
| commit | fb0882b5e3622b762812f4ffe4688c7a344a02cd (patch) | |
| tree | 4f7f549cc620546a6ca6d3aa6f3378f1f03d56b3 /ast-to-instr | |
| parent | 15a8692f5384c0b6247a51cddec230f00ad5bbfc (diff) | |
Working on function calls and literals predicates.
Diffstat (limited to 'ast-to-instr')
| -rw-r--r-- | ast-to-instr/src/VHDLNode.java | 27 | ||||
| -rw-r--r-- | ast-to-instr/src/VHDLSSASNode.java | 18 | 
2 files changed, 28 insertions, 17 deletions
| diff --git a/ast-to-instr/src/VHDLNode.java b/ast-to-instr/src/VHDLNode.java index cb3fb4d..6c49cdf 100644 --- a/ast-to-instr/src/VHDLNode.java +++ b/ast-to-instr/src/VHDLNode.java @@ -1,5 +1,7 @@  import org.w3c.dom.Node; +import javax.xml.xpath.XPathExpressionException; +  public abstract class VHDLNode extends ParsableXML  {     protected final IDs next_node; @@ -25,4 +27,29 @@ public abstract class VHDLNode extends ParsableXML        this.attributes = attributes;     } +   protected void handle_expression +   ( +      final IDs local_id, +      final Node expression_ref +   ) +   throws XPathExpressionException +   { +      final String ref; + +      ref = XMLManager.get_attribute(expression_ref, "ref"); + +      if (!Main.node_is_function_or_literal(ref)) +      { +         Predicates.add_entry +         ( +            output, +            predicate, +            local_id, +            Waveforms.get_associated_waveform_id +            ( +               IDs.get_id_from_xml_id(ref, (String) null) +            ) +         ); +      } +   }  } diff --git a/ast-to-instr/src/VHDLSSASNode.java b/ast-to-instr/src/VHDLSSASNode.java index 76d56af..c67c3f2 100644 --- a/ast-to-instr/src/VHDLSSASNode.java +++ b/ast-to-instr/src/VHDLSSASNode.java @@ -178,23 +178,7 @@ public class VHDLSSASNode extends VHDLNode        for (int i = 0; i < sources_count; ++i)        { -         final String ref; - -         ref = XMLManager.get_attribute(sources.item(0), "ref"); - -         if (!Main.node_is_function_or_literal(ref)) -         { -            Predicates.add_entry -            ( -               output, -               "expr_reads", -               local_id, -               Waveforms.get_associated_waveform_id -               ( -                  IDs.get_id_from_xml_id(ref, (String) null) -               ) -            ); -         } +         handle_expression("expr_reads", local_id, sources.item(0));        }     } | 


