Files
kotlin-fork/compiler/frontend/buildLexer.xml
T
Stepan Koltsov 25f71bcd3a skip shebang in the first line
Something like this works now:

===
% PATH="./bin:$PATH" ./sum.ktscript 31 21
31 + 21 = 52

% cat sum.ktscript
#!/usr/bin/env kotlin -script

val a = Integer.parseInt(args[0])
val b = Integer.parseInt(args[1])
println("$a + $b = ${a + b}")
===
2012-05-28 22:59:03 +04:00

55 lines
1.9 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="-charat"/>
<!-- generates invalid code when %line option is on
<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>