yaml: more examples
[protos/libecoli.git] / examples / parse-yaml / cond.yaml
diff --git a/examples/parse-yaml/cond.yaml b/examples/parse-yaml/cond.yaml
new file mode 100644 (file)
index 0000000..49483ab
--- /dev/null
@@ -0,0 +1,43 @@
+type: re_lex
+patterns:
+- pattern: "[_a-zA-Z][._a-zA-Z0-9]*"
+  keep: true
+  attr: a_identifier
+- pattern: "\\("
+  keep: true
+  attr: a_open
+- pattern: "\\)"
+  keep: true
+  attr: a_close
+- pattern: ","
+  keep: true
+- pattern: "[  ]+"
+  keep: false
+child:
+  &term
+  id: term
+  type: or
+  children:
+  - type: seq
+    id: function
+    children:
+    - type: any
+      id: function_name
+      attr: a_identifier
+    - type: any
+      attr: a_open
+    - type: option
+      id: term_list
+      child:
+        type: seq
+        children:
+        - *term
+        - type: many
+          child:
+            type: seq
+            children:
+            - type: str
+              string: ","
+            - *term
+    - type: any
+      attr: a_close