1 | <?xml version="1.0"?>
|
---|
2 |
|
---|
3 | <project name="antlr-test" basedir="." default="test1">
|
---|
4 |
|
---|
5 | <property name="tmp.dir" location="antlr.tmp"/>
|
---|
6 |
|
---|
7 |
|
---|
8 | <target name="setup">
|
---|
9 | <mkdir dir="${tmp.dir}"/>
|
---|
10 | </target>
|
---|
11 |
|
---|
12 | <target name="test1">
|
---|
13 | <antlr/>
|
---|
14 | </target>
|
---|
15 |
|
---|
16 | <target name="test2">
|
---|
17 | <antlr target="antlr.g" outputdirectory="${tmp.dir}"/>
|
---|
18 | </target>
|
---|
19 |
|
---|
20 | <target name="test3" depends="setup">
|
---|
21 | <antlr target="antlr.g" outputdirectory="${tmp.dir}"/>
|
---|
22 | </target>
|
---|
23 |
|
---|
24 | <target name="test4" depends="setup">
|
---|
25 | <antlr target="java.g" outputdirectory="${tmp.dir}"/>
|
---|
26 | <antlr dir="${tmp.dir}" target="java.tree.g" outputdirectory="${tmp.dir}"/>
|
---|
27 | </target>
|
---|
28 |
|
---|
29 | <target name="test5" depends="setup">
|
---|
30 | <antlr target="java.tree.g" outputdirectory="${tmp.dir}" fork="yes"/>
|
---|
31 | </target>
|
---|
32 |
|
---|
33 | <target name="test6" depends="setup">
|
---|
34 | <antlr target="java.g" outputdirectory="${tmp.dir}" />
|
---|
35 | <antlr dir="${tmp.dir}"
|
---|
36 | target="java.tree.g"
|
---|
37 | outputdirectory="${tmp.dir}"
|
---|
38 | fork="yes"/>
|
---|
39 | </target>
|
---|
40 |
|
---|
41 | <target name="test7">
|
---|
42 | <antlr target="antlr.xml"/>
|
---|
43 | </target>
|
---|
44 |
|
---|
45 | <target name="test8" depends="setup">
|
---|
46 | <antlr target="extended.calc.g" outputdirectory="${tmp.dir}" glib="non-existant-file.g"/>
|
---|
47 | </target>
|
---|
48 |
|
---|
49 | <target name="test9" depends="setup">
|
---|
50 | <!-- Note that I had to copy the grammars over to the temporary directory. -->
|
---|
51 | <!-- This is because ANTLR expects the super grammar and its generated java -->
|
---|
52 | <!-- files to be in the same directory, which won't be the case if I use -->
|
---|
53 | <!-- the output directory option. -->
|
---|
54 | <copy file="antlr.g" todir="${tmp.dir}"/>
|
---|
55 | <copy file="extended.calc.g" todir="${tmp.dir}"/>
|
---|
56 | <antlr target="${tmp.dir}/antlr.g"/>
|
---|
57 | <antlr target="${tmp.dir}/extended.calc.g" glib="${tmp.dir}/antlr.g"/>
|
---|
58 | </target>
|
---|
59 |
|
---|
60 | <target name="test10" depends="setup">
|
---|
61 | <antlr target="antlr.g" outputdirectory="${tmp.dir}" html="yes"/>
|
---|
62 | </target>
|
---|
63 |
|
---|
64 | <target name="test11" depends="setup">
|
---|
65 | <antlr target="antlr.g" outputdirectory="${tmp.dir}" diagnostic="yes"/>
|
---|
66 | </target>
|
---|
67 |
|
---|
68 | <target name="test12" depends="setup">
|
---|
69 | <antlr target="antlr.g" outputdirectory="${tmp.dir}" trace="yes"/>
|
---|
70 | </target>
|
---|
71 |
|
---|
72 | <target name="test13" depends="setup">
|
---|
73 | <antlr target="antlr.g" outputdirectory="${tmp.dir}" traceLexer="yes" traceParser="yes" traceTreeWalker="yes"/>
|
---|
74 | </target>
|
---|
75 |
|
---|
76 | <!-- test9 will have been run before that -->
|
---|
77 | <target name="noRecompile">
|
---|
78 | <antlr target="${tmp.dir}/extended.calc.g" glib="${tmp.dir}/antlr.g"/>
|
---|
79 | </target>
|
---|
80 |
|
---|
81 | <!-- test9 will have been run before that -->
|
---|
82 | <target name="normalRecompile">
|
---|
83 | <sleep seconds="2"/>
|
---|
84 | <touch file="${tmp.dir}/extended.calc.g"/>
|
---|
85 | <antlr target="${tmp.dir}/extended.calc.g" glib="${tmp.dir}/antlr.g"/>
|
---|
86 | </target>
|
---|
87 |
|
---|
88 | <!-- test9 will have been run before that -->
|
---|
89 | <target name="supergrammarChangeRecompile">
|
---|
90 | <sleep seconds="2"/>
|
---|
91 | <touch file="${tmp.dir}/antlr.g"/>
|
---|
92 | <antlr target="${tmp.dir}/extended.calc.g" glib="${tmp.dir}/antlr.g"/>
|
---|
93 | </target>
|
---|
94 |
|
---|
95 | <target name="cleanup">
|
---|
96 | <delete dir="${tmp.dir}" />
|
---|
97 | <delete file="../../../../../../CalcParserTokenTypes.txt"/>
|
---|
98 | </target>
|
---|
99 |
|
---|
100 | </project>
|
---|