Skip to content

Commit

Permalink
Merge pull request #33 from amyjbrown/patch-3
Browse files Browse the repository at this point in the history
Create meso-lisp
  • Loading branch information
katef authored Sep 21, 2020
2 parents 42abe09 + 2efadd0 commit 2daf53c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions examples/meso-lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# LISP grammar

Program ::= Declaration*
Declaration::= VarDec
| ConstDecl
| FunDeclar
| UseDecl
| PubDecl
| MainDecl
| Expression;

Expression ::= Atom | "(" Complex ")";
Complex ::= IfForm
| ListForm
| QuoteForm
| LambdaForm
| SetForm
| Call;

IfForm ::= "if" Expression Expression Expression?;
QuoteForm ::= "quote" Expression;
ListForm ::= "ls" Expression*;
LambdaForm ::= "lmb" "("SYMBOL*")" Expression;
Setform ::= "set" SYMBOL Expression;

Call ::= SYMBOL Expression*;

Atom ::= NUMBER | STRING | SYMBOL | "true" | "false";

0 comments on commit 2daf53c

Please sign in to comment.