head	1.7;
access;
symbols
	charm6_1:1.7
	charm_6_0_1:1.7
	charm6_0_1:1.7;
locks; strict;
comment	@# @;


1.7
date	2008.12.16.21.44.00;	author abecker;	state Exp;
branches;
next	1.6;
commitid	CqtWF2eCBBAnQJut;

1.6
date	2008.08.18.20.08.14;	author abecker;	state Exp;
branches;
next	1.5;
commitid	DUeJYDhmCMG2ajft;

1.5
date	2008.06.15.04.19.54;	author abecker;	state Exp;
branches;
next	1.4;
commitid	4t3x6jgMKWLyYZ6t;

1.4
date	2008.06.08.05.12.39;	author abecker;	state Exp;
branches;
next	1.3;
commitid	rHQu2bBmFc9Qu66t;

1.3
date	2008.06.08.05.11.01;	author abecker;	state Exp;
branches;
next	1.2;
commitid	kgg6JnAKv1o2u66t;

1.2
date	2008.06.07.08.51.54;	author abecker;	state Exp;
branches;
next	1.1;
commitid	nvku7ATu3gJ1KZ5t;

1.1
date	2008.06.03.23.35.22;	author abecker;	state Exp;
branches;
next	;
commitid	cTVE68mTkeQ7Ly5t;


desc
@@


1.7
log
@fixed stdlib path and added stdlib target
@
text
@#!/bin/bash

ECHO="true"                        # should we echo the our command to stdout?
CHARJCHOME=${0%${0##*/}}            # location of charjc
ANTLRHOME=$CHARJCHOME/../lib        # location of antlr jars
ANTLR_VERSION="3.1"
ANTLR_CLASSPATH=""

if test "$ANTLR_VERSION" = "3.0"
then
    ANTLRJAR=$ANTLRHOME/antlr-3.0.1.jar
    ANTLR27JAR=$ANTLRHOME/antlr-2.7.7.jar
    ANTLR_RTJAR=$ANTLRHOME/antlr-runtime-3.0.1.jar
    STJAR=$ANTLRHOME/stringtemplate-3.1b1.jar
    ANTLR_CLASSPATH=$ANTLRJAR:$STJAR:$ANTLR_RTJAR:$ANTLR27JAR
fi

if test "$ANTLR_VERSION" = "3.1"
then
    ANTLRJAR=$ANTLRHOME/antlr-3.1b1.jar
    ANTLR27JAR=$ANTLRHOME/antlr-2.7.7.jar
    ANTLR_RTJAR=$ANTLRHOME/antlr-runtime-3.1b1.jar
    STJAR=$ANTLRHOME/stringtemplate-3.1.jar
    ANTLR_CLASSPATH=$ANTLRJAR:$STJAR:$ANTLR_RTJAR:$ANTLR27JAR
fi

JSAP_JAR=$CHARJCHOME/../lib/JSAP-2.1.jar
CHARJ_JAR=$CHARJCHOME/../build/lib/charj.jar
CHARJ_JFLAGS="-classpath $CLASSPATH:$ANTLR_CLASSPATH:$JSAP_JAR:$CHARJ_JAR"

# flag processing
# We need to aggregate all charmc options into one quoted string, while leaving
# the charjc options alone.
VERBOSE=false
CHARMC=$CHARJCHOME../../../../bin/charmc
STDLIB=$CHARJCHOME../src
CHARMC_ARGS=
FILES=
ARGS=
processArgs() {
    while [ ! $# -eq 0 ]
    do
        arg="$1"
        shift

        case "$arg" in
        "-v"|"--verbose")
            VERBOSE=true
            ARGS="$ARGS $arg"
            ;;
        "--AST")
            ARGS="$ARGS $arg"
            ;;
        "--debug")
            ARGS="$ARGS $arg"
            ;;
        "--stdout")
            ARGS="$ARGS $arg"
            ;;
        "--stdlib")
            STDLIB="$1"
            shift
            ;;
        "--lib")
            ARGS="$ARGS $arg $1"
            shift
            ;;
        "--charmc")
            CHARMC="$1"
            shift
            ;;
        *.cj)
            FILES="$FILES $arg"
            ;;
        --*|-*)
            # unrecognized options are passed through to charmc
            CHARMC_ARGS="$CHARMC_ARGS $arg"
            ;;
        esac
    done
    CHARMC="$CHARMC $CHARMC_ARGS"
}

processArgs "$@@"
if test "$ECHO" = "true"
then
    echo "java $CHARJ_JFLAGS charj.Main --charmc \"$CHARMC\" \
    --stdlib $STDLIB $ARGS $FILES"
fi
java $CHARJ_JFLAGS charj.Main --charmc "$CHARMC" --stdlib $STDLIB $ARGS $FILES
@


1.6
log
@major improvements to symbol table
added some type resolution logic
greatly improved efficiency of translation passes
added AST output capability
simplified scope objects
better flow control and less redundancy in main driver
small tweaks to language grammar
@
text
@d36 1
a36 1
STDLIB=$CHARJCHOME../charj/src/
@


1.5
log
@implemented type loader, changed debug output to be more helpful, extended
error message capabilities.
to do: integrate type loading function in semantic tree walk
@
text
@d3 1
a3 1
ECHO="false"                        # should we echo the our command to stdout?
d51 3
@


1.4
log
@turned off gratuitous command echoing
@
text
@d3 3
a5 1
CHARJCHOME=${0%${0##*/}}
a6 1
ANTLRHOME=$CHARJCHOME/../lib
d36 1
d57 8
d66 1
a66 1
            CHARMC="$arg"
d82 6
a87 5
#if test "$VERBOSE" = "true"
#then
#    echo "java $CHARJ_JFLAGS charj.Main $ARGS $FILES"
#fi
java $CHARJ_JFLAGS charj.Main --charmc "$CHARMC" $ARGS $FILES
@


1.3
log
@improved command-line parsing, now passes extra arguments through to charmc
better control of what gets written to stdout, with nicer formatting
@
text
@d72 4
a75 4
if test "$VERBOSE" = "true"
then
    echo "java $CHARJ_JFLAGS charj.Main $ARGS $FILES"
fi
@


1.2
log
@Added temp file writing with call to external charm compiler
@
text
@d31 2
d35 1
d37 1
d47 7
d56 1
a56 1
            CHARMC="$1"
d59 1
a59 1
        *.*)
d61 5
d68 1
d74 1
a74 1
    echo "java $CHARJ_JFLAGS charj.Main $FILES"
d76 1
a76 1
java $CHARJ_JFLAGS charj.Main --charmc $CHARMC $FILES
@


1.1
log
@charj compile script
@
text
@d26 1
d28 1
a28 1
CHARJ_JFLAGS="-classpath $CLASSPATH:$ANTLR_CLASSPATH:$CHARJ_JAR"
d32 1
d44 4
d57 1
a57 1
    echo "java $CHARJ_JFLAGS charj.Main $*"
d59 1
a59 1
java $CHARJ_JFLAGS charj.Main $FILES
@

