Permalink
Browse files

complete DQL porting from haskell, still has some cyclic deps

  • Loading branch information...
1 parent 52c70df commit 6488f989a7357af24dbba689f57d0b3ab269fe77 @mmikulicic committed Jan 4, 2010
Showing with 22 additions and 3 deletions.
  1. +6 −0 src/ast.clj
  2. +16 −3 src/doroty.clj
View
@@ -35,3 +35,9 @@
(defn make-xpath-expression [ex]
{:type 'XPathPredicate :expression ex})
+
+(defn make-decl-init [typ name e]
+ {:type 'DeclInit :type typ :name name :expression e})
+
+(defn make-assign [name e]
+ {:type 'Assign :name name :expression e})
View
@@ -44,8 +44,22 @@
(result (make-call target method args))))
+(defn decl [typ]
+ (let-bind [name identifier
+ _ (symb "=")
+ e expression]
+ (result (make-decl-init typ name e))))
+
+(defn assign [name]
+ (let-bind [_ (symb "=")
+ e expression]
+ (result (make-assign name e))))
+
(def predecl
- (string "undef"))
+ (let-bind [name identifier]
+ (either (decl name) (assign name))))
+
+
(def tagname (either (symb ".")
(let-bind [attr (option "" (string "@"))
@@ -68,8 +82,7 @@
(def xpath
(>>== (sepBy tagexp (string "/"))
- make-xpath)
-)
+ make-xpath))
(def fieldList
(sepBy identifier comma))

0 comments on commit 6488f98

Please sign in to comment.