Artifact 7d7a59abebf26f18a772cb20e295db6dc5dbcf21
-----------------------------------------------------------------------------
Polemy 0.1.0
by k.inaba (www.kmonos.net)
Nov 8, 2010
-----------------------------------------------------------------------------
<<How to Build>>
- Install DMD
http://www.digitalmars.com/d/2.0/changelog.html
Version 2.050 is recommended. Older and/or newer version may not work.
- Build
(for Windows) Run build.bat
(for Unix) Run build.sh
or use your favorite build tools upon main.d and polemy/*.d.
Then you will get the executable "polemy" in the "bin" directory.
<<License>>
d2stacktrace/*
is written by Benjamin Thaut and licensed under 2-clause BSD License.
See http://3d.benjamin-thaut.de/?p=15 for the detail.
(this package is used only for enabling stack-traces during printing exceptions;
it is not used for release builds.)
polemy/*
main.d
All the other parts are written by Kazuhiro Inaba and
licensed under NYSL 0.9982 ( http://www.kmonos.net/nysl/ ).
<<How to Use>>
> polemy
starts REPL
> polemy foo.pmy
executes foo.pmy
<<Memo of Language Spec>>
syntax
E ::= ("var"|"let"|"def"|LAYER) ID "=" E ; E
| "fun" "(" PARAMS ")" "{" E "}"
| E "(" ARGS ")"
| LAYER "(" E ")"
| "(" E ")"
| E BINOP E
| "if" "(" E ")" "{" E "}"
| "if" "(" E ")" "{" E "}" "else "{" E "}"
| ("var"|"let"|"def"|LAYER) ID "(" PARAMS ")" "{" E "}"
ARGS ::= ","-separated E's
PARAMS ::= ","-separated VAR's
LAYER ::= "@" ID
if-then-else is a syntax sugar for a function call: if( E, fun(){E}, fun(){E} )
binary ops (e.g., E + E) is a syntax sugar: +(E, E)
comment is "# ... \n"