/*
 *           TTCN-3 Parser
 *
 *        Installation Guide
 *
 * Copyright (C) 2002 Institute for Telematics
 *
 *    Michael Schmitt <schmitt@itm.mu-luebeck.de>
 *    Roman Koch <rkoch@itm.mu-luebeck.de>
 *    Helmut Neukirchen <neukirchen@itm.mu-luebeck.de>
 *
 *    Medical University of Luebeck,
 *    Ratzeburger Allee 160,
 *    23538 Luebeck,
 *    Germany
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Id: INSTALL,v 1.12 2002/12/03 12:24:37 neukirchen Exp $
 *
 */

Welcome to the TTCN-3 parser!

This file describes how to compile the TTCN-3 parser source code.
If the description below is faulty or lacks some information, please
send a short email to 'neukirchen@itm.mu-luebeck.de'.

Latest sources can be found on: 
http://www.itm.mu-luebeck.de/research/main_projects/projects/single_projects/index.php?lang=en&pj_nr=6

Good luck!

Helmut Neukirchen, Michael Schmitt, Roman Koch

********************************************************************

What you need to compile the TTCN-3 parser source code:

  - ANTLR 2.7.1 (download for free at www.antlr.org)
    (2.7.2 will not work, since AST structures changed a lot.)
  - A java virtual machine and maybe also java compiler (for ANTLR)
    (tested jdk 1.2.2 or 1.3.1, the GNU gcj does not work)

  - An ANSI C++ compiler (e.g., gcc 2.95.3, or Sun CC 5.0/5.1/5.2)
    (gcc 3.x and icc do not work!)
  - A 'Make' tool (e.g., GNU make)
  - The TTCN-3 parser source code (of course :-))

Preparation for ANTLR:

  - Install ANTLR in a directory of your choice,
    e.g. '/home/user/programs/antlr',
    i.e untar the ANTLR package (and follow maybe further instructions of ANTL)

  - Set the Java 'CLASSPATH' to the ANTLR directory.

    In a C shell (csh/tcsh) on UN*X, you have to enter

      setenv CLASSPATH ${CLASSPATH}:/home/user/programs/antlr

    In a Bourne shell (sh/bash), the following commands must be used:

      CLASSPATH=${CLASSPATH}:/home/user/programs/antlr
      export CLASSPATH

    (If you use Windows and Cygwin, note that you better set
    the Java 'CLASSPATH' from within Windows using Windows Syntax
    for filenames, e.g. 'c:\cygwin\home\user\progra~1\antlr'.
    If your experience later on an 
    'Exception in thread "main" java.lang.NoClassDefFoundError: antlr/Tool
     make: *** [.lexer_made] Error 1', your CLASSPATH is wrong!)

  - Set the environment variables CXX and CXXFLAGS according to your
    preferred C++ compiler and its options.

    In a C shell (csh/tcsh), you may select Sun CC as follows:

      setenv CXX CC
      setenv CXXFLAGS "-O +p +w2"

    Alternatively, gcc can be chosen in a Bourne shell by

      CXX=g++; export CXX
      CXXFLAGS="-O -ansi -pedantic -Wall"; export CXXFLAGS

  - Enter directory '/home/user/programs/antlr' and do a
    './configure', 'make antlrall.jar' and 'make'

  - Enter directory '/home/user/programs/antlr/lib/cpp/src' and compile
    all '*.cpp' files (create a '.o' file for each of them)

    Typically, you invoke your compiler like follows:

      ${CXX} ${CXXFLAGS} -c -I.. -I. *.cpp

  - Link all generated '.o' files, i.e. create one big library file.

    When using Sun's CC, you have to invoke

      CC -xar -o libantlr.a *.o

    Object files generated by gcc can be linked with ar:

      ar -rs libantlr.a *.o

  - For convenience, move 'libantlr.a' to subdirectory
    '/home/user/programs/antlr/lib/cpp/antlr'

    NOTE: the current TTCN-3 parser Makefile assumes,
    that under Solaris, Sun's CC is used and the ANTLR library file
    is called 'libantlr.a', in any other case, GNU's g++ is assumed and
    the linux ANTLR library file is called 'libantlr-g++-linux.a',
    under Windows (with cygwin) it is called 'libantlr-g++-cygwin.a'.

Compilation of the TTCN-3 parser:

  - Download the latest source files from the CVS repository and put
    them all in one working directory

  - Make a subdirectory in the working directory which is identical
    to '/home/user/programs/antlr/lib/cpp/antlr'.

    There are two possibilities: Either copy the directory or (preferably)
    make a symbolic link to it:

      ln -s /home/user/programs/antlr/lib/cpp/antlr .

  - Apply the 'Makefile' provided with the TTCN-3 parser by running

      make TTCN3Parser

  - Start the TTCN-3 parser with

      ./TTCN3Parser --help

