Files
kotlin-fork/compiler/frontend/buildLexer.xml
T
Andrey Breslav 0b33877144 Simplified SHEBANG comment detection
* %line & %column removed (zzCurrentPos used instead)
* jflex cmd arguments reverted
2012-05-29 11:41:54 +04:00

52 lines
1.8 KiB
XML

<project name="JetLexer" default="lexer">
<property name="home" value="${basedir}"/>
<!--
This script relies on a custom JFlex that is available in the sources of IntelliJ IDEA Community Edition
put the idea.properties file to the root directory of the frontend module, and put the following property there:
idea.home=../../../idea/src
where "../../../idea/src" is the relative location of the sources of IntelliJ IDEA Community
-->
<property file="${home}/idea.properties"/>
<property name="flex.base" value="${idea.home}/tools/lexer/jflex-1.4"/>
<property name="out.dir" value="${basedir}/tmpout"/>
<macrodef name="flex">
<attribute name="flexfile"/>
<attribute name="destdir"/>
<attribute name="skeleton" default="${idea.home}/tools/lexer/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}/lib/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">
<echo message="${flex.base}"/>
<flex flexfile="${home}/src/org/jetbrains/jet/lexer/Jet.flex"
destdir="${home}//src/org/jetbrains/jet/lexer/"/>
</target>
</project>