This repository has been archived by the owner on Jan 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.xml
executable file
·135 lines (115 loc) · 5.61 KB
/
build.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<project name="PhpParser" basedir="." default="help">
<!-- PROPERTIES *************************************************************-->
<!-- java/javac properties -->
<property name="src.dir" value="src"/>
<property name="src.project.dir" value="${src.dir}/project"/>
<property name="src.spec.dir" value="${src.dir}/spec"/>
<property name="src.jflex.dir" value="${src.dir}/JFlex"/>
<property name="src.cup.dir" value="${src.dir}/java_cup"/>
<property name="build.dir" value="build"/>
<property name="build.java.dir" value="${build.dir}/java"/>
<property name="build.class.dir" value="${build.dir}/class"/>
<property name="lexparse.package" value="at.ac.tuwien.infosys.www.phpparser"/>
<property name="lexparse.dir" value="${build.java.dir}/at/ac/tuwien/infosys/www/phpparser"/>
<property name="javadoc.dir" value="doc/html"/>
<property name="javadoc.lexparse.dir" value="${javadoc.dir}/phpparser"/>
<!-- lexer generator and generated lexer -->
<property name="lexgen.main" value="JFlex.Main"/>
<property name="lexgen.input" value="${src.spec.dir}/php.jflex"/>
<!-- the lexer name is specified with the %class option in the input file -->
<property name="lexer.name" value="PhpLexer"/>
<property name="lexer.source" value="${lexer.name}.java"/>
<property name="lexer.class" value="${lexer.name}.class"/>
<!-- parser generator and generated parser -->
<property name="parsegen.main" value="java_cup.Main"/>
<property name="parsegen.input" value="${src.spec.dir}/php.cup"/>
<!-- CAUTION: when changing this property, consult the parser generator's input file first -->
<property name="parser.name" value="PhpParser"/>
<property name="parser.source" value="${parser.name}.java"/>
<property name="parser.sym.name" value="PhpSymbols"/>
<property name="parser.sym.source" value="${parser.sym.name}.java"/>
<!-- classpath -->
<path id="classpath">
<pathelement location="${build.class.dir}"/>
<!-- -necessary because of JFlex Messages bundle -->
<pathelement location="${src.jflex.dir}"/>
</path>
<!-- TARGETS ****************************************************************-->
<target name="cup" description="Compiles the modified Cup.">
<mkdir dir="${build.class.dir}"/>
<javac srcdir="${src.cup.dir}" destdir="${build.class.dir}" debug="on" includeantruntime="false">
<classpath refid="classpath"/>
</javac>
</target>
<target name="jflex" description="Compiles the modified JFlex.">
<javac srcdir="${src.jflex.dir}" destdir="${build.class.dir}" debug="on" includeantruntime="false">
<classpath refid="classpath"/>
</javac>
</target>
<target name="lexer.source" depends="cup,jflex"
description="Uses the lexer generator to create a Java lexer from the input file.">
<mkdir dir="${lexparse.dir}"/>
<java classname="${lexgen.main}" fork="yes">
<arg value="${lexgen.input}"/>
<arg value="-d"/>
<arg value="${lexparse.dir}"/>
<classpath refid="classpath"/>
</java>
</target>
<target name="parser.source" depends="cup"
description="Uses the parser generator to create a Java parser from the input file.">
<mkdir dir="${lexparse.dir}"/>
<java classname="${parsegen.main}" fork="yes">
<arg value="-parser"/>
<arg value="${parser.name}"/>
<arg value="-symbols"/>
<arg value="${parser.sym.name}"/>
<arg value="-nonterms"/>
<arg value="-expect"/>
<arg value="1"/>
<arg value="${parsegen.input}"/>
<classpath refid="classpath"/>
</java>
<move file="${basedir}/${parser.source}" todir="${lexparse.dir}"/>
<move file="${basedir}/${parser.sym.source}" todir="${lexparse.dir}"/>
</target>
<target name="javac"
description="Internal target for Java development. Doesn't try to generate lexer and parser.">
<mkdir dir="${build.class.dir}"/>
<javac destdir="${build.class.dir}" debug="on" includeantruntime="false">
<src>
<pathelement path="${src.project.dir}"/>
<pathelement path="${build.java.dir}"/>
</src>
<classpath refid="classpath"/>
</javac>
</target>
<target name="javadoc" depends="javac" description="Generates JavaDoc.">
<javadoc destdir="${javadoc.lexparse.dir}" packagenames="${lexparse.package}" Windowtitle="PhpParser 1.0">
<sourcepath>
<pathelement path="${src.project.dir}"/>
<pathelement path="${build.java.dir}"/>
</sourcepath>
<classpath refid="classpath"/>
</javadoc>
</target>
<target name="build" depends="lexer.source,parser.source,javac,javadoc"
description="Builds the whole project together with the generated lexer and parser."/>
<target name="clean" description="Cleans up.">
<delete dir="${build.java.dir}"/>
<delete dir="${build.class.dir}"/>
<delete dir="${graphs.dir}"/>
<delete file="${jar.file}"/>
</target>
<target name="cleanall" depends="clean" description="Cleans up JFlex, Cup and JavaDoc as well.">
<delete dir="${lib.dir}/JFlex"/>
<delete dir="${lib.dir}/java_cup"/>
<delete dir="${javadoc.dir}"/>
</target>
<target name="dist">
<mkdir dir="dist"/>
</target>
<target name="help">
<echo message="You probably want to do 'ant build'. Otherwise, type 'ant -projecthelp' for help."/>
</target>
</project>