blob: c760bf3f5032988c6445432c3039051966b87975 [file] [log] [blame] [edit]
<project name="GrammarLexer" default="lexer">
<property name="home" value="${basedir}"/>
<property name="flex.base" value="${home}/../dependencies/jflex"/>
<property name="out.dir" value="${basedir}/tmpout"/>
<macrodef name="flex">
<attribute name="flexfile"/>
<attribute name="destdir"/>
<attribute name="skeleton" default="${flex.base}/idea-flex.skeleton"/>
<sequential>
<delete dir="${out.dir}"/>
<mkdir dir="${out.dir}"/>
<java classname="JFlex.Main"
jvmargs="-Xmx512M"
fork="true"
failonerror="true">
<arg value="-sliceandcharat"/>
<arg value="-skel"/>
<arg value="@{skeleton}"/>
<arg value="-d"/>
<arg value="${out.dir}"/>
<arg value="@{flexfile}"/>
<classpath>
<pathelement location="${flex.base}/JFlex.jar"/>
</classpath>
</java>
<move todir="@{destdir}">
<fileset dir="${out.dir}">
<include name="*.java"/>
</fileset>
</move>
<delete dir="${out.dir}"/>
</sequential>
</macrodef>
<target name="lexer">
<flex flexfile="${home}/src/org/jetbrains/jet/grammar/Grammar.flex"
destdir="${home}//src/org/jetbrains/jet/grammar/"/>
</target>
</project>