aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-08-17 14:54:41 +0200
committerMattias Andrée <maandree@operamail.com>2013-08-17 14:54:41 +0200
commitd76fe91106cb7cf67b96e7a47012e4416713ebaa (patch)
tree38a5f46e396de8d0ba0078ad09e152787f3a7286
parentimplement variables (diff)
downloadauto-auto-complete-d76fe91106cb7cf67b96e7a47012e4416713ebaa.tar.gz
auto-auto-complete-d76fe91106cb7cf67b96e7a47012e4416713ebaa.tar.bz2
auto-auto-complete-d76fe91106cb7cf67b96e7a47012e4416713ebaa.tar.xz
add limited syntax document
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--syntax78
1 files changed, 78 insertions, 0 deletions
diff --git a/syntax b/syntax
new file mode 100644
index 0000000..6a53dff
--- /dev/null
+++ b/syntax
@@ -0,0 +1,78 @@
+auto-auto-complete ::= _ program _
+
+program ::= '(' _ value _ body ')'
+
+body ::= [{(multiple | default | unargumented | argumented | variadic | suggestion) _}]
+
+_value ::= __ name | _ value | _ case
+
+value ::= name | variable | case
+
+variable ::= '(' _ "value" __ name _ [{value _}] ')'
+
+case ::= '(' _ "case" {_ a_case} _ ')'
+
+a_case ::= '(' {_ value} _ ')'
+
+multiple ::= '(' _ "multiple" <keyword=_value> [{_ '(' _ <item=anything> _ ')'}] _ ')'
+ ==> [{'(' <keyword> ' ' <item> ')'}]
+
+anything ::= [{_ value | _ '(' anything _ ')'}]
+
+default ::= '(' _ "default" (4-:_ ) _ ')'
+
+unargumented ::= '(' _ "unargumented" (3-:_ (options | complete | desc)) _ ')'
+
+argumented ::= '(' _ "argumented" (6-:_ (options | complete | arg | suggest | files | bind | desc)) _ ')'
+
+variadic ::= '(' _ "variadic" (6-:_ (options | complete | arg | suggest | files | bind | desc)) _ ')'
+
+options ::= '(' _ "options" _value [{_ value}] ')'
+
+complete ::= '(' _ "complete" _value [{_ value}] ')'
+
+arg ::= '(' _ "arg" _value ')'
+
+suggest ::= '(' _ "suggest" _value ')'
+
+files ::= '(' _ "files" _value [{_ value}] ')'
+::= {"-0" | "-a" | "-d" | "-D" | "-f" | "-l" | "-r"} [{value}]
+
+bind ::= '(' _ "bind" _value ')'
+
+desc ::= '(' _ "desc" _value ')'
+
+suggestion ::= '(' _ "suggestion" _ value {_ a_suggestion} _ ')'
+
+a_suggestion ::= '(' _ (exec | noexec | ls | verbatim | calc) _ ')'
+
+exec ::= 'exec' (__ value | _ any_exec) [{_ value | _ any_exec}]
+
+noexec ::= ls | verbatim
+
+ls ::= 'ls' _value [_ value]
+
+verbatim ::= 'verbatim' _value [{_ value}]
+
+calc ::= 'calc' (__ value | _ any_exec) [{_ value | _ any_exec}]
+
+any_exec ::= exec_type (__ value | _ any_exec) [{_ value | _ any_exec}]
+
+exec_type ::= 'exec' | 'calc' | 'pipe' | 'fullpipe' | 'cat' | 'and' | 'or'
+
+name ::= {letter | escape | squote | dquote}
+
+letter :: $any ^ ' ' ^ \t ^ \n ^ \r ^ \t ^ '\' ^ \' ^ \"
+
+escape ::= '\' $any
+
+squote ::= \' [{$any ^ '\' ^ \' | escape}] \'
+
+dquote ::= \" [{$any ^ '\' ^ \" | escape}] \"
+
+comment ::= ('#' | ';') [{$any}] \z
+
+__ ::= {' ' | \t | \n | \r | \f | comment}
+
+_ ::= [__]
+