Artifact Content
Not logged in

Artifact 7d7a59abebf26f18a772cb20e295db6dc5dbcf21


     1  -----------------------------------------------------------------------------
     2    Polemy 0.1.0
     3                                                   by k.inaba (www.kmonos.net)
     4                                                                  Nov 8, 2010
     5  -----------------------------------------------------------------------------
     6  
     7  
     8  
     9  <<How to Build>>
    10  
    11    - Install DMD
    12        http://www.digitalmars.com/d/2.0/changelog.html
    13      Version 2.050 is recommended. Older and/or newer version may not work.
    14  
    15    - Build
    16        (for Windows) Run build.bat
    17        (for Unix) Run build.sh
    18        or use your favorite build tools upon main.d and polemy/*.d.
    19  
    20    Then you will get the executable "polemy" in the "bin" directory.
    21  
    22  
    23  
    24  <<License>>
    25  
    26    d2stacktrace/*
    27  
    28      is written by Benjamin Thaut and licensed under 2-clause BSD License.
    29      See http://3d.benjamin-thaut.de/?p=15 for the detail.
    30  
    31      (this package is used only for enabling stack-traces during printing exceptions;
    32       it is not used for release builds.)
    33  
    34    polemy/*
    35    main.d
    36  
    37      All the other parts are written by Kazuhiro Inaba and
    38      licensed under NYSL 0.9982 ( http://www.kmonos.net/nysl/ ).
    39  
    40  
    41  
    42  <<How to Use>>
    43  
    44    > polemy
    45        starts REPL
    46  
    47    > polemy foo.pmy
    48        executes foo.pmy
    49  
    50  
    51  
    52  <<Memo of Language Spec>>
    53  
    54  syntax
    55  
    56   E ::= ("var"|"let"|"def"|LAYER) ID "=" E ; E
    57       | "fun" "(" PARAMS ")" "{" E "}"
    58       | E "(" ARGS ")"
    59  
    60       | LAYER "(" E ")"
    61  
    62       | "(" E ")"
    63       | E BINOP E
    64       | "if" "(" E ")" "{" E "}"
    65       | "if" "(" E ")" "{" E "}" "else "{" E "}"
    66       | ("var"|"let"|"def"|LAYER) ID "(" PARAMS ")" "{" E "}"
    67  
    68  ARGS ::= ","-separated E's
    69  PARAMS ::= ","-separated VAR's
    70  LAYER ::= "@" ID
    71  
    72  if-then-else is a syntax sugar for a function call: if( E, fun(){E}, fun(){E} )
    73  binary ops (e.g., E + E) is a syntax sugar: +(E, E)
    74  
    75  comment is "# ... \n"
    76