aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/nix.sdf
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-01-30 15:21:42 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-01-30 15:21:42 +0000
commitc5baaafae69394082817ede9e6eb3910c4601a72 (patch)
treebfc2599717c4274e16ba02959617254873c0c007 /src/libexpr/nix.sdf
parentabd1878b26200ba3fa75592637aa87e04f52100d (diff)
* Replaced the SDF parser by a substantially faster Bison/Flex
parser (roughly 80x faster). The absolutely latest version of Bison (1.875c) is required for reentrant GLR support, as well as a recent version of Flex (say, 2.5.31). Note that most Unix distributions ship with the prehistoric Flex 2.5.4, which doesn't support reentrancy.
Diffstat (limited to 'src/libexpr/nix.sdf')
-rw-r--r--src/libexpr/nix.sdf131
1 files changed, 0 insertions, 131 deletions
diff --git a/src/libexpr/nix.sdf b/src/libexpr/nix.sdf
deleted file mode 100644
index 36fbef39c..000000000
--- a/src/libexpr/nix.sdf
+++ /dev/null
@@ -1,131 +0,0 @@
-definition
-
-module Main
-imports Fix
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Top level syntax.
-
-module Fix
-imports Fix-Exprs Fix-Layout
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Expressions.
-
-module Fix-Exprs
-imports Fix-Lexicals
-exports
- sorts Expr Formal Bind Binds ExprList
- context-free syntax
-
- Id -> Expr {cons("Var")}
-
- Int -> Expr {cons("Int")}
-
- Str -> Expr {cons("Str")}
-
- Uri -> Expr {cons("Uri")}
-
- Path -> Expr {cons("Path")}
-
- "(" Expr ")" -> Expr {bracket}
-
- Expr Expr -> Expr {cons("Call"), left}
-
- "{" {Formal ","}* "}" ":" Expr -> Expr {cons("Function")}
- Id -> Formal {cons("NoDefFormal")}
- Id "?" Expr -> Formal {cons("DefFormal")}
-
- "assert" Expr ";" Expr -> Expr {cons("Assert")}
-
- "rec" "{" Binds "}" -> Expr {cons("Rec")}
- "let" "{" Binds "}" -> Expr {cons("LetRec")}
- "{" Binds "}" -> Expr {cons("Attrs")}
-
- Bind* -> Binds
- Id "=" Expr ";" -> Bind {cons("Bind")}
-
- "[" ExprList "]" -> Expr {cons("List")}
- "" -> ExprList {cons("ExprNil")}
- Expr ExprList -> ExprList {cons("ExprCons")}
-
- Expr "." Id -> Expr {cons("Select")}
-
- "if" Expr "then" Expr "else" Expr -> Expr {cons("If")}
-
- Expr "==" Expr -> Expr {cons("OpEq"), non-assoc}
- Expr "!=" Expr -> Expr {cons("OpNEq"), non-assoc}
-
- "!" Expr -> Expr {cons("OpNot")}
- Expr "&&" Expr -> Expr {cons("OpAnd"), right}
- Expr "||" Expr -> Expr {cons("OpOr"), right}
- Expr "->" Expr -> Expr {cons("OpImpl"), right}
-
- context-free priorities
-
- Expr "." Id -> Expr
- > Expr ExprList -> ExprList
- > Expr Expr -> Expr
- > "!" Expr -> Expr
- > Expr "==" Expr -> Expr
- > Expr "!=" Expr -> Expr
- > Expr "&&" Expr -> Expr
- > Expr "||" Expr -> Expr
- > Expr "->" Expr -> Expr
- > "assert" Expr ";" Expr -> Expr
- > "{" {Formal ","}* "}" ":" Expr -> Expr
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Lexical syntax.
-
-module Fix-Lexicals
-exports
- sorts Id Int Str Path PathComp Uri
- lexical syntax
- [a-zA-Z\_][a-zA-Z0-9\_\']* -> Id
- "rec" -> Id {reject}
- "let" -> Id {reject}
- "if" -> Id {reject}
- "then" -> Id {reject}
- "else" -> Id {reject}
- "assert" -> Id {reject}
-
- [0-9]+ -> Int
-
- "\"" ~[\n\"]* "\"" -> Str
-
- "." ("/" PathComp)+ -> Path
- ".." ("/" PathComp)+ -> Path
- ("/" PathComp)+ -> Path
- [a-zA-Z0-9\.\_\-\+]+ -> PathComp
-
- [a-zA-Z] [a-zA-Z0-9\+\-\.]* ":" [a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*\']* -> Uri
-
- lexical restrictions
- Id -/- [a-zA-Z0-9\_\']
- Int -/- [0-9]
- Path -/- [a-zA-Z0-9\.\_\-\+\/]
- Uri -/- [a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*\']
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Layout.
-
-module Fix-Layout
-exports
- sorts HashComment Asterisk Comment
- lexical syntax
- [\ \t\n] -> LAYOUT
- HashComment -> LAYOUT
- Comment -> LAYOUT
- "#" ~[\n]* -> HashComment
- "/*" ( ~[\*] | Asterisk )* "*/" -> Comment
- [\*] -> Asterisk
- lexical restrictions
- Asterisk -/- [\/]
- HashComment -/- ~[\n]
- context-free restrictions
- LAYOUT? -/- [\ \t\n]