forked from JPMoresmau/eclipsefp
/
build-parser.xml
86 lines (69 loc) · 3.16 KB
/
build-parser.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?xml version="1.0"?>
<!-- ======================================================================
31/10/2005 11:29:37
Builder script for the EclipseFP JParser sub-plugin.
This script controls the build process for the parser, that starts
with the translation from the parser-definition language to Java.
Tools needed:
- ANTLR: The script was originally designed for version 2.7.5,
using later versions should be no big deal.
ANTLR is available at http://www.antlr.org
If you've got the full eclipsefp project, there should be a
org.antlr side-by-side with this one. It includes the
antlr.jar for version 2.7.6, and this script is designed to use that
Jar. If this is your case, you probably just need to run the script.
If you don't wish to obtain that, or if you wish to use a newer
ANTLR version, you can set your CLASSPATH variable to point to
another library. This will take precendence over the included Jar.
- Java Software Development Kit (JDK): you should already have this
in order to run any Ant build. This script was designed and
tested with JDK1.5 (or JDK5.0, if you'd like), but any version
from 1.3 should work
Thiago Arrais
====================================================================== -->
<project name="eclipsefp.haskell.core.jparser " default="default">
<description>
This script controls the build process for the parser, that starts
with the translation from the parser-definition language to Java.
</description>
<property environment="env" />
<property name="antlr.src.dir" location="${basedir}/antlr-src" />
<property name="output.dir" location="${basedir}/src/net/sf/eclipsefp/haskell/core/jparser" />
<property name="antlr.lib" location="../org.antlr/lib/antlr.jar" />
<!-- =================================
target: default
================================= -->
<target name="default"
depends="java-build"
description="Build the Java binaries for the parser and its components" />
<target name="java-build" depends="parser-build" />
<target name="lexer-build">
<antlr target="${antlr.src.dir}/haskell-lexer.g"
outputdirectory="${output.dir}">
<classpath id="antlr.classpath">
<pathelement path="${env.CLASSPATH}"/>
<pathelement location="${antlr.lib}"/>
</classpath>
</antlr>
</target>
<target name="parser-build" depends="lexer-build">
<antlr target="${antlr.src.dir}/haskell-parser.g"
outputdirectory="${output.dir}">
<classpath refid="antlr.classpath" />
</antlr>
</target>
<target name="clean">
<delete>
<fileset dir="${output.dir}">
<include name="HaskellLexer.java"/>
<include name="HaskellLexer.smap"/>
<include name="HaskellLexerTokenTypes.java"/>
<include name="HaskellLexerTokenTypes.txt"/>
<include name="HaskellParser.java"/>
<include name="HaskellParser.smap"/>
<include name="HaskellParserTokenTypes.java"/>
<include name="HaskellParserTokenTypes.txt"/>
</fileset>
</delete>
</target>
</project>