strlang

The strlang language features a C-like structure wrapped in a minimalistic syntax.  Its focus is on making manipulation of text strings easy and efficient.

Files
-----

docs/			documentation
docs/report.docx	primary documentation for strlang
tests/			compiler testcases

Makefile		for building the compiler
README.txt		this file
hello.str		sample strlang program
test.sh			runs the testsuite

parser.mly		parser generator
scanner.mll		scanner generator
*.ml			compiler source code

Installation
------------

strlang assumes a UNIX-like environment.  It requires make, bash, diff and several other standard UNIX utilities to build and execute.  It also requires a C++ compiler, including the C++ standard library (STL).  

1). Obtain and install the ocaml 3.1 distribution, hosted at http://caml.inria.fr/.  The ocaml binaries must be added to the $PATH environment variable.

2). Obtain and install the pcre regular expression library, located at http://www.pcre.org/.  If building from source, make sure to enable the C++ wrapper: (./configure --enable-cpp).  The libraries and headers need to be installed in directories in the standard search path (/usr/local/include and /usr/local/lib are usually fine).

3). Obtain and decompress the strlang source distribution.

4). Adjust strlang.ml's cpp_compiler variable if you are using a C++ compiler other than g++.  If PCRE is not installed in the default search path, you may need to change the pcre_* variables as well.

5). From the top-level of the source distribution, type 'make'.

Invocation
----------

$ ./strlang 
usage:
./strlang
        -a file.str                (dump AST of source)
        -c file.str [file.cpp]     (compile to C++)
        -e file.str file.exe       (compile to executable)
        -h                         (display this message)
        -v                         (display version number)

$ ./strlang -e hello.str hello
$ ./hello
Enter your name: Dara H
Hello Dara H!
$

--------------------------

Dara Hazeghi
12/22/11

