Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %{
- open RSLispV3.RunTime
- %}
- %start parse
- %token <string> Text
- %token <int> Digits
- %token Apostrophe Comma LeftParen RightParen Eof
- %type <Tim.Lisp.Core.LispVal list> parse
- %%
- Expr: Text { Text($1, 1) }
- | Apostrophe Text { Text($1, 0) }
- | Comma Text { Text($1, 2) }
- | Digits { Number $1 }
- | LeftParen RightParen { Null }
- | LeftParen Expr RightParen { List($2, 1, Null) }
- | Apostrophe LeftParen ExprList RightParen { List($2, 0, Null) }
- | Comma LeftParen ExprList RightParen { List($2, 2, Null) }
- | LeftParen Expr ExprList RightParen { List($2, 1, $3) }
- | Apostrophe LeftParen Expr ExprList RightParen { List($2, 0, $3) }
- | Comma LeftParen Expr ExprList RightParen { List($2, 2, $3) }
- ExprList: Expr { List($1, -1, Null) ] }
- | Expr ExprList { List($1, -1, $2) }
- parse: ExprList Eof { $1 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement