Sophie

Sophie

distrib > Mageia > 5 > i586 > by-pkgid > d6ed6c5147aa2cde3d48cc9fb4d84ac5 > files > 53

ant-antlr3-20110110-11.mga5.noarch.rpm

How to build and run the polydiff example:

Extact the content of the archive polydiff_build.zip into the
polydiff directory of the java/polydiff example.
   
Prerequisites:

1) Java version 1.5 or higher installed
2) Antlr installed
3) Environment variable ANTLR_HOME defined. ANTLR_HOME should
   point to the installation directory of Antlr.
4) At least apache ant version 1.7 or newer correctly installed and working
5) The antlr3 task for antlr has been installed. This usually means
   the ant-antlr3.jar archive has been copied to the apache ant lib directory

Building and running the example:

1) Go into the polydiff directory
2) Type:
   ant all
   
Remarks:

The ANTLR_HOME environment variable is a central
element of the build file. It is being used to
compose a path to the Antlr libraries.
The pattern defined to reference the Antlr libraries
is using wild cards. Therefore no changes of the buid
file should be necessary if a new version of Antlr
is intalled on your computer. Just let ANTLR_HOME
point to the new installation and you are done.
The relevant excerpt of the build file is listed here:

    <!-- Inquire environment variables -->
    <property environment="envList"/>

    <!-- Get environment variable ANTLR_HOME -->
    <property name="antlrHome" value="${envList.ANTLR_HOME}"/>
    
    <!-- Use wildcards in pattern definition -->
    <!-- to be independent of antlr versions -->
    <patternset id="antlr.libs">
        <include name="antlr-*.jar" />
        <include name="stringtemplate-*.jar" />
    </patternset>
    
    <!-- Looking for archives in ANTLR_HOME -->
    <path id="antlr.path">
        <fileset dir="${antlrHome}" casesensitive="yes">
            <patternset refid="antlr.libs" />
        </fileset>
    </path>   
    
The path "antlr.path" is than referenced in the classpath
directive various times.

Another possible point of interest is the jvmarg directive,
which is used in the antlr3 macro definition.
It passes the specified jvm args to the java machine, when Antlr
is executed. In the example below the maximum heap size is set
to 512 Megabytes.

    <jvmarg value="-Xmx512M"/>