summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-05-28 13:29:08 +0200
committernsensfel <SpamShield0@noot-noot.org>2018-05-28 13:29:08 +0200
commit3ead43a313414ee523364f18e6aba25f863b312e (patch)
tree8461b54d5ed0bcdfc6398281e2907b635ab98702
parentde2a0107a5a7a08a5470e54ed2ed792eebfe87ba (diff)
Woops, forgot a file.
-rw-r--r--src/hastabel2idp/idp/VocabularyOut.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/hastabel2idp/idp/VocabularyOut.java b/src/hastabel2idp/idp/VocabularyOut.java
new file mode 100644
index 0000000..2229f38
--- /dev/null
+++ b/src/hastabel2idp/idp/VocabularyOut.java
@@ -0,0 +1,42 @@
+package hastabel2idp.idp;
+
+import hastabel2idp.OutputFile;
+
+import hastabel.lang.Variable;
+
+import java.util.List;
+
+public class VocabularyOut
+{
+ private final OutputFile out;
+
+ public VocabularyOut (final String filename)
+ {
+ out = OutputFile.new_output_file(filename);
+ }
+
+ public void write_header ()
+ {
+ out.write("vocabulary Vout {");
+ out.insert_newline();
+ }
+
+ public void write_footer ()
+ {
+ out.write("}");
+ out.insert_newline();
+ }
+
+ public void add_target_predicate
+ (
+ final String name,
+ final List<Variable> arguments
+ )
+ {
+ out.write(" extern V::");
+ out.write(name);
+ out.write("/");
+ out.write(Integer.toString(arguments.size()));
+ out.insert_newline();
+ }
+}