| 1 | <!--
|
|---|
| 2 | build.xml : Ant build file for ABC
|
|---|
| 3 | Author: Stephen F. Siegel, University of Delaware
|
|---|
| 4 | Last modified: 03-Jun-2012
|
|---|
| 5 |
|
|---|
| 6 | The following can be defined on command line with -Dprop=val:
|
|---|
| 7 | revision. This is for the use of our SVN commit hook, which
|
|---|
| 8 | runs the test suite and performs other tasks every time a commit
|
|---|
| 9 | is made. The SVN revision number is just used here to insert
|
|---|
| 10 | into reports.
|
|---|
| 11 | -->
|
|---|
| 12 |
|
|---|
| 13 | <project name="ABC" default="compile"
|
|---|
| 14 | xmlns:jacoco="antlib:org.jacoco.ant">
|
|---|
| 15 | <import file="../../common.xml" />
|
|---|
| 16 |
|
|---|
| 17 | <!-- Properties -->
|
|---|
| 18 | <property name="src.dir" value="${abc.src.dir}" />
|
|---|
| 19 | <property name="bin.dir" value="${abc.bin.dir}" />
|
|---|
| 20 | <property name="c.real.src.dir"
|
|---|
| 21 | value="${src.dir}/dev/civl/abc/front/c" />
|
|---|
| 22 | <property name="fortran.old.src.dir"
|
|---|
| 23 | value="${src.dir}/dev/civl/abc/front/fortran/old" />
|
|---|
| 24 | <property name="fortran.src.dir"
|
|---|
| 25 | value="${src.dir}/dev/civl/abc/front/fortran" />
|
|---|
| 26 | <property name="c.grammar.dir"
|
|---|
| 27 | value="${abc.dir}/grammar/c" />
|
|---|
| 28 | <property name="fortran.old.grammar.dir"
|
|---|
| 29 | value="${abc.dir}/grammar/fortran" />
|
|---|
| 30 | <property name="fortran.grammar.dir" value="${abc.dir}/grammar/mfortran" />
|
|---|
| 31 | <property name="test.src.dir" location="${abc.test.dir}" />
|
|---|
| 32 | <property name="test.bin.root.dir" location="${abc.dir}/bin-test" />
|
|---|
| 33 | <property name="test.bin.dir" location="${test.bin.root.dir}" />
|
|---|
| 34 | <property name="junit.dir" location="${abc.junit.dir}" />
|
|---|
| 35 | <property name="junit.data.dir" location="${junit.dir}/data" />
|
|---|
| 36 | <property name="junit.reports.dir" location="${junit.dir}/reports" />
|
|---|
| 37 | <property name="coverage.dir" location="${abc.coverage.dir}" />
|
|---|
| 38 | <property name="javadoc.dir" value="${abc.javadoc.dir}" />
|
|---|
| 39 | <property name="main-class" value="dev.civl.abc.main.ABC" />
|
|---|
| 40 |
|
|---|
| 41 | <!-- Running ANTLR -->
|
|---|
| 42 |
|
|---|
| 43 | <target name="testFLDep">
|
|---|
| 44 | <uptodate
|
|---|
| 45 | property="testFLUp2Date"
|
|---|
| 46 | srcfile="${fortran.grammar.dir}/MF2018Lexer.g"
|
|---|
| 47 | targetfile="${fortran.src.dir}/preproc/MF2018Lexer.java" />
|
|---|
| 48 | </target>
|
|---|
| 49 |
|
|---|
| 50 | <target name="testFL" depends="testFLDep">
|
|---|
| 51 | <delete file="${fortran.grammar.dir}/MF2018Lexer.tokens" />
|
|---|
| 52 | <touch file="${fortran.grammar.dir}/MF2018Lexer.tokens" />
|
|---|
| 53 | <java
|
|---|
| 54 | classname="org.antlr.Tool"
|
|---|
| 55 | classpathref="antlr3.class.path"
|
|---|
| 56 | fork="true"
|
|---|
| 57 | failonerror="true"
|
|---|
| 58 | dir="${fortran.grammar.dir}">
|
|---|
| 59 | <arg value="-verbose" />
|
|---|
| 60 | <arg value="MF2018Lexer.g" />
|
|---|
| 61 | </java>
|
|---|
| 62 | <move file="${fortran.grammar.dir}/MF2018Lexer.java"
|
|---|
| 63 | todir="${fortran.src.dir}/preproc/" />
|
|---|
| 64 | <delete file="${fortran.src.dir}/preproc/MF2018Lexer.java" />
|
|---|
| 65 | </target>
|
|---|
| 66 |
|
|---|
| 67 | <target name="testFPDep" depends="testFL">
|
|---|
| 68 | </target>
|
|---|
| 69 |
|
|---|
| 70 | <target name="testFP">
|
|---|
| 71 | </target>
|
|---|
| 72 |
|
|---|
| 73 | <target name="testFFE" depends="testFL, testFP">
|
|---|
| 74 | </target>
|
|---|
| 75 |
|
|---|
| 76 | <target name="fParsers" depends="fLexer, fParser, fOMPParser">
|
|---|
| 77 | </target>
|
|---|
| 78 |
|
|---|
| 79 | <!--
|
|---|
| 80 | MFortranLexer.java should be built if MFortranLexer.g
|
|---|
| 81 | is newer than MFortranLexer.java
|
|---|
| 82 | -->
|
|---|
| 83 |
|
|---|
| 84 | <target name="fLexerDependencies">
|
|---|
| 85 | <uptodate property="FortranLexerUpToDate"
|
|---|
| 86 | srcfile="${fortran.grammar.dir}/MFortranLexer.g"
|
|---|
| 87 | targetfile="${fortran.src.dir}/preproc/MFortranLexer.java" />
|
|---|
| 88 | </target>
|
|---|
| 89 |
|
|---|
| 90 | <target name="fLexer" depends="fLexerDependencies" unless="FortranLexerUpToDate">
|
|---|
| 91 | <delete file="${fortran.grammar.dir}/MFortranLexer.tokens" />
|
|---|
| 92 | <touch file="${fortran.grammar.dir}/MFortranLexer.tokens" />
|
|---|
| 93 | <delete file="${fortran.src.dir}/preproc/MFortranLexer.java" />
|
|---|
| 94 | <java classname="org.antlr.Tool" classpathref="antlr3.class.path"
|
|---|
| 95 | fork="true" failonerror="true" dir="${fortran.grammar.dir}">
|
|---|
| 96 | <arg value="-verbose" />
|
|---|
| 97 | <arg value="MFortranLexer.g" />
|
|---|
| 98 | </java>
|
|---|
| 99 | <move file="${fortran.grammar.dir}/MFortranLexer.java"
|
|---|
| 100 | todir="${fortran.src.dir}/preproc/" />
|
|---|
| 101 | </target>
|
|---|
| 102 |
|
|---|
| 103 | <!--
|
|---|
| 104 | MFortranParser08.java should be built if MFortranParser08.g
|
|---|
| 105 | is newer than MFortranParser08.java OR MFortranLexer.java
|
|---|
| 106 | is newer than MFortranParser08.java.
|
|---|
| 107 |
|
|---|
| 108 | BUT: you only want to check if MFortranLexer.java is newer
|
|---|
| 109 | than MFortranParser08.java AFTER the lexer things happens.
|
|---|
| 110 | -->
|
|---|
| 111 |
|
|---|
| 112 | <target name="fParserDependencies" depends="fLexer">
|
|---|
| 113 | <uptodate property="unchangedFortranParser18Grammar"
|
|---|
| 114 | srcfile="${fortran.grammar.dir}/MFortranParser2018.g"
|
|---|
| 115 | targetfile="${fortran.src.dir}/parse/MFortranParser2018.java" />
|
|---|
| 116 | <uptodate property="FortranLexerBeforeFortranParser18"
|
|---|
| 117 | srcfile="${fortran.grammar.dir}/MFortranLexer.tokens"
|
|---|
| 118 | targetfile="${fortran.src.dir}/parse/MFortranParser2018.java" />
|
|---|
| 119 | <condition property="FortranParser18UpToDate">
|
|---|
| 120 | <and>
|
|---|
| 121 | <isset property="unchangedFortranParser18Grammar" />
|
|---|
| 122 | <isset property="FortranLexerBeforeFortranParser18" />
|
|---|
| 123 | </and>
|
|---|
| 124 | </condition>
|
|---|
| 125 | </target>
|
|---|
| 126 |
|
|---|
| 127 | <target name="fParser" depends="fParserDependencies"
|
|---|
| 128 | unless="FortranParser18UpToDate">
|
|---|
| 129 | <delete file="${fortran.grammar.dir}/MFortranParser2018.tokens" />
|
|---|
| 130 | <delete file="${fortran.src.dir}/parse/MFortranParser2018.java" />
|
|---|
| 131 | <java classname="org.antlr.Tool" classpathref="antlr3.class.path"
|
|---|
| 132 | fork="true" failonerror="true" dir="${fortran.grammar.dir}">
|
|---|
| 133 | <arg value="-verbose" />
|
|---|
| 134 | <arg value="MFortranParser2018.g" />
|
|---|
| 135 | </java>
|
|---|
| 136 | <move file="${fortran.grammar.dir}/MFortranParser2018.java"
|
|---|
| 137 | todir="${fortran.src.dir}/parse/" />
|
|---|
| 138 | </target>
|
|---|
| 139 |
|
|---|
| 140 | <!--
|
|---|
| 141 | MFortranOmpLexer is a composite grammar.
|
|---|
| 142 | It is needed only for its tokens. The java file can be
|
|---|
| 143 | thrown away.
|
|---|
| 144 | MFortranOmpLexer.tokens depends on MFortranOmpLexer.g and MFortranParser.tokens.
|
|---|
| 145 | -->
|
|---|
| 146 |
|
|---|
| 147 | <target name="fOmpLexerDependencies" depends="fParser">
|
|---|
| 148 | <uptodate property="unchangedOmpLexerF08Grammar"
|
|---|
| 149 | srcfile="${fortran.grammar.dir}/MFortranOmpLexer.g"
|
|---|
| 150 | targetfile="${fortran.grammar.dir}/MFortranOmpLexer.tokens" />
|
|---|
| 151 | <uptodate property="FortranParserTokensBeforeOmpLexerF08"
|
|---|
| 152 | srcfile="${fortran.src.dir}/parse/MFortranParser2018.java"
|
|---|
| 153 | targetfile="${fortran.grammar.dir}/MFortranOmpLexer.tokens" />
|
|---|
| 154 | <condition property="OmpLexerF08UpToDate">
|
|---|
| 155 | <and>
|
|---|
| 156 | <isset property="unchangedOmpLexerF08Grammar" />
|
|---|
| 157 | <isset property="FortranParserTokensBeforeOmpLexerF08" />
|
|---|
| 158 | </and>
|
|---|
| 159 | </condition>
|
|---|
| 160 | </target>
|
|---|
| 161 |
|
|---|
| 162 | <target name="fOMPLexer" depends="fOmpLexerDependencies"
|
|---|
| 163 | unless="OmpLexerF08UpToDate">
|
|---|
| 164 | <delete file="${fortran.grammar.dir}/MFortranOmpLexer.tokens" />
|
|---|
| 165 | <touch file="${fortran.grammar.dir}/MFortranOmpLexer.tokens" />
|
|---|
| 166 | <java classname="org.antlr.Tool" classpathref="antlr3.class.path"
|
|---|
| 167 | fork="true" failonerror="true" dir="${fortran.grammar.dir}">
|
|---|
| 168 | <arg value="-verbose" />
|
|---|
| 169 | <arg value="MFortranOmpLexer.g" />
|
|---|
| 170 | </java>
|
|---|
| 171 | <delete file="${fortran.grammar.dir}/MFortranOmpLexer.java" />
|
|---|
| 172 | </target>
|
|---|
| 173 |
|
|---|
| 174 | <!--
|
|---|
| 175 | MFortranOmpParser is a composite grammar.
|
|---|
| 176 | MFortranOmpParser.java depends on MFortranOmpParser.g, OmpLexer.tokens,
|
|---|
| 177 | and MFortranParser.java. It also requires inserting some text
|
|---|
| 178 | at beginning manually.
|
|---|
| 179 | -->
|
|---|
| 180 |
|
|---|
| 181 | <target name="fOmpParserDependencies" depends="fParser, fOMPLexer">
|
|---|
| 182 | <uptodate property="unchangedOmpParserF08Grammar"
|
|---|
| 183 | srcfile="${fortran.grammar.dir}/MFortranOmpParser.g"
|
|---|
| 184 | targetfile="${fortran.src.dir}/parse/MFortranOmpParser.java" />
|
|---|
| 185 | <uptodate property="OmpLexerF08BeforeOmpParserF08"
|
|---|
| 186 | srcfile="${fortran.grammar.dir}/MFortranOmpParser.g"
|
|---|
| 187 | targetfile="${fortran.src.dir}/parse/MFortranOmpParser.java" />
|
|---|
| 188 | <uptodate property="FortranParsersBeforeOmpParserF08"
|
|---|
| 189 | srcfile="${fortran.src.dir}/parse/MFortranParser2018.java"
|
|---|
| 190 | targetfile="${fortran.src.dir}/parse/MFortranOmpParser.java" />
|
|---|
| 191 | <condition property="OmpParserF08UpToDate">
|
|---|
| 192 | <and>
|
|---|
| 193 | <isset property="unchangedOmpParserF08Grammar" />
|
|---|
| 194 | <isset property="OmpLexerF08BeforeOmpParserF08" />
|
|---|
| 195 | <isset property="FortranParsersBeforeOmpParserF08" />
|
|---|
| 196 | </and>
|
|---|
| 197 | </condition>
|
|---|
| 198 | </target>
|
|---|
| 199 |
|
|---|
| 200 | <target name="fOMPParser" depends="fOmpParserDependencies"
|
|---|
| 201 | unless="OmpParserF08UpToDate">
|
|---|
| 202 | <delete file="${fortran.grammar.dir}/MFortranOmpParser.tokens" />
|
|---|
| 203 | <delete file="${fortran.grammar.dir}/parse/MFortranOmpParser.java" />
|
|---|
| 204 | <java classname="org.antlr.Tool" classpathref="antlr3.class.path"
|
|---|
| 205 | fork="true" failonerror="true" dir="${fortran.grammar.dir}">
|
|---|
| 206 | <arg value="-verbose" />
|
|---|
| 207 | <arg value="MFortranOmpParser.g" />
|
|---|
| 208 | </java>
|
|---|
| 209 | <move file="${fortran.grammar.dir}/MFortranOmpParser.java"
|
|---|
| 210 | tofile="${fortran.grammar.dir}/MFortranOmpParser_2.java" />
|
|---|
| 211 | <echo message="package
|
|---|
| 212 | dev.civl.abc.front.fortran.parse;${line.separator}import
|
|---|
| 213 | dev.civl.abc.front.IF.RuntimeParseException;${line.separator}import
|
|---|
| 214 | dev.civl.abc.front.fortran.preproc.*;${line.separator}${line.separator}"
|
|---|
| 215 | file="${fortran.grammar.dir}/MFortranOmpParser.java" />
|
|---|
| 216 | <concat destfile="${fortran.grammar.dir}/MFortranOmpParser.java"
|
|---|
| 217 | append="true">
|
|---|
| 218 | <filelist dir="${fortran.grammar.dir}" files="MFortranOmpParser_2.java" />
|
|---|
| 219 | </concat>
|
|---|
| 220 | <delete file="${fortran.grammar.dir}/MFortranOmpParser_2.java" />
|
|---|
| 221 | <move file="${fortran.grammar.dir}/MFortranOmpParser.java"
|
|---|
| 222 | todir="${fortran.src.dir}/parse/" />
|
|---|
| 223 | </target>
|
|---|
| 224 |
|
|---|
| 225 | <target name="cParsers"
|
|---|
| 226 | depends="CPreprocessorExpressionParser,CivlCParser,OmpParser, AcslParser">
|
|---|
| 227 | </target>
|
|---|
| 228 |
|
|---|
| 229 | <!--
|
|---|
| 230 | PreprocessorLexer.java should be built if PreprocessorLexer.g
|
|---|
| 231 | is newer than PreprocessorLexer.java
|
|---|
| 232 | -->
|
|---|
| 233 |
|
|---|
| 234 | <target name="CPreprocessorLexerDependencies">
|
|---|
| 235 | <uptodate property="CPreprocessorLexerUpToDate"
|
|---|
| 236 | srcfile="${c.grammar.dir}/PreprocessorLexer.g"
|
|---|
| 237 | targetfile="${c.real.src.dir}/preproc/PreprocessorLexer.java" />
|
|---|
| 238 | </target>
|
|---|
| 239 |
|
|---|
| 240 | <target name="CPreprocessorLexer"
|
|---|
| 241 | depends="CPreprocessorLexerDependencies"
|
|---|
| 242 | unless="CPreprocessorLexerUpToDate">
|
|---|
| 243 | <delete file="${c.grammar.dir}/PreprocessorLexer.tokens" />
|
|---|
| 244 | <delete file="${c.real.src.dir}/preproc/PreprocessorLexer.java" />
|
|---|
| 245 | <java classname="org.antlr.Tool" classpathref="antlr3.class.path"
|
|---|
| 246 | fork="true" failonerror="true" dir="${c.grammar.dir}">
|
|---|
| 247 | <arg value="-verbose" />
|
|---|
| 248 | <arg value="PreprocessorLexer.g" />
|
|---|
| 249 | </java>
|
|---|
| 250 | <move file="${c.grammar.dir}/PreprocessorLexer.java"
|
|---|
| 251 | todir="${c.real.src.dir}/preproc/" />
|
|---|
| 252 | </target>
|
|---|
| 253 |
|
|---|
| 254 | <!--
|
|---|
| 255 | PreprocessorParser.java should be built if PreprocessorParser.g
|
|---|
| 256 | is newer than PreprocessorParser.java OR PreprocessorLexer.java
|
|---|
| 257 | is newer than PreprocessorParser.java.
|
|---|
| 258 |
|
|---|
| 259 | BUT: you only want to check if PreprocessorLexer.java is newer
|
|---|
| 260 | than PreprocessorParser.java AFTER the lexer things happens.
|
|---|
| 261 | -->
|
|---|
| 262 |
|
|---|
| 263 | <target name="CPreprocessorParserDependencies" depends="CPreprocessorLexer">
|
|---|
| 264 | <uptodate property="unchangedCPreprocessorParserGrammar"
|
|---|
| 265 | srcfile="${c.grammar.dir}/PreprocessorParser.g"
|
|---|
| 266 | targetfile="${c.real.src.dir}/preproc/PreprocessorParser.java" />
|
|---|
| 267 | <uptodate property="CPreprocessorLexerBeforePreprocessorParser"
|
|---|
| 268 | srcfile="${c.grammar.dir}/PreprocessorLexer.g"
|
|---|
| 269 | targetfile="${c.real.src.dir}/preproc/PreprocessorParser.java" />
|
|---|
| 270 | <condition property="CPreprocessorParserUpToDate">
|
|---|
| 271 | <and>
|
|---|
| 272 | <isset property="unchangedCPreprocessorParserGrammar" />
|
|---|
| 273 | <isset property="CPreprocessorLexerBeforePreprocessorParser" />
|
|---|
| 274 | </and>
|
|---|
| 275 | </condition>
|
|---|
| 276 | </target>
|
|---|
| 277 |
|
|---|
| 278 | <target name="CPreprocessorParser"
|
|---|
| 279 | depends="CPreprocessorParserDependencies"
|
|---|
| 280 | unless="CPreprocessorParserUpToDate">
|
|---|
| 281 | <delete file="${c.grammar.dir}/PreprocessorParser.tokens" />
|
|---|
| 282 | <delete file="${c.real.src.dir}/preproc/PreprocessorParser.java" />
|
|---|
| 283 | <java classname="org.antlr.Tool" classpathref="antlr3.class.path"
|
|---|
| 284 | fork="true" failonerror="true" dir="${c.grammar.dir}">
|
|---|
| 285 | <arg value="-verbose" />
|
|---|
| 286 | <arg value="PreprocessorParser.g" />
|
|---|
| 287 | </java>
|
|---|
| 288 | <move file="${c.grammar.dir}/PreprocessorParser.java"
|
|---|
| 289 | todir="${c.real.src.dir}/preproc" />
|
|---|
| 290 | </target>
|
|---|
| 291 |
|
|---|
| 292 | <!--
|
|---|
| 293 | PreprocessorExpressionParser.java should be built if
|
|---|
| 294 | PreprocessorExpressionParser.g is newer than
|
|---|
| 295 | PreprocessorExpressionParser.java OR PreprocessorLexer.java is
|
|---|
| 296 | newer than PreprocessorExpressionParser.java.
|
|---|
| 297 | -->
|
|---|
| 298 |
|
|---|
| 299 | <target name="CPreprocessorExpressionParserDependencies"
|
|---|
| 300 | depends="CPreprocessorLexer">
|
|---|
| 301 | <uptodate property="unchangedCPreprocessorExpressionParserGrammar"
|
|---|
| 302 | srcfile="${c.grammar.dir}/PreprocessorExpressionParser.g"
|
|---|
| 303 | targetfile="${c.real.src.dir}/preproc/PreprocessorExpressionParser.java" />
|
|---|
| 304 | <uptodate
|
|---|
| 305 | property="CPreprocessorLexerBeforePreprocessorExpressionParser"
|
|---|
| 306 | srcfile="${c.real.src.dir}/preproc/PreprocessorLexer.java"
|
|---|
| 307 | targetfile="${c.real.src.dir}/preproc/PreprocessorExpressionParser.java" />
|
|---|
| 308 | <condition property="CPreprocessorExpressionParserUpToDate">
|
|---|
| 309 | <and>
|
|---|
| 310 | <isset property="unchangedCPreprocessorExpressionParserGrammar" />
|
|---|
| 311 | <isset property="CPreprocessorLexerBeforePreprocessorExpressionParser" />
|
|---|
| 312 | </and>
|
|---|
| 313 | </condition>
|
|---|
| 314 | </target>
|
|---|
| 315 |
|
|---|
| 316 | <target name="CPreprocessorExpressionParser"
|
|---|
| 317 | depends="CPreprocessorExpressionParserDependencies"
|
|---|
| 318 | unless="CPreprocessorExpressionParserUpToDate">
|
|---|
| 319 | <delete file="${c.grammar.dir}/PreprocessorExpressionParser.tokens" />
|
|---|
| 320 | <delete file="${c.real.src.dir}/preproc/PreprocessorExpressionParser.java" />
|
|---|
| 321 | <java classname="org.antlr.Tool" classpathref="antlr3.class.path"
|
|---|
| 322 | fork="true" failonerror="true" dir="${c.grammar.dir}">
|
|---|
| 323 | <arg value="-verbose" />
|
|---|
| 324 | <arg value="PreprocessorExpressionParser.g" />
|
|---|
| 325 | </java>
|
|---|
| 326 | <move file="${c.grammar.dir}/PreprocessorExpressionParser.java"
|
|---|
| 327 | todir="${c.real.src.dir}/preproc" />
|
|---|
| 328 | </target>
|
|---|
| 329 |
|
|---|
| 330 | <!--
|
|---|
| 331 | CivlCParser.java depends on CivlCParser.g and PreprocessorParser.java
|
|---|
| 332 | -->
|
|---|
| 333 |
|
|---|
| 334 | <target name="CivlCParserDependencies" depends="CPreprocessorParser">
|
|---|
| 335 | <uptodate property="unchangedCivlCParserGrammar"
|
|---|
| 336 | srcfile="${c.grammar.dir}/CivlCParser.g"
|
|---|
| 337 | targetfile="${c.real.src.dir}/parse/CivlCParser.java" />
|
|---|
| 338 | <uptodate property="PreprocessorParserBeforeCivlCParser"
|
|---|
| 339 | srcfile="${c.real.src.dir}/preproc/PreprocessorParser.java"
|
|---|
| 340 | targetfile="${c.real.src.dir}/parse/CivlCParser.java" />
|
|---|
| 341 | <condition property="CivlCParserUpToDate">
|
|---|
| 342 | <and>
|
|---|
| 343 | <isset property="unchangedCivlCParserGrammar" />
|
|---|
| 344 | <isset property="PreprocessorParserBeforeCivlCParser" />
|
|---|
| 345 | </and>
|
|---|
| 346 | </condition>
|
|---|
| 347 | </target>
|
|---|
| 348 |
|
|---|
| 349 | <target name="CivlCParser" depends="CivlCParserDependencies"
|
|---|
| 350 | unless="CivlCParserUpToDate">
|
|---|
| 351 | <delete file="${c.grammar.dir}/CivlCParser.tokens" />
|
|---|
| 352 | <delete file="${c.real.src.dir}/parse/CivlCParser.java" />
|
|---|
| 353 | <java classname="org.antlr.Tool" classpathref="antlr3.class.path"
|
|---|
| 354 | fork="true" failonerror="true" dir="${c.grammar.dir}">
|
|---|
| 355 | <arg value="-verbose" />
|
|---|
| 356 | <arg value="CivlCParser.g" />
|
|---|
| 357 | </java>
|
|---|
| 358 | <move file="${c.grammar.dir}/CivlCParser.java"
|
|---|
| 359 | todir="${c.real.src.dir}/parse" />
|
|---|
| 360 | </target>
|
|---|
| 361 |
|
|---|
| 362 | <!--
|
|---|
| 363 | OmpLexer is a composite grammar. It is needed only for its
|
|---|
| 364 | tokens. The java file can be thrown away. OmpLexer.tokens
|
|---|
| 365 | depends on OmpLexer.g and CivlCParser.tokens.
|
|---|
| 366 | -->
|
|---|
| 367 |
|
|---|
| 368 | <target name="OmpLexerDependencies" depends="CivlCParser">
|
|---|
| 369 | <uptodate property="unchangedOmpLexerGrammar"
|
|---|
| 370 | srcfile="${c.grammar.dir}/OmpLexer.g"
|
|---|
| 371 | targetfile="${c.grammar.dir}/OmpLexer.tokens" />
|
|---|
| 372 | <uptodate property="CivlCParserTokensBeforeOmpLexer"
|
|---|
| 373 | srcfile="${c.real.src.dir}/parse/CivlCParser.java"
|
|---|
| 374 | targetfile="${c.grammar.dir}/OmpLexer.tokens" />
|
|---|
| 375 | <condition property="OmpLexerUpToDate">
|
|---|
| 376 | <and>
|
|---|
| 377 | <isset property="unchangedOmpLexerGrammar" />
|
|---|
| 378 | <isset property="CivlCParserTokensBeforeOmpLexer" />
|
|---|
| 379 | </and>
|
|---|
| 380 | </condition>
|
|---|
| 381 | </target>
|
|---|
| 382 |
|
|---|
| 383 | <target name="OmpLexer" depends="OmpLexerDependencies"
|
|---|
| 384 | unless="OmpLexerUpToDate">
|
|---|
| 385 | <delete file="${c.grammar.dir}/OmpLexer.tokens" />
|
|---|
| 386 | <java classname="org.antlr.Tool" classpathref="antlr3.class.path"
|
|---|
| 387 | fork="true" failonerror="true" dir="${c.grammar.dir}">
|
|---|
| 388 | <arg value="-verbose" />
|
|---|
| 389 | <arg value="OmpLexer.g" />
|
|---|
| 390 | </java>
|
|---|
| 391 | <delete file="${c.grammar.dir}/OmpLexer.java" />
|
|---|
| 392 | </target>
|
|---|
| 393 |
|
|---|
| 394 | <!--
|
|---|
| 395 | OmpParser is a composite grammar. OmpParser.java depends on
|
|---|
| 396 | OmpParser.g, OmpLexer.tokens, and CivlCParser.java. It also
|
|---|
| 397 | requires inserting some text at beginning manually.
|
|---|
| 398 | -->
|
|---|
| 399 |
|
|---|
| 400 | <target name="OmpParserDependencies" depends="OmpLexer,CivlCParser">
|
|---|
| 401 | <uptodate property="unchangedOmpParserGrammar"
|
|---|
| 402 | srcfile="${c.grammar.dir}/OmpParser.g"
|
|---|
| 403 | targetfile="${c.real.src.dir}/parse/OmpParser.java" />
|
|---|
| 404 | <uptodate property="OmpLexerBeforeOmpParser"
|
|---|
| 405 | srcfile="${c.grammar.dir}/OmpLexer.g"
|
|---|
| 406 | targetfile="${c.real.src.dir}/parse/OmpParser.java" />
|
|---|
| 407 | <uptodate property="CivlCParserBeforeOmpParser"
|
|---|
| 408 | srcfile="${c.real.src.dir}/parse/CivlCParser.java"
|
|---|
| 409 | targetfile="${c.real.src.dir}/parse/OmpParser.java" />
|
|---|
| 410 | <condition property="OmpParserUpToDate">
|
|---|
| 411 | <and>
|
|---|
| 412 | <isset property="unchangedOmpParserGrammar" />
|
|---|
| 413 | <isset property="OmpLexerBeforeOmpParser" />
|
|---|
| 414 | <isset property="CivlCParserBeforeOmpParser" />
|
|---|
| 415 | </and>
|
|---|
| 416 | </condition>
|
|---|
| 417 | </target>
|
|---|
| 418 |
|
|---|
| 419 | <target name="OmpParser" depends="OmpParserDependencies"
|
|---|
| 420 | unless="OmpParserUpToDate">
|
|---|
| 421 | <delete file="${c.grammar.dir}/OmpParser.tokens" />
|
|---|
| 422 | <delete file="${c.real.src.dir}/parse/OmpParser.java" />
|
|---|
| 423 | <delete file="${c.real.src.dir}/parse/OmpParser_CivlCParser.java" />
|
|---|
| 424 | <java classname="org.antlr.Tool" classpathref="antlr3.class.path"
|
|---|
| 425 | fork="true" failonerror="true" dir="${c.grammar.dir}">
|
|---|
| 426 | <arg value="-verbose" />
|
|---|
| 427 | <arg value="OmpParser.g" />
|
|---|
| 428 | </java>
|
|---|
| 429 | <move file="${c.grammar.dir}/OmpParser.java"
|
|---|
| 430 | tofile="${c.grammar.dir}/OmpParser2.java" />
|
|---|
| 431 | <echo message="package
|
|---|
| 432 | dev.civl.abc.front.c.parse;${line.separator}import
|
|---|
| 433 | dev.civl.abc.front.IF.RuntimeParseException;${line.separator}import
|
|---|
| 434 | dev.civl.abc.front.c.preproc.*;${line.separator}${line.separator}"
|
|---|
| 435 | file="${c.grammar.dir}/OmpParser.java" />
|
|---|
| 436 | <concat destfile="${c.grammar.dir}/OmpParser.java" append="true">
|
|---|
| 437 | <filelist dir="${c.grammar.dir}" files="OmpParser2.java" />
|
|---|
| 438 | </concat>
|
|---|
| 439 | <delete file="${c.grammar.dir}/OmpParser2.java" />
|
|---|
| 440 | <move file="${c.grammar.dir}/OmpParser.java"
|
|---|
| 441 | todir="${c.real.src.dir}/parse" />
|
|---|
| 442 | <move file="${c.grammar.dir}/OmpParser_CivlCParser.java"
|
|---|
| 443 | todir="${c.real.src.dir}/parse" />
|
|---|
| 444 | </target>
|
|---|
| 445 |
|
|---|
| 446 | <!--
|
|---|
| 447 | AcslParser is the parser for ACSL contracts. AcslParser.java
|
|---|
| 448 | depends on AcslParser.g, AcslLexer.tokens, and AcslLexer.java.
|
|---|
| 449 | -->
|
|---|
| 450 |
|
|---|
| 451 | <target name="AcslParserDependencies" depends="CPreprocessorParser">
|
|---|
| 452 | <uptodate property="unchangedAcslParserGrammar"
|
|---|
| 453 | srcfile="${c.grammar.dir}/AcslParser.g"
|
|---|
| 454 | targetfile="${c.real.src.dir}/parse/AcslParser.java" />
|
|---|
| 455 | <uptodate property="CPreprocessorParserBeforeAcslParser"
|
|---|
| 456 | srcfile="${c.real.src.dir}/preproc/PreprocessorParser.java"
|
|---|
| 457 | targetfile="${c.real.src.dir}/parse/AcslParser.java" />
|
|---|
| 458 | <condition property="AcslParserUpToDate">
|
|---|
| 459 | <and>
|
|---|
| 460 | <isset property="unchangedAcslParserGrammar" />
|
|---|
| 461 | <isset property="CPreprocessorParserBeforeAcslParser" />
|
|---|
| 462 | </and>
|
|---|
| 463 | </condition>
|
|---|
| 464 | </target>
|
|---|
| 465 |
|
|---|
| 466 | <target name="AcslParser" depends="AcslParserDependencies"
|
|---|
| 467 | unless="AcslParserUpToDate">
|
|---|
| 468 | <delete file="${c.grammar.dir}/AcslParser.tokens" />
|
|---|
| 469 | <delete file="${c.real.src.dir}/parse/AcslParser.java" />
|
|---|
| 470 | <java classname="org.antlr.Tool" classpathref="antlr3.class.path"
|
|---|
| 471 | fork="true" failonerror="true" dir="${c.grammar.dir}">
|
|---|
| 472 | <arg value="-verbose" />
|
|---|
| 473 | <arg value="AcslParser.g" />
|
|---|
| 474 | </java>
|
|---|
| 475 | <move file="${c.grammar.dir}/AcslParser.java"
|
|---|
| 476 | tofile="${c.real.src.dir}/parse/AcslParser.java" />
|
|---|
| 477 | </target>
|
|---|
| 478 |
|
|---|
| 479 | <!-- Source compilation -->
|
|---|
| 480 |
|
|---|
| 481 | <target name="dependencies" description="Compile SARL module.">
|
|---|
| 482 | <ant dir="${sarl.dir}" target="compile" inheritAll="false" />
|
|---|
| 483 | </target>
|
|---|
| 484 |
|
|---|
| 485 | <target name="compile" depends="cParsers,fParsers,dependencies"
|
|---|
| 486 | description="Compile all Java source files for ABC.">
|
|---|
| 487 | <mkdir dir="${bin.dir}" />
|
|---|
| 488 | <javac release="${javaversion}" debug="true"
|
|---|
| 489 | srcdir="${src.dir}" destdir="${bin.dir}"
|
|---|
| 490 | encoding="UTF-8" includeantruntime="false">
|
|---|
| 491 | <modulepath>
|
|---|
| 492 | <pathelement path="${sarl.bin.dir}" />
|
|---|
| 493 | <pathelement location="${antlr3.runtime.mod.jar.path}" />
|
|---|
| 494 | </modulepath>
|
|---|
| 495 | </javac>
|
|---|
| 496 | <copy todir="${bin.dir}/dev/civl/abc/include">
|
|---|
| 497 | <fileset dir="${src.dir}/dev/civl/abc/include" />
|
|---|
| 498 | </copy>
|
|---|
| 499 | </target>
|
|---|
| 500 |
|
|---|
| 501 | <!-- JUnit tests and Jacoco coverage analysis -->
|
|---|
| 502 |
|
|---|
| 503 | <path id="test.compile.classpath">
|
|---|
| 504 | <pathelement location="${test.src.dir}" />
|
|---|
| 505 | <pathelement location="${bin.dir}" />
|
|---|
| 506 | <pathelement location="${sarl.bin.dir}" />
|
|---|
| 507 | <pathelement location="${junit.jar}" />
|
|---|
| 508 | <pathelement location="${hamcrest.jar}" />
|
|---|
| 509 | <pathelement location="${antlr3.runtime.jar}" />
|
|---|
| 510 | </path>
|
|---|
| 511 |
|
|---|
| 512 | <path id="test.execute.classpath">
|
|---|
| 513 | <pathelement location="${test.bin.dir}" />
|
|---|
| 514 | <pathelement location="${bin.dir}" />
|
|---|
| 515 | <pathelement location="${root.dir}" />
|
|---|
| 516 | <pathelement location="${sarl.bin.dir}" />
|
|---|
| 517 | <pathelement location="${junit.jar}" />
|
|---|
| 518 | <pathelement location="${hamcrest.jar}" />
|
|---|
| 519 | <pathelement location="${antlr3.runtime.jar}" />
|
|---|
| 520 | <pathelement location="${src.dir}" /> <!-- why? -->
|
|---|
| 521 | </path>
|
|---|
| 522 |
|
|---|
| 523 | <target name="test-init">
|
|---|
| 524 | <delete dir="${junit.dir}" quiet="true" />
|
|---|
| 525 | <delete dir="${test.bin.dir}" quiet="true" />
|
|---|
| 526 | <mkdir dir="${junit.dir}" />
|
|---|
| 527 | <mkdir dir="${junit.data.dir}" />
|
|---|
| 528 | <mkdir dir="${junit.reports.dir}" />
|
|---|
| 529 | <mkdir dir="${test.bin.dir}" />
|
|---|
| 530 | </target>
|
|---|
| 531 |
|
|---|
| 532 | <target name="test-compile" depends="compile,test-init">
|
|---|
| 533 | <javac release="${javaversion}" destdir="${test.bin.dir}"
|
|---|
| 534 | debug="true" failonerror="false"
|
|---|
| 535 | classpathref="test.compile.classpath"
|
|---|
| 536 | encoding="UTF-8" includeantruntime="true">
|
|---|
| 537 | <src path="${test.src.dir}" />
|
|---|
| 538 | </javac>
|
|---|
| 539 | </target>
|
|---|
| 540 |
|
|---|
| 541 | <target name="test-run" depends="test-compile">
|
|---|
| 542 | <jacoco:coverage destfile="${abc.dir}/jacoco.exec">
|
|---|
| 543 | <junit dir="${abc.dir}" fork="true" forkmode="once" timeout="300000">
|
|---|
| 544 | <jvmarg value="-ea" />
|
|---|
| 545 | <classpath refid="test.execute.classpath" />
|
|---|
| 546 | <formatter type="brief" usefile="false" />
|
|---|
| 547 | <formatter type="xml" />
|
|---|
| 548 | <batchtest todir="${junit.data.dir}">
|
|---|
| 549 | <fileset dir="${test.bin.dir}" includes="**/*Test.class" />
|
|---|
| 550 | </batchtest>
|
|---|
| 551 | </junit>
|
|---|
| 552 | </jacoco:coverage>
|
|---|
| 553 | <junitreport todir="${junit.data.dir}">
|
|---|
| 554 | <fileset dir="${junit.data.dir}">
|
|---|
| 555 | <include name="TEST-*.xml" />
|
|---|
| 556 | </fileset>
|
|---|
| 557 | <report format="frames" todir="${junit.reports.dir}">
|
|---|
| 558 | <param name="TITLE"
|
|---|
| 559 | expression="JUnit Report for ABC ${civlversion}.${revision}" />
|
|---|
| 560 | </report>
|
|---|
| 561 | </junitreport>
|
|---|
| 562 | </target>
|
|---|
| 563 |
|
|---|
| 564 | <target name="test" depends="test-run">
|
|---|
| 565 | <jacoco:report>
|
|---|
| 566 | <executiondata>
|
|---|
| 567 | <file file="jacoco.exec" />
|
|---|
| 568 | </executiondata>
|
|---|
| 569 | <structure name="Test Coverage Report for ABC ${civlversion}.${revision}">
|
|---|
| 570 | <classfiles>
|
|---|
| 571 | <fileset dir="${bin.dir}" />
|
|---|
| 572 | </classfiles>
|
|---|
| 573 | <sourcefiles encoding="UTF-8">
|
|---|
| 574 | <fileset dir="${src.dir}" />
|
|---|
| 575 | </sourcefiles>
|
|---|
| 576 | </structure>
|
|---|
| 577 | <html destdir="coverage" />
|
|---|
| 578 | </jacoco:report>
|
|---|
| 579 | </target>
|
|---|
| 580 |
|
|---|
| 581 | <!-- Javadoc Tasks -->
|
|---|
| 582 |
|
|---|
| 583 | <target name="javadoc">
|
|---|
| 584 | <delete dir="${javadoc.dir}" quiet="true" />
|
|---|
| 585 | <mkdir dir="${javadoc.dir}" />
|
|---|
| 586 | <javadoc destdir="${javadoc.dir}"
|
|---|
| 587 | Overview="${src.dir}/overview.html"
|
|---|
| 588 | author="false" version="true" use="true"
|
|---|
| 589 | windowtitle="ABC ${civlversion}.${revision}"
|
|---|
| 590 | access="public" failonerror="false">
|
|---|
| 591 | <modulepath>
|
|---|
| 592 | <pathelement path="${bin.dir}" />
|
|---|
| 593 | <pathelement path="${sarl.bin.dir}" />
|
|---|
| 594 | <pathelement location="${antlr3.runtime.mod.jar.path}" />
|
|---|
| 595 | </modulepath>
|
|---|
| 596 | <packageset dir="${src.dir}" defaultexcludes="yes">
|
|---|
| 597 | <include name="**/IF" />
|
|---|
| 598 | <include name="**/IF/**" />
|
|---|
| 599 | <include name="dev/civl/abc" />
|
|---|
| 600 | <include name="dev/civl/abc/util" />
|
|---|
| 601 | </packageset>
|
|---|
| 602 | </javadoc>
|
|---|
| 603 | </target>
|
|---|
| 604 |
|
|---|
| 605 | <!-- Clean -->
|
|---|
| 606 |
|
|---|
| 607 | <target name="cleanAcsl" description="Delete all generated ACSL files.">
|
|---|
| 608 | <delete file="${c.grammar.dir}/AcslLexer.tokens" />
|
|---|
| 609 | <delete file="${c.grammar.dir}/AcslParser.tokens" />
|
|---|
| 610 | <delete file="${c.real.src.dir}/parse/AcslParser.java" />
|
|---|
| 611 | </target>
|
|---|
| 612 |
|
|---|
| 613 | <target name="cleanOmp" description="Delete all generated OpenMP files.">
|
|---|
| 614 | <delete file="${c.grammar.dir}/OmpLexer.tokens" />
|
|---|
| 615 | <delete file="${c.real.src.dir}/preproc/OmpLexer.java" />
|
|---|
| 616 | <delete file="${c.real.src.dir}/preproc/OmpLexer_PreprocessorLexer.java" />
|
|---|
| 617 | <delete file="${c.grammar.dir}/OmpParser.tokens" />
|
|---|
| 618 | <delete file="${c.real.src.dir}/parse/OmpParser.java" />
|
|---|
| 619 | <delete file="${c.real.src.dir}/parse/OmpParser_CivlCParser.java" />
|
|---|
| 620 | <delete file="${fortran.old.grammar.dir}/OmpLexerF08.tokens" />
|
|---|
| 621 | <delete file="${fortran.old.grammar.dir}/OmpParserF08.tokens" />
|
|---|
| 622 | <delete file="${fortran.old.src.dir}/parse/OmpParserF08.java" />
|
|---|
| 623 | <delete file="${fortran.old.src.dir}/parse/OmpParserF08_FortranParserExtras.java" />
|
|---|
| 624 | <delete file="${fortran.old.src.dir}/parse/OmpParserF08_FortranParserExtras_FortranParser08.java" />
|
|---|
| 625 | <delete file="${fortran.grammar.dir}/MFortranOmpLexer.tokens" />
|
|---|
| 626 | <delete file="${fortran.grammar.dir}/MFortranOmpParser.tokens" />
|
|---|
| 627 | <delete file="${fortran.src.dir}/parse/MFortranOmpParser.java" />
|
|---|
| 628 | <delete file="${fortran.src.dir}/parse/MFortranOmpParser_FortranParserExtras.java" />
|
|---|
| 629 | <delete file="${fortran.src.dir}/parse/MFortranOmpParser_FortranParserExtras_FortranParser08.java" />
|
|---|
| 630 | </target>
|
|---|
| 631 |
|
|---|
| 632 | <target name="cleanCivlC"
|
|---|
| 633 | description="Delete all generated files related to CIVL-C Parser"
|
|---|
| 634 | depends="cleanOmp, cleanAcsl">
|
|---|
| 635 | <delete file="${c.grammar.dir}/PreprocessorLexer.tokens" />
|
|---|
| 636 | <delete file="${c.real.src.dir}/preproc/PreprocessorLexer.java" />
|
|---|
| 637 | <delete file="${c.grammar.dir}/PreprocessorParser.tokens" />
|
|---|
| 638 | <delete file="${c.real.src.dir}/preproc/PreprocessorParser.java" />
|
|---|
| 639 | <delete file="${c.grammar.dir}/PreprocessorExpressionParser.tokens" />
|
|---|
| 640 | <delete file="${c.real.src.dir}/preproc/PreprocessorExpressionParser.java" />
|
|---|
| 641 | <delete file="${c.grammar.dir}/CivlCParser.tokens" />
|
|---|
| 642 | <delete file="${c.real.src.dir}/parse/CivlCParser.java" />
|
|---|
| 643 | </target>
|
|---|
| 644 |
|
|---|
| 645 | <target name="cleanFortran"
|
|---|
| 646 | description="Delete all generated files related to Fortran Parser">
|
|---|
| 647 | <delete file="${fortran.old.grammar.dir}/FortranLexer.tokens" />
|
|---|
| 648 | <delete file="${fortran.old.src.dir}/preproc/FortranLexer.java" />
|
|---|
| 649 | <delete file="${fortran.old.grammar.dir}/FortranParser08.tokens" />
|
|---|
| 650 | <delete file="${fortran.old.src.dir}/parse/FortranParser08.java" />
|
|---|
| 651 | <delete file="${fortran.old.grammar.dir}/FortranParserExtras.tokens" />
|
|---|
| 652 | <delete file="${fortran.old.src.dir}/parse/FortranParserExtras.java" />
|
|---|
| 653 | <delete file="${fortran.old.src.dir}/parse/FortranParserExtras_FortranParser08.java" />
|
|---|
| 654 | <delete file="${fortran.grammar.dir}/MFortranLexer.tokens" />
|
|---|
| 655 | <delete file="${fortran.src.dir}/preproc/MFortranLexer.java" />
|
|---|
| 656 | <delete file="${fortran.grammar.dir}/MFortranParser2018.tokens" />
|
|---|
| 657 | <delete file="${fortran.src.dir}/parse/MFortranParser2018.java" />
|
|---|
| 658 | <delete file="${fortran.src.dir}/parse/MFortranParser08.java" />
|
|---|
| 659 | <delete file="${fortran.src.dir}/parse/MFortranParserExtras.java" />
|
|---|
| 660 | <delete file="${fortran.src.dir}/parse/MFortranParserExtras_MFortranParser08.java" />
|
|---|
| 661 | </target>
|
|---|
| 662 |
|
|---|
| 663 | <target name="clean" description="Delete all generated files."
|
|---|
| 664 | depends="clean-default, cleanFortran, cleanCivlC">
|
|---|
| 665 | <delete dir="${bin.dir}" />
|
|---|
| 666 | <delete dir="${test.bin.dir}" />
|
|---|
| 667 | <delete dir="${junit.dir}" />
|
|---|
| 668 | <delete dir="${javadoc.dir}" />
|
|---|
| 669 | <delete dir="${coverage.dir}" />
|
|---|
| 670 | </target>
|
|---|
| 671 |
|
|---|
| 672 | <!-- Do everything -->
|
|---|
| 673 |
|
|---|
| 674 | <target name="all" depends="test,javadoc" />
|
|---|
| 675 |
|
|---|
| 676 | </project>
|
|---|