| summaryrefslogtreecommitdiff | 
diff options
Diffstat (limited to 'ast-to-instr/src')
| -rw-r--r-- | ast-to-instr/src/VHDLComponent.java | 208 | ||||
| -rw-r--r-- | ast-to-instr/src/VHDLProcess.java | 437 | ||||
| -rw-r--r-- | ast-to-instr/src/VHDLSignal.java | 352 | 
3 files changed, 997 insertions, 0 deletions
| diff --git a/ast-to-instr/src/VHDLComponent.java b/ast-to-instr/src/VHDLComponent.java new file mode 100644 index 0000000..e22abe9 --- /dev/null +++ b/ast-to-instr/src/VHDLComponent.java @@ -0,0 +1,208 @@ +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpression; +import javax.xml.xpath.XPathExpressionException; + +import java.util.ArrayList; +import java.util.Collection; + +public class VHDLComponent extends ParsableXML +{ +   private static final XPathExpression GET_ENTITIES; + +   static +   { +      GET_ENTITIES = null; +      /* TODO +         Main.get_xpath().compile +         ( +         ); +      */ +       //     "./*/*/library_unit[@kind=\"entity_declaration\"]" +   } + +   public VHDLComponent +   ( +      final IDs parent_id, +      final Node xml_node +   ) +   { +      super(parent_id, xml_node); +   } + +   @Override +   public Collection<ParsableXML> parse () +   throws XPathExpressionException +   { +      final Collection<ParsableXML> result; +      final String xml_id; +      final IDs local_id; + +      result = new ArrayList<ParsableXML>(); + +      xml_id = null; /* TODO: elem.attrib.get("id") */ + +      local_id = IDs.get_id_from_xml_id(xml_id, "component"); + +      /** Parent **************************************************************/ +      handle_link_to_architecture(local_id); +      handle_link_to_entity(local_id); + +      /** Functions ***********************************************************/ +      handle_function_line(local_id); +      handle_function_column(local_id); +      handle_function_label(local_id); + +      /** Predicates **********************************************************/ +      handle_predicate_port_maps(local_id); +      handle_predicate_generic_maps(local_id); + +      return null; +   } + +   /***************************************************************************/ +   /** Parents ****************************************************************/ +   /***************************************************************************/ +   private void handle_link_to_architecture +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            parent_id +         }; + +      /* TODO */ +   } + +   private void handle_link_to_entity +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            parent_id +         }; + +      /* TODO */ +   } + + +   /***************************************************************************/ +   /** Functions **************************************************************/ +   /***************************************************************************/ +   private void handle_function_line +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_function_column +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_function_label +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   /***************************************************************************/ +   /** Predicates *************************************************************/ +   /***************************************************************************/ +   private void handle_predicate_port_maps +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_generic_maps +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } +} diff --git a/ast-to-instr/src/VHDLProcess.java b/ast-to-instr/src/VHDLProcess.java new file mode 100644 index 0000000..1979424 --- /dev/null +++ b/ast-to-instr/src/VHDLProcess.java @@ -0,0 +1,437 @@ +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpression; +import javax.xml.xpath.XPathExpressionException; + +import java.util.ArrayList; +import java.util.Collection; + +public class VHDLProcess extends ParsableXML +{ +   private static final XPathExpression GET_ENTITIES; + +   static +   { +      GET_ENTITIES = null; +      /* TODO +         Main.get_xpath().compile +         ( +         ); +      */ +       //     "./*/*/library_unit[@kind=\"entity_declaration\"]" +   } + +   public VHDLProcess +   ( +      final IDs parent_id, +      final Node xml_node +   ) +   { +      super(parent_id, xml_node); +   } + +   @Override +   public Collection<ParsableXML> parse () +   throws XPathExpressionException +   { +      final Collection<ParsableXML> result; +      final String xml_id; +      final IDs local_id; + +      result = new ArrayList<ParsableXML>(); + +      xml_id = null; /* TODO: elem.attrib.get("id") */ + +      local_id = IDs.get_id_from_xml_id(xml_id, "process"); + +      /** Parent **************************************************************/ +      handle_link_to_architecture(local_id); + +      /** Functions ***********************************************************/ +      handle_function_line(local_id); +      handle_function_column(local_id); +      handle_function_label(local_id); + +      /** Predicates **********************************************************/ +      handle_predicate_has_seen_flag(local_id); +      handle_predicate_end_has_postponed(local_id); +      handle_predicate_is_ref(local_id); +      handle_predicate_has_passive_flag(local_id); +      handle_predicate_has_postponed_flag(local_id); +      handle_predicate_has_visible_flag(local_id); +      handle_predicate_has_label(local_id); +      handle_predicate_has_is(local_id); +      handle_predicate_end_has_reserved_id(local_id); +      handle_predicate_end_has_identifier(local_id); + +      handle_predicate_is_explicit_process(local_id); +      handle_predicate_is_in_sensitivity_list(local_id); +      handle_predicate_is_accessed_by(local_id); + +      /** Children ************************************************************/ +      result.addAll(handle_child_nodes(local_id)); + +      return null; +   } + +   /***************************************************************************/ +   /** Parents ****************************************************************/ +   /***************************************************************************/ +   private void handle_link_to_architecture +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            parent_id +         }; + +      /* TODO */ +   } + + +   /***************************************************************************/ +   /** Functions **************************************************************/ +   /***************************************************************************/ +   private void handle_function_line +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_function_column +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_function_label +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   /***************************************************************************/ +   /** Predicates *************************************************************/ +   /***************************************************************************/ +   private void handle_predicate_has_seen_flag +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_end_has_postponed +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_is_ref +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_has_passive_flag +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_has_postponed_flag +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_has_visible_flag +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_has_label +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_has_is +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_end_has_reserved_id +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_end_has_identifier +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_is_explicit_process +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_is_in_sensitivity_list +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_is_accessed_by +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   /***************************************************************************/ +   /** Children ***************************************************************/ +   /***************************************************************************/ +   private Collection<ParsableXML> handle_child_nodes +   ( +      final IDs local_id +   ) +   { +      /* TODO */ +      return null; +   } +} diff --git a/ast-to-instr/src/VHDLSignal.java b/ast-to-instr/src/VHDLSignal.java new file mode 100644 index 0000000..9dffe73 --- /dev/null +++ b/ast-to-instr/src/VHDLSignal.java @@ -0,0 +1,352 @@ +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpression; +import javax.xml.xpath.XPathExpressionException; + +import java.util.ArrayList; +import java.util.Collection; + +public class VHDLSignal extends ParsableXML +{ +   private static final XPathExpression GET_ENTITIES; + +   static +   { +      GET_ENTITIES = null; +      /* TODO +         Main.get_xpath().compile +         ( +         ); +      */ +       //     "./*/*/library_unit[@kind=\"entity_declaration\"]" +   } + +   public VHDLSignal +   ( +      final IDs parent_id, +      final Node xml_node +   ) +   { +      super(parent_id, xml_node); +   } + +   @Override +   public Collection<ParsableXML> parse () +   throws XPathExpressionException +   { +      final Collection<ParsableXML> result; +      final String xml_id; +      final IDs local_id; + +      result = new ArrayList<ParsableXML>(); + +      xml_id = null; /* TODO: elem.attrib.get("id") */ + +      local_id = IDs.get_id_from_xml_id(xml_id, "signal"); + +      /** Parent **************************************************************/ +      handle_link_to_architecture(local_id); + +      /** Functions ***********************************************************/ +      handle_function_line(local_id); +      handle_function_column(local_id); +      handle_function_identifier(local_id); + +      /** Predicates **********************************************************/ +      handle_predicate_has_disconnect_flag(local_id); +      handle_predicate_is_ref(local_id); +      handle_predicate_has_active_flag(local_id); +      handle_predicate_has_identifier_list(local_id); +      handle_predicate_has_visible_flag(local_id); +      handle_predicate_has_after_drivers_flag(local_id); +      handle_predicate_has_use_flag(local_id); +      handle_predicate_has_guarded_signal_flag(local_id); + +      handle_predicate_is_of_kind(local_id); + +      /** Children ************************************************************/ +      handle_child_waveform(local_id); + +      return null; +   } + +   /***************************************************************************/ +   /** Parents ****************************************************************/ +   /***************************************************************************/ +   private void handle_link_to_architecture +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            parent_id +         }; + +      /* TODO */ +   } + + +   /***************************************************************************/ +   /** Functions **************************************************************/ +   /***************************************************************************/ +   private void handle_function_line +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_function_column +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_function_identifier +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   /***************************************************************************/ +   /** Predicates *************************************************************/ +   /***************************************************************************/ +   private void handle_predicate_has_disconnect_flag +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_is_ref +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_has_active_flag +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_has_identifier_list +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_has_visible_flag +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_has_after_drivers_flag +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_has_use_flag +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_has_guarded_signal_flag +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   private void handle_predicate_is_of_kind +   ( +      final IDs local_id +   ) +   { +      final IDs params[]; + +      params = +         new IDs[] +         { +            local_id, +            Strings.get_id_from_string +            ( +               null /* TODO: get attribute */ +            ) +         }; + +      /* Functions.add_entry("filename", params); */ +   } + +   /***************************************************************************/ +   /** Children ***************************************************************/ +   /***************************************************************************/ +   private void handle_child_waveform +   ( +      final IDs local_id +   ) +   { +      /* TODO */ +   } +} | 


