From 8a22531a1fa9560f312693dfd886b3a86a222d04 Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Sat, 26 Mar 2022 14:23:44 +0100 Subject: [PATCH] added AdmFragmentTemplate interface --- .../fragment/AsmFragmentTemplateFactory.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/main/java/dk/camelot64/kickc/fragment/AsmFragmentTemplateFactory.java diff --git a/src/main/java/dk/camelot64/kickc/fragment/AsmFragmentTemplateFactory.java b/src/main/java/dk/camelot64/kickc/fragment/AsmFragmentTemplateFactory.java new file mode 100644 index 000000000..934d0ebfd --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/fragment/AsmFragmentTemplateFactory.java @@ -0,0 +1,26 @@ +package dk.camelot64.kickc.fragment; + +import dk.camelot64.kickc.fragment.signature.AsmFragmentSignature; +import dk.camelot64.kickc.model.TargetCpu; + +/** + * Abstract factory for creating ASM fragment templates from signatures. + */ +public interface AsmFragmentTemplateFactory { + + /** + * Get the CPU that the factory produces templates for + * + * @return The target CPU + */ + TargetCpu getCpu(); + + /** + * Get an ASM template from a signature. + * + * @param signature The signature describing the ASM fragment + * @return The ASM fragment template that can be used for generating ASM + */ + AsmFragmentTemplate getTemplate(AsmFragmentSignature signature); + +}