   (gen-java-executor-source! 
   "/Users/anderse/src/mz-dev2/mz-main/mediationzone/packages/bitcoin/src/main/java" 
   "com.digitalroute.mz.bitcoin.agent" "BitcoinRpcExecutor" "AbstractBitcoinRpc")
-  )+  )
+
+
+

    ast->clj-map 
    ast))

(def not-working #{"prioritisetransaction" "createrawtransaction" "listunspent" "sendmany"})

(defn valid-fn [l] 
  (let [n (first (.split l " "))]
    (not (contains? not-working n))))

(defn parse [l]
  (let [r (help-parser l)]
    (if (insta/failure? r) 
      (throw (IllegalStateException. (pr-str (insta/get-failure r)))) 
      (ast->clj r))))

(defn def-rpcs [] 
  (let [e (conj 
            (map parse (filter valid-fn (split-help)))
            'do)]
    e))

;;--------------------------------------------------------




;;---------------------------------------------------------------------------------

(def rpc-parser
  (insta/parser
    "BTC = TITLE | FUNCTION | Epsilon
     TITLE = (<'=='> SPACE SYMBOL SPACE <'=='>)
     FUNCTION = SYMBOL | (SYMBOL SPACE ARGS)
     ARGS = ((ARG SPACE)* ARG OPTIONAL-SPACE) | Epsilon
     <ARG> = MAP-ARG | LIST-ARG | STRING-SYMBOL | SYMBOL  | OPTIONAL-ARG | ENUM | ALT-LIST-ARG
     ENUM = ((SYMBOL <'|'>)+ SYMBOL)
     OPTIONAL-ARG = (<'('> OPTIONAL-SPACE (ARG | ARGS) OPTIONAL-SPACE <')'>)
     LIST-ARG = <'['> ARG <',...'> <']'> 
     ALT-LIST-ARG = <'<'> (SYMBOL SPACE)* SYMBOL <'>'> 
     MAP-ARG = (<'{'>) ((KEY-VALUE <','>)* KEY-VALUE) (<'}'>)
     KEY-VALUE = ARG <':'> ARG
     OPEN-KEY-VALUE = (KEY-VALUE <',...'>)
