From b0c9baf1b5843acbb954d21bcb5cacc897236c3b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 8 Apr 2004 13:31:57 +0000 Subject: * EBNF grammar for the Nix expression language. --- doc/manual/nix-lang-ref.xml | 183 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 doc/manual/nix-lang-ref.xml (limited to 'doc/manual/nix-lang-ref.xml') diff --git a/doc/manual/nix-lang-ref.xml b/doc/manual/nix-lang-ref.xml new file mode 100644 index 000000000000..19917144e7d4 --- /dev/null +++ b/doc/manual/nix-lang-ref.xml @@ -0,0 +1,183 @@ + + Nix Language Reference + + + Grammar + + + + + + Expressions + + + Expr + + + + + + + ExprFunction + + '{' '}' ':' + | + + + + + + ExprAssert + + 'assert' ';' + | + + + + + + ExprIf + + 'if' 'then' + 'else' + | + + + + + + ExprOp + + '!' + | + '==' + | + '!=' + | + '&&' + | + '||' + | + '->' + | + '//' + | + '~' + | + '?' + | + + + + + + ExprApp + + '.' + | + + + + + + ExprSelect + + + | + + + + + + ExprSimple + + | + | + | + | + + | + '(' ')' + | + '{' * '}' + | + 'let' '{' * '}' + | + 'rec' '{' * '}' + | + '[' * ']' + + + + + Bind + + '=' ';' + | + 'inherit' ('(' ')')? * ';' + + + + + Formals + + ',' + | + + + + + Formal + + + | + '?' + + + + + + + Terminals + + + Id + [a-zA-Z\_][a-zA-Z0-9\_\']* + + + + Int + [0-9]+ + + + + Str + \"[^\n\"]*\" + + + + Path + [a-zA-Z0-9\.\_\-\+]*(\/[a-zA-Z0-9\.\_\-\+]+)+ + + + + Uri + [a-zA-Z][a-zA-Z0-9\+\-\.]*\:[a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*\']+ + + + + Whitespace + + [ \t\n]+ + | + \#[^\n]* + | + \/\*(.|\n)*\*\/ + + + + + + + + \ No newline at end of file -- cgit 1.4.1