More work on extra/lisp

db4
James Cash 2008-04-20 01:41:16 -04:00
parent a033091b44
commit 025da7d2cd
2 changed files with 12 additions and 4 deletions

View File

@ -1,8 +1,16 @@
! Copyright (C) 2008 James Cash
! See http://factorcode.org/license.txt for BSD license.
USING: kernel peg.ebnf peg.expr ;
USING: kernel peg.ebnf peg.expr math.parser sequences arrays ;
IN: lisp
EBNF: expr
list = "(" ( atom | list )* ")" => [[ second 1array ]]
EBNF: lisp-expr
digit = [0-9] => [[ digit> ]]
integer = (digit)+ => [[ 10 digits>integer ]]
float = (digit)+ "." (digit)* => [[ 3 head 3append string>number ]]
number = integer
| float
identifier = [a-zA-Z] ([a-zA-Z0-9])*
atom = number
| identifier
list = "(" (atom|list)* ")" => [[ second 1array ]]
;EBNF

View File

@ -1 +1 @@
Lisp languages
lisp