summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-08-01 11:10:01 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-08-01 11:10:01 +0200
commit4637db06583bc250b96e6145fc7bac9e16c730df (patch)
treed787feebae44e7bfd526e8391e1999376a4f0185 /ast-to-instr/src
parent798dea30c7832f8c6364d1734423c6a6fda1ce57 (diff)
Fixes is_accessed_by. CNE_01700 is not working.
The BCE has been updated to include a group of items that should be tagged by the CNE_01700 rule. However, it's not happening. I don't see anything wrong with the way the CNE_01700 rule is written and a quick overview of the generated model would lead me to conclude that it indeed should tag something. Likely there are still issues with the way properties are turned into Kodkod formulas.
Diffstat (limited to 'ast-to-instr/src')
-rw-r--r--ast-to-instr/src/VHDLNode.java14
-rw-r--r--ast-to-instr/src/VHDLProcess.java56
-rw-r--r--ast-to-instr/src/VHDLSSASNode.java23
3 files changed, 31 insertions, 62 deletions
diff --git a/ast-to-instr/src/VHDLNode.java b/ast-to-instr/src/VHDLNode.java
index b05f08c..36ba028 100644
--- a/ast-to-instr/src/VHDLNode.java
+++ b/ast-to-instr/src/VHDLNode.java
@@ -69,6 +69,13 @@ public abstract class VHDLNode extends ParsableXML
Strings.get_id_from_string(Integer.toString(i)),
elements.get(i)
);
+
+ Predicates.add_entry
+ (
+ "is_accessed_by",
+ elements.get(i),
+ parent_id
+ );
}
}
@@ -111,6 +118,13 @@ public abstract class VHDLNode extends ParsableXML
Strings.get_id_from_string(Integer.toString(i)),
elements.get(i)
);
+
+ Predicates.add_entry
+ (
+ "is_accessed_by",
+ elements.get(i),
+ parent_id
+ );
}
}
}
diff --git a/ast-to-instr/src/VHDLProcess.java b/ast-to-instr/src/VHDLProcess.java
index 1146f3f..2eae165 100644
--- a/ast-to-instr/src/VHDLProcess.java
+++ b/ast-to-instr/src/VHDLProcess.java
@@ -10,7 +10,6 @@ import java.util.Stack;
public class VHDLProcess extends ParsableXML
{
private static final XPathExpression XPE_FIND_SL_ELEMENTS;
- private static final XPathExpression XPE_FIND_NE_IN_PROCESS;
private static final XPathExpression XPE_FIND_START_NODE;
static
@@ -21,12 +20,6 @@ public class VHDLProcess extends ParsableXML
"(./sensitivity_list/el/named_entity | ./sensitivity_list/el[@ref])"
);
- XPE_FIND_NE_IN_PROCESS =
- XMLManager.compile_or_die
- (
- ".//*[@kind=\"simple_name\"]/named_entity"
- );
-
XPE_FIND_START_NODE =
XMLManager.compile_or_die
(
@@ -80,7 +73,6 @@ public class VHDLProcess extends ParsableXML
handle_predicate_is_explicit_process(local_id);
handle_predicate_is_in_sensitivity_list(local_id);
- handle_predicate_is_accessed_by(local_id);
/** Children ************************************************************/
handle_child_node(local_id, waiting_list);
@@ -407,54 +399,6 @@ public class VHDLProcess extends ParsableXML
}
}
- private void handle_predicate_is_accessed_by
- (
- final IDs local_id
- )
- throws XPathExpressionException
- {
- final NodeList items;
- final int items_count;
-
- items =
- (NodeList) XPE_FIND_SL_ELEMENTS.evaluate
- (
- xml_node,
- XPathConstants.NODESET
- );
-
- items_count = items.getLength();
-
- for (int i = 0; i < items_count; ++i)
- {
- final String xml_id;
-
- xml_id =
- XMLManager.get_attribute
- (
- items.item(i),
- "ref"
- );
-
- if (!Main.node_is_function_or_literal(xml_id))
- {
- Predicates.add_entry
- (
- "is_accessed_by",
- Waveforms.get_associated_waveform_id
- (
- IDs.get_id_from_xml_id
- (
- xml_id,
- null
- )
- ),
- local_id
- );
- }
- }
- }
-
/***************************************************************************/
/** Children ***************************************************************/
/***************************************************************************/
diff --git a/ast-to-instr/src/VHDLSSASNode.java b/ast-to-instr/src/VHDLSSASNode.java
index 944ad18..fd43f28 100644
--- a/ast-to-instr/src/VHDLSSASNode.java
+++ b/ast-to-instr/src/VHDLSSASNode.java
@@ -170,6 +170,7 @@ public class VHDLSSASNode extends VHDLNode
)
throws XPathExpressionException
{
+ final IDs target_id;
Node target;
target =
@@ -221,11 +222,7 @@ public class VHDLSSASNode extends VHDLNode
);
}
- Predicates.add_entry
- (
- output,
- "expr_writes",
- local_id,
+ target_id =
Waveforms.get_associated_waveform_id
(
IDs.get_id_from_xml_id
@@ -233,7 +230,21 @@ public class VHDLSSASNode extends VHDLNode
XMLManager.get_attribute(target, "id"),
(String) null
)
- )
+ );
+
+ Predicates.add_entry
+ (
+ output,
+ "expr_writes",
+ local_id,
+ target_id
+ );
+
+ Predicates.add_entry
+ (
+ "is_accessed_by",
+ target_id,
+ parent_id
);
}