1. Yoshihiro Imai
  2. primitive language

Overview

HTTPS SSH
    Primitive Language in Objective Caml

WHAT DO YOU NEED?
=================

    - Objective Caml version 3.09.3 or later
      (available at http://caml.inria.fr/)


BUILD
=====

  1. $ make


RUN
===
    $ ./primc <filename>

 (example)
    $ ./primc samples/test.prim


BNF
===

  <program> ::= MODULE <ident> ; <vdecl opt> BEGIN <statement list> END <ident> .

  <vdecl> ::= VAR <decl> <decl list>
  <decl> ::= <ident list(',')> : <type> ;
  <type> ::= INT | STRING

  <statement> ::= <ident> := <expr>n
              | IF <relation> THEN <statement list> <else opt> END
              | WHILE <relation> DO <statement list> END
              | <ident> ( <literal> )
  <else> ::= ELSE <statement list>
  <relation> ::= <expr> <relop> <expr>
  <expr> ::= <term> <(<addop> <term>) list>
  <term> ::= <uop opt> <factor> <(<mulop> <factor>) list>
  <factor> ::= <literal>
           | ( <expr> )

  <literal> ::= <ident>
            | <number>
            | <string>

  <relop> ::= <> | < | <= | = | > | >=
  <uop>   ::= + | -
  <addop> ::= + | -
  <mulop> ::= * | /


BUGS REPORT
===========

	yimai.v @ gmail.com


CSNagoya
========

	http://www.jamboree.jp/cs/


REFERENCE
=========

	[冨沢 高明] コンパイラ入門 C#で学ぶ理論と実践 (ソフトウェア実践講座)