summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-07-26 14:32:28 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-07-26 14:32:28 +0200
commit5f06e34bc24876739c1d4af1d45f7cb322a19559 (patch)
tree38363a28b472610d5dc8391baeba2d98e731fa2c /ast-to-instr
parent1eb79a5c6ae03500a2816a34983e5d4cc700de33 (diff)
First shot at (logic, not VHDL) functions.
Diffstat (limited to 'ast-to-instr')
-rw-r--r--ast-to-instr/src/Expressions.java28
-rw-r--r--ast-to-instr/src/VHDLCSNode.java9
-rw-r--r--ast-to-instr/src/VHDLISNode.java9
-rw-r--r--ast-to-instr/src/VHDLSSASNode.java9
-rw-r--r--ast-to-instr/src/VHDLWNode.java9
5 files changed, 20 insertions, 44 deletions
diff --git a/ast-to-instr/src/Expressions.java b/ast-to-instr/src/Expressions.java
index 0ea741b..90b0fff 100644
--- a/ast-to-instr/src/Expressions.java
+++ b/ast-to-instr/src/Expressions.java
@@ -19,6 +19,7 @@ public class Expressions
private static final XPathExpression XPE_GET_INDEX_LIST;
private static final XPathExpression XPE_GET_NAMED_ENTITY;
private static final XPathExpression XPE_GET_PREFIX_NAMED_ENTITY;
+ private static final XPathExpression XPE_GET_PREFIX;
static
{
@@ -29,7 +30,7 @@ public class Expressions
XPE_GET_FUN_PARAMETERS =
XMLManager.compile_or_die
(
- "./parameter_association_chain/el"
+ "./parameter_association_chain/el/actual"
);
XPE_GET_INDEX_LIST = XMLManager.compile_or_die("./index_list/el");
@@ -40,6 +41,8 @@ public class Expressions
(
"./prefix/named_entity"
);
+
+ XPE_GET_PREFIX = XMLManager.compile_or_die("./prefix");
}
private static enum Operator
@@ -266,7 +269,7 @@ public class Expressions
final int params_length;
named_entity =
- (Node) XPE_GET_PREFIX_NAMED_ENTITY.evaluate
+ (Node) XPE_GET_PREFIX/*_NAMED_ENTITY*/.evaluate
(
current_node,
XPathConstants.NODE
@@ -274,18 +277,27 @@ public class Expressions
structure.append("(?");
+ /*
+ * TODO: Handle functions better, like:
+ elements.add
+ (
+ IDs.get_id_from_xml_id
+ (
+ XMLManager.get_attribute(named_entity, "ref"),
+ null
+ )
+ );
+ * But for now, we'll just use the function's name as string:
+ */
elements.add
(
- Waveforms.get_associated_waveform_id
+ Strings.get_id_from_string
(
- IDs.get_id_from_xml_id
- (
- XMLManager.get_attribute(named_entity, "ref"),
- null
- )
+ XMLManager.get_attribute(named_entity, "identifier")
)
);
+
params =
(NodeList) XPE_GET_FUN_PARAMETERS.evaluate
(
diff --git a/ast-to-instr/src/VHDLCSNode.java b/ast-to-instr/src/VHDLCSNode.java
index 3e991f0..f500345 100644
--- a/ast-to-instr/src/VHDLCSNode.java
+++ b/ast-to-instr/src/VHDLCSNode.java
@@ -75,7 +75,6 @@ public class VHDLCSNode extends VHDLNode
handle_function_label(local_id);
handle_function_kind(local_id);
handle_function_depth(local_id);
- handle_function_expression(local_id);
/** Predicates **********************************************************/
handle_predicate_has_option(local_id);
@@ -138,14 +137,6 @@ public class VHDLCSNode extends VHDLNode
);
}
- private void handle_function_expression
- (
- final IDs local_id
- )
- {
- /* TODO */
- }
-
/***************************************************************************/
/** Predicates *************************************************************/
/***************************************************************************/
diff --git a/ast-to-instr/src/VHDLISNode.java b/ast-to-instr/src/VHDLISNode.java
index 62fc3da..3c293cd 100644
--- a/ast-to-instr/src/VHDLISNode.java
+++ b/ast-to-instr/src/VHDLISNode.java
@@ -74,7 +74,6 @@ public class VHDLISNode extends VHDLNode
handle_function_label(local_id);
handle_function_kind(local_id);
handle_function_depth(local_id);
- handle_function_expression(local_id);
/** Predicates **********************************************************/
handle_predicate_has_option(local_id);
@@ -136,14 +135,6 @@ public class VHDLISNode extends VHDLNode
);
}
- private void handle_function_expression
- (
- final IDs local_id
- )
- {
- /* TODO */
- }
-
/***************************************************************************/
/** Predicates *************************************************************/
/***************************************************************************/
diff --git a/ast-to-instr/src/VHDLSSASNode.java b/ast-to-instr/src/VHDLSSASNode.java
index ef08f6f..b638f81 100644
--- a/ast-to-instr/src/VHDLSSASNode.java
+++ b/ast-to-instr/src/VHDLSSASNode.java
@@ -68,7 +68,6 @@ public class VHDLSSASNode extends VHDLNode
handle_function_label(local_id);
handle_function_kind(local_id);
handle_function_depth(local_id);
- handle_function_expression(local_id);
/** Predicates **********************************************************/
handle_predicate_has_option(local_id);
@@ -130,14 +129,6 @@ public class VHDLSSASNode extends VHDLNode
);
}
- private void handle_function_expression
- (
- final IDs local_id
- )
- {
- /* TODO */
- }
-
/***************************************************************************/
/** Predicates *************************************************************/
/***************************************************************************/
diff --git a/ast-to-instr/src/VHDLWNode.java b/ast-to-instr/src/VHDLWNode.java
index 84cebb9..4052229 100644
--- a/ast-to-instr/src/VHDLWNode.java
+++ b/ast-to-instr/src/VHDLWNode.java
@@ -67,7 +67,6 @@ public class VHDLWNode extends VHDLNode
handle_function_label(local_id);
handle_function_kind(local_id);
handle_function_depth(local_id);
- handle_function_expression(local_id);
/** Predicates **********************************************************/
handle_predicate_has_option(local_id);
@@ -125,14 +124,6 @@ public class VHDLWNode extends VHDLNode
);
}
- private void handle_function_expression
- (
- final IDs local_id
- )
- {
- /* TODO */
- }
-
/***************************************************************************/
/** Predicates *************************************************************/
/***************************************************************************/