1 --- alex-2.0.orig/alex/doc/alex.sgml
2 +++ alex-2.0/alex/doc/alex.sgml
4 <term><option>-g</option></term>
5 <term><option>--ghc</option></term>
7 - <para>Causes Alex to produce a parser which is optimised for
8 - compiling with GHC. The parser will be significantly more
9 + <para>Causes Alex to produce a lexer which is optimised for
10 + compiling with GHC. The lexer will be significantly more
11 efficient, both in terms of the size of the compiled
12 lexer and its runtime.</para>
15 <term><option>-v</option></term>
16 <term><option>--version</option></term>
18 - <para>Be more verbose. This currently doesn't do
19 - anything, but it might in the future.</para>
20 + <para>Print version information on standard output then exit
21 + successfully.</para>
25 --- alex-2.0.orig/alex/doc/alex.1.in
26 +++ alex-2.0/alex/doc/alex.1.in
28 +.TH ALEX 1 "2003-09-09" "Glasgow FP Suite" "Alex Lexical Analyser Generator"
30 +alex \- the lexical analyser generator for Haskell
34 +[\fIOPTION\fR]... \fIfile\fR [\fIOPTION\fR]...
37 +This manual page documents briefly the
42 +This manual page was written for the Debian GNU/Linux distribution
43 +because the original program does not have a manual page. Instead, it
44 +has documentation in various other formats, including DVI, Info and
49 +is a lexical analyser generator system for Haskell. It is similar to the
50 +tool lex or flex for C/C++.
53 +Input files are expected to be of the form
57 +will produce output in
63 +(Chalmers Haskell) the command argument structure is slightly
64 +different. This is because the hbc run time system takes some flags
65 +as its own (for setting things like the heap size, etc). This problem
66 +can be circumvented by adding a single dash (`-') to your command
67 +line. So when using a hbc generated version of Alex, the argument
71 +[\fIOPTION\fR]... \fIfile\fR [\fIOPTION\fR]...
74 +The programs follow the usual GNU command line syntax, with long
75 +options starting with two dashes (`--'). A summary of options is
76 +included below. For a complete description, see the other
80 +.BR \-d ", " \-\-debug
81 +Instructs Alex to generate a lexer which will output debugging messsages
86 +Instructs Alex to generate a lexer which is optimised for compiling with
87 +GHC. The lexer will be significantly more efficient, both in terms of
88 +the size of the compiled lexer and its runtime.
91 +\fB\-o\fR \fIFILE\fR, \fB\-\-outfile=\fIFILE
92 +Specifies the filename in which the output is to be placed. By default,
93 +this is the name of the input file with the
99 +\fB\-i\fR [\fIFILE\fR], \fB\-\-info\fR[=\fIFILE\fR]
100 +Produces a human-readable rendition of the state machine (DFA) that
101 +Alex derives from the lexer, in
105 +where the input file is
109 +The format of the info file is currently a bit basic, and not
110 +particularly informative.
113 +.BR \-v ", " \-\-version
114 +Print version information on standard output then exit successfully.
122 +.UR http://haskell.org/alex/
123 +(http://haskell.org/alex/)
127 +Alex Version @VERSION@
129 +Copyright (c) 1995-2003, Chris Dornan and Simon Marlow
132 +This manual page was written by Ian Lynagh
133 +<igloo@debian.org>, based on the happy manpage, for the Debian GNU/Linux
134 +system (but may be used by others).
136 +.\" Local variables:
139 --- alex-2.0.orig/alex/src/Main.hs
140 +++ alex-2.0/alex/src/Main.hs
145 - prog <- getProgName
146 - die (concat errors ++ usageInfo (usageHeader prog) argInfo)
147 + die (concat errors ++ usageInfo usageHeader argInfo)
149 copyright = "Alex version " ++ version ++ ", (c) 2003 Chris Dornan and Simon Marlow\n"
151 -usageHeader prog = prog ++ " [OPTION...] file"
152 +usageHeader = "alex [OPTION...] file"
154 runAlex cli file = do
155 basename <- case (reverse file) of
156 --- alex-2.0.orig/alex/src/alex.sh
157 +++ alex-2.0/alex/src/alex.sh
162 -*--template*) $ALEXBIN $*;;
163 -*) $ALEXBIN --template $ALEXLIB $*;;
164 +*--template*) $ALEXBIN "$@";;
165 +*) $ALEXBIN --template $ALEXLIB ${1+"$@"};;
167 --- alex-2.0.orig/configure.in
168 +++ alex-2.0/configure.in
174 + HostPlatform=mips-unknown-linux # hack again
175 + TargetPlatform=mips-unknown-linux
176 + BuildPlatform=mips-unknown-linux
177 + HostPlatform_CPP='mips_unknown_linux'
178 + HostArch_CPP='mips'
179 + HostVendor_CPP='unknown'
183 + HostPlatform=hppa-unknown-linux # hack again
184 + TargetPlatform=hppa-unknown-linux
185 + BuildPlatform=hppa-unknown-linux
186 + HostPlatform_CPP='hppa_unknown_linux'
187 + HostArch_CPP='hppa'
188 + HostVendor_CPP='unknown'
192 + HostPlatform=arm-unknown-linux # hack again
193 + TargetPlatform=arm-unknown-linux
194 + BuildPlatform=arm-unknown-linux
195 + HostPlatform_CPP='arm_unknown_linux'
197 + HostVendor_CPP='unknown'
201 HostPlatform=ia64-unknown-linux # hack again
202 TargetPlatform=ia64-unknown-linux
204 HostVendor_CPP='unknown'
208 + HostPlatform=m68k-unknown-linux # hack again
209 + TargetPlatform=m68k-unknown-linux
210 + BuildPlatform=m68k-unknown-linux
211 + HostPlatform_CPP='m68k_unknown_linux'
212 + HostArch_CPP='m68k'
213 + HostVendor_CPP='unknown'
217 HostPlatform_CPP='m68k_next_nextstep2'
220 HostVendor_CPP='apple'
224 + HostPlatform=powerpc-unknown-linux
225 + TargetPlatform=powerpc-unknown-linux
226 + BuildPlatform=powerpc-unknown-linux
227 + HostPlatform_CPP='powerpc_unknown_linux'
228 + HostArch_CPP='powerpc'
229 + HostVendor_CPP='unknown'
233 HostPlatform=sparc-sun-sunos4
234 TargetPlatform=sparc-sun-sunos4 #hack
237 HostOS_CPP='solaris2'
239 +sparc*-unknown-linux*)
240 + HostPlatform=sparc-unknown-linux
241 + TargetPlatform=sparc-unknown-linux
242 + BuildPlatform=sparc-unknown-linux
243 + HostPlatform_CPP='sparc-unknown-linux'
244 + HostArch_CPP='sparc'
245 + HostVendor_CPP='unknown'
249 + HostPlatform=s390-ibm-linux
250 + TargetPlatform=s390-ibm-linux #hack
251 + BuildPlatform=s390-ibm-linux #hack
252 + HostPlatform_CPP='s390_ibm_linux'
253 + HostArch_CPP='s390'
254 + HostVendor_CPP='ibm'
258 echo "Unrecognised platform: $HostPlatform"
261 dnl ** Find lex command (lex or flex) - *doesn't* use autoconf's
262 dnl AC_PROG_LEX, since it doesn't actually check whether 'lex'
263 dnl exists if 'flex' doesn't.
265 +dnl AC_PROG_LEX_STRICT
267 dnl ** figure out how to do a BSD-ish install
269 --- alex-2.0.orig/configure
270 +++ alex-2.0/configure
271 @@ -1598,6 +1598,33 @@
276 + HostPlatform=mips-unknown-linux # hack again
277 + TargetPlatform=mips-unknown-linux
278 + BuildPlatform=mips-unknown-linux
279 + HostPlatform_CPP='mips_unknown_linux'
280 + HostArch_CPP='mips'
281 + HostVendor_CPP='unknown'
285 + HostPlatform=hppa-unknown-linux # hack again
286 + TargetPlatform=hppa-unknown-linux
287 + BuildPlatform=hppa-unknown-linux
288 + HostPlatform_CPP='hppa_unknown_linux'
289 + HostArch_CPP='hppa'
290 + HostVendor_CPP='unknown'
294 + HostPlatform=arm-unknown-linux # hack again
295 + TargetPlatform=arm-unknown-linux
296 + BuildPlatform=arm-unknown-linux
297 + HostPlatform_CPP='arm_unknown_linux'
299 + HostVendor_CPP='unknown'
303 HostPlatform=ia64-unknown-linux # hack again
304 TargetPlatform=ia64-unknown-linux
305 @@ -1607,6 +1634,15 @@
306 HostVendor_CPP='unknown'
310 + HostPlatform=m68k-unknown-linux # hack again
311 + TargetPlatform=m68k-unknown-linux
312 + BuildPlatform=m68k-unknown-linux
313 + HostPlatform_CPP='m68k_unknown_linux'
314 + HostArch_CPP='m68k'
315 + HostVendor_CPP='unknown'
319 HostPlatform_CPP='m68k_next_nextstep2'
321 @@ -1697,6 +1733,15 @@
322 HostVendor_CPP='apple'
326 + HostPlatform=powerpc-unknown-linux
327 + TargetPlatform=powerpc-unknown-linux
328 + BuildPlatform=powerpc-unknown-linux
329 + HostPlatform_CPP='powerpc_unknown_linux'
330 + HostArch_CPP='powerpc'
331 + HostVendor_CPP='unknown'
335 HostPlatform=sparc-sun-sunos4
336 TargetPlatform=sparc-sun-sunos4 #hack
337 @@ -1715,6 +1760,24 @@
339 HostOS_CPP='solaris2'
341 +sparc*-unknown-linux*)
342 + HostPlatform=sparc-unknown-linux
343 + TargetPlatform=sparc-unknown-linux
344 + BuildPlatform=sparc-unknown-linux
345 + HostPlatform_CPP='sparc-unknown-linux'
346 + HostArch_CPP='sparc'
347 + HostVendor_CPP='unknown'
351 + HostPlatform=s390-ibm-linux
352 + TargetPlatform=s390-ibm-linux #hack
353 + BuildPlatform=s390-ibm-linux #hack
354 + HostPlatform_CPP='s390_ibm_linux'
355 + HostArch_CPP='s390'
356 + HostVendor_CPP='ibm'
360 echo "Unrecognised platform: $HostPlatform"
362 @@ -3769,82 +3832,82 @@
366 -# Extract the first word of "flex", so it can be a program name with args.
367 -set dummy flex; ac_word=$2
368 -echo "$as_me:$LINENO: checking for $ac_word" >&5
369 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
370 -if test "${ac_cv_prog_LEX+set}" = set; then
371 - echo $ECHO_N "(cached) $ECHO_C" >&6
373 - if test -n "$LEX"; then
374 - ac_cv_prog_LEX="$LEX" # Let the user override the test.
376 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
380 - test -z "$as_dir" && as_dir=.
381 - for ac_exec_ext in '' $ac_executable_extensions; do
382 - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
383 - ac_cv_prog_LEX="flex"
384 - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
393 -if test -n "$LEX"; then
394 - echo "$as_me:$LINENO: result: $LEX" >&5
395 -echo "${ECHO_T}$LEX" >&6
397 - echo "$as_me:$LINENO: result: no" >&5
398 -echo "${ECHO_T}no" >&6
403 - # Extract the first word of "lex", so it can be a program name with args.
404 -set dummy lex; ac_word=$2
405 -echo "$as_me:$LINENO: checking for $ac_word" >&5
406 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
407 -if test "${ac_cv_prog_LEX+set}" = set; then
408 - echo $ECHO_N "(cached) $ECHO_C" >&6
410 - if test -n "$LEX"; then
411 - ac_cv_prog_LEX="$LEX" # Let the user override the test.
413 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
417 - test -z "$as_dir" && as_dir=.
418 - for ac_exec_ext in '' $ac_executable_extensions; do
419 - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
420 - ac_cv_prog_LEX="lex"
421 - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
430 -if test -n "$LEX"; then
431 - echo "$as_me:$LINENO: result: $LEX" >&5
432 -echo "${ECHO_T}$LEX" >&6
434 - echo "$as_me:$LINENO: result: no" >&5
435 -echo "${ECHO_T}no" >&6
438 - test -z "$LEX" && { { echo "$as_me:$LINENO: error: 'lex' or 'flex' is required to compile GHC." >&5
439 -echo "$as_me: error: 'lex' or 'flex' is required to compile GHC." >&2;}
440 - { (exit 1); exit 1; }; }
442 +## Extract the first word of "flex", so it can be a program name with args.
443 +#set dummy flex; ac_word=$2
444 +#echo "$as_me:$LINENO: checking for $ac_word" >&5
445 +#echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
446 +#if test "${ac_cv_prog_LEX+set}" = set; then
447 +# echo $ECHO_N "(cached) $ECHO_C" >&6
449 +# if test -n "$LEX"; then
450 +# ac_cv_prog_LEX="$LEX" # Let the user override the test.
452 +#as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
453 +#for as_dir in $PATH
456 +# test -z "$as_dir" && as_dir=.
457 +# for ac_exec_ext in '' $ac_executable_extensions; do
458 +# if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
459 +# ac_cv_prog_LEX="flex"
460 +# echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
468 +#LEX=$ac_cv_prog_LEX
469 +#if test -n "$LEX"; then
470 +# echo "$as_me:$LINENO: result: $LEX" >&5
471 +#echo "${ECHO_T}$LEX" >&6
473 +# echo "$as_me:$LINENO: result: no" >&5
474 +#echo "${ECHO_T}no" >&6
479 +# # Extract the first word of "lex", so it can be a program name with args.
480 +#set dummy lex; ac_word=$2
481 +#echo "$as_me:$LINENO: checking for $ac_word" >&5
482 +#echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
483 +#if test "${ac_cv_prog_LEX+set}" = set; then
484 +# echo $ECHO_N "(cached) $ECHO_C" >&6
486 +# if test -n "$LEX"; then
487 +# ac_cv_prog_LEX="$LEX" # Let the user override the test.
489 +#as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
490 +#for as_dir in $PATH
493 +# test -z "$as_dir" && as_dir=.
494 +# for ac_exec_ext in '' $ac_executable_extensions; do
495 +# if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
496 +# ac_cv_prog_LEX="lex"
497 +# echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
505 +#LEX=$ac_cv_prog_LEX
506 +#if test -n "$LEX"; then
507 +# echo "$as_me:$LINENO: result: $LEX" >&5
508 +#echo "${ECHO_T}$LEX" >&6
510 +# echo "$as_me:$LINENO: result: no" >&5
511 +#echo "${ECHO_T}no" >&6
514 +# test -z "$LEX" && { { echo "$as_me:$LINENO: error: 'lex' or 'flex' is required to compile GHC." >&5
515 +#echo "$as_me: error: 'lex' or 'flex' is required to compile GHC." >&2;}
516 +# { (exit 1); exit 1; }; }
520 # Find a good install program. We prefer a C program (faster),
521 --- alex-2.0.orig/debian/rules
522 +++ alex-2.0/debian/rules
525 +# debian/rules for alex
526 +# This file is public domain software, originally written by Joey Hess.
527 +# Adapted for alex by Ian Lynagh.
529 +# Uncomment this to turn on verbose mode.
530 +#export DH_VERBOSE=1
532 +version := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \([^-]*\)-.*/\1/p')
533 +docdir := `pwd`/debian/`dh_listpackages`/usr/share/doc/alex
534 +sgmldocindex := alex.html
541 + ./configure --prefix=/usr
543 + $(MAKE) -C alex/doc ps html
544 + sed -e "s#@LIBDIR@#/usr/lib/alex-$(version)#g" \
545 + -e "s#@DOCDIR@#/usr/share/doc/alex#g" \
546 + -e "s#@VERSION@#$(version)#g" \
547 + alex/doc/alex.1.in > alex/doc/alex.1
548 + echo ".so man1/alex.1" > debian/alex-$(version).1
559 + rm -f alex/doc/alex.1 debian/alex-$(version).1
560 + rm -f mk/config.mk mk/config.h mk/stamp-h
570 + $(MAKE) prefix=`pwd`/debian/`dh_listpackages`/usr install
572 + mkdir -p $(docdir)/{sgml,dvi,ps,html}
573 + cp alex/doc/*.sgml $(docdir)/sgml/
574 + cp alex/doc/*.dvi $(docdir)/dvi/
575 + cp alex/doc/*.ps $(docdir)/ps/
576 + cp -a alex/doc/alex/* $(docdir)/html/
577 + ln -s $(sgmldocindex) $(docdir)/html/index.html
578 + cp -a alex/examples $(docdir)
580 +# Build architecture-independent files here.
581 +binary-indep: build install
584 +# Build architecture-dependent files here.
585 +binary-arch: build install
588 + dh_installchangelogs
594 +# dh_installlogrotate
596 +# dh_installcatalogs
603 + dh_installman debian/alex-$(version).1 alex/doc/alex.1
617 +binary: binary-indep binary-arch
618 +.PHONY: build clean binary-indep binary-arch binary install
620 --- alex-2.0.orig/debian/changelog
621 +++ alex-2.0/debian/changelog
623 +alex (2.0-2) unstable; urgency=low
625 + * Added s390, m68k, mips, hppa, arm and powerpc Linux to configure{,.in}
627 + -- Ian Lynagh (wibble) <igloo@debian.org> Wed, 01 Oct 2003 12:31:01 +0000
629 +alex (2.0-1) unstable; urgency=low
631 + * Initial release. Closes: #151044.
632 + * Changed configure{,.in} to not require flex.
633 + * Wrote manpage for alex(1).
634 + * Fix references to happy/parsers and version/verbose confusion in the docs.
635 + * Changed wrapper to use $@ and ${1+"$@"} rather than $*
636 + * When giving usage info, always use the name "alex" (otherwise
637 + alex.bin is given).
638 + * Add sparc case to configure{,.in}.
640 + -- Ian Lynagh (wibble) <igloo@debian.org> Tue, 09 Sep 2003 15:14:27 +0000
642 --- alex-2.0.orig/debian/control
643 +++ alex-2.0/debian/control
648 +Maintainer: Ian Lynagh (wibble) <igloo@debian.org>
649 +Standards-Version: 3.5.6.0
650 +Build-Depends: debhelper (>= 4), ghc6 | ghc5 (>= 5.04), jade, docbook-utils
654 +Depends: ${shlibs:Depends}
655 +Description: lexical analyser generator for Haskell
656 + Alex is a tool for generating lexical analysers in Haskell, given a
657 + description of the tokens to be recognised in the form of regular
658 + expressions. It is similar to the tool lex or flex for C/C++.
660 --- alex-2.0.orig/debian/compat
661 +++ alex-2.0/debian/compat
664 --- alex-2.0.orig/debian/copyright
665 +++ alex-2.0/debian/copyright
667 +This package was originally debianized by Ian Lynagh <igloo@debian.org>
670 +It was downloaded from
671 +http://www.haskell.org/alex/dist/alex-2.0-src.tar.bz2
673 +Upstream Author: Simon Marlow (simonmar@microsoft.com)
677 +The Glasgow Haskell Compiler License
679 +Copyright 1999, The University Court of the University of Glasgow.
680 +All rights reserved.
682 +Redistribution and use in source and binary forms, with or without
683 +modification, are permitted provided that the following conditions are met:
685 +· Redistributions of source code must retain the above copyright notice,
686 + this list of conditions and the following disclaimer.
688 +· Redistributions in binary form must reproduce the above copyright notice,
689 + this list of conditions and the following disclaimer in the documentation
690 + and/or other materials provided with the distribution.
692 +· Neither name of the University nor the names of its contributors may be
693 + used to endorse or promote products derived from this software without
694 + specific prior written permission.
696 +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF
697 +GLASGOW AND THE CONTRIBUTORS ÄS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
698 +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
699 +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
700 +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE
701 +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
702 +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
703 +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
704 +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
705 +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
706 +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH