diff --git a/src/main/java/org/biscuitsec/biscuit/token/builder/parser/Parser.java b/src/main/java/org/biscuitsec/biscuit/token/builder/parser/Parser.java
index dbd1c2c8..724fd8aa 100644
--- a/src/main/java/org/biscuitsec/biscuit/token/builder/parser/Parser.java
+++ b/src/main/java/org/biscuitsec/biscuit/token/builder/parser/Parser.java
@@ -1,7 +1,9 @@
package org.biscuitsec.biscuit.token.builder.parser;
import biscuit.format.schema.Schema;
+import io.vavr.collection.Stream;
import org.biscuitsec.biscuit.crypto.PublicKey;
+import org.biscuitsec.biscuit.datalog.SymbolTable;
import org.biscuitsec.biscuit.token.Policy;
import io.vavr.Tuple2;
import io.vavr.Tuple4;
@@ -10,12 +12,48 @@
import java.time.OffsetDateTime;
import java.time.format.DateTimeParseException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.HashSet;
+import java.util.*;
import java.util.function.Function;
public class Parser {
+ /**
+ * Takes a datalog string with \n
as datalog line separator. It tries to parse
+ * each line using fact, rule, check and scope sequentially.
+ *
+ * If one succeed it returns Right(Block)
+ * else it returns a Map[lineNumber, List[Error]]
+ *
+ * @param index block index
+ * @param baseSymbols symbols table
+ * @param s datalog string to parse
+ * @return Either