  { :parents [ {:type <[ or ( or { or \" or \\> :line :offset :col} ... ]
    :offset current-offset :line current-line :col current-col}"
 
-#_(defn default-parser-hook
-  ; todo : later on, move offset+line+col+parents inside a proper deftyped type
-  [#^String text offset line col parents hook-state]
-  [(< offset (.length text))
-   { :parents parents :offset offset :line line :col col }])
+; todo : later on, move offset+line+col+parents inside a proper deftyped type
+(defn default-accumulator
+  [#^String text offset line col parents parser-state accumulated-state]
+    [#^String text offset line col parents parser-state accumulated-state]
+    nil)
 
-(defn make-stop-offset-based-parser-hook
+(defn make-default-continue?-fn
   [stop-offset]
-  (fn stop-offset-based-parser-hook
-  ; todo : later on, move offset+line+col+parents inside a proper deftyped type
-    [#^String text offset line col parents parser-state hook-state]
-    [(< offset stop-offset) nil]))
+  (fn default-continue?-fn
+    [#^String text offset line col parents parser-state accumulated-state]
+    (< offset stop-offset)))
 
-(defn default-parser-result-maker
-  [#^String text offset line col parents parser-state hook-state]
+(defn default-make-result
+  [#^String text offset line col parents parser-state accumulated-state]
   { :parents parents :offset offset :line line :col col })
    
 (defn parse 

                    (= \; c)
                    (= \\ c)
                    :else
                      (recur (inc offset) line (inc col) parents hook-state)))))))))
	          
(comment
(defn parse-lib 

	 TODO: make the parser restartable at a given offset given a state ...
	 TODO: make the parser fully incremental (via chunks of any possible size ...)"	
  ([#^String text] (parse text (.length text)))
  ([#^String text stop-offset] (parse text nil default-accumulator (make-default-continue?-fn stop-offset) default-make-result))
	([#^String text initial-accumulated-state accumulator-fn continue?-fn make-result-fn]
	  (loop [offset  (int 0)
	         line    (int 0)
	         col     (int 0)
	         parents [{:type nil :offset 0 :line 0 :col 0}]
	         accumulated-state initial-accumulated-state]
	      (let [parser-state (if (>= offset (.length text)) :eof :ok) ; TODO soon an additional :parser-error state !
	            accumulated-state (accumulator-fn text offset line col parents parser-state accumulated-state)
	            continue? (continue?-fn text offset line col parents parser-state accumulated-state)] 
  	      (if (or (not continue?) (= :eof parser-state))
  	        (make-result-fn text offset line col parents parser-state accumulated-state)
  	        (let [c (.charAt text offset)] ; c: current char
  	          (condp = (-> parents peek :type)
  	            \" 
                  (cond
                    (= \newline c)
                      (recur (inc offset) (inc line) (int 0) parents accumulated-state)
                    (= \" c)
                      (if (= offset 0)
                        (recur (inc offset) line (inc col) (conj parents {:type c :line line :col col :offset offset}) accumulated-state)
                        (if (= \\ (.charAt text (dec offset)))
                          (recur (inc offset) line (inc col) parents accumulated-state)
                          (recur (inc offset) line (inc col) (pop parents) accumulated-state)))
                    :else
                      (recur (inc offset) line (inc col) parents accumulated-state))
                \;	          
                  (cond
                    (= \newline c)
                      (recur (inc offset) (inc line) (int 0) (pop parents) accumulated-state)
                    :else
                      (recur (inc offset) line (inc col) parents accumulated-state))
                \\
                  (cond   ; leaved as a template if new cases have to be handled
                    #_(*opening-brackets* c)
