From criswell at cs.uiuc.edu Mon Dec 29 11:30:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Dec 29 11:30:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/ Message-ID: <200312291729.LAA03496@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Applications/lambda-0.1.3: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/test/Programs/MultiSource/Applications/lambda-0.1.3 added to the repository --- Diffs of the changes: (+0 -0) From criswell at cs.uiuc.edu Mon Dec 29 11:31:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Dec 29 11:31:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/ Message-ID: <200312291730.LAA03518@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs added to the repository --- Diffs of the changes: (+0 -0) From criswell at cs.uiuc.edu Mon Dec 29 11:31:02 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Dec 29 11:31:02 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config/ Message-ID: <200312291730.LAA03513@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config added to the repository --- Diffs of the changes: (+0 -0) From criswell at cs.uiuc.edu Mon Dec 29 11:38:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Dec 29 11:38:01 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/Makefile.am Makefile.in lambda.html lambdamanual_src.html trans_xml_for_cat.pl user_manual_style.css Message-ID: <200312291737.LAA03643@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs: Makefile.am added (r1.1) Makefile.in added (r1.1) lambda.html added (r1.1) lambdamanual_src.html added (r1.1) trans_xml_for_cat.pl added (r1.1) user_manual_style.css added (r1.1) --- Log message: Adding the C++ program lambda to the test suite. This is a "real" C++ application that currently appears to work on both Linux and Solaris. --- Diffs of the changes: (+2452 -0) Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/Makefile.am diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/Makefile.am:1.1 *** /dev/null Mon Dec 29 11:37:49 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/Makefile.am Mon Dec 29 11:37:39 2003 *************** *** 0 **** --- 1,16 ---- + noinst_DATA= \ + lambdamanual.html \ + trans_xml_for_cat.pl \ + user_manual_style.css \ + lambda.html + + lambdamanual.html: ${srcdir}/lambdamanual_src.html ${srcdir}/trans_xml_for_cat.pl + ${srcdir}/trans_xml_for_cat.pl <${srcdir}/lambdamanual_src.html >lambdamanual.html + + EXTRA_DIST=\ + lambdamanual_src.html \ + trans_xml_for_cat.pl \ + user_manual_style.css \ + lambda.html + + CLEANFILES=lambdamanual.html Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/Makefile.in diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/Makefile.in:1.1 *** /dev/null Mon Dec 29 11:37:49 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/Makefile.in Mon Dec 29 11:37:39 2003 *************** *** 0 **** --- 1,219 ---- + # Makefile.in generated by automake 1.6.3 from Makefile.am. + # @configure_input@ + + # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + # Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY, to the extent permitted by law; without + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + + @SET_MAKE@ + SHELL = @SHELL@ + + srcdir = @srcdir@ + top_srcdir = @top_srcdir@ + VPATH = @srcdir@ + prefix = @prefix@ + exec_prefix = @exec_prefix@ + + bindir = @bindir@ + sbindir = @sbindir@ + libexecdir = @libexecdir@ + datadir = @datadir@ + sysconfdir = @sysconfdir@ + sharedstatedir = @sharedstatedir@ + localstatedir = @localstatedir@ + libdir = @libdir@ + infodir = @infodir@ + mandir = @mandir@ + includedir = @includedir@ + oldincludedir = /usr/include + pkgdatadir = $(datadir)/@PACKAGE@ + pkglibdir = $(libdir)/@PACKAGE@ + pkgincludedir = $(includedir)/@PACKAGE@ + top_builddir = .. + + ACLOCAL = @ACLOCAL@ + AUTOCONF = @AUTOCONF@ + AUTOMAKE = @AUTOMAKE@ + AUTOHEADER = @AUTOHEADER@ + + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd + INSTALL = @INSTALL@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ + INSTALL_DATA = @INSTALL_DATA@ + install_sh_DATA = $(install_sh) -c -m 644 + install_sh_PROGRAM = $(install_sh) -c + install_sh_SCRIPT = $(install_sh) -c + INSTALL_SCRIPT = @INSTALL_SCRIPT@ + INSTALL_HEADER = $(INSTALL_DATA) + transform = @program_transform_name@ + NORMAL_INSTALL = : + PRE_INSTALL = : + POST_INSTALL = : + NORMAL_UNINSTALL = : + PRE_UNINSTALL = : + POST_UNINSTALL = : + + EXEEXT = @EXEEXT@ + OBJEXT = @OBJEXT@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + AMTAR = @AMTAR@ + AWK = @AWK@ + CC = @CC@ + CXX = @CXX@ + DEPDIR = @DEPDIR@ + INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ + PACKAGE = @PACKAGE@ + STRIP = @STRIP@ + VERSION = @VERSION@ + am__include = @am__include@ + am__quote = @am__quote@ + install_sh = @install_sh@ + noinst_DATA = \ + lambdamanual.html \ + trans_xml_for_cat.pl \ + user_manual_style.css \ + lambda.html + + + EXTRA_DIST = \ + lambdamanual_src.html \ + trans_xml_for_cat.pl \ + user_manual_style.css \ + lambda.html + + + CLEANFILES = lambdamanual.html + subdir = docs + mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs + CONFIG_HEADER = $(top_builddir)/config.h + CONFIG_CLEAN_FILES = + DIST_SOURCES = + DATA = $(noinst_DATA) + + DIST_COMMON = Makefile.am Makefile.in + all: all-am + + .SUFFIXES: + $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign docs/Makefile + Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + uninstall-info-am: + tags: TAGS + TAGS: + + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + + top_distdir = .. + distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + + distdir: $(DISTFILES) + @list='$(DISTFILES)'; for file in $$list; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + check-am: all-am + check: check-am + all-am: Makefile $(DATA) + + installdirs: + + install: install-am + install-exec: install-exec-am + install-data: install-data-am + uninstall: uninstall-am + + install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + + installcheck: installcheck-am + install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + mostlyclean-generic: + + clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + + distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + + maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + clean: clean-am + + clean-am: clean-generic mostlyclean-am + + distclean: distclean-am + + distclean-am: clean-am distclean-generic + + dvi: dvi-am + + dvi-am: + + info: info-am + + info-am: + + install-data-am: + + install-exec-am: + + install-info: install-info-am + + install-man: + + installcheck-am: + + maintainer-clean: maintainer-clean-am + + maintainer-clean-am: distclean-am maintainer-clean-generic + + mostlyclean: mostlyclean-am + + mostlyclean-am: mostlyclean-generic + + uninstall-am: uninstall-info-am + + .PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic uninstall uninstall-am uninstall-info-am + + + lambdamanual.html: ${srcdir}/lambdamanual_src.html ${srcdir}/trans_xml_for_cat.pl + ${srcdir}/trans_xml_for_cat.pl <${srcdir}/lambdamanual_src.html >lambdamanual.html + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/lambda.html diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/lambda.html:1.1 *** /dev/null Mon Dec 29 11:37:49 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/lambda.html Mon Dec 29 11:37:39 2003 *************** *** 0 **** --- 1,110 ---- + + + Lambda - Unique Software Designs + + + + +

Datamaster Project

+ Lambda is a lambda calculus interpret. + It also will convert lambda expression into the + combinators S, K, and I. +
+
About
+
+
+
Current features:
+
+
    +
  • Load predefined lambda expression
  • +
  • Many definitions provided: + numbers Y fact map iszero list 1st 2nd 3rd + ADD MUL EXP + list suc pred . . . +
  • +
  • Automatic number definitions.
  • +
  • Interpret lambda expressions.
  • +
  • Single step interpretation.
  • +
  • Normal or application order reductions.
  • +
  • Variable extraction (Conversion to S K I)
  • +
  • List definitions.
  • +
  • Some lambda calculus theory.
  • +
+
+
Current version
+
Lambda-0.1.1.
+ +
License
+
+ Lambda is distributed as free software under GPL. +
+
+
+ +
News
+
+
+
Aug 19, 2003
+
Released Version 0.1.3. +
    +
  • Add xapp flag for ext command.
  • +
  • Made ext behave consistently when extracting constant expressions.
  • +
  • Add preprocessing for user manual. + This automatically inserts a table of contents + and does character entity translations.
  • +
+
+
Aug 18, 2003
+
Released Version 0.1.2. + Added documentation: +
    +
  • Include examples for numbers.
  • +
  • Lists
  • +
  • Functional Completeness.
  • +
+
+ +
Aug 17, 2003
+
Correction to definition of: + ext x lambda-exp
+
Aug 15, 2003
+
Released version 0.1.1.
+
+
+ +
Documentation
+
+ User Manual. +
+ +
Requirements
+
+ The following software is required: + +
+ +
Download
+
+ Download Source +
+ +
ChangeLog
+
+ ChangeLog +
+ +
Contact
+
+ usdesign at earthlink.net +
+
+ + Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/lambdamanual_src.html diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/lambdamanual_src.html:1.1 *** /dev/null Mon Dec 29 11:37:49 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/lambdamanual_src.html Mon Dec 29 11:37:39 2003 *************** *** 0 **** --- 1,1756 ---- + + + + Lambda + + + + +

+ Lambda +
+ Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.1 or any later version published by the Free Software + Foundation; with all sections Invariant Sections, with no Front-Cover + Texts, and with no Back-Cover Texts. A copy of the license is included + in the file "fdl.txt" included in this distribution. + +
+

+


+ +
+

Commands

+

load

+
load <definition-filename>
+ + When lambda first starts it prints the current directory. + If the definition file is in this directory, + <directory-filename> + can be just the filename + (so long as the filename is just one word). + Otherwise, the filename should be enclosed in double quotes. +

+ For example: +

+ + load definitions
+ load "../share/definitions"
+
+
+ +

list

+
list
+

+ List all current definitions in reverse order. + That is, the more recent definitions are printed first. + +

set

+
+ set [<flag>]...
+ <flag> = trace | step | thru | app | body | brief | sym | eta | xapp | full
+
+ +

+ Set or clear flags. + The flags govern the way in which expressions are evaluated and printed. + The set command used without any flags or with a flag + which it doesn't recognize will print a list the flags and their current state, after executing the commands. + The meaning of each flag is as follows: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ trace + + If set, prints a sub-expression just before it is reduced. + Default: not set. +
+ step + + if set, one reduction is done at a time, the result printed, + and the user prompted to continue or stop reduction of this expression. + Default: not set. +
+ thru + + Works the same as step, + except that the expression is reduced to normal form + without pausing between each reduction to print the expression + and prompt the user. + Setting one of these flags (step or thru) + will cause the other to be cleared. + If neither flag is set, the expression is reduced using a + recursive descent method, which should be faster. + This method should result in the reductions being performed + in the same order as the one reduction at a time method used + when step or thru are set. + However, it may not always. + Default: not set. +
+ app + + If set, do the reductions in "applicative order," + which means reduce the "rand" of an application + before reducing the application. + If not set, perform the reductions in "normal order", + which means, do the left-most reduction in the expression first. + Default: not set. +
+ body + + If set reduce the body of a abstraction, + even though it is not the rator of an application. + Default: not set. + Setting body is necessary in order to make arithmetic work + correctly: MUL 2 2 ==> 4. +
+ brief + + If set, use a more compact method of printing an expression, + in which unnecessary parenthesis or elided. + If not set, extra parenthesis are printed to indicate + the left-to-right association nature of applications. + Default: set. +
+ sym + + If set, causes sub-expressions to be matched to definitions + when printing an expression. + Whenever a match is found, + the name of the definition is printed in place + of the value, which result in a more compact representation. + No attempt is made to preform alpha conversions to match expression, + although this would be a good idea for future versions of this program. + (An "alpha" conversion allows the name of the argument of an abstraction + to be changed.) + Default: set. +
eta + If set: + ext x f x ==> f. + If not set: + ext x f x ==> S(K f)I. +
xapp + If set: + ext x f g ==>S(K f)(K g). + If not set: + ext x f g ==>K(f g). +
+ full + + If set, causes names to be completed expanded, + by looping over the definitions until no more expansions + can be done. + May result in recursive loops. + Default: set. +
+ +

def

+
+ def <name> <lambda-exp> +
+ +

+ Make a definition, associating + + <name> + + + with + + <lambda-exp> + + + in subsequent reductions. + If the name is already in use in a previous definition, + that definition is replaced with the new one. + If the lambda expression contains unbound variables, + they may be captured by arguments of abstractions + when the lambda expression is substituted for the definition name + in the reduction process. + +

ext

+
+ ext <var> <lambda-exp> +
+

+ Extract the variable + <var> + from the lambda-exp + <lambda-exp> + so that +

+ + (ext <var> <lambda-exp>) <var> + == <lambda-exp>
+
+

+ If instead of a variable name + <var> + is the character + ^ + or ~, +

+ + (ext ^ <lambda-exp>) == <lambda-exp>
+ (ext ~ <lambda-exp>) == <lambda-exp>
+
+

+ The + <lambda-exp> + is replaced by + S, + K, + and I + combinators, as follows: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
expressionresultremark
ext x xI 
ext x AK AA is a single symbol other than x
ext x AK (A)A is free in A and A is an application expression + and xapp is off
ext x lambda-expext x (ext lambda-exp.arg lambda-exp.body) 
ext x exp1 exp2S (ext x exp1)(ext x exp2) + exp1 and exp2 both constant and xapp is on + or
+ exp1 and ext2 not both constant and exp2 is not x + or
+ exp1 is x and eta is off))
ext x exp1 xS (ext x exp1)(ext x exp2)eta is on
ext ^ xx
 
ext ^ lambda-expext lambda-exp.arg lambda-exp.body 
ext ^ exp1 exp2(ext ^ exp1)(ext ^ exp2) 
+

+ The definitions of S, K, and I are +

+ + I a = a
+ K a b = a
+ S a b c = a c( b c)
+
+

+ I is often defined as + S K K. +

+ For example, +

+
+ << set
+ >trace = 0
+ >step  = 0
+ >thru  = 0
+ >app   = 0
+ >body  = 0
+ >brief = 1
+ >sym   = 1
+ >eta   = 1
+ >xapp  = 0
+ >full  = 1
+ << ext x E x
+ E
+ << set eta
+ << ext x E x
+ S(K E)I
+ << ext x A B
+ K(A B)
+ << set xapp
+ << ext x A B
+ S(K A)(K B)
+ << ext x ^y.x y
+ S(S(K S)(S(K K)I))(K I)
+ << set eta
+ << ext x ^y.x y
+ I
+ << ext ^ ^x.^y.x y
+ I
+ << ext ^ ^x.^y.y x
+ S(S(K S)(K I))K
+ <<
+ 
+ +

lambda-expression

+ +
+ <lambda-exp> +
+

+ Reduce the lambda-expression. + However, if the lambda expression is just a single variable, + print its definition. + When a expression is reduced, + it is first parsed into an internal expression tree form, + printed (in the "non-brief" format), + and reduced again as directed by the flags. + The final result (and any intermediate results, + if the step flag is set) is printed as directed by the brief and sym flags. + When in the step mode, for each intermediate or final result, + an "B" is incorporated into the result cue to indicate a "beta" + reduction was performed, and an "H" is incorporated + to indicated a "eta" reduction was performed. +

+ A user cue of +

+ + << + +

+ used to indicate input is needed. + An a command is terminated by a new line. + However, if a lambda-expression is being reduced and a new line + is encountered with parentheses unbalanced, + the user is prompted to supply the missing right parentheses. +

+ Parsed results are printed after the cue: +

+ + ==> + +

+ In the step mode, + intermediate and final results are printed after the cue: +

+ + =B==> + +

+ which indicates an "beta" reduction was peformed, or +

+ + =H==> + +

+ which means an "eta" reduction was performed. The cue +

+ + ===> + + is used for final results when not in the step mode. +

+ +

quit

+
+ quit +
+ Quit. + +

Expressions

+ +

Syntax

+

+ + <lambda-exp> = <variable>
+ | ^<variable>.<lambda-exp>
+ | <lambda-exp> <lambda-exp>
+ | (<lambda-exp>)
+
+ +

Semantics

+

+ The form ^<variable>.<lambda-exp> + is called an "abstraction." + The variable after the ^ and before the period is called the + argument, + and the lambda expression after the period is called the + body. + The body extends until the end of the expression, + or until a right parenthesis is encountered + which is unmatched by a corresponding left parenthesis + in the body expression. +

+ + The form + <lambda-exp> <lambda-exp> + is called an application. + The first lambda expression is called the operator + (or rator for short) + and the second is called the operand + (or rand for short.) + When an rator of an application is an abstraction, + an application can be reduced + by substituting the rand into the body of the abstraction + in place of each occurrence of the abstraction's argument. + This must be done in such a way + as to avoid an name collisions + with the arguments of other abstractions + which might be embedded in the body of the abstraction. + The application operation is left-associative, + which means that the expression +

+ + a b c d + +

+ means +

+ + ((a b) c) d. + + +

Definition of "free"

+ Variable x occurs free in an expression: +
+ 1. x occurs free in x (but not in any other variable); +
+ 2. x occurs free in X Y if x occurs free in X or Y; +
+ 3. x occurs free in ^y.Y if x and y + different and x occurs free in Y; +
+ 4. x occurs free in (X) if x occurs free in X. +
+

Definition of "bound"

+ Variable x occurs bound in an expression: +
+ 1. No variable occurs bound in an expression consisting of + just a single variable; +
+ 2. x occurs bound in ^y.Y if + x and y are the same variable + (and x occurs free in Y), + or if x occurs bound in Y. +
+ 3. x occurs bound in X Y if it occurs bound in X or Y. +
+ 4. x occurs bound in (X) if it occurs bound in X. + +

Substitution Rules

+

+ Substitute expression M for variable x in expression X
+ [M/x]X
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CaseConditionRule: [M/x]X ==>
1 + X is a Variable
1.1X == xM
1.2X != xX
2 + X is a Application: Y Z + ([M/x]Y)([M/x]Z)
3 + X is an Abstraction: ^y.Y
3.1 + y == xX
3.2 + y != x 
3.2.1 + x doesn't occur free in Y
+ or y doesn't occur free in M
+ ^y.[M/x]Y
3.2.2 + x does occur free in Y
+ and y does occur free in M + (a collision)
+ ^z.[M/x]([z/y]Y)
+ where z is the first variable + in the sequence of variables + such that z doesn't occur free in M or Y. +
+ That is, change all free occurrences of y in Y to z, + then replace occurrences of x in Y with M. + The argument of the abstraction is changed from + y to z. +
+
+

+ +

Conversion Definitions

+ + + + + + + + + + + + + + + + + +
ConversionDefinition
αif y is not free in X, + then ^x.X cnv(&alpha) ^y.[y/x]X
β(^x.M)N cnv(β) [N/x]M
ηif x is not free in M, then + ^x.M x cnv(η) M. +
+

+ A reduction means going from left to right with a β or η conversion; that is, getting rid of a ^. + Normal order means getting rid of the left most ^ first. + Applicative order means reducing the rand before the rator. + +

Variable Name Prefixes

+

+ + + + + + + + + + + + + +
PrefixMeaning
+ $ + + If the argument of an abstraction has + $ + as its first character, + the abstraction, + when it is being reduced as part of an application, + will be reduced as though the step flag were off, + and the body flag were on. +
+ & + + If the argument of an abstraction has + & + as its first character, + the abstraction will be reduced as though the step + and body flags are both off. +
+ +

Arithmetic

+ +

Basic Definitions

+ + Let + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ [m] + + represent the lambda expression for the postive integer m, +
+ [0] + + ^x.^y.y +
+ [n+1] + + ^x.^y.x([n] x y) for all n > 0 +
+ ADD + + ^m.^n.^x.^y.m x(n x y) +
+ MUL + + ^m.^n.^x.m(n x) +
+ EXP + + ^n.^m.m n +
+ +

Proposition for Addition

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ ADD [m][n] = [m+n] +
Proof
By induction
1) + + ADD [0] [n]
+ = ^x.^y.[0] x.([n] x y)
+ = ^x.^y.[n] x y
+ = [n] = [0+n]
+
+
2) + Assume + + ADD [m][n] = [m+n] + + + induction hypothesis +
3) + + ADD [m+1][n]
+ = ^x.^y.[m+1] x([n] x y)
+ = ^x.^y.(^a.^b.a([m] a b)) x ([n] x y)
+ = ^x.^y.x([m] x ([n] x y)
+ = ^x.^y.x(ADD [m] [n] x y)
+
+
=> + + + = ^x.^y.x([m+n] x y)
+
+
+ by 2) induction hypothesis
+
+ + = [(m+1)+n]
+
+
+ +

Proposition for Multiplication

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ MUL [m][n] = [m*n] +
Proof
By induction
1) + + MUL [0] [n]
+ = ^x.[0]([n] x)
+ = ^x.(^a.^b.b)([n] x)
+ = ^x.^b.b
+ = ^x.^y.y
+ = [0]
+
+
2) + Assume + + MUL [m][n] = [m*n] + + + induction hypothesis
+
3) + + MUL [m+1] [n]
+ = ^x.[m+1]([n] x)
+ = ^x.(^a.^b.a([m] a b))([n] x)
+ = ^x.^b.([n] x)([m] ([n] x) b)
+ = ^x.^b.([n] x)(MUL [m] [n] x b)
+
+
+
=> + + = ^x.^b.([n] x)([m*n] x b)
+
+
+ by 2) induction hypthesis
+
+ + + = ^x.^b.ADD [n] [m*n] x b
+ = ^x.^b.[n+m*n] x b
+ = [n+m*n]
+ = [(m+1)*n]
+
+
+
+ +

+

Proposition for Exponentiation.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ EXP [n][m] = [n**m] +
Proof
By induction
1) + + EXP [n] [0]
+ = [0] [n]
+ = (^x.^y.y)[n]
+ = ^y.y
+ = ^y.^z.y z
+ = [1]
+
+
2) + Assume + + EXP [n][m] = [n**m] + + + induction hypothesis
+
3) + + EXP [n] [m+1]
+ = [m+1] [n]
+ = (^x.^y.x([m] x y))[n]
+ = ^y.[n]([m] [n] y)
+ = ^y.[n](EXP [n] [m] y)
+
+
=> + + = ^y.[n]([n**m] y) + + + by 2) induction hypothesis
+
+ + = MUL [n] [n**m]
+ = [n*(n**m)]
+ = [n**(m+1)]
+
+
+
+ +

+

Proposition for Predecessor

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + pred [n] = [n-1] + + + + + + + + + + + + + + + + + + + + + + + +
+ Let
+
+ + suc = ^n.^x.^y.x(n x y)
+ pair = ^f.^s.^p.(p f s)
+ false = ^f.^s.s
+ true = ^f.^s.f
+
+
+ and
+
+ + bump = ^p.pair (suc(p true)) (p true)
+ pred_pair = ^n.n bump (pair 0 0)
+ pred = ^n.pred_pair n false
+
+
+ then + + + pred_pair [n] = pair [n] [n-1]
+
+
+ hence
+
+ + pred [n] = [n-1]
+
+
+
Proof
By induction
1) + + pred_pair [1]
+ = 1 bump (pair 0 0)
+ = bump (pair 0 0)
+ = pair (suc((pair 0 0) true)) ((pair 0 0) true))
+ = pair 1 0
+
+ +
2) + Assume + + pred_pair [n] = pair [n] [n-1]
+
+
+ induction hypothesis
+
3) + + pred_pair [n+1]
+ = ^n. (n bump (pair 0 0))[n+1]
+ = [n+1] bump (pair 0 0)
+ = bump ([n] bump (pair 0 0))
+ = bump (pred_pair [n])
+
+
=> + + = bump (pair [n] [n-1])
+ = pair [n+1] [n]
+
+
+ by 2) induction hypothesis
+
4) + + pred [n]
+ = pred_pair [n] false
+ = pair [n] [n-1] false
+ = false [n] [n-1]
+ = [n-1]
+
+
+ +

Examples

+ +
+
+ def 0 ^m.^n.n
+ def true ^p.^q.p
+ def def false ^p.^q.q
+ def suc ^p.^m.^n.m(p m n)
+ def pred ^$k.$k(^p.(mpair(suc(p true))(p true)))(mpair 0 0)false
+ def mpair ^a.^b.^u.u a b
+ def def iszero ^n. n (true false) true
+ def ADD ^m.^n.^x.^y.m x(n x y)
+ def MUL ^m.^n.^f.m(n f)
+ def EXP ^m.^n.n m
+ def GT ^m.^n.not(iszero (n pred m))
+ def EQ ^m.^n.and (iszero (m pred n)) (iszero (n pred n))
+ def LT ^m.^n.not(iszero(m pred n))
+ def GE ^m.^n.not(LT m n)
+ << iszero 0
+ ==> iszero 0
+ ====>true
+ << iszero 5
+ ==> iszero 5
+ ====>false
+ << suc 0
+ ==> suc 0
+ ====>I
+ << suc 1
+ ==> suc 1
+ ====>2
+ << suc 2
+ ==> suc 2
+ ====>3
+ << pred 3
+ ==> pred 3
+ ====>2
+ << pred 2
+ ==> pred 2
+ ====>I
+ << pred 1
+ ==> pred 1
+ ====>0
+ << pred 0
+ ==> pred 0
+ ====>0
+ << ADD 1 2
+ ==> (ADD 1) 2
+ ====>3
+ << MUL 2 3
+ ==> (MUL 2) 3
+ ====>6
+ << EXP 2 3
+ ==> (EXP 2) 3
+ ====>8
+ << EXP 3 2
+ ==> (EXP 3) 2
+ ====>9
+ << GT 2 3
+ ==> (GT 2) 3
+ ====>false
+ << GT 3 2
+ ==> (GT 3) 2
+ ====>true
+ << EQ 4 (ADD 2 2)
+ ==> (EQ 4)((ADD 2) 2)
+ ====>true
+ << EQ 5 (ADD 3 3)
+ ==> (EQ 5)((ADD 3) 3)
+ ====>false
+ <<
+ 
+
+ +

Lists

+

Nodes

+ The basis of a list is the triple: +
+
+ def mtriple ^a.^b.^c.^u.u a b c
+ def 1st ^a.^b.^c.a
+ def 2nd ^a.^b.^c.b
+ def 3rd ^a.^b.^c.c
+ 
+
+ So +
+
+ ==> abc 2nd
+ ====>b
+ << abc 3rd
+ ==> abc 3rd
+ ====>c
+ <<
+ 
+
+ A list node is a triple whose first component is the first + element of the list, the second component is the rest of the + list, and the third component is a boolean that is true if + the triple is the last node of the list and false otherwise. +
+
+ def true ^p.^q.p
+ def false ^p.^q.q
+ def mknode (^a.^b.^u.u a b false)
+ def is_end (^n.n sel_3)
+ 
+
+

Empty List

+ A special node, end is constructed to serve as the + empty list, and to be the last node of a list. +
+
+ def renda ^e.^&u.&u e e true
+ def def rend (^x.renda(x x))(^x.renda(x x))
+ def head (^n.n sel_1)
+ def tail (^n.n sel_2)
+ def end ^&u.&u rend rend true
+ 
+
+ We see that: +
+
+ << Y renda
+ ==> Y renda
+ ====>end
+ << renda rend
+ ==> renda rend
+ ====<end
+ << head end
+ ==> head end
+ ====>end
+ << tail end
+ ==> tail end
+ ====>end
+ << is_end end
+ ==> is_end end
+ ====>true
+ <<
+ 
+
+ We define Y, the fixed-point operator, + in the next section, "Function Complete of Curry Algebras." +

+ So end +

+

+

Appending

+ The form append adds and element to the end of a list. +
+
+ def Appenda ^h.^n.^list.(is_end list)(mknode n end)(mknode(head list)(h n(tail list)))
+ def append (^x.Appenda(x x))(^x.Appenda(x x))
+ 
+
+ It is easy to see that +
+ 	append = Y Appenda
+ 
+ As an example of a list, we have: +
+
+ << def abc append c (append b (append a end)))
+ << head abc
+ ==> head abc
+ ====>a
+ << head (tail abc)
+ ==> head(tail abc)
+ ====>b
+ << head (tail (tail abc))
+ ==> head(tail(tail abc))
+ ====>c
+ << head (tail (tail (tail abc)))
+ ==> head(tail(tail(tail abc)))
+ ====>end
+ <<
+ 
+
+

Mapping

+ Finally define the form map which applies + its first argument to each node of its second argument, + if the second argument is a list, anyway. +
+
+ def Mapa ^h.^f.^list.(is_end list)(end)(mknode(f (head list))(h f (tail list)))
+ def map (^x.Mapa(x x))(^x.Mapa(x x))
+ 
+
+ So, for example, +
+
+ << def n01234 append 4 (append 3 (append 2 (append 1 (append 0 end))))
+ << head n01234
+ ==> head n01234
+ ====>0
+ << head (tail n01234)
+ ==> head(tail n01234)
+ ====>I
+ << head (tail (tail n01234))
+ ==> head(tail(tail n01234))
+ ====>2
+ << head (tail (tail (tail n01234)))
+ ==> head(tail(tail(tail n01234)))
+ ====>3
+ << head(tail(tail(tail(tail n01234))))
+ ==> head(tail(tail(tail(tail n01234))))
+ ====>4
+ << head(tail(tail(tail(tail(tail n01234)))))
+ ==> head(tail(tail(tail(tail(tail n01234)))))
+ ====>end
+ << def s01234 map suc n01234
+ << head s01234
+ ==> head s01234
+ ====>I
+ << head (tail s01234)
+ ==> head(tail s01234)
+ ====>2
+ << head (tail (tail s01234))
+ ==> head(tail(tail s01234))
+ ====>3
+ << head(tail(tail(tail s01234)))
+ ==> head(tail(tail(tail s01234)))
+ ====>4
+ << head(tail(tail(tail(tail s01234))))
+ ==> head(tail(tail(tail(tail s01234))))
+ ====>5
+ << head(tail(tail(tail(tail(tail s01234)))))
+ ==> head(tail(tail(tail(tail(tail s01234)))))
+ ====>end
+ <<
+ 
+
+ +

Functional Completeness of Curry Algebras

+ The course of reasoning followed here is adapted from + "FROM λ-CALCULUS TO CARTESIAN CLOSED CATEGORIES", + J Lambek, McGill University, Montreal, P.Q. H3A 2K6, Canada. +

+ [Note: To read this section your browser must be able to render + the greek character entities: + &alpha;(α), + &beta;(β), + ..., + &equiv;(≡), + &isin;(∈), + &forall;(∀), + &deg;(°).] +

+ A Schönfinkel Algebra + A consists of a set of symbols + |A|, + a left associative binary operation |A|x|A|->|A| + (denoted here by juxtaposition), + and three constants in |A|: + I, + K, and + S such that: +

+ for all a, b, c, f, and g in |A|
+ (1)	I a = a
+ (2)	K a b = a
+ (3)	S f g c = (f c)(g c)
+ 
+ + We call (a b) a combination. + So we can form expressions of combinations of the symbols in + |A|, and these will correspond to other symbols + in |A|. Mostly, we are interested in just those + symbols that can be expressed by combinations of + S, K and I. +

+ We can say that a polynomial in A + with unknown x is an element of + the Schönfinkel Algebra A[x], (which is + A with an extra element x + attached to + |A|) + and a mapping

+ 	hx: A -> A[x]
+ 
such for all + algebra's B and mappings + A->B and + b ∈ |B|, + there is an f' such that +
+ 	f = f'°hx
+ 
+ and +
+ 	f'(x) = b. 
+ 
+ If +
+ 	B = A and
+ 	f is the identity morphism,
+ 
+ then + f' is the substitution map that + replaces x with b=a∈A. +

+ If +

+ 	B =  A[x], and
+ 	f = hx
+ 
+ then f' is the substitution map that + replaces x with b=ψ(x)∈A[x]. + +

Proposition 1 Abstractions in Schönfinkel Algebras.

+ Every polynomial φ(x) over a + Schönfinkel Algebra A can be written in the form +
+ 	f x
+ 
+ where +
+ 	f ∈ |A|
+ 
+ + Polynomials in A are formed as words in an indeterminate + x and satisfy the same three identities. + In particular equality =x between polynomials is the + smallest equivalence relation ≡ that satisfies: +
+ (0x)	φ(x) &quiv; psi;(x) and α(x) ≡ β(x) implies φ(x)ψ(x) ≡ α(x) β(x)
+ (1x)	I(α(x)) ≡ α(x)
+ (2x)	K(α(x))(β(x)) ≡ α(x)
+ (3x)	S(α(x))(β(x))(γ(x)) ≡ (α(x))(γ(x))((β(x))(γ(x))
+ 
+ + +
Proof:
+ By induction a the length of the word φ(x), + which must be one of +
+ 	x,
+ 	some constant expression (without x), or
+ 	ψ(x) χ(x)
+ 
+ We have for these three cases: +
+ 	φ(x) =x I x
+ 	φ(x) =x (K a ) x,
+ 	φ(x) =x (g x) (h x) = (S g h x)
+ 
+ + This proof yields an algorithm for converting every polynomial + into the form f x, where the word f + is free of any occurrence of x. This is equivalent + to the + lambda + command +
+ 	ext x φ(x)
+ 
+ with the flag eta toggled off (1) and xapp toggle on, + With eta on, we still can make ext x work + like this algorithm if we replace all occurrences of x + not already in the combination (I x) + with (I x). +

+ Starting with eta on, such a + lambda + session might look like: +

+
+ << ext x x
+ I
+ << ext x I x
+ I
+ << ext x A
+ K A
+ << ext x A B
+ K(A B)
+ << ext x (A x)(B x)
+ S A B
+ << ext x A x
+ A
+ << ext x A (I x)
+ S(K A)I
+ << ext x x A
+ S I(K A)
+ << ext x I x A
+ S I(K A)
+ <<
+ 
+
+ +

+ A Curry Algebra is a Schönfinkel Algebra subject to certain + additional equations or identities whose conjunction is equivalent + to the following statement: +

+ (4)	If f x =x g x in A[x] then f = g in A.
+ 
+ For example, +
+ 	S K I x =x (K x)(I x) =x I x,
+ 
+ so, (4) implies +
+ 	S K I = I
+ 
+ a result that can't be obtained from (1) through (3) alone. +

+ +

Proposition 2. Existence of Curry Algebras.

+ It is possible to add a finite collection of equations or identities to + the definition of a Schönfinkel Algebra to form a Curry Algebra: + Every polynomial φ(x) + over a Curry Algebra A may be + written uniquely in the form (f x) + with f ∈ |A|. +
Proof
+ We need to demonstate a collection of (universally quantified) + equations, or better, identities, in |A| whose conjunction, + together with (1), (2), and (3), + imply (4). +

+ Define the function λx by induction on the length + of the word representing the polynomial, φ(x). +

+ (i)	λxx = I;
+ (ii)	λxx = K a, when a is a constant; and
+ (iii)	λx(φ(x))(ψ(x)) = S(λxφ(x))(λxψ(x)), when φ(x) and ψ(x) are not both constant.
+ 
+

+ The restriction on (iii) is necessary so that λx is not ambiguous: + if both parts of a combination are constant then (ii) applies. + The lambda command ext x works + like λx if the both the flags eta + and xapp are off. + With xapp on, constant applications will be extracted by + (iii) instead of (ii). +

+ λx maps every polynomial φ(x) in A[x] + to an element of f of A such that (f x) =x φ(x). + So the existence of f is assured. +

+ We must now show that f is unique. We first prove that +

+ (*)		φ(x) =x ψ(x) implies λx(φ(x)) = λx(ψ(x)).
+ 
+ That is, if two polynomials are equal in A[x], their lambda abstractions are equal in A . +

+ To prove this assertion, we show that the equality +

+ 	λx(φ(x)) = λx(ψ(x))
+ 
+ defines an equivalence relation over the polynomials in + A[x] that satisfies  + (ix), + (iix), and + (iiix) above, + when certain additional universally quantified equations in + A  are assumed. + Since =x is assumed to be the smallest (finest grained) + such equivalence, the assertion must hold. +

+ (Adding such equations can only unify partitions of an equivalence + relation, but never divide. + That is, two members of |A[x]| (or |A|) + that were equal without the additional equations will still be equal + with them. So if =x was the finest equivalence relation + satisfying + (ix), + (iix), and + (iiix) + before the addition, it will remain such after the addition.) +

+ So we must have, for all polynomials + α(x), β(x), γ(x) in A[x]: +

+ (1''')	λxI(α(x)) = λα(x)
+ (2''')	λxK(α(x))(β(x)) = λx(α(x))
+ (3''')	λxS(α(x))(β(x))(γ(x)) = λx(α(x))(γ(x))((β(x))(γ(x))
+ 
+ For uniqueness of f, suppose we have +
+ 	(g x) =x φ(x).
+ 
+ By (*) this implies that for all gA +
+ 	λx(g x) = λxφ(x) = f.
+ 
+ So we impose the condition, for all gA +
+ (4''')	λx(g x) = g.
+ 
+ We would like to remove the restriction on (iii) above. + That is, for all f, and gA , + λx(f g)  using (iii) + must equal λx(f g)  using (ii). + So we have: +
+ (5''')	S(K f)(K g) = K(f g)
+ 
+ Let +
+ 	a = λxα(x)
+ 	b = λxβ(x)
+ 	c = λxγ(x)
+ 
+ If we replace + α(x), + β(x), + and γ(x) + in (1'''), (2'''), and (3''') above with: + (a x), (b x), and (c x) + then we can use the + lambda  + command ext x  + to calculate the corresponding equations in A +
+ (1'')	S(K I)a = a
+ (2'')	S(S(K K)a)b = a
+ (3'')	S(S(S(K S)a)b)c = S(S a c)(S b c)
+ (4'')	S(K g)I = g
+ (5'')	S(K f)(K g) = K(f g)
+ 
+ Such a + lambda  + session might look like: +
+
+ << ext x I(a x)
+ S(K I)a
+ << ext x (a x)
+ a
+ << ext x K(a x)(b x)
+ S(S(K K)a)b
+ << ext x (a x)
+ a
+ << ext x S(a x)(b x)(c x)
+ S(S(S(K S)a)b)c
+ << ext x (a x)(c x)((b x)(c x))
+ S(S a c)(S b c)
+ << ext x g (I x)
+ S(K g)I
+ <<
+ 
+
+ These equations are universally quantified in + α(x), + β(x), + γ(x), + f, and + g. + Because every occurrence of the polynomials are bound by + λx, and + in light of (4'''), every expression + aA + has a corresponding polynomial in A[x]: + (a x). + So instead of qualifying the equations in terms of polynomials + in |A[x]|, we can qualify them in terms of + elements in |A|. + So we have +
+ (1')	∀a.S(K I)a = a
+ (2')	∀a.∀b.S(S(K K)a)b = a
+ (3')	∀a.∀b.∀c.S(S(S(K S)a)b)c = S(S a c)(S b c)
+ (4')	∀g.S(K g)I = g
+ (5')	∀f.∀g.S(K f)(K g) = K(f g)
+ 
+ Using the + lambda  + ext ^  command, we can turn these equations + into identities in A +
+ (1i)	S(K I) = I
+ (2i)	S(K S)(S(K K)) = K
+ (3i)	S(K(S(K S)))(S(K S)(S(K S))) = S(S(K S)(S(K K)(S(K S)(S(K(S(K S)))S))))(K S)
+ (4i)	S(S(K S)K)(K I) = I
+ (5i)	S(S(K S)(S(K K)(S(K S)K)))(K K) = S(K K)
+ 
+ Such a + lambda  + session might look like: +
+
+ << ext ^ ^a.^x.I(a x)
+ S(K I)
+ << ext ^ ^a.^x.a x
+ I
+ << ext ^ ^a.^b.^x.K(a x)(b x)
+ S(K S)(S(K K))
+ << ext ^ ^a.^b.^x.a x
+ K
+ << ext ^ ^a.^b.^c.^x.S(a x)(b x)(c x)
+ S(K(S(K S)))(S(K S)(S(K S)))
+ << ext ^ ^a.^b.^c.^x.(a x)(c x)((b x)(c x))
+ S(S(K S)(S(K K)(S(K S)(S(K(S(K S)))S))))(K S)
+ << ext ^ ^g.S(K g)I
+ S(S(K S)K)(K I)
+ << ext ^ ^g.g
+ I
+ << ext ^ ^f.^g.S(K f)(K g)
+ S(S(K S)(S(K K)(S(K S)K)))(K K)
+ << ext ^ ^f.^g.K(f g)
+ S(K K)
+ <<
+ 
+
+ Let's check our work: +
+
+ << load definitions
+ << S(K I) a x
+ ==> ((S(K I)) a) x
+ ====>a x
+ << I a x
+ ==> (I a) x
+ ====>a x
+ << S(K S)(S(K K)) a b x
+ ==> ((((S(K S))(S(K K))) a) b) x
+ ====>a x
+ << K a b x
+ ==> ((K a) b) x
+ ====>a x
+ << S(K(S(K S)))(S(K S)(S(K S))) a b c x
+ ==> (((((S(K(S(K S))))((S(K S))(S(K S)))) a) b) c) x
+ ====>a x(c x)(b x(c x))
+ << S(S(K S)(S(K K)(S(K S)(S(K(S(K S)))S))))(K S) a b c x
+ ==> (((((S((S(K S))((S(K K))((S(K S))((S(K(S(K S)))) S)))))(K S)) a) b) c) x
+ ====>a x(c x)(b x(c x))
+ << S(S(K S)K)(K I) g x
+ ==> (((S((S(K S)) K))(K I)) g) x
+ ====>g x
+ << I g x
+ ==> (I g) x
+ ====>g x
+ << S(S(K S)(S(K K)(S(K S)K)))(K K) f g x
+ ==> ((((S((S(K S))((S(K K))((S(K S)) K))))(K K)) f) g) x
+ ====>f g
+ << S(K K) f g x
+ ==> (((S(K K)) f) g) x
+ ====>f g
+ <<
+ 
+ 
+
+

Proposition 3 Curry Algebras ≡ Lambda Calculus.

+ A Curry Algebra is equivalent to the lambda calculus. +
Proof
+ We have the following equations: +
+ (1) I = λxx
+ (2) K = λxλyx
+ (3) S = λxλyλzx z(y z)
+ (4) ∀f.f = λxf x = f
+ (5) ∀φ(x).∀a.φ(a) = (λxφ(x))a
+ 
+ Condition (5) is true because we have by Proposition 2, +
+ 	 (λxφ(x))x = φ(x)
+ 
+ and by the substitution property, we can substitute a∈A for the unbound occurrences of x on both sides of the equation. +

Proposition 4 Fixed Points in Curry Algebras.

+ Every element of a Curry Algebra has a fixed point. +
Proof
+ The fixed point is +
+ 	Y g,
+ 
+ where +
+ 	Y = λg((λxg(x x))(λxg(x x))).
+ 
+ We have +
+ 	Y f
+ 	= (λxf(x x))(λxf(x x))
+ 	= f((λxf(x x))(λxf(x x)))
+ 	= f(Y f)
+ 
+ so (Y f) is indeed a fixed point of f. + + Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/trans_xml_for_cat.pl diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/trans_xml_for_cat.pl:1.1 *** /dev/null Mon Dec 29 11:37:49 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/trans_xml_for_cat.pl Mon Dec 29 11:37:39 2003 *************** *** 0 **** --- 1,239 ---- + #!/usr/bin/perl -w -I ./ + #####!/usr/bin/perl -T -w -I ./ + use IO::File; + + # stdin: html + # stdout: html with toc + # replace a line with "" with table of contents + # generated from header elements:

etc. + # surrounds each head element with element + + ##open (TOC, "+>DOC"); + ##open (DOC, "+>TOC"); + $toc = IO::File->new_tmpfile(); + $doc = IO::File->new_tmpfile(); + + print ($toc "
Table of Contents
\n"); + + $level = 0; + #@paranums; + + while ( ) + { + ###if( /\s*<[hH](\d+)>([^<]*)<\/[hH]\1>/ ) + if( /\s*<([hHlL])(\d+)>([^<]*)<\/\1\2>/ ) + { + my $hdr = $1; + my $lvl = $2; + my $txt = $3; + if( $lvl < 1 ) { $lvl = 1; } + if( $lvl > $level ) + { + $paranums[$lvl-1] = 0; + print ($toc "
\n"); + }elsif( $lvl < $level ) + { + my $ndx; + for( $ndx=0; $lvl+$ndx < $level; $ndx++ ) + { + print ($toc "
\n"); + } + } + $level = $lvl; + $paranums[$level-1] += 1; + + my $paraname = ""; + my $dot = ""; + for ( $ndx=0; $ndx<$level; $ndx++ ) + { + $paraname = $paraname . $dot . $paranums[$ndx]; + $dot = "."; + } + if( "h" eq $hdr || "H" eq $hdr ) + { + print ($doc "
$paraname $txt\n"); + print ($toc "
$paraname $txt
\n"); + }else{ + my @txtprt = split(/;/,$txt,2); + if( @txtprt == 2 ) + { + print ($toc "
$paraname $txtprt[1]
\n"); + }else{ + print ($toc "
$paraname $txtprt[0]
\n"); + } + } + }else{ + s/
([^<]*)<\/header>/
$1<\/td><\/tr><\/table>/g; + s/([^<]*)<\/cat>/$1<\/span>/g; + s/([^<]*)<\/func>/$1<\/span>/g; + s/([^<]*)<\/map>/$1<\/span>/g; + s/([^<]*)<\/set>/$1<\/span>/g; + s/([^<]*)<\/obj>/$1<\/span>/g; + s/([^<]*)<\/CAT>/$1<\/span>/g; + s/([^<]*)<\/FAM>/$1<\/span>/g; + s/([^<]*)<\/FUNC>/$1<\/span>/g; + + s/&arrow;/→/g; + s/&rarrow;/←/g; #reverse arrow + s/&monic;/↦/g; #monic arrow + s/&equalize;/↣/g; #equalizer arrow + #s/&eqlz;/∥/g; #equalizer op double bar + s/&eqlz;/≑/g; #equalizer op geometric equality + + #s/&cover;/↠/g; #cover arrow + s/&cover;/−⊳/g; #cover arrow + #s/&cover;/⇾/g; #cover arrow + s/&isoarrow;/⥲/g; #isomorphism arrow + + s/&darrow;/⇒/g; #double arrow + s/&implies;/⇒/g; #double arrow + + s/&rdarrow;/⇐/g; #reverse double arrow + s/&impliedby;/⇐/g; #reverse double arrow + + s/⇔/⇔/g; #if and only if + + s/&box;/□/g; #source or target operator + s/&opbox;/▣/g; #opposite source or target op + s/&circle;/○/g; #circle + s/&cring;/⊚/g; #circle ring + s/&bullseye;/◎/g; #circle ring + + s/&role;/○/g; #role + s/&roleop;/◎/g; #opposite role + + s/∀/∀/g; + s/∃/∃/g; + s/¬exist;/∄/g; + s/¬equal;/≠/g; + s/&isomorphic;/≃/g; + + s/&mul;/X<\/font>/g; + s/&add;/+/g; + + s/∏/∏/g; # n-ary + s/∐/∐/g; # n-ary + s/∑/∑/g; # n-ary + + s/∅/∅/g; + s/&incr;/∆/g; + s/&nable;/∇/g; + s/∈/∈/g; + s/∉/∉/g; + s/&smallisin;/∊/g; + s/&contains;/∋/g; + s/¬contains;/∌/g; + s/&smallcontains;/∍/g; + s/&QED;/∎/g; + + s/&slash;/∕/g; + s/∖/∖/g; + s/&asterisk;/∗/g; + s/&compose;/∘/g; + s/&dcomp;/ /g; + s/•/∙/g; + s/&infinity;/∞/g; + + s/&logicaland;/∧/g; s/&land;/∧/g; + s/&logicalor;/∨/g; s/&lor;/∨/g; + s/∩/∩/g; s/&intersection;/∩/g; + s/∪/∪/g; s/&union;/∪/g; + + s/&bar;/∣/g; + s/⊂/⊂/g; + s/⊃/⊃/g; + s/&direq;/⇉/g; #directed equality, venturi tube + #s/&direq;/≔/g; # :=, directed equality, venturi tube + s/&colonequal;/≕/g; # := + s/&equalcolon;/≕/g; # =; + + s/°ree;/°/g; + s/·/·/g; + s/&inverse;/⁻¹/g; + s/&nland;/⋀/g; + s/&nlor;/⋁/g; + s/&nintersection;/⋂/g; + s/⩃/⋂/g; + s/&nunion;/⋃/g; + s/⩂/⋃/g; + s/⋄/⋄/g; + s/˙/⋅/g; + + s/♯/#<\/sup>/g; + s/&wbullet;/◦/g; + s/&whitebullet;/◦/g; + + s/Α/Α/g; + s/Β/Β/g; + s/Γ/Γ/g; + s/Δ/Δ/g; + s/Ε/Ε/g; + s/Ζ/Ζ/g; + s/Η/Η/g; + s/Θ/Θ/g; + s/Ι/Ι/g; + s/Κ/Κ/g; + s/Λ/Λ/g; + s/Μ/Μ/g; + s/Ν/Ν/g; + s/Ξ/Ξ/g; + s/Ο/Ο/g; + s/Π/Π/g; + s/Ρ/Ρ/g; + s/&Stigma;/΢/g; + s/Σ/Σ/g; + s/Τ/Τ/g; + s/Υ/Υ/g; + s/Φ/Φ/g; + s/Χ/Χ/g; + s/Ψ/Ψ/g; + s/Ω/Ω/g; + + s/α/α/g; + s/β/β/g; + s/γ/γ/g; + s/δ/δ/g; + s/ε/ε/g; + s/ζ/ζ/g; + s/η/η/g; + s/θ/θ/g; + s/ι/ι/g; + s/κ/κ/g; + s/λ/λ/g; + s/μ/μ/g; + s/ν/ν/g; + s/ξ/ξ/g; + s/ο/ο/g; + s/π/π/g; + s/ρ/ρ/g; + s/&stigma;/ς/g; + s/σ/σ/g; + s/τ/τ/g; + s/υ/υ/g; + s/φ/φ/g; + s/χ/χ/g; + s/ψ/ψ/g; + s/ω/ω/g; + print $doc $_; + } + } + print ($toc "\n"); + + seek ($toc,0,0); + seek ($doc,0,0); + + while (<$doc>) + { + if( /<[Tt][Oo][Cc]\/?>/ ) + { + while ( <$toc> ) + { + print; + } + }else{ + print; + } + } + close $toc; + close $doc; + #unlink TOC, DOC; Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/user_manual_style.css diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/user_manual_style.css:1.1 *** /dev/null Mon Dec 29 11:37:49 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/docs/user_manual_style.css Mon Dec 29 11:37:39 2003 *************** *** 0 **** --- 1,112 ---- + From criswell at cs.uiuc.edu Mon Dec 29 11:38:05 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Dec 29 11:38:05 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config/depcomp install-sh missing mkinstalldirs Message-ID: <200312291737.LAA03626@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config: depcomp added (r1.1) install-sh added (r1.1) missing added (r1.1) mkinstalldirs added (r1.1) --- Log message: Adding the C++ program lambda to the test suite. This is a "real" C++ application that currently appears to work on both Linux and Solaris. --- Diffs of the changes: (+1109 -0) Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config/depcomp diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config/depcomp:1.1 *** /dev/null Mon Dec 29 11:37:48 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config/depcomp Mon Dec 29 11:37:37 2003 *************** *** 0 **** --- 1,423 ---- + #! /bin/sh + + # depcomp - compile a program generating dependencies as side-effects + # Copyright 1999, 2000 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2, or (at your option) + # any later version. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a + # configuration script generated by Autoconf, you may include it under + # the same distribution terms that you use for the rest of that program. + + # Originally written by Alexandre Oliva . + + if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 + fi + # `libtool' can also be set to `yes' or `no'. + + if test -z "$depfile"; then + base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` + dir=`echo "$object" | sed 's,/.*$,/,'` + if test "$dir" = "$object"; then + dir= + fi + # FIXME: should be _deps on DOS. + depfile="$dir.deps/$base" + fi + + tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + + rm -f "$tmpdepfile" + + # Some modes work just like other modes, but use different flags. We + # parameterize here, but still list the modes in the big case below, + # to make depend.m4 easier to write. Note that we *cannot* use a case + # here, because this file can only contain one case statement. + if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc + fi + + if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout + fi + + case "$depmode" in + gcc3) + ## gcc 3 implements dependency tracking that does exactly what + ## we want. Yay! Note: for some reason libtool 1.4 doesn't like + ## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + + gcc) + ## There are various ways to get dependency output from gcc. Here's + ## why we pick this rather obscure method: + ## - Don't want to use -MD because we'd like the dependencies to end + ## up in a subdir. Having to rename by hand is ugly. + ## (We might end up doing this anyway to support other compilers.) + ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like + ## -MM, not -M (despite what the docs say). + ## - Using -M directly means running the compiler twice (even worse + ## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz + ## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" + ## This next piece of magic avoids the `deleted header file' problem. + ## The problem is that when a header file which appears in a .P file + ## is deleted, the dependency causes make to die (because there is + ## typically no way to rebuild the header). We avoid this by adding + ## dummy dependencies for each header file. Too bad gcc doesn't do + ## this for us directly. + tr ' ' ' + ' < "$tmpdepfile" | + ## Some versions of gcc put a space before the `:'. On the theory + ## that the space means something, we add a space to the output as + ## well. + ## Some versions of the HPUX 10.20 sed can't process this invocation + ## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + + hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + + sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' + ' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' + ' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' + ' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + + aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. This file always lives in the current directory. + # Also, the AIX compiler puts `$object:' at the start of each line; + # $object doesn't have directory information. + stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + outname="$stripped.o" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + + tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + tmpdepfile1="$dir.libs/$base.lo.d" + tmpdepfile2="$dir.libs/$base.d" + "$@" -Wc,-MD + else + tmpdepfile1="$dir$base.o.d" + tmpdepfile2="$dir$base.d" + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + if test -f "$tmpdepfile1"; then + tmpdepfile="$tmpdepfile1" + else + tmpdepfile="$tmpdepfile2" + fi + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a space and a tab in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + + #nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + + dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. We will use -o /dev/null later, + # however we can't do the remplacement now because + # `-o $object' might simply not be used + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + "$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' + ' < "$tmpdepfile" | \ + ## Some versions of the HPUX 10.20 sed can't process this invocation + ## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + + dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + + makedepend) + "$@" || exit $? + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + -*) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' + ' | \ + ## Some versions of the HPUX 10.20 sed can't process this invocation + ## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + + cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + + msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + + none) + exec "$@" + ;; + + *) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; + esac + + exit 0 Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config/install-sh diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config/install-sh:1.1 *** /dev/null Mon Dec 29 11:37:48 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config/install-sh Mon Dec 29 11:37:37 2003 *************** *** 0 **** --- 1,251 ---- + #!/bin/sh + # + # install - install a program, script, or datafile + # This comes from X11R5 (mit/util/scripts/install.sh). + # + # Copyright 1991 by the Massachusetts Institute of Technology + # + # Permission to use, copy, modify, distribute, and sell this software and its + # documentation for any purpose is hereby granted without fee, provided that + # the above copyright notice appear in all copies and that both that + # copyright notice and this permission notice appear in supporting + # documentation, and that the name of M.I.T. not be used in advertising or + # publicity pertaining to distribution of the software without specific, + # written prior permission. M.I.T. makes no representations about the + # suitability of this software for any purpose. It is provided "as is" + # without express or implied warranty. + # + # Calling this script install-sh is preferred over install.sh, to prevent + # `make' implicit rules from creating a file called install from it + # when there is no Makefile. + # + # This script is compatible with the BSD install script, but was written + # from scratch. It can only install one file at a time, a restriction + # shared with many OS's install programs. + + + # set DOITPROG to echo to test this script + + # Don't use :- since 4.3BSD and earlier shells don't like it. + doit="${DOITPROG-}" + + + # put in absolute paths if you don't have them in your path; or use env. vars. + + mvprog="${MVPROG-mv}" + cpprog="${CPPROG-cp}" + chmodprog="${CHMODPROG-chmod}" + chownprog="${CHOWNPROG-chown}" + chgrpprog="${CHGRPPROG-chgrp}" + stripprog="${STRIPPROG-strip}" + rmprog="${RMPROG-rm}" + mkdirprog="${MKDIRPROG-mkdir}" + + transformbasename="" + transform_arg="" + instcmd="$mvprog" + chmodcmd="$chmodprog 0755" + chowncmd="" + chgrpcmd="" + stripcmd="" + rmcmd="$rmprog -f" + mvcmd="$mvprog" + src="" + dst="" + dir_arg="" + + while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac + done + + if [ x"$src" = x ] + then + echo "install: no input file specified" + exit 1 + else + : + fi + + if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=$mkdirprog + fi + else + + # Waiting for this to be detected by the "$instcmd $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + + if [ -f "$src" ] || [ -d "$src" ] + then + : + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + : + fi + + # If destination is a directory, append the input filename; if your system + # does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + : + fi + fi + + ## this sed command emulates the dirname command + dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + + # Make sure that the destination directory exists. + # this part is taken from Noah Friedman's mkinstalldirs script + + # Skip lots of stat calls in the usual case. + if [ ! -d "$dstdir" ]; then + defaultIFS=' + ' + IFS="${IFS-${defaultIFS}}" + + oIFS="${IFS}" + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` + IFS="${oIFS}" + + pathcomp='' + + while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + : + fi + + pathcomp="${pathcomp}/" + done + fi + + if [ x"$dir_arg" != x ] + then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi + else + + # If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + + # don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + : + fi + + # Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + + # Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + + # and set any options; do chmod last to preserve setuid bits + + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && + + # Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + + fi && + + + exit 0 Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config/missing diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config/missing:1.1 *** /dev/null Mon Dec 29 11:37:48 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config/missing Mon Dec 29 11:37:37 2003 *************** *** 0 **** --- 1,336 ---- + #! /bin/sh + # Common stub for a few missing GNU programs while installing. + # Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. + # Originally by Fran,cois Pinard , 1996. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2, or (at your option) + # any later version. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a + # configuration script generated by Autoconf, you may include it under + # the same distribution terms that you use for the rest of that program. + + if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + fi + + run=: + + # In the cases where this matters, `missing' is being run in the + # srcdir already. + if test -f configure.ac; then + configure_ac=configure.ac + else + configure_ac=configure.in + fi + + case "$1" in + --run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + ;; + esac + + # If it does not exist, or fails to run (possibly an outdated version), + # try to emulate it. + case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ + $0 [OPTION]... PROGRAM [ARGUMENT]... + + Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an + error status if there is no known handling for PROGRAM. + + Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + + Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing 0.4 - GNU automake" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal*) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ + WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. + You can get \`$1Help2man' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then + # We have makeinfo, but it failed. + exit 1 + fi + + echo 1>&2 "\ + WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + tar) + shift + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + fi + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ + WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ + WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequirements for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; + esac + + exit 0 Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config/mkinstalldirs diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config/mkinstalldirs:1.1 *** /dev/null Mon Dec 29 11:37:48 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config/mkinstalldirs Mon Dec 29 11:37:38 2003 *************** *** 0 **** --- 1,99 ---- + #! /bin/sh + # mkinstalldirs --- make directory hierarchy + # Author: Noah Friedman + # Created: 1993-05-16 + # Public domain + + errstatus=0 + dirmode="" + + usage="\ + Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." + + # process command line arguments + while test $# -gt 0 ; do + case "${1}" in + -h | --help | --h* ) # -h for help + echo "${usage}" 1>&2; exit 0 ;; + -m ) # -m PERM arg + shift + test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } + dirmode="${1}" + shift ;; + -- ) shift; break ;; # stop option processing + -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option + * ) break ;; # first non-opt arg + esac + done + + for file + do + if test -d "$file"; then + shift + else + break + fi + done + + case $# in + 0) exit 0 ;; + esac + + case $dirmode in + '') + if mkdir -p -- . 2>/dev/null; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + fi ;; + *) + if mkdir -m "$dirmode" -p -- . 2>/dev/null; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + fi ;; + esac + + for file + do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + + lasterr="" + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp="$pathcomp/" + done + done + + exit $errstatus + + # Local Variables: + # mode: shell-script + # sh-indentation: 3 + # End: + # mkinstalldirs ends here From criswell at cs.uiuc.edu Mon Dec 29 11:38:09 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Dec 29 11:38:09 2003 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/COPYING ChangeLog INSTALL LICENSE.TXT Makefile Makefile.am Makefile.in aclocal.m4 config.h config.h.in configure configure.ac definitions definitions_with_numbers fdl.txt gpl.txt input lambda.cc node.cc node.h parse.cc parse.h token_stream.cc token_stream.h Message-ID: <200312291737.LAA03613@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Applications/lambda-0.1.3: COPYING added (r1.1) ChangeLog added (r1.1) INSTALL added (r1.1) LICENSE.TXT added (r1.1) Makefile added (r1.1) Makefile.am added (r1.1) Makefile.in added (r1.1) aclocal.m4 added (r1.1) config.h added (r1.1) config.h.in added (r1.1) configure added (r1.1) configure.ac added (r1.1) definitions added (r1.1) definitions_with_numbers added (r1.1) fdl.txt added (r1.1) gpl.txt added (r1.1) input added (r1.1) lambda.cc added (r1.1) node.cc added (r1.1) node.h added (r1.1) parse.cc added (r1.1) parse.h added (r1.1) token_stream.cc added (r1.1) token_stream.h added (r1.1) --- Log message: Adding the C++ program lambda to the test suite. This is a "real" C++ application that currently appears to work on both Linux and Solaris. --- Diffs of the changes: (+10774 -0) Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/COPYING diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/COPYING:1.1 *** /dev/null Mon Dec 29 11:37:45 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/COPYING Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,7 ---- + This software is distributed under the provisions of the + GNU GENERAL PUBLIC LICENSE, Version 2, June 1991, + a copy of which may be found in gpl.txt. + + The documentation is distributed under the provisions of the + GNU Free Documentation License, Version 1.2, November 2002, + a copy of which may be found in fdl.txt. Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/ChangeLog diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/ChangeLog:1.1 *** /dev/null Mon Dec 29 11:37:45 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/ChangeLog Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,149 ---- + 2003-08-19 22:10 narwhal + + * docs/lambdamanual_src.html: spelling + + 2003-08-19 21:48 narwhal + + * docs/lambda.html: Updated news and download in lambda web page. + + 2003-08-19 21:38 narwhal + + * lambda, node.cc, node.h, parse.cc, docs/lambdamanual_src.html: + Added flag xapp to command "ext" to make it more consistent in + the way it extracts from a constant expression. + + 2003-08-19 19:14 narwhal + + * docs/lambdamanual_src.html: Spacing and spans. + + 2003-08-19 18:45 narwhal + + * Makefile.am, configure.ac, docs/.cvsignore, docs/Makefile.am, + docs/lambdamanual.html, docs/lambdamanual_src.html, + docs/trans_xml_for_cat.pl, docs/user_manual_style.css: Make + lambdamanual.html from lambdamanual_src.html using + trans_xml_for_cat.pl Added Files:docs/.cvsignore docs/Makefile.am + docs/lambdamanual_src.html docs/trans_xml_for_cat.pl + + 2003-08-19 16:11 narwhal + + * docs/: lambda.html, lambdamanual.html: Minor edit. + + 2003-08-18 22:02 narwhal + + * docs/lambdamanual.html: Minor Edit. + + 2003-08-18 21:54 narwhal + + * docs/lambda.html: Update download version. + + 2003-08-18 21:53 narwhal + + * docs/lambda.html: Updated News for release of version 0.1.2. + + 2003-08-18 21:18 narwhal + + * Makefile.am, configure.ac: Updated version to 0.1.2 Changed docs + dist to only those that are useful. + + 2003-08-18 21:13 narwhal + + * docs/lambdamanual.html: Spelling + + 2003-08-18 21:10 narwhal + + * docs/: lambdamanual.html, user_manual_style.css: Added List to + lambdamanual Added: user_manual_style.css + + 2003-08-18 11:57 narwhal + + * docs/lambdamanual.html: More Curry Algebra. + + 2003-08-18 03:25 narwhal + + * docs/lambdamanual.html: More curry algebra completeness. + + 2003-08-18 00:56 narwhal + + * docs/lambdamanual.html: Adding info about functional completeness + to manual. + + 2003-08-17 22:47 narwhal + + * texput.log: Removed Files:texput.log + + 2003-08-17 19:48 narwhal + + * docs/lambda.html: Updated news. + + 2003-08-17 19:28 narwhal + + * docs/lambdamanual.html: Correction for definition of: ext x + lambda-exp. + + 2003-08-16 01:03 narwhal + + * docs/lambda.html: Minor correction. + + 2003-08-16 00:53 narwhal + + * docs/lambda.html: Added lambda.html + + 2003-08-16 00:28 narwhal + + * COPYING, INSTALL, fdl.txt, gpl.txt, lambda, + docs/lambdamanual.html: Minor documentation changes Modified + Files: Added Files: COPYING fdl.txt gpl.txt + + 2003-08-16 00:06 narwhal + + * INSTALL, lambda.cc, node.cc, node.h, parse.cc, parse.h, + token_stream.cc, token_stream.h: Add gpl notice + + 2003-08-15 23:57 narwhal + + * .Makefile, .cvsignore, .makefile, .makefile.root, .makerules.sh, + Makefile, Makefile.am, bootstrap, configure.ac, do_configure, + lambda, lambda.cc, makefile, makefile.root, makerules.sh, + node.cc, parse.cc, token_stream.cc: Converted to auto tools + + 2003-08-15 21:37 narwhal + + * docs/lambdamanual.html: Clean up html + + 2002-12-02 18:15 narwhal + + * .cvsignore, Makefile, lambda, token_stream.cc, + docs/lambdamanual.html: added Makefile and .cvsignore repair + bracket warning in toke_stream.cc + + 2001-07-18 10:32 narwhal + + * lambda, node.cc: debug + + 2001-07-15 18:35 narwhal + + * lambda, makefile, node.cc: Changed make to compile for debug + (-g). In lam_node::reduce_eta, when body_v is an app_node, + changed this->body_v = 0 to set_body(0,true) to avoid what + appears to bea memory leak. Added: when printing app_node, with + print "()" for NULL left_v or right_v. + + 2001-07-15 14:49 narwhal + + * definitions, definitions_with_numbers, lambda, lambda.cc, + makefile, makefile.root, makerules.sh, node.cc, node.h, parse.cc, + parse.h, texput.log, token_stream.cc, token_stream.h, + docs/definitions, docs/equalities.txt, docs/lambdaabstract.doc, + docs/lambdaexamples.doc, docs/lambdamanual.doc, + docs/lambdamanual.html: Initial revision + + 2001-07-15 14:49 narwhal + + * definitions, definitions_with_numbers, lambda, lambda.cc, + makefile, makefile.root, makerules.sh, node.cc, node.h, parse.cc, + parse.h, texput.log, token_stream.cc, token_stream.h, + docs/definitions, docs/equalities.txt, docs/lambdaabstract.doc, + docs/lambdaexamples.doc, docs/lambdamanual.doc, + docs/lambdamanual.html: lambda source + Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/INSTALL diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/INSTALL:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/INSTALL Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,7 ---- + ./do_configure + make + make install + + Unfortunately, the name + lambda clashes with another program lambda + which is part of the tetex-1.0.7-57.1 package Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/LICENSE.TXT diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/LICENSE.TXT:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/LICENSE.TXT Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,5 ---- + Lambda + ------------------------------------------------------------------------------ + Lambda is licensed under the GNU General Public License. Please see the + file COPYING for more information. + Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/Makefile diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/Makefile:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/Makefile Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,6 ---- + LEVEL = ../../../../.. + PROG = lambda + LDFLAGS = -lsupc++ + LIBS += -lsupc++ + STDIN_FILENAME=$(BUILD_SRC_DIR)/input + include ../../Makefile.multisrc Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/Makefile.am diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/Makefile.am:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/Makefile.am Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,24 ---- + SUBDIRS=docs + bin_PROGRAMS = lambda + data_DATA = definitions + lambda_SOURCES=\ + lambda.cc \ + node.cc \ + node.h \ + parse.cc \ + parse.h \ + token_stream.cc \ + token_stream.h + + lambda_LDADD=-lstdc++ + AM_CXXFLAGS=-Wall + AM_LDFLAGS= + + EXTRA_DIST=definitions definitions_with_numbers \ + fdl.txt gpl.txt + + CLEANFILES=lambda + + ChangeLog: FORCE + cvs2cl.pl + FORCE: Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/Makefile.in diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/Makefile.in:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/Makefile.in Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,553 ---- + # Makefile.in generated by automake 1.6.3 from Makefile.am. + # @configure_input@ + + # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + # Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY, to the extent permitted by law; without + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + + @SET_MAKE@ + SHELL = @SHELL@ + + srcdir = @srcdir@ + top_srcdir = @top_srcdir@ + VPATH = @srcdir@ + prefix = @prefix@ + exec_prefix = @exec_prefix@ + + bindir = @bindir@ + sbindir = @sbindir@ + libexecdir = @libexecdir@ + datadir = @datadir@ + sysconfdir = @sysconfdir@ + sharedstatedir = @sharedstatedir@ + localstatedir = @localstatedir@ + libdir = @libdir@ + infodir = @infodir@ + mandir = @mandir@ + includedir = @includedir@ + oldincludedir = /usr/include + pkgdatadir = $(datadir)/@PACKAGE@ + pkglibdir = $(libdir)/@PACKAGE@ + pkgincludedir = $(includedir)/@PACKAGE@ + top_builddir = . + + ACLOCAL = @ACLOCAL@ + AUTOCONF = @AUTOCONF@ + AUTOMAKE = @AUTOMAKE@ + AUTOHEADER = @AUTOHEADER@ + + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd + INSTALL = @INSTALL@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ + INSTALL_DATA = @INSTALL_DATA@ + install_sh_DATA = $(install_sh) -c -m 644 + install_sh_PROGRAM = $(install_sh) -c + install_sh_SCRIPT = $(install_sh) -c + INSTALL_SCRIPT = @INSTALL_SCRIPT@ + INSTALL_HEADER = $(INSTALL_DATA) + transform = @program_transform_name@ + NORMAL_INSTALL = : + PRE_INSTALL = : + POST_INSTALL = : + NORMAL_UNINSTALL = : + PRE_UNINSTALL = : + POST_UNINSTALL = : + + EXEEXT = @EXEEXT@ + OBJEXT = @OBJEXT@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + AMTAR = @AMTAR@ + AWK = @AWK@ + CC = @CC@ + CXX = @CXX@ + DEPDIR = @DEPDIR@ + INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ + PACKAGE = @PACKAGE@ + STRIP = @STRIP@ + VERSION = @VERSION@ + am__include = @am__include@ + am__quote = @am__quote@ + install_sh = @install_sh@ + SUBDIRS = docs + bin_PROGRAMS = lambda + data_DATA = definitions + lambda_SOURCES = \ + lambda.cc \ + node.cc \ + node.h \ + parse.cc \ + parse.h \ + token_stream.cc \ + token_stream.h + + + lambda_LDADD = -lstdc++ + AM_CXXFLAGS = -Wall + AM_LDFLAGS = + + EXTRA_DIST = definitions definitions_with_numbers \ + fdl.txt gpl.txt + + + CLEANFILES = lambda + subdir = . + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs + CONFIG_HEADER = config.h + CONFIG_CLEAN_FILES = + bin_PROGRAMS = lambda$(EXEEXT) + PROGRAMS = $(bin_PROGRAMS) + + am_lambda_OBJECTS = lambda.$(OBJEXT) node.$(OBJEXT) parse.$(OBJEXT) \ + token_stream.$(OBJEXT) + lambda_OBJECTS = $(am_lambda_OBJECTS) + lambda_DEPENDENCIES = + lambda_LDFLAGS = + + DEFS = @DEFS@ + DEFAULT_INCLUDES = -I. -I$(srcdir) -I. + CPPFLAGS = @CPPFLAGS@ + LDFLAGS = @LDFLAGS@ + LIBS = @LIBS@ + depcomp = $(SHELL) $(top_srcdir)/config/depcomp + am__depfiles_maybe = depfiles + @AMDEP_TRUE at DEP_FILES = ./$(DEPDIR)/lambda.Po ./$(DEPDIR)/node.Po \ + @AMDEP_TRUE@ ./$(DEPDIR)/parse.Po ./$(DEPDIR)/token_stream.Po + CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) + CXXLD = $(CXX) + CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ + CXXFLAGS = @CXXFLAGS@ + CFLAGS = @CFLAGS@ + COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + CCLD = $(CC) + LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + DIST_SOURCES = $(lambda_SOURCES) + DATA = $(data_DATA) + + + RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive + DIST_COMMON = COPYING ChangeLog INSTALL Makefile.am Makefile.in \ + aclocal.m4 config.h.in config/depcomp config/install-sh \ + config/missing config/mkinstalldirs configure configure.ac + DIST_SUBDIRS = $(SUBDIRS) + SOURCES = $(lambda_SOURCES) + + all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + + .SUFFIXES: + .SUFFIXES: .cc .o .obj + + am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno + $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile + Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) + + $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + $(srcdir)/configure: $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + + $(ACLOCAL_M4): configure.ac + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + + config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ + else :; fi + + stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h + + $(srcdir)/config.h.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOHEADER) + touch $(srcdir)/config.h.in + + distclean-hdr: + -rm -f config.h stamp-h1 + binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) + install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \ + else :; fi; \ + done + + uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ + rm -f $(DESTDIR)$(bindir)/$$f; \ + done + + clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + lambda$(EXEEXT): $(lambda_OBJECTS) $(lambda_DEPENDENCIES) + @rm -f lambda$(EXEEXT) + $(CXXLINK) $(lambda_LDFLAGS) $(lambda_OBJECTS) $(lambda_LDADD) $(LIBS) + + mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + + distclean-compile: + -rm -f *.tab.c + + @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/lambda.Po at am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/node.Po at am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/parse.Po at am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/token_stream.Po at am__quote@ + + distclean-depend: + -rm -rf ./$(DEPDIR) + + .cc.o: + @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ + @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ + @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + + .cc.obj: + @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ + @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ + @AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CXXCOMPILE) -c -o $@ `cygpath -w $<` + CXXDEPMODE = @CXXDEPMODE@ + uninstall-info-am: + dataDATA_INSTALL = $(INSTALL_DATA) + install-dataDATA: $(data_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(datadir) + @list='$(data_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(dataDATA_INSTALL) $$d$$p $(DESTDIR)$(datadir)/$$f"; \ + $(dataDATA_INSTALL) $$d$$p $(DESTDIR)$(datadir)/$$f; \ + done + + uninstall-dataDATA: + @$(NORMAL_UNINSTALL) + @list='$(data_DATA)'; for p in $$list; do \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " rm -f $(DESTDIR)$(datadir)/$$f"; \ + rm -f $(DESTDIR)$(datadir)/$$f; \ + done + + # This directory's subdirectories are mostly independent; you can cd + # into them and run `make' without going through this Makefile. + # To change the values of `make' variables: instead of editing Makefiles, + # (1) if the variable is set in `config.status', edit `config.status' + # (which will cause the Makefiles to be regenerated when you run `make'); + # (2) otherwise, pass the desired values on the `make' command line. + $(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + + mostlyclean-recursive clean-recursive distclean-recursive \ + maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" + tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + + ETAGS = etags + ETAGSFLAGS = + + tags: TAGS + + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + + TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + + GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + + distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + + top_distdir = . + distdir = $(PACKAGE)-$(VERSION) + + am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } + + GZIP_ENV = --best + distcleancheck_listfiles = find . -type f -print + + distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkinstalldirs) $(distdir)/config + @list='$(DISTFILES)'; for file in $$list; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) + dist-gzip: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + + dist dist-all: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + + # This target untars the dist file and tries a VPATH configuration. Then + # it guarantees that the distribution is self-contained by making another + # tarfile. + distcheck: dist + $(am__remove_distdir) + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ + && cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + find $$dc_install_base -type f -print ; \ + exit 1; } >&2 ) \ + && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ + && rm -f $(distdir).tar.gz \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @echo "$(distdir).tar.gz is ready for distribution" | \ + sed 'h;s/./=/g;p;x;p;x' + distcleancheck: distclean + if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 + check-am: all-am + check: check-recursive + all-am: Makefile $(PROGRAMS) $(DATA) config.h + installdirs: installdirs-recursive + installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(datadir) + + install: install-recursive + install-exec: install-exec-recursive + install-data: install-data-recursive + uninstall: uninstall-recursive + + install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + + installcheck: installcheck-recursive + install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + mostlyclean-generic: + + clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + + distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + + maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + clean: clean-recursive + + clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + + distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-hdr distclean-tags + + dvi: dvi-recursive + + dvi-am: + + info: info-recursive + + info-am: + + install-data-am: install-dataDATA + + install-exec-am: install-binPROGRAMS + + install-info: install-info-recursive + + install-man: + + installcheck-am: + + maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf autom4te.cache + maintainer-clean-am: distclean-am maintainer-clean-generic + + mostlyclean: mostlyclean-recursive + + mostlyclean-am: mostlyclean-compile mostlyclean-generic + + uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA uninstall-info-am + + uninstall-info: uninstall-info-recursive + + .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-binPROGRAMS clean-generic clean-recursive dist dist-all \ + dist-gzip distcheck distclean distclean-compile \ + distclean-depend distclean-generic distclean-hdr \ + distclean-recursive distclean-tags distcleancheck distdir dvi \ + dvi-am dvi-recursive info info-am info-recursive install \ + install-am install-binPROGRAMS install-data install-data-am \ + install-data-recursive install-dataDATA install-exec \ + install-exec-am install-exec-recursive install-info \ + install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-recursive tags tags-recursive \ + uninstall uninstall-am uninstall-binPROGRAMS uninstall-dataDATA \ + uninstall-info-am uninstall-info-recursive uninstall-recursive + + + ChangeLog: FORCE + cvs2cl.pl + FORCE: + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/aclocal.m4 diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/aclocal.m4:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/aclocal.m4 Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,836 ---- + # aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*- + + # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 + # Free Software Foundation, Inc. + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY, to the extent permitted by law; without + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + + # Do all the work for Automake. -*- Autoconf -*- + + # This macro actually does too much some checks are only needed if + # your package does certain things. But this isn't really a big deal. + + # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 + # Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2, or (at your option) + # any later version. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + + # serial 8 + + # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be + # written in clear, in which case automake, when reading aclocal.m4, + # will think it sees a *use*, and therefore will trigger all it's + # C support machinery. Also note that it means that autoscan, seeing + # CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + AC_PREREQ([2.52]) + + # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow + # the ones we care about. + m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl + + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) + # AM_INIT_AUTOMAKE([OPTIONS]) + # ----------------------------------------------- + # The call with PACKAGE and VERSION arguments is the old style + # call (pre autoconf-2.50), which is being phased out. PACKAGE + # and VERSION should now be passed to AC_INIT and removed from + # the call to AM_INIT_AUTOMAKE. + # We support both call styles for the transition. After + # the next Automake release, Autoconf can make the AC_INIT + # arguments mandatory, and then we can depend on a new Autoconf + # release and drop the old call support. + AC_DEFUN([AM_INIT_AUTOMAKE], + [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl + # test to see if srcdir already configured + if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi + + # Define the identity of the package. + dnl Distinguish between old-style and new-style calls. + m4_ifval([$2], + [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], + [_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl + AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl + + _AM_IF_OPTION([no-define],, + [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + + # Some tools Automake needs. + AC_REQUIRE([AM_SANITY_CHECK])dnl + AC_REQUIRE([AC_ARG_PROGRAM])dnl + AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) + AM_MISSING_PROG(AUTOCONF, autoconf) + AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) + AM_MISSING_PROG(AUTOHEADER, autoheader) + AM_MISSING_PROG(MAKEINFO, makeinfo) + AM_MISSING_PROG(AMTAR, tar) + AM_PROG_INSTALL_SH + AM_PROG_INSTALL_STRIP + # We need awk for the "check" target. The system "awk" is bad on + # some platforms. + AC_REQUIRE([AC_PROG_AWK])dnl + AC_REQUIRE([AC_PROG_MAKE_SET])dnl + + _AM_IF_OPTION([no-dependencies],, + [AC_PROVIDE_IFELSE([AC_PROG_][CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_][CC], + defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl + AC_PROVIDE_IFELSE([AC_PROG_][CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_][CXX], + defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl + ]) + ]) + + # Copyright 2002 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2, or (at your option) + # any later version. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + + # AM_AUTOMAKE_VERSION(VERSION) + # ---------------------------- + # Automake X.Y traces this macro to ensure aclocal.m4 has been + # generated from the m4 files accompanying Automake X.Y. + AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"]) + + # AM_SET_CURRENT_AUTOMAKE_VERSION + # ------------------------------- + # Call AM_AUTOMAKE_VERSION so it can be traced. + # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. + AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.6.3])]) + + # Helper functions for option handling. -*- Autoconf -*- + + # Copyright 2001, 2002 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2, or (at your option) + # any later version. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + + # serial 2 + + # _AM_MANGLE_OPTION(NAME) + # ----------------------- + AC_DEFUN([_AM_MANGLE_OPTION], + [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + + # _AM_SET_OPTION(NAME) + # ------------------------------ + # Set option NAME. Presently that only means defining a flag for this option. + AC_DEFUN([_AM_SET_OPTION], + [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + + # _AM_SET_OPTIONS(OPTIONS) + # ---------------------------------- + # OPTIONS is a space-separated list of Automake options. + AC_DEFUN([_AM_SET_OPTIONS], + [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + + # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) + # ------------------------------------------- + # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. + AC_DEFUN([_AM_IF_OPTION], + [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + + # + # Check to make sure that the build environment is sane. + # + + # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2, or (at your option) + # any later version. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + + # serial 3 + + # AM_SANITY_CHECK + # --------------- + AC_DEFUN([AM_SANITY_CHECK], + [AC_MSG_CHECKING([whether build environment is sane]) + # Just in case + sleep 1 + echo timestamp > conftest.file + # Do `set' in a subshell so we don't clobber the current shell's + # arguments. Must try -L first in case configure is actually a + # symlink; some systems play weird games with the mod time of symlinks + # (eg FreeBSD returns the mod time of the symlink's containing + # directory). + if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + + test "$[2]" = conftest.file + ) + then + # Ok. + : + else + AC_MSG_ERROR([newly created file is older than distributed files! + Check your system clock]) + fi + AC_MSG_RESULT(yes)]) + + # -*- Autoconf -*- + + + # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2, or (at your option) + # any later version. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + + # serial 3 + + # AM_MISSING_PROG(NAME, PROGRAM) + # ------------------------------ + AC_DEFUN([AM_MISSING_PROG], + [AC_REQUIRE([AM_MISSING_HAS_RUN]) + $1=${$1-"${am_missing_run}$2"} + AC_SUBST($1)]) + + + # AM_MISSING_HAS_RUN + # ------------------ + # Define MISSING if not defined so far and test if it supports --run. + # If it does, set am_missing_run to use it, otherwise, to nothing. + AC_DEFUN([AM_MISSING_HAS_RUN], + [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl + test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" + # Use eval to expand $SHELL + if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " + else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) + fi + ]) + + # AM_AUX_DIR_EXPAND + + # Copyright 2001 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2, or (at your option) + # any later version. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + + # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets + # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to + # `$srcdir', `$srcdir/..', or `$srcdir/../..'. + # + # Of course, Automake must honor this variable whenever it calls a + # tool from the auxiliary directory. The problem is that $srcdir (and + # therefore $ac_aux_dir as well) can be either absolute or relative, + # depending on how configure is run. This is pretty annoying, since + # it makes $ac_aux_dir quite unusable in subdirectories: in the top + # source directory, any form will work fine, but in subdirectories a + # relative path needs to be adjusted first. + # + # $ac_aux_dir/missing + # fails when called from a subdirectory if $ac_aux_dir is relative + # $top_srcdir/$ac_aux_dir/missing + # fails if $ac_aux_dir is absolute, + # fails when called from a subdirectory in a VPATH build with + # a relative $ac_aux_dir + # + # The reason of the latter failure is that $top_srcdir and $ac_aux_dir + # are both prefixed by $srcdir. In an in-source build this is usually + # harmless because $srcdir is `.', but things will broke when you + # start a VPATH build or use an absolute $srcdir. + # + # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, + # iff we strip the leading $srcdir from $ac_aux_dir. That would be: + # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` + # and then we would define $MISSING as + # MISSING="\${SHELL} $am_aux_dir/missing" + # This will work as long as MISSING is not called from configure, because + # unfortunately $(top_srcdir) has no meaning in configure. + # However there are other variables, like CC, which are often used in + # configure, and could therefore not use this "fixed" $ac_aux_dir. + # + # Another solution, used here, is to always expand $ac_aux_dir to an + # absolute PATH. The drawback is that using absolute paths prevent a + # configured tree to be moved without reconfiguration. + + # Rely on autoconf to set up CDPATH properly. + AC_PREREQ([2.50]) + + AC_DEFUN([AM_AUX_DIR_EXPAND], [ + # expand $ac_aux_dir to an absolute path + am_aux_dir=`cd $ac_aux_dir && pwd` + ]) + + # AM_PROG_INSTALL_SH + # ------------------ + # Define $install_sh. + + # Copyright 2001 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2, or (at your option) + # any later version. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + + AC_DEFUN([AM_PROG_INSTALL_SH], + [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl + install_sh=${install_sh-"$am_aux_dir/install-sh"} + AC_SUBST(install_sh)]) + + # AM_PROG_INSTALL_STRIP + + # Copyright 2001 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2, or (at your option) + # any later version. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + + # One issue with vendor `install' (even GNU) is that you can't + # specify the program used to strip binaries. This is especially + # annoying in cross-compiling environments, where the build's strip + # is unlikely to handle the host's binaries. + # Fortunately install-sh will honor a STRIPPROG variable, so we + # always use install-sh in `make install-strip', and initialize + # STRIPPROG with the value of the STRIP variable (set by the user). + AC_DEFUN([AM_PROG_INSTALL_STRIP], + [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl + # Installed binaries are usually stripped using `strip' when the user + # run `make install-strip'. However `strip' might not be the right + # tool to use in cross-compilation environments, therefore Automake + # will honor the `STRIP' environment variable to overrule this program. + dnl Don't test for $cross_compiling = yes, because it might be `maybe'. + if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) + fi + INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + AC_SUBST([INSTALL_STRIP_PROGRAM])]) + + # serial 4 -*- Autoconf -*- + + # Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2, or (at your option) + # any later version. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + + + # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be + # written in clear, in which case automake, when reading aclocal.m4, + # will think it sees a *use*, and therefore will trigger all it's + # C support machinery. Also note that it means that autoscan, seeing + # CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + + # _AM_DEPENDENCIES(NAME) + # ---------------------- + # See how the compiler implements dependency checking. + # NAME is "CC", "CXX", "GCJ", or "OBJC". + # We try a few techniques and use that to set a single cache variable. + # + # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was + # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular + # dependency, and given that the user is not expected to run this macro, + # just rely on AC_PROG_CC. + AC_DEFUN([_AM_DEPENDENCIES], + [AC_REQUIRE([AM_SET_DEPDIR])dnl + AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl + AC_REQUIRE([AM_MAKE_INCLUDE])dnl + AC_REQUIRE([AM_DEP_TRACK])dnl + + ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + + AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], + [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir + else + am_cv_$1_dependencies_compiler_type=none + fi + ]) + AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) + ]) + + + # AM_SET_DEPDIR + # ------------- + # Choose a directory name for dependency files. + # This macro is AC_REQUIREd in _AM_DEPENDENCIES + AC_DEFUN([AM_SET_DEPDIR], + [rm -f .deps 2>/dev/null + mkdir .deps 2>/dev/null + if test -d .deps; then + DEPDIR=.deps + else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps + fi + rmdir .deps 2>/dev/null + AC_SUBST([DEPDIR]) + ]) + + + # AM_DEP_TRACK + # ------------ + AC_DEFUN([AM_DEP_TRACK], + [AC_ARG_ENABLE(dependency-tracking, + [ --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors]) + if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + fi + AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) + AC_SUBST([AMDEPBACKSLASH]) + ]) + + # Generate code to set up dependency tracking. -*- Autoconf -*- + + # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2, or (at your option) + # any later version. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + + #serial 2 + + # _AM_OUTPUT_DEPENDENCY_COMMANDS + # ------------------------------ + AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], + [for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done + ])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + + # AM_OUTPUT_DEPENDENCY_COMMANDS + # ----------------------------- + # This macro should only be invoked once -- use via AC_REQUIRE. + # + # This code is only required when automatic dependency tracking + # is enabled. FIXME. This creates each `.P' file that we will + # need in order to bootstrap the dependency handling code. + AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], + [AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) + ]) + + # Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*- + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2, or (at your option) + # any later version. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + + # serial 2 + + # AM_MAKE_INCLUDE() + # ----------------- + # Check to see how make treats includes. + AC_DEFUN([AM_MAKE_INCLUDE], + [am_make=${MAKE-make} + cat > confinc << 'END' + doit: + @echo done + END + # If we don't find an include directive, just comment out the code. + AC_MSG_CHECKING([for style of include used by $am_make]) + am__include="#" + am__quote= + _am_result=none + # First try GNU make style include. + echo "include confinc" > confmf + # We grep out `Entering directory' and `Leaving directory' + # messages which can occur if `w' ends up in MAKEFLAGS. + # In particular we don't look at `^make:' because GNU make might + # be invoked under some other name (usually "gmake"), in which + # case it prints its new name instead of `make'. + if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU + fi + # Now try BSD make style include. + if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi + fi + AC_SUBST(am__include) + AC_SUBST(am__quote) + AC_MSG_RESULT($_am_result) + rm -f confinc confmf + ]) + + # AM_CONDITIONAL -*- Autoconf -*- + + # Copyright 1997, 2000, 2001 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2, or (at your option) + # any later version. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + + # serial 5 + + AC_PREREQ(2.52) + + # AM_CONDITIONAL(NAME, SHELL-CONDITION) + # ------------------------------------- + # Define a conditional. + AC_DEFUN([AM_CONDITIONAL], + [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl + AC_SUBST([$1_TRUE]) + AC_SUBST([$1_FALSE]) + if $2; then + $1_TRUE= + $1_FALSE='#' + else + $1_TRUE='#' + $1_FALSE= + fi + AC_CONFIG_COMMANDS_PRE( + [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([conditional \"$1\" was never defined. + Usually this means the macro was only invoked conditionally.]) + fi])]) + + # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- + + # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2, or (at your option) + # any later version. + + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + # 02111-1307, USA. + + AC_PREREQ([2.52]) + + # serial 6 + + # When config.status generates a header, we must update the stamp-h file. + # This file resides in the same directory as the config header + # that is generated. We must strip everything past the first ":", + # and everything past the last "/". + + # _AM_DIRNAME(PATH) + # ----------------- + # Like AS_DIRNAME, only do it during macro expansion + AC_DEFUN([_AM_DIRNAME], + [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, + m4_if(regexp([$1], [^//\([^/]\|$\)]), -1, + m4_if(regexp([$1], [^/.*]), -1, + [.], + patsubst([$1], [^\(/\).*], [\1])), + patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), + patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl + ])# _AM_DIRNAME + + + # The stamp files are numbered to have different names. + # We could number them on a directory basis, but that's additional + # complications, let's have a unique counter. + m4_define([_AM_STAMP_Count], [0]) + + + # _AM_STAMP(HEADER) + # ----------------- + # The name of the stamp file for HEADER. + AC_DEFUN([_AM_STAMP], + [m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl + AS_ESCAPE(_AM_DIRNAME(patsubst([$1], + [:.*])))/stamp-h[]_AM_STAMP_Count]) + + + # _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS) + # ------------------------------------------------------------ + # We used to try to get a real timestamp in stamp-h. But the fear is that + # that will cause unnecessary cvs conflicts. + AC_DEFUN([_AM_CONFIG_HEADER], + [# Add the stamp file to the list of files AC keeps track of, + # along with our hook. + AC_CONFIG_HEADERS([$1], + [# update the timestamp + echo 'timestamp for $1' >"_AM_STAMP([$1])" + $2], + [$3]) + ])# _AM_CONFIG_HEADER + + + # AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS) + # -------------------------------------------------------------- + AC_DEFUN([AM_CONFIG_HEADER], + [AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])]) + ])# AM_CONFIG_HEADER + Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config.h diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config.h:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config.h Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,74 ---- + /* config.h. Generated by configure. */ + /* config.h.in. Generated from configure.ac by autoheader. */ + + /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ + #define HAVE_DOPRNT 1 + + /* Define to 1 if you have the `getcwd' function. */ + #define HAVE_GETCWD 1 + + /* Define to 1 if you have the header file. */ + #define HAVE_INTTYPES_H 1 + + /* Define to 1 if you have the header file. */ + #define HAVE_MEMORY_H 1 + + /* Define to 1 if you have the header file. */ + #define HAVE_STDINT_H 1 + + /* Define to 1 if you have the header file. */ + #define HAVE_STDLIB_H 1 + + /* Define to 1 if you have the `strchr' function. */ + #define HAVE_STRCHR 1 + + /* Define to 1 if you have the `strerror' function. */ + #define HAVE_STRERROR 1 + + /* Define to 1 if you have the header file. */ + #define HAVE_STRINGS_H 1 + + /* Define to 1 if you have the header file. */ + #define HAVE_STRING_H 1 + + /* Define to 1 if you have the header file. */ + #define HAVE_SYS_PARAM_H 1 + + /* Define to 1 if you have the header file. */ + #define HAVE_SYS_STAT_H 1 + + /* Define to 1 if you have the header file. */ + #define HAVE_SYS_TYPES_H 1 + + /* Define to 1 if you have the header file. */ + #define HAVE_UNISTD_H 1 + + /* Define to 1 if you have the `vprintf' function. */ + #define HAVE_VPRINTF 1 + + /* Name of package */ + #define PACKAGE "lambda" + + /* Define to the address where bug reports for this package should be sent. */ + #define PACKAGE_BUGREPORT "usdesign at earthlink.net" + + /* Define to the full name of this package. */ + #define PACKAGE_NAME "lambda" + + /* Define to the full name and version of this package. */ + #define PACKAGE_STRING "lambda 0.1.3" + + /* Define to the one symbol short name of this package. */ + #define PACKAGE_TARNAME "lambda" + + /* Define to the version of this package. */ + #define PACKAGE_VERSION "0.1.3" + + /* Define to 1 if you have the ANSI C header files. */ + #define STDC_HEADERS 1 + + /* Version number of package */ + #define VERSION "0.1.3" + + /* Define to empty if `const' does not conform to ANSI C. */ + /* #undef const */ Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config.h.in diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config.h.in:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/config.h.in Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,73 ---- + /* config.h.in. Generated from configure.ac by autoheader. */ + + /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ + #undef HAVE_DOPRNT + + /* Define to 1 if you have the `getcwd' function. */ + #undef HAVE_GETCWD + + /* Define to 1 if you have the header file. */ + #undef HAVE_INTTYPES_H + + /* Define to 1 if you have the header file. */ + #undef HAVE_MEMORY_H + + /* Define to 1 if you have the header file. */ + #undef HAVE_STDINT_H + + /* Define to 1 if you have the header file. */ + #undef HAVE_STDLIB_H + + /* Define to 1 if you have the `strchr' function. */ + #undef HAVE_STRCHR + + /* Define to 1 if you have the `strerror' function. */ + #undef HAVE_STRERROR + + /* Define to 1 if you have the header file. */ + #undef HAVE_STRINGS_H + + /* Define to 1 if you have the header file. */ + #undef HAVE_STRING_H + + /* Define to 1 if you have the header file. */ + #undef HAVE_SYS_PARAM_H + + /* Define to 1 if you have the header file. */ + #undef HAVE_SYS_STAT_H + + /* Define to 1 if you have the header file. */ + #undef HAVE_SYS_TYPES_H + + /* Define to 1 if you have the header file. */ + #undef HAVE_UNISTD_H + + /* Define to 1 if you have the `vprintf' function. */ + #undef HAVE_VPRINTF + + /* Name of package */ + #undef PACKAGE + + /* Define to the address where bug reports for this package should be sent. */ + #undef PACKAGE_BUGREPORT + + /* Define to the full name of this package. */ + #undef PACKAGE_NAME + + /* Define to the full name and version of this package. */ + #undef PACKAGE_STRING + + /* Define to the one symbol short name of this package. */ + #undef PACKAGE_TARNAME + + /* Define to the version of this package. */ + #undef PACKAGE_VERSION + + /* Define to 1 if you have the ANSI C header files. */ + #undef STDC_HEADERS + + /* Version number of package */ + #undef VERSION + + /* Define to empty if `const' does not conform to ANSI C. */ + #undef const Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/configure diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/configure:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/configure Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,5090 ---- + #! /bin/sh + # Guess values for system-dependent variables and create Makefiles. + # Generated by GNU Autoconf 2.53 for lambda 0.1.3. + # + # Report bugs to . + # + # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 + # Free Software Foundation, Inc. + # This configure script is free software; the Free Software Foundation + # gives unlimited permission to copy, distribute and modify it. + + if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr + else + as_expr=false + fi + + + ## --------------------- ## + ## M4sh Initialization. ## + ## --------------------- ## + + # Be Bourne compatible + if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix + fi + + # NLS nuisances. + # Support unset when possible. + if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset + else + as_unset=false + fi + + (set +x; test -n "`(LANG=C; export LANG) 2>&1`") && + { $as_unset LANG || test "${LANG+set}" != set; } || + { LANG=C; export LANG; } + (set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && + { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || + { LC_ALL=C; export LC_ALL; } + (set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && + { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || + { LC_TIME=C; export LC_TIME; } + (set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && + { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || + { LC_CTYPE=C; export LC_CTYPE; } + (set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && + { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || + { LANGUAGE=C; export LANGUAGE; } + (set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && + { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || + { LC_COLLATE=C; export LC_COLLATE; } + (set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && + { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || + { LC_NUMERIC=C; export LC_NUMERIC; } + (set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && + { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || + { LC_MESSAGES=C; export LC_MESSAGES; } + + + # Name of the executable. + as_me=`(basename "$0") 2>/dev/null || + $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || + echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + # PATH needs CR, and LINENO needs CR and PATH. + # Avoid depending upon Character Ranges. + as_cr_letters='abcdefghijklmnopqrstuvwxyz' + as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' + as_cr_Letters=$as_cr_letters$as_cr_LETTERS + as_cr_digits='0123456789' + as_cr_alnum=$as_cr_Letters$as_cr_digits + + # The user is always right. + if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conftest.sh + fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done + done + ;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit + } + + + case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' + ' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; + esac + + if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr + else + as_expr=false + fi + + rm -f conf$$ conf$$.exe conf$$.file + echo >conf$$.file + if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi + rm -f conf$$ conf$$.exe conf$$.file + + as_executable_p="test -f" + + # Sed expression to map a string onto a valid CPP name. + as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + + # Sed expression to map a string onto a valid variable name. + as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + + # IFS + # We need space, tab and new line, in precisely that order. + as_nl=' + ' + IFS=" $as_nl" + + # CDPATH. + $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } + + + # Name of the host. + # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, + # so uname gets run too. + ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + + exec 6>&1 + + # + # Initializations. + # + ac_default_prefix=/usr/local + cross_compiling=no + subdirs= + MFLAGS= + MAKEFLAGS= + SHELL=${CONFIG_SHELL-/bin/sh} + + # Maximum number of lines to put in a shell here document. + # This variable seems obsolete. It should probably be removed, and + # only ac_max_sed_lines should be used. + : ${ac_max_here_lines=38} + + # Identity of this package. + PACKAGE_NAME='lambda' + PACKAGE_TARNAME='lambda' + PACKAGE_VERSION='0.1.3' + PACKAGE_STRING='lambda 0.1.3' + PACKAGE_BUGREPORT='usdesign at earthlink.net' + + # Factoring default headers for most tests. + ac_includes_default="\ + #include + #if HAVE_SYS_TYPES_H + # include + #endif + #if HAVE_SYS_STAT_H + # include + #endif + #if STDC_HEADERS + # include + # include + #else + # if HAVE_STDLIB_H + # include + # endif + #endif + #if HAVE_STRING_H + # if !STDC_HEADERS && HAVE_MEMORY_H + # include + # endif + # include + #endif + #if HAVE_STRINGS_H + # include + #endif + #if HAVE_INTTYPES_H + # include + #else + # if HAVE_STDINT_H + # include + # endif + #endif + #if HAVE_UNISTD_H + # include + #endif" + + + # Initialize some variables set by options. + ac_init_help= + ac_init_version=false + # The variables have the same names as the options, with + # dashes changed to underlines. + cache_file=/dev/null + exec_prefix=NONE + no_create= + no_recursion= + prefix=NONE + program_prefix=NONE + program_suffix=NONE + program_transform_name=s,x,x, + silent= + site= + srcdir= + verbose= + x_includes=NONE + x_libraries=NONE + + # Installation directory options. + # These are left unexpanded so users can "make install exec_prefix=/foo" + # and all the variables that are supposed to be based on exec_prefix + # by default will actually change. + # Use braces instead of parens because sh, perl, etc. also accept them. + bindir='${exec_prefix}/bin' + sbindir='${exec_prefix}/sbin' + libexecdir='${exec_prefix}/libexec' + datadir='${prefix}/share' + sysconfdir='${prefix}/etc' + sharedstatedir='${prefix}/com' + localstatedir='${prefix}/var' + libdir='${exec_prefix}/lib' + includedir='${prefix}/include' + oldincludedir='/usr/include' + infodir='${prefix}/info' + mandir='${prefix}/man' + + ac_prev= + for ac_option + do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option + Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac + done + + if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } + fi + + # Be sure to have absolute paths. + for ac_var in exec_prefix prefix + do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac + done + + # Be sure to have absolute paths. + for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir + do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac + done + + # There might be people who depend on the old broken behavior: `$host' + # used to hold the argument of --host etc. + # FIXME: To remove some day. + build=$build_alias + host=$host_alias + target=$target_alias + + # FIXME: To remove some day. + if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi + fi + + ac_tool_prefix= + test -n "$host_alias" && ac_tool_prefix=$host_alias- + + test "$silent" = yes && exec 6>/dev/null + + + # Find the source files, if location was not specified. + if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || + $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || + echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi + else + ac_srcdir_defaulted=no + fi + if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi + fi + srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` + ac_env_build_alias_set=${build_alias+set} + ac_env_build_alias_value=$build_alias + ac_cv_env_build_alias_set=${build_alias+set} + ac_cv_env_build_alias_value=$build_alias + ac_env_host_alias_set=${host_alias+set} + ac_env_host_alias_value=$host_alias + ac_cv_env_host_alias_set=${host_alias+set} + ac_cv_env_host_alias_value=$host_alias + ac_env_target_alias_set=${target_alias+set} + ac_env_target_alias_value=$target_alias + ac_cv_env_target_alias_set=${target_alias+set} + ac_cv_env_target_alias_value=$target_alias + ac_env_CXX_set=${CXX+set} + ac_env_CXX_value=$CXX + ac_cv_env_CXX_set=${CXX+set} + ac_cv_env_CXX_value=$CXX + ac_env_CXXFLAGS_set=${CXXFLAGS+set} + ac_env_CXXFLAGS_value=$CXXFLAGS + ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} + ac_cv_env_CXXFLAGS_value=$CXXFLAGS + ac_env_LDFLAGS_set=${LDFLAGS+set} + ac_env_LDFLAGS_value=$LDFLAGS + ac_cv_env_LDFLAGS_set=${LDFLAGS+set} + ac_cv_env_LDFLAGS_value=$LDFLAGS + ac_env_CPPFLAGS_set=${CPPFLAGS+set} + ac_env_CPPFLAGS_value=$CPPFLAGS + ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} + ac_cv_env_CPPFLAGS_value=$CPPFLAGS + ac_env_CC_set=${CC+set} + ac_env_CC_value=$CC + ac_cv_env_CC_set=${CC+set} + ac_cv_env_CC_value=$CC + ac_env_CFLAGS_set=${CFLAGS+set} + ac_env_CFLAGS_value=$CFLAGS + ac_cv_env_CFLAGS_set=${CFLAGS+set} + ac_cv_env_CFLAGS_value=$CFLAGS + ac_env_CPP_set=${CPP+set} + ac_env_CPP_value=$CPP + ac_cv_env_CPP_set=${CPP+set} + ac_cv_env_CPP_value=$CPP + + # + # Report the --help message. + # + if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF + \`configure' configures lambda 0.1.3 to adapt to many kinds of systems. + + Usage: $0 [OPTION]... [VAR=VALUE]... + + To assign environment variables (e.g., CC, CFLAGS...), specify them as + VAR=VALUE. See below for descriptions of some of the useful variables. + + Defaults for the options are specified in brackets. + + Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + + _ACEOF + + cat <<_ACEOF + Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + + By default, \`make install' will install all the files in + \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify + an installation prefix other than \`$ac_default_prefix' using \`--prefix', + for instance \`--prefix=\$HOME'. + + For better control, use the options below. + + Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] + _ACEOF + + cat <<\_ACEOF + + Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + _ACEOF + fi + + if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of lambda 0.1.3:";; + esac + cat <<\_ACEOF + + Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors + + Some influential environment variables: + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CC C compiler command + CFLAGS C compiler flags + CPP C preprocessor + + Use these variables to override the choices made by `configure' or to help + it to find libraries and programs with nonstandard names/locations. + + Report bugs to . + _ACEOF + fi + + if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + + if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` + else + ac_dir_suffix= ac_top_builddir= + fi + + case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; + esac + # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be + # absolute. + ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` + ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` + ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` + ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done + fi + + test -n "$ac_init_help" && exit 0 + if $ac_init_version; then + cat <<\_ACEOF + lambda configure 0.1.3 + generated by GNU Autoconf 2.53 + + Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 + Free Software Foundation, Inc. + This configure script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it. + _ACEOF + exit 0 + fi + exec 5>config.log + cat >&5 <<_ACEOF + This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. + + It was created by lambda $as_me 0.1.3, which was + generated by GNU Autoconf 2.53. Invocation command line was + + $ $0 $@ + + _ACEOF + { + cat <<_ASUNAME + ## --------- ## + ## Platform. ## + ## --------- ## + + hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` + uname -m = `(uname -m) 2>/dev/null || echo unknown` + uname -r = `(uname -r) 2>/dev/null || echo unknown` + uname -s = `(uname -s) 2>/dev/null || echo unknown` + uname -v = `(uname -v) 2>/dev/null || echo unknown` + + /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` + /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + + /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` + /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` + /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` + hostinfo = `(hostinfo) 2>/dev/null || echo unknown` + /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` + /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` + /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + + _ASUNAME + + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" + done + + } >&5 + + cat >&5 <<_ACEOF + + + ## ----------- ## + ## Core tests. ## + ## ----------- ## + + _ACEOF + + + # Keep a trace of the command line. + # Strip out --no-create and --no-recursion so they do not pile up. + # Also quote any args containing shell meta-characters. + ac_configure_args= + ac_sep= + for ac_arg + do + case $ac_arg in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n ) continue ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + ac_sep=" " ;; + esac + # Get rid of the leading space. + done + + # When interrupted or exit'd, cleanup temporary files, and complete + # config.log. We remove comments because anyway the quotes in there + # would cause problems or look ugly. + # WARNING: Be sure not to use single quotes in there, as some shells, + # such as our DU 5.0 friend, will then `close' the trap. + trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + cat <<\_ASBOX + ## ---------------- ## + ## Cache variables. ## + ## ---------------- ## + _ASBOX + echo + # The following way of writing the cache mishandles newlines in values, + { + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; + } + echo + if test -s confdefs.h; then + cat <<\_ASBOX + ## ----------- ## + ## confdefs.h. ## + ## ----------- ## + _ASBOX + echo + sed "/^$/d" confdefs.h + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core core.* *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 + for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal + done + ac_signal=0 + + # confdefs.h avoids OS command line length limits that DEFS can exceed. + rm -rf conftest* confdefs.h + # AIX cpp loses on an empty file, so make sure it contains at least a newline. + echo >confdefs.h + + # Predefined preprocessor variables. + + cat >>confdefs.h <<_ACEOF + #define PACKAGE_NAME "$PACKAGE_NAME" + _ACEOF + + + cat >>confdefs.h <<_ACEOF + #define PACKAGE_TARNAME "$PACKAGE_TARNAME" + _ACEOF + + + cat >>confdefs.h <<_ACEOF + #define PACKAGE_VERSION "$PACKAGE_VERSION" + _ACEOF + + + cat >>confdefs.h <<_ACEOF + #define PACKAGE_STRING "$PACKAGE_STRING" + _ACEOF + + + cat >>confdefs.h <<_ACEOF + #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" + _ACEOF + + + # Let the site file select an alternate cache file if it wants to. + # Prefer explicitly selected file to automatically selected ones. + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi + for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 + echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi + done + + if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 + echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi + else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 + echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file + fi + + # Check that the precious variables saved in the cache have kept the same + # value. + ac_cache_corrupted=false + for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 + echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 + echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 + echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 + echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi + done + if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 + echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 + echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } + fi + + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + ac_aux_dir= + for ac_dir in config $srcdir/config; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi + done + if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config $srcdir/config" >&5 + echo "$as_me: error: cannot find install-sh or install.sh in config $srcdir/config" >&2;} + { (exit 1); exit 1; }; } + fi + ac_config_guess="$SHELL $ac_aux_dir/config.guess" + ac_config_sub="$SHELL $ac_aux_dir/config.sub" + ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + + am__api_version="1.6" + # Find a good install program. We prefer a C program (faster), + # so one script is as good as another. But avoid the broken or + # incompatible versions: + # SysV /etc/install, /usr/sbin/install + # SunOS /usr/etc/install + # IRIX /sbin/install + # AIX /bin/install + # AmigaOS /C/install, which installs bootblocks on floppy discs + # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag + # AFS /usr/afsws/bin/install, which mishandles nonexistent args + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" + # ./install, which can be erroneously created by make from ./install.sh. + echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 + echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 + if test -z "$INSTALL"; then + if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. + case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; + esac + done + + + fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi + fi + echo "$as_me:$LINENO: result: $INSTALL" >&5 + echo "${ECHO_T}$INSTALL" >&6 + + # Use test -z because SunOS4 sh mishandles braces in ${var-val}. + # It thinks the first close brace ends the variable substitution. + test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + + test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + echo "$as_me:$LINENO: checking whether build environment is sane" >&5 + echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 + # Just in case + sleep 1 + echo timestamp > conftest.file + # Do `set' in a subshell so we don't clobber the current shell's + # arguments. Must try -L first in case configure is actually a + # symlink; some systems play weird games with the mod time of symlinks + # (eg FreeBSD returns the mod time of the symlink's containing + # directory). + if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken + alias in your environment" >&5 + echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken + alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) + then + # Ok. + : + else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! + Check your system clock" >&5 + echo "$as_me: error: newly created file is older than distributed files! + Check your system clock" >&2;} + { (exit 1); exit 1; }; } + fi + echo "$as_me:$LINENO: result: yes" >&5 + echo "${ECHO_T}yes" >&6 + test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" + # Use a double $ so make ignores it. + test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" + # Double any \ or $. echo might interpret backslashes. + # By default was `s,x,x', remove it if useless. + cat <<\_ACEOF >conftest.sed + s/[\\$]/&&/g;s/;s,x,x,$// + _ACEOF + program_transform_name=`echo $program_transform_name | sed -f conftest.sed` + rm conftest.sed + + + # expand $ac_aux_dir to an absolute path + am_aux_dir=`cd $ac_aux_dir && pwd` + + test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" + # Use eval to expand $SHELL + if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " + else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 + echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} + fi + + for ac_prog in gawk mawk nawk awk + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo "$as_me:$LINENO: checking for $ac_word" >&5 + echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 + if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done + done + + fi + fi + AWK=$ac_cv_prog_AWK + if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 + echo "${ECHO_T}$AWK" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 + fi + + test -n "$AWK" && break + done + + echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5 + echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 + set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` + if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.make <<\_ACEOF + all: + @echo 'ac_maketemp="${MAKE}"' + _ACEOF + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` + if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes + else + eval ac_cv_prog_make_${ac_make}_set=no + fi + rm -f conftest.make + fi + if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 + echo "${ECHO_T}yes" >&6 + SET_MAKE= + else + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" + fi + + # test to see if srcdir already configured + if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 + echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } + fi + + # Define the identity of the package. + PACKAGE=lambda + VERSION=0.1.3 + + + cat >>confdefs.h <<_ACEOF + #define PACKAGE "$PACKAGE" + _ACEOF + + + cat >>confdefs.h <<_ACEOF + #define VERSION "$VERSION" + _ACEOF + + # Some tools Automake needs. + + ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + + AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + + AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + + AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + + MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + + + AMTAR=${AMTAR-"${am_missing_run}tar"} + + install_sh=${install_sh-"$am_aux_dir/install-sh"} + + # Installed binaries are usually stripped using `strip' when the user + # run `make install-strip'. However `strip' might not be the right + # tool to use in cross-compilation environments, therefore Automake + # will honor the `STRIP' environment variable to overrule this program. + if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. + set dummy ${ac_tool_prefix}strip; ac_word=$2 + echo "$as_me:$LINENO: checking for $ac_word" >&5 + echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 + if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done + done + + fi + fi + STRIP=$ac_cv_prog_STRIP + if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 + echo "${ECHO_T}$STRIP" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 + fi + + fi + if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. + set dummy strip; ac_word=$2 + echo "$as_me:$LINENO: checking for $ac_word" >&5 + echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 + if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done + done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" + fi + fi + ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP + if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 + echo "${ECHO_T}$ac_ct_STRIP" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 + fi + + STRIP=$ac_ct_STRIP + else + STRIP="$ac_cv_prog_STRIP" + fi + + fi + INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + + # We need awk for the "check" target. The system "awk" is bad on + # some platforms. + + + + ##AC_CONFIG_SRCDIR([lambda.cc]) + # Add the stamp file to the list of files AC keeps track of, + # along with our hook. + ac_config_headers="$ac_config_headers config.h" + + + + + # Checks for programs. + ac_ext=cc + ac_cpp='$CXXCPP $CPPFLAGS' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. + set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + echo "$as_me:$LINENO: checking for $ac_word" >&5 + echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 + if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done + done + + fi + fi + CXX=$ac_cv_prog_CXX + if test -n "$CXX"; then + echo "$as_me:$LINENO: result: $CXX" >&5 + echo "${ECHO_T}$CXX" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 + fi + + test -n "$CXX" && break + done + fi + if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo "$as_me:$LINENO: checking for $ac_word" >&5 + echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 + if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done + done + + fi + fi + ac_ct_CXX=$ac_cv_prog_ac_ct_CXX + if test -n "$ac_ct_CXX"; then + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 + echo "${ECHO_T}$ac_ct_CXX" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 + fi + + test -n "$ac_ct_CXX" && break + done + test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX + fi + + + # Provide some information about the compiler. + echo "$as_me:$LINENO:" \ + "checking for C++ compiler version" >&5 + ac_compiler=`set X $ac_compile; echo $2` + { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + + ; + return 0; + } + _ACEOF + ac_clean_files_save=$ac_clean_files + ac_clean_files="$ac_clean_files a.out a.exe" + # Try to create an executable without -o first, disregard a.out. + # It will help us diagnose broken compilers, and finding out an intuition + # of exeext. + echo "$as_me:$LINENO: checking for C++ compiler default output" >&5 + echo $ECHO_N "checking for C++ compiler default output... $ECHO_C" >&6 + ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is + # not robust to junk in `.', hence go to wildcards (a.*) only as a last + # resort. + + # Be careful to initialize this variable, since it used to be cached. + # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. + ac_cv_exeext= + for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; + ls a.out conftest 2>/dev/null; + ls a.* conftest.* 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool --akim. + export ac_cv_exeext + break;; + * ) break;; + esac + done + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + { { echo "$as_me:$LINENO: error: C++ compiler cannot create executables" >&5 + echo "$as_me: error: C++ compiler cannot create executables" >&2;} + { (exit 77); exit 77; }; } + fi + + ac_exeext=$ac_cv_exeext + echo "$as_me:$LINENO: result: $ac_file" >&5 + echo "${ECHO_T}$ac_file" >&6 + + # Check the compiler produces executables we can run. If not, either + # the compiler is broken, or we cross compile. + echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5 + echo $ECHO_N "checking whether the C++ compiler works... $ECHO_C" >&6 + # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 + # If not cross compiling, check that we can run a simple program. + if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C++ compiled programs. + If you meant to cross compile, use \`--host'." >&5 + echo "$as_me: error: cannot run C++ compiled programs. + If you meant to cross compile, use \`--host'." >&2;} + { (exit 1); exit 1; }; } + fi + fi + fi + echo "$as_me:$LINENO: result: yes" >&5 + echo "${ECHO_T}yes" >&6 + + rm -f a.out a.exe conftest$ac_cv_exeext + ac_clean_files=$ac_clean_files_save + # Check the compiler produces executables we can run. If not, either + # the compiler is broken, or we cross compile. + echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 + echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: $cross_compiling" >&5 + echo "${ECHO_T}$cross_compiling" >&6 + + echo "$as_me:$LINENO: checking for suffix of executables" >&5 + echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) + # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will + # work properly (i.e., refer to `conftest.exe'), while it won't with + # `rm'. + for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac + done + else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 + echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} + { (exit 1); exit 1; }; } + fi + + rm -f conftest$ac_cv_exeext + echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 + echo "${ECHO_T}$ac_cv_exeext" >&6 + + rm -f conftest.$ac_ext + EXEEXT=$ac_cv_exeext + ac_exeext=$EXEEXT + echo "$as_me:$LINENO: checking for suffix of object files" >&5 + echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 + if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + + ; + return 0; + } + _ACEOF + rm -f conftest.o conftest.obj + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac + done + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 + echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} + { (exit 1); exit 1; }; } + fi + + rm -f conftest.$ac_cv_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 + echo "${ECHO_T}$ac_cv_objext" >&6 + OBJEXT=$ac_cv_objext + ac_objext=$OBJEXT + echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 + echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 + if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + #ifndef __GNUC__ + choke me + #endif + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_compiler_gnu=no + fi + rm -f conftest.$ac_objext conftest.$ac_ext + ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + + fi + echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 + echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 + GXX=`test $ac_compiler_gnu = yes && echo yes` + ac_test_CXXFLAGS=${CXXFLAGS+set} + ac_save_CXXFLAGS=$CXXFLAGS + CXXFLAGS="-g" + echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 + echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 + if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cxx_g=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cxx_g=no + fi + rm -f conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 + echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 + if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS + elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi + else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi + fi + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' + do + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include + $ac_declaration + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + exit (42); + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + continue + fi + rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + $ac_declaration + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + exit (42); + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest.$ac_objext conftest.$ac_ext + done + rm -f conftest* + if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h + fi + + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu + rm -f .deps 2>/dev/null + mkdir .deps 2>/dev/null + if test -d .deps; then + DEPDIR=.deps + else + # MS-DOS does not allow filenames that begin with a dot. + DEPDIR=_deps + fi + rmdir .deps 2>/dev/null + + + ac_config_commands="$ac_config_commands depfiles" + + + am_make=${MAKE-make} + cat > confinc << 'END' + doit: + @echo done + END + # If we don't find an include directive, just comment out the code. + echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 + echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 + am__include="#" + am__quote= + _am_result=none + # First try GNU make style include. + echo "include confinc" > confmf + # We grep out `Entering directory' and `Leaving directory' + # messages which can occur if `w' ends up in MAKEFLAGS. + # In particular we don't look at `^make:' because GNU make might + # be invoked under some other name (usually "gmake"), in which + # case it prints its new name instead of `make'. + if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU + fi + # Now try BSD make style include. + if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi + fi + + + echo "$as_me:$LINENO: result: $_am_result" >&5 + echo "${ECHO_T}$_am_result" >&6 + rm -f confinc confmf + + # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. + if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + + fi; + if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + fi + + + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' + else + AMDEP_TRUE='#' + AMDEP_FALSE= + fi + + + + + depcc="$CXX" am_compiler_list= + + echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 + echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 + if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir + else + am_cv_CXX_dependencies_compiler_type=none + fi + + fi + echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 + echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 + CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + + for ac_prog in gawk mawk nawk awk + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo "$as_me:$LINENO: checking for $ac_word" >&5 + echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 + if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done + done + + fi + fi + AWK=$ac_cv_prog_AWK + if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 + echo "${ECHO_T}$AWK" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 + fi + + test -n "$AWK" && break + done + + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. + set dummy ${ac_tool_prefix}gcc; ac_word=$2 + echo "$as_me:$LINENO: checking for $ac_word" >&5 + echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 + if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done + done + + fi + fi + CC=$ac_cv_prog_CC + if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 + echo "${ECHO_T}$CC" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 + fi + + fi + if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. + set dummy gcc; ac_word=$2 + echo "$as_me:$LINENO: checking for $ac_word" >&5 + echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 + if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done + done + + fi + fi + ac_ct_CC=$ac_cv_prog_ac_ct_CC + if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + echo "${ECHO_T}$ac_ct_CC" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 + fi + + CC=$ac_ct_CC + else + CC="$ac_cv_prog_CC" + fi + + if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + set dummy ${ac_tool_prefix}cc; ac_word=$2 + echo "$as_me:$LINENO: checking for $ac_word" >&5 + echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 + if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done + done + + fi + fi + CC=$ac_cv_prog_CC + if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 + echo "${ECHO_T}$CC" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 + fi + + fi + if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. + set dummy cc; ac_word=$2 + echo "$as_me:$LINENO: checking for $ac_word" >&5 + echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 + if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done + done + + fi + fi + ac_ct_CC=$ac_cv_prog_ac_ct_CC + if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + echo "${ECHO_T}$ac_ct_CC" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 + fi + + CC=$ac_ct_CC + else + CC="$ac_cv_prog_CC" + fi + + fi + if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. + set dummy cc; ac_word=$2 + echo "$as_me:$LINENO: checking for $ac_word" >&5 + echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 + if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else + ac_prog_rejected=no + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done + done + + if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$as_dir/$ac_word" ${1+"$@"} + shift + ac_cv_prog_CC="$@" + fi + fi + fi + fi + CC=$ac_cv_prog_CC + if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 + echo "${ECHO_T}$CC" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 + fi + + fi + if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. + set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + echo "$as_me:$LINENO: checking for $ac_word" >&5 + echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 + if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done + done + + fi + fi + CC=$ac_cv_prog_CC + if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 + echo "${ECHO_T}$CC" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 + fi + + test -n "$CC" && break + done + fi + if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 + echo "$as_me:$LINENO: checking for $ac_word" >&5 + echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 + if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. + else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi + done + done + + fi + fi + ac_ct_CC=$ac_cv_prog_ac_ct_CC + if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 + echo "${ECHO_T}$ac_ct_CC" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 + echo "${ECHO_T}no" >&6 + fi + + test -n "$ac_ct_CC" && break + done + + CC=$ac_ct_CC + fi + + fi + + + test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 + echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + + # Provide some information about the compiler. + echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 + ac_compiler=`set X $ac_compile; echo $2` + { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + + echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 + echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 + if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + #ifndef __GNUC__ + choke me + #endif + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_compiler_gnu=no + fi + rm -f conftest.$ac_objext conftest.$ac_ext + ac_cv_c_compiler_gnu=$ac_compiler_gnu + + fi + echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 + echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 + GCC=`test $ac_compiler_gnu = yes && echo yes` + ac_test_CFLAGS=${CFLAGS+set} + ac_save_CFLAGS=$CFLAGS + CFLAGS="-g" + echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 + echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 + if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_g=no + fi + rm -f conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 + echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS + elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi + else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi + fi + # Some people use a C++ compiler to compile C. Since we use `exit', + # in C++ we need to declare it. In case someone uses the same compiler + # for both compiling C and C++ we need to have the C++ compiler decide + # the declaration of exit, since it's the most demanding environment. + cat >conftest.$ac_ext <<_ACEOF + #ifndef __cplusplus + choke me + #endif + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' + do + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include + $ac_declaration + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + exit (42); + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + continue + fi + rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + $ac_declaration + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + exit (42); + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest.$ac_objext conftest.$ac_ext + done + rm -f conftest* + if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h + fi + + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest.$ac_objext conftest.$ac_ext + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu + + depcc="$CC" am_compiler_list= + + echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 + echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 + if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + echo '#include "conftest.h"' > conftest.c + echo 'int i;' > conftest.h + echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=conftest.c object=conftest.o \ + depfile=conftest.Po tmpdepfile=conftest.TPo \ + $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && + grep conftest.h conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + done + + cd .. + rm -rf conftest.dir + else + am_cv_CC_dependencies_compiler_type=none + fi + + fi + echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 + echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 + CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + + # Checks for libraries. + + # Checks for header files. + + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu + echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 + echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 + # On Suns, sometimes $CPP names a directory. + if test -n "$CPP" && test -d "$CPP"; then + CPP= + fi + if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false + for ac_c_preproc_warn_flag in '' yes + do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include + Syntax error + _ACEOF + if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi + else + ac_cpp_err=yes + fi + if test -z "$ac_cpp_err"; then + : + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. + continue + fi + rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include + _ACEOF + if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi + else + ac_cpp_err=yes + fi + if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. + continue + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. + ac_preproc_ok=: + break + fi + rm -f conftest.err conftest.$ac_ext + + done + # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. + rm -f conftest.err conftest.$ac_ext + if $ac_preproc_ok; then + break + fi + + done + ac_cv_prog_CPP=$CPP + + fi + CPP=$ac_cv_prog_CPP + else + ac_cv_prog_CPP=$CPP + fi + echo "$as_me:$LINENO: result: $CPP" >&5 + echo "${ECHO_T}$CPP" >&6 + ac_preproc_ok=false + for ac_c_preproc_warn_flag in '' yes + do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include + Syntax error + _ACEOF + if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi + else + ac_cpp_err=yes + fi + if test -z "$ac_cpp_err"; then + : + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. + continue + fi + rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include + _ACEOF + if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi + else + ac_cpp_err=yes + fi + if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. + continue + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. + ac_preproc_ok=: + break + fi + rm -f conftest.err conftest.$ac_ext + + done + # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. + rm -f conftest.err conftest.$ac_ext + if $ac_preproc_ok; then + : + else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 + echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { (exit 1); exit 1; }; } + fi + + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + echo "$as_me:$LINENO: checking for ANSI C header files" >&5 + echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 + if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include + #include + #include + #include + + _ACEOF + if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi + else + ac_cpp_err=yes + fi + if test -z "$ac_cpp_err"; then + ac_cv_header_stdc=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_stdc=no + fi + rm -f conftest.err conftest.$ac_ext + + if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include + + _ACEOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : + else + ac_cv_header_stdc=no + fi + rm -f conftest* + + fi + + if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include + + _ACEOF + if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : + else + ac_cv_header_stdc=no + fi + rm -f conftest* + + fi + + if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include + #if ((' ' & 0x0FF) == 0x020) + # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') + # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) + #else + # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) + # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) + #endif + + #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) + int + main () + { + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); + } + _ACEOF + rm -f conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : + else + echo "$as_me: program exited with status $ac_status" >&5 + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ( exit $ac_status ) + ac_cv_header_stdc=no + fi + rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + fi + fi + fi + echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 + echo "${ECHO_T}$ac_cv_header_stdc" >&6 + if test $ac_cv_header_stdc = yes; then + + cat >>confdefs.h <<\_ACEOF + #define STDC_HEADERS 1 + _ACEOF + + fi + + # On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + + for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h + do + as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` + echo "$as_me:$LINENO: checking for $ac_header" >&5 + echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 + if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + $ac_includes_default + + #include <$ac_header> + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$as_ac_Header=no" + fi + rm -f conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF + #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 + _ACEOF + + fi + + done + + + + + + + for ac_header in stdlib.h string.h sys/param.h unistd.h + do + as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` + if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 + echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 + if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + else + # Is the header compilable? + echo "$as_me:$LINENO: checking $ac_header usability" >&5 + echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + $ac_includes_default + #include <$ac_header> + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_compiler=no + fi + rm -f conftest.$ac_objext conftest.$ac_ext + echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 + echo "${ECHO_T}$ac_header_compiler" >&6 + + # Is the header present? + echo "$as_me:$LINENO: checking $ac_header presence" >&5 + echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include <$ac_header> + _ACEOF + if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi + else + ac_cpp_err=yes + fi + if test -z "$ac_cpp_err"; then + ac_header_preproc=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no + fi + rm -f conftest.err conftest.$ac_ext + echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 + echo "${ECHO_T}$ac_header_preproc" >&6 + + # So? What about this header? + case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 + echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 + echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 + echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 + echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 + echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + esac + echo "$as_me:$LINENO: checking for $ac_header" >&5 + echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 + if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + eval "$as_ac_Header=$ac_header_preproc" + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + + fi + if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF + #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 + _ACEOF + + fi + + done + + + # Checks for typedefs, structures, and compiler characteristics. + echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 + echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 + if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_cv_prog_cc_stdc=no + ac_save_CC=$CC + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + #include + #include + #include + #include + /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ + struct buf { int x; }; + FILE * (*rcsopen) (struct buf *, struct stat *, int); + static char *e (p, i) + char **p; + int i; + { + return p[i]; + } + static char *f (char * (*g) (char **, int), char **p, ...) + { + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; + } + int test (int i, double x); + struct s1 {int (*f) (int a);}; + struct s2 {int (*f) (double a);}; + int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); + int argc; + char **argv; + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; + } + _ACEOF + # Don't try gcc -ansi; that turns off useful extensions and + # breaks some systems' header files. + # AIX -qlanglvl=ansi + # Ultrix and OSF/1 -std1 + # HP-UX 10.20 and later -Ae + # HP-UX older versions -Aa -D_HPUX_SOURCE + # SVR4 -Xc -D__EXTENSIONS__ + for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" + do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg + break + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest.$ac_objext + done + rm -f conftest.$ac_ext conftest.$ac_objext + CC=$ac_save_CC + + fi + + case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 + echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 + echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; + esac + + echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 + echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 + if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + /* FIXME: Include the comments suggested by Paul. */ + #ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } + #endif + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_const=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_c_const=no + fi + rm -f conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 + echo "${ECHO_T}$ac_cv_c_const" >&6 + if test $ac_cv_c_const = no; then + + cat >>confdefs.h <<\_ACEOF + #define const + _ACEOF + + fi + + + # Checks for library functions. + + for ac_func in vprintf + do + as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` + echo "$as_me:$LINENO: checking for $ac_func" >&5 + echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 + if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + /* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ + #include + /* Override any gcc2 internal prototype to avoid an error. */ + #ifdef __cplusplus + extern "C" + #endif + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char $ac_func (); + char (*f) (); + + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + /* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ + #if defined (__stub_$ac_func) || defined (__stub___$ac_func) + choke me + #else + f = $ac_func; + #endif + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$as_ac_var=no" + fi + rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 + if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF + #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 + _ACEOF + + echo "$as_me:$LINENO: checking for _doprnt" >&5 + echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 + if test "${ac_cv_func__doprnt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + /* System header to define __stub macros and hopefully few prototypes, + which can conflict with char _doprnt (); below. */ + #include + /* Override any gcc2 internal prototype to avoid an error. */ + #ifdef __cplusplus + extern "C" + #endif + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char _doprnt (); + char (*f) (); + + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + /* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ + #if defined (__stub__doprnt) || defined (__stub____doprnt) + choke me + #else + f = _doprnt; + #endif + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func__doprnt=yes + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_func__doprnt=no + fi + rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 + echo "${ECHO_T}$ac_cv_func__doprnt" >&6 + if test $ac_cv_func__doprnt = yes; then + + cat >>confdefs.h <<\_ACEOF + #define HAVE_DOPRNT 1 + _ACEOF + + fi + + fi + done + + + + + + for ac_func in getcwd strchr strerror + do + as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` + echo "$as_me:$LINENO: checking for $ac_func" >&5 + echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 + if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + #include "confdefs.h" + /* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ + #include + /* Override any gcc2 internal prototype to avoid an error. */ + #ifdef __cplusplus + extern "C" + #endif + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char $ac_func (); + char (*f) (); + + #ifdef F77_DUMMY_MAIN + # ifdef __cplusplus + extern "C" + # endif + int F77_DUMMY_MAIN() { return 1; } + #endif + int + main () + { + /* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ + #if defined (__stub_$ac_func) || defined (__stub___$ac_func) + choke me + #else + f = $ac_func; + #endif + + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$as_ac_var=no" + fi + rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 + if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF + #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 + _ACEOF + + fi + done + + + ac_config_files="$ac_config_files Makefile docs/Makefile" + + cat >confcache <<\_ACEOF + # This file is a shell script that caches the results of configure + # tests run on this system so they can be shared between configure + # scripts and configure runs, see configure's option --config-cache. + # It is not useful on other systems. If it contains results you don't + # want to keep, you may remove or edit it. + # + # config.status only pays attention to the cache file if you give it + # the --recheck option to rerun configure. + # + # `ac_cv_env_foo' variables (set or unset) will be overriden when + # loading this file, other *unset* `ac_cv_foo' will be assigned the + # following values. + + _ACEOF + + # The following way of writing the cache mishandles newlines in values, + # but we know of no workaround that is simple, portable, and efficient. + # So, don't put newlines in cache variables' values. + # Ultrix sh set writes to stderr and can't be redirected directly, + # and sets the high bit in the cache file unless we assign to the vars. + { + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; + } | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache + if cmp -s $cache_file confcache; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi + fi + rm -f confcache + + test "x$prefix" = xNONE && prefix=$ac_default_prefix + # Let make expand exec_prefix. + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + + # VPATH may cause trouble with some makes, so we remove $(srcdir), + # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and + # trailing colons and then remove the whole line if VPATH becomes empty + # (actually we leave an empty line to preserve line numbers). + if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ + s/:*\$(srcdir):*/:/; + s/:*\${srcdir}:*/:/; + s/:*@srcdir@:*/:/; + s/^\([^=]*=[ ]*\):*/\1/; + s/:*$//; + s/^[^=]*=[ ]*$//; + }' + fi + + DEFS=-DHAVE_CONFIG_H + + if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. + Usually this means the macro was only invoked conditionally." >&5 + echo "$as_me: error: conditional \"AMDEP\" was never defined. + Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } + fi + + : ${CONFIG_STATUS=./config.status} + ac_clean_files_save=$ac_clean_files + ac_clean_files="$ac_clean_files $CONFIG_STATUS" + { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 + echo "$as_me: creating $CONFIG_STATUS" >&6;} + cat >$CONFIG_STATUS <<_ACEOF + #! $SHELL + # Generated by $as_me. + # Run this file to recreate the current configuration. + # Compiler output produced by configure, useful for debugging + # configure, is in config.log if it exists. + + debug=false + SHELL=\${CONFIG_SHELL-$SHELL} + _ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + + ## --------------------- ## + ## M4sh Initialization. ## + ## --------------------- ## + + # Be Bourne compatible + if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix + fi + + # NLS nuisances. + # Support unset when possible. + if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset + else + as_unset=false + fi + + (set +x; test -n "`(LANG=C; export LANG) 2>&1`") && + { $as_unset LANG || test "${LANG+set}" != set; } || + { LANG=C; export LANG; } + (set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && + { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || + { LC_ALL=C; export LC_ALL; } + (set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && + { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || + { LC_TIME=C; export LC_TIME; } + (set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && + { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || + { LC_CTYPE=C; export LC_CTYPE; } + (set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && + { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || + { LANGUAGE=C; export LANGUAGE; } + (set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && + { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || + { LC_COLLATE=C; export LC_COLLATE; } + (set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && + { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || + { LC_NUMERIC=C; export LC_NUMERIC; } + (set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && + { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || + { LC_MESSAGES=C; export LC_MESSAGES; } + + + # Name of the executable. + as_me=`(basename "$0") 2>/dev/null || + $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || + echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + # PATH needs CR, and LINENO needs CR and PATH. + # Avoid depending upon Character Ranges. + as_cr_letters='abcdefghijklmnopqrstuvwxyz' + as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' + as_cr_Letters=$as_cr_letters$as_cr_LETTERS + as_cr_digits='0123456789' + as_cr_alnum=$as_cr_Letters$as_cr_digits + + # The user is always right. + if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conftest.sh + fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 + echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done + done + ;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 + echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit + } + + + case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' + ' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; + esac + + if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr + else + as_expr=false + fi + + rm -f conf$$ conf$$.exe conf$$.file + echo >conf$$.file + if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi + rm -f conf$$ conf$$.exe conf$$.file + + as_executable_p="test -f" + + # Sed expression to map a string onto a valid CPP name. + as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + + # Sed expression to map a string onto a valid variable name. + as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + + # IFS + # We need space, tab and new line, in precisely that order. + as_nl=' + ' + IFS=" $as_nl" + + # CDPATH. + $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } + + exec 6>&1 + + # Open the log real soon, to keep \$[0] and so on meaningful, and to + # report actual input values of CONFIG_FILES etc. instead of their + # values after options handling. Logging --version etc. is OK. + exec 5>>config.log + { + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX + ## Running $as_me. ## + _ASBOX + } >&5 + cat >&5 <<_CSEOF + + This file was extended by lambda $as_me 0.1.3, which was + generated by GNU Autoconf 2.53. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + + _CSEOF + echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 + echo >&5 + _ACEOF + + # Files that config.status was made for. + if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS + fi + + if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS + fi + + if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS + fi + + if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS + fi + + cat >>$CONFIG_STATUS <<\_ACEOF + + ac_cs_usage="\ + \`$as_me' instantiates files from templates according to the + current configuration. + + Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + + Configuration files: + $config_files + + Configuration headers: + $config_headers + + Configuration commands: + $config_commands + + Report bugs to ." + _ACEOF + + cat >>$CONFIG_STATUS <<_ACEOF + ac_cs_version="\\ + lambda config.status 0.1.3 + configured by $0, generated by GNU Autoconf 2.53, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + + Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. + This config.status script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it." + srcdir=$srcdir + INSTALL="$INSTALL" + _ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # If no file are specified by the user, then we need to provide default + # value. By we need to know if files were specified by the user. + ac_need_defaults=: + while test $# != 0 + do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift + ;; + -*);; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_need_defaults=false;; + esac + + case $1 in + # Handling of the options. + _ACEOF + cat >>$CONFIG_STATUS <<_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" + exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; + _ACEOF + cat >>$CONFIG_STATUS <<\_ACEOF + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 + Try \`$0 --help' for more information." >&5 + echo "$as_me: error: ambiguous option: $1 + Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + shift + CONFIG_FILES="$CONFIG_FILES $1" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" + ac_need_defaults=false;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 + Try \`$0 --help' for more information." >&5 + echo "$as_me: error: unrecognized option: $1 + Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift + done + + _ACEOF + + cat >>$CONFIG_STATUS <<_ACEOF + # + # INIT-COMMANDS section. + # + + AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + _ACEOF + + + + cat >>$CONFIG_STATUS <<\_ACEOF + for ac_config_target in $ac_config_targets + do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "docs/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 + echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac + done + + # If the user did not use the arguments to specify the items to instantiate, + # then the envvar interface is used. Set only those that are not. + # We use the long form for the default assignment because of an extremely + # bizarre bug on SunOS 4.1.3. + if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands + fi + + # Create a temporary directory, and hook for its removal unless debugging. + $debug || + { + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 + } + + # Create a (secure) tmp directory for tmp files. + : ${TMPDIR=/tmp} + { + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" + } || + { + tmp=$TMPDIR/cs$$-$RANDOM + (umask 077 && mkdir $tmp) + } || + { + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } + } + + _ACEOF + + cat >>$CONFIG_STATUS <<_ACEOF + + # + # CONFIG_FILES section. + # + + # No need to generate the scripts if there are no CONFIG_FILES. + # This happens for instance when ./config.status config.h + if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF + s, at SHELL@,$SHELL,;t t + s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t + s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t + s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t + s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t + s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t + s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t + s, at exec_prefix@,$exec_prefix,;t t + s, at prefix@,$prefix,;t t + s, at program_transform_name@,$program_transform_name,;t t + s, at bindir@,$bindir,;t t + s, at sbindir@,$sbindir,;t t + s, at libexecdir@,$libexecdir,;t t + s, at datadir@,$datadir,;t t + s, at sysconfdir@,$sysconfdir,;t t + s, at sharedstatedir@,$sharedstatedir,;t t + s, at localstatedir@,$localstatedir,;t t + s, at libdir@,$libdir,;t t + s, at includedir@,$includedir,;t t + s, at oldincludedir@,$oldincludedir,;t t + s, at infodir@,$infodir,;t t + s, at mandir@,$mandir,;t t + s, at build_alias@,$build_alias,;t t + s, at host_alias@,$host_alias,;t t + s, at target_alias@,$target_alias,;t t + s, at DEFS@,$DEFS,;t t + s, at ECHO_C@,$ECHO_C,;t t + s, at ECHO_N@,$ECHO_N,;t t + s, at ECHO_T@,$ECHO_T,;t t + s, at LIBS@,$LIBS,;t t + s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t + s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t + s, at INSTALL_DATA@,$INSTALL_DATA,;t t + s, at PACKAGE@,$PACKAGE,;t t + s, at VERSION@,$VERSION,;t t + s, at ACLOCAL@,$ACLOCAL,;t t + s, at AUTOCONF@,$AUTOCONF,;t t + s, at AUTOMAKE@,$AUTOMAKE,;t t + s, at AUTOHEADER@,$AUTOHEADER,;t t + s, at MAKEINFO@,$MAKEINFO,;t t + s, at AMTAR@,$AMTAR,;t t + s, at install_sh@,$install_sh,;t t + s, at STRIP@,$STRIP,;t t + s, at ac_ct_STRIP@,$ac_ct_STRIP,;t t + s, at INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t + s, at AWK@,$AWK,;t t + s, at SET_MAKE@,$SET_MAKE,;t t + s, at CXX@,$CXX,;t t + s, at CXXFLAGS@,$CXXFLAGS,;t t + s, at LDFLAGS@,$LDFLAGS,;t t + s, at CPPFLAGS@,$CPPFLAGS,;t t + s, at ac_ct_CXX@,$ac_ct_CXX,;t t + s, at EXEEXT@,$EXEEXT,;t t + s, at OBJEXT@,$OBJEXT,;t t + s, at DEPDIR@,$DEPDIR,;t t + s, at am__include@,$am__include,;t t + s, at am__quote@,$am__quote,;t t + s, at AMDEP_TRUE@,$AMDEP_TRUE,;t t + s, at AMDEP_FALSE@,$AMDEP_FALSE,;t t + s, at AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t + s, at CXXDEPMODE@,$CXXDEPMODE,;t t + s, at CC@,$CC,;t t + s, at CFLAGS@,$CFLAGS,;t t + s, at ac_ct_CC@,$ac_ct_CC,;t t + s, at CCDEPMODE@,$CCDEPMODE,;t t + s, at CPP@,$CPP,;t t + CEOF + + _ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi + fi # test -n "$CONFIG_FILES" + + _ACEOF + cat >>$CONFIG_STATUS <<\_ACEOF + for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || + $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || + echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; + esac + as_dummy="$ac_dir" + for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || + mkdir "$as_incr_dir" || + { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 + echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + done; } + + ac_builddir=. + + if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` + else + ac_dir_suffix= ac_top_builddir= + fi + + case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; + esac + # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be + # absolute. + ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` + ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` + ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` + ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 + echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + _ACEOF + cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub + $extrasub + _ACEOF + cat >>$CONFIG_STATUS <<\_ACEOF + :t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b + s, at configure_input@,$configure_input,;t t + s, at srcdir@,$ac_srcdir,;t t + s, at abs_srcdir@,$ac_abs_srcdir,;t t + s, at top_srcdir@,$ac_top_srcdir,;t t + s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t + s, at builddir@,$ac_builddir,;t t + s, at abs_builddir@,$ac_abs_builddir,;t t + s, at top_builddir@,$ac_top_builddir,;t t + s, at abs_top_builddir@,$ac_abs_top_builddir,;t t + s, at INSTALL@,$ac_INSTALL,;t t + " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + + done + _ACEOF + cat >>$CONFIG_STATUS <<\_ACEOF + + # + # CONFIG_HEADER section. + # + + # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where + # NAME is the cpp macro being defined and VALUE is the value it is being given. + # + # ac_d sets the value in "#define NAME VALUE" lines. + ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' + ac_dB='[ ].*$,\1#\2' + ac_dC=' ' + ac_dD=',;t' + # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". + ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' + ac_uB='$,\1#\2define\3' + ac_uC=' ' + ac_uD=',;t' + + for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 + echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 + echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + + _ACEOF + + # Transform confdefs.h into two sed scripts, `conftest.defines' and + # `conftest.undefs', that substitutes the proper values into + # config.h.in to produce config.h. The first handles `#define' + # templates, and the second `#undef' templates. + # And first: Protect against being on the right side of a sed subst in + # config.status. Protect against being in an unquoted here document + # in config.status. + rm -f conftest.defines conftest.undefs + # Using a here document instead of a string reduces the quoting nightmare. + # Putting comments in sed scripts is not portable. + # + # `end' is used to avoid that the second main sed command (meant for + # 0-ary CPP macros) applies to n-ary macro definitions. + # See the Autoconf documentation for `clear'. + cat >confdef2sed.sed <<\_ACEOF + s/[\\&,]/\\&/g + s,[\\$`],\\&,g + t clear + : clear + s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp + t end + s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp + : end + _ACEOF + # If some macros were called several times there might be several times + # the same #defines, which is useless. Nevertheless, we may not want to + # sort them, since we want the *last* AC-DEFINE to be honored. + uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines + sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs + rm -f confdef2sed.sed + + # This sed command replaces #undef with comments. This is necessary, for + # example, in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + cat >>conftest.undefs <<\_ACEOF + s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, + _ACEOF + + # Break up conftest.defines because some shells have a limit on the size + # of here documents, and old seds have small limits too (100 cmds). + echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS + echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS + echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS + echo ' :' >>$CONFIG_STATUS + rm -f conftest.tail + while grep . conftest.defines >/dev/null + do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in + ' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines + done + rm -f conftest.defines + echo ' fi # egrep' >>$CONFIG_STATUS + echo >>$CONFIG_STATUS + + # Break up conftest.undefs because some shells have a limit on the size + # of here documents, and old seds have small limits too (100 cmds). + echo ' # Handle all the #undef templates' >>$CONFIG_STATUS + rm -f conftest.tail + while grep . conftest.undefs >/dev/null + do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in + ' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs + done + rm -f conftest.undefs + + cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if cmp -s $ac_file $tmp/config.h 2>/dev/null; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 + echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || + $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || + echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; + esac + as_dummy="$ac_dir" + for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || + mkdir "$as_incr_dir" || + { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 + echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + done; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi + # Run the commands associated with the file. + case $ac_file in + config.h ) # update the timestamp + echo 'timestamp for config.h' >"./stamp-h1" + ;; + esac + done + _ACEOF + cat >>$CONFIG_STATUS <<\_ACEOF + + # + # CONFIG_COMMANDS section. + # + for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || + $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || + echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + ac_builddir=. + + if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` + else + ac_dir_suffix= ac_top_builddir= + fi + + case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; + esac + # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be + # absolute. + ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` + ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` + ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` + ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 + echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || + $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || + echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || + $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || + echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { case $dirpart/$fdir in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; + esac + as_dummy=$dirpart/$fdir + for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || + mkdir "$as_incr_dir" || + { { echo "$as_me:$LINENO: error: cannot create $dirpart/$fdir" >&5 + echo "$as_me: error: cannot create $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + done; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done + ;; + esac + done + _ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + + { (exit 0); exit 0; } + _ACEOF + chmod +x $CONFIG_STATUS + ac_clean_files=$ac_clean_files_save + + + # configure is writing to config.log, and then calls config.status. + # config.status does its own redirection, appending to config.log. + # Unfortunately, on DOS this fails, as config.log is still kept open + # by configure, so config.status won't be able to write to it; its + # output is simply discarded. So we exec the FD to /dev/null, + # effectively closing config.log, so it can be properly (re)opened and + # appended to by config.status. When coming back to configure, we + # need to make the FD available again. + if test "$no_create" != yes; then + ac_cs_success=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } + fi + Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/configure.ac diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/configure.ac:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/configure.ac Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,27 ---- + # Process this file with autoconf to produce a configure script. + AC_INIT([lambda], [0.1.3], [usdesign at earthlink.net]) + AC_CONFIG_AUX_DIR([config]) + AM_INIT_AUTOMAKE + ##AC_CONFIG_SRCDIR([lambda.cc]) + AM_CONFIG_HEADER([config.h]) + + # Checks for programs. + AC_PROG_CXX + AC_PROG_AWK + AC_PROG_CC + + # Checks for libraries. + + # Checks for header files. + AC_HEADER_STDC + AC_CHECK_HEADERS([stdlib.h string.h sys/param.h unistd.h]) + + # Checks for typedefs, structures, and compiler characteristics. + AC_C_CONST + + # Checks for library functions. + AC_FUNC_VPRINTF + AC_CHECK_FUNCS([getcwd strchr strerror]) + + AC_CONFIG_FILES([Makefile docs/Makefile]) + AC_OUTPUT Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/definitions diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/definitions:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/definitions Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,83 ---- + def LIST map suc(append 2(append 1 end)) + def mknode (^a.^b.^u.u a b false) + def head (^n.n sel_1) + def tail (^n.n sel_2) + def is_end (^n.n sel_3) + def sel_1 (^p.^q.^r.p) + def sel_2 (^p.^q.^r.q) + def sel_3 (^p.^q.^r.r) + def nth ^n.^list.head((pred n) tail list) + def renda ^e.^&u.&u e e true + def rend (^x.renda(x x))(^x.renda(x x)) + def nend ^u.u 0 0 true + def end ^&u.&u rend rend true + def Appenda ^h.^n.^list.(is_end list)(mknode n end)(mknode(head list)(h n(tail list))) + def append (^x.Appenda(x x))(^x.Appenda(x x)) + def Mapa ^h.^f.^list.(is_end list)(end)(mknode(f (head list))(h f (tail list))) + def map (^x.Mapa(x x))(^x.Mapa(x x)) + def mtriple ^a.^b.^c.^u.u a b c + def 1st ^a.^b.^c.a + def 2nd ^a.^b.^c.b + def 3rd ^a.^b.^c.c + def div_cond ^p.GE(p 1st)(p 2nd) + def div_body ^t.mtriple(sub (t 1st)(t 2nd))(t 2nd)(suc(t 3rd)) + def div ^m.^n.while div_cond div_body (mtriple m n 0)3rd + def sub ^m.^n.n pred m + def force ^$.$ + def pred_body ^p.mpair (suc(p true))(p true) + def do ^n.^b.^x.n b x + def c1 ^p.not(iszero(p true)) + def btri ^p.mpair(pred(p true))(add(p true)(p false)) + def tri ^k.while c1 btri(mpair k 0)false + def Wh ^f.^c.^b.^x.(c x) (f c b (b x)) x + def while (^x.Wh(x x))(^x.Wh(x x)) + def G ^g.^f.f(g f) + def Y2d Y G + def Y2 (^x.G(x x))(^x.G(x x)) + def Y3 Y2 G + def Y4 Y3 G + def Y5 Y4 G + def YC S(S(K PHI)I)(S(K PHI)I) + def PHI S(K W)(S(K B)I) + def W ^f.^x.f x x + def S ^x.^y.^z.x z(y z) + def B ^x.^y.^z.x(y z) + def K ^x.^y.x + def I ^x.x + def true ^p.^q.p + def false ^p.^q.q + def and ^a.^b.a b false + def or ^a.^b.a true b + def not ^r.^p.^q.r q p + def mpair ^a.^b.^u.u a b + def iszero ^n. n (true false) true + def pred ^$k.$k(^p.(mpair(suc(p true))(p true)))(mpair 0 0)false + def add ^m.^n.m suc n + def mul ^m.^n.m(add n)0 + def exp ^m.^n.n(mul m)1 + def Y ^f.(^x.f(x x))(^x.f(x x)) + def F ^h.^n.(iszero n) 1 (mul n (h(pred n))) + def fact (^x.F(x x))(^x.F(x x)) + def H ^h.or(not h)A + def ADD ^m.^n.^x.^y.m x(n x y) + def MUL ^m.^n.^f.m(n f) + def EXP ^m.^n.n m + def GT ^m.^n.not(iszero (n pred m)) + def EQ ^m.^n.and (iszero (m pred n)) (iszero (n pred n)) + def LT ^m.^n.not(iszero(m pred n)) + def GE ^m.^n.not(LT m n) + def YH ^f.(^x.f(^h.x x h))(^x.f(^h.x x h)) + def YG ^f.(^x.^g.f(x x)g)(^x.^g.f(x x)g) + def S ^x.^y.^z.x z(y z) + def K ^x.^y.x + def I ^x.x + def triple ^x.^y.^z.^p.p x y z + def sel1 ^x.^y.^z.x + def sel2 ^x.^y.^z.y + def sel3 ^x.^y.^z.z + def isend ^t.t sel3 + def lpair ^a.^b.triple a b false + def B ^x.^y.^z.x(y z) + def W ^f.^x.f x x + def 0 ^m.^n.n + def suc ^p.^m.^n.m(p m n) Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/definitions_with_numbers diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/definitions_with_numbers:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/definitions_with_numbers Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,104 ---- + def LIST map suc(append 2(append 1 end)) + def mknode (^a.^b.^u.u a b false) + def head (^n.n sel_1) + def tail (^n.n sel_2) + def is_end (^n.n sel_3) + def sel_1 (^p.^q.^r.p) + def sel_2 (^p.^q.^r.q) + def sel_3 (^p.^q.^r.r) + def nth ^n.^list.head((pred n) tail list) + def renda ^e.^&u.&u e e true + def rend (^x.renda(x x))(^x.renda(x x)) + def nend ^u.u 0 0 true + def end ^&u.&u rend rend true + def Appenda ^h.^n.^list.(is_end list)(mknode n end)(mknode(head list)(h n(tail list))) + def append (^x.Appenda(x x))(^x.Appenda(x x)) + def Mapa ^h.^f.^list.(is_end list)(end)(mknode(f (head list))(h f (tail list))) + def map (^x.Mapa(x x))(^x.Mapa(x x)) + def mtriple ^a.^b.^c.^u.u a b c + def 1st ^a.^b.^c.a + def 2nd ^a.^b.^c.b + def 3rd ^a.^b.^c.c + def div_cond ^p.GE(p 1st)(p 2nd) + def div_body ^t.mtriple(sub (t 1st)(t 2nd))(t 2nd)(suc(t 3rd)) + def div ^m.^n.while div_cond div_body (mtriple m n 0)3rd + def sub ^m.^n.n pred m + def force ^$.$ + def pred_body ^p.mpair (suc(p true))(p true) + def do ^n.^b.^x.n b x + def c1 ^p.not(iszero(p true)) + def btri ^p.mpair(pred(p true))(add(p true)(p false)) + def tri ^k.while c1 btri(mpair k 0)false + def Wh ^f.^c.^b.^x.(c x) (f c b (b x)) x + def while (^x.Wh(x x))(^x.Wh(x x)) + def G ^g.^f.f(g f) + def Y2d Y G + def Y2 (^x.G(x x))(^x.G(x x)) + def Y3 Y2 G + def Y4 Y3 G + def Y5 Y4 G + def YC S(S(K PHI)I)(S(K PHI)I) + def PHI S(K W)(S(K B)I) + def W ^f.^x.f x x + def S ^x.^y.^z.x z(y z) + def B ^x.^y.^z.x(y z) + def K ^x.^y.x + def I ^x.x + def true ^p.^q.p + def false ^p.^q.q + def and ^a.^b.a b false + def or ^a.^b.a true b + def not ^r.^p.^q.r q p + def mpair ^a.^b.^u.u a b + def iszero ^n. n (true false) true + def pred ^$k.$k(^p.(mpair(suc(p true))(p true)))(mpair 0 0)false + def add ^m.^n.m suc n + def mul ^m.^n.m(add n)0 + def exp ^m.^n.n(mul m)1 + def Y ^f.(^x.f(x x))(^x.f(x x)) + def F ^h.^n.(iszero n) 1 (mul n (h(pred n))) + def fact (^x.F(x x))(^x.F(x x)) + def H ^h.or(not h)A + def ADD ^m.^n.^x.^y.m x(n x y) + def MUL ^m.^n.^f.m(n f) + def EXP ^m.^n.n m + def GT ^m.^n.not(iszero (n pred m)) + def EQ ^m.^n.and (iszero (m pred n)) (iszero (n pred n)) + def LT ^m.^n.not(iszero(m pred n)) + def GE ^m.^n.not(LT m n) + def YH ^f.(^x.f(^h.x x h))(^x.f(^h.x x h)) + def YG ^f.(^x.^g.f(x x)g)(^x.^g.f(x x)g) + def S ^x.^y.^z.x z(y z) + def K ^x.^y.x + def I ^x.x + def triple ^x.^y.^z.^p.p x y z + def sel1 ^x.^y.^z.x + def sel2 ^x.^y.^z.y + def sel3 ^x.^y.^z.z + def isend ^t.t sel3 + def lpair ^a.^b.triple a b false + def B ^x.^y.^z.x(y z) + def W ^f.^x.f x x + def 0 ^m.^n.n + def suc ^p.^m.^n.m(p m n) + def 1 ^m.^n.m n + def 2 ^m.^n.m(m n) + def 3 ^m.^n.m(m(m n)) + def 4 ^m.^n.m(m(m(m n))) + def 5 ^m.^n.m(m(m(m(m n)))) + def 6 ^m.^n.m(m(m(m(m(m n))))) + def 7 ^m.^n.m(m(m(m(m(m(m n)))))) + def 8 ^m.^n.m(m(m(m(m(m(m(m n))))))) + def 9 ^m.^n.m(m(m(m(m(m(m(m(m n)))))))) + def 10 ^m.^n.m(m(m(m(m(m(m(m(m(m n))))))))) + def 11 ^m.^n.m(m(m(m(m(m(m(m(m(m(m n)))))))))) + def 12 ^m.^n.m(m(m(m(m(m(m(m(m(m(m(m n))))))))))) + def 13 ^m.^n.m(m(m(m(m(m(m(m(m(m(m(m(m n)))))))))))) + def 14 ^m.^n.m(m(m(m(m(m(m(m(m(m(m(m(m(m n))))))))))))) + def 15 ^m.^n.m(m(m(m(m(m(m(m(m(m(m(m(m(m(m n)))))))))))))) + def 16 ^m.^n.m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m n))))))))))))))) + def 17 ^m.^n.m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m n)))))))))))))))) + def 18 ^m.^n.m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m n))))))))))))))))) + def 19 ^m.^n.m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m n)))))))))))))))))) + def 20 ^m.^n.m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m(m n))))))))))))))))))) + Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/fdl.txt diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/fdl.txt:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/fdl.txt Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,397 ---- + GNU Free Documentation License + Version 1.2, November 2002 + + + Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document "free" in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or noncommercially. + Secondarily, this License preserves for the author and publisher a way + to get credit for their work, while not being considered responsible + for modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. It + complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for free + software, because free software needs free documentation: a free + program should come with manuals providing the same freedoms that the + software does. But this License is not limited to software manuals; + it can be used for any textual work, regardless of subject matter or + whether it is published as a printed book. We recommend this License + principally for works whose purpose is instruction or reference. + + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, that + contains a notice placed by the copyright holder saying it can be + distributed under the terms of this License. Such a notice grants a + world-wide, royalty-free license, unlimited in duration, to use that + work under the conditions stated herein. The "Document", below, + refers to any such manual or work. Any member of the public is a + licensee, and is addressed as "you". You accept the license if you + copy, modify or distribute the work in a way requiring permission + under copyright law. + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section of + the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall subject + (or to related matters) and contains nothing that could fall directly + within that overall subject. (Thus, if the Document is in part a + textbook of mathematics, a Secondary Section may not explain any + mathematics.) The relationship could be a matter of historical + connection with the subject or with related matters, or of legal, + commercial, philosophical, ethical or political position regarding + them. + + The "Invariant Sections" are certain Secondary Sections whose titles + are designated, as being those of Invariant Sections, in the notice + that says that the Document is released under this License. If a + section does not fit the above definition of Secondary then it is not + allowed to be designated as Invariant. The Document may contain zero + Invariant Sections. If the Document does not identify any Invariant + Sections then there are none. + + The "Cover Texts" are certain short passages of text that are listed, + as Front-Cover Texts or Back-Cover Texts, in the notice that says that + the Document is released under this License. A Front-Cover Text may + be at most 5 words, and a Back-Cover Text may be at most 25 words. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images composed of + pixels) generic paint programs or (for drawings) some widely available + drawing editor, and that is suitable for input to text formatters or + for automatic translation to a variety of formats suitable for input + to text formatters. A copy made in an otherwise Transparent file + format whose markup, or absence of markup, has been arranged to thwart + or discourage subsequent modification by readers is not Transparent. + An image format is not Transparent if used for any substantial amount + of text. A copy that is not "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, SGML + or XML using a publicly available DTD, and standard-conforming simple + HTML, PostScript or PDF designed for human modification. Examples of + transparent image formats include PNG, XCF and JPG. Opaque formats + include proprietary formats that can be read and edited only by + proprietary word processors, SGML or XML for which the DTD and/or + processing tools are not generally available, and the + machine-generated HTML, PostScript or PDF produced by some word + processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the material + this License requires to appear in the title page. For works in + formats which do not have any title page as such, "Title Page" means + the text near the most prominent appearance of the work's title, + preceding the beginning of the body of the text. + + A section "Entitled XYZ" means a named subunit of the Document whose + title either is precisely XYZ or contains XYZ in parentheses following + text that translates XYZ in another language. (Here XYZ stands for a + specific section name mentioned below, such as "Acknowledgements", + "Dedications", "Endorsements", or "History".) To "Preserve the Title" + of such a section when you modify the Document means that it remains a + section "Entitled XYZ" according to this definition. + + The Document may include Warranty Disclaimers next to the notice which + states that this License applies to the Document. These Warranty + Disclaimers are considered to be included by reference in this + License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and has + no effect on the meaning of this License. + + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License applies + to the Document are reproduced in all copies, and that you add no other + conditions whatsoever to those of this License. You may not use + technical measures to obstruct or control the reading or further + copying of the copies you make or distribute. However, you may accept + compensation in exchange for copies. If you distribute a large enough + number of copies you must also follow the conditions in section 3. + + You may also lend copies, under the same conditions stated above, and + you may publicly display copies. + + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly have + printed covers) of the Document, numbering more than 100, and the + Document's license notice requires Cover Texts, you must enclose the + copies in covers that carry, clearly and legibly, all these Cover + Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on + the back cover. Both covers must also clearly and legibly identify + you as the publisher of these copies. The front cover must present + the full title with all words of the title equally prominent and + visible. You may add other material on the covers in addition. + Copying with changes limited to the covers, as long as they preserve + the title of the Document and satisfy these conditions, can be treated + as verbatim copying in other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto adjacent + pages. + + If you publish or distribute Opaque copies of the Document numbering + more than 100, you must either include a machine-readable Transparent + copy along with each Opaque copy, or state in or with each Opaque copy + a computer-network location from which the general network-using + public has access to download using public-standard network protocols + a complete Transparent copy of the Document, free of added material. + If you use the latter option, you must take reasonably prudent steps, + when you begin distribution of Opaque copies in quantity, to ensure + that this Transparent copy will remain thus accessible at the stated + location until at least one year after the last time you distribute an + Opaque copy (directly or through your agents or retailers) of that + edition to the public. + + It is requested, but not required, that you contact the authors of the + Document well before redistributing any large number of copies, to give + them a chance to provide you with an updated version of the Document. + + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document under + the conditions of sections 2 and 3 above, provided that you release + the Modified Version under precisely this License, with the Modified + Version filling the role of the Document, thus licensing distribution + and modification of the Modified Version to whoever possesses a copy + of it. In addition, you must do these things in the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. + B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has fewer than five), + unless they release you from this requirement. + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + D. Preserve all the copyright notices of the Document. + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. + G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. + H. Include an unaltered copy of this License. + I. Preserve the section Entitled "History", Preserve its Title, and add + to it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section Entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. + J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the "History" section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section all + the substance and tone of each of the contributor acknowledgements + and/or dedications given therein. + L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + N. Do not retitle any existing section to be Entitled "Endorsements" + or to conflict in title with any Invariant Section. + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no material + copied from the Document, you may at your option designate some or all + of these sections as invariant. To do this, add their titles to the + list of Invariant Sections in the Modified Version's license notice. + These titles must be distinct from any other section titles. + + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text has + been approved by an organization as the authoritative definition of a + standard. + + You may add a passage of up to five words as a Front-Cover Text, and a + passage of up to 25 words as a Back-Cover Text, to the end of the list + of Cover Texts in the Modified Version. Only one passage of + Front-Cover Text and one of Back-Cover Text may be added by (or + through arrangements made by) any one entity. If the Document already + includes a cover text for the same cover, previously added by you or + by arrangement made by the same entity you are acting on behalf of, + you may not add another; but you may replace the old one, on explicit + permission from the previous publisher that added the old one. + + The author(s) and publisher(s) of the Document do not by this License + give permission to use their names for publicity for or to assert or + imply endorsement of any Modified Version. + + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under this + License, under the terms defined in section 4 above for modified + versions, provided that you include in the combination all of the + Invariant Sections of all of the original documents, unmodified, and + list them all as Invariant Sections of your combined work in its + license notice, and that you preserve all their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name but + different contents, make the title of each such section unique by + adding at the end of it, in parentheses, the name of the original + author or publisher of that section if known, or else a unique number. + Make the same adjustment to the section titles in the list of + Invariant Sections in the license notice of the combined work. + + In the combination, you must combine any sections Entitled "History" + in the various original documents, forming one section Entitled + "History"; likewise combine any sections Entitled "Acknowledgements", + and any sections Entitled "Dedications". You must delete all sections + Entitled "Endorsements". + + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other documents + released under this License, and replace the individual copies of this + License in the various documents with a single copy that is included in + the collection, provided that you follow the rules of this License for + verbatim copying of each of the documents in all other respects. + + You may extract a single document from such a collection, and distribute + it individually under this License, provided you insert a copy of this + License into the extracted document, and follow this License in all + other respects regarding verbatim copying of that document. + + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other separate + and independent documents or works, in or on a volume of a storage or + distribution medium, is called an "aggregate" if the copyright + resulting from the compilation is not used to limit the legal rights + of the compilation's users beyond what the individual works permit. + When the Document is included in an aggregate, this License does not + apply to the other works in the aggregate which are not themselves + derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half of + the entire aggregate, the Document's Cover Texts may be placed on + covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic form. + Otherwise they must appear on printed covers that bracket the whole + aggregate. + + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section 4. + Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also include + the original English version of this License and the original versions + of those notices and disclaimers. In case of a disagreement between + the translation and the original version of this License or a notice + or disclaimer, the original version will prevail. + + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to Preserve + its Title (section 1) will typically require changing the actual + title. + + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document except + as expressly provided for under this License. Any other attempt to + copy, modify, sublicense or distribute the Document is void, and will + automatically terminate your rights under this License. However, + parties who have received copies, or rights, from you under this + License will not have their licenses terminated so long as such + parties remain in full compliance. + + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions + of the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + http://www.gnu.org/copyleft/. + + Each version of the License is given a distinguishing version number. + If the Document specifies that a particular numbered version of this + License "or any later version" applies to it, you have the option of + following the terms and conditions either of that specified version or + of any later version that has been published (not as a draft) by the + Free Software Foundation. If the Document does not specify a version + number of this License, you may choose any version ever published (not + as a draft) by the Free Software Foundation. + + + ADDENDUM: How to use this License for your documents + + To use this License in a document you have written, include a copy of + the License in the document and put the following copyright and + license notices just after the title page: + + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled "GNU + Free Documentation License". + + If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, + replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + + If you have Invariant Sections without Cover Texts, or some other + combination of the three, merge those two alternatives to suit the + situation. + + If your document contains nontrivial examples of program code, we + recommend releasing these examples in parallel under your choice of + free software license, such as the GNU General Public License, + to permit their use in free software. Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/gpl.txt diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/gpl.txt:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/gpl.txt Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,340 ---- + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your + freedom to share and change it. By contrast, the GNU General Public + License is intended to guarantee your freedom to share and change free + software--to make sure the software is free for all its users. This + General Public License applies to most of the Free Software + Foundation's software and to any other program whose authors commit to + using it. (Some other Free Software Foundation software is covered by + the GNU Library General Public License instead.) You can apply it to + your programs, too. + + When we speak of free software, we are referring to freedom, not + price. Our General Public Licenses are designed to make sure that you + have the freedom to distribute copies of free software (and charge for + this service if you wish), that you receive source code or can get it + if you want it, that you can change the software or use pieces of it + in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid + anyone to deny you these rights or to ask you to surrender the rights. + These restrictions translate to certain responsibilities for you if you + distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether + gratis or for a fee, you must give the recipients all the rights that + you have. You must make sure that they, too, receive or can get the + source code. And you must show them these terms so they know their + rights. + + We protect your rights with two steps: (1) copyright the software, and + (2) offer you this license which gives you legal permission to copy, + distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain + that everyone understands that there is no warranty for this free + software. If the software is modified by someone else and passed on, we + want its recipients to know that what they have is not the original, so + that any problems introduced by others will not reflect on the original + authors' reputations. + + Finally, any free program is threatened constantly by software + patents. We wish to avoid the danger that redistributors of a free + program will individually obtain patent licenses, in effect making the + program proprietary. To prevent this, we have made it clear that any + patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and + modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains + a notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", below, + refers to any such program or work, and a "work based on the Program" + means either the Program or any derivative work under copyright law: + that is to say, a work containing the Program or a portion of it, + either verbatim or with modifications and/or translated into another + language. (Hereinafter, translation is included without limitation in + the term "modification".) Each licensee is addressed as "you". + + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of + running the Program is not restricted, and the output from the Program + is covered only if its contents constitute a work based on the + Program (independent of having been made by running the Program). + Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's + source code as you receive it, in any medium, provided that you + conspicuously and appropriately publish on each copy an appropriate + copyright notice and disclaimer of warranty; keep intact all the + notices that refer to this License and to the absence of any warranty; + and give any other recipients of the Program a copy of this License + along with the Program. + + You may charge a fee for the physical act of transferring a copy, and + you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion + of it, thus forming a work based on the Program, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Program, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work based + on the Program, the distribution of the whole must be on the terms of + this License, whose permissions for other licensees extend to the + entire whole, and thus to each and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or contest + your rights to work written entirely by you; rather, the intent is to + exercise the right to control the distribution of derivative or + collective works based on the Program. + + In addition, mere aggregation of another work not based on the Program + with the Program (or with a work based on the Program) on a volume of + a storage or distribution medium does not bring the other work under + the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms of + Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + + The source code for a work means the preferred form of the work for + making modifications to it. For an executable work, complete source + code means all the source code for all modules it contains, plus any + associated interface definition files, plus the scripts used to + control compilation and installation of the executable. However, as a + special exception, the source code distributed need not include + anything that is normally distributed (in either source or binary + form) with the major components (compiler, kernel, and so on) of the + operating system on which the executable runs, unless that component + itself accompanies the executable. + + If distribution of executable or object code is made by offering + access to copy from a designated place, then offering equivalent + access to copy the source code from the same place counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is + void, and will automatically terminate your rights under this License. + However, parties who have received copies, or rights, from you under + this License will not have their licenses terminated so long as such + parties remain in full compliance. + + 5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify or + distribute the Program or its derivative works. These actions are + prohibited by law if you do not accept this License. Therefore, by + modifying or distributing the Program (or any work based on the + Program), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program subject to + these terms and conditions. You may not impose any further + restrictions on the recipients' exercise of the rights granted herein. + You are not responsible for enforcing compliance by third parties to + this License. + + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement or + otherwise) that contradict the conditions of this License, they do not + excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence you + may not distribute the Program at all. For example, if a patent + license would not permit royalty-free redistribution of the Program by + all those who receive copies directly or indirectly through you, then + the only way you could satisfy both it and this License would be to + refrain entirely from distribution of the Program. + + If any portion of this section is held invalid or unenforceable under + any particular circumstance, the balance of the section is intended to + apply and the section as a whole is intended to apply in other + circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of any + such claims; this section has the sole purpose of protecting the + integrity of the free software distribution system, which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing + to distribute software through any other system and a licensee cannot + impose that choice. + + This section is intended to make thoroughly clear what is believed to + be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Program under this License + may add an explicit geographical distribution limitation excluding + those countries, so that distribution is permitted only in or among + countries not thus excluded. In such case, this License incorporates + the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions + of the General Public License from time to time. Such new versions will + be similar in spirit to the present version, but may differ in detail to + address new problems or concerns. + + Each version is given a distinguishing version number. If the Program + specifies a version number of this License which applies to it and "any + later version", you have the option of following the terms and conditions + either of that version or of any later version published by the Free + Software Foundation. If the Program does not specify a version number of + this License, you may choose any version ever published by the Free Software + Foundation. + + 10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the author + to ask for permission. For software which is copyrighted by the Free + Software Foundation, write to the Free Software Foundation; we sometimes + make exceptions for this. Our decision will be guided by the two goals + of preserving the free status of all derivatives of our free software and + of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY + FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN + OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES + PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED + OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS + TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, + REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest + possible use to the public, the best way to achieve this is to make it + free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest + to attach them to the start of each source file to most effectively + convey the exclusion of warranty; and each file should have at least + the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + Also add information on how to contact you by electronic and paper mail. + + If the program is interactive, make it output a short notice like this + when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + + The hypothetical commands `show w' and `show c' should show the appropriate + parts of the General Public License. Of course, the commands you use may + be called something other than `show w' and `show c'; they could even be + mouse-clicks or menu items--whatever suits your program. + + You should also get your employer (if you work as a programmer) or your + school, if any, to sign a "copyright disclaimer" for the program, if + necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + + This General Public License does not permit incorporating your program into + proprietary programs. If your program is a subroutine library, you may + consider it more useful to permit linking proprietary applications with the + library. If this is what you want to do, use the GNU Library General + Public License instead of this License. Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/input diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/input:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/input Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,33 ---- + def 0 ^m.^n.n + def true ^p.^q.p + def def false ^p.^q.q + def suc ^p.^m.^n.m(p m n) + def pred ^$k.$k(^p.(mpair(suc(p true))(p true)))(mpair 0 0)false + def mpair ^a.^b.^u.u a b + def def iszero ^n. n (true false) true + def ADD ^m.^n.^x.^y.m x(n x y) + def MUL ^m.^n.^f.m(n f) + def EXP ^m.^n.n m + def GT ^m.^n.not(iszero (n pred m)) + def EQ ^m.^n.and (iszero (m pred n)) (iszero (n pred n)) + def LT ^m.^n.not(iszero(m pred n)) + def GE ^m.^n.not(LT m n) + iszero 0 + iszero 5 + suc 0 + suc 1 + suc 2 + pred 3 + pred 2 + pred 1 + pred 0 + ADD 1 2 + MUL 2 3 + EXP 2 3 + EXP 3 2 + GT 2 3 + GT 3 2 + EQ 4 (ADD 2 2) + EQ 5 (ADD 3 3) + quit + Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/lambda.cc diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/lambda.cc:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/lambda.cc Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,240 ---- + /* lambda.cc */ + /* + Copyright (C) 2003 Unique Software Designs + + This file is part of the program "lambda". + + The program "lambda" is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + The program "lambda" is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with "lambda"; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + A copy of the GNU General Public License may also be found at: + http://www.gnu.org/copyleft/gpl.html + */ + #if HAVE_CONFIG_H + # include "config.h" + #endif + #include + #include + #include "node.h" + #include "token_stream.h" + #include "parse.h" + + #ifdef WIN32 + #include + + #else + #include + #include + #endif + + #ifdef WIN32 + void + #else + int + #endif + main(int argc, char** argv) + { + printf( + "Copyright (c) 2000 John A. Maiorana. " + "All rights reserved.\n" ); + #ifdef WIN32 + { + char buf[512]; + char* cwd = _getcwd(buf,sizeof(buf)-1); + int dr = _getdrive(); + if( cwd ){ + printf( "%s\n", cwd); + } + } + #else + { + char buf[MAXPATHLEN+1]; + char* cwd = getcwd(buf,sizeof(buf)-1); + if( cwd ){ + printf( "%s\n", cwd); + } + } + #endif + #if 0 + arg_node arg1("x",0); + var_node varx("x"); + var_node vary("y"); + var_node varf("f"); + app_node appxx(&varx, &varx); + app_node appfxx(&varf, &appxx); + lam_node lamD(&arg1,&appfxx); + app_node appDD(&lamD,&lamD); + printf("(^x.f(x x)) (^x.f(x x)) = "); + appDD.print(); + printf("\n"); + appDD.bind(); + + printf("reduced = "); + exp_node* rn = appDD.reduce(); + rn->print(); + printf("\n"); + #endif + token_stream tokstr; + tokstr.open(); + lambda_expression_parser parse(&tokstr); + + arglst_node* env = 0; + while( 1 ) + { + printf("<< "); + exp_node* exp = parse.expression(&env); + if( exp ) + { + int inp = 0; + int outp = 0; + if( node::ARG==exp->op() ) + { + delete exp; + break; + } + printf("==> "); + exp->print(); + printf("\n"); + //exp->bind(env); + node::reset(); + if( trace_lambda ) inp |= node::DO_TRACE; + if( print_symbols ) inp |= node::DO_PRINT_SYM; + if( applicative_order ) inp |= node::DO_APP_ORDER; + if( reduce_body ) inp |= node::DO_REDUCE_BODY; + if( step_lambda ) inp |= node::DO_STEP; + if( brief_print ) inp |= node::DO_PRINT_BRIEF; + if( reduce_fully ) inp |= node::DO_REDUCE_FULLY; + + int exp_was_var = node::VAR==exp->op(); + + if( step_lambda ) + { + int printed = 0; + exp_node* rexp = exp->reduce(env,inp,&outp); + do { + if( rexp ){ + if(1){ + char* step = "="; + if( outp & node::BETA_ETA_DONE ){ + if( outp & node::ETA_DONE ){ + step = "H"; + }else{ + step = "B"; + } + } + printf("=%1.1s==> ", step ); + //rexp->symbolic_print(env,inp); + if( exp_was_var ) + rexp->print(env,inp&~node::DO_PRINT_SYM); + else + rexp->symbolic_print(env,inp); + printf("\n"); + printed = 1; + } + exp_node* nexp; + if( outp & node::BETA_ETA_DONE) { + outp &= ~(node::BETA_ETA_DONE|node::ETA_DONE); + nexp = rexp->reduce(env,inp,&outp); + if( nexp && rexp!=nexp ){ + //if( rexp != exp ) delete rexp; + delete rexp; + if( rexp == exp ) exp = 0; + rexp = nexp; + } + if( !(outp & node::BETA_ETA_DONE)) + break; + }else{ + break; + } + printf("*** Continue?[y/n]:"); + int ans = getchar(); + if( '\n'!=ans ) + while ( '\n'!=getchar() ); + if( 'n'==ans || 'N'==ans ) break; + } + } while (rexp); + if( !printed && rexp ){ + printf("=====> "); + if( exp_was_var ) + rexp->print(env,inp&~node::DO_PRINT_SYM); + else + rexp->symbolic_print(env,inp); + printf("\n"); + printed = 1; + //if( rexp && rexp != exp ) delete rexp; + delete rexp; + if( rexp == exp ) exp = 0; + rexp = 0; + } + }else if( step_thru ) { + inp |= node::DO_STEP; + exp_node* rexp = exp->reduce(env,inp,&outp); + do { + if( rexp ){ + exp_node* nexp; + if( outp & node::BETA_ETA_DONE) { + outp &= ~node::BETA_ETA_DONE; + nexp = rexp->reduce(env,inp,&outp); + if( nexp && rexp!=nexp ){ + //if( rexp != exp ) delete rexp; + delete rexp; + if( rexp == exp ) exp = 0; + rexp = nexp; + } + if( !(outp & node::BETA_ETA_DONE)) + break; + }else{ + break; + } + } + } while (rexp); + if( rexp ) + { + printf("====>"); + if( exp_was_var ) + rexp->print(env,inp&~node::DO_PRINT_SYM); + else + rexp->symbolic_print(env,inp); + printf("\n"); + //if( rexp && rexp != exp ) delete rexp; + delete rexp; + if( rexp == exp ) exp = 0; + rexp = 0; + } + }else{ + exp_node* rexp = exp->reduce(env,inp,&outp); + if( rexp ) + { + printf("====>"); + if( exp_was_var ) + rexp->print(env,inp&~node::DO_PRINT_SYM); + else + rexp->symbolic_print(env,inp); + printf("\n"); + //if( rexp && rexp != exp ) delete rexp; + delete rexp; + if( rexp == exp ) exp = 0; + rexp = 0; + } + } + if( exp ) delete exp; + exp = 0; + } + } + tokstr.close(); + #ifndef WIN32 + return 0; + #endif + } + Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/node.cc diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/node.cc:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/node.cc Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,1427 ---- + /* node.cc */ + /* + Copyright (C) 2003 Unique Software Designs + + This file is part of the program "lambda". + + The program "lambda" is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + The program "lambda" is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with "lambda"; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + A copy of the GNU General Public License may also be found at: + http://www.gnu.org/copyleft/gpl.html + */ + #if HAVE_CONFIG_H + # include "config.h" + #endif + #include + #include + #include + #include + #include "node.h" + + #define REDUCE_VARS + //#undef REDUCE_VARS + #define USE_UNDER_SCORE_PREFIX_FOR_GENERATED_NAMES + #undef USE_UNDER_SCORE_PREFIX_FOR_GENERATED_NAMES + + //const int MAX_RECURSE=200; + const int MAX_RECURSE=4000; + + const arglst_node* definition_env = 0; + + static int name_sequence = 1; + static int lambda_reduce_recurse_level = 0; + static int app_reduce_recurse_level = 0; + static int var_reduce_recurse_level = 0; + + static char* newname(const char* oldname) + { + char* nm = 0; + char buf[128]; + if( !oldname ) oldname = "~"; + + #ifdef USE_UNDER_SCORE_PREFIX_FOR_GENERATED_NAMES + sprintf( buf, "_%s_%d", oldname, name_sequence ); + #else + sprintf( buf, "%s#%d", oldname, name_sequence ); + #endif + name_sequence += 1; + + nm = new char[strlen(buf)+1]; + strcpy(nm,buf); + return nm; + } + + char* newstring(const char*os) + { + char* ns; + if(os) { + ns = new char[strlen(os)+1]; + strcpy(ns,os); + }else ns = 0; + return ns; + }; + + ////////////////////////////////////////////////////////////////////// + void node:: + reset() + { + name_sequence = 1; + lambda_reduce_recurse_level = 0; + app_reduce_recurse_level = 0; + var_reduce_recurse_level = 0; + } + + void node:: + print(const alst_node*env,int inp) const + { + printf("(%p:node)",this); + } + + ////////////////////////////////////////////////////////////////////// + // arg_node + arg_node:: + arg_node(const char* nm, const exp_node* ex, Boolean import) + { + this->name_v = newstring(nm); + if( import ){ + if( ex ) value_v = (exp_node*)ex; + else value_v = 0; + }else{ + if( ex ) value_v = (exp_node*)ex->clone(); + else value_v = 0; + if( value_v ) value_v->set_parent(this); + } + } + + arg_node:: + arg_node(const arg_node& from) + { + //*this = from; + if( from.name_v ) { + name_v = new char [strlen(from.name_v)+1]; + strcpy(name_v, from.name_v); + }else name_v = 0; + if( from.value_v ) + value_v = + (exp_node*)from.value_v->clone(); + else value_v = 0; + if( value_v ) value_v->set_parent(this); + parent_v = from.parent_v; + } + + node* arg_node:: + clone() const + { + return (node*)new arg_node(*this); + } + + arg_node:: + ~arg_node() + { + if( name_v ) delete [] name_v; + if( value_v ) delete value_v; + } + + arg_node& arg_node:: + operator =(const arg_node& from) + { + if( this != &from ){ + this->~arg_node(); + if( from.name_v ) { + name_v = new char [strlen(from.name_v)+1]; + strcpy(name_v, from.name_v); + }else name_v = 0; + if( from.value_v ) + value_v = + (exp_node*)from.value_v->clone(); + else value_v = 0; + if( value_v ) value_v->set_parent(this); + parent_v = from.parent_v; + } + return *this; + } + + //Boolean arg_node:: + //free_in(exp_node* exp) + //{ + // Boolean in = False; + // in = exp->has_free(this); + // return in; + //} + + void arg_node:: + print(const alst_node*env, int inp)const + { + printf("%s", name_v ? name_v : "(null)" ); + if( value_v ) { + printf(" = "); + value_v->print(env,inp); + } + } + + void arg_node:: + import_value(exp_node** val) + { + if( value_v ) delete value_v; + if( val ){ + value_v = *val; + *val = 0; + }else value_v = 0; + if( value_v ) value_v->set_parent(this); + } + + int arg_node:: + operator == (const arg_node& cmp) const + { + Boolean b1 = + !name_v && !cmp.name_v || + name_v && cmp.name_v && 0==strcmp(name_v, cmp.name_v); + return b1; + } + + int arg_node:: + operator == (const char* cmp) const + { + Boolean b1 = + !name_v && !cmp || + name_v && cmp && 0==strcmp(name_v, cmp); + return b1; + } + + ///////////////////////////////////////////////////////////////////// + // exp_node's + const alst_node* exp_node:: + match(const alst_node* env ) const + { + const alst_node* match = 0; + for(const alst_node* en=env; en; en = en->next() ) + { + if( en->arg() && en->arg()->value() ){ + if( *this==*(en->arg()->value()) ) + { + match = en; + break; + } + } + } + return match; + } + + void exp_node:: + symbolic_print(const alst_node*env,int inp)const + { + if( inp&node::DO_PRINT_SYM ){ + exp_node* exp = (exp_node*)this->clone(); + if( exp ){ + exp_node* pexp = exp->extract_defs(env); + if( pexp ){ + pexp->print(env,inp); + if( pexp != exp ) delete pexp; + }else{ + exp->print(env,inp); + } + delete exp; + }else{ + this->print(env,inp); + } + }else{ + this->print(env,inp); + } + } + + ///////////////////////////////////////////////////////////////////// + // var_node + var_node:: + var_node(const char* nm) + { + if( nm ){ + name_v = new char[strlen(nm)+1]; + strcpy(name_v,nm); + }else nm = 0; + } + + var_node:: + var_node(const var_node& from) + { + //*this = from; + if( from.name_v ) { + name_v = new char [strlen(from.name_v)+1]; + strcpy(name_v, from.name_v); + }else name_v = 0; + parent_v = 0;//from.parent_v; + } + + Boolean var_node:: + has_free(const arg_node* argr, const alst_node* env) const + { + // const exp_node* exp=this; + #ifndef REDUCE_VARS + exp = reduce_value(env); + //if( exp != this ) + if( VAR!=exp->op() ) + return exp->has_free(argr, env); + #endif + #undef MATCH_NAME + #ifdef MATCH_NAME + //if( argr ) return argr->operator==(name_v); + if( argr ) return *argr==(exp->name()); + #else + if( argr ){ + const alst_node* bd = this->bind(env); + if( bd && (bd->arg()==argr)) + { + return True; + } + } + #endif + return False; + } + + arglst_node* var_node:: + bind(const alst_node* env) const + { + //arg_node* arg = 0; + //if( !this->name() ) return arg; + //if( ref_arg_v ) return; + if( !this->name() ) return 0; + #if 0 + for( node* par = parent_v; par; par = par->parent() ) + { + if( LAM==par->op() && par->arg() && par->arg()->name() ){ + if( 0==strcmp(par->arg()->name(), + this->name())) + { + arg = par->arg(); + break; + } + } + // if( arg ) break; + } + #endif + //if( !arg ) { + alst_node* lst; + for( lst=(arglst_node*)env; + lst; lst=(arglst_node*)lst->next() ) + { + if( lst->arg() && lst->arg()->name() ){ + if( 0==strcmp(lst->arg()->name(), + this->name())) + { + //arg = lst->arg(); + break; + } + } + } + //} + ////if( arg ){ref_arg_v = arg;if( def_arg_v ) delete def_arg_v;def_arg_v = 0;} + return (arglst_node*)lst; + } + + void var_node:: + print(const alst_node*env,int inp) const + { + printf("%s", name() ? name() : "(null-var)" ); + } + + var_node& var_node:: + operator =(const var_node& from) + { + if( name_v ) delete [] name_v; + if( from.name_v ) { + name_v = new char [strlen(from.name_v)+1]; + strcpy(name_v, from.name_v); + }else name_v = 0; + if( this != &from ){ + parent_v = from.parent_v; + } + return *this; + } + + void var_node:: + set_name(const char* nm) + { + if( name_v == nm ) return; + if( name_v ) delete [] name_v; + name_v = nm?new char[strlen(nm)+1]:0; + if( name_v && nm ) strcpy(name_v,nm); + } + + exp_node* var_node:: + reduce_value(const alst_node* env, int inp, int* outp, + const alst_node** pnenv) + { + exp_node* exp = this; + exp_node* val; + + val = exp; + int reduced = 0; + int cnt = 0; + int max_loops = (inp & DO_REDUCE_FULLY) ? 2 : 0; + do { + do { + env = val->bind(env); + if( !val ) goto end; + arg_node* barg = env ? env->arg() : 0; + exp_node* nval = barg ? barg->value() : 0; + if( !nval ) break; + if( val == nval ) goto end; + if( val == nval ) break; + val = nval; + reduced = 1; + } while (env && val && VAR==val->op() && val!=this ); + env = definition_env; + cnt++; + } while (reduced && cnt < max_loops); + end: + if( val ) exp = val; + if( pnenv ){ + //if( env ) env = env->next(); + //*pnenv = (alst_node*)env; + *pnenv = definition_env; + } + return exp; + } + + exp_node* var_node:: + reduce_number() + { + exp_node* exp = 0; + if( name() ) + { + int is_number = 1; + for(const char*pc = name();*pc!='\0';pc++) + { + int ch = *pc; + if( ch < '0' || ch > '9' ) + { + is_number = 0; + break; + } + } + if( is_number ) + { + arg_node* arg1 = new arg_node("m",0); + arg_node* arg2 = new arg_node("n",0); + exp_node *bdy = new var_node("n"); + int number = atoi((const char*)name()); + for( ; number > 0; number -= 1 ) + { + var_node* lft = new var_node("m"); + bdy = new app_node(lft,bdy,True); + } + lam_node* lam2 = new lam_node(arg2,bdy,True); + lam_node* lam1 = new lam_node(arg1,lam2,True); + exp = lam1; + } + } + return exp; + } + + exp_node* var_node:: + reduce(const alst_node* env, int inp,int* outp) + { + var_reduce_recurse_level++; + if( var_reduce_recurse_level > MAX_RECURSE ){ + printf("\nvar_reduce_recurse_level %d [", + var_reduce_recurse_level); + this->print(); + printf ("]\n"); + var_reduce_recurse_level--; + if( outp ) *outp |= node::RECURSE_LVL; + return this; + } + const alst_node* nenv = 0; + exp_node* exp = this->reduce_value(env, inp, outp, &nenv); + if( exp != this ) + { + exp = (exp_node*)exp->clone(); + if( nenv && (APP==exp->op() || LAM==exp->op()) + && (inp&DO_REDUCE_FULLY)!=0 ) + { + exp_node* nexp = exp->reduce_vars(nenv,inp,outp); + if( nexp && nexp != exp ) + { + delete exp; + exp = nexp; + } + } + } + exp_node* num = reduce_number(); + if( num ) + { + if( exp != this ){ + delete exp; + exp = num; + }else{ + exp = num; + } + } + var_reduce_recurse_level--; + return exp; + } + + void var_node:: + rename(arg_node* arg, const char* newname, alst_node* env) + { + arglst_node* lst = this->bind(env); + arg_node* barg = lst ? lst->arg() : 0; + if( barg && barg==arg ) this->set_name(newname); + } + + int var_node:: + operator == (const exp_node& cmp) const + { + Boolean b1 = False; + if( VAR!=cmp.op() ) return b1; + b1 = !name() && !cmp.name() || + name() && cmp.name() && 0==strcmp(name(), cmp.name()); + return b1; + } + + exp_node* var_node:: + extract(const char* nm, int inp) const + { + if( name() && nm && 0==strcmp(nm,name()) ) + { + return (exp_node*)new var_node("I"); + }else + if( nm ) + { + exp_node* lft = new var_node("K"); + exp_node* rgt = new var_node(name()); + return (exp_node*)new app_node(lft,rgt,True); + }else{ + return (exp_node*)new var_node(name()); + } + } + + + ////////////////////////////////////////////////////////////////////// + // lam_node + lam_node:: + lam_node(arg_node* arg, exp_node* bdy, Boolean import) + { + arg_v = 0; + body_v = 0; + set_arg(arg,import); + set_body(bdy,import); + } + + lam_node:: + lam_node(const lam_node& from) + { + //*this = from; + if( from.arg_v ) + arg_v = (arg_node*)from.arg_v->clone(); + else arg_v = 0; + if( arg_v ) arg_v->set_parent(this); + if( from.body_v ) + body_v = (exp_node*)from.body_v->clone(); + else body_v = 0; + if( body_v ) body_v->set_parent(this); + parent_v = 0;//from.parent_v; + } + + lam_node:: + ~lam_node() + { + if( arg_v ) delete arg_v; + if( body_v ) delete body_v; + } + + Boolean lam_node:: + has_free(const arg_node* argr, const alst_node* env) const + { + stack_frame nenv(arg_v,env); + if( arg_v && arg_v->operator ==(*argr) ) return False; + if( body_v ) return body_v->has_free(argr, (alst_node*)&nenv); + return False; + } + + void lam_node:: + print(const alst_node*env, int inp) const + { + int printed = 0; + if( (inp&DO_PRINT_SYM) ) + { + if( env ) + { + const alst_node* alst = this->match(env); + if( alst ){ + printf("%s", alst->arg()->name()); + printed = 1; + } + } + if( !printed ) + { + int value = 0; + if( LAM==body()->op() + && arg() + && arg()->name() + && body() + && body()->arg() + && body()->arg()->name() + && body()->body()) + { + const char* name1 = arg()->name(); + const char* name2 = body()->arg()->name(); + for( exp_node* numbody = body()->body(); + numbody; numbody = numbody->right() ) + { + if( APP==numbody->op() + && numbody->left() + && VAR==numbody->left()->op() + && numbody->left()->name() + && 0==strcmp(name1,numbody->left()->name()) + ){ + value += 1; + }else + if( VAR==numbody->op() + && numbody->name() + && 0==strcmp(name2,numbody->name()) + ){ + break; + }else{ + value = -1; + break; + } + } + if( value >= 0 ) + { + printf( "%d",value); + printed = 1; + } + }else + if( arg() + && arg()->name() + && body() + && VAR==body()->op() + && 0==strcmp(arg()->name(), body()->name()) ) + { + printf( "I"); + printed = 1; + } + } + } + if( !printed ) + { + printf("^"); + //if( arg() ) arg()->print(env,inp); + if( arg() && arg()->name() ) printf("%s",arg()->name()); + else printf("(null-arg)"); + if( arg() && arg()->value() ){ + printf("["); + arg()->value()->print(env,inp); + printf("]"); + } + printf("."); + if( body() ) body()->print(env,inp); + else printf("(null-body)"); + } + } + + lam_node& lam_node:: + operator =(const lam_node& from) + { + if( this!=&from ){ + this->~lam_node(); + if( from.arg_v ) + arg_v = (arg_node*)from.arg_v->clone(); + else arg_v = 0; + if( arg_v ) arg_v->set_parent(this); + if( from.body_v ) + body_v = (exp_node*)from.body_v->clone(); + else body_v = 0; + if( body_v ) body_v->set_parent(this); + parent_v = 0;//from.parent_v; + } + return *this; + } + + exp_node* lam_node:: + reduce(const alst_node* env, int inp, int* outp) + { + exp_node* exp = this; + stack_frame nenv(this->arg_v, (arglst_node*)env ); + if(inp&DO_TRACE){ + for(int idx=0;idxparent();par=(exp_node*)par->parent() ); + par->symbolic_print(env,inp); + printf("\n"); + } + lambda_reduce_recurse_level++; + if( lambda_reduce_recurse_level > MAX_RECURSE ){ + printf("\nlambda_reduce_recurse_level %d\n", + lambda_reduce_recurse_level); + lambda_reduce_recurse_level--; + if( outp ) *outp |= node::RECURSE_LVL; + return this; + } + body_v->set_parent(this); + if( arg_v && arg_v->name() && '&'==arg_v->name()[0] ) + { + inp &= ~DO_STEP; + inp &= ~DO_REDUCE_BODY; + } + if( arg_v && arg_v->value() && body_v ){ + body_v->resolve_name_clash(arg_v,&nenv); + //old delet -- body_v->bind(nenv); + // + if( arg_v->name() && '$'==arg_v->name()[0] ) + { + inp &= ~DO_STEP; + inp |= DO_REDUCE_BODY; + } + if( !(inp&DO_STEP) ){ + int toutp = outp ? *outp : 0; + exp = body_v; + exp = body_v->reduce_vars((alst_node*)&nenv,inp,outp); + if( exp!=body_v ) set_body(0,True); + arg_v->import_value((exp_node*)0); + int cnt = 0; + do { + exp_node* nexp = 0; + nexp = exp->reduce((alst_node*)&nenv,inp,&toutp); + if( nexp && exp != nexp ){ + if( exp==body_v ) body_v = 0; + delete exp; + exp = nexp; + } + if( toutp && toutp&node::RECURSE_LVL ) break; + if( toutp & node::BETA_ETA_DONE){ + toutp &= ~node::BETA_ETA_DONE; + }else break; + cnt++; + } while( exp ); + if( outp ) *outp = toutp; + if( cnt > 1 ) + { + printf("[%d.%d]",cnt,lambda_reduce_recurse_level); + } + }else{ + exp = body_v->reduce_vars((alst_node*)&nenv,inp,outp); + } + if( body_v && body_v!=exp ) delete body_v; + this->body_v = 0; + if( exp ) exp->set_parent(parent_v); + //if( parent() ) delete this; + }else if( body_v ){ + exp_node* nexp = eta_reduce( &nenv,inp,outp); + if( exp!=nexp ){ + if( exp != this ) delete exp; + exp = nexp; + }else{ + int toutp = outp ? *outp : 0; + if( inp&DO_REDUCE_BODY ){ + exp_node* nd = + body_v->reduce((alst_node*)&nenv,inp,&toutp); + if( nd ) set_body(nd,True); + }else{ + exp_node* nd = + body_v->reduce_vars((alst_node*)&nenv,inp,outp); + if( nd ) set_body(nd,True); + } + if( !(inp&DO_STEP) || !(toutp&node::BETA_ETA_DONE) ){ + nexp = eta_reduce( &nenv,inp, &toutp); + if( exp!=nexp ){ + if( exp != this ) delete exp; + exp = nexp; + } + } + if( outp ) *outp = toutp; + } + } + lambda_reduce_recurse_level--; + if(0 && inp&DO_TRACE ){ + for(int idx=0;idx "); + //exp->print(env, inp); + exp->set_parent(this->parent()); + exp_node* par; + for(par=exp;par->parent();par=(exp_node*)par->parent() ); + par->symbolic_print(env,inp); + printf("\n"); + } + return exp; + } + + exp_node* lam_node:: + eta_reduce(const alst_node* env,int inp,int* outp) + { + // assume stack frame already set> + exp_node* exp = this; + if( !body_v ) return exp; + if( !(inp&DO_STEP) || !outp || !(*outp&node::BETA_ETA_DONE)) + { + if(APP==body_v->op() && !(inp&DO_APP_ORDER) ){ + // check for eta reduction + if( body()->left() ) + { + #ifdef REDUCE_VARS + exp_node* nd = body_v->left()->reduce_vars(env,inp,outp); + if( nd ) ((app_node*)body())->set_left(nd,True); + #endif + if( body_v->right() && arg_v + && *arg_v == body_v->right()->name() + && !body_v->left()->has_free(arg_v, env) ) + { + // do eta reduction + exp = this->body_v->export_left(); + //this->body_v = 0; // right_v memory leak? + set_body(0,true); + if( outp ) *outp |= + (node::BETA_ETA_DONE | node::ETA_DONE); + if( !(inp&DO_STEP ) ){ + exp_node* nexp = exp->reduce(env,inp,outp); + if( nexp && exp != nexp ){ + if( exp ) delete exp; + exp = nexp; + } + } + } + } + } + } + return exp; + } + + exp_node* lam_node:: + reduce_vars(const alst_node* env,int inp,int* outp) + { + stack_frame nenv(this->arg_v, (arglst_node*)env ); + + exp_node* nd = body_v->reduce_vars((alst_node*)&nenv,inp,outp); + if( nd ) set_body(nd,True); + + return this; + } + + void lam_node:: + rename(arg_node* arg, const char* newname, alst_node* env) + { + stack_frame nenv(this->arg_v, (arglst_node*)env ); + if( body_v ) body_v->rename(arg,newname,&nenv); + } + + void lam_node:: + resolve_name_clash( arg_node* outer_arg,alst_node* env) + { + stack_frame nenv(this->arg_v, (arglst_node*)env ); + if( outer_arg->value() ){ + arg_node* inner_arg = this->arg(); + exp_node* inner_body = this->body(); + if( inner_arg && inner_body + && !(inner_arg==outer_arg)) + { + Boolean b1 = outer_arg->value() + ->has_free(inner_arg, (alst_node*)&nenv); + Boolean b2 = + inner_body->has_free(outer_arg, (alst_node*)&nenv); + if( b1 && b2 ) + { + char* nm = newname(inner_arg->name()); + body_v->rename(inner_arg,nm,(alst_node*)&nenv); + inner_arg->set_name(nm); + delete [] nm; + } + } + if( body_v && body_v->has_free(outer_arg, &nenv) ) + body_v->resolve_name_clash(outer_arg, &nenv); + } + } + + void lam_node:: + set_arg(arg_node* nd, Boolean import) + { + if( arg_v == nd ) return; + if( arg_v ) delete arg_v; + if( import ) arg_v = nd; + else if( nd ) arg_v = (arg_node*)nd->clone(); + else arg_v = 0; + if( arg_v ) arg_v->set_parent(this); + } + + void lam_node:: + set_body(exp_node* nd, Boolean import) + { + if( body_v == nd ) return; + if( body_v ) delete body_v; + if( import ) body_v = nd; + else if( nd ) body_v = (exp_node*)nd->clone(); + else body_v = 0; + if( body_v ) body_v->set_parent(this); + } + + int lam_node:: + operator == (const exp_node& cmp) const + { + Boolean b1 = False; + if( LAM!=cmp.op() ) return b1; + if( !arg() || !cmp.arg() ) return b1; + if( !body() || !cmp.body() ) return b1; + b1 = *arg() == *(cmp.arg()) + && *body() == *(cmp.body()); + return b1; + } + + exp_node* lam_node:: + extract_defs(const alst_node* env) + { + exp_node* exp = this; + const alst_node* alst = this->match(env); + if( !alst ){ + if( body() ) { + exp_node* nb = body()->extract_defs(env); + if( nb ) + set_body(nb,True); + alst = this->match(env); + if( alst ) + exp = new var_node(alst->arg()->name()); + } + }else{ + exp = new var_node(alst->arg()->name()); + } + return exp; + } + + exp_node* lam_node:: + extract(const char* nm, int inp) const + { + exp_node* exp = 0; + if( body() && arg() ) + { + exp_node* bdy = body()->extract(arg()->name(),inp); + if( bdy && nm ) + { + exp = bdy->extract(nm,inp); + delete bdy; + } else { + exp = bdy; + } + } + return exp; + } + + ////////////////////////////////////////////////////////////////////// + // app_node + app_node:: + app_node(exp_node* lft, + exp_node* rgt, + Boolean import) + { + left_v = 0; + right_v = 0; + set_left(lft,import); + set_right(rgt,import); + } + + app_node:: + app_node(const app_node& from) + { + //*this = from; + if( from.left_v ) + left_v = (exp_node*)from.left_v->clone(); + else left_v = 0; + if( left_v ) left_v->set_parent(this); + if( from.right_v ) + right_v = + (exp_node*)from.right_v->clone(); + else right_v = 0; + if( right_v) set_parent(this); + parent_v = from.parent_v; + } + + app_node:: + ~app_node() + { + if( left_v ) delete left_v; + if( right_v ) delete right_v; + } + + Boolean app_node:: + has_free(const arg_node* argr, const alst_node* env) const + { + Boolean has = False; + if( left_v ) has = has || left_v->has_free(argr,env); + if( right_v ) has = has || right_v->has_free(argr,env); + return has; + } + + void app_node:: + print(const alst_node*env,int inp) const + { + if( inp&DO_PRINT_BRIEF ){ + int left_paren = 1; + int right_paren = 1; + int left_right_paren = 0; + int left_match = 0; + int right_match = 0; + int left_right_match = 0; + if( left() ){ + if( inp&DO_PRINT_SYM ) + left_match = left()->match(env) ? 1 : 0; + if( VAR==left()->op() || APP==left()->op() || left_match ) + { + left_paren = 0; + } + if( APP==left()->op() && left()->right() ) + { + if( inp&DO_PRINT_SYM ) + left_right_match = + left()->right()->match(env) ? 1 : 0; + if( VAR!=left()->right()->op() && !left_right_match ) + left_right_paren = 1; + } + if( left_paren ) printf("("); + if( left() ) left()->print(env,inp); + else printf("(null-right)"); + if( left_paren ) printf(")"); + }else printf("()"); + if( right() ){ + if( inp&DO_PRINT_SYM ) + right_match = right()->match(env) ? 1 : 0; + if( VAR==right()->op() || right_match ) right_paren = 0; + if( right_paren ) printf("("); + else if( !left_paren && !left_right_paren ) + printf(" "); + if( right() ) right()->print(env,inp); + else printf("(null-right)"); + if( right_paren ) printf(")"); + }else printf("()"); + }else{ + if( left() ){ + if( VAR!=left()->op()||left()->value() ) printf("("); + if( left() ) left()->print(env,inp); + else printf("(null-right)"); + if( VAR!=left()->op()||left()->value() ) printf(")"); + }else printf("()"); + if( right() ){ + if( VAR!=right()->op()||right()->value() ) printf("("); + else printf(" "); + if( right() ) right()->print(env,inp); + else printf("(null-right)"); + if( VAR!=right()->op()||right()->value() ) printf(")"); + }else printf("()"); + } + } + + app_node& app_node:: + operator =(const app_node& from) + { + if( this!=&from ){ + this->~app_node(); + if( from.left_v ) + left_v = (exp_node*)from.left_v->clone(); + else left_v = 0; + if( left_v ) left_v->set_parent(this); + if( from.right_v ) + right_v = (exp_node*)from.right_v->clone(); + else right_v = 0; + if( right_v ) right_v->set_parent(this); + parent_v = from.parent_v; + } + return *this; + } + + void app_node:: + rename(arg_node* arg, const char* newname, alst_node* env) + { + if( left_v ) left_v->rename(arg,newname,env); + if( right_v ) right_v->rename(arg,newname,env); + } + + void app_node:: + resolve_name_clash( arg_node* outer_arg,alst_node* env) + { + if( left_v ) left_v->resolve_name_clash(outer_arg,env); + if( right_v ) right_v->resolve_name_clash(outer_arg,env); + } + + exp_node* app_node:: + reduce(const alst_node* env, int inp,int* outp) + { + exp_node* exp = this; + app_reduce_recurse_level += 1; + if( app_reduce_recurse_level > MAX_RECURSE ){ + printf("\napp_reduce_recurse_level %d\n", + app_reduce_recurse_level); + app_reduce_recurse_level--; + if( outp ) *outp |= node::RECURSE_LVL; + return this; + } + + if( left_v ){ + int ninp = inp & ~DO_REDUCE_BODY; + left_v->set_parent(this); + exp_node* nd = left_v->reduce(env,ninp,outp); + set_left(nd,True); + if( outp && *outp&node::RECURSE_LVL ){ + app_reduce_recurse_level--; + return exp; + } + if( inp&node::DO_STEP && outp && (*outp&node::BETA_ETA_DONE) ) + { + app_reduce_recurse_level--; + return exp; + } + } + if( left_v && APP==left_v->op() ){ + exp_node* nd = 0; + int ninp = inp & ~DO_REDUCE_BODY; + left_v->set_parent(this); + if( left_v ) nd = left_v->reduce(env,ninp,outp); + set_left(nd, True); + if( outp && *outp&node::RECURSE_LVL ) + { + app_reduce_recurse_level--; + return exp; + } + if( inp&node::DO_STEP && outp && (*outp&node::BETA_ETA_DONE) ) + { + app_reduce_recurse_level--; + return exp; + } + if( right_v ){ + nd = 0; + right_v->set_parent(this); + #ifdef REDUCE_VARS + nd = right_v->reduce_vars(env,inp,outp); + set_right(nd,True); + #endif + } + } + if( left_v && LAM==left_v->op() ) + { + int app_inp = inp; + if( left_v->arg() + && left_v->arg() + && left_v->arg()->name() ) + { + if('@'==left_v->arg()->name()[0] ) + { + app_inp |= DO_APP_ORDER; + }else + if( '#'==left_v->arg()->name()[0] ) + { + app_inp &= ~DO_APP_ORDER; + } + } + if( right_v ) + { + Boolean has = False; + right_v->set_parent(this); + if( app_inp&DO_APP_ORDER ){ + arg_node* an = left_v->arg(); + exp_node* bd = left_v->body(); + stack_frame nenv(an, (arglst_node*)env ); + has = bd && an && bd->has_free(an, &nenv); + } + if( (app_inp&DO_APP_ORDER) && has ){ + int ninp = inp & ~DO_REDUCE_BODY; + set_right(right_v->reduce(env, ninp, outp),True); + if( outp && (*outp&node::RECURSE_LVL) ) + { + app_reduce_recurse_level--; + return exp; + } + if( (inp&node::DO_STEP) + && outp && (*outp&node::BETA_ETA_DONE) ) + { + app_reduce_recurse_level--; + return exp; + } + }else{ + #ifdef REDUCE_VARS + set_right(right_v->reduce_vars(env,inp,outp),True); + if( outp && (*outp&node::RECURSE_LVL) ) + { + app_reduce_recurse_level--; + return exp; + } + #endif + } + } + left_v->arg()->import_value(&right_v); + right_v = 0; + left_v->set_parent(this); + exp = left_v->reduce(env,inp,outp); + if( left_v && left_v!=exp ) delete left_v; + left_v = 0; + if( exp ) exp->set_parent(this); + if( outp ) *outp |= node::BETA_ETA_DONE; + }else{ + if( right_v ){ + right_v->set_parent(this); + #ifdef REDUCE_VARS + set_right(right_v->reduce_vars(env,inp,outp),True); + #endif + set_right(right_v->reduce(env,inp,outp),True); + + #if 0 + if( right_v && APP==right_v->op() + && right_v->left() + && LAM==right_v->left()->op() + ){ + set_right(right_v->reduce(env,inp,outp),True);//OLD + } + #endif + } + } + app_reduce_recurse_level -= 1; + return exp; + } + + exp_node* app_node:: + reduce_vars(const alst_node* env,int inp,int* outp) + { + if( left_v ){ + left_v->set_parent(this); + exp_node* exp = left_v->reduce_vars(env,inp,outp); + set_left(exp,True); + if( outp && (*outp&node::RECURSE_LVL) ) + { + if( right_v ) right_v->set_parent(this); + return this; + } + } + if( right_v ){ + right_v->set_parent(this); + exp_node* exp = right_v->reduce_vars(env,inp,outp); + set_right(exp,True); + } + return this; + } + + void app_node:: + set_left(exp_node* nd, Boolean import) + { + if( left_v == nd ) return; + if( left_v ) delete left_v; + if( import ) left_v = nd; + else if( nd ) left_v = (exp_node*)nd->clone(); + else left_v = 0; + if( left_v ) left_v->set_parent(this); + } + + void app_node:: + set_right(exp_node* nd, Boolean import) + { + if( right_v==nd ) return; + if( right_v ) delete right_v; + if( import ) right_v = nd; + else if( nd ) right_v = (exp_node*)nd->clone(); + else right_v = 0; + if( right_v ) right_v->set_parent(this); + } + + int app_node:: + operator == (const exp_node& cmp) const + { + Boolean b1 = False; + if( APP!=cmp.op() ) return b1; + if( !left() || !cmp.left() ) return b1; + if( !right() || !cmp.right() ) return b1; + b1 = *left() == *(cmp.left()) + && *right() == *(cmp.right()); + return b1; + } + + exp_node* app_node:: + extract_defs(const alst_node* env) + { + exp_node* exp = this; + const alst_node* alst = match(env); + if( !alst ){ + if( left() ){ + exp_node* nl = left()->extract_defs(env); + if( nl ) + set_left( nl, True); + } + if( right() ){ + exp_node* nr = right()->extract_defs(env); + if( nr ) + set_right( nr, True); + } + alst = match(env); + if( alst ) + exp = new var_node(alst->arg()->name()); + }else{ + exp = new var_node(alst->arg()->name()); + } + return exp; + } + + exp_node* app_node:: + extract(const char* nm,int inp) const + { + exp_node* exp = 0; + exp_node* lft = 0; + exp_node* rgt = 0; + exp_node* exp1 = 0; + //if( left() && right() && nm && (inp&DO_EXTRACT_ETA) ) + if( left() && right() && nm ) + { + arg_node* argr = new arg_node(nm,0); + arglst_node env(argr,0, True); + if( !this->has_free(argr, &env) ) + { + if( inp&DO_EXTRACT_APP ) + { + if( left() ) lft = left()->extract(nm,inp); + if( right() ) rgt = right()->extract(nm,inp); + exp1 = (exp_node*)new app_node( + new var_node("S"),lft,True); + exp = (exp_node*)new app_node(exp1,rgt,True); + }else{ + //exp = (exp_node*)new app_node(new var_node("K"), + // (exp_node*)this->clone(),True); + exp1 = this->extract(0,inp); + exp = (exp_node*)new app_node( + new var_node("K"), exp1, True); + } + }else + if( !left()->has_free(argr, &env) + && VAR==right()->op() + && right()->name() + && (inp&DO_EXTRACT_ETA) + && 0==strcmp( nm, right()->name()) ) + { + exp = (exp_node*)left()->clone(); + } + } + if( !exp ) + { + if( left() ) lft = left()->extract(nm,inp); + if( right() ) rgt = right()->extract(nm,inp); + if( nm ) + { + exp1 = (exp_node*)new app_node( + new var_node("S"),lft,True); + exp = (exp_node*)new app_node(exp1,rgt,True); + }else{ + exp = (exp_node*)new app_node(lft,rgt,True); + } + } + return exp; + } + + ////////////////////////////////////////////////////////////////////// + // alst_node's + arglst_node:: + arglst_node( arg_node* arg,arglst_node* next, Boolean import) + { + if( import) arg_v=arg; + else if( arg ) arg_v = (arg_node*)arg->clone(); + else arg_v = 0; + if( import ) next_v=next; + else if( next ) next_v = (arglst_node*)next->clone(); + else next_v = 0; + } + + arglst_node:: + arglst_node(const arglst_node& from) { + if( from.arg_v ) + arg_v = (arg_node*)from.arg_v->clone(); + else arg_v = 0; + if( from.next_v ) + next_v = (arglst_node*)from.next_v->clone(); + else arg_v = 0; + } + + + arglst_node:: + ~arglst_node() + { + if( arg_v ) delete arg_v; + if( next_v ) delete next_v; + } + alst_node* arglst_node:: + add(arg_node* anode,Boolean import) + { + arglst_node* retval = this; + arglst_node* where = 0; + if( !anode ) return where; + + for( arglst_node* lst=this; + lst; lst=(arglst_node*)lst->next() ) + { + if( lst->arg() && lst->arg()->name() ){ + if( 0==strcmp(anode->name(), + lst->arg_v->name())) + { + where = lst; + where->set_arg(anode, import); + break; + } + } + } + + if( !where){ + where = new arglst_node(anode,0,import); + where->next_v = this; + retval = where; + } + + return (alst_node*)retval; + } + + arg_node* arglst_node:: + find(arg_node* anode) + { + arglst_node* where = 0; + if( !anode ) return 0; + arglst_node* last = 0; + arg_node* arg = 0; + + for( arglst_node* lst=this; + lst; last = lst, lst=(arglst_node*)lst->next() ) + { + if( lst->arg() && lst->arg()->name() ){ + if( 0==strcmp(anode->name(), + lst->arg_v->name())) + { + where = lst; + break; + } + } + } + if( where ) arg = where->arg_v; + return arg; + } + + void arglst_node:: + set_arg(arg_node* nd, Boolean import) + { + if( arg_v == nd ) return; + if( arg_v ) delete arg_v; + if( import ) arg_v = nd; + else if( nd ) arg_v = (arg_node*)nd->clone(); + else arg_v = 0; + if( arg_v ) arg_v->set_parent(this); + } + + void arglst_node:: + list() + { + for(alst_node* pnode=(alst_node*)this;pnode; pnode=pnode->next() ) + { + if( pnode->arg() ) pnode->arg()->print(); + printf("\n"); + } + } Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/node.h diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/node.h:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/node.h Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,383 ---- + /* node.h */ + /* + Copyright (C) 2003 Unique Software Designs + + This file is part of the program "lambda". + + The program "lambda" is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + The program "lambda" is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with "lambda"; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + A copy of the GNU General Public License may also be found at: + http://www.gnu.org/copyleft/gpl.html + */ + class arg_node; + class exp_node; + class var_node; + class lam_node; + class app_node; + + class alst_node; + class arglst_node; + class argrefs_node; + + #ifndef Boolean + #define Boolean short + #define False 0 + #define True 1 + #endif + + ///////////////////////////////////////////////////////////////////// + class node { + public: + enum type { NTYPE, NODE, ARG, VAR, LAM, APP, ARGLST, STACKFRAME, ARGREFS }; + enum { RECURSE_LVL=1, BETA_ETA_DONE=2, ETA_DONE=4 }; + enum { DO_STEP=1, DO_APP_ORDER=2, DO_REDUCE_BODY=4, + DO_PRINT_SYM=8,DO_PRINT_BRIEF=16, + DO_TRACE=32, DO_EXTRACT_ETA=64, + DO_EXTRACT_APP=128, + DO_REDUCE_FULLY=256}; + public: + node() { parent_v = 0;}; + node(const node& from) { parent_v=from.parent_v; }; + virtual node* clone() const= 0; + virtual ~node() {}; + public: + virtual type op() const{ return NODE;}; + virtual const char* name() const{ return 0;}; + virtual exp_node* value() const{ return 0;}; + virtual arg_node* arg() const{ return 0;}; + virtual exp_node* body() const{ return 0;}; + virtual exp_node* left() const{ return 0;}; + virtual exp_node* right() const{ return 0;}; + virtual alst_node* next() const{ return 0;}; + virtual node* parent() const{ return parent_v; }; + public: + virtual void set_parent(node* par){ parent_v = par;}; + public: + static void reset(); + public: + //virtual void rename() {}; + virtual exp_node* reduce( + const alst_node* env,int inp,int* outp){ + return 0;}; + public: + virtual void print(const alst_node*env=0,int inp=0) const; + protected: + node* parent_v; + }; + + ///////////////////////////////////////////////////////////////////// + class exp_node: public node + { + public: + virtual Boolean has_free(const arg_node*, const alst_node* env)const{ return False; }; + virtual arglst_node* bind(const alst_node* env=0)const{return 0;}; + virtual exp_node* reduce_vars(const alst_node* env,int inp,int* outp){ + return this; }; + virtual void rename( + arg_node* arg,const char* newname,alst_node* env=0){}; + virtual void resolve_name_clash( + arg_node* outer_arg,alst_node* env=0){}; + public: + virtual int operator == (const exp_node& cmp) const {return False;}; + public: + virtual exp_node* export_body(){return 0;}; + virtual exp_node* export_left(){return 0;}; + virtual exp_node* export_right(){return 0;}; + public: + virtual const alst_node* match(const alst_node* env=0) const; + virtual exp_node* extract_defs(const alst_node* env=0){return 0; }; + void symbolic_print(const alst_node* env,int inp = 0) const; + public: + virtual exp_node* extract(const char* nm,int inp=0) const {return 0; }; + }; + + ///////////////////////////////////////////////////////////////////// + class alst_node: public node + { + public: + virtual ~alst_node(){}; + virtual alst_node* add( + arg_node* anode,Boolean import=False){ + return 0; }; + virtual arg_node* find(arg_node* anode) { + return 0;}; + virtual void list(){}; + }; + + ///////////////////////////////////////////////////////////////////// + class arg_node: public node + { + public: + arg_node(){ name_v = 0; value_v=0;}; + arg_node(const char*nm,const exp_node* ex, + Boolean import=False); + + arg_node(const arg_node& from); + virtual node* clone() const; + virtual ~arg_node(); + public: + virtual arg_node& operator =(const arg_node& from); + public: + //Boolean free_in(exp_node* exp); + virtual void print(const alst_node*env=0, int inp=0) const; + public: + virtual type op() const{ return ARG;}; + virtual const char* name() const{ return name_v;}; + virtual exp_node* value() const{ return value_v;}; // VAR, LAM, or APP + //virtual arg_node* arg() const{ return 0;}; + //virtual exp_node* body() const{ return 0;}; + //virtual exp_node* left() const{ return 0;}; + //virtual exp_node* right() const{ return 0;}; + //virtual alst_node* next() const{ return 0;}; + public: + //virtual exp_node* reduce(const alst_node* env,int inp,int* outp) { return 0;}; + void import_value(exp_node** val); + int operator == (const arg_node& cmp) const; + int operator == (const char* cmp) const; + public: + void set_name(const char* nm) + { + if( name_v == nm ) return; + if( name_v ) delete [] name_v; + name_v = nm?new char[strlen(nm)+1]:0; + if( name_v && nm ) strcpy(name_v,nm); + }; + void import_value(exp_node* nd) + { + if( value_v == nd ) return; + if( value_v ) delete value_v; + value_v = nd; + if( value_v ) value_v->set_parent(this); + }; + private: + char* name_v; + exp_node* value_v; + }; + + ///////////////////////////////////////////////////////////////////// + class var_node: public exp_node + { + public: + var_node(const char* nm=0); + var_node(const var_node& from); + virtual node* clone() const { return (node*)new var_node(*this); }; + virtual ~var_node(){ if( name_v ) delete [] name_v;}; + public: + virtual Boolean has_free(const arg_node* argr, const alst_node* env) const; + arglst_node* bind(const alst_node* env=0)const; + virtual void print(const alst_node*env=0,int inp=0) const; + public: + var_node& operator =(const var_node& from); + public: + virtual type op() const { return VAR;}; + virtual const char* name() const{ + return name_v;}; + //virtual exp_node* value() const{return arg() ? arg()->value() : 0; }; // VAR, LAM, or APP + //virtual exp_node* value() const; + ////virtual arg_node* arg() const{return ref_arg_v ? ref_arg_v : def_arg_v;}; + //virtual exp_node* body() const{ return 0;}; + //virtual exp_node* left() const{ return 0;}; + //virtual exp_node* right() const{ return 0;}; + //virtual alst_node* next() const{ return 0;}; + public: + void set_name(const char* nm); + public: + virtual void rename( + arg_node* arg,const char* newname,alst_node*env=0); + virtual void resolve_name_clash( + arg_node* outer_arg,alst_node* env=0){}; + virtual exp_node* reduce_value( + const alst_node* env, int inp, int* outp, + const alst_node** pnenv); + exp_node* reduce_number(); + virtual exp_node* reduce( + const alst_node* env,int inp,int* outp); + virtual exp_node* reduce_vars(const alst_node* env,int inp,int* outp) + { + return reduce(env,inp,outp); + }; + public: + ////void reduce_arg(); + ////arg_node* ref_arg() { return ref_arg_v;}; + public: + virtual int operator == (const exp_node& cmp) const; + public: + virtual exp_node* extract(const char* nm,int inp=0) const; + private: + ////arg_node* def_arg_v; + ////arg_node* ref_arg_v; + char* name_v; + }; + + ///////////////////////////////////////////////////////////////////// + class lam_node: public exp_node + { + public: + lam_node(){ arg_v=0; body_v=0;}; + lam_node(arg_node* arg, exp_node* bdy, + Boolean import=False); + lam_node(const lam_node& from); + virtual node* clone() const { return (node*)new lam_node(*this); }; + virtual ~lam_node(); + public: + virtual Boolean has_free(const arg_node* argr, const alst_node* env) const; + virtual arglst_node* bind(const alst_node* env=0)const{ + //if( body_v ){body_v->set_parent(this);body_v->bind(env); }; + return 0; + }; + virtual void print(const alst_node*env=0,int inp=0) const; + public: + lam_node& operator =(const lam_node& from); + public: + virtual type op() const { return LAM;}; + //virtual const char* name() const{ return 0;}; + //virtual exp_node* value() const{ return value;}; // VAR, LAM, or APP + virtual arg_node* arg() const{ return arg_v;}; + virtual exp_node* body() const{ return body_v;}; + //virtual exp_node* left() const{ return 0;}; + //virtual exp_node* right() const{ return 0;}; + //virtual alst_node* next() const{ return 0;}; + public: + virtual void rename( + arg_node* arg,const char* newname,alst_node* env=0); + virtual void resolve_name_clash( + arg_node* outer_arg,alst_node* env=0); + virtual exp_node* reduce( + const alst_node* env,int inp,int* outp); + virtual exp_node* eta_reduce( + const alst_node* env,int inp,int* outp); + virtual exp_node* reduce_vars(const alst_node* env,int inp,int* outp); + public: + void set_arg(arg_node* nd, Boolean import); + void set_body(exp_node* nd, Boolean import); + public: + virtual int operator == (const exp_node& cmp) const; + public: + virtual exp_node* export_body(){ + exp_node* exp = body_v; + body_v = 0; + return exp;}; + public: + virtual exp_node* extract_defs(const alst_node* env=0); + public: + virtual exp_node* extract(const char* nm,int inp=0) const; + private: + arg_node* arg_v; + exp_node* body_v; + }; + + ///////////////////////////////////////////////////////////////////// + class app_node: public exp_node + { + public: + app_node(){ left_v=0; right_v=0;}; + app_node( exp_node* lft, exp_node* rgt, + Boolean import = False); + app_node(const app_node& from); + virtual node* clone() const { return (node*)new app_node(*this); }; + virtual ~app_node(); + public: + virtual Boolean has_free(const arg_node* argr, const alst_node* env) const; + virtual arglst_node* bind(const alst_node* env=0)const{ + ////if( left_v ){left_v->set_parent(this);left_v->bind(env); } + ////if( right_v ){right_v->set_parent(this);right_v->bind(env); }; + return 0; + }; + virtual void print(const alst_node*env=0,int inp=0) const; + public: + app_node& operator =(const app_node& from); + public: + virtual type op() const{ return APP;}; + //virtual const char* name() const{ return 0;}; + //virtual exp_node* value() const{ return value;}; // VAR, LAM, or APP + //virtual arg_node* arg() const{ return 0;}; + //virtual exp_node* body() const{ return 0;}; + virtual exp_node* left() const{ return left_v;}; + virtual exp_node* right() const{ return right_v;}; + //virtual alst_node* next() const{ return 0;}; + public: + virtual void rename( + arg_node* arg,const char* newname,alst_node* env=0); + virtual void resolve_name_clash( + arg_node* outer_arg,alst_node* env=0); + virtual exp_node* reduce( + const alst_node* env,int inp,int* outp); + virtual exp_node* reduce_vars(const alst_node* env,int inp,int* outp); + public: + void set_left(exp_node* nd, Boolean import); + void set_right(exp_node* nd, Boolean import); + public: + virtual int operator == (const exp_node& cmp) const; + public: + virtual exp_node* export_left(){ + exp_node* exp = left_v; + left_v = 0; + return exp;}; + virtual exp_node* export_right(){ + exp_node* exp = right_v; + right_v = 0; + return exp;}; + public: + virtual exp_node* extract_defs(const alst_node* env=0); + public: + virtual exp_node* extract(const char* nm,int inp=0) const; + private: + exp_node* left_v; + exp_node* right_v; + }; + + ///////////////////////////////////////////////////////////////////// + class arglst_node: public alst_node + { + public: + arglst_node( + arg_node* arg=0,arglst_node* next=0, + Boolean import=False); + arglst_node(const arglst_node& from); + virtual node* clone() const { return (node*)new arglst_node(*this); }; + virtual ~arglst_node(); + public: + virtual type op() const { return ARGLST;}; + //virtual const char* name() const{ return 0;}; + //virtual exp_node* value() const{ return value;}; // VAR, LAM, or APP + virtual arg_node* arg() const{ return arg_v;}; + //virtual exp_node* body() const{ return 0;}; + //virtual exp_node* left() const{ return 0;}; + //virtual exp_node* right() const{ return 0;}; + virtual alst_node* next() const{ return (alst_node*)next_v;}; + public: + //virtual void rename() {}; + //virtual exp_node* reduce(const alst_node* env,int inp,int* outp) { return 0;}; + virtual alst_node* add(arg_node* anode,Boolean import=False); + virtual arg_node* find(arg_node* anode); + public: + void set_arg(arg_node* nd, Boolean import); + virtual void list(); + protected: + arg_node* arg_v; + arglst_node* next_v; + }; + + ///////////////////////////////////////////////////////////////////// + class stack_frame: public arglst_node + { + public: + virtual type op() const{ return STACKFRAME;}; + stack_frame(arg_node* arg=0, const alst_node* next=0) + { arg_v = arg; next_v = (arglst_node*)next; } + virtual ~stack_frame(){arg_v = 0;next_v = 0;}; + }; + + extern const arglst_node* definition_env; Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/parse.cc diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/parse.cc:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/parse.cc Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,453 ---- + /* parse.cc */ + /* + Copyright (C) 2003 Unique Software Designs + + This file is part of the program "lambda". + + The program "lambda" is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + The program "lambda" is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with "lambda"; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + A copy of the GNU General Public License may also be found at: + http://www.gnu.org/copyleft/gpl.html + */ + #if HAVE_CONFIG_H + # include "config.h" + #endif + #include + #include + #include + #include + + #include "token_stream.h" + #include "node.h" + #include "parse.h" + + int trace_lambda = 0; + int step_lambda = 0; + int print_symbols = 1; + int applicative_order = 0; + int reduce_body = 0; + int brief_print = 1; + int step_thru = 0; + int extract_eta = 1; + int extract_app = 0; + int reduce_fully = 1; + + lambda_expression_parser:: + lambda_expression_parser(token_stream* tokstr) + { + tokstr_v = tokstr; + paren_nest_level_v = 0; + } + + lambda_expression_parser:: + ~lambda_expression_parser() + { + } + + exp_node* lambda_expression_parser:: + expression(arglst_node** penv) + { + exp_node* exp = 0; + if( !tokstr_v ) return exp; + token_stream::token_type tok; + char* ptok; + token_stream::header_type htype; + + tok = tokstr_v->get_token(&ptok); + htype = tokstr_v->is_header(tok,ptok); + if( htype != token_stream::NOTHDR){ + switch(htype){ + case token_stream::QUIT: + exp = (exp_node*)new arg_node("QUIT", 0); + break; + case token_stream::DEF: + definition(penv); + break; + case token_stream::LOAD: + load(penv); + break; + case token_stream::SAVE: + break; + case token_stream::LIST: + if( penv && *penv) (*penv)->list(); + break; + case token_stream::SET: + { + int do_list = 0; + int cnt = 0; + for( tok = tokstr_v->get_token(&ptok); + tok!=token_stream::EOE; + tok = tokstr_v->get_token(&ptok) ) + { + if( tok==token_stream::NAME ){ + if( 0==strcasecmp("trace", ptok) ){ + trace_lambda = (!trace_lambda); + }else + if( 0==strcasecmp("step", ptok) ){ + step_lambda = (!step_lambda); + if( step_lambda ) step_thru = 0; + }else + if( 0==strcasecmp("thru", ptok) ){ + step_thru = (!step_thru); + if( step_thru ) step_lambda = 0; + }else + if( 0==strcasecmp("sym", ptok) ){ + print_symbols = (!print_symbols); + }else + if( 0==strcasecmp("app", ptok) ){ + applicative_order = (!applicative_order); + }else + if( 0==strcasecmp("body", ptok) ){ + reduce_body = (!reduce_body); + }else + if( 0==strcasecmp("brief", ptok) ){ + brief_print = (!brief_print); + }else + if( 0==strcasecmp("eta", ptok) ){ + extract_eta = (!extract_eta); + }else + if( 0==strcasecmp("xapp", ptok) ){ + extract_app = (!extract_app); + }else + if( 0==strcasecmp("full", ptok) ){ + reduce_fully = (!reduce_fully); + }else{ + do_list = 1; + } + }else do_list =1; + cnt = 1; + } + if( do_list || !cnt ){ + printf(">trace = %d\n",trace_lambda); + printf(">step = %d\n",step_lambda); + printf(">thru = %d\n",step_thru); + printf(">app = %d\n",applicative_order); + printf(">body = %d\n",reduce_body); + printf(">brief = %d\n",brief_print); + printf(">sym = %d\n",print_symbols); + printf(">eta = %d\n",extract_eta); + printf(">xapp = %d\n",extract_app); + printf(">full = %d\n",reduce_fully); + } + } + break; + case token_stream::EXT: + { + int inp = 0; + if( extract_eta ) inp |= node::DO_EXTRACT_ETA; + if( extract_app ) inp |= node::DO_EXTRACT_APP; + exp_node* exp = extraction(penv,inp); + arglst_node* env = 0; + if( penv ) env = *penv; + if( exp ) + { + int inp = 0; + if( brief_print ) + inp |= node::DO_PRINT_BRIEF; + exp->print(env,inp); + printf("\n"); + delete exp; + } + } + break; + default: + break; + } + }else{ + tokstr_v->push_token(tok,ptok ); + exp = application(); + } + if( tokstr_v ) tokstr_v->reset_token(); + node::reset(); + + return exp; + } + + exp_node* lambda_expression_parser:: + application() + { + exp_node* exp = 0; + if( !tokstr_v ) return exp; + token_stream::token_type tok; + char* ptok; + exp_node* left = 0; + exp_node* right = 0; + + tok = tokstr_v->get_token(&ptok); + switch( tok ){ + case token_stream::LAMBDA: + tokstr_v->push_token(tok,ptok ); + exp = lambda(); + break; + case token_stream::NAME: + case token_stream::LPAREN: + tokstr_v->push_token(tok,ptok ); + left = alist(); + right = lambda(); + if( !right ){ + exp = left; + }else{ + exp = (exp_node*)new app_node(left,right,True); + } + case token_stream::EOE: + break; + default: + dderrmsg("expresion expected: got %s", ptok?ptok:"(*null*)" ); + //tokstr_v->push_token(tok,ptok ); + } + + return exp; + } + + exp_node* lambda_expression_parser:: + lambda() + { + exp_node* exp = 0; + if( !tokstr_v ) return exp; + token_stream::token_type tok; + char* ptok; + arg_node* arg = 0; + exp_node* body = 0; + + tok = tokstr_v->get_token(&ptok); + if( token_stream::LAMBDA!=tok ){ + //dderrmsg("^ expected: got %s", ptok?ptok:"(*null*)" ); + if( token_stream::EOE!=tok ) + tokstr_v->push_token(tok,ptok ); + return exp; + } + + tok = tokstr_v->get_token(&ptok); + if( token_stream::NAME!=tok ){ + dderrmsg("NAME expected: got %s", ptok?ptok:"(*null*)" ); + //tokstr_v->push_token(tok,ptok ); + return exp; + } + arg = new arg_node(ptok,0); + + tok = tokstr_v->get_token(&ptok); + if( token_stream::PERIOD!=tok ){ + dderrmsg("PERIOD expected: got %s", ptok?ptok:"(*null*)" ); + //tokstr_v->push_token(tok,ptok ); + return exp; + } + + body = application(); //expression(); + if( !body ) { + delete arg; + }else{ + exp = new lam_node(arg,body,True); + } + + return exp; + } + + exp_node* lambda_expression_parser:: + alist() + { + exp_node* exp = 0; + if( !tokstr_v ) return exp; + token_stream::token_type tok; + char* ptok; + + for( tok = tokstr_v->get_token(&ptok); + token_stream::NAME==tok || + token_stream::LPAREN==tok; + tok = tokstr_v->get_token(&ptok) ) + { + tokstr_v->push_token(tok,ptok); + exp_node* anode = atom(); + if( anode ){ + if( exp ) + { + exp = (exp_node*) + new app_node( exp, anode, True); + }else exp = anode; + } + } + tokstr_v->push_token(tok,ptok ); + + return exp; + } + + exp_node* lambda_expression_parser:: + atom() + { + exp_node* exp = 0; + if( !tokstr_v ) return exp; + token_stream::token_type tok; + char* ptok; + + tok = tokstr_v->get_token(&ptok); + switch(tok) + { + case token_stream::LPAREN: + exp = application();//expression(); + tok = tokstr_v->get_token(&ptok); + if( token_stream::RPAREN!=tok ){ + dderrmsg(") expected: got %s", ptok?ptok:"(*null*)" ); + //if( token_stream::EOE!=tok ) + // tokstr_v->push_token(tok,ptok ); + } + break; + case token_stream::NAME: + exp = (exp_node*)new var_node(ptok); + break; + default: + tokstr_v->push_token(tok,ptok ); + } + + return exp; + } + + ///////////////////////////////////////////////////////////////////// + arglst_node* lambda_expression_parser:: + definition(arglst_node** penv) + { + arglst_node* arglst = 0; + if( !tokstr_v ) return arglst; + token_stream::token_type tok; + char* ptok; + tok = tokstr_v->get_token(&ptok); + if( token_stream::NAME==tok ){ + arg_node* arg= new arg_node(ptok, 0); + exp_node* exp= expression(); + if( penv ){ + #define APPEND_DEFS + #undef APPEND_DEFS + #ifdef APPEND_DEFS + if( arg ) arg->import_value(&exp); + if( *penv ){ + arglst = (arglst_node*)((*penv)->add(arg,True)); + *penv = arglst; + } + else{ + arglst = new arglst_node(arg,0,True); + *penv = arglst; + } + #else + if( *penv ){ + arg_node* old = (*penv)->find(arg); + if( old ){ + old->import_value(&exp); + if( arg ) delete arg;// arg not used! + }else{ + if( arg ) arg->import_value(&exp); + arglst = new arglst_node(arg,*penv,True); + *penv = arglst; + definition_env = arglst; + } + }else{ + if( arg ) arg->import_value(&exp); + arglst = new arglst_node(arg,0,True); + *penv = arglst; + definition_env = arglst; + } + #endif + } + } + return arglst; + } + + arglst_node* lambda_expression_parser:: + load(arglst_node** penv) + { + arglst_node* arglst = 0; + if( !tokstr_v ) return arglst; + token_stream::token_type tok; + char* ptok; + tok = tokstr_v->get_token(&ptok); + if( token_stream::STRING==tok ){ + char* tk = strtok( ptok, "\"" ); + if( tk ) ptok = tk; + tok = token_stream::NAME; + } + if( token_stream::NAME==tok ){ + token_stream* loadstr = new token_stream(ptok); + if( loadstr ){ + lambda_expression_parser parse(loadstr); + while( !loadstr->get_read_EOF() + && !loadstr->get_read_error() ) + parse.expression(penv); + delete loadstr; + } + } + return arglst; + } + + exp_node* lambda_expression_parser:: + extraction(arglst_node** penv,int inp) + { + exp_node* exp = 0; + if( !tokstr_v ) return exp; + token_stream::token_type tok; + char* ptok; + tok = tokstr_v->get_token(&ptok); + if( token_stream::NAME==tok + || token_stream::LAMBDA==tok ) + { + char* nm = 0; + if( token_stream::NAME==tok + && 0 != strcmp(ptok, "~" ) ) + { + nm = new char[strlen(ptok)+1]; + strcpy(nm,ptok); + } + exp_node* exp1 = expression(); + if( exp1 ) + { + exp = exp1->extract(nm,inp); + delete exp1; + } + if( nm ) delete nm; + } + return exp; + } + + ///////////////////////////////////////////////////////////////////// + void lambda_expression_parser:: + set_tok_str(token_stream* tokstr) + { + tokstr_v = tokstr; + } + + void lambda_expression_parser:: + reset() + { + paren_nest_level_v = 0; + } + + void lambda_expression_parser:: + dderrmsg(char* format,...) + { + va_list args; + + va_start(args, format); + //format = va_arg(args,char*); + #if defined _WINDOWS + char msg[512]; + sprintf(msg, "***line %d:\n", linenum); + vsprintf(msg+strlen(msg), format, args ); + AfxMessageBox(msg); + #else + if(tokstr_v->get_linenum()>=0) + printf("\n*** line %d: ", + tokstr_v->get_linenum()); + vfprintf(stdout,format,args); + printf("\n"); + #endif + va_end(args); + fflush(stderr); + } Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/parse.h diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/parse.h:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/parse.h Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,56 ---- + /* parse.h */ + /* + Copyright (C) 2003 Unique Software Designs + + This file is part of the program "lambda". + + The program "lambda" is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + The program "lambda" is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with "lambda"; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + A copy of the GNU General Public License may also be found at: + http://www.gnu.org/copyleft/gpl.html + */ + + extern int trace_lambda; + extern int step_lambda; + extern int print_symbols; + extern int applicative_order; + extern int reduce_body; + extern int brief_print; + extern int step_thru; + extern int reduce_fully; + + class lambda_expression_parser + { + public: + lambda_expression_parser(token_stream* tokstr=0); + ~lambda_expression_parser(); + exp_node* expression(arglst_node** penv=0); + exp_node* application(); + exp_node* lambda(); + exp_node* alist(); + exp_node* atom(); + public: + arglst_node* definition(arglst_node** penv); + arglst_node* load(arglst_node** penv); + public: + exp_node* extraction(arglst_node** penv,int inp=0); + public: + void set_tok_str(token_stream* tokstr); + void reset(); + void dderrmsg(char* format,...); + private: + token_stream* tokstr_v; + int paren_nest_level_v; + }; Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/token_stream.cc diff -c /dev/null llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/token_stream.cc:1.1 *** /dev/null Mon Dec 29 11:37:46 2003 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/token_stream.cc Mon Dec 29 11:37:35 2003 *************** *** 0 **** --- 1,331 ---- + /* token_stream.cc */ + /* + Copyright (C) 2003 Unique Software Designs + + This file is part of the program "lambda". + + The program "lambda" is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + The program "lambda" is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with "lambda"; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + A copy of the GNU General Public License may also be found at: + http://www.gnu.org/copyleft/gpl.html + */ + #if HAVE_CONFIG_H + # include "config.h" + #endif + #include + #include + #include + #include + #include + #include "token_stream.h" + + static struct header_def{ + token_stream::header_type type; + char* value; + } headers[] = { + {token_stream::DEF, "def"}, + {token_stream::LOAD, "load"}, + {token_stream::SAVE, "save"}, + {token_stream::QUIT, "quit"}, + {token_stream::LIST, "list"}, + {token_stream::SET, "set"}, + {token_stream::EXT, "ext"}, + {token_stream::NOTHDR, NULL} }; + + token_stream:: + token_stream(const char* filename) + { + in = 0; + file_name_v = 0; + paren_level_v = 0; + linenum_v = 0; + need_new_line_v = 0; + open(filename); + } + + Boolean token_stream:: + open(const char* filename) + { + read_error = False; + if( filename ){ + if( in ) fclose(in); + in = fopen(filename,"r" ); + if( !in ){ + read_error = True; + dderrmsg("Cannot Open \"%s\":%s\n", + filename, strerror(errno)); + } + file_name_v = new char[strlen(filename)+1]; + if( file_name_v ) strcpy(file_name_v,filename); + }else{ + in = stdin; + file_name_v = 0; + } + read_EOF = False; + push_token(NOTOKEN,""); + ptok = 0; + linenum_v = 0; + paren_level_v = 0; + need_new_line_v = 1; + return (in!=0); + } + + token_stream:: + ~token_stream() + { + if( in ) fclose(in); + if( file_name_v ) delete [] file_name_v; + } + + void token_stream:: + reset_token() + { + paren_level_v = 0; + #if 1 + pushed_token = NOTOKEN; + need_new_line_v = 1; + ptok = linebuf; + *ptok = '\0'; + #endif + } + + void token_stream:: + close() + { + if( in && file_name_v) fclose(in); + in = 0; + } + + void token_stream:: + dderrmsg(char* format,...) + { + va_list args; + + va_start(args, format); + //format = va_arg(args,char*); + #if defined _WINDOWS + char msg[512]; + sprintf(msg, "***line %d:\n", linenum_v); + vsprintf(msg+strlen(msg), format, args ); + AfxMessageBox(msg); + #else + if(linenum_v>=0) + fprintf(stderr,"\n*** line %d: ",linenum_v); + vfprintf(stderr,format,args); + #endif + va_end(args); + fflush(stderr); + } + + char *token_stream:: + read_line() + { + //#define READ_BUF_SIZE 512 + //static char linebuf[READ_BUF_SIZE]; + int n; + + char *res = fgets(linebuf,READ_BUF_SIZE,in); + if( res != NULL ){ + linenum_v++; + n = strlen(linebuf); + if( n>0 ){ + n -= 1; + if( linebuf[n]=='\n' ) linebuf[n] = '\0'; + } + } else { + if( ferror(in) ){ + n = errno; + printf( + "*error reading line %d of DataDesc input file: %s\n", + linenum_v,strerror(errno) ); + read_error = True; + }else if( feof(in) ){ + read_EOF = True; + } + } + need_new_line_v = 0; + return res; + } + + token_stream::header_type token_stream:: + is_header(token_type tok, char *ptk ) + { + header_def* phdr; + header_type res = NOTHDR; + + if( NAME==tok ){ + for(phdr = headers; phdr->type!=NOTHDR; phdr++ ){ + if( strcmp(ptk,phdr->value)==0 ){ + res = phdr->type; + break; + } + } + } + return res; + } + + void token_stream:: + push_token(token_type tok, char *ptk ) + { + pushed_token = tok; + if( ptk!=NULL && token!=ptk ) strncpy(token,ptk,MAX_TOKEN_SIZE-1); + token[MAX_TOKEN_SIZE-1] = '\0'; + } + + token_stream::token_type token_stream:: + get_token(char **atok) + { + char *ttok; + token_stream::token_type res; + register char chr; + Boolean found; + + if( !in ) return NOTOKEN; + if( pushed_token!=NOTOKEN ){ + *atok = token; + res = pushed_token; + pushed_token = NOTOKEN; + return res; + } + res = NOTOKEN; + *atok = NULL; + found = False; + while( !found ){ + if( NULL==ptok || '\0'==ptok[0] ){ + if( 0==paren_level_v && !need_new_line_v ) { + need_new_line_v = 1; + token[0] = '\0'; + res = EOE; + break; + } + if( paren_level_v > 0 ) + printf("*need %d )%s*<< ", paren_level_v, + paren_level_v > 1 ? "'s" : "" ); + ptok = read_line(); + } + if( NULL==ptok ) break; + + found = True; + while( (chr=ptok[0])!='\0' && chr<=' ' ) ptok++; + + token[0] = ptok[0]; + token[1] = '\0'; + switch( ptok[0] ){ + case '\0': + case '#': + found = False; + ptok = NULL; + break; + case '^': + res = LAMBDA; + ptok++; + break; + case '.': + res = PERIOD; + ptok++; + break; + case '(': + res = LPAREN; + paren_level_v++; + ptok++; + break; + case ')': + res = RPAREN; + paren_level_v--; + ptok++; + break; + case '{': + res = LBRACE; + ptok++; + break; + case '}': + res = RBRACE; + ptok++; + break; + case ',': + res = COMMA; + ptok++; + break; + case ';': + res = SEMICOLON; + ptok++; + break; + case '"': + res = STRING; + for( ttok=token,ptok++; + ttok Changes in directory llvm/test/Programs/MultiSource/Applications: Makefile updated: 1.2 -> 1.3 --- Log message: Added lambda to the list of tests to run. --- Diffs of the changes: (+1 -1) Index: llvm/test/Programs/MultiSource/Applications/Makefile diff -u llvm/test/Programs/MultiSource/Applications/Makefile:1.2 llvm/test/Programs/MultiSource/Applications/Makefile:1.3 --- llvm/test/Programs/MultiSource/Applications/Makefile:1.2 Tue Dec 2 11:10:46 2003 +++ llvm/test/Programs/MultiSource/Applications/Makefile Mon Dec 29 11:40:20 2003 @@ -2,6 +2,6 @@ LEVEL = ../../../.. -PARALLEL_DIRS := Burg aha sgefa siod +PARALLEL_DIRS := Burg aha sgefa siod lambda-0.1.3 include $(LEVEL)/test/Programs/Makefile.programs From lattner at cs.uiuc.edu Mon Dec 29 15:36:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Dec 29 15:36:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Message-ID: <200312292135.PAA22593@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: ReaderWrappers.cpp updated: 1.19 -> 1.20 --- Log message: Factor FDHandle out of the bytecode reader into the FileUtilities.h support routines. --- Diffs of the changes: (+4 -16) Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.19 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.20 --- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.19 Thu Dec 11 18:47:44 2003 +++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Mon Dec 29 15:35:05 2003 @@ -16,12 +16,13 @@ #include "ReaderInternals.h" #include "llvm/Module.h" #include "llvm/Instructions.h" +#include "Support/FileUtilities.h" #include "Support/StringExtras.h" #include "Config/fcntl.h" -#include -#include #include "Config/unistd.h" #include "Config/sys/mman.h" +#include +#include using namespace llvm; //===----------------------------------------------------------------------===// @@ -29,19 +30,6 @@ // namespace { - /// FDHandle - Simple handle class to make sure a file descriptor gets closed - /// when the object is destroyed. - /// - class FDHandle { - int FD; - public: - FDHandle(int fd) : FD(fd) {} - operator int() const { return FD; } - ~FDHandle() { - if (FD != -1) close(FD); - } - }; - /// BytecodeFileReader - parses a bytecode file from a file /// class BytecodeFileReader : public BytecodeParser { @@ -63,7 +51,7 @@ } BytecodeFileReader::BytecodeFileReader(const std::string &Filename) { - FDHandle FD = open(Filename.c_str(), O_RDONLY); + FDHandle FD(open(Filename.c_str(), O_RDONLY)); if (FD == -1) throw ErrnoMessage(errno, "open '" + Filename + "'"); From lattner at cs.uiuc.edu Mon Dec 29 15:36:06 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Dec 29 15:36:06 2003 Subject: [llvm-commits] CVS: llvm/include/Support/FileUtilities.h Message-ID: <200312292135.PAA22587@zion.cs.uiuc.edu> Changes in directory llvm/include/Support: FileUtilities.h updated: 1.9 -> 1.10 --- Log message: Factor FDHandle out of the bytecode reader into the FileUtilities.h support routines. --- Diffs of the changes: (+21 -0) Index: llvm/include/Support/FileUtilities.h diff -u llvm/include/Support/FileUtilities.h:1.9 llvm/include/Support/FileUtilities.h:1.10 --- llvm/include/Support/FileUtilities.h:1.9 Sun Nov 23 23:28:39 2003 +++ llvm/include/Support/FileUtilities.h Mon Dec 29 15:35:04 2003 @@ -102,6 +102,27 @@ /// bool MakeFileReadable (const std::string & Filename); + +/// FDHandle - Simple handle class to make sure a file descriptor gets closed +/// when the object is destroyed. +/// +class FDHandle { + int FD; + FDHandle(const FDHandle &); // DO NOT IMPLEMENT + void operator=(const FDHandle&); // DO NOT IMPLEMENT +public: + FDHandle() : FD(-1) {} + FDHandle(int fd) : FD(fd) {} + ~FDHandle(); + + operator int() const { return FD; } + + FDHandle &operator=(int fd); + + /// take - Take ownership of the file descriptor away from the FDHandle + /// object, so that the file is not closed when the FDHandle is destroyed. + int take(); +}; } // End llvm namespace #endif From lattner at cs.uiuc.edu Mon Dec 29 15:36:11 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Dec 29 15:36:11 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp Message-ID: <200312292135.PAA22588@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FileUtilities.cpp updated: 1.14 -> 1.15 --- Log message: Factor FDHandle out of the bytecode reader into the FileUtilities.h support routines. --- Diffs of the changes: (+23 -0) Index: llvm/lib/Support/FileUtilities.cpp diff -u llvm/lib/Support/FileUtilities.cpp:1.14 llvm/lib/Support/FileUtilities.cpp:1.15 --- llvm/lib/Support/FileUtilities.cpp:1.14 Sun Dec 14 15:35:53 2003 +++ llvm/lib/Support/FileUtilities.cpp Mon Dec 29 15:35:05 2003 @@ -194,3 +194,26 @@ bool llvm::MakeFileReadable(const std::string &Filename) { return AddPermissionsBits(Filename, 0444); } + +//===----------------------------------------------------------------------===// +// FDHandle class implementation +// + +FDHandle::~FDHandle() { + if (FD != -1) close(FD); +} + +FDHandle &FDHandle::operator=(int fd) { + if (FD != -1) close(FD); + FD = fd; + return *this; +} + + +/// take - Take ownership of the file descriptor away from the FDHandle +/// object, so that the file is not closed when the FDHandle is destroyed. +int FDHandle::take() { + int Ret = FD; + FD = -1; + return Ret; +} From lattner at cs.uiuc.edu Mon Dec 29 15:45:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Dec 29 15:45:01 2003 Subject: [llvm-commits] CVS: llvm/include/Support/FileUtilities.h Message-ID: <200312292144.PAA22647@zion.cs.uiuc.edu> Changes in directory llvm/include/Support: FileUtilities.h updated: 1.10 -> 1.11 --- Log message: Add trivial exception specs to produce better code since the methods cannot be inlined. --- Diffs of the changes: (+3 -3) Index: llvm/include/Support/FileUtilities.h diff -u llvm/include/Support/FileUtilities.h:1.10 llvm/include/Support/FileUtilities.h:1.11 --- llvm/include/Support/FileUtilities.h:1.10 Mon Dec 29 15:35:04 2003 +++ llvm/include/Support/FileUtilities.h Mon Dec 29 15:43:58 2003 @@ -113,15 +113,15 @@ public: FDHandle() : FD(-1) {} FDHandle(int fd) : FD(fd) {} - ~FDHandle(); + ~FDHandle() throw(); operator int() const { return FD; } - FDHandle &operator=(int fd); + FDHandle &operator=(int fd) throw(); /// take - Take ownership of the file descriptor away from the FDHandle /// object, so that the file is not closed when the FDHandle is destroyed. - int take(); + int take() throw(); }; } // End llvm namespace From lattner at cs.uiuc.edu Mon Dec 29 15:45:07 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Dec 29 15:45:07 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp Message-ID: <200312292144.PAA22652@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FileUtilities.cpp updated: 1.15 -> 1.16 --- Log message: Add trivial exception specs to produce better code since the methods cannot be inlined. --- Diffs of the changes: (+3 -3) Index: llvm/lib/Support/FileUtilities.cpp diff -u llvm/lib/Support/FileUtilities.cpp:1.15 llvm/lib/Support/FileUtilities.cpp:1.16 --- llvm/lib/Support/FileUtilities.cpp:1.15 Mon Dec 29 15:35:05 2003 +++ llvm/lib/Support/FileUtilities.cpp Mon Dec 29 15:43:58 2003 @@ -199,11 +199,11 @@ // FDHandle class implementation // -FDHandle::~FDHandle() { +FDHandle::~FDHandle() throw() { if (FD != -1) close(FD); } -FDHandle &FDHandle::operator=(int fd) { +FDHandle &FDHandle::operator=(int fd) throw() { if (FD != -1) close(FD); FD = fd; return *this; @@ -212,7 +212,7 @@ /// take - Take ownership of the file descriptor away from the FDHandle /// object, so that the file is not closed when the FDHandle is destroyed. -int FDHandle::take() { +int FDHandle::take() throw() { int Ret = FD; FD = -1; return Ret; From criswell at cs.uiuc.edu Mon Dec 29 16:03:02 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Mon Dec 29 16:03:02 2003 Subject: [llvm-commits] CVS: llvm/Makefile.rules Message-ID: <200312292202.QAA19352@choi.cs.uiuc.edu> Changes in directory llvm: Makefile.rules updated: 1.166 -> 1.167 --- Log message: Allow C++ programs to end in .cc. This allows C++ test programs in the test suite to compile. --- Diffs of the changes: (+2 -1) Index: llvm/Makefile.rules diff -u llvm/Makefile.rules:1.166 llvm/Makefile.rules:1.167 --- llvm/Makefile.rules:1.166 Thu Dec 18 14:57:48 2003 +++ llvm/Makefile.rules Mon Dec 29 16:02:12 2003 @@ -364,7 +364,8 @@ # ifndef Source Source := $(notdir $(ExtraSource) $(wildcard $(SourceDir)/*.cpp \ - $(SourceDir)/*.c $(SourceDir)/*.y $(SourceDir)/*.l)) + $(SourceDir)/*.cc $(SourceDir)/*.c $(SourceDir)/*.y \ + $(SourceDir)/*.l)) endif # From lattner at cs.uiuc.edu Mon Dec 29 20:45:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Dec 29 20:45:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/ModuleProvider.h Message-ID: <200312300244.UAA23240@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: ModuleProvider.h updated: 1.7 -> 1.8 --- Log message: Add a new class useful for providing fully materialized modules to ExecutionEngine's --- Diffs of the changes: (+12 -0) Index: llvm/include/llvm/ModuleProvider.h diff -u llvm/include/llvm/ModuleProvider.h:1.7 llvm/include/llvm/ModuleProvider.h:1.8 --- llvm/include/llvm/ModuleProvider.h:1.7 Tue Nov 11 16:41:30 2003 +++ llvm/include/llvm/ModuleProvider.h Mon Dec 29 20:44:04 2003 @@ -54,6 +54,18 @@ } }; + +/// ExistingModuleProvider - Allow conversion from a fully materialized Module +/// into a ModuleProvider, allowing code that expects a ModuleProvider to work +/// if we just have a Module. Note that the ModuleProvider takes ownership of +/// the Module specified. +struct ExistingModuleProvider : public ModuleProvider { + ExistingModuleProvider(Module *M) { + TheModule = M; + } + void materializeFunction(Function *F) {} +}; + } // End llvm namespace #endif From lattner at cs.uiuc.edu Mon Dec 29 20:46:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Dec 29 20:46:00 2003 Subject: [llvm-commits] CVS: llvm/include/Support/FileUtilities.h Message-ID: <200312300245.UAA23300@zion.cs.uiuc.edu> Changes in directory llvm/include/Support: FileUtilities.h updated: 1.11 -> 1.12 --- Log message: Further revisions of the FDHandle idea. In this version we use ownership semantics that are the same as those used by std::auto_ptr. This allows copying of FDHandle's, but copying transfers ownership. --- Diffs of the changes: (+22 -5) Index: llvm/include/Support/FileUtilities.h diff -u llvm/include/Support/FileUtilities.h:1.11 llvm/include/Support/FileUtilities.h:1.12 --- llvm/include/Support/FileUtilities.h:1.11 Mon Dec 29 15:43:58 2003 +++ llvm/include/Support/FileUtilities.h Mon Dec 29 20:45:16 2003 @@ -104,24 +104,41 @@ /// FDHandle - Simple handle class to make sure a file descriptor gets closed -/// when the object is destroyed. +/// when the object is destroyed. This handle acts similarly to an +/// std::auto_ptr, in that the copy constructor and assignment operators +/// transfer ownership of the handle. This means that FDHandle's do not have +/// value semantics. /// class FDHandle { int FD; - FDHandle(const FDHandle &); // DO NOT IMPLEMENT - void operator=(const FDHandle&); // DO NOT IMPLEMENT public: FDHandle() : FD(-1) {} FDHandle(int fd) : FD(fd) {} + FDHandle(FDHandle &RHS) : FD(RHS.FD) { + RHS.FD = -1; // Transfer ownership + } + ~FDHandle() throw(); + /// get - Get the current file descriptor, without releasing ownership of it. + int get() const { return FD; } operator int() const { return FD; } FDHandle &operator=(int fd) throw(); - /// take - Take ownership of the file descriptor away from the FDHandle + FDHandle &operator=(FDHandle &RHS) { + int fd = RHS.FD; + RHS.FD = -1; // Transfer ownership + return operator=(fd); + } + + /// release - Take ownership of the file descriptor away from the FDHandle /// object, so that the file is not closed when the FDHandle is destroyed. - int take() throw(); + int release() { + int Ret = FD; + FD = -1; + return Ret; + } }; } // End llvm namespace From lattner at cs.uiuc.edu Mon Dec 29 20:46:05 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Dec 29 20:46:05 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp Message-ID: <200312300245.UAA23303@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FileUtilities.cpp updated: 1.16 -> 1.17 --- Log message: Further revisions of the FDHandle idea. In this version we use ownership semantics that are the same as those used by std::auto_ptr. This allows copying of FDHandle's, but copying transfers ownership. --- Diffs of the changes: (+0 -8) Index: llvm/lib/Support/FileUtilities.cpp diff -u llvm/lib/Support/FileUtilities.cpp:1.16 llvm/lib/Support/FileUtilities.cpp:1.17 --- llvm/lib/Support/FileUtilities.cpp:1.16 Mon Dec 29 15:43:58 2003 +++ llvm/lib/Support/FileUtilities.cpp Mon Dec 29 20:45:16 2003 @@ -209,11 +209,3 @@ return *this; } - -/// take - Take ownership of the file descriptor away from the FDHandle -/// object, so that the file is not closed when the FDHandle is destroyed. -int FDHandle::take() throw() { - int Ret = FD; - FD = -1; - return Ret; -} From lattner at cs.uiuc.edu Mon Dec 29 21:25:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Mon Dec 29 21:25:01 2003 Subject: [llvm-commits] CVS: llvm/tools/gccas/gccas.cpp Message-ID: <200312300324.VAA23436@zion.cs.uiuc.edu> Changes in directory llvm/tools/gccas: gccas.cpp updated: 1.89 -> 1.90 --- Log message: Add a -disable-opt flag to gccas, so that we can use -Wa,-disable-opt just like -Wl,-disable-opt --- Diffs of the changes: (+7 -0) Index: llvm/tools/gccas/gccas.cpp diff -u llvm/tools/gccas/gccas.cpp:1.89 llvm/tools/gccas/gccas.cpp:1.90 --- llvm/tools/gccas/gccas.cpp:1.89 Thu Dec 11 11:50:32 2003 +++ llvm/tools/gccas/gccas.cpp Mon Dec 29 21:24:27 2003 @@ -42,6 +42,10 @@ cl::opt DisableInline("disable-inlining", cl::desc("Do not run the inliner pass")); + + cl::opt + DisableOptimizations("disable-opt", + cl::desc("Do not run any optimization passes")); } @@ -58,6 +62,9 @@ PM.add(createVerifierPass()); // Verify that input is correct addPass(PM, createLowerSetJmpPass()); // Lower llvm.setjmp/.longjmp addPass(PM, createFunctionResolvingPass()); // Resolve (...) functions + + if (DisableOptimizations) return; + addPass(PM, createCFGSimplificationPass()); // Clean up disgusting code addPass(PM, createRaiseAllocationsPass()); // call %malloc -> malloc inst addPass(PM, createGlobalDCEPass()); // Remove unused globals From lattner at cs.uiuc.edu Tue Dec 30 01:36:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Dec 30 01:36:01 2003 Subject: [llvm-commits] CVS: llvm/include/Support/FileUtilities.h Message-ID: <200312300735.BAA24647@zion.cs.uiuc.edu> Changes in directory llvm/include/Support: FileUtilities.h updated: 1.12 -> 1.13 --- Log message: Add new function --- Diffs of the changes: (+13 -28) Index: llvm/include/Support/FileUtilities.h diff -u llvm/include/Support/FileUtilities.h:1.12 llvm/include/Support/FileUtilities.h:1.13 --- llvm/include/Support/FileUtilities.h:1.12 Mon Dec 29 20:45:16 2003 +++ llvm/include/Support/FileUtilities.h Tue Dec 30 01:35:47 2003 @@ -70,37 +70,22 @@ /// std::string getUniqueFilename(const std::string &FilenameBase); +/// MakeFileExecutable - This method turns on whatever access attributes are +/// needed to make the specified file executable. It returns true on success. +/// In case of failure, the file's access attributes are unspecified. /// -/// Method: MakeFileExecutable() -/// -/// Description: -/// This method turns on whatever access attributes are needed to make the -/// specified file executable. -/// -/// Return value: -/// True - The operation succeeded. -/// False - The operation failed. -/// -/// Notes: -/// In case of failure, the file's access attributes are unspecified. -/// -bool MakeFileExecutable (const std::string & Filename); +bool MakeFileExecutable(const std::string &Filename); +/// MakeFileReadable - This method turns on whatever access attributes are +/// needed to make the specified file readable. It returns true on success. +/// In case of failure, the file's access attributes are unspecified. /// -/// Method: MakeFileReadable() -/// -/// Description: -/// This method turns on whatever access attributes are needed to make the -/// specified file readable. -/// -/// Return value: -/// True - The operation succeeded. -/// False - The operation failed. -/// -/// Notes: -/// In case of failure, the file's access attributes are unspecified. -/// -bool MakeFileReadable (const std::string & Filename); +bool MakeFileReadable(const std::string &Filename); + +/// getFileSize - Return the size of the specified file in bytes, or -1 if the +/// file cannot be read or does not exist. +long long getFileSize(const std::string &Filename); + /// FDHandle - Simple handle class to make sure a file descriptor gets closed From lattner at cs.uiuc.edu Tue Dec 30 01:37:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Dec 30 01:37:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp Message-ID: <200312300736.BAA24705@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FileUtilities.cpp updated: 1.17 -> 1.18 --- Log message: Add new method --- Diffs of the changes: (+10 -0) Index: llvm/lib/Support/FileUtilities.cpp diff -u llvm/lib/Support/FileUtilities.cpp:1.17 llvm/lib/Support/FileUtilities.cpp:1.18 --- llvm/lib/Support/FileUtilities.cpp:1.17 Mon Dec 29 20:45:16 2003 +++ llvm/lib/Support/FileUtilities.cpp Tue Dec 30 01:36:14 2003 @@ -195,6 +195,16 @@ return AddPermissionsBits(Filename, 0444); } +/// getFileSize - Return the size of the specified file in bytes, or -1 if the +/// file cannot be read or does not exist. +long long llvm::getFileSize(const std::string &Filename) { + struct stat StatBuf; + if (stat(Filename.c_str(), &StatBuf) == -1) + return -1; + return StatBuf.st_size; +} + + //===----------------------------------------------------------------------===// // FDHandle class implementation // From lattner at cs.uiuc.edu Tue Dec 30 01:41:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Dec 30 01:41:00 2003 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/ArchiveReader.cpp ReaderWrappers.cpp Message-ID: <200312300740.BAA24762@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: ArchiveReader.cpp updated: 1.13 -> 1.14 ReaderWrappers.cpp updated: 1.20 -> 1.21 --- Log message: Use new getFileSize function instead of sys/stat.h directly. --- Diffs of the changes: (+9 -14) Index: llvm/lib/Bytecode/Reader/ArchiveReader.cpp diff -u llvm/lib/Bytecode/Reader/ArchiveReader.cpp:1.13 llvm/lib/Bytecode/Reader/ArchiveReader.cpp:1.14 --- llvm/lib/Bytecode/Reader/ArchiveReader.cpp:1.13 Mon Dec 22 10:22:49 2003 +++ llvm/lib/Bytecode/Reader/ArchiveReader.cpp Tue Dec 30 01:40:35 2003 @@ -18,7 +18,7 @@ #include "llvm/Bytecode/Reader.h" #include "llvm/Module.h" -#include "Config/sys/stat.h" +#include "Support/FileUtilities.h" #include "Config/sys/mman.h" #include "Config/fcntl.h" #include @@ -164,17 +164,15 @@ // bool ReadArchiveFile(const std::string &Filename, std::vector &Objects, std::string *ErrorStr) { + int Length = getFileSize(Filename); + if (Length == -1) + return Error(ErrorStr, "Error getting file length!"); + int FD = open(Filename.c_str(), O_RDONLY); if (FD == -1) return Error(ErrorStr, "Error opening file!"); - // Stat the file to get its length... - struct stat StatBuf; - if (fstat(FD, &StatBuf) == -1 || StatBuf.st_size == 0) - return Error(ErrorStr, "Error stat'ing file!"); - // mmap in the file all at once... - int Length = StatBuf.st_size; unsigned char *Buffer = (unsigned char*)mmap(0, Length, PROT_READ, MAP_PRIVATE, FD, 0); if (Buffer == (unsigned char*)MAP_FAILED) Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.20 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.21 --- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.20 Mon Dec 29 15:35:05 2003 +++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Tue Dec 30 01:40:35 2003 @@ -21,7 +21,6 @@ #include "Config/fcntl.h" #include "Config/unistd.h" #include "Config/sys/mman.h" -#include #include using namespace llvm; @@ -51,17 +50,15 @@ } BytecodeFileReader::BytecodeFileReader(const std::string &Filename) { + Length = getFileSize(Filename); + if (Length == -1) + throw ErrnoMessage(errno, "stat '" + Filename + "'"); + FDHandle FD(open(Filename.c_str(), O_RDONLY)); if (FD == -1) throw ErrnoMessage(errno, "open '" + Filename + "'"); - // Stat the file to get its length... - struct stat StatBuf; - if (fstat(FD, &StatBuf) == -1 || StatBuf.st_size == 0) - throw ErrnoMessage(errno, "stat '" + Filename + "'"); - // mmap in the file all at once... - Length = StatBuf.st_size; Buffer = (unsigned char*)mmap(0, Length, PROT_READ, MAP_PRIVATE, FD, 0); if (Buffer == (unsigned char*)MAP_FAILED) From lattner at cs.uiuc.edu Tue Dec 30 01:46:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Dec 30 01:46:01 2003 Subject: [llvm-commits] CVS: llvm/tools/llvm-ar/llvm-ar.cpp Message-ID: <200312300745.BAA24803@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-ar: llvm-ar.cpp updated: 1.9 -> 1.10 --- Log message: Use new getFileSize function. Eliminate some using directives. Reorder #includes a bit --- Diffs of the changes: (+20 -27) Index: llvm/tools/llvm-ar/llvm-ar.cpp diff -u llvm/tools/llvm-ar/llvm-ar.cpp:1.9 llvm/tools/llvm-ar/llvm-ar.cpp:1.10 --- llvm/tools/llvm-ar/llvm-ar.cpp:1.9 Sat Dec 6 17:01:25 2003 +++ llvm/tools/llvm-ar/llvm-ar.cpp Tue Dec 30 01:45:46 2003 @@ -1,4 +1,4 @@ -//===-- tools/llvm-ar/llvm-ar.cpp - LLVM archive librarian utility --------===// +//===-- llvm-ar.cpp - LLVM archive librarian utility ----------------------===// // // The LLVM Compiler Infrastructure // @@ -11,25 +11,21 @@ // //===----------------------------------------------------------------------===// -#include "Support/CommandLine.h" -#include "llvm/Bytecode/Reader.h" #include "llvm/Module.h" +#include "llvm/Bytecode/Reader.h" +#include "Support/CommandLine.h" +#include "Support/FileUtilities.h" #include -#include #include -#include -#include #include +#include #include #include #include #include - using namespace llvm; using std::string; -using std::vector; -using std::cout; #define ARFMAG "\n" /* header trailer string */ @@ -96,7 +92,7 @@ string Archive; //Member Files -vector Members; +std::vector Members; // WriteSymbolTable - Writes symbol table to ArchiveFile, return false @@ -139,8 +135,8 @@ unsigned memoff = 0; //Keep Track of total size of files added to archive - vector offsets; //Vector of offsets into archive file - vector names; //Vector of characters that are the symbol names. + std::vector offsets; //Vector of offsets into archive file + std::vector names; //Vector of characters that are the symbol names. //Loop over archive member files, parse bytecode, and generate symbol table. for(unsigned i=0; i> 24) & 255; output[1] = (offsets[i] >> 16) & 255; output[2] = (offsets[i] >> 8) & 255; @@ -259,7 +252,7 @@ // bool AddMemberToArchive(string Member, std::ofstream &ArchiveFile) { - cout << "Member File Start: " << ArchiveFile.tellp() << "\n"; + std::cout << "Member File Start: " << ArchiveFile.tellp() << "\n"; ar_hdr Hdr; //Header for archive member file. @@ -286,7 +279,7 @@ //file member size in decimal unsigned Length = StatBuf.st_size; sprintf(Hdr.size,"%d", Length); - cout << "Size: " << Length << "\n"; + std::cout << "Size: " << Length << "\n"; //file member user id in decimal sprintf(Hdr.uid, "%d", StatBuf.st_uid); @@ -328,7 +321,7 @@ // Unmmap the memberfile munmap((char*)buf, Length); - cout << "Member File End: " << ArchiveFile.tellp() << "\n"; + std::cout << "Member File End: " << ArchiveFile.tellp() << "\n"; return true; } @@ -354,12 +347,12 @@ //If the '-s' option was specified, generate symbol table. if(SymTable) { - cout << "Symbol Table Start: " << ArchiveFile.tellp() << "\n"; + std::cout << "Symbol Table Start: " << ArchiveFile.tellp() << "\n"; if(!WriteSymbolTable(ArchiveFile)) { std::cerr << "Error creating symbol table. Exiting program."; exit(1); } - cout << "Symbol Table End: " << ArchiveFile.tellp() << "\n"; + std::cout << "Symbol Table End: " << ArchiveFile.tellp() << "\n"; } //Loop over all member files, and add to the archive. for(unsigned i=0; i < Members.size(); ++i) { @@ -409,7 +402,7 @@ //Print version void printVersion() { - cout << VERSION; + std::cout << VERSION; exit(0); } @@ -453,7 +446,7 @@ void getMembers() { std::cerr << RestofArgs.size() << "\n"; if(RestofArgs.size() > 0) - Members = vector(RestofArgs); + Members = std::vector(RestofArgs); } // Parse the operations and operation modifiers From lattner at cs.uiuc.edu Tue Dec 30 01:49:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Dec 30 01:49:01 2003 Subject: [llvm-commits] CVS: llvm/tools/llvm-link/llvm-link.cpp Message-ID: <200312300748.BAA24837@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-link: llvm-link.cpp updated: 1.33 -> 1.34 --- Log message: Use getFileSize() instead of sys/stat.h directly --- Diffs of the changes: (+2 -9) Index: llvm/tools/llvm-link/llvm-link.cpp diff -u llvm/tools/llvm-link/llvm-link.cpp:1.33 llvm/tools/llvm-link/llvm-link.cpp:1.34 --- llvm/tools/llvm-link/llvm-link.cpp:1.33 Tue Nov 11 16:41:34 2003 +++ llvm/tools/llvm-link/llvm-link.cpp Tue Dec 30 01:48:17 2003 @@ -18,11 +18,10 @@ #include "llvm/Bytecode/Writer.h" #include "llvm/Transforms/Utils/Linker.h" #include "Support/CommandLine.h" +#include "Support/FileUtilities.h" #include "Support/Signals.h" #include #include -#include // For FileExists -#include using namespace llvm; @@ -46,12 +45,6 @@ LibPaths("L", cl::desc("Specify a library search path"), cl::ZeroOrMore, cl::value_desc("directory"), cl::Prefix); -// FileExists - Return true if the specified string is an openable file... -static inline bool FileExists(const std::string &FN) { - struct stat StatBuf; - return stat(FN.c_str(), &StatBuf) != -1; -} - // LoadFile - Read the specified bytecode file in and return it. This routine // searches the link path for the specified file to try to find it... // @@ -64,7 +57,7 @@ while (1) { if (Verbose) std::cerr << "Loading '" << Filename << "'\n"; - if (FileExists(Filename)) FoundAFile = true; + if (getFileSize(Filename) != -1) FoundAFile = true; Module *Result = ParseBytecodeFile(Filename, &ErrorMessage); if (Result) return std::auto_ptr(Result); // Load successful! From lattner at cs.uiuc.edu Tue Dec 30 01:51:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Dec 30 01:51:00 2003 Subject: [llvm-commits] CVS: llvm/tools/llvm-prof/ProfileInfo.cpp Message-ID: <200312300750.BAA24892@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-prof: ProfileInfo.cpp updated: 1.5 -> 1.6 --- Log message: Remove some pointless #includes --- Diffs of the changes: (+1 -6) Index: llvm/tools/llvm-prof/ProfileInfo.cpp diff -u llvm/tools/llvm-prof/ProfileInfo.cpp:1.5 llvm/tools/llvm-prof/ProfileInfo.cpp:1.6 --- llvm/tools/llvm-prof/ProfileInfo.cpp:1.5 Tue Nov 11 16:41:34 2003 +++ llvm/tools/llvm-prof/ProfileInfo.cpp Tue Dec 30 01:50:31 2003 @@ -14,12 +14,7 @@ #include "ProfileInfo.h" #include "llvm/Module.h" -#include -#include -#include -#include -#include - +#include using namespace llvm; enum ProfilingType { From lattner at cs.uiuc.edu Tue Dec 30 01:56:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Dec 30 01:56:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp Message-ID: <200312300755.BAA24955@zion.cs.uiuc.edu> Changes in directory llvm/lib/Bytecode/Reader: Reader.cpp updated: 1.91 -> 1.92 --- Log message: remove some useless #includes --- Diffs of the changes: (+0 -9) Index: llvm/lib/Bytecode/Reader/Reader.cpp diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.91 llvm/lib/Bytecode/Reader/Reader.cpp:1.92 --- llvm/lib/Bytecode/Reader/Reader.cpp:1.91 Mon Dec 1 01:05:30 2003 +++ llvm/lib/Bytecode/Reader/Reader.cpp Tue Dec 30 01:55:21 2003 @@ -19,17 +19,8 @@ #include "ReaderInternals.h" #include "llvm/Bytecode/Reader.h" #include "llvm/Bytecode/Format.h" -#include "llvm/Constants.h" -#include "llvm/iPHINode.h" -#include "llvm/iOther.h" #include "llvm/Module.h" #include "Support/StringExtras.h" -#include "Config/unistd.h" -#include "Config/sys/mman.h" -#include "Config/sys/stat.h" -#include "Config/sys/types.h" -#include -#include using namespace llvm; static inline void ALIGN32(const unsigned char *&begin, From criswell at cs.uiuc.edu Tue Dec 30 11:52:02 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Dec 30 11:52:02 2003 Subject: [llvm-commits] CVS: llvm/autoconf/acinclude.m4 aclocal.m4 Message-ID: <200312301751.LAA09466@choi.cs.uiuc.edu> Changes in directory llvm/autoconf: acinclude.m4 added (r1.1) aclocal.m4 (r1.10) removed --- Log message: Moved aclocal.m4 to acinclude.m4. To re-generate the configure script, do the following: % cd llvm/autoconf % aclocal % autoconf -o ../configure This changes facilitaties the following: 1) It should be easier to incorporate new autoconf macros. 2) It allows for conversion to Automake (should we ever desire it). --- Diffs of the changes: (+6263 -0) Index: llvm/autoconf/acinclude.m4 diff -c /dev/null llvm/autoconf/acinclude.m4:1.1 *** /dev/null Tue Dec 30 11:51:05 2003 --- llvm/autoconf/acinclude.m4 Tue Dec 30 11:50:54 2003 *************** *** 0 **** --- 1,6263 ---- + # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- + ## Copyright 1996, 1997, 1998, 1999, 2000, 2001 + ## Free Software Foundation, Inc. + ## Originally by Gordon Matzigkeit , 1996 + ## + ## This program is free software; you can redistribute it and/or modify + ## it under the terms of the GNU General Public License as published by + ## the Free Software Foundation; either version 2 of the License, or + ## (at your option) any later version. + ## + ## This program is distributed in the hope that it will be useful, but + ## WITHOUT ANY WARRANTY; without even the implied warranty of + ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + ## General Public License for more details. + ## + ## You should have received a copy of the GNU General Public License + ## along with this program; if not, write to the Free Software + ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + ## + ## As a special exception to the GNU General Public License, if you + ## distribute this file as part of a program that contains a + ## configuration script generated by Autoconf, you may include it under + ## the same distribution terms that you use for the rest of that program. + + # serial 47 AC_PROG_LIBTOOL + + + # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) + # ----------------------------------------------------------- + # If this macro is not defined by Autoconf, define it here. + m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + + # AC_PROG_LIBTOOL + # --------------- + AC_DEFUN([AC_PROG_LIBTOOL], + [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl + dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX + dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) + dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 + ])]) + + dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. + dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run + dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) + ])])# AC_PROG_LIBTOOL + + + # _AC_PROG_LIBTOOL + # ---------------- + AC_DEFUN([_AC_PROG_LIBTOOL], + [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl + AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl + AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl + AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl + + # This can be used to rebuild libtool when needed + LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + + # Always use our own libtool. + LIBTOOL='$(SHELL) $(top_builddir)/mklib' + AC_SUBST(LIBTOOL)dnl + + # Prevent multiple expansion + define([AC_PROG_LIBTOOL], []) + ])# _AC_PROG_LIBTOOL + + + # AC_LIBTOOL_SETUP + # ---------------- + AC_DEFUN([AC_LIBTOOL_SETUP], + [AC_PREREQ(2.50)dnl + AC_REQUIRE([AC_ENABLE_SHARED])dnl + AC_REQUIRE([AC_ENABLE_STATIC])dnl + AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl + AC_REQUIRE([AC_CANONICAL_BUILD])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_PROG_LD])dnl + AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl + AC_REQUIRE([AC_PROG_NM])dnl + + AC_REQUIRE([AC_PROG_LN_S])dnl + AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl + # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! + AC_REQUIRE([AC_OBJEXT])dnl + AC_REQUIRE([AC_EXEEXT])dnl + dnl + + AC_LIBTOOL_SYS_MAX_CMD_LEN + AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + AC_LIBTOOL_OBJDIR + + AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + _LT_AC_PROG_ECHO_BACKSLASH + + case $host_os in + aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; + esac + + # Sed substitution that helps us do robust quoting. It backslashifies + # metacharacters that are still active within double-quoted strings. + Xsed='sed -e s/^X//' + [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + + # Same as above, but do not quote variable references. + [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + + # Sed substitution to delay expansion of an escaped shell variable in a + # double_quote_subst'ed string. + delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + + # Sed substitution to avoid accidental globbing in evaled expressions + no_glob_subst='s/\*/\\\*/g' + + # Constants: + rm="rm -f" + + # Global variables: + default_ofile=mklib + can_build_shared=yes + + # All known linkers require a `.a' archive for static linking (except M$VC, + # which needs '.lib'). + libext=a + ltmain="$ac_aux_dir/ltmain.sh" + ofile="$default_ofile" + with_gnu_ld="$lt_cv_prog_gnu_ld" + + AC_CHECK_TOOL(AR, ar, false) + AC_CHECK_TOOL(RANLIB, ranlib, :) + AC_CHECK_TOOL(STRIP, strip, :) + + old_CC="$CC" + old_CFLAGS="$CFLAGS" + + # Set sane defaults for various variables + test -z "$AR" && AR=ar + test -z "$AR_FLAGS" && AR_FLAGS=cru + test -z "$AS" && AS=as + test -z "$CC" && CC=cc + test -z "$LTCC" && LTCC=$CC + test -z "$DLLTOOL" && DLLTOOL=dlltool + test -z "$LD" && LD=ld + test -z "$LN_S" && LN_S="ln -s" + test -z "$MAGIC_CMD" && MAGIC_CMD=file + test -z "$NM" && NM=nm + test -z "$SED" && SED=sed + test -z "$OBJDUMP" && OBJDUMP=objdump + test -z "$RANLIB" && RANLIB=: + test -z "$STRIP" && STRIP=: + test -z "$ac_objext" && ac_objext=o + + # Determine commands to create old-style static archives. + old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' + old_postinstall_cmds='chmod 644 $oldlib' + old_postuninstall_cmds= + + if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" + ;; + *) + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + fi + + # Only perform the check for file, if the check method requires it + case $deplibs_check_method in + file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; + esac + + AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) + AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], + enable_win32_dll=yes, enable_win32_dll=no) + + AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) + test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + + AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) + test -z "$pic_mode" && pic_mode=default + + # Use C for the default configuration in the libtool script + tagname= + AC_LIBTOOL_LANG_C_CONFIG + _LT_AC_TAGCONFIG + ])# AC_LIBTOOL_SETUP + + + # _LT_AC_SYS_COMPILER + # ------------------- + AC_DEFUN([_LT_AC_SYS_COMPILER], + [AC_REQUIRE([AC_PROG_CC])dnl + + # If no C compiler was specified, use CC. + LTCC=${LTCC-"$CC"} + + # Allow CC to be a program name with arguments. + compiler=$CC + ])# _LT_AC_SYS_COMPILER + + + # _LT_AC_SYS_LIBPATH_AIX + # ---------------------- + # Links a minimal program and checks the executable + # for the system default hardcoded library path. In most cases, + # this is /usr/lib:/lib, but when the MPI compilers are used + # the location of the communication and MPI libs are included too. + # If we don't find anything, use the default library path according + # to the aix ld manual. + AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], + [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ + aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } + }'` + # Check for a 64-bit object if we didn't find anything. + if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } + }'`; fi],[]) + if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + ])# _LT_AC_SYS_LIBPATH_AIX + + + # _LT_AC_SHELL_INIT(ARG) + # ---------------------- + AC_DEFUN([_LT_AC_SHELL_INIT], + [ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) + $1 + AC_DIVERT_POP + ])# _LT_AC_SHELL_INIT + + + # _LT_AC_PROG_ECHO_BACKSLASH + # -------------------------- + # Add some code to the start of the generated configure script which + # will find an echo command which doesn't interpret backslashes. + AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], + [_LT_AC_SHELL_INIT([ + # Check that we are running under the correct shell. + SHELL=${CONFIG_SHELL-/bin/sh} + + case X$ECHO in + X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; + esac + + echo=${ECHO-echo} + if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : + elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : + else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} + fi + + if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done + fi + + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi + fi + fi + + # Copy echo and quote the copy suitably for passing to libtool from + # the Makefile, instead of quoting the original, which is used later. + ECHO=$echo + if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" + fi + + AC_SUBST(ECHO) + ])])# _LT_AC_PROG_ECHO_BACKSLASH + + + # _LT_AC_LOCK + # ----------- + AC_DEFUN([_LT_AC_LOCK], + [AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) + test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + + # Some flags need to be propagated to the compiler or linker for good + # libtool support. + case $host in + ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; + *-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + + x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + + *-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; + AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], + [*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) + esac + + need_locks="$enable_libtool_lock" + + ])# _LT_AC_LOCK + + + # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, + # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) + # ---------------------------------------------------------------- + # Check whether the given compiler option works + AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], + [AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s conftest.err; then + $2=yes + fi + fi + $rm conftest* + ]) + + if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) + else + ifelse([$6], , :, [$6]) + fi + ])# AC_LIBTOOL_COMPILER_OPTION + + + # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, + # [ACTION-SUCCESS], [ACTION-FAILURE]) + # ------------------------------------------------------------ + # Check whether the given compiler option works + AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], + [AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + ]) + + if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) + else + ifelse([$5], , :, [$5]) + fi + ])# AC_LIBTOOL_LINKER_OPTION + + + # AC_LIBTOOL_SYS_MAX_CMD_LEN + # -------------------------- + AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], + [# find the maximum length of command line arguments + AC_MSG_CHECKING([the maximum length of command line arguments]) + AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + testring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \ + = "XX$testring") >/dev/null 2>&1 && + new_result=`expr "X$testring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + testring=$testring$testring + done + testring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac + ]) + if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) + else + AC_MSG_RESULT(none) + fi + ])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + + # _LT_AC_CHECK_DLFCN + # -------------------- + AC_DEFUN([_LT_AC_CHECK_DLFCN], + [AC_CHECK_HEADERS(dlfcn.h)dnl + ])# _LT_AC_CHECK_DLFCN + + + # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, + # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) + # ------------------------------------------------------------------ + AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], + [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl + if test "$cross_compiling" = yes; then : + [$4] + else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < + #endif + + #include + + #ifdef RTLD_GLOBAL + # define LT_DLGLOBAL RTLD_GLOBAL + #else + # ifdef DL_GLOBAL + # define LT_DLGLOBAL DL_GLOBAL + # else + # define LT_DLGLOBAL 0 + # endif + #endif + + /* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ + #ifndef LT_DLLAZY_OR_NOW + # ifdef RTLD_LAZY + # define LT_DLLAZY_OR_NOW RTLD_LAZY + # else + # ifdef DL_LAZY + # define LT_DLLAZY_OR_NOW DL_LAZY + # else + # ifdef RTLD_NOW + # define LT_DLLAZY_OR_NOW RTLD_NOW + # else + # ifdef DL_NOW + # define LT_DLLAZY_OR_NOW DL_NOW + # else + # define LT_DLLAZY_OR_NOW 0 + # endif + # endif + # endif + # endif + #endif + + #ifdef __cplusplus + extern "C" void exit (int); + #endif + + void fnord() { int i=42;} + int main () + { + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + + exit (status); + }] + EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_unknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi + fi + rm -fr conftest* + ])# _LT_AC_TRY_DLOPEN_SELF + + + # AC_LIBTOOL_DLOPEN_SELF + # ------------------- + AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], + [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown + else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + LDFLAGS="$LDFLAGS $link_static_flag" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac + fi + ])# AC_LIBTOOL_DLOPEN_SELF + + + # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) + # --------------------------------- + # Check to see if options -c and -o are simultaneously supported by compiler + AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], + [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + # According to Tom Tromey, Ian Lance Taylor reported there are C compilers + # that will create temporary files in the current directory regardless of + # the output directory. Thus, making CWD read-only will cause this test + # to fail, enabling locking or at least warning the user not to do parallel + # builds. + chmod -w . + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test ! -s out/conftest.err; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . + $rm conftest* out/* + rmdir out + cd .. + rmdir conftest + $rm conftest* + ]) + ])# AC_LIBTOOL_PROG_CC_C_O + + + # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) + # ----------------------------------------- + # Check to see if we can do hard links to lock some files if needed + AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], + [AC_REQUIRE([_LT_AC_LOCK])dnl + + hard_links="nottested" + if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi + else + need_locks=no + fi + ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + + # AC_LIBTOOL_OBJDIR + # ----------------- + AC_DEFUN([AC_LIBTOOL_OBJDIR], + [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], + [rm -f .libs 2>/dev/null + mkdir .libs 2>/dev/null + if test -d .libs; then + lt_cv_objdir=.libs + else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs + fi + rmdir .libs 2>/dev/null]) + objdir=$lt_cv_objdir + ])# AC_LIBTOOL_OBJDIR + + + # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) + # ---------------------------------------------- + # Check hardcoding attributes. + AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], + [AC_MSG_CHECKING([how to hardcode library paths into programs]) + _LT_AC_TAGVAR(hardcode_action, $1)= + if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi + else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported + fi + AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + + if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no + elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless + fi + ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + + # AC_LIBTOOL_SYS_LIB_STRIP + # ------------------------ + AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], + [striplib= + old_striplib= + AC_MSG_CHECKING([whether stripping libraries is possible]) + if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + # FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac + fi + ])# AC_LIBTOOL_SYS_LIB_STRIP + + + # AC_LIBTOOL_SYS_DYNAMIC_LINKER + # ----------------------------- + # PORTME Fill in your ld.so characteristics + AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], + [AC_MSG_CHECKING([dynamic linker characteristics]) + library_names_spec= + libname_spec='lib$name' + soname_spec= + shrext=".so" + postinstall_cmds= + postuninstall_cmds= + finish_cmds= + finish_eval= + shlibpath_var= + shlibpath_overrides_runpath=unknown + version_type=none + dynamic_linker="$host_os ld.so" + sys_lib_dlsearch_path_spec="/lib /usr/lib" + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + fi + need_lib_prefix=unknown + hardcode_into_libs=no + + # when you set need_version to no, make sure it does not cause -set_version + # flags to be left without arguments + need_version=unknown + + case $host_os in + aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + + aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + + amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + + beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + + bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + + cygwin* | mingw* | pw32*) + version_type=windows + shrext=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + + darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext='$(test .$module = .yes && echo .so || echo .dylib)' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + + dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + + freebsd1*) + dynamic_linker=no + ;; + + freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + esac + ;; + + gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + + hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case "$host_cpu" in + ia64*) + shrext='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + + irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + + # No shared lib support for Linux oldld, aout, or coff. + linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + + # This must be Linux ELF. + linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + + netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + + newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + + nto-qnx) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + + openbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + + os2*) + libname_spec='$name' + shrext=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + + osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + + sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + ;; + + solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + + sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + + uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + + *) + dynamic_linker=no + ;; + esac + AC_MSG_RESULT([$dynamic_linker]) + test "$dynamic_linker" = no && can_build_shared=no + ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER + + + # _LT_AC_TAGCONFIG + # ---------------- + AC_DEFUN([_LT_AC_TAGCONFIG], + [AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + + if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && test "X$CXX" != "Xno"; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi + fi + ])# _LT_AC_TAGCONFIG + + + # AC_LIBTOOL_DLOPEN + # ----------------- + # enable checks for dlopen support + AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) + ])# AC_LIBTOOL_DLOPEN + + + # AC_LIBTOOL_WIN32_DLL + # -------------------- + # declare package support for building win32 dll's + AC_DEFUN([AC_LIBTOOL_WIN32_DLL], + [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) + ])# AC_LIBTOOL_WIN32_DLL + + + # AC_ENABLE_SHARED([DEFAULT]) + # --------------------------- + # implement the --enable-shared flag + # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. + AC_DEFUN([AC_ENABLE_SHARED], + [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl + AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) + ])# AC_ENABLE_SHARED + + + # AC_DISABLE_SHARED + # ----------------- + #- set the default shared flag to --disable-shared + AC_DEFUN([AC_DISABLE_SHARED], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_ENABLE_SHARED(no) + ])# AC_DISABLE_SHARED + + + # AC_ENABLE_STATIC([DEFAULT]) + # --------------------------- + # implement the --enable-static flag + # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. + AC_DEFUN([AC_ENABLE_STATIC], + [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl + AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) + ])# AC_ENABLE_STATIC + + + # AC_DISABLE_STATIC + # ----------------- + # set the default static flag to --disable-static + AC_DEFUN([AC_DISABLE_STATIC], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_ENABLE_STATIC(no) + ])# AC_DISABLE_STATIC + + + # AC_ENABLE_FAST_INSTALL([DEFAULT]) + # --------------------------------- + # implement the --enable-fast-install flag + # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. + AC_DEFUN([AC_ENABLE_FAST_INSTALL], + [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl + AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) + ])# AC_ENABLE_FAST_INSTALL + + + # AC_DISABLE_FAST_INSTALL + # ----------------------- + # set the default to --disable-fast-install + AC_DEFUN([AC_DISABLE_FAST_INSTALL], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_ENABLE_FAST_INSTALL(no) + ])# AC_DISABLE_FAST_INSTALL + + + # AC_LIBTOOL_PICMODE([MODE]) + # -------------------------- + # implement the --with-pic flag + # MODE is either `yes' or `no'. If omitted, it defaults to `both'. + AC_DEFUN([AC_LIBTOOL_PICMODE], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + pic_mode=ifelse($#,1,$1,default) + ])# AC_LIBTOOL_PICMODE + + + # AC_PROG_EGREP + # ------------- + # This is predefined starting with Autoconf 2.54, so this conditional + # definition can be removed once we require Autoconf 2.54 or later. + m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], + [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) + ])]) + + + # AC_PATH_TOOL_PREFIX + # ------------------- + # find a file program which can recognise shared library + AC_DEFUN([AC_PATH_TOOL_PREFIX], + [AC_REQUIRE([AC_PROG_EGREP])dnl + AC_MSG_CHECKING([for $1]) + AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, + [case $MAGIC_CMD in + [[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; + *) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + dnl $ac_dummy forces splitting on constant user-supplied paths. + dnl POSIX.2 word splitting is done only on the output of word expansions, + dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + + *** Warning: the command libtool uses to detect shared libraries, + *** $file_magic_cmd, produces output that libtool cannot recognize. + *** The result is that libtool may fail to recognize shared libraries + *** as such. This will affect the creation of libtool libraries that + *** depend on shared libraries, but programs linked with such libtool + *** libraries will work regardless of this problem. Nevertheless, you + *** may want to report the problem to your system manager and/or to + *** bug-libtool at gnu.org + + EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; + esac]) + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) + else + AC_MSG_RESULT(no) + fi + ])# AC_PATH_TOOL_PREFIX + + + # AC_PATH_MAGIC + # ------------- + # find a file program which can recognise a shared library + AC_DEFUN([AC_PATH_MAGIC], + [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) + if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi + fi + ])# AC_PATH_MAGIC + + + # AC_PROG_LD + # ---------- + # find the path to the GNU or non-GNU linker + AC_DEFUN([AC_PROG_LD], + [AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) + AC_REQUIRE([LT_AC_PROG_SED])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl + AC_REQUIRE([AC_CANONICAL_BUILD])dnl + ac_prog=ld + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac + elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) + else + AC_MSG_CHECKING([for non-GNU ld]) + fi + AC_CACHE_VAL(lt_cv_path_LD, + [if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + + gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + + hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case "$host_cpu" in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + + irix5* | irix6* | nonstopux*) + case $host_os in + irix5* | nonstopux*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" + ;; + esac + lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` + lt_cv_deplibs_check_method=pass_all + ;; + + # This must be Linux ELF. + linux*) + case $host_cpu in + alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; + esac + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + + newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + + nto-qnx) + lt_cv_deplibs_check_method=unknown + ;; + + openbsd*) + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' + else + lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' + fi + ;; + + osf3* | osf4* | osf5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' + lt_cv_file_magic_test_file=/shlib/libc.so + lt_cv_deplibs_check_method=pass_all + ;; + + sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + + solaris*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=/lib/libc.so + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ]) + file_magic_cmd=$lt_cv_file_magic_cmd + deplibs_check_method=$lt_cv_deplibs_check_method + test -z "$deplibs_check_method" && deplibs_check_method=unknown + ])# AC_DEPLIBS_CHECK_METHOD + + + # AC_PROG_NM + # ---------- + # find the path to a BSD-compatible name lister + AC_DEFUN([AC_PROG_NM], + [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, + [if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" + else + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/${ac_tool_prefix}nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + esac + fi + done + IFS="$lt_save_ifs" + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm + fi]) + NM="$lt_cv_path_NM" + ])# AC_PROG_NM + + + # AC_CHECK_LIBM + # ------------- + # check for math library + AC_DEFUN([AC_CHECK_LIBM], + [AC_REQUIRE([AC_CANONICAL_HOST])dnl + LIBM= + case $host in + *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; + *-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; + *) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; + esac + ])# AC_CHECK_LIBM + + + # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) + # ----------------------------------- + # sets LIBLTDL to the link flags for the libltdl convenience library and + # LTDLINCL to the include flags for the libltdl header and adds + # --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL + # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If + # DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will + # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with + # '${top_srcdir}/' (note the single quotes!). If your package is not + # flat and you're not using automake, define top_builddir and + # top_srcdir appropriately in the Makefiles. + AC_DEFUN([AC_LIBLTDL_CONVENIENCE], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" + ])# AC_LIBLTDL_CONVENIENCE + + + # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) + # ----------------------------------- + # sets LIBLTDL to the link flags for the libltdl installable library and + # LTDLINCL to the include flags for the libltdl header and adds + # --enable-ltdl-install to the configure arguments. Note that LIBLTDL + # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If + # DIRECTORY is not provided and an installed libltdl is not found, it is + # assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' + # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single + # quotes!). If your package is not flat and you're not using automake, + # define top_builddir and top_srcdir appropriately in the Makefiles. + # In the future, this macro may have to be called after AC_PROG_LIBTOOL. + AC_DEFUN([AC_LIBLTDL_INSTALLABLE], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" + ])# AC_LIBLTDL_INSTALLABLE + + + # AC_LIBTOOL_CXX + # -------------- + # enable support for C++ libraries + AC_DEFUN([AC_LIBTOOL_CXX], + [AC_REQUIRE([_LT_AC_LANG_CXX]) + ])# AC_LIBTOOL_CXX + + + # _LT_AC_LANG_CXX + # --------------- + AC_DEFUN([_LT_AC_LANG_CXX], + [AC_REQUIRE([AC_PROG_CXX]) + AC_REQUIRE([AC_PROG_CXXCPP]) + _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,CXX" | sed 's/^,//'`]) + ])# _LT_AC_LANG_CXX + + + # AC_LIBTOOL_F77 + # -------------- + # enable support for Fortran 77 libraries + AC_DEFUN([AC_LIBTOOL_F77], + [AC_REQUIRE([_LT_AC_LANG_F77]) + ])# AC_LIBTOOL_F77 + + + # _LT_AC_LANG_F77 + # --------------- + AC_DEFUN([_LT_AC_LANG_F77], + [AC_REQUIRE([AC_PROG_F77]) + _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,F77" | sed 's/^,//'`]) + ])# _LT_AC_LANG_F77 + + + # AC_LIBTOOL_GCJ + # -------------- + # enable support for GCJ libraries + AC_DEFUN([AC_LIBTOOL_GCJ], + [AC_REQUIRE([_LT_AC_LANG_GCJ]) + ])# AC_LIBTOOL_GCJ + + + # _LT_AC_LANG_GCJ + # --------------- + AC_DEFUN([_LT_AC_LANG_GCJ], + [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) + _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,GCJ" | sed 's/^,//'`]) + ])# _LT_AC_LANG_GCJ + + + # AC_LIBTOOL_RC + # -------------- + # enable support for Windows resource files + AC_DEFUN([AC_LIBTOOL_RC], + [AC_REQUIRE([LT_AC_PROG_RC]) + _LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,RC" | sed 's/^,//'`]) + ])# AC_LIBTOOL_RC + + + # AC_LIBTOOL_LANG_C_CONFIG + # ------------------------ + # Ensure that the configuration vars for the C compiler are + # suitably defined. Those variables are subsequently used by + # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. + AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) + AC_DEFUN([_LT_AC_LANG_C_CONFIG], + [lt_save_CC="$CC" + AC_LANG_PUSH(C) + + # Source file extension for C test sources. + ac_ext=c + + # Object file extension for compiled C test sources. + objext=o + _LT_AC_TAGVAR(objext, $1)=$objext + + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;\n" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(){return(0);}\n' + + _LT_AC_SYS_COMPILER + + # + # Check for any special shared library compilation flags. + # + _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= + if test "$GCC" = no; then + case $host_os in + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' + ;; + esac + fi + if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then + AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) + if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then : + else + AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) + _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no + fi + fi + + + # + # Check to make sure the static flag actually works. + # + AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) + + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) + AC_LIBTOOL_PROG_COMPILER_PIC($1) + AC_LIBTOOL_PROG_CC_C_O($1) + AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) + AC_LIBTOOL_PROG_LD_SHLIBS($1) + AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + AC_LIBTOOL_SYS_LIB_STRIP + AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) + AC_LIBTOOL_DLOPEN_SELF($1) + + # Report which librarie types wil actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case "$host_os" in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix4*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + ;; + esac + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. Also zsh mangles + # `"' quotes if we put them in here... so don't! + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + AC_LIBTOOL_CONFIG($1) + + AC_LANG_POP + CC="$lt_save_CC" + ])# AC_LIBTOOL_LANG_C_CONFIG + + + # AC_LIBTOOL_LANG_CXX_CONFIG + # -------------------------- + # Ensure that the configuration vars for the C compiler are + # suitably defined. Those variables are subsequently used by + # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. + AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) + AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], + [AC_LANG_PUSH(C++) + AC_REQUIRE([AC_PROG_CXX]) + AC_REQUIRE([AC_PROG_CXXCPP]) + + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds + _LT_AC_TAGVAR(no_undefined_flag, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + + # Dependencies to place before and after the object being linked: + _LT_AC_TAGVAR(predep_objects, $1)= + _LT_AC_TAGVAR(postdep_objects, $1)= + _LT_AC_TAGVAR(predeps, $1)= + _LT_AC_TAGVAR(postdeps, $1)= + _LT_AC_TAGVAR(compiler_lib_search_path, $1)= + + # Source file extension for C++ test sources. + ac_ext=cc + + # Object file extension for compiled C++ test sources. + objext=o + _LT_AC_TAGVAR(objext, $1)=$objext + + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;\n" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_AC_SYS_COMPILER + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + compiler=$CC + _LT_AC_TAGVAR(compiler, $1)=$CC + cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'` + + # We don't want -fno-exception wen compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + ;; + esac + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' + + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + fi + ;; + + dgux*) + case $cc_basename in + ec++) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC) + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case "$host_cpu" in + ia64*|hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + irix5* | irix6*) + case $cc_basename in + CC) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc) + # Intel C++ + with_gnu_ld=yes + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + cxx) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + osf3*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry $objdir/so_locations -o $lib~ + $rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sco*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case $cc_basename in + CC) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) + test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_AC_TAGVAR(GCC, $1)="$GXX" + _LT_AC_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + AC_LIBTOOL_POSTDEP_PREDEP($1) + AC_LIBTOOL_PROG_COMPILER_PIC($1) + AC_LIBTOOL_PROG_CC_C_O($1) + AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) + AC_LIBTOOL_PROG_LD_SHLIBS($1) + AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + AC_LIBTOOL_SYS_LIB_STRIP + AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) + AC_LIBTOOL_DLOPEN_SELF($1) + + AC_LIBTOOL_CONFIG($1) + + AC_LANG_POP + CC=$lt_save_CC + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ldcxx=$with_gnu_ld + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld + ])# AC_LIBTOOL_LANG_CXX_CONFIG + + # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) + # ------------------------ + # Figure out "hidden" library dependencies from verbose + # compiler output when linking a shared library. + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ + dnl we can't use the lt_simple_compile_test_code here, + dnl because it contains code intended for an executable, + dnl not a library. It's possible we should let each + dnl tag define a new lt_????_link_test_code variable, + dnl but it's only used here... + ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" + ifelse([$1], [], + [#! $SHELL + + # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. + # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) + # NOTE: Changes made to this file will be lost: look at ltmain.sh. + # + # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 + # Free Software Foundation, Inc. + # + # This file is part of GNU Libtool: + # Originally by Gordon Matzigkeit , 1996 + # + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, but + # WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + # General Public License for more details. + # + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + # + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a + # configuration script generated by Autoconf, you may include it under + # the same distribution terms that you use for the rest of that program. + + # A sed program that does not truncate output. + SED=$lt_SED + + # Sed that helps us avoid accidentally triggering echo(1) options like -n. + Xsed="$SED -e s/^X//" + + # The HP-UX ksh and POSIX shell print the target directory to stdout + # if CDPATH is set. + if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + + # The names of the tagged configurations supported by this script. + available_tags= + + # ### BEGIN LIBTOOL CONFIG], + [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + + # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + + # Shell to use when invoking shell scripts. + SHELL=$lt_SHELL + + # Whether or not to build shared libraries. + build_libtool_libs=$enable_shared + + # Whether or not to build static libraries. + build_old_libs=$enable_static + + # Whether or not to add -lc for building shared libraries. + build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + + # Whether or not to disallow shared libs when runtime libs are static + allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + + # Whether or not to optimize for fast installation. + fast_install=$enable_fast_install + + # The host system. + host_alias=$host_alias + host=$host + + # An echo program that does not interpret backslashes. + echo=$lt_echo + + # The archiver. + AR=$lt_AR + AR_FLAGS=$lt_AR_FLAGS + + # A C compiler. + LTCC=$lt_LTCC + + # A language-specific compiler. + CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + + # Is the compiler the GNU C compiler? + with_gcc=$_LT_AC_TAGVAR(GCC, $1) + + # An ERE matcher. + EGREP=$lt_EGREP + + # The linker used to build libraries. + LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + + # Whether we need hard or soft links. + LN_S=$lt_LN_S + + # A BSD-compatible nm program. + NM=$lt_NM + + # A symbol stripping program + STRIP=$STRIP + + # Used to examine libraries when file_magic_cmd begins "file" + MAGIC_CMD=$MAGIC_CMD + + # Used on cygwin: DLL creation program. + DLLTOOL="$DLLTOOL" + + # Used on cygwin: object dumper. + OBJDUMP="$OBJDUMP" + + # Used on cygwin: assembler. + AS="$AS" + + # The name of the directory that contains temporary libtool files. + objdir=$objdir + + # How to create reloadable object files. + reload_flag=$lt_reload_flag + reload_cmds=$lt_reload_cmds + + # How to pass a linker flag through the compiler. + wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + + # Object file suffix (normally "o"). + objext="$ac_objext" + + # Old archive suffix (normally "a"). + libext="$libext" + + # Shared library suffix (normally ".so"). + shrext='$shrext' + + # Executable file suffix (normally ""). + exeext="$exeext" + + # Additional compiler flags for building library objects. + pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) + pic_mode=$pic_mode + + # What is the maximum length of a command? + max_cmd_len=$lt_cv_sys_max_cmd_len + + # Does compiler simultaneously support -c and -o options? + compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + + # Must we lock files when doing compilation ? + need_locks=$lt_need_locks + + # Do we need the lib prefix for modules? + need_lib_prefix=$need_lib_prefix + + # Do we need a version for libraries? + need_version=$need_version + + # Whether dlopen is supported. + dlopen_support=$enable_dlopen + + # Whether dlopen of programs is supported. + dlopen_self=$enable_dlopen_self + + # Whether dlopen of statically linked programs is supported. + dlopen_self_static=$enable_dlopen_self_static + + # Compiler flag to prevent dynamic linking. + link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + + # Compiler flag to turn off builtin functions. + no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + + # Compiler flag to allow reflexive dlopens. + export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + + # Compiler flag to generate shared objects directly from archives. + whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + + # Compiler flag to generate thread-safe objects. + thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + + # Library versioning type. + version_type=$version_type + + # Format of library name prefix. + libname_spec=$lt_libname_spec + + # List of archive names. First name is the real one, the rest are links. + # The last name is the one that the linker finds with -lNAME. + library_names_spec=$lt_library_names_spec + + # The coded name of the library, if different from the real name. + soname_spec=$lt_soname_spec + + # Commands used to build and install an old-style archive. + RANLIB=$lt_RANLIB + old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) + old_postinstall_cmds=$lt_old_postinstall_cmds + old_postuninstall_cmds=$lt_old_postuninstall_cmds + + # Create an old-style archive from a shared archive. + old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + + # Create a temporary old-style archive to link instead of a shared archive. + old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + + # Commands used to build and install a shared archive. + archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) + archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) + postinstall_cmds=$lt_postinstall_cmds + postuninstall_cmds=$lt_postuninstall_cmds + + # Commands used to build a loadable module (assumed same as above if empty) + module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) + module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + + # Commands to strip libraries. + old_striplib=$lt_old_striplib + striplib=$lt_striplib + + # Dependencies to place before the objects being linked to create a + # shared library. + predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + + # Dependencies to place after the objects being linked to create a + # shared library. + postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + + # Dependencies to place before the objects being linked to create a + # shared library. + predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + + # Dependencies to place after the objects being linked to create a + # shared library. + postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + + # The library search path used internally by the compiler when linking + # a shared library. + compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + + # Method to check whether dependent libraries are shared objects. + deplibs_check_method=$lt_deplibs_check_method + + # Command to use when deplibs_check_method == file_magic. + file_magic_cmd=$lt_file_magic_cmd + + # Flag that allows shared libraries with undefined symbols to be built. + allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + + # Flag that forces no undefined symbols. + no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + + # Commands used to finish a libtool library installation in a directory. + finish_cmds=$lt_finish_cmds + + # Same as above, but a single script fragment to be evaled but not shown. + finish_eval=$lt_finish_eval + + # Take the output of nm and produce a listing of raw symbols and C names. + global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + + # Transform the output of nm in a proper C declaration + global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + + # Transform the output of nm in a C name address pair + global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + + # This is the shared library runtime path variable. + runpath_var=$runpath_var + + # This is the shared library path variable. + shlibpath_var=$shlibpath_var + + # Is shlibpath searched before the hard-coded library search path? + shlibpath_overrides_runpath=$shlibpath_overrides_runpath + + # How to hardcode a shared library path into an executable. + hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) + + # Whether we should hardcode library paths into libraries. + hardcode_into_libs=$hardcode_into_libs + + # Flag to hardcode \$libdir into a binary during linking. + # This must work even if \$libdir does not exist. + hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + + # If ld is used when linking, flag to hardcode \$libdir into + # a binary during linking. This must work even if \$libdir does + # not exist. + hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + + # Whether we need a single -rpath flag with a separated argument. + hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + + # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the + # resulting binary. + hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + + # Set to yes if using the -LDIR flag during linking hardcodes DIR into the + # resulting binary. + hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + + # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into + # the resulting binary. + hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + + # Set to yes if building a shared library automatically hardcodes DIR into the library + # and all subsequent libraries and executables linked against it. + hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) + + # Variables whose values should be saved in libtool wrapper scripts and + # restored at relink time. + variables_saved_for_relink="$variables_saved_for_relink" + + # Whether libtool must link a program against all its dependency libraries. + link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) + + # Compile-time system search path for libraries + sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + + # Run-time system search path for libraries + sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + + # Fix the shell variable \$srcfile for the compiler. + fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" + + # Set to yes if exported symbols are required. + always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + + # The commands to list exported symbols. + export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + + # The commands to extract the exported symbol list from a shared archive. + extract_expsyms_cmds=$lt_extract_expsyms_cmds + + # Symbols that should not be listed in the preloaded symbols. + exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + + # Symbols that must always be exported. + include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + + ifelse([$1],[], + [# ### END LIBTOOL CONFIG], + [# ### END LIBTOOL TAG CONFIG: $tagname]) + + __EOF__ + + ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + ]) + else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + test -f Makefile && make "$ltmain" + fi + ])# AC_LIBTOOL_CONFIG + + + # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) + # ------------------------------------------- + AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], + [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) + fi + ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + + # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + # --------------------------------- + AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], + [AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_PROG_NM]) + AC_REQUIRE([AC_OBJEXT]) + # Check for command to grab the raw symbol name followed by C symbol from nm. + AC_MSG_CHECKING([command to parse $NM output from $compiler object]) + AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], + [ + # These are sane defaults that work on at least a few old systems. + # [They come from Ultrix. What could be older than Ultrix?!! ;)] + + # Character class describing NM global symbol codes. + symcode='[[BCDEGRST]]' + + # Regexp to match symbols that can be accessed directly from C. + sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + + # Transform the above into a raw symbol and a C symbol. + symxfrm='\1 \2\3 \3' + + # Transform an extracted symbol line into a proper C declaration + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + + # Transform an extracted symbol line into symbol name and symbol address + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + + # Define system-specific variables. + case $host_os in + aix*) + symcode='[[BCDT]]' + ;; + cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; + hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; + irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; + osf*) + symcode='[[BCDEGQRST]]' + ;; + solaris* | sysv5*) + symcode='[[BDT]]' + ;; + sysv4) + symcode='[[DFNSTU]]' + ;; + esac + + # Handle CRLF in mingw tool chain + opt_cr= + case $build_os in + mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; + esac + + # If we're using GNU nm, then use its standard symbol codes. + case `$NM -V 2>&1` in + *GNU* | *'with BFD'*) + symcode='[[ABCDGISTW]]' ;; + esac + + # Try without a prefix undercore, then with it. + for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext + #ifdef __cplusplus + extern "C" { + #endif + + EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext + #if defined (__STDC__) && __STDC__ + # define lt_ptr_t void * + #else + # define lt_ptr_t char * + # define const + #endif + + /* The mapping between symbol names and symbols. */ + const struct { + const char *name; + lt_ptr_t address; + } + lt_preloaded_symbols[[]] = + { + EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} + }; + + #ifdef __cplusplus + } + #endif + EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi + done + ]) + if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= + fi + if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) + else + AC_MSG_RESULT(ok) + fi + ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + + # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) + # --------------------------------------- + AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], + [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + + AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + cxx) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + sco*) + case $cc_basename in + CC) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + *) + ;; + esac + ;; + solaris*) + case $cc_basename in + CC) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + unixware*) + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi + ], + [ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case "$host_cpu" in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux*) + case $CC in + icc|ecc) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + ccc) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi + ]) + AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + + # + # Check to make sure the PIC flag actually works. + # + if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) + fi + case "$host_os" in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; + esac + ]) + + + # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) + # ------------------------------------ + # See if the linker supports building shared libraries. + AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], + [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + ],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + + *** Warning: the GNU linker, at least up to release 2.9.1, is reported + *** to be unable to reliably create shared libraries on AIX. + *** Therefore, libtool is disabling shared libraries support. If you + *** really care for shared libraries, you may want to modify your PATH + *** so that a non-GNU linker is found, and then restart. + + EOF + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + + *** Warning: The releases 2.8.* of the GNU linker cannot reliably + *** create shared libraries on Solaris systems. Therefore, libtool + *** is disabling shared libraries support. We urge you to upgrade GNU + *** binutils to release 2.9.1 or newer. Another option is to modify + *** your PATH or compiler configuration so that the native linker is + *** used, and then restart. + + EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # -bexpall does not export symbols beginning with underscore (_) + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds it's shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi4*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + case "$host_os" in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress' + ;; + *) # Darwin 1.3 on + test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress' + ;; + esac + # FIXME: Relying on posixy $() will cause problems for + # cross-compilation, but unfortunately the echo tests do not + # yet detect zsh echo's removal of \ escapes. Also zsh mangles + # `"' quotes if we put them in here... so don't! + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10* | hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case "$host_cpu" in + hppa*64*|ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + case "$host_cpu" in + hppa*64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + *) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + sco3.2v5*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4.2uw2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv5*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ]) + AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) + test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + variables_saved_for_relink="PATH $shlibpath_var $runpath_var" + if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" + fi + + # + # Do we need to explicitly link libc? + # + case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in + x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; + esac + ])# AC_LIBTOOL_PROG_LD_SHLIBS + + + # _LT_AC_FILE_LTDLL_C + # ------------------- + # Be careful that the start marker always follows a newline. + AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ + # /* ltdll.c starts here */ + # #define WIN32_LEAN_AND_MEAN + # #include + # #undef WIN32_LEAN_AND_MEAN + # #include + # + # #ifndef __CYGWIN__ + # # ifdef __CYGWIN32__ + # # define __CYGWIN__ __CYGWIN32__ + # # endif + # #endif + # + # #ifdef __cplusplus + # extern "C" { + # #endif + # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); + # #ifdef __cplusplus + # } + # #endif + # + # #ifdef __CYGWIN__ + # #include + # DECLARE_CYGWIN_DLL( DllMain ); + # #endif + # HINSTANCE __hDllInstance_base; + # + # BOOL APIENTRY + # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) + # { + # __hDllInstance_base = hInst; + # return TRUE; + # } + # /* ltdll.c ends here */ + ])# _LT_AC_FILE_LTDLL_C + + + # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) + # --------------------------------- + AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + + # old names + AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) + AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) + AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) + AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) + AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + + # This is just to silence aclocal about the macro not being used + ifelse([AC_DISABLE_FAST_INSTALL]) + + AC_DEFUN([LT_AC_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) + ]) + + AC_DEFUN([LT_AC_PROG_RC], + [AC_CHECK_TOOL(RC, windres, no) + ]) + + ############################################################ + # NOTE: This macro has been submitted for inclusion into # + # GNU Autoconf as AC_PROG_SED. When it is available in # + # a released version of Autoconf we should remove this # + # macro and use it instead. # + ############################################################ + # LT_AC_PROG_SED + # -------------- + # Check for a fully-functional sed program, that truncates + # as few characters as possible. Prefer GNU sed if found. + AC_DEFUN([LT_AC_PROG_SED], + [AC_MSG_CHECKING([for a sed that does not truncate output]) + AC_CACHE_VAL(lt_cv_path_SED, + [# Loop through the user's path and test for sed and gsed. + # Then use that list of sed's as ones to test for truncation. + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done + done + lt_ac_max=0 + lt_ac_count=0 + # Add /usr/xpg4/bin/sed as it is typically found on Solaris + # along with /bin/sed that truncates output. + for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && break + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done + done + SED=$lt_cv_path_SED + ]) + AC_MSG_RESULT([$SED]) + ]) + ############################################################################# + # Additional Macros + ############################################################################# + + # + # Check for C++ namespace support. This is from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_namespaces.html + # + AC_DEFUN([AC_CXX_NAMESPACES], + [AC_CACHE_CHECK(whether the compiler implements namespaces, + ac_cv_cxx_namespaces, + [AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], + [using namespace Outer::Inner; return i;], + ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) + AC_LANG_RESTORE + ]) + if test "$ac_cv_cxx_namespaces" = yes; then + AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces]) + fi + ]) + + # + # Check for hash_map extension. This is from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_map.html + # + AC_DEFUN([AC_CXX_HAVE_STD_EXT_HASH_MAP], + [AC_CACHE_CHECK([whether the compiler has defining template class std::hash_map], + ac_cv_cxx_have_std_ext_hash_map, + [AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace std; + #endif],[hash_map t;], + [ac_cv_cxx_have_std_ext_hash_map=yes], [ac_cv_cxx_have_std_ext_hash_map=no]) + AC_LANG_RESTORE]) + if test "$ac_cv_cxx_have_std_ext_hash_map" = yes; then + AC_DEFINE(HAVE_STD_EXT_HASH_MAP,,[Define if the compiler has a header that defines template class std::hash_map.]) + fi]) + + AC_DEFUN([AC_CXX_HAVE_GNU_EXT_HASH_MAP], + [AC_CACHE_CHECK([whether the compiler has defining template class __gnu_cxx::hash_map], + ac_cv_cxx_have_gnu_ext_hash_map, + [AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace __gnu_cxx; + #endif],[hash_map t; ], + [ac_cv_cxx_have_gnu_ext_hash_map=yes],[ac_cv_cxx_have_gnu_ext_hash_map=no]) + AC_LANG_RESTORE]) + if test "$ac_cv_cxx_have_gnu_ext_hash_map" = yes; then + AC_DEFINE(HAVE_GNU_EXT_HASH_MAP,,[Define if the compiler has a header that defines template class __gnu_cxx::hash_map.]) + fi]) + + AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_MAP], + [AC_CACHE_CHECK([whether the compiler has defining template class ::hash_map], + ac_cv_cxx_have_global_hash_map, + [AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include ],[hash_map t; ], + [ac_cv_cxx_have_global_hash_map=yes], [ac_cv_cxx_have_global_hash_map=no]) + AC_LANG_RESTORE]) + if test "$ac_cv_cxx_have_global_hash_map" = yes; then + AC_DEFINE(HAVE_GLOBAL_HASH_MAP,,[Define if the compiler has a header that defines template class ::hash_map.]) + fi]) + + AC_DEFUN([AC_CXX_HAVE_HASH_MAP], + [AC_CXX_HAVE_STD_EXT_HASH_MAP + AC_CXX_HAVE_GNU_EXT_HASH_MAP + AC_CXX_HAVE_GLOBAL_HASH_MAP]) + # + # Check for hash_set extension. This is modified from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html + # + AC_DEFUN([AC_CXX_HAVE_STD_EXT_HASH_SET], + [AC_CACHE_CHECK([whether the compiler has defining template class std::hash_set], + ac_cv_cxx_have_std_ext_hash_set, + [AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace std; + #endif],[hash_set t; ], + [ac_cv_cxx_have_std_ext_hash_set=yes], [ac_cv_cxx_have_std_ext_hash_set=no]) + AC_LANG_RESTORE]) + if test "$ac_cv_cxx_have_std_ext_hash_set" = yes; then + AC_DEFINE(HAVE_STD_EXT_HASH_SET,,[Define if the compiler has a header that defines template class std::hash_set.]) + fi]) + + AC_DEFUN([AC_CXX_HAVE_GNU_EXT_HASH_SET], + [AC_CACHE_CHECK( + [whether the compiler has defining template class __gnu_cxx::hash_set], + ac_cv_cxx_have_gnu_ext_hash_set, + [AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace __gnu_cxx; + #endif],[hash_set t; ], + [ac_cv_cxx_have_gnu_ext_hash_set=yes], [ac_cv_cxx_have_gnu_ext_hash_set=no]) + AC_LANG_RESTORE]) + if test "$ac_cv_cxx_have_gnu_ext_hash_set" = yes; then + AC_DEFINE(HAVE_GNU_EXT_HASH_SET,,[Define if the compiler has a header that defines template class __gnu_cxx::hash_set.]) + fi]) + + AC_DEFUN([AC_CXX_HAVE_GLOBAL_HASH_SET], + [AC_CACHE_CHECK([whether the compiler has defining template class ::hash_set], + ac_cv_cxx_have_global_hash_set, + [AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include ],[hash_set t; return 0;], + [ac_cv_cxx_have_global_hash_set=yes], [ac_cv_cxx_have_global_hash_set=no]) + AC_LANG_RESTORE]) + if test "$ac_cv_cxx_have_global_hash_set" = yes; then + AC_DEFINE(HAVE_GLOBAL_HASH_SET,,[Define if the compiler has a header that defines template class ::hash_set.]) + fi]) + + AC_DEFUN([AC_CXX_HAVE_HASH_SET], + [AC_CXX_HAVE_STD_EXT_HASH_SET + AC_CXX_HAVE_GNU_EXT_HASH_SET + AC_CXX_HAVE_GLOBAL_HASH_SET]) + + # + # Check for standard iterator extension. This is modified from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html + # + AC_DEFUN([AC_CXX_HAVE_STD_ITERATOR], + [AC_CACHE_CHECK(whether the compiler has the standard iterator, + ac_cv_cxx_have_std_iterator, + [AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace std; + #endif],[iterator t; return 0;], + ac_cv_cxx_have_std_iterator=yes, ac_cv_cxx_have_std_iterator=no) + AC_LANG_RESTORE + ]) + if test "$ac_cv_cxx_have_std_iterator" = yes; then + AC_DEFINE(HAVE_STD_ITERATOR,,[define if the compiler has STL iterators]) + fi + ]) + + # + # Check for bidirectional iterator extension. This is modified from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html + # + AC_DEFUN([AC_CXX_HAVE_BI_ITERATOR], + [AC_CACHE_CHECK(whether the compiler has the bidirectional iterator, + ac_cv_cxx_have_bi_iterator, + [AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace std; + #endif],[bidirectional_iterator t; return 0;], + ac_cv_cxx_have_bi_iterator=yes, ac_cv_cxx_have_bi_iterator=no) + AC_LANG_RESTORE + ]) + if test "$ac_cv_cxx_have_bi_iterator" = yes; then + AC_DEFINE(HAVE_BI_ITERATOR,,[define if the compiler has bidirectional iterator]) + fi + ]) + + # + # Check for forward iterator extension. This is modified from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_hash_set.html + # + AC_DEFUN([AC_CXX_HAVE_FWD_ITERATOR], + [AC_CACHE_CHECK(whether the compiler has forward iterators, + ac_cv_cxx_have_fwd_iterator, + [AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace std; + #endif],[forward_iterator t; return 0;], + ac_cv_cxx_have_fwd_iterator=yes, ac_cv_cxx_have_fwd_iterator=no) + AC_LANG_RESTORE + ]) + if test "$ac_cv_cxx_have_fwd_iterator" = yes; then + AC_DEFINE(HAVE_FWD_ITERATOR,,[define if the compiler has STL iterators]) + fi + ]) + + # + # Check for slist extension. This is from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html + # + AC_DEFUN([AC_CXX_HAVE_EXT_SLIST], + [AC_CACHE_CHECK(whether the compiler has ext/slist, + ac_cv_cxx_have_ext_slist, + [AC_REQUIRE([AC_CXX_NAMESPACES]) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace std; + #endif],[slist s; return 0;], + ac_cv_cxx_have_ext_slist=std, ac_cv_cxx_have_ext_slist=no) + AC_TRY_COMPILE([#include + #ifdef HAVE_NAMESPACES + using namespace __gnu_cxx; + #endif],[slist s; return 0;], + ac_cv_cxx_have_ext_slist=gnu, ac_cv_cxx_have_ext_slist=no) + + AC_LANG_RESTORE + ]) + if test "$ac_cv_cxx_have_ext_slist" = std; then + AC_DEFINE(HAVE_EXT_SLIST,std,[define if the compiler has ext/slist]) + fi + if test "$ac_cv_cxx_have_ext_slist" = gnu; then + AC_DEFINE(HAVE_EXT_SLIST,gnu,[define if the compiler has ext/slist]) + fi + ]) + + # + # Check for FLEX. This is modified from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_namespaces.html + # + AC_DEFUN([AC_PROG_FLEX], + [AC_CACHE_CHECK(, + ac_cv_has_flex, + [AC_PROG_LEX() + ]) + if test "$LEX" != "flex"; then + AC_MSG_ERROR([flex not found but required]) + fi + ]) + + # + # Check for Bison. This is modified from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_namespaces.html + # + AC_DEFUN([AC_PROG_BISON], + [AC_CACHE_CHECK(, + ac_cv_has_bison, + [AC_PROG_YACC() + ]) + if test "$YACC" != "bison -y"; then + AC_MSG_ERROR([bison not found but required]) + else + AC_SUBST(YACC,[bison],[location of bison]) + fi + ]) + + # + # Check for GNU Make. This is from + # http://www.gnu.org/software/ac-archive/htmldoc/check_gnu_make.html + # + AC_DEFUN( + [CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command, + _cv_gnu_make_command='' ; + dnl Search all the common names for GNU make + for a in "$MAKE" make gmake gnumake ; do + if test -z "$a" ; then continue ; fi ; + if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then + _cv_gnu_make_command=$a ; + break; + fi + done ; + ) ; + dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise + if test "x$_cv_gnu_make_command" != "x" ; then + ifGNUmake='' ; + else + ifGNUmake='#' ; + AC_MSG_RESULT("Not found"); + fi + AC_SUBST(ifGNUmake) + ] ) + + # + # Check for the ability to mmap a file. This is modified from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html + # + AC_DEFUN([AC_FUNC_MMAP_FILE], + [AC_CACHE_CHECK(for mmap of files, + ac_cv_func_mmap_file, + [AC_LANG_SAVE + AC_LANG_C + AC_TRY_RUN([ + #ifdef HAVE_SYS_TYPES_H + #include + #endif + + #ifdef HAVE_SYS_MMAN_H + #include + #endif + + #ifdef HAVE_FCNTL_H + #include + #endif + + int fd; + int main () { + fd = creat ("foo",0777); fd = (int) mmap (0, 1, PROT_READ, MAP_SHARED, fd, 0); unlink ("foo"); return (fd != (int) MAP_FAILED);}], + ac_cv_func_mmap_file=yes, ac_cv_func_mmap_file=no) + AC_LANG_RESTORE + ]) + if test "$ac_cv_func_mmap_file" = yes; then + AC_DEFINE([HAVE_MMAP_FILE],[],[Define if mmap() can map files into memory]) + AC_SUBST(MMAP_FILE,[yes]) + fi + ]) + + # + # Check for anonymous mmap macros. This is modified from + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html + # + AC_DEFUN([AC_HEADER_MMAP_ANONYMOUS], + [AC_CACHE_CHECK(for MAP_ANONYMOUS vs. MAP_ANON, + ac_cv_header_mmap_anon, + [AC_LANG_SAVE + AC_LANG_C + AC_TRY_COMPILE([#include + #include + #include ], + [mmap (0, 1, PROT_READ, MAP_ANONYMOUS, -1, 0); return (0);], + ac_cv_header_mmap_anon=yes, ac_cv_header_mmap_anon=no) + AC_LANG_RESTORE + ]) + if test "$ac_cv_header_mmap_anon" = yes; then + AC_DEFINE([HAVE_MMAP_ANONYMOUS],[],[Define if mmap() uses MAP_ANONYMOUS to map anonymous pages, or undefine if it uses MAP_ANON]) + fi + ]) + + # + # Configure a Makefile without clobbering it if it exists and is not out of + # date. This is modified from: + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html + #[AC_CONFIG_COMMANDS($1,${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/$1 $1) + # + AC_DEFUN([AC_CONFIG_MAKEFILE], + [AC_CONFIG_COMMANDS($1,${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/$1 $1,${srcdir}/autoconf/mkinstalldirs `dirname $1`) + ]) + + # + # Determine if the printf() functions have the %a format character. + # This is modified from: + # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html + AC_DEFUN([AC_C_PRINTF_A], + [ + AC_LANG_SAVE + AC_LANG_C + AC_RUN_IFELSE( + AC_LANG_PROGRAM([#include + #include ], + [[[ + volatile double A, B; + char Buffer[100]; + A = 1; + A /= 10.0; + sprintf(Buffer, "%a", A); + B = atof(Buffer); + if (A != B) + return (1); + if (A != 0x1.999999999999ap-4) + return (1); + return (0);]]]), + ac_c_printf_a=yes,ac_c_printf_a=no) + AC_LANG_RESTORE + if test "$ac_c_printf_a" = "yes"; then + AC_DEFINE([HAVE_PRINTF_A],[1],[Define to have the %a format string]) + fi + ]) + + # + # Determine if the system can handle the -R option being passed to the linker. + # + AC_DEFUN([AC_LINK_USE_R], + [ + AC_LANG_SAVE + AC_LANG_C + oldcflags="$CFLAGS" + CFLAGS="$CFLAGS -Wl,-R." + AC_LINK_IFELSE([int main() { return 0; }],[ac_cv_link_use_r=yes],[ac_cv_link_use_r=no]) + CFLAGS="$oldcflags" + AC_LANG_RESTORE + if test "$ac_cv_link_use_r" = yes + then + AC_DEFINE([HAVE_LINK_R],[1],[Define if you can use -Wl,-R. to pass -R. to the linker, in order to add the current directory to the dynamic linker search path.]) + fi + ]) From criswell at cs.uiuc.edu Tue Dec 30 11:56:01 2003 From: criswell at cs.uiuc.edu (John Criswell) Date: Tue Dec 30 11:56:01 2003 Subject: [llvm-commits] CVS: llvm/configure Message-ID: <200312301755.LAA23823@choi.cs.uiuc.edu> Changes in directory llvm: configure updated: 1.63 -> 1.64 --- Log message: Updated from files in llvm/autoconf. This was done immediently following the renaming of aclocal.m4 to acinclude.m4. --- Diffs of the changes: (+26 -38) Index: llvm/configure diff -u llvm/configure:1.63 llvm/configure:1.64 --- llvm/configure:1.63 Sat Dec 20 15:35:15 2003 +++ llvm/configure Tue Dec 30 11:55:05 2003 @@ -5864,10 +5864,6 @@ -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... lt_prog_compiler_no_builtin_flag= @@ -5892,11 +5888,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:5895: $lt_compile\"" >&5) + (eval echo "\"\$as_me:5891: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:5899: \$? = $ac_status" >&5 + echo "$as_me:5895: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6124,11 +6120,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6127: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6123: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6131: \$? = $ac_status" >&5 + echo "$as_me:6127: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6191,11 +6187,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6194: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6190: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6198: \$? = $ac_status" >&5 + echo "$as_me:6194: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8203,7 +8199,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:10432: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:10444: \$? = $ac_status" >&5 + echo "$as_me:10436: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -10504,11 +10496,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:10507: $lt_compile\"" >&5) + (eval echo "\"\$as_me:10499: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:10511: \$? = $ac_status" >&5 + echo "$as_me:10503: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -11747,7 +11739,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:12662: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12674: \$? = $ac_status" >&5 + echo "$as_me:12666: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -12734,11 +12726,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12737: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12729: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12741: \$? = $ac_status" >&5 + echo "$as_me:12733: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14650,10 +14642,6 @@ # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... lt_prog_compiler_no_builtin_flag_GCJ= @@ -14678,11 +14666,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14681: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14669: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14685: \$? = $ac_status" >&5 + echo "$as_me:14673: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -14910,11 +14898,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14913: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14901: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14917: \$? = $ac_status" >&5 + echo "$as_me:14905: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings @@ -14977,11 +14965,11 @@ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14980: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14968: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14984: \$? = $ac_status" >&5 + echo "$as_me:14972: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16989,7 +16977,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext < Changes in directory llvm/lib/AsmParser: llvmAsmParser.y updated: 1.146 -> 1.147 --- Log message: Minor code cleanups. The only bugfix is to the UR_DEBUG stuff which didn't compile when enabled. --- Diffs of the changes: (+20 -15) Index: llvm/lib/AsmParser/llvmAsmParser.y diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.146 llvm/lib/AsmParser/llvmAsmParser.y:1.147 --- llvm/lib/AsmParser/llvmAsmParser.y:1.146 Tue Dec 23 16:18:36 2003 +++ llvm/lib/AsmParser/llvmAsmParser.y Tue Dec 30 20:18:11 2003 @@ -592,36 +592,41 @@ return find(df_begin(Ty), df_end(Ty), E) != df_end(Ty); } - +// UpRefs - A list of the outstanding upreferences that need to be resolved. static std::vector > UpRefs; +/// HandleUpRefs - Every time we finish a new layer of types, this function is +/// called. It loops through the UpRefs vector, which is a list of the +/// currently active types. For each type, if the up reference is contained in +/// the newly completed type, we decrement the level count. When the level +/// count reaches zero, the upreferenced type is the type that is passed in: +/// thus we can complete the cycle. +/// static PATypeHolder HandleUpRefs(const Type *ty) { PATypeHolder Ty(ty); - UR_OUT("Type '" << ty->getDescription() << + UR_OUT("Type '" << Ty->getDescription() << "' newly formed. Resolving upreferences.\n" << UpRefs.size() << " upreferences active!\n"); - for (unsigned i = 0; i < UpRefs.size(); ) { + for (unsigned i = 0; i != UpRefs.size(); ++i) { UR_OUT(" UR#" << i << " - TypeContains(" << Ty->getDescription() << ", " << UpRefs[i].second->getDescription() << ") = " - << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << endl); + << (TypeContains(Ty, UpRefs[i].second) ? "true" : "false") << "\n"); if (TypeContains(Ty, UpRefs[i].second)) { unsigned Level = --UpRefs[i].first; // Decrement level of upreference - UR_OUT(" Uplevel Ref Level = " << Level << endl); + UR_OUT(" Uplevel Ref Level = " << Level << "\n"); if (Level == 0) { // Upreference should be resolved! UR_OUT(" * Resolving upreference for " - << UpRefs[i].second->getDescription() << endl; + << UpRefs[i].second->getDescription() << "\n"; std::string OldName = UpRefs[i].second->getDescription()); UpRefs[i].second->refineAbstractTypeTo(Ty); - UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list... UR_OUT(" * Type '" << OldName << "' refined upreference to: " - << (const void*)Ty << ", " << Ty->getDescription() << endl); - continue; + << (const void*)Ty << ", " << Ty->getDescription() << "\n"); + UpRefs.erase(UpRefs.begin()+i); // Remove from upreference list... + --i; // Do not skip the next element... } } - - ++i; // Otherwise, no resolve, move on... } - // FIXME: TODO: this should return the updated type + return Ty; } @@ -893,7 +898,7 @@ UpRTypesV : UpRTypes | VOID { $$ = new PATypeHolder($1); }; Types : UpRTypes { - if (UpRefs.size()) + if (!UpRefs.empty()) ThrowException("Invalid upreference in type: " + (*$1)->getDescription()); $$ = $1; }; @@ -916,7 +921,7 @@ // Include derived types in the Types production. // UpRTypes : '\\' EUINT64VAL { // Type UpReference - if ($2 > (uint64_t)INT64_MAX) ThrowException("Value out of range!"); + if ($2 > (uint64_t)~0U) ThrowException("Value out of range!"); OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder UpRefs.push_back(std::make_pair((unsigned)$2, OT)); // Add to vector... $$ = new PATypeHolder(OT); @@ -931,7 +936,7 @@ $$ = new PATypeHolder(HandleUpRefs(FunctionType::get(*$1,Params,isVarArg))); delete $3; // Delete the argument list - delete $1; // Delete the old type handle + delete $1; // Delete the return type handle } | '[' EUINT64VAL 'x' UpRTypes ']' { // Sized array type? $$ = new PATypeHolder(HandleUpRefs(ArrayType::get(*$4, (unsigned)$2))); From lattner at cs.uiuc.edu Tue Dec 30 20:51:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Dec 30 20:51:01 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Type.cpp Message-ID: <200312310250.UAA02279@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Type.cpp updated: 1.85 -> 1.86 --- Log message: Add comments --- Diffs of the changes: (+5 -2) Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.85 llvm/lib/VMCore/Type.cpp:1.86 --- llvm/lib/VMCore/Type.cpp:1.85 Tue Nov 25 15:28:00 2003 +++ llvm/lib/VMCore/Type.cpp Tue Dec 30 20:50:02 2003 @@ -585,7 +585,10 @@ return I; } - + /// finishRefinement - This method is called after we have updated an existing + /// type with its new components. We must now either merge the type away with + /// some other type or reinstall it in the map with it's new configuration. + /// The specified iterator tells us what the type USED to look like. void finishRefinement(iterator TyIt) { TypeClass *Ty = TyIt->second; @@ -594,7 +597,7 @@ Map.erase(TyIt); // Determine whether there is a cycle through the type graph which passes - // back through this type. Other cycles are ok, + // back through this type. Other cycles are ok though. bool HasTypeCycle = false; { std::set VisitedTypes; From lattner at cs.uiuc.edu Tue Dec 30 21:20:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Dec 30 21:20:01 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Type.cpp Message-ID: <200312310319.VAA26196@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Type.cpp updated: 1.86 -> 1.87 --- Log message: Fix PR198 --- Diffs of the changes: (+11 -8) Index: llvm/lib/VMCore/Type.cpp diff -u llvm/lib/VMCore/Type.cpp:1.86 llvm/lib/VMCore/Type.cpp:1.87 --- llvm/lib/VMCore/Type.cpp:1.86 Tue Dec 30 20:50:02 2003 +++ llvm/lib/VMCore/Type.cpp Tue Dec 30 21:19:37 2003 @@ -561,7 +561,7 @@ namespace llvm { template class TypeMap { - typedef std::map MapTy; + typedef std::map MapTy; MapTy Map; public: typedef typename MapTy::iterator iterator; @@ -569,7 +569,7 @@ inline TypeClass *get(const ValType &V) { iterator I = Map.find(V); - return I != Map.end() ? I->second : 0; + return I != Map.end() ? cast((Type*)I->second.get()) : 0; } inline void add(const ValType &V, TypeClass *T) { @@ -581,7 +581,7 @@ iterator I = Map.find(ValType::get(Ty)); if (I == Map.end()) print("ERROR!"); assert(I != Map.end() && "Didn't find type entry!"); - assert(I->second == Ty && "Type entry wrong?"); + assert(I->second.get() == (const Type*)Ty && "Type entry wrong?"); return I; } @@ -590,7 +590,10 @@ /// some other type or reinstall it in the map with it's new configuration. /// The specified iterator tells us what the type USED to look like. void finishRefinement(iterator TyIt) { - TypeClass *Ty = TyIt->second; + // Make a temporary type holder for the type so that it doesn't disappear on + // us when we erase the entry from the map. + PATypeHolder TyHolder = TyIt->second; + TypeClass *Ty = cast((Type*)TyHolder.get()); // The old record is now out-of-date, because one of the children has been // updated. Remove the obsolete entry from the map. @@ -625,7 +628,7 @@ // We already have this type in the table. Get rid of the newly refined // type. assert(Ty->isAbstract() && "Replacing a non-abstract type?"); - TypeClass *NewTy = I->second; + TypeClass *NewTy = cast((Type*)I->second.get()); // Refined to a different type altogether? Ty->refineAbstractTypeTo(NewTy); @@ -640,7 +643,7 @@ for (iterator I = Map.begin(), E = Map.end(); I != E; ++I) if (TypesEqual(Ty, I->second)) { assert(Ty->isAbstract() && "Replacing a non-abstract type?"); - TypeClass *NewTy = I->second; + TypeClass *NewTy = cast((Type*)I->second.get()); // Refined to a different type altogether? Ty->refineAbstractTypeTo(NewTy); @@ -680,8 +683,8 @@ unsigned i = 0; for (typename MapTy::const_iterator I = Map.begin(), E = Map.end(); I != E; ++I) - std::cerr << " " << (++i) << ". " << (void*)I->second << " " - << *I->second << "\n"; + std::cerr << " " << (++i) << ". " << (void*)I->second.get() << " " + << *I->second.get() << "\n"; #endif } From lattner at cs.uiuc.edu Tue Dec 30 21:25:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Dec 30 21:25:01 2003 Subject: [llvm-commits] CVS: llvm/test/Regression/Assembler/2003-12-30-TypeMapInvalidMemory.llx Message-ID: <200312310324.VAA26229@zion.cs.uiuc.edu> Changes in directory llvm/test/Regression/Assembler: 2003-12-30-TypeMapInvalidMemory.llx added (r1.1) --- Log message: testcase for PR198 --- Diffs of the changes: (+5 -0) Index: llvm/test/Regression/Assembler/2003-12-30-TypeMapInvalidMemory.llx diff -c /dev/null llvm/test/Regression/Assembler/2003-12-30-TypeMapInvalidMemory.llx:1.1 *** /dev/null Tue Dec 30 21:24:24 2003 --- llvm/test/Regression/Assembler/2003-12-30-TypeMapInvalidMemory.llx Tue Dec 30 21:24:14 2003 *************** *** 0 **** --- 1,5 ---- + ; RUN: llvm-as < %s 2>&1 | grep 'Reference to an invalid type' + + + %d_reduction_0_dparser_gram = global { int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)*, int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sby! te*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)** } { int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, ! int, int }*)* null, int (sbyte*, sbyte**, int, int, { %struct.Grammar* , void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)** null } + From lattner at cs.uiuc.edu Tue Dec 30 22:43:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Dec 30 22:43:02 2003 Subject: [llvm-commits] CVS: llvm/include/Support/Signals.h Message-ID: <200312310442.WAA26475@zion.cs.uiuc.edu> Changes in directory llvm/include/Support: Signals.h updated: 1.7 -> 1.8 --- Log message: doxygenify --- Diffs of the changes: (+4 -4) Index: llvm/include/Support/Signals.h diff -u llvm/include/Support/Signals.h:1.7 llvm/include/Support/Signals.h:1.8 --- llvm/include/Support/Signals.h:1.7 Tue Nov 11 16:41:29 2003 +++ llvm/include/Support/Signals.h Tue Dec 30 22:42:00 2003 @@ -19,10 +19,10 @@ namespace llvm { -// RemoveFileOnSignal - This function registers signal handlers to ensure that -// if a signal gets delivered that the named file is removed. -// -void RemoveFileOnSignal(const std::string &Filename); + /// RemoveFileOnSignal - This function registers signal handlers to ensure + /// that if a signal gets delivered that the named file is removed. + /// + void RemoveFileOnSignal(const std::string &Filename); } // End llvm namespace From lattner at cs.uiuc.edu Tue Dec 30 23:41:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Dec 30 23:41:01 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/SlowOperationInformer.cpp Message-ID: <200312310540.XAA26619@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: SlowOperationInformer.cpp added (r1.1) --- Log message: New class, useful for command-line interactive programs. --- Diffs of the changes: (+94 -0) Index: llvm/lib/Support/SlowOperationInformer.cpp diff -c /dev/null llvm/lib/Support/SlowOperationInformer.cpp:1.1 *** /dev/null Tue Dec 30 23:40:12 2003 --- llvm/lib/Support/SlowOperationInformer.cpp Tue Dec 30 23:40:02 2003 *************** *** 0 **** --- 1,94 ---- + //===-- SlowOperationInformer.cpp - Keep the user informed ----------------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the SlowOperationInformer class for the LLVM debugger. + // + //===----------------------------------------------------------------------===// + + #include "Support/SlowOperationInformer.h" + #include "Config/config.h" // Get the signal handler return type + #include + #include + #include + #include + using namespace llvm; + + /// OperationCancelled - This flag is set by the SIGINT signal handler if the + /// user presses CTRL-C. + static volatile bool OperationCancelled; + + /// ShouldShowStatus - This flag gets set if the operation takes a long time. + /// + static volatile bool ShouldShowStatus; + + /// NestedSOI - Sanity check. SlowOperationInformers cannot be nested or run in + /// parallel. This ensures that they never do. + static bool NestedSOI = false; + + static RETSIGTYPE SigIntHandler(int Sig) { + OperationCancelled = true; + signal(SIGINT, SigIntHandler); + } + + static RETSIGTYPE SigAlarmHandler(int Sig) { + ShouldShowStatus = true; + } + + static sighandler_t OldSigIntHandler; + + + SlowOperationInformer::SlowOperationInformer(const std::string &Name) + : OperationName(Name), LastPrintAmount(0) { + assert(!NestedSOI && "SlowerOperationInformer objects cannot be nested!"); + NestedSOI = true; + + OperationCancelled = 0; + ShouldShowStatus = 0; + + signal(SIGALRM, SigAlarmHandler); + OldSigIntHandler = signal(SIGINT, SigIntHandler); + alarm(1); + } + + SlowOperationInformer::~SlowOperationInformer() { + NestedSOI = false; + if (LastPrintAmount) + std::cout << "\n"; + + alarm(0); + signal(SIGALRM, SIG_DFL); + signal(SIGINT, OldSigIntHandler); + } + + /// progress - Clients should periodically call this method when they are in + /// an exception-safe state. The Amount variable should indicate how far + /// along the operation is, given in 1/10ths of a percent (in other words, + /// Amount should range from 0 to 1000). + void SlowOperationInformer::progress(unsigned Amount) { + if (OperationCancelled) { + std::cout << "\n"; + LastPrintAmount = 0; + throw "While " + OperationName + ", operation cancelled."; + } + + // If we haven't spent enough time in this operation to warrant displaying the + // progress bar, don't do so yet. + if (!ShouldShowStatus) + return; + + // Delete whatever we printed last time. + std::string ToPrint = std::string(LastPrintAmount, '\b'); + + std::ostringstream OS; + OS << "Progress " << OperationName << ": " << Amount/10 << "." << Amount % 10 + << "%"; + + LastPrintAmount = OS.str().size(); + std::cout << ToPrint+OS.str() << std::flush; + } From lattner at cs.uiuc.edu Tue Dec 30 23:41:10 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Dec 30 23:41:10 2003 Subject: [llvm-commits] CVS: llvm/include/Support/SlowOperationInformer.h Message-ID: <200312310540.XAA26618@zion.cs.uiuc.edu> Changes in directory llvm/include/Support: SlowOperationInformer.h added (r1.1) --- Log message: New class, useful for command-line interactive programs. --- Diffs of the changes: (+56 -0) Index: llvm/include/Support/SlowOperationInformer.h diff -c /dev/null llvm/include/Support/SlowOperationInformer.h:1.1 *** /dev/null Tue Dec 30 23:40:12 2003 --- llvm/include/Support/SlowOperationInformer.h Tue Dec 30 23:40:02 2003 *************** *** 0 **** --- 1,56 ---- + //===- SlowOperationInformer.h - Keep the user informed ---------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines a simple object which can be used to let the user know what + // is going on when a slow operation is happening,l and gives them the ability + // to cancel it. Potentially slow operations can stack allocate one of these + // objects, and periodically call the "progress" method to update the progress + // bar. If the operation takes more than 3 seconds to complete, the progress + // bar is automatically shown and updated every second. As such, the slow + // operation should not print stuff to the screen, and should not be confused if + // an extra line appears on the screen (ie, the cursor should be at the start of + // the line). + // + // If the user presses CTRL-C during the operation, the next invocation of the + // progress method with throw an std::string object indicating that the + // operation was cancelled. As such, client code must be exception safe around + // the progress method. + // + // Because SlowOperationInformers fiddle around with signals, they cannot be + // nested. The SIGINT signal handler is restored after the + // SlowOperationInformer is destroyed, but the SIGALRM handlers is set back to + // the default. + // + //===----------------------------------------------------------------------===// + + #ifndef SUPPORT_SLOW_OPERATION_INFORMER_H + #define SUPPORT_SLOW_OPERATION_INFORMER_H + + #include + + namespace llvm { + class SlowOperationInformer { + std::string OperationName; + unsigned LastPrintAmount; + + SlowOperationInformer(const SlowOperationInformer&); // DO NOT IMPLEMENT + void operator=(const SlowOperationInformer&); // DO NOT IMPLEMENT + public: + SlowOperationInformer(const std::string &Name); + ~SlowOperationInformer(); + + /// progress - Clients should periodically call this method when they are in + /// an exception-safe state. The Amount variable should indicate how far + /// along the operation is, given in 1/10ths of a percent (in other words, + /// Amount should range from 0 to 1000). + void progress(unsigned Amount); + }; + } // end namespace llvm + + #endif /* SLOW_OPERATION_INFORMER_H */ From lattner at cs.uiuc.edu Tue Dec 30 23:46:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Tue Dec 30 23:46:01 2003 Subject: [llvm-commits] CVS: llvm/include/Support/SlowOperationInformer.h Message-ID: <200312310545.XAA26690@zion.cs.uiuc.edu> Changes in directory llvm/include/Support: SlowOperationInformer.h updated: 1.1 -> 1.2 --- Log message: clarify comments --- Diffs of the changes: (+9 -10) Index: llvm/include/Support/SlowOperationInformer.h diff -u llvm/include/Support/SlowOperationInformer.h:1.1 llvm/include/Support/SlowOperationInformer.h:1.2 --- llvm/include/Support/SlowOperationInformer.h:1.1 Tue Dec 30 23:40:02 2003 +++ llvm/include/Support/SlowOperationInformer.h Tue Dec 30 23:45:16 2003 @@ -8,14 +8,13 @@ //===----------------------------------------------------------------------===// // // This file defines a simple object which can be used to let the user know what -// is going on when a slow operation is happening,l and gives them the ability -// to cancel it. Potentially slow operations can stack allocate one of these +// is going on when a slow operation is happening, and gives them the ability to +// cancel it. Potentially slow operations can stack allocate one of these // objects, and periodically call the "progress" method to update the progress -// bar. If the operation takes more than 3 seconds to complete, the progress -// bar is automatically shown and updated every second. As such, the slow -// operation should not print stuff to the screen, and should not be confused if -// an extra line appears on the screen (ie, the cursor should be at the start of -// the line). +// bar. If the operation takes more than 1 second to complete, the progress bar +// is automatically shown and updated. As such, the slow operation should not +// print stuff to the screen, and should not be confused if an extra line +// appears on the screen (ie, the cursor should be at the start of the line). // // If the user presses CTRL-C during the operation, the next invocation of the // progress method with throw an std::string object indicating that the @@ -23,9 +22,9 @@ // the progress method. // // Because SlowOperationInformers fiddle around with signals, they cannot be -// nested. The SIGINT signal handler is restored after the -// SlowOperationInformer is destroyed, but the SIGALRM handlers is set back to -// the default. +// nested, and interact poorly with threads. The SIGALRM handler is set back to +// SIGDFL, but the SIGINT signal handler is restored when the +// SlowOperationInformer is destroyed. // //===----------------------------------------------------------------------===// From lattner at cs.uiuc.edu Wed Dec 31 00:16:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Dec 31 00:16:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/FileUtilities.cpp Message-ID: <200312310615.AAA26827@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: FileUtilities.cpp updated: 1.18 -> 1.19 --- Log message: Add new function --- Diffs of the changes: (+13 -0) Index: llvm/lib/Support/FileUtilities.cpp diff -u llvm/lib/Support/FileUtilities.cpp:1.18 llvm/lib/Support/FileUtilities.cpp:1.19 --- llvm/lib/Support/FileUtilities.cpp:1.18 Tue Dec 30 01:36:14 2003 +++ llvm/lib/Support/FileUtilities.cpp Wed Dec 31 00:15:37 2003 @@ -204,6 +204,19 @@ return StatBuf.st_size; } +/// getFileTimestamp - Get the last modified time for the specified file in an +/// unspecified format. This is useful to allow checking to see if a file was +/// updated since that last time the timestampt was aquired. If the file does +/// not exist or there is an error getting the time-stamp, zero is returned. +unsigned long long llvm::getFileTimestamp(const std::string &Filename) { + struct stat StatBuf; + if (stat(Filename.c_str(), &StatBuf) == -1) + return 0; + return StatBuf.st_mtime; +} + + + //===----------------------------------------------------------------------===// // FDHandle class implementation From lattner at cs.uiuc.edu Wed Dec 31 00:17:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Dec 31 00:17:02 2003 Subject: [llvm-commits] CVS: llvm/include/Support/FileUtilities.h Message-ID: <200312310616.AAA26878@zion.cs.uiuc.edu> Changes in directory llvm/include/Support: FileUtilities.h updated: 1.13 -> 1.14 --- Log message: add new function --- Diffs of the changes: (+6 -0) Index: llvm/include/Support/FileUtilities.h diff -u llvm/include/Support/FileUtilities.h:1.13 llvm/include/Support/FileUtilities.h:1.14 --- llvm/include/Support/FileUtilities.h:1.13 Tue Dec 30 01:35:47 2003 +++ llvm/include/Support/FileUtilities.h Wed Dec 31 00:16:02 2003 @@ -87,6 +87,12 @@ long long getFileSize(const std::string &Filename); +/// getFileTimestamp - Get the last modified time for the specified file in an +/// unspecified format. This is useful to allow checking to see if a file was +/// updated since that last time the timestampt was aquired. If the file does +/// not exist or there is an error getting the time-stamp, zero is returned. +unsigned long long getFileTimestamp(const std::string &Filename); + /// FDHandle - Simple handle class to make sure a file descriptor gets closed /// when the object is destroyed. This handle acts similarly to an From lattner at cs.uiuc.edu Wed Dec 31 00:48:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Dec 31 00:48:01 2003 Subject: [llvm-commits] CVS: llvm/docs/doxygen.css doxygen.footer doxygen.header doxygen.intro doxygen.cfg Message-ID: <200312310647.AAA27317@zion.cs.uiuc.edu> Changes in directory llvm/docs: doxygen.css added (r1.1) doxygen.footer added (r1.1) doxygen.header added (r1.1) doxygen.intro added (r1.1) doxygen.cfg updated: 1.6 -> 1.7 --- Log message: Add a bunch of fine tunings that Reid contributed. Thanks Reid! --- Diffs of the changes: (+132 -5) Index: llvm/docs/doxygen.css diff -c /dev/null llvm/docs/doxygen.css:1.1 *** /dev/null Wed Dec 31 00:47:38 2003 --- llvm/docs/doxygen.css Wed Dec 31 00:47:28 2003 *************** *** 0 **** --- 1,84 ---- + BODY { background: white; color: black; font-family: Verdana,Arial,sans-serif; } + H1 { text-align: center; } + H2 { text-align: center; } + H3 { text-align: center; } + CAPTION { font-weight: bold } + A.qindex {} + A.qindexRef {} + A.el { text-decoration: none; font-weight: bold } + A.elRef { font-weight: bold } + A.code { text-decoration: none; font-weight: normal; color: #4444ee } + A.codeRef { font-weight: normal; color: #4444ee } + A:link { + cursor: pointer; + text-decoration: none; + font-weight: bolder; + } + A:visited { + cursor: pointer; + text-decoration: underline; + font-weight: bolder; + } + A:hover { + cursor: pointer; + text-decoration: underline; + font-weight: bolder; + } + A:active { + cursor: pointer; + text-decoration: underline; + font-weight: bolder; + font-style: italic; + } + DL.el { margin-left: -1cm } + DIV.fragment { width: 100%; border: none; background-color: #eeeeee } + DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } + TD.md { background-color: #f2f2ff; font-weight: bold; } + TD.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; } + TD.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; } + DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold } + DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller } + TD.indexkey { + background-color: #eeeeff; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px + } + TD.indexvalue { + background-color: #eeeeff; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px + } + span.keyword { color: #008000 } + span.keywordtype { color: #604020 } + span.keywordflow { color: #e08000 } + span.comment { color: #800000 } + span.preprocessor { color: #806020 } + span.stringliteral { color: #002080 } + span.charliteral { color: #008080 } + + .footer { + font-size: 80%; + font-weight: bold; + text-align: center; + vertical-align: middle; + } + .title { + font-size: 105% + font-weight: bold; + text-decoration: underline; + text-align: center; + } Index: llvm/docs/doxygen.footer diff -c /dev/null llvm/docs/doxygen.footer:1.1 *** /dev/null Wed Dec 31 00:47:38 2003 --- llvm/docs/doxygen.footer Wed Dec 31 00:47:28 2003 *************** *** 0 **** --- 1,9 ---- +
+ Index: llvm/docs/doxygen.header diff -c /dev/null llvm/docs/doxygen.header:1.1 *** /dev/null Wed Dec 31 00:47:38 2003 --- llvm/docs/doxygen.header Wed Dec 31 00:47:28 2003 *************** *** 0 **** --- 1,9 ---- + + + + + + LLVM: $title + + +

LLVM API Documentation

Index: llvm/docs/doxygen.intro diff -c /dev/null llvm/docs/doxygen.intro:1.1 *** /dev/null Wed Dec 31 00:47:38 2003 --- llvm/docs/doxygen.intro Wed Dec 31 00:47:28 2003 *************** *** 0 **** --- 1,25 ---- + //////////////////////////////////////////////////////////////////////////////// + /// @file doxygen.intro + /// @author Reid Spencer + /// @date 2003/12/30 + /// @brief LLVM API documentation introduction. + //////////////////////////////////////////////////////////////////////////////// + /// + /// @mainpage LLVM:Low Level Virtual Machine + /// + /// @section main_intro Introduction + /// Welcome to the Low Level Virtual Machine (LLVM) + /// + /// This documentation describes the @b internal software that makes + /// up LLVM, not the @b external use of LLVM. There are no instructions + /// here on how to use LLVM, only the APIs that make up the software. For usage + /// instructions, please see the programmer's guide or reference manual. + /// + /// @section main_caveat Caveat + /// This documentation is generated directly from the source code with doxygen. + /// Since LLVM is constantly under active development, what you're about to + /// read is out of date! However, it may still be useful since certain portions of + /// LLVM are very stable. + /// + /// @section main_changelog Change Log + /// - Original content written 12/30/2003 by Reid Spencer Index: llvm/docs/doxygen.cfg diff -u llvm/docs/doxygen.cfg:1.6 llvm/docs/doxygen.cfg:1.7 --- llvm/docs/doxygen.cfg:1.6 Fri Oct 17 18:00:03 2003 +++ llvm/docs/doxygen.cfg Wed Dec 31 00:47:28 2003 @@ -201,7 +201,7 @@ # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. -TAB_SIZE = 8 +TAB_SIZE = 2 # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo @@ -301,7 +301,7 @@ # directories like "/usr/src/myproject". Separate the files or directories with # spaces. -INPUT = .. +INPUT = .. ./doxygen.intro # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp @@ -439,20 +439,20 @@ # each generated HTML page. If it is left blank doxygen will generate a # standard header. -HTML_HEADER = +HTML_HEADER = doxygen.header # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. -HTML_FOOTER = +HTML_FOOTER = doxygen.footer # The HTML_STYLESHEET tag can be used to specify a user defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet -HTML_STYLESHEET = +HTML_STYLESHEET = doxygen.css # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to From lattner at cs.uiuc.edu Wed Dec 31 01:09:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Dec 31 01:09:02 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/SymbolTable.cpp Message-ID: <200312310708.BAA27502@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: SymbolTable.cpp updated: 1.41 -> 1.42 --- Log message: Make the lookup method const. --- Diffs of the changes: (+3 -3) Index: llvm/lib/VMCore/SymbolTable.cpp diff -u llvm/lib/VMCore/SymbolTable.cpp:1.41 llvm/lib/VMCore/SymbolTable.cpp:1.42 --- llvm/lib/VMCore/SymbolTable.cpp:1.41 Fri Nov 21 14:23:48 2003 +++ llvm/lib/VMCore/SymbolTable.cpp Wed Dec 31 01:08:19 2003 @@ -72,10 +72,10 @@ // lookup - Returns null on failure... -Value *SymbolTable::lookup(const Type *Ty, const std::string &Name) { - iterator I = find(Ty); +Value *SymbolTable::lookup(const Type *Ty, const std::string &Name) const { + const_iterator I = find(Ty); if (I != end()) { // We have symbols in that plane... - type_iterator J = I->second.find(Name); + type_const_iterator J = I->second.find(Name); if (J != I->second.end()) // and the name is in our hash table... return J->second; } From lattner at cs.uiuc.edu Wed Dec 31 01:09:16 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Dec 31 01:09:16 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/SymbolTable.h Message-ID: <200312310708.BAA27499@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: SymbolTable.h updated: 1.29 -> 1.30 --- Log message: Make the lookup method const. --- Diffs of the changes: (+1 -1) Index: llvm/include/llvm/SymbolTable.h diff -u llvm/include/llvm/SymbolTable.h:1.29 llvm/include/llvm/SymbolTable.h:1.30 --- llvm/include/llvm/SymbolTable.h:1.29 Tue Nov 11 16:41:30 2003 +++ llvm/include/llvm/SymbolTable.h Wed Dec 31 01:08:19 2003 @@ -42,7 +42,7 @@ ~SymbolTable(); // lookup - Returns null on failure... - Value *lookup(const Type *Ty, const std::string &name); + Value *lookup(const Type *Ty, const std::string &name) const; // insert - Add named definition to the symbol table... inline void insert(Value *N) { From lattner at cs.uiuc.edu Wed Dec 31 01:10:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Dec 31 01:10:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Module.h Message-ID: <200312310709.BAA27566@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Module.h updated: 1.38 -> 1.39 --- Log message: * Make Module::getTypeName const * Add new Module::getTypeByName method * Group methods in Module.cpp better --- Diffs of the changes: (+5 -1) Index: llvm/include/llvm/Module.h diff -u llvm/include/llvm/Module.h:1.38 llvm/include/llvm/Module.h:1.39 --- llvm/include/llvm/Module.h:1.38 Tue Nov 11 16:41:30 2003 +++ llvm/include/llvm/Module.h Wed Dec 31 01:09:33 2003 @@ -132,7 +132,11 @@ /// getTypeName - If there is at least one entry in the symbol table for the /// specified type, return it. /// - std::string getTypeName(const Type *Ty); + std::string getTypeName(const Type *Ty) const; + + /// getTypeByName - Return the type with the specified name in this module, or + /// null if there is none by that name. + const Type *getTypeByName(const std::string &Name) const; /// Get the underlying elements of the Module... inline const GlobalListType &getGlobalList() const { return GlobalList; } From lattner at cs.uiuc.edu Wed Dec 31 01:10:09 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Dec 31 01:10:09 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Module.cpp Message-ID: <200312310709.BAA27565@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Module.cpp updated: 1.45 -> 1.46 --- Log message: * Make Module::getTypeName const * Add new Module::getTypeByName method * Group methods in Module.cpp better --- Diffs of the changes: (+23 -16) Index: llvm/lib/VMCore/Module.cpp diff -u llvm/lib/VMCore/Module.cpp:1.45 llvm/lib/VMCore/Module.cpp:1.46 --- llvm/lib/VMCore/Module.cpp:1.45 Fri Nov 21 14:23:48 2003 +++ llvm/lib/VMCore/Module.cpp Wed Dec 31 01:09:33 2003 @@ -137,21 +137,6 @@ return cast_or_null(SymTab.lookup(PointerType::get(Ty), Name)); } -// addTypeName - Insert an entry in the symbol table mapping Str to Type. If -// there is already an entry for this name, true is returned and the symbol -// table is not modified. -// -bool Module::addTypeName(const std::string &Name, const Type *Ty) { - SymbolTable &ST = getSymbolTable(); - - if (ST.lookup(Type::TypeTy, Name)) return true; // Already in symtab... - - // Not in symbol table? Set the name with the Symtab as an argument so the - // type knows what to update... - ((Value*)Ty)->setName(Name, &ST); - - return false; -} /// getMainFunction - This function looks up main efficiently. This is such a /// common case, that it is a method in Module. If main cannot be found, a @@ -217,11 +202,33 @@ } +// addTypeName - Insert an entry in the symbol table mapping Str to Type. If +// there is already an entry for this name, true is returned and the symbol +// table is not modified. +// +bool Module::addTypeName(const std::string &Name, const Type *Ty) { + SymbolTable &ST = getSymbolTable(); + + if (ST.lookup(Type::TypeTy, Name)) return true; // Already in symtab... + + // Not in symbol table? Set the name with the Symtab as an argument so the + // type knows what to update... + ((Value*)Ty)->setName(Name, &ST); + + return false; +} + +/// getTypeByName - Return the type with the specified name in this module, or +/// null if there is none by that name. +const Type *Module::getTypeByName(const std::string &Name) const { + const SymbolTable &ST = getSymbolTable(); + return cast_or_null(ST.lookup(Type::TypeTy, Name)); +} // getTypeName - If there is at least one entry in the symbol table for the // specified type, return it. // -std::string Module::getTypeName(const Type *Ty) { +std::string Module::getTypeName(const Type *Ty) const { const SymbolTable &ST = getSymbolTable(); if (ST.find(Type::TypeTy) == ST.end()) return ""; // No names for types... From lattner at cs.uiuc.edu Wed Dec 31 01:32:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Dec 31 01:32:02 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/SlowOperationInformer.cpp Message-ID: <200312310731.BAA27649@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: SlowOperationInformer.cpp updated: 1.1 -> 1.2 --- Log message: Add missing #include --- Diffs of the changes: (+1 -0) Index: llvm/lib/Support/SlowOperationInformer.cpp diff -u llvm/lib/Support/SlowOperationInformer.cpp:1.1 llvm/lib/Support/SlowOperationInformer.cpp:1.2 --- llvm/lib/Support/SlowOperationInformer.cpp:1.1 Tue Dec 30 23:40:02 2003 +++ llvm/lib/Support/SlowOperationInformer.cpp Wed Dec 31 01:31:10 2003 @@ -17,6 +17,7 @@ #include #include #include +#include using namespace llvm; /// OperationCancelled - This flag is set by the SIGINT signal handler if the From lattner at cs.uiuc.edu Wed Dec 31 02:43:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Dec 31 02:43:01 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/Module.h Message-ID: <200312310842.CAA02779@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Module.h updated: 1.39 -> 1.40 --- Log message: Add some comments, add a new getGlobalVariable method --- Diffs of the changes: (+28 -4) Index: llvm/include/llvm/Module.h diff -u llvm/include/llvm/Module.h:1.39 llvm/include/llvm/Module.h:1.40 --- llvm/include/llvm/Module.h:1.39 Wed Dec 31 01:09:33 2003 +++ llvm/include/llvm/Module.h Wed Dec 31 02:42:27 2003 @@ -95,6 +95,10 @@ PointerSize getPointerSize() const { return PtrSize; } void setPointerSize(PointerSize PS) { PtrSize = PS; } + //===--------------------------------------------------------------------===// + // Methods for easy access to the functions in the module. + // + /// getOrInsertFunction - Look up the specified function in the module symbol /// table. If it does not exist, add a prototype for the function and return /// it. @@ -123,6 +127,24 @@ /// Function *getNamedFunction(const std::string &Name); + //===--------------------------------------------------------------------===// + // Methods for easy access to the global variables in the module. + // + + /// getGlobalVariable - Look up the specified global variable in the module + /// symbol table. If it does not exist, return null. Note that this only + /// returns a global variable if it does not have internal linkage. The type + /// argument should be the underlying type of the global, ie, it should not + /// have the top-level PointerType, which represents the address of the + /// global. + /// + GlobalVariable *getGlobalVariable(const std::string &Name, const Type *Ty); + + + //===--------------------------------------------------------------------===// + // Methods for easy access to the types in the module. + // + /// addTypeName - Insert an entry in the symbol table mapping Str to Type. If /// there is already an entry for this name, true is returned and the symbol /// table is not modified. @@ -138,16 +160,18 @@ /// null if there is none by that name. const Type *getTypeByName(const std::string &Name) const; + + //===--------------------------------------------------------------------===// + // Methods for direct access to the globals list, functions list, and symbol + // table. + // + /// Get the underlying elements of the Module... inline const GlobalListType &getGlobalList() const { return GlobalList; } inline GlobalListType &getGlobalList() { return GlobalList; } inline const FunctionListType &getFunctionList() const { return FunctionList;} inline FunctionListType &getFunctionList() { return FunctionList;} - - //===--------------------------------------------------------------------===// - // Symbol table support functions... - /// getSymbolTable() - Get access to the symbol table for the module, where /// global variables and functions are identified. /// From lattner at cs.uiuc.edu Wed Dec 31 02:44:00 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Dec 31 02:44:00 2003 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Module.cpp Message-ID: <200312310843.CAA02830@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Module.cpp updated: 1.46 -> 1.47 --- Log message: Add some comments, add new getGlobalVariable method --- Diffs of the changes: (+43 -1) Index: llvm/lib/VMCore/Module.cpp diff -u llvm/lib/VMCore/Module.cpp:1.46 llvm/lib/VMCore/Module.cpp:1.47 --- llvm/lib/VMCore/Module.cpp:1.46 Wed Dec 31 01:09:33 2003 +++ llvm/lib/VMCore/Module.cpp Wed Dec 31 02:43:01 2003 @@ -23,6 +23,10 @@ #include using namespace llvm; +//===----------------------------------------------------------------------===// +// Stuff to implement the globals and functions lists. +// + Function *ilist_traits::createNode() { FunctionType *FTy = FunctionType::get(Type::VoidTy, std::vector(), false); @@ -62,6 +66,9 @@ }; } +//===----------------------------------------------------------------------===// +// Primitive Module methods. +// Module::Module(const std::string &MID) : ModuleID(MID), Endian(AnyEndianness), PtrSize(AnyPointerSize) { @@ -87,6 +94,10 @@ print(std::cerr); } +//===----------------------------------------------------------------------===// +// Methods for easy access to the functions in the module. +// + // getOrInsertFunction - Look up the specified function in the module symbol // table. If it does not exist, add a prototype for the function and return // it. This is nice because it allows most passes to get away with not handling @@ -128,7 +139,6 @@ } - // getFunction - Look up the specified function in the module symbol table. // If it does not exist, return null. // @@ -201,6 +211,33 @@ return Found; // Non-external function not found... } +//===----------------------------------------------------------------------===// +// Methods for easy access to the global variables in the module. +// + +/// getGlobalVariable - Look up the specified global variable in the module +/// symbol table. If it does not exist, return null. Note that this only +/// returns a global variable if it does not have internal linkage. The type +/// argument should be the underlying type of the global, ie, it should not +/// have the top-level PointerType, which represents the address of the +/// global. +/// +GlobalVariable *Module::getGlobalVariable(const std::string &Name, + const Type *Ty) { + if (Value *V = getSymbolTable().lookup(PointerType::get(Ty), Name)) { + GlobalVariable *Result = cast(V); + if (!Result->hasInternalLinkage()) + return Result; + } + return 0; +} + + + +//===----------------------------------------------------------------------===// +// Methods for easy access to the types in the module. +// + // addTypeName - Insert an entry in the symbol table mapping Str to Type. If // there is already an entry for this name, true is returned and the symbol @@ -243,6 +280,11 @@ return TI->first; return ""; // Must not have found anything... } + + +//===----------------------------------------------------------------------===// +// Other module related stuff. +// // dropAllReferences() - This function causes all the subelementss to "let go" From lattner at cs.uiuc.edu Wed Dec 31 04:21:01 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Dec 31 04:21:01 2003 Subject: [llvm-commits] CVS: llvm/include/Support/SlowOperationInformer.h Message-ID: <200312311020.EAA10109@zion.cs.uiuc.edu> Changes in directory llvm/include/Support: SlowOperationInformer.h updated: 1.2 -> 1.3 --- Log message: * Add a new helper progress method * Make sure that the user sees the 100% mark * Don't bother printing out X.0%, just print out X% --- Diffs of the changes: (+10 -0) Index: llvm/include/Support/SlowOperationInformer.h diff -u llvm/include/Support/SlowOperationInformer.h:1.2 llvm/include/Support/SlowOperationInformer.h:1.3 --- llvm/include/Support/SlowOperationInformer.h:1.2 Tue Dec 30 23:45:16 2003 +++ llvm/include/Support/SlowOperationInformer.h Wed Dec 31 04:20:37 2003 @@ -32,6 +32,7 @@ #define SUPPORT_SLOW_OPERATION_INFORMER_H #include +#include namespace llvm { class SlowOperationInformer { @@ -49,6 +50,15 @@ /// along the operation is, given in 1/10ths of a percent (in other words, /// Amount should range from 0 to 1000). void progress(unsigned Amount); + + /// progress - Same as the method above, but this performs the division for + /// you, and helps you avoid overflow if you are dealing with largish + /// numbers. + void progress(unsigned Current, unsigned Maximum) { + assert(Maximum != 0 && + "Shouldn't be doing work if there is nothing to do!"); + progress(Current*1000ULL/Maximum); + } }; } // end namespace llvm From lattner at cs.uiuc.edu Wed Dec 31 04:21:12 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Dec 31 04:21:12 2003 Subject: [llvm-commits] CVS: llvm/lib/Support/SlowOperationInformer.cpp Message-ID: <200312311020.EAA10110@zion.cs.uiuc.edu> Changes in directory llvm/lib/Support: SlowOperationInformer.cpp updated: 1.2 -> 1.3 --- Log message: * Add a new helper progress method * Make sure that the user sees the 100% mark * Don't bother printing out X.0%, just print out X% --- Diffs of the changes: (+11 -4) Index: llvm/lib/Support/SlowOperationInformer.cpp diff -u llvm/lib/Support/SlowOperationInformer.cpp:1.2 llvm/lib/Support/SlowOperationInformer.cpp:1.3 --- llvm/lib/Support/SlowOperationInformer.cpp:1.2 Wed Dec 31 01:31:10 2003 +++ llvm/lib/Support/SlowOperationInformer.cpp Wed Dec 31 04:20:38 2003 @@ -59,8 +59,12 @@ SlowOperationInformer::~SlowOperationInformer() { NestedSOI = false; - if (LastPrintAmount) - std::cout << "\n"; + if (LastPrintAmount) { + // If we have printed something, make _sure_ we print the 100% amount, and + // also print a newline. + std::cout << std::string(LastPrintAmount, '\b') << "Progress " + << OperationName << ": 100% \n"; + } alarm(0); signal(SIGALRM, SIG_DFL); @@ -87,8 +91,11 @@ std::string ToPrint = std::string(LastPrintAmount, '\b'); std::ostringstream OS; - OS << "Progress " << OperationName << ": " << Amount/10 << "." << Amount % 10 - << "%"; + OS << "Progress " << OperationName << ": " << Amount/10; + if (unsigned Rem = Amount % 10) + OS << "." << Rem << "%"; + else + OS << "% "; LastPrintAmount = OS.str().size(); std::cout << ToPrint+OS.str() << std::flush; From lattner at cs.uiuc.edu Wed Dec 31 14:20:02 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Dec 31 14:20:02 2003 Subject: [llvm-commits] CVS: llvm/include/llvm/ExecutionEngine/ExecutionEngine.h Message-ID: <200312312019.OAA19122@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/ExecutionEngine: ExecutionEngine.h updated: 1.25 -> 1.26 --- Log message: Add new ExecutionEngine::getGlobalValueAtAddress method, which can efficiently turn a memory address back into the LLVM global object that starts at that address. Note that this won't cause any additional datastructures to be built for clients of the EE that don't need this information. --- Diffs of the changes: (+25 -6) Index: llvm/include/llvm/ExecutionEngine/ExecutionEngine.h diff -u llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.25 llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.26 --- llvm/include/llvm/ExecutionEngine/ExecutionEngine.h:1.25 Sun Dec 28 03:48:17 2003 +++ llvm/include/llvm/ExecutionEngine/ExecutionEngine.h Wed Dec 31 14:19:31 2003 @@ -36,9 +36,15 @@ Module &CurMod; const TargetData *TD; - // GlobalAddress - A mapping between LLVM global values and their actualized - // version... - std::map GlobalAddress; + /// GlobalAddressMap - A mapping between LLVM global values and their + /// actualized version... + std::map GlobalAddressMap; + + /// GlobalAddressReverseMap - This is the reverse mapping of GlobalAddressMap, + /// used to convert raw addresses into the LLVM global value that is emitted + /// at the address. This map is not computed unless getGlobalValueAtAddress + /// is called at some point. + std::map GlobalAddressReverseMap; protected: ModuleProvider *MP; @@ -74,17 +80,24 @@ void addGlobalMapping(const GlobalValue *GV, void *Addr) { - void *&CurVal = GlobalAddress[GV]; + void *&CurVal = GlobalAddressMap[GV]; assert((CurVal == 0 || Addr == 0) && "GlobalMapping already established!"); CurVal = Addr; + + // If we are using the reverse mapping, add it too + if (!GlobalAddressReverseMap.empty()) { + const GlobalValue *&V = GlobalAddressReverseMap[Addr]; + assert((V == 0 || GV == 0) && "GlobalMapping already established!"); + V = GV; + } } /// getPointerToGlobalIfAvailable - This returns the address of the specified /// global value if it is available, otherwise it returns null. /// void *getPointerToGlobalIfAvailable(const GlobalValue *GV) { - std::map::iterator I = GlobalAddress.find(GV); - return I != GlobalAddress.end() ? I->second : 0; + std::map::iterator I = GlobalAddressMap.find(GV); + return I != GlobalAddressMap.end() ? I->second : 0; } /// getPointerToGlobal - This returns the address of the specified global @@ -106,6 +119,12 @@ // Default implementation, just codegen the function. return getPointerToFunction(F); } + + /// getGlobalValueAtAddress - Return the LLVM global value object that starts + /// at the specified address. + /// + const GlobalValue *getGlobalValueAtAddress(void *Addr); + void StoreValueToMemory(GenericValue Val, GenericValue *Ptr, const Type *Ty); void InitializeMemory(const Constant *Init, void *Addr); From lattner at cs.uiuc.edu Wed Dec 31 14:22:03 2003 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Wed Dec 31 14:22:03 2003 Subject: [llvm-commits] CVS: llvm/lib/ExecutionEngine/ExecutionEngine.cpp Message-ID: <200312312021.OAA19241@zion.cs.uiuc.edu> Changes in directory llvm/lib/ExecutionEngine: ExecutionEngine.cpp updated: 1.44 -> 1.45 --- Log message: Add new ExecutionEngine::getGlobalValueAtAddress method, which can efficiently turn a memory address back into the LLVM global object that starts at that address. Note that this won't cause any additional datastructures to be built for clients of the EE that don't need this information. Also modified some code to not access the GlobalAddress map directly. --- Diffs of the changes: (+21 -5) Index: llvm/lib/ExecutionEngine/ExecutionEngine.cpp diff -u llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.44 llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.45 --- llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.44 Sun Dec 28 03:44:36 2003 +++ llvm/lib/ExecutionEngine/ExecutionEngine.cpp Wed Dec 31 14:21:04 2003 @@ -47,6 +47,21 @@ delete MP; } +/// getGlobalValueAtAddress - Return the LLVM global value object that starts +/// at the specified address. +/// +const GlobalValue *ExecutionEngine::getGlobalValueAtAddress(void *Addr) { + // If we haven't computed the reverse mapping yet, do so first. + if (GlobalAddressReverseMap.empty()) { + for (std::map::iterator I = + GlobalAddressMap.begin(), E = GlobalAddressMap.end(); I != E; ++I) + GlobalAddressReverseMap.insert(std::make_pair(I->second, I->first)); + } + + std::map::iterator I = + GlobalAddressReverseMap.find(Addr); + return I != GlobalAddressReverseMap.end() ? I->second : 0; +} // CreateArgv - Turn a vector of strings into a nice argv style array of // pointers to null terminated strings. @@ -133,8 +148,8 @@ if (Function *F = const_cast(dyn_cast(GV))) return getPointerToFunction(F); - assert(GlobalAddress[GV] && "Global hasn't had an address allocated yet?"); - return GlobalAddress[GV]; + assert(GlobalAddressMap[GV] && "Global hasn't had an address allocated yet?"); + return GlobalAddressMap[GV]; } /// FIXME: document @@ -435,12 +450,12 @@ addGlobalMapping(I, new char[Size]); DEBUG(std::cerr << "Global '" << I->getName() << "' -> " - << (void*)GlobalAddress[I] << "\n"); + << getPointerToGlobal(I) << "\n"); } else { // External variable reference. Try to use the dynamic loader to // get a pointer to it. if (void *SymAddr = GetAddressOfSymbol(I->getName().c_str())) - GlobalAddress[I] = SymAddr; + addGlobalMapping(I, SymAddr); else { std::cerr << "Could not resolve external global address: " << I->getName() << "\n"; @@ -460,11 +475,12 @@ // address specified in GlobalAddresses, or allocates new memory if it's not // already in the map. void ExecutionEngine::EmitGlobalVariable(const GlobalVariable *GV) { - void *&GA = GlobalAddress[GV]; + void *GA = getPointerToGlobalIfAvailable(GV); const Type *ElTy = GV->getType()->getElementType(); if (GA == 0) { // If it's not already specified, allocate memory for the global. GA = new char[getTargetData().getTypeSize(ElTy)]; + addGlobalMapping(GV, GA); } InitializeMemory(GV->getInitializer(), GA); From criswell at cs.uiuc.edu Thu Jan 1 09:15:02 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu Jan 1 09:15:02 2004 Subject: [llvm-commits] CVS: llvm/lib/Support/SlowOperationInformer.cpp Message-ID: <200401011514.JAA08984@choi.cs.uiuc.edu> Changes in directory llvm/lib/Support: SlowOperationInformer.cpp updated: 1.3 -> 1.4 --- Log message: Not all platforms supports sighandler_t, so I changed it to use the older return value from signal() (which should be the same type; it's just not typedef'd). This fixes the build on Solaris. --- Diffs of the changes: (+1 -1) Index: llvm/lib/Support/SlowOperationInformer.cpp diff -u llvm/lib/Support/SlowOperationInformer.cpp:1.3 llvm/lib/Support/SlowOperationInformer.cpp:1.4 --- llvm/lib/Support/SlowOperationInformer.cpp:1.3 Wed Dec 31 04:20:38 2003 +++ llvm/lib/Support/SlowOperationInformer.cpp Thu Jan 1 09:14:28 2004 @@ -41,7 +41,7 @@ ShouldShowStatus = true; } -static sighandler_t OldSigIntHandler; +static void (*OldSigIntHandler) (int); SlowOperationInformer::SlowOperationInformer(const std::string &Name) From criswell at cs.uiuc.edu Thu Jan 1 09:33:01 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu Jan 1 09:33:01 2004 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Applications/d/ Message-ID: <200401011532.JAA12194@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Applications/d: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/test/Programs/MultiSource/Applications/d added to the repository --- Diffs of the changes: (+0 -0) From criswell at cs.uiuc.edu Thu Jan 1 10:46:01 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu Jan 1 10:46:01 2004 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Applications/d/tests/ Message-ID: <200401011645.KAA14820@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Applications/d/tests: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/test/Programs/MultiSource/Applications/d/tests added to the repository --- Diffs of the changes: (+0 -0) From criswell at cs.uiuc.edu Thu Jan 1 10:48:01 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu Jan 1 10:48:01 2004 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Applications/d/verilog/ Message-ID: <200401011647.KAA14856@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Applications/d/verilog: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/test/Programs/MultiSource/Applications/d/verilog added to the repository --- Diffs of the changes: (+0 -0) From criswell at cs.uiuc.edu Thu Jan 1 10:51:02 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu Jan 1 10:51:02 2004 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Applications/d/CHANGES COPYRIGHT Makefile README UPGRADING arg.c arg.h d.h dparse.h dparse_tables.h dsymtab.h faq.html gram.c gram.h gramgram.h grammar.g.c index.html lex.c lex.h lr.c lr.h make_dparser.1 make_dparser.c make_dparser.cat manual.html parse.c parse.h parser_tests sample.g.d_parser.h scan.c scan.h symtab.c util.c util.h version.c write_ctables.c write_ctables.h Message-ID: <200401011650.KAA14955@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Applications/d: CHANGES added (r1.1) COPYRIGHT added (r1.1) Makefile added (r1.1) README added (r1.1) UPGRADING added (r1.1) arg.c added (r1.1) arg.h added (r1.1) d.h added (r1.1) dparse.h added (r1.1) dparse_tables.h added (r1.1) dsymtab.h added (r1.1) faq.html added (r1.1) gram.c added (r1.1) gram.h added (r1.1) gramgram.h added (r1.1) grammar.g.c added (r1.1) index.html added (r1.1) lex.c added (r1.1) lex.h added (r1.1) lr.c added (r1.1) lr.h added (r1.1) make_dparser.1 added (r1.1) make_dparser.c added (r1.1) make_dparser.cat added (r1.1) manual.html added (r1.1) parse.c added (r1.1) parse.h added (r1.1) parser_tests added (r1.1) sample.g.d_parser.h added (r1.1) scan.c added (r1.1) scan.h added (r1.1) symtab.c added (r1.1) util.c added (r1.1) util.h added (r1.1) version.c added (r1.1) write_ctables.c added (r1.1) write_ctables.h added (r1.1) --- Log message: Adding the D Parser Generator to the test suite. On Linux, LLVM has historically compiled this program with ease. So, if this program doesn't work, something either very simple or very obscure is wrong. --- Diffs of the changes: (+14738 -0) Index: llvm/test/Programs/MultiSource/Applications/d/CHANGES diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/CHANGES:1.1 *** /dev/null Thu Jan 1 10:50:46 2004 --- llvm/test/Programs/MultiSource/Applications/d/CHANGES Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,54 ---- + 1.6 Fixed missing test files + Fixed ${declare subparser XXX} + Fixed bug with multiple passes + Split states based on symboltable and globals + Added print_scope + + 1.5 Fixed web pages + Fixed DEBUG compilation error + Fixed ${scan XXX} example (g4.test.g) + Fixed strings/chars in ANSI-C grammar + Fixed OSX/Darwin compilation + Fixed ws_before/ws_after + Added support for \xNN \d00 escape sequences + Added support for /i (ignore case) strings/regexes + Added support for starting in arbitrary states + + 1.4 Added embedded actions + Added default actions + Added support for multi-pass compilation + Added support for mixed all/longest scanners + Enhanced python interface + + 1.3 Made GC version end in _gc + Fixed symtab, changed interface and added test cases + Fixed other bugs + Added verilog grammar + Added python grammar + Added support for regular expression 'productions' + + 1.2 Fixed a bug in cmp_reduction_priorities that could result in crashes + Fixed a bug which could result in ambiguity on final result + (thanx Thomas) + Fixed a bug in fixup of internal reductions which could result + in incorrectly ordered actions (thanx Tomas) + Fixed a bug in stack comparison pruning which could result in + incorrectly ruling out legal parses + Added python support (thanx to Brian Sabbey) + Added non-longest-match-only scanning + + 1.1 Fixed bug in fixing up internal productions + Made the default using left recursion for EBNF internal productions + + 1.0 Added full unambiguous ANSI C grammar + Added tokenizers (scanners shared over sets of states) + Added support for subparsers + Cleanup of header files + Fixed bugs in error recovery + + 1.0b2 Improved memory utilization + Fixed bug with right epsilon grammars + Added simple error recovery + General bug fixes + + 1.0b1 First release Index: llvm/test/Programs/MultiSource/Applications/d/COPYRIGHT diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/COPYRIGHT:1.1 *** /dev/null Thu Jan 1 10:50:46 2004 --- llvm/test/Programs/MultiSource/Applications/d/COPYRIGHT Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,9 ---- + Copyright (c) 1994-2003 John Bradley Plevyak, All Rights Reserved + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Index: llvm/test/Programs/MultiSource/Applications/d/Makefile diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/Makefile:1.1 *** /dev/null Thu Jan 1 10:50:46 2004 --- llvm/test/Programs/MultiSource/Applications/d/Makefile Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,6 ---- + LEVEL = ../../../../.. + PROG = make_dparser + Sources=make_dparser.c write_ctables.c gram.c lex.c lr.c arg.c parse.c scan.c symtab.c util.c + CPPFLAGS = -DD_BUILD_VERSION=5725 + RUN_OPTIONS="-v $(BUILD_SRC_DIR)/grammar.g" + include ../../Makefile.multisrc Index: llvm/test/Programs/MultiSource/Applications/d/README diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/README:1.1 *** /dev/null Thu Jan 1 10:50:46 2004 --- llvm/test/Programs/MultiSource/Applications/d/README Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,20 ---- + This is the D scannerless GLR parser. It uses to Tomita algorithm, + and incorporates BNF production syntax, regular expression terminals, + and a state-specific symbol table. + + It can be compiled to work with or without the Boehm Garbage Collector. + To compile with GC, uncomment the line D_USE_GC=1 in the Makefile. + + The result is natural grammars and powerful parsing. + + To build: 'gmake' (only available with source code package) + + To test: 'gmake test' (only available with source code package) + + To install, 'gmake install' (binary or source code packages) + + For python support, '(cd python; gmake install)' + + Refer to the manual for more information. + + See the UPGRADING for information on upgrading from previous version. Index: llvm/test/Programs/MultiSource/Applications/d/UPGRADING diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/UPGRADING:1.1 *** /dev/null Thu Jan 1 10:50:46 2004 --- llvm/test/Programs/MultiSource/Applications/d/UPGRADING Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,10 ---- + + from 1.1 to 1.2 + + - new_D_Parser now requires sizeof_D_ParseNode_User as an + argument because setting this value incorrectly can result in + subtle and confusing bugs. + + - the parser now defaults to NOT doing longest match + disambiguation during scanning. If you want this behavior + either specify -l to make_dparser or use ${declare longest_match ... }. Index: llvm/test/Programs/MultiSource/Applications/d/arg.c diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/arg.c:1.1 *** /dev/null Thu Jan 1 10:50:46 2004 --- llvm/test/Programs/MultiSource/Applications/d/arg.c Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,201 ---- + /* + Copyright 1994-2003 John Plevyak, All Rights Reserved + */ + #include "d.h" + + static char *SPACES = " "; + static char *arg_types_keys = (char *)"ISDfF+TL"; + static char *arg_types_desc[] = { + (char *)"int ", + (char *)"string ", + (char *)"double ", + (char *)"set off ", + (char *)"set on ", + (char *)"incr ", + (char *)"toggle ", + (char *)"int64 ", + (char *)" " + }; + + void + process_arg(ArgumentState *arg_state, int i, char ***argv) { + char * arg = NULL; + ArgumentDescription *desc = arg_state->desc; + if (desc[i].type) { + char type = desc[i].type[0]; + if (type=='F'||type=='f') + *(int *)desc[i].location = type=='F'?1:0; + else if (type=='T') + *(int *)desc[i].location = !*(int *)desc[i].location; + else if (type == '+') + (*(int *)desc[i].location)++; + else { + arg = *++(**argv) ? **argv : *++(*argv); + if (!arg) usage(arg_state, NULL); + switch (type) { + case 'I': + *(int *)desc[i].location = atoi(arg); + break; + case 'D': + *(double *)desc[i].location = atof(arg); + break; + case 'L': + *(int64 *)desc[i].location = atoll(arg); + break; + case 'S': strncpy((char *)desc[i].location,arg, atoi(desc[i].type+1)); + break; + default: + fprintf(stderr, "%s:bad argument description\n", + arg_state->program_name); + exit(1); + break; + } + **argv += strlen(**argv)-1; + } + } + if (desc[i].pfn) + desc[i].pfn(arg_state, arg); + } + + void + process_args(ArgumentState *arg_state, char **argv) { + int i = 0, len; + char *end; + ArgumentDescription *desc = arg_state->desc; + /* Grab Environment Variables */ + for (i = 0;; i++) { + if (!desc[i].name) + break; + if (desc[i].env) { + char type = desc[i].type[0]; + char * env = getenv(desc[i].env); + if (!env) continue; + switch (type) { + case 'A': + case 'f': + case 'F': + break; + case 'I': *(int *)desc[i].location = strtol(env, NULL, 0); break; + case 'D': *(double *)desc[i].location = strtod(env, NULL); break; + case 'L': *(int64 *)desc[i].location = strtoll(env, NULL, 0); break; + case 'S': strncpy((char *)desc[i].location,env, + strtol(desc[i].type+1, NULL, 0)); + break; + } + if (desc[i].pfn) + desc[i].pfn(arg_state, env); + } + } + + /* + Grab Command Line Arguments + */ + arg_state->program_name = argv[0]; + while ( *++argv ) { + if ( **argv == '-' ) { + if ((*argv)[1] == '-') { + for (i = 0;; i++) { + if (!desc[i].name) + usage(arg_state,NULL); + if ((end = strchr((*argv)+2, '='))) + len = end - ((*argv) + 2); + else + len = strlen((*argv) + 2); + if (len == strlen(desc[i].name) && + !strncmp(desc[i].name,(*argv)+2, len)) + { + if (!end) + *argv += strlen(*argv) - 1; + else + *argv = end; + process_arg(arg_state, i, &argv); + break; + } + } + } else { + while (*++(*argv)) + for (i = 0;; i++) { + if (!desc[i].name) + usage(arg_state, NULL); + if (desc[i].key == **argv) { + process_arg(arg_state, i, &argv); + break; + } + } + } + } else { + arg_state->file_argument = (char **)REALLOC( + arg_state->file_argument, + sizeof(char**) * (arg_state->nfile_arguments + 2)); + arg_state->file_argument[arg_state->nfile_arguments++] = *argv; + arg_state->file_argument[arg_state->nfile_arguments] = NULL; + } + } + } + + void + usage(ArgumentState *arg_state, char *arg_unused) { + ArgumentDescription *desc = arg_state->desc; + int i; + + (void)arg_unused; + fprintf(stderr,"Usage: %s [flags|args]\n",arg_state->program_name); + for (i = 0;; i++) { + if (!desc[i].name) + break; + if (!desc[i].description) + continue; + fprintf(stderr," %c%c%c --%s%s%s", + desc[i].key != ' ' ? '-' : ' ', desc[i].key, + desc[i].key != ' ' ? ',' : ' ', desc[i].name, + (strlen(desc[i].name) + 61 < 81) ? + &SPACES[strlen(desc[i].name)+61] : "", + arg_types_desc[desc[i].type?strchr(arg_types_keys,desc[i].type[0])- + arg_types_keys : strlen(arg_types_keys)]); + switch(desc[i].type?desc[i].type[0]:0) { + case 0: fprintf(stderr, " "); break; + case 'L': + fprintf(stderr, + #ifdef __alpha + " %-9ld", + #else + #ifdef FreeBSD + " %-9qd", + #else + " %-9lld", + #endif + #endif + *(int64*)desc[i].location); + break; + case 'S': + if (*(char*)desc[i].location) { + if (strlen((char*)desc[i].location) < 10) + fprintf(stderr, " %-9s", (char*)desc[i].location); + else { + ((char*)desc[i].location)[7] = 0; + fprintf(stderr, " %-7s..", (char*)desc[i].location); + } + } else + fprintf(stderr, " (null) "); + break; + case 'D': + fprintf(stderr, " %-9.3e", *(double*)desc[i].location); + break; + case '+': + case 'I': + fprintf(stderr, " %-9d", *(int *)desc[i].location); + break; + case 'T': case 'f': case 'F': + fprintf(stderr, " %-9s", *(int *)desc[i].location?"true ":"false"); + break; + } + fprintf(stderr," %s\n",desc[i].description); + } + exit(1); + } + + void + free_args(ArgumentState *arg_state) { + if (arg_state->file_argument) + FREE(arg_state->file_argument); + } Index: llvm/test/Programs/MultiSource/Applications/d/arg.h diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/arg.h:1.1 *** /dev/null Thu Jan 1 10:50:46 2004 --- llvm/test/Programs/MultiSource/Applications/d/arg.h Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,37 ---- + /* + Copyright 1994-2003 John Plevyak, All Rights Reserved + */ + #include + #include + #include + + #ifndef __alpha + #define atoll atol + #endif + + /* Argument Handling + */ + struct ArgumentState; + + typedef void ArgumentFunction(struct ArgumentState *arg_state, char *arg); + + typedef struct { + char *name; + char key; + char *description; + char *type; + void *location; + char *env; + ArgumentFunction *pfn; + } ArgumentDescription; + + typedef struct ArgumentState { + char **file_argument; + int nfile_arguments; + char *program_name; + ArgumentDescription *desc; + } ArgumentState; + + void usage(ArgumentState *arg_state, char *arg_unused); + void process_args(ArgumentState *arg_state, char **argv); + void free_args(ArgumentState *arg_state); Index: llvm/test/Programs/MultiSource/Applications/d/d.h diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/d.h:1.1 *** /dev/null Thu Jan 1 10:50:46 2004 --- llvm/test/Programs/MultiSource/Applications/d/d.h Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,101 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + #ifndef _d_H_ + #define _d_H_ + + #ifdef MEMWATCH + #define MEMWATCH_STDIO 1 + #include "../../src/memwatch-2.67/memwatch.h" + #define MEM_GROW_MACRO + #endif + #include + #include + #include + #include + #include + #include + #ifndef __MINGW32__ + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + + #ifdef LEAK_DETECT + #define GC_DEBUG + #include "gc.h" + #define MALLOC(n) GC_MALLOC(n) + #define CALLOC(m,n) GC_MALLOC((m)*(n)) + #define FREE(p) GC_FREE(p) + #define REALLOC(p,n) GC_REALLOC((p),(n)) + #define CHECK_LEAKS() GC_gcollect() + #else + #ifdef USE_GC + #include "gc.h" + #define MALLOC GC_MALLOC + #define REALLOC GC_REALLOC + #define FREE(_x) + #define malloc dont_use_malloc_use_MALLOC_instead + #define relloc dont_use_realloc_use_REALLOC_instead + #define free dont_use_free_use_FREE_instead + #else + #define MALLOC malloc + #define REALLOC realloc + #define FREE free + #endif + #endif + + #define D_MAJOR_VERSION 1 + #define D_MINOR_VERSION 2 + #define D_VERSION (\ + (D_MAJOR_VERSION << 24) + (D_MINOR_VERSION << 16) + \ + D_BUILD_VERSION) + + /* Compilation Options + */ + + #define round2(_x,_n) ((_x + ((_n)-1)) & ~((_n)-1)) + #define tohex1(_x) \ + ((((_x)&15) > 9) ? (((_x)&15) - 10 + 'A') : (((_x)&15) + '0')) + #define tohex2(_x) \ + ((((_x)>>4) > 9) ? (((_x)>>4) - 10 + 'A') : (((_x)>>4) + '0')) + #define numberof(_x) ((sizeof(_x))/(sizeof((_x)[0]))) + + typedef char int8; + typedef unsigned char uint8; + typedef int int32; + typedef unsigned int uint32; + typedef long long int64; + typedef unsigned long long uint64; + typedef short int16; + typedef unsigned short uint16; + /* typedef uint32 uint; * already part of most systems */ + + #include "dparse.h" + #include "arg.h" + #include "util.h" + #include "gram.h" + #include "lr.h" + #include "lex.h" + #include "scan.h" + #include "parse.h" + #include "write_ctables.h" + + #ifdef D_DEBUG + #define DBG(_x) if (debug_level>1) { _x; } + #else + #define DBG(_x) + #endif + + void d_version(char *); + + #define USE_SCANNER 1 + + #endif Index: llvm/test/Programs/MultiSource/Applications/d/dparse.h diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/dparse.h:1.1 *** /dev/null Thu Jan 1 10:50:46 2004 --- llvm/test/Programs/MultiSource/Applications/d/dparse.h Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,87 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + #ifndef _dparse_H_ + #define _dparse_H_ + + #include + #if defined(__cplusplus) + extern "C" { + #endif + #include "dparse_tables.h" + #include "dsymtab.h" + + struct D_Parser; + struct D_ParserTables; + struct D_Scope; + struct D_ParseNode; + + typedef void *d_voidp; + #ifndef D_ParseNode_User + #define D_ParseNode_User d_voidp + #endif + #ifndef D_ParseNode_Globals + #define D_ParseNode_Globals void + #endif + + typedef void (*D_SyntaxErrorFn)(struct D_Parser *); + typedef struct D_ParseNode *(*D_AmbiguityFn)(struct D_Parser *, + int n, struct D_ParseNode **v); + typedef void (*D_FreeNodeFn)(struct D_ParseNode *d); + + typedef struct D_Parser { + D_ParseNode_Globals *initial_globals; /* global values */ + D_WhiteSpaceFn initial_white_space_fn; + struct D_Scope *initial_scope; + D_SyntaxErrorFn syntax_error_fn; + D_AmbiguityFn ambiguity_fn; + D_FreeNodeFn free_node_fn; + d_loc_t loc; /* initial location, set on error */ + int start_state; + /* user configurables */ + int sizeof_user_parse_node; + int save_parse_tree; + int dont_compare_stacks; + int dont_fixup_internal_productions; + int dont_merge_epsilon_trees; + int dont_use_eagerness_for_disambiguation; + int dont_use_height_for_disambiguation; + int commit_actions_interval; /* 0 is immediate */ + int error_recovery; + int partial_parses; + /* parse results */ + int syntax_errors; + } D_Parser; + + typedef struct D_ParseNode { + int symbol; + d_loc_t start_loc; + char *end; + char *end_skip; + struct D_Scope *scope; + D_WhiteSpaceFn white_space; + D_ParseNode_Globals *globals; + D_ParseNode_User user; + } D_ParseNode; + + D_Parser *new_D_Parser(struct D_ParserTables *t, int sizeof_ParseNode_User); + void free_D_Parser(D_Parser *p); + D_ParseNode *dparse(D_Parser *p, char *buf, int buf_len); + void free_D_ParseNode(D_Parser *p, D_ParseNode *pn); + void free_D_ParseTreeBelow(D_Parser *p, D_ParseNode *pn); + + int d_get_number_of_children(D_ParseNode *pn); + D_ParseNode *d_get_child(D_ParseNode *pn, int child); + D_ParseNode *d_find_in_tree(D_ParseNode *pn, int symbol); + char *d_ws_before(D_Parser *p, D_ParseNode *pn); /* points BEFORE leading ws */ + char *d_ws_after(D_Parser *p, D_ParseNode *pn); /* points AFTER trailing ws */ + + void d_pass(D_Parser *p, D_ParseNode *pn, int pass_number); + + char *d_dup_pathname_str(char *str); + + #if defined(__cplusplus) + } + #endif + + #endif Index: llvm/test/Programs/MultiSource/Applications/d/dparse_tables.h diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/dparse_tables.h:1.1 *** /dev/null Thu Jan 1 10:50:46 2004 --- llvm/test/Programs/MultiSource/Applications/d/dparse_tables.h Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,165 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + #ifndef _dparse_tables_H_ + #define _dparse_tables_H_ + + #define SCANNER_BLOCKS_POW2 2 + #define SCANNER_BLOCKS (1 << SCANNER_BLOCKS_POW2) + #define SCANNER_BLOCK_SHIFT (8 - SCANNER_BLOCKS_POW2) + #define SCANNER_BLOCK_MASK ((1 << SCANNER_BLOCK_SHIFT) - 1) + #define SCANNER_BLOCK_SIZE (256 / SCANNER_BLOCKS) + + struct D_Parser; + struct D_ShiftTable; + + #define D_PN(_x, _o) ((D_ParseNode*)((char*)(_x) + _o)) + + typedef struct d_loc_t { + char *s, *pathname; + int previous_col, col, line; + } d_loc_t; + + typedef void (*D_WhiteSpaceFn)(struct D_Parser *p, + d_loc_t *loc, void **p_globals); + typedef int (*D_ScanCode)( + char **s, int *col, int *line, unsigned short *symbol, + int *term_priority, unsigned char *op_assoc, int *op_priority); + typedef int (*D_ReductionCode)( + void *new_ps, void **children, int n_children, int pn_offset, + struct D_Parser *parser); + + typedef struct D_Reduction { + unsigned short nelements; + unsigned short symbol; + D_ReductionCode speculative_code; + D_ReductionCode final_code; + unsigned short op_assoc; + unsigned short rule_assoc; + int op_priority; + int rule_priority; + int action_index; + int npass_code; + D_ReductionCode *pass_code; + } D_Reduction; + + typedef struct D_RightEpsilonHint { + unsigned short depth; + unsigned short preceeding_state; + D_Reduction *reduction; + } D_RightEpsilonHint; + + typedef struct D_ErrorRecoveryHint { + unsigned short depth; + unsigned short symbol; + char *string; + } D_ErrorRecoveryHint; + + typedef struct D_Shift { + unsigned short symbol; + unsigned char shift_kind; + unsigned char op_assoc; + int op_priority; + int term_priority; + D_ReductionCode speculative_code; + } D_Shift; + + typedef struct SB_uint8 { + D_Shift **shift; + unsigned char *scanner_block[SCANNER_BLOCKS]; + } SB_uint8; + + typedef struct SB_uint16 { + D_Shift **shift; + unsigned short *scanner_block[SCANNER_BLOCKS]; + } SB_uint16; + + typedef struct SB_uint32 { + D_Shift **shift; + unsigned int *scanner_block[SCANNER_BLOCKS]; + } SB_uint32; + + typedef struct SB_trans_uint8 { + unsigned char *scanner_block[SCANNER_BLOCKS]; + } SB_trans_uint8; + + typedef struct SB_trans_uint16 { + unsigned short *scanner_block[SCANNER_BLOCKS]; + } SB_trans_uint16; + + typedef struct SB_trans_uint32 { + unsigned int *scanner_block[SCANNER_BLOCKS]; + } SB_trans_uint32; + + #define D_SCAN_ALL 0 + #define D_SCAN_LONGEST 1 + #define D_SCAN_MIXED 2 + #define D_SCAN_RESERVED 3 + #define D_SCAN_DEFAULT D_SCAN_ALL + + typedef struct D_State { + unsigned char *goto_valid; + int goto_table_offset; + struct { + unsigned int n; + D_Reduction **v; + } reductions; + struct { + unsigned int n; + D_RightEpsilonHint *v; + } right_epsilon_hints; + struct { + unsigned int n; + D_ErrorRecoveryHint *v; + } error_recovery_hints; + D_Shift **shifts; + D_ScanCode scanner_code; + void* scanner_table; + unsigned char scanner_size; + unsigned char accept; + unsigned char scan_kind; + void* transition_table; + D_Shift ***accepts_diff; + int reduces_to; + } D_State; + + #define D_SHIFTS_CODE ((D_Shift**)-1) + + #define D_SYMBOL_NTERM 1 + #define D_SYMBOL_INTERNAL 2 + #define D_SYMBOL_STRING 3 + #define D_SYMBOL_REGEX 4 + #define D_SYMBOL_CODE 5 + #define D_SYMBOL_TOKEN 6 + typedef struct D_Symbol { + unsigned int kind; + char *name; + int name_len; + } D_Symbol; + + #define D_PASS_PRE_ORDER 0x0001 + #define D_PASS_POST_ORDER 0x0002 + #define D_PASS_MANUAL 0x0004 + #define D_PASS_FOR_ALL 0x0008 + #define D_PASS_FOR_UNDEFINED 0x0010 + typedef struct D_Pass { + char *name; + unsigned int name_len; + unsigned int kind; + unsigned int index; + } D_Pass; + + typedef struct D_ParserTables { + unsigned int nstates; + D_State *state; + unsigned short *goto_table; + unsigned int whitespace_state; + unsigned int nsymbols; + D_Symbol *symbols; + D_WhiteSpaceFn default_white_space; + unsigned int npasses; + D_Pass *passes; + unsigned int save_parse_tree; + } D_ParserTables; + + #endif Index: llvm/test/Programs/MultiSource/Applications/d/dsymtab.h diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/dsymtab.h:1.1 *** /dev/null Thu Jan 1 10:50:46 2004 --- llvm/test/Programs/MultiSource/Applications/d/dsymtab.h Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,54 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + #ifndef _dsymtab_H_ + #define _dsymtab_H_ + + #ifndef D_UserSym + #define D_UserSym unsigned int + #endif + + struct D_SymHash; + + typedef struct D_Sym { + char *name; + int len; + unsigned int hash; + struct D_Sym *update_of; + struct D_Sym *next; + D_UserSym user; + } D_Sym; + + #define SCOPE_INHERIT 0 + #define SCOPE_RECURSIVE 1 + #define SCOPE_PARALLEL 2 + #define SCOPE_SEQUENTIAL 3 + + typedef struct D_Scope { + unsigned int owned_by_user:1; /* don't automatically delete */ + unsigned int kind:2; + D_Sym *ll; + struct D_SymHash *hash; + D_Sym *updates; + struct D_Scope *search; /* scope to start search */ + struct D_Scope *up; /* enclosing scope */ + struct D_Scope *up_updates; /* prior scope in speculative parse */ + struct D_Scope *down; /* enclosed scopes (for FREE) */ + struct D_Scope *down_next; /* next enclosed scope */ + } D_Scope; + + D_Scope *new_D_Scope(D_Scope *parent); + D_Scope *enter_D_Scope(D_Scope *current, D_Scope *scope); + D_Scope *commit_D_Scope(D_Scope *scope); + void free_D_Scope(D_Scope *st, int force); + D_Sym *new_D_Sym(D_Scope *st, char *name, char *end, int sizeof_D_Sym); + #define NEW_D_SYM(_st, _name, _end) new_D_Sym(_st, _name, _end, sizeof(D_Sym)) + void free_D_Sym(D_Sym *sym); + D_Sym *find_D_Sym(D_Scope *st, char *name, char *end); + D_Sym *update_D_Sym(D_Scope *st, D_Sym *sym, int sizeof_D_Sym); + #define UPDATE_D_SYM(_st, _sym) update_D_Sym(_st, _sym, sizeof(D_Sym)) + D_Sym *current_D_Sym(D_Scope *st, D_Sym *sym); + D_Sym *find_D_Sym_in_Scope(D_Scope *st, char *name, char *end); + void print_scope(D_Scope *st); + + #endif Index: llvm/test/Programs/MultiSource/Applications/d/faq.html diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/faq.html:1.1 *** /dev/null Thu Jan 1 10:50:46 2004 --- llvm/test/Programs/MultiSource/Applications/d/faq.html Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,62 ---- + + + + + manual.html + + +
  DParser FAQ
+
+

+
+
1. How do + I access the subnodes for expressions like "S: A*;" ?
+
+
In this case, "A*" is $n0 of type + D_ParseNode.  In dparse.h the functions + d_get_number_of_children(D_ParseNode *) and d_get_child(D_ParseNode *, + int) allow you to get the number of children (A's) by calling + d_get_number_of_children(&$n0) and individual children by calling + d_get_child(&$n0, x).
+
+ See the example: tests/g27.test.g
+
+ 2. Why doesn't '$n0.end_skip' include + the trailing whitespace when $n0 is a string/regex?
+
+
Whitespace is not skipped as part of the scan of a + string/regex but is done later (when the new parse state is + created).  This makes it possible to change the whitespace parser + as a result of recognition of a particular string/regex.  This is + used in the python grammar to handle implicit line joining.
+
+ See the regex-productions LP RP LB RB LC RC in test/python.test.g.
+
+ 3. What is the difference between + DParser and ANTLR?
+

+ The basic syntax of DParser and ANTLR grammars is very similar.  + In fact, the DParser example ANSI-C grammar was ported from ANTLR in + less than an hour. 
+
+ Beyond that there are a number of differences.  First of all ANTRL + has been developed for over a decade while DParser is relatively + young.  Internally, DParser is a table-driven parser while ANTLR + generates directly executable parsers.  DParser is a GLR parser + based on the Tomita algorithm while ANTLR is modified LL(k).  + DParser is scannerless while ANTLR uses token streams.  In terms + of power, both DParser and ANTLR are very powerful.  In theory + DParser can handle any context free grammar, though not necessarily in + linear time.  In practice ANTLR is likely to be faster (mostly + because it is more mature).   Beyond that you would really + have ask Terance Parr who is more of a hard core parsing theory guru + than I am.
+
+
+ + Index: llvm/test/Programs/MultiSource/Applications/d/gram.c diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/gram.c:1.1 *** /dev/null Thu Jan 1 10:50:46 2004 --- llvm/test/Programs/MultiSource/Applications/d/gram.c Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,1322 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + + #include "d.h" + + static char *action_types[] = { "ACCEPT", "SHIFT", "REDUCE" }; + + static void print_state(State *s); + + Production * + new_production(Grammar *g, char *name) { + Production *p; + if ((p = lookup_production(g, name, strlen(name)))) + return p; + p = MALLOC(sizeof(Production)); + memset(p, 0, sizeof(Production)); + vec_add(&g->productions, p); + p->name = name; + p->name_len = strlen(name); + return p; + } + + static Elem * + new_elem() { + Elem *e = MALLOC(sizeof(Elem)); + memset(e, 0, sizeof(Elem)); + return e; + } + + Rule * + new_rule(Grammar *g, Production *p) { + Rule *r = MALLOC(sizeof(Rule)); + memset(r, 0, sizeof(Rule)); + r->prod = p; + r->end = new_elem(); + r->end->kind = ELEM_END; + r->end->rule = r; + r->action_index = g->action_index; + return r; + } + + static Term * + new_term() { + Term *term = MALLOC(sizeof(Term)); + memset(term, 0, sizeof(Term)); + return term; + } + + static Elem * + new_elem_term(Term *t, Rule *r) { + Elem *e = new_elem(); + e->kind = ELEM_TERM; + e->e.term = t; + e->rule = r; + vec_add(&r->elems, e); + return e; + } + + Elem * + new_elem_nterm(Production *p, Rule *r) { + Elem *e = new_elem(); + e->kind = ELEM_NTERM; + e->e.nterm = p; + e->rule = r; + return e; + } + + static Elem * + new_term_string(Grammar *g, char *s, char *e, Rule *r) { + Term *t = new_term(); + Elem *elem; + + t->string = MALLOC(e - s + 1); + memcpy(t->string, s, e - s); + t->string[e - s] = 0; + t->string_len = e - s; + vec_add(&g->terminals, t); + elem = new_elem_term(t, r); + return elem; + } + + #define ESC(_c) *ss++ = '\\'; *ss++ = _c; break; + char * + escape_string_for_regex(char *s) { + char *ss = (char*)MALLOC((strlen(s) + 1) * 2), *sss = ss; + for (; *s; s++) { + switch (*s) { + case '(': + case ')': + case '[': + case ']': + case '-': + case '^': + case '*': + case '?': + case '+': + *ss++ = '\\'; + /* fall through */ + default: *ss++ = *s; break; + } + } + *ss = 0; + return sss; + } + + static void + unescape_term_string(Term *t) { + char *s, *start = 0, *ss; + int length, base = 0; + + for (ss = s = t->string; *s; s++) { + if (*s == '\\') { + switch (s[1]) { + case 'b': *ss = '\b'; s++; break; + case 'f': *ss = '\f'; s++; break; + case 'n': *ss = '\n'; s++; break; + case 'r': *ss = '\r'; s++; break; + case 't': *ss = '\t'; s++; break; + case 'v': *ss = '\v'; s++; break; + case 'a': *ss = '\a'; s++; break; + case 'c': *ss = 0; return; + case '\"': + if (t->kind == TERM_REGEX) + { *ss = '\"'; s++; break; } + else + goto Ldefault; + case '\'': + if (t->kind == TERM_STRING) + { *ss = '\''; s++; break; } + else + goto Ldefault; + case 'x': + length = 0; + if (isxdigit(s[2])) { + base = 16; + start = s + 2; + length++; + if (isxdigit(s[3])) + length++; + } + s += length + 1; + goto Lncont; + case 'd': + length = 0; + if (isdigit(s[2])) { + base = 10; + start = s + 2; + length++; + if (isdigit(s[3])) { + length++; + if (isdigit(s[4]) && ((s[2] < '2') || ((s[2] == '2') && ((s[3] < '5') || + ((s[3] == '5') && (s[4] < '6')))))) + length++; + } + } + s += length + 1; + goto Lncont; + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + length = 1; + base = 8; + start = s + 1; + if (isdigit(s[2]) && (s[2] != '8') && (s[2] != '9')) { + length++; + if (isdigit(s[3]) && (s[3] != '8') && (s[3] != '9')) { + length++; + } + } + s += length; + /* fall through */ + Lncont: + if (length > 0) { + char saved_c = start[length]; + start[length] = '\0'; + *ss = (char) strtol(start, NULL, base); + start[length] = saved_c; + if (*s > 0) + break; + d_fail("encountered an escaped NULL while processing '%s'", t->string); + } else + goto next; + Ldefault: + default: + *ss++ = *s; + *ss = s[1]; + s++; + break; + } + } else + *ss = *s; + ss++; + next:; + } + *ss = 0; + t->string_len = strlen(t->string); + if (!t->string_len) + d_fail("empty string after unescape '%s'", t->string); + } + + Elem * + new_string(Grammar *g, char *s, char *e, Rule *r) { + Elem *x = new_term_string(g, s + 1, e - 1, r); + x->e.term->kind = (*s == '"') ? TERM_REGEX : TERM_STRING; + unescape_term_string(x->e.term); + return x; + } + + Elem * + new_ident(char *s, char *e, Rule *r) { + Elem *x = new_elem(); + x->kind = ELEM_UNRESOLVED; + x->e.unresolved.string = dup_str(s, e); + x->e.unresolved.len = strlen(x->e.unresolved.string); + x->rule = r; + if (r) + vec_add(&r->elems, x); + return x; + } + + void + new_token(Grammar *g, char *s, char *e) { + Term *t = new_term(); + t->string = MALLOC(e - s + 1); + memcpy(t->string, s, e - s); + t->string[e - s] = 0; + t->string_len = e - s; + vec_add(&g->terminals, t); + t->kind = TERM_TOKEN; + } + + Elem * + new_code(Grammar *g, char *s, char *e, Rule *r) { + Elem *x = new_term_string(g, s, e, r); + x->e.term->kind = TERM_CODE; + return x; + } + + Elem * + dup_elem(Elem *e, Rule *r) { + Elem *ee = MALLOC(sizeof(Elem)); + memcpy(ee, e, sizeof(Elem)); + ee->rule = r; + return ee; + } + + void + add_global_code(Grammar *g, char *start, char *end, int line) { + if (!g->code) g->code = MALLOC(sizeof(Code) * 4); + else if (!((g->ncode + 1) & 4)) + g->code = REALLOC(g->code, sizeof(Code) * (g->ncode + 4)); + g->code[g->ncode].code = dup_str(start, end); + g->code[g->ncode].line = line; + g->ncode++; + } + + void + new_declaration(Grammar *g, Elem *e, uint kind) { + Declaration *d = MALLOC(sizeof(*d)); + d->elem = e; + d->kind = kind; + d->index = g->declarations.n; + vec_add(&g->declarations, d); + } + + void + add_declaration(Grammar *g, char *start, char *end, uint kind, uint line) { + if (start == end) { + switch (kind) { + case DECLARE_SET_OP_PRIORITY: g->set_op_priority_from_rule = 1; return; + case DECLARE_STATES_FOR_ALL_NTERMS: g->states_for_all_nterms = 1; return; + case DECLARE_LONGEST_MATCH: g->longest_match = 1; return; + case DECLARE_ALL_MATCHES: g->longest_match = 0; return; + case DECLARE_TOKENIZE: g->tokenizer = 1; return; + case DECLARE_SAVE_PARSE_TREE: g->save_parse_tree = 1; return; + default: d_fail("declare expects argument, line %d", line); + } + } + switch (kind) { + case DECLARE_WHITESPACE: g->default_white_space = dup_str(start, end); return; + case DECLARE_SET_OP_PRIORITY: + d_fail("declare does not expect argument, line %d", line); + default: + new_declaration(g, new_ident(start, end, NULL), kind); + break; + } + } + + D_Pass * + find_pass(Grammar *g, char *start, char *end) { + int i, l; + while (*start && isspace(*start)) start++; + l = end - start; + for (i = 0; i < g->passes.n; i++) + if (l == g->passes.v[i]->name_len && + !strncmp(g->passes.v[i]->name, start, l)) + return g->passes.v[i]; + return NULL; + } + + void + add_pass(Grammar *g, char *start, char *end, uint kind, uint line) { + if (find_pass(g, start, end)) + d_fail("duplicate pass '%s' line %d", dup_str(start, end), line); + else { + D_Pass *p = MALLOC(sizeof(*p)); + p->name = dup_str(start, end); + p->name_len = end - start; + p->kind = kind; + p->index = g->pass_index++; + vec_add(&g->passes, p); + } + } + + void + add_pass_code(Grammar *g, Rule *r, char *pass_start, char *pass_end, + char *code_start, char *code_end, uint pass_line, uint code_line) + { + D_Pass *p = find_pass(g, pass_start, pass_end); + if (!p) + d_fail("unknown pass '%s' line %d", dup_str(pass_start, pass_end), pass_line); + while (r->pass_code.n <= p->index) vec_add(&r->pass_code, NULL); + r->pass_code.v[p->index] = MALLOC(sizeof(Code)); + r->pass_code.v[p->index]->code = dup_str(code_start, code_end); + r->pass_code.v[p->index]->line = code_line; + } + + + Production * + new_internal_production(Grammar *g, Production *p) { + char *n = p ? p->name : " _synthetic"; + char *name = MALLOC(strlen(n) + 20); + Production *pp = NULL, *tp = NULL, *ttp; + int i, found = 0; + sprintf(name, "%s.%d", n, g->productions.n); + pp = new_production(g, name); + pp->internal = INTERNAL_HIDDEN; + pp->regex = p ? p->regex : 0; + if (p) { + for (i = 0; i < g->productions.n; i++) { + if (found) { + ttp = g->productions.v[i]; + g->productions.v[i] = tp; + tp = ttp; + } else if (p == g->productions.v[i]) { + found = 1; + tp = g->productions.v[i+1]; + g->productions.v[i+1] = pp; + i++; + } + } + } + return pp; + } + + void + conditional_EBNF(Grammar *g) { + Production *pp; + Rule *rr; + + pp = new_internal_production(g, g->p); + pp->internal = INTERNAL_CONDITIONAL; + rr = new_rule(g, pp); + vec_add(&rr->elems, last_elem(g->r)); + last_elem(g->r)->rule = rr; + rr->elems.v[rr->elems.n - 1]->rule = rr; + vec_add(&pp->rules, rr); + vec_add(&pp->rules, new_rule(g, pp)); + last_elem(g->r) = new_elem_nterm(pp, g->r); + } + + void + star_EBNF(Grammar *g) { + Production *pp; + Rule *rr; + + pp = new_internal_production(g, g->p); + pp->internal = INTERNAL_STAR; + rr = new_rule(g, pp); + if (!g->right_recursive_BNF) { + vec_add(&rr->elems, new_elem_nterm(pp, rr)); + vec_add(&rr->elems, last_elem(g->r)); + last_elem(g->r) = new_elem_nterm(pp, g->r); + last_elem(rr)->rule = rr; + } else { + vec_add(&rr->elems, last_elem(g->r)); + last_elem(g->r) = new_elem_nterm(pp, g->r); + last_elem(rr)->rule = rr; + vec_add(&rr->elems, new_elem_nterm(pp, rr)); + } + vec_add(&pp->rules, rr); + vec_add(&pp->rules, new_rule(g, pp)); + } + + void + plus_EBNF(Grammar *g) { + Production *pp; + Rule *rr; + Elem *elem; + + pp = new_internal_production(g, g->p); + pp->internal = INTERNAL_PLUS; + rr = new_rule(g, pp); + if (!g->right_recursive_BNF) { + elem = last_elem(g->r); + vec_add(&rr->elems, new_elem_nterm(pp, rr)); + vec_add(&rr->elems, dup_elem(elem, rr)); + last_elem(g->r) = new_elem_nterm(pp, g->r); + } else { + elem = last_elem(g->r); + vec_add(&rr->elems, dup_elem(elem, rr)); + last_elem(g->r) = new_elem_nterm(pp, g->r); + vec_add(&rr->elems, new_elem_nterm(pp, rr)); + } + vec_add(&pp->rules, rr); + rr = new_rule(g, pp); + vec_add(&rr->elems, elem); + elem->rule = rr; + vec_add(&pp->rules, rr); + } + + void + initialize_productions(Grammar *g) { + Production *pp, *ppp; + Rule *rrr; + + ppp = new_production(g, strdup("0 Start")); + ppp->internal = INTERNAL_HIDDEN; + rrr = new_rule(g, ppp); + vec_add(&rrr->elems, new_elem_nterm(NULL, rrr)); + vec_add(&ppp->rules, rrr); + pp = new_production(g, strdup("1 Start")); + pp->internal = INTERNAL_HIDDEN; + rrr->elems.v[0]->e.nterm = pp; + } + + void + finish_productions(Grammar *g) { + Production *pp = g->productions.v[1]; + Rule *rr = new_rule(g, g->productions.v[1]); + vec_add(&rr->elems, new_elem_nterm(NULL, rr)); + vec_add(&pp->rules, rr); + rr->elems.v[0]->e.nterm = g->productions.v[2]; + } + + Production * + lookup_production(Grammar *g, char *name, int l) { + int i; + + for (i = 0; i < g->productions.n; i++) { + Production *pp = g->productions.v[i]; + if (pp->name_len != l || strncmp(pp->name, name, l)) + continue; + return pp; + } + return NULL; + } + + static Term * + lookup_token(Grammar *g, char *name, int l) { + int i; + + for (i = 0; i < g->terminals.n; i++) { + Term *t = g->terminals.v[i]; + if (t->kind != TERM_TOKEN || t->string_len != l || + strncmp(t->string, name, l)) + continue; + return t; + } + return NULL; + } + + static Term * + unique_term(Grammar *g, Term *t) { + int i; + for (i = 0; i < g->terminals.n; i++) + if (t->kind == g->terminals.v[i]->kind && + t->string_len == g->terminals.v[i]->string_len && + t->term_priority == g->terminals.v[i]->term_priority && + (!g->set_op_priority_from_rule || + (t->op_assoc == g->terminals.v[i]->op_assoc && + t->op_priority == g->terminals.v[i]->op_priority)) && + !strncmp(t->string, g->terminals.v[i]->string, t->string_len)) + return g->terminals.v[i]; + return t; + } + + static void + compute_nullable(Grammar *g) { + int i, j, k, changed = 1; + Elem *e; + + /* ensure that the trivial case is the first cause */ + for (i = 0; i < g->productions.n; i++) { + for (j = 0; j < g->productions.v[i]->rules.n; j++) + if (!g->productions.v[i]->rules.v[j]->elems.n) { + g->productions.v[i]->nullable = g->productions.v[i]->rules.v[j]; + break; + } + } + /* transitive closure */ + while (changed) { + changed = 0; + for (i = 0; i < g->productions.n; i++) { + if (!g->productions.v[i]->nullable) + for (j = 0; j < g->productions.v[i]->rules.n; j++) { + for (k = 0; k < g->productions.v[i]->rules.v[j]->elems.n; k++) { + e = g->productions.v[i]->rules.v[j]->elems.v[k]; + if (e->kind != ELEM_NTERM || !e->e.nterm->nullable) + goto Lnot_nullable; + } + changed = 1; + g->productions.v[i]->nullable = g->productions.v[i]->rules.v[j]; + break; + } + Lnot_nullable:; + } + } + } + + /* + verify and cleanup the grammar datastructures + - resolve non-terminals + - set element indexes + */ + static void + resolve_grammar(Grammar *g) { + int i, j, k, l; + Production *p, *pp; + Rule *r; + Elem *e; + Term *last_term, *t; + + g->rule_index = 0; + for (i = 0; i < g->productions.n; i++) { + p = g->productions.v[i]; + if (p != lookup_production(g, p->name, p->name_len)) + d_fail("duplicate production '%s'", p->name); + p->index = i; + for (j = 0; j < p->rules.n; j++) { + r = p->rules.v[j]; + r->index = g->rule_index++; + last_term = NULL; + for (k = 0; k < r->elems.n; k++) { + e = r->elems.v[k]; + e->index = k; + if (e->kind == ELEM_UNRESOLVED) { + l = e->e.unresolved.len; + if ((pp = lookup_production(g, e->e.unresolved.string, l))) { + e->kind = ELEM_NTERM; + e->e.nterm = pp; + } else if ((t = lookup_token(g, e->e.unresolved.string, l))) { + e->kind = ELEM_TERM; + e->e.term = t; + } else { + char str[256]; + strncpy(str, e->e.unresolved.string, l); + str[l < 255 ? l : 255] = 0; + d_fail("unresolved identifier: '%s'", str); + } + } + if (e->kind == ELEM_TERM) + last_term = e->e.term; + } + r->end->index = r->elems.n; + if (g->set_op_priority_from_rule) { + if (last_term && r->rule_assoc) { + last_term->op_assoc = r->rule_assoc; + last_term->op_priority = r->rule_priority; + } + } + } + } + for (i = 0; i < g->terminals.n; i++) + g->terminals.v[i]->index = i; + compute_nullable(g); + } + + static void + merge_identical_terminals(Grammar *g) { + int i, j, k; + Production *p; + Rule *r; + Elem *e; + + for (i = 0; i < g->productions.n; i++) { + p = g->productions.v[i]; + for (j = 0; j < p->rules.n; j++) { + r = p->rules.v[j]; + for (k = 0; k < r->elems.n; k++) { + e = r->elems.v[k]; + if (e->kind == ELEM_TERM) + e->e.term = unique_term(g, e->e.term); + } + } + } + } + + void + print_term(Term *t) { + char *s = t->string ? escape_string(t->string) : NULL; + if (t->kind == TERM_STRING) { + if (!t->string || !*t->string) + printf(" "); + else + printf("string(\"%s\") ", s); + } else if (t->kind == TERM_REGEX) + printf("regex(\"%s\") ", s); + else if (t->kind == TERM_CODE) + printf("code(\"%s\") ", s); + else if (t->kind == TERM_TOKEN) + printf("token(\"%s\") ", s); + else + d_fail("unknown token kind"); + if (s) + FREE(s); + } + + void + print_elem(Elem *ee) { + if (ee->kind == ELEM_TERM) + print_term(ee->e.term); + else if (ee->kind == ELEM_UNRESOLVED) + printf("%s ", ee->e.unresolved.string); + else + printf("%s ", ee->e.nterm->name); + } + + struct EnumStr { + uint e; + char *s; + } assoc_strings[] = { + { ASSOC_NONE, "$none" }, + { ASSOC_NARY_LEFT, "$left" }, + { ASSOC_NARY_RIGHT, "$right" }, + { ASSOC_UNARY_LEFT, "$unary_left" }, + { ASSOC_UNARY_RIGHT, "$unary_right" }, + { ASSOC_BINARY_LEFT, "$binary_left" }, + { ASSOC_BINARY_RIGHT, "$binary_right" }, + { ASSOC_NO, "$noassoc" } + }; + + static char * + assoc_str(uint e) { + int i; + + for (i = 0; i < sizeof(assoc_strings) / sizeof(assoc_strings[0]); i++) + if (e == assoc_strings[i].e) + return assoc_strings[i].s; + return assoc_strings[0].s; + } + + void + print_rule(Rule *r) { + int k; + + printf("%s: ", r->prod->name); + for (k = 0; k < r->elems.n; k++) + print_elem(r->elems.v[k]); + if (r->speculative_code.code) + printf("SPECULATIVE_CODE\n%s\nEND CODE\n", r->speculative_code.code); + if (r->final_code.code) + printf("FINAL_CODE\n%s\nEND CODE\n", r->final_code.code); + } + + void + print_grammar(Grammar *g) { + uint i, j, k; + Production *pp; + Rule *rr; + + if (!g->productions.n) + return; + printf("PRODUCTIONS\n\n"); + for (i = 0; i < g->productions.n; i++) { + pp = g->productions.v[i]; + printf("%s (%d)\n", pp->name, i); + for (j = 0; j < pp->rules.n; j++) { + rr = pp->rules.v[j]; + if (!j) + printf("\t: "); + else + printf("\t| "); + for (k = 0; k < rr->elems.n; k++) + print_elem(rr->elems.v[k]); + if (rr->op_priority) + printf("op %d ", rr->op_priority); + if (rr->op_assoc) + printf("%s ", assoc_str(rr->op_assoc)); + if (rr->rule_priority) + printf("rule %d ", rr->rule_priority); + if (rr->rule_assoc) + printf("%s ", assoc_str(rr->rule_assoc)); + if (rr->speculative_code.code) + printf("%s ", rr->speculative_code.code); + if (rr->final_code.code) + printf("%s ", rr->final_code.code); + printf("\n"); + } + printf("\t;\n"); + printf("\n"); + } + printf("TERMINALS\n\n"); + for (i = 0; i < g->terminals.n; i++) { + printf("\t"); + print_term(g->terminals.v[i]); + printf("(%d)\n", i + g->productions.n); + } + printf("\n"); + } + + static void + print_item(Item *i) { + int j, end = 1; + + printf("\t%s: ", i->rule->prod->name); + for (j = 0; j < i->rule->elems.n; j++) { + Elem *e = i->rule->elems.v[j]; + if (i == e) { + printf(". "); + end = 0; + } + print_elem(e); + } + if (end) + printf(". "); + printf("\n"); + } + + static void + print_conflict(char *kind, int *conflict) { + if (!*conflict) { + printf(" CONFLICT (before precedence and associativity)\n"); + *conflict = 1; + } + printf("\t%s conflict ", kind); + printf("\n"); + } + + static void + print_state(State *s) { + int j, conflict = 0; + + printf("STATE %d (%d ITEMS)%s\n", s->index, s->items.n, + s->accept ? " ACCEPT" : ""); + for (j = 0; j < s->items.n; j++) + print_item(s->items.v[j]); + if (s->gotos.n) + printf(" GOTO\n"); + for (j = 0; j < s->gotos.n; j++) { + printf("\t"); + print_elem(s->gotos.v[j]->elem); + printf(" : %d\n", s->gotos.v[j]->state->index); + } + printf(" ACTION\n"); + for (j = 0; j < s->reduce_actions.n; j++) { + Action *a = s->reduce_actions.v[j]; + printf("\t%s\t", action_types[a->kind]); + print_rule(a->rule); + printf("\n"); + } + for (j = 0; j < s->shift_actions.n; j++) { + Action *a = s->shift_actions.v[j]; + printf("\t%s\t", action_types[a->kind]); + if (a->kind == ACTION_SHIFT) { + print_term(a->term); + printf("%d", a->state->index); + } + printf("\n"); + } + if (s->reduce_actions.n > 1) + print_conflict("reduce/reduce", &conflict); + if (s->reduce_actions.n && s->shift_actions.n) + print_conflict("shift/reduce", &conflict); + printf("\n"); + } + + void + print_states(Grammar *g) { + int i; + + for (i = 0; i < g->states.n; i++) + print_state(g->states.v[i]); + } + + int + state_for_declaration(Grammar *g, int iproduction) { + int i; + for (i = 0; i < g->declarations.n; i++) + if (g->declarations.v[i]->kind == DECLARE_STATE_FOR && + g->declarations.v[i]->elem->e.nterm->index == iproduction) + return 1; + return 0; + } + + static void + make_elems_for_productions(Grammar *g) { + int i, j, k, l; + Rule *rr; + Production *pp, *ppp; + + pp = g->productions.v[0]; + for (i = 0; i < g->productions.n; i++) + if (!g->productions.v[i]->internal) { + if (g->states_for_all_nterms || + state_for_declaration(g, i)) { + /* try to find an existing elem */ + for (j = 0; j < g->productions.n; j++) + for (k = 0; k < g->productions.v[j]->rules.n; k++) { + rr = g->productions.v[j]->rules.v[k]; + for (l = 0; l < rr->elems.n; l++) + if (rr->elems.v[l]->e.term_or_nterm == g->productions.v[i]) { + g->productions.v[i]->elem = rr->elems.v[l]; + break; + } + } + if (j >= g->productions.n) { /* not found */ + g->productions.v[i]->elem = + new_elem_nterm(g->productions.v[i], new_rule(g, pp)); + g->productions.v[i]->elem->rule->index = g->rule_index++; /* fake */ + } + } + } + if (!g->states_for_all_nterms && + g->states_for_whitespace && + (ppp = lookup_production(g, "whitespace", sizeof("whitespace")-1))) + { + ppp->elem = new_elem_nterm(ppp, new_rule(g, pp)); + ppp->elem->rule->index = g->rule_index++; /* fake */ + } + } + + static void + convert_regex_production_one(Grammar *g, Production *p) { + int j, k, l; + Production *pp; + Rule *r, *rr; + Elem *e; + Term *t; + int circular = 0; + char *buf = 0, *b, *s; + int buf_len = 0; + + if (p->regex_term) /* already done */ + return; + if (p->in_regex) + d_fail("circular regex production '%s'", p->name); + p->in_regex = 1; + for (j = 0; j < p->rules.n; j++) { + r = p->rules.v[j]; + if (r->final_code.code || (r->speculative_code.code && p->rules.n > 1)) + d_fail("final and/or multi-rule code not permitted in regex productions '%s'", p->name); + for (k = 0; k < r->elems.n; k++) { + e = r->elems.v[k]; + if (e->kind == ELEM_NTERM) { + if (!e->e.nterm->regex) + d_fail("regex production '%s' cannot invoke non-regex production '%s'", + p->name, e->e.nterm->name); + pp = e->e.nterm; + for (l = 0; l < pp->rules.n; l++) + if (pp->rules.v[l]->speculative_code.code || pp->rules.v[l]->final_code.code) + d_fail("code not permitted in rule %d of regex productions '%s'", l, p->name); + if (p != pp) { + convert_regex_production_one(g, pp); + buf_len += pp->regex_term->string_len + 5; + } else { + circular = 1; + buf_len += 5; + } + } else { /* e->kind == ELEM_TERM */ + if (e->e.term->kind == TERM_CODE || e->e.term->kind == TERM_TOKEN) + d_fail("regex production '%s' cannot include scanners or tokens"); + buf_len += e->e.term->string_len + 5; + } + } + } + b = buf = (char*)MALLOC(buf_len + 1); + t = new_term(); + t->kind = TERM_REGEX; + t->string = buf; + t->index = g->terminals.n; + t->regex_production = p; + vec_add(&g->terminals, t); + p->regex_term = t; + if (circular) { /* attempt to match to regex operators */ + if (p->rules.n != 2) + Lfail: d_fail("unable to resolve circular regex production: '%s'", p->name); + l = p->rules.v[0]->elems.n + p->rules.v[1]->elems.n; + if (l == 2 || l == 3) { + if (p->rules.v[0]->elems.n != 2 && p->rules.v[1]->elems.n != 2) + goto Lfail; + r = p->rules.v[0]->elems.n == 2 ? p->rules.v[0] : p->rules.v[1]; + rr = p->rules.v[0] == r ? p->rules.v[1] : p->rules.v[0]; + if (r->elems.v[0]->e.nterm != p && r->elems.v[1]->e.nterm != p) + goto Lfail; + e = r->elems.v[0]->e.nterm == p ? r->elems.v[1] : r->elems.v[1]; + if (rr->elems.n && e->e.term_or_nterm != rr->elems.v[0]->e.term_or_nterm) + goto Lfail; + t = e->kind == ELEM_TERM ? e->e.term : e->e.nterm->regex_term; + *b++ = '('; + if (t->kind == TERM_STRING) + s = escape_string_for_regex(t->string); + else + s = t->string; + memcpy(b, s, strlen(s)); b += strlen(s); + if (t->kind == TERM_STRING) + FREE(s); + *b++ = ')'; + if (l == 2) + *b++ = '*'; + else + *b++ = '+'; + *b = 0; + p->regex_term->string_len = strlen(p->regex_term->string); + } else + goto Lfail; + } else { /* handle the base case, p = (r | r'), r = (e e') */ + if (p->rules.n > 1) + *b++ = '('; + for (j = 0; j < p->rules.n; j++) { + r = p->rules.v[j]; + if (r->elems.n > 1) + *b++ = '('; + for (k = 0; k < r->elems.n; k++) { + e = r->elems.v[k]; + t = e->kind == ELEM_TERM ? e->e.term : e->e.nterm->regex_term; + if (t->kind == TERM_STRING) + s = escape_string_for_regex(t->string); + else + s = t->string; + memcpy(b, s, strlen(s)); b += strlen(s); + if (t->kind == TERM_STRING) + FREE(s); + } + if (r->elems.n > 1) + *b++ = ')'; + if (j != p->rules.n - 1) + *b++ = '|'; + } + if (p->rules.n > 1) + *b++ = ')'; + *b = 0; + p->regex_term->string_len = strlen(p->regex_term->string); + } + p->in_regex = 0; + } + + static void + convert_regex_productions(Grammar *g) { + int i, j, k; + Production *p; + Rule *r; + + for (i = 0; i < g->productions.n; i++) { + p = g->productions.v[i]; + if (!p->regex) + continue; + convert_regex_production_one(g, p); + } + for (i = 0; i < g->productions.n; i++) { + p = g->productions.v[i]; + for (j = 0; j < p->rules.n; j++) { + r = p->rules.v[j]; + for (k = 0; k < r->elems.n; k++) { + if (r->elems.v[k]->kind == ELEM_NTERM && r->elems.v[k]->e.nterm->regex_term) { + r->elems.v[k]->e.term = r->elems.v[k]->e.nterm->regex_term; + r->elems.v[k]->kind = ELEM_TERM; + } + } + } + } + } + + static void + check_default_actions(Grammar *g) { + Production *pdefault; + + pdefault = lookup_production(g, "_", 1); + if (pdefault && pdefault->rules.n > 1) + d_fail("number of rules in default action != 1"); + } + + typedef struct { + struct State *eq; + struct Rule *diff_rule; + struct State *diff_state; + } EqState; + + void + build_eq(Grammar *g) { + int i, j, k, changed = 1, x, xx; + State *s, *ss; + EqState *eq, *e, *ee; + + eq = (EqState*)MALLOC(sizeof(EqState)*g->states.n); + memset(eq, 0, sizeof(EqState)*g->states.n); + while (changed) { + changed = 0; + for (i = 0; i < g->states.n; i++) { + s = g->states.v[i]; + e = &eq[s->index]; + for (j = i + 1; j < g->states.n; j++) { + ss = g->states.v[j]; + ee = &eq[ss->index]; + if (e->eq || ee->eq) + continue; + if (s->same_shifts != ss->same_shifts && ss->same_shifts != s) + continue; + /* check gotos */ + if (s->gotos.n != ss->gotos.n) + continue; + for (k = 0; k < s->gotos.n; k++) { + if (elem_symbol(g, s->gotos.v[k]->elem) != elem_symbol(g, ss->gotos.v[k]->elem)) + goto Lcontinue; + if (s->gotos.v[k]->state != ss->gotos.v[k]->state) { + EqState *ge = &eq[s->gotos.v[k]->state->index]; + EqState *gee = &eq[ss->gotos.v[k]->state->index]; + if (ge->eq != ss->gotos.v[k]->state && gee->eq != s->gotos.v[k]->state) + goto Lcontinue; + if ((ee->diff_state && ee->diff_state != eq[ss->gotos.v[k]->state->index].eq) || + (e->diff_state && e->diff_state != eq[s->gotos.v[k]->state->index].eq)) + goto Lcontinue; + /* allow one different state */ + ee->diff_state = ss->gotos.v[k]->state; + e->diff_state = s->gotos.v[k]->state; + } + } + /* check reductions */ + if (s->reduce_actions.n != ss->reduce_actions.n) + continue; + for (k = 0; k < s->reduce_actions.n; k++) { + if (s->reduce_actions.v[k]->rule == ss->reduce_actions.v[k]->rule) + continue; + if (s->reduce_actions.v[k]->rule->prod != + ss->reduce_actions.v[k]->rule->prod) + goto Lcontinue; + if ((x = s->reduce_actions.v[k]->rule->elems.n) != + (xx = ss->reduce_actions.v[k]->rule->elems.n)) { + if ((ee->diff_rule && ee->diff_rule != ss->reduce_actions.v[k]->rule) || + (e->diff_rule && e->diff_rule != s->reduce_actions.v[k]->rule)) + goto Lcontinue; + /* allow one different rule */ + ee->diff_rule = ss->reduce_actions.v[k]->rule; + e->diff_rule = s->reduce_actions.v[k]->rule; + } + } + ee->eq = s; + changed = 1; + Lcontinue:; + } + } + } + for (i = 0; i < g->states.n; i++) { + s = g->states.v[i]; + e = &eq[s->index]; + if (e->eq) { + if (verbose_level > 2) { + printf("eq %d %d ", s->index, e->eq->index); + if (e->diff_state) + printf("diff state (%d %d) ", + e->diff_state->index, + eq[e->eq->index].diff_state->index); + if (e->diff_rule) { + printf("diff rule "); + printf("[ "); + print_rule(e->diff_rule); + printf("][ "); + print_rule(eq[e->eq->index].diff_rule); + printf("]"); + } + printf("\n"); + } + } + } + for (i = 0; i < g->states.n; i++) { + s = g->states.v[i]; + e = &eq[s->index]; + if (e->eq && e->diff_state) { + if (eq[e->diff_state->index].diff_rule && + eq[e->diff_state->index].diff_rule->elems.n == 2) + { + s->reduces_to = e->eq; + s->reduces_with = eq[e->eq->index].diff_rule; + s->reduces_to_then_with = e->diff_rule; + } else if (eq[eq[e->eq->index].diff_state->index].diff_rule && + eq[eq[e->eq->index].diff_state->index].diff_rule->elems.n == 2) + { + e->eq->reduces_to = s; + s->reduces_with = e->diff_rule; + s->reduces_to_then_with = eq[e->eq->index].diff_rule; + } + } + } + for (i = 0; i < g->states.n; i++) { + s = g->states.v[i]; + if (s->reduces_to) + if (verbose_level) + printf("reduces_to %d %d\n", s->index, s->reduces_to->index); + } + FREE(eq); + } + + Grammar * + new_D_Grammar(char *pathname) { + Grammar *g = (Grammar *)MALLOC(sizeof(Grammar)); + memset(g, 0, sizeof(Grammar)); + g->pathname = dup_str(pathname, pathname + strlen(pathname)); + return g; + } + + void + free_D_Grammar(Grammar *g) { + FREE(g->pathname); + } + + int + parse_grammar(Grammar *g, D_ParserTables *t, int sizeof_ParseNode_User) { + FILE *fp = fopen(g->pathname, "r"); + char *s; + D_Parser *p; + + if (!fp) + return -1; + if (!(s = sbuf_read(g->pathname))) + return -1; + initialize_productions(g); + p = new_D_Parser(t, sizeof_ParseNode_User); + p->initial_globals = g; + p->loc.pathname = g->pathname; + if (dparse(p, s, strlen(s))) { + if (g->productions.n > 2) + finish_productions(g); + return 0; + } else + return -1; + } + + static int + scanner_declaration(Declaration *d) { + switch (d->kind) { + case DECLARE_TOKENIZE: + case DECLARE_LONGEST_MATCH: + case DECLARE_ALL_MATCHES: + return 1; + default: + return 0; + } + } + + static void + set_declaration_group(Production *p, Production *root, Declaration *d) { + int i, j; + if (p->declaration_group[d->kind] == root) + return; + if (d->kind == DECLARE_TOKENIZE && p->declaration_group[d->kind]) { + d_fail("shared tokenize subtrees"); + return; + } + p->declaration_group[d->kind] = root; + p->last_declaration[d->kind] = d; + for (i = 0; i < p->rules.n; i++) { + for (j = 0; j < p->rules.v[i]->elems.n; j++) + if (p->rules.v[i]->elems.v[j]->kind == ELEM_NTERM) + set_declaration_group(p->rules.v[i]->elems.v[j]->e.nterm, root, d); + } + } + + static void + propogate_declarations(Grammar *g) { + int i, j, k; + Production *p; + Rule *r; + Elem *e; + + /* global defaults */ + if (g->tokenizer) + new_declaration(g, new_elem_nterm(g->productions.v[0], NULL), DECLARE_TOKENIZE); + if (g->longest_match) + new_declaration(g, new_elem_nterm(g->productions.v[0], NULL), DECLARE_LONGEST_MATCH); + /* resolve declarations */ + for (i = 0; i < g->declarations.n; i++) { + e = g->declarations.v[i]->elem; + if (e->kind == ELEM_UNRESOLVED) { + if (!(p = lookup_production(g, e->e.unresolved.string, e->e.unresolved.len))) + d_fail("unresolved declaration '%s'", e->e.unresolved.string); + e->kind = ELEM_NTERM; + e->e.nterm = p; + } + } + /* build declaration groups (covering a production subtrees) */ + for (i = 0; i < g->declarations.n; i++) { + if (scanner_declaration(g->declarations.v[i])) { + p = g->declarations.v[i]->elem->e.nterm; + set_declaration_group(p, p, g->declarations.v[i]); + } + } + /* set terminal scan_kind */ + for (i = 0; i < g->productions.n; i++) { + p = g->productions.v[i]; + for (j = 0; j < p->rules.n; j++) { + r = p->rules.v[j]; + for (k = 0; k < r->elems.n; k++) { + e = r->elems.v[k]; + if (e->kind == ELEM_TERM) { + if (!p->declaration_group[DECLARE_LONGEST_MATCH] && + !p->declaration_group[DECLARE_ALL_MATCHES]) + e->e.term->scan_kind = D_SCAN_DEFAULT; + else if (p->declaration_group[DECLARE_LONGEST_MATCH] && + !p->declaration_group[DECLARE_ALL_MATCHES]) + e->e.term->scan_kind = D_SCAN_LONGEST; + else if (!p->declaration_group[DECLARE_LONGEST_MATCH] && + p->declaration_group[DECLARE_ALL_MATCHES]) + e->e.term->scan_kind = D_SCAN_ALL; + else { + if (p->last_declaration[DECLARE_LONGEST_MATCH]->index > + p->last_declaration[DECLARE_ALL_MATCHES]->index) + e->e.term->scan_kind = D_SCAN_LONGEST; + else + e->e.term->scan_kind = D_SCAN_ALL; + } + } + } + } + } + } + + static void + merge_shift_actions(State *to, State *from) { + int i, j; + for (i = 0; i < from->shift_actions.n; i++) { + for (j = 0; j < to->shift_actions.n; j++) + if (from->shift_actions.v[i]->term == to->shift_actions.v[j]->term) + goto Lnext; + vec_add(&to->shift_actions, from->shift_actions.v[i]); + Lnext:; + } + } + + static void + compute_declaration_states(Grammar *g, Production *p, Declaration *d) { + State *s, *base_s = NULL; + int j, k, scanner = scanner_declaration(d); + + for (j = 0; j < g->states.n; j++) { + s = g->states.v[j]; + if (d->kind == DECLARE_TOKENIZE) { + if (!base_s) + base_s = s; + else { + s->same_shifts = base_s; + merge_shift_actions(base_s, s); + } + } + if (scanner) { + for (k = 0; k < s->items.n; k++) + if (s->items.v[k]->kind == ELEM_TERM) + switch (s->items.v[k]->e.term->scan_kind) { + case D_SCAN_LONGEST: + if (s->scan_kind == D_SCAN_RESERVED || + s->scan_kind == D_SCAN_LONGEST) + s->scan_kind = D_SCAN_LONGEST; + else + s->scan_kind = D_SCAN_MIXED; + break; + case D_SCAN_ALL: + if (s->scan_kind == D_SCAN_RESERVED || + s->scan_kind == D_SCAN_ALL) + s->scan_kind = D_SCAN_ALL; + else + s->scan_kind = D_SCAN_MIXED; + break; + default: + break; + } + } + } + } + + static void + map_declarations_to_states(Grammar *g) { + int i; + State *s; + + for (i = 0; i < g->states.n; i++) { + s = g->states.v[i]; + s->scan_kind = D_SCAN_RESERVED; + } + /* map groups to sets of states */ + for (i = 0; i < g->declarations.n; i++) + if (scanner_declaration(g->declarations.v[i])) + compute_declaration_states(g, g->declarations.v[i]->elem->e.nterm, + g->declarations.v[i]); + for (i = 0; i < g->states.n; i++) { + s = g->states.v[i]; + if (s->scan_kind == D_SCAN_RESERVED) + s->scan_kind = D_SCAN_DEFAULT; /* set the default */ + } + } + + int + build_grammar(Grammar *g) { + resolve_grammar(g); + convert_regex_productions(g); + propogate_declarations(g); + merge_identical_terminals(g); + make_elems_for_productions(g); + check_default_actions(g); + build_LR_tables(g); + map_declarations_to_states(g); + if (verbose_level) { + printf("%d productions %d terminals %d states %d declarations\n", + g->productions.n, g->terminals.n, g->states.n, + g->declarations.n); + } + if (verbose_level > 1) { + print_grammar(g); + print_states(g); + } + build_scanners(g); + build_eq(g); + return 0; + } Index: llvm/test/Programs/MultiSource/Applications/d/gram.h diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/gram.h:1.1 *** /dev/null Thu Jan 1 10:50:46 2004 --- llvm/test/Programs/MultiSource/Applications/d/gram.h Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,268 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + + #ifndef _gram_H_ + #define _gram_H_ + + #define EOF_SENTINAL "\377" + #define NO_PROD 0xFFFFFFFF + + struct Production; + struct Rule; + struct Elem; + struct Term; + struct State; + struct ScanState; + struct ScanStateTransition; + struct D_ParserTables; + + typedef struct Elem Item; + + typedef struct Code { + char *code; + int line; + } Code; + + typedef struct Goto { + struct Elem *elem; + struct State *state; + } Goto; + typedef Vec(Goto *) VecGoto; + + typedef enum ActionKind { + ACTION_ACCEPT, ACTION_SHIFT, ACTION_REDUCE + } ActionKind; + typedef struct Action { + ActionKind kind; + struct Term *term; + struct Rule *rule; + struct State *state; + uint index; + char *temp_string; + } Action; + typedef Vec(Action *) VecAction; + + typedef struct Hint { + uint depth; + struct State *state; + struct Rule *rule; + } Hint; + typedef Vec(Hint *) VecHint; + + typedef Vec(struct ScanStateTransition*) VecScanStateTransition; + typedef Vec(struct ScanState *) VecScanState; + + typedef struct Scanner { + VecScanState states; + VecScanStateTransition transitions; + } Scanner; + + typedef struct State { + uint index; + uint64 hash; + Vec(Item*) items; + Vec(Item*) items_hash; + VecGoto gotos; + VecAction shift_actions; + VecAction reduce_actions; + VecHint right_epsilon_hints; + VecHint error_recovery_hints; + Scanner scanner; + uint accept:1; + uint scanner_code:1; + uint goto_on_token:1; + uint scan_kind:2; + uint8 *goto_valid; + int goto_table_offset; + struct State *same_shifts; + struct State *reduces_to; + struct Rule *reduces_with; + struct Rule *reduces_to_then_with; + } State; + + #define ASSOC_LEFT 0x0001 + #define ASSOC_RIGHT 0x0002 + #define ASSOC_NARY 0x0004 + #define ASSOC_UNARY 0x0008 + #define ASSOC_BINARY 0x0010 + + typedef enum AssocKind { + ASSOC_NONE = 0, + ASSOC_NARY_LEFT = (ASSOC_NARY|ASSOC_LEFT), + ASSOC_NARY_RIGHT = (ASSOC_NARY|ASSOC_RIGHT), + ASSOC_UNARY_LEFT = (ASSOC_UNARY|ASSOC_LEFT), + ASSOC_UNARY_RIGHT = (ASSOC_UNARY|ASSOC_RIGHT), + ASSOC_BINARY_LEFT = (ASSOC_BINARY|ASSOC_LEFT), + ASSOC_BINARY_RIGHT = (ASSOC_BINARY|ASSOC_RIGHT), + ASSOC_NO = 0x0020 + } AssocKind; + #define IS_RIGHT_ASSOC(_x) ((_x) & ASSOC_RIGHT) + #define IS_LEFT_ASSOC(_x) ((_x) & ASSOC_LEFT) + #define IS_NARY_ASSOC(_x) ((_x) & ASSOC_NARY) + #define IS_BINARY_ASSOC(_x) ((_x) & ASSOC_BINARY) + #define IS_UNARY_ASSOC(_x) ((_x) & ASSOC_UNARY) + #define IS_UNARY_BINARY_ASSOC(_x) (IS_BINARY_ASSOC(_x) || IS_UNARY_ASSOC(_x)) + #define IS_BINARY_NARY_ASSOC(_x) (IS_BINARY_ASSOC(_x) || IS_NARY_ASSOC(_x)) + /* not valid for NARY */ + #define IS_EXPECT_RIGHT_ASSOC(_x) ((_x) && (_x) != ASSOC_UNARY_LEFT) + #define IS_EXPECT_LEFT_ASSOC(_x) ((_x) && _x != ASSOC_UNARY_RIGHT) + typedef struct Rule { + uint index; + struct Production *prod; + int op_priority; + AssocKind op_assoc; + int rule_priority; + AssocKind rule_assoc; + Vec(struct Elem*) elems; + struct Elem *end; + Code speculative_code; + Code final_code; + Vec(Code*) pass_code; + int action_index; + struct Rule *same_reduction; + } Rule; + + typedef enum TermKind { + TERM_STRING, TERM_REGEX, TERM_CODE, TERM_TOKEN + } TermKind; + typedef struct Term { + TermKind kind; + uint index; + int term_priority; + AssocKind op_assoc; + int op_priority; + char *string; + int string_len; + uint scan_kind:3; + uint ignore_case:1; + struct Production *regex_production; + } Term; + + typedef Vec(Term *) TermVec; + + typedef enum DeclarationKind { + DECLARE_TOKENIZE, DECLARE_LONGEST_MATCH, DECLARE_ALL_MATCHES, + DECLARE_SET_OP_PRIORITY, DECLARE_STATES_FOR_ALL_NTERMS, + DECLARE_STATE_FOR, DECLARE_WHITESPACE, DECLARE_SAVE_PARSE_TREE, DECLARE_NUM + } DeclarationKind; + typedef struct Declaration { + struct Elem * elem; + uint kind; + uint index; + } Declaration; + + typedef enum InternalKind { + INTERNAL_NOT, INTERNAL_HIDDEN, INTERNAL_CONDITIONAL, INTERNAL_STAR, INTERNAL_PLUS + } InternalKind; + + typedef struct Production { + char *name; + uint name_len; + Vec(Rule *) rules; + uint index; + uint regex:1; + uint in_regex:1; + uint internal:3; /* production used for EBNF */ + Rule *nullable; /* shortest rule for epsilon reduction */ + struct Production *declaration_group[DECLARE_NUM]; + struct Declaration *last_declaration[DECLARE_NUM]; + State *state; /* state for independent parsing of this productions*/ + struct Elem *elem; /* base elem for the item set of the above state */ + struct Term *regex_term; /* regex production terminal */ + struct Production *next; + } Production; + + typedef enum ElemKind { + ELEM_NTERM, ELEM_TERM, ELEM_UNRESOLVED, ELEM_END + } ElemKind; + typedef struct Elem { + ElemKind kind; + uint index; + Rule *rule; + union { + Production *nterm; + Term *term; + void *term_or_nterm; + struct Unresolved { + char *string; + uint len; + } unresolved; + } e; + } Elem; + + typedef struct Grammar { + char *pathname; + Vec(Production *) productions; + Vec(Term *) terminals; + Vec(State *) states; + Code scanner; + Code *code; + int ncode; + Vec(Declaration *) declarations; + Vec(D_Pass *) passes; + char *default_white_space; + /* grammar construction options */ + int set_op_priority_from_rule; + int right_recursive_BNF; + int states_for_whitespace; + int states_for_all_nterms; + int tokenizer; + int longest_match; + int save_parse_tree; + /* grammar writing options */ + char grammar_ident[256]; + int scanner_blocks; + int scanner_block_size; + int write_line_directives; + int write_header; + int token_type; + /* temporary variables for grammar construction */ + struct Production * p; + struct Rule * r; + struct Elem * e; + int action_index; + int action_count; + int pass_index; + int rule_index; + } Grammar; + + /* automatically add %op_XXX to rightmost token of %XXX rule, default off */ + + Grammar *new_D_Grammar(char *pathname); + void free_D_Grammar(Grammar *g); + int build_grammar(Grammar *g); + int parse_grammar(Grammar *g, D_ParserTables *t, int sizeof_ParseNode_User); + void print_grammar(Grammar *g); + void print_states(Grammar *g); + void print_rule(Rule *r); + void print_term(Term *t); + Production *lookup_production(Grammar *g, char *name, int len); + + /* for creating grammars */ + #define last_elem(_r) ((_r)->elems.v[(_r)->elems.n-1]) + + Rule *new_rule(Grammar *g, Production *p); + Elem *new_elem_nterm(Production *p, Rule *r); + void new_declaration(Grammar *g, Elem *e, uint kind); + Production *new_production(Grammar *g, char *name); + Elem *new_string(Grammar *g, char *s, char *e, Rule *r); + Elem *new_ident(char *s, char *e, Rule *r); + void new_token(Grammar *g, char *s, char *e); + Elem *new_code(Grammar *g, char *s, char *e, Rule *r); + void add_global_code(Grammar *g, char *start, char *end, int line); + Production *new_internal_production(Grammar *g, Production *p); + Elem * dup_elem(Elem *e, Rule *r); + void add_declaration(Grammar *g, char *start, char *end, uint kind, uint line); + void add_pass(Grammar *g, char *start, char *end, uint kind, uint line); + void add_pass_code(Grammar *g, Rule *r, char *pass_start, char *pass_end, + char *code_start, char *code_end, uint line, uint pass_line); + D_Pass *find_pass(Grammar *g, char *start, char *end); + void conditional_EBNF(Grammar *g); /* applied to g->e,g->r,g->p */ + void star_EBNF(Grammar *g); /* ditto */ + void plus_EBNF(Grammar *g); /* ditto */ + void initialize_productions(Grammar *g); + void finalize_productions(Grammar *g); + int state_for_declaration(Grammar *g, int iproduction); + + #endif Index: llvm/test/Programs/MultiSource/Applications/d/gramgram.h diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/gramgram.h:1.1 *** /dev/null Thu Jan 1 10:50:46 2004 --- llvm/test/Programs/MultiSource/Applications/d/gramgram.h Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,18 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + struct Production; + struct Rule; + struct Elem; + + typedef struct ParseNode_User { + struct Production *p; + struct Rule *r; + struct Elem *e; + unsigned int kind; + } ParseNode_User; + + #define D_ParseNode_User ParseNode_User + + #define D_ParseNode_Globals struct Grammar + Index: llvm/test/Programs/MultiSource/Applications/d/grammar.g.c diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/grammar.g.c:1.1 *** /dev/null Thu Jan 1 10:50:46 2004 --- llvm/test/Programs/MultiSource/Applications/d/grammar.g.c Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,5697 ---- + #line 4 "grammar.g" + + #include "gramgram.h" + #include "d.h" + + #include "dparse.h" + + D_Reduction d_reduction_0_dparser_gram = {1, 0, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_1_dparser_gram = {1, 1, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_2_dparser_gram = {2, 2, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_3_dparser_gram = {2, 3, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_4_dparser_gram = {1, 3, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_5_dparser_gram = {2, 4, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_6_dparser_gram = {2, 5, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_7_dparser_gram = {0, 5, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_8_dparser_gram = {2, 6, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_9_dparser_gram = {0, 6, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + int d_final_reduction_code_7_10_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 11 "grammar.g" + + add_global_code((D_PN(_ps, _offset)->globals), (*(D_PN(_children[0], _offset))).start_loc.s+1, (*(D_PN(_children[0], _offset))).end-1, + (*(D_PN(_children[0], _offset))).start_loc.line); + return 0;} + + D_Reduction d_reduction_10_dparser_gram = {1, 7, NULL, d_final_reduction_code_7_10_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_7_11_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 15 "grammar.g" + + (D_PN(_ps, _offset)->globals)->scanner.code = dup_str((*(D_PN(_children[1], _offset))).start_loc.s, (*(D_PN(_children[1], _offset))).end); + (D_PN(_ps, _offset)->globals)->scanner.line = (*(D_PN(_children[0], _offset))).start_loc.line; + return 0;} + + D_Reduction d_reduction_11_dparser_gram = {3, 7, NULL, d_final_reduction_code_7_11_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_7_12_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 19 "grammar.g" + + if (!d_get_number_of_children(&(*(D_PN(_children[2], _offset))))) + add_declaration((D_PN(_ps, _offset)->globals), (*(D_PN(_children[2], _offset))).start_loc.s, (*(D_PN(_children[2], _offset))).end, (D_PN(_children[1], _offset)->user).kind, (*(D_PN(_children[2], _offset))).start_loc.line); + else { + int i, n = d_get_number_of_children(&(*(D_PN(_children[2], _offset)))); + for (i = 0; i < n; i++) { + D_ParseNode *pn = d_get_child(&(*(D_PN(_children[2], _offset))), i); + add_declaration((D_PN(_ps, _offset)->globals), pn->start_loc.s, pn->end, (D_PN(_children[1], _offset)->user).kind, pn->start_loc.line); + } + } + return 0;} + + D_Reduction d_reduction_12_dparser_gram = {4, 7, NULL, d_final_reduction_code_7_12_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_13_dparser_gram = {3, 7, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_7_14_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 31 "grammar.g" + (D_PN(_ps, _offset)->globals)->action_index++; return 0;} + + D_Reduction d_reduction_14_dparser_gram = {1, 7, NULL, d_final_reduction_code_7_14_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_7_15_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 32 "grammar.g" + + add_pass((D_PN(_ps, _offset)->globals), (*(D_PN(_children[1], _offset))).start_loc.s, (*(D_PN(_children[1], _offset))).end, (D_PN(_children[2], _offset)->user).kind, (*(D_PN(_children[1], _offset))).start_loc.line); + return 0;} + + D_Reduction d_reduction_15_dparser_gram = {4, 7, NULL, d_final_reduction_code_7_15_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_16_dparser_gram = {2, 8, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_17_dparser_gram = {1, 8, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_18_dparser_gram = {2, 9, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_19_dparser_gram = {0, 9, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_20_dparser_gram = {2, 10, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_21_dparser_gram = {1, 10, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_22_dparser_gram = {0, 11, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_11_23_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 38 "grammar.g" + (D_PN(_ps, _offset)->user).kind = (D_PN(_children[0], _offset)->user).kind | (D_PN(_children[1], _offset)->user).kind; return 0;} + + D_Reduction d_reduction_23_dparser_gram = {2, 11, NULL, d_final_reduction_code_11_23_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_12_24_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 41 "grammar.g" + (D_PN(_ps, _offset)->user).kind |= D_PASS_PRE_ORDER; return 0;} + + D_Reduction d_reduction_24_dparser_gram = {1, 12, NULL, d_final_reduction_code_12_24_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_12_25_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 42 "grammar.g" + (D_PN(_ps, _offset)->user).kind |= D_PASS_POST_ORDER; return 0;} + + D_Reduction d_reduction_25_dparser_gram = {1, 12, NULL, d_final_reduction_code_12_25_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_12_26_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 43 "grammar.g" + (D_PN(_ps, _offset)->user).kind |= D_PASS_MANUAL; return 0;} + + D_Reduction d_reduction_26_dparser_gram = {1, 12, NULL, d_final_reduction_code_12_26_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_12_27_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 44 "grammar.g" + (D_PN(_ps, _offset)->user).kind |= D_PASS_FOR_ALL; return 0;} + + D_Reduction d_reduction_27_dparser_gram = {1, 12, NULL, d_final_reduction_code_12_27_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_12_28_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 45 "grammar.g" + (D_PN(_ps, _offset)->user).kind |= D_PASS_FOR_UNDEFINED; return 0;} + + D_Reduction d_reduction_28_dparser_gram = {1, 12, NULL, d_final_reduction_code_12_28_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_13_29_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 48 "grammar.g" + (D_PN(_ps, _offset)->user).kind = DECLARE_TOKENIZE; return 0;} + + D_Reduction d_reduction_29_dparser_gram = {1, 13, NULL, d_final_reduction_code_13_29_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_13_30_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 49 "grammar.g" + (D_PN(_ps, _offset)->user).kind = DECLARE_LONGEST_MATCH; return 0;} + + D_Reduction d_reduction_30_dparser_gram = {1, 13, NULL, d_final_reduction_code_13_30_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_13_31_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 50 "grammar.g" + (D_PN(_ps, _offset)->user).kind = DECLARE_WHITESPACE; return 0;} + + D_Reduction d_reduction_31_dparser_gram = {1, 13, NULL, d_final_reduction_code_13_31_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_13_32_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 51 "grammar.g" + (D_PN(_ps, _offset)->user).kind = DECLARE_ALL_MATCHES; return 0;} + + D_Reduction d_reduction_32_dparser_gram = {1, 13, NULL, d_final_reduction_code_13_32_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_13_33_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 52 "grammar.g" + (D_PN(_ps, _offset)->user).kind = DECLARE_SET_OP_PRIORITY; return 0;} + + D_Reduction d_reduction_33_dparser_gram = {1, 13, NULL, d_final_reduction_code_13_33_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_13_34_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 53 "grammar.g" + (D_PN(_ps, _offset)->user).kind = DECLARE_STATES_FOR_ALL_NTERMS; return 0;} + + D_Reduction d_reduction_34_dparser_gram = {1, 13, NULL, d_final_reduction_code_13_34_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_13_35_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 54 "grammar.g" + (D_PN(_ps, _offset)->user).kind = DECLARE_STATE_FOR; return 0;} + + D_Reduction d_reduction_35_dparser_gram = {1, 13, NULL, d_final_reduction_code_13_35_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_13_36_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 55 "grammar.g" + (D_PN(_ps, _offset)->user).kind = DECLARE_SAVE_PARSE_TREE; return 0;} + + D_Reduction d_reduction_36_dparser_gram = {1, 13, NULL, d_final_reduction_code_13_36_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_14_37_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 58 "grammar.g" + new_token((D_PN(_ps, _offset)->globals), (*(D_PN(_children[0], _offset))).start_loc.s, (*(D_PN(_children[0], _offset))).end); return 0;} + + D_Reduction d_reduction_37_dparser_gram = {1, 14, NULL, d_final_reduction_code_14_37_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_38_dparser_gram = {4, 15, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_40_dparser_gram = {1, 15, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_16_41_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 63 "grammar.g" + (D_PN(_ps, _offset)->globals)->p->regex = 1; return 0;} + + D_Reduction d_reduction_41_dparser_gram = {1, 16, NULL, d_final_reduction_code_16_41_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_17_42_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 66 "grammar.g" + (D_PN(_ps, _offset)->globals)->p = new_production((D_PN(_ps, _offset)->globals), dup_str((*(D_PN(_children[0], _offset))).start_loc.s, (*(D_PN(_children[0], _offset))).end)); return 0;} + + D_Reduction d_reduction_42_dparser_gram = {1, 17, NULL, d_final_reduction_code_17_42_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_43_dparser_gram = {1, 18, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_45_dparser_gram = {2, 19, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_46_dparser_gram = {2, 20, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_47_dparser_gram = {0, 20, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_48_dparser_gram = {2, 21, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + int d_final_reduction_code_22_49_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 71 "grammar.g" + + vec_add(&(D_PN(_ps, _offset)->globals)->p->rules, (D_PN(_ps, _offset)->globals)->r); + return 0;} + + D_Reduction d_reduction_49_dparser_gram = {4, 22, NULL, d_final_reduction_code_22_49_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_50_dparser_gram = {2, 23, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_51_dparser_gram = {0, 23, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_52_dparser_gram = {1, 24, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_53_dparser_gram = {0, 24, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_54_dparser_gram = {3, 25, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_55_dparser_gram = {2, 26, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_56_dparser_gram = {0, 26, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_57_dparser_gram = {2, 27, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_58_dparser_gram = {0, 27, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_59_dparser_gram = {2, 28, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_60_dparser_gram = {2, 29, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_61_dparser_gram = {0, 29, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + int d_final_reduction_code_30_62_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 75 "grammar.g" + (D_PN(_ps, _offset)->globals)->r = new_rule((D_PN(_ps, _offset)->globals), (D_PN(_ps, _offset)->globals)->p); return 0;} + + D_Reduction d_reduction_62_dparser_gram = {0, 30, NULL, d_final_reduction_code_30_62_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_31_63_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 78 "grammar.g" + (D_PN(_ps, _offset)->globals)->e = new_string((D_PN(_ps, _offset)->globals), (*(D_PN(_children[0], _offset))).start_loc.s, (*(D_PN(_children[0], _offset))).end, (D_PN(_ps, _offset)->globals)->r); return 0;} + + D_Reduction d_reduction_63_dparser_gram = {1, 31, NULL, d_final_reduction_code_31_63_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_31_64_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 79 "grammar.g" + (D_PN(_ps, _offset)->globals)->e = new_string((D_PN(_ps, _offset)->globals), (*(D_PN(_children[0], _offset))).start_loc.s, (*(D_PN(_children[0], _offset))).end, (D_PN(_ps, _offset)->globals)->r); return 0;} + + D_Reduction d_reduction_64_dparser_gram = {1, 31, NULL, d_final_reduction_code_31_64_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_31_65_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 80 "grammar.g" + (D_PN(_ps, _offset)->globals)->e = new_ident((*(D_PN(_children[0], _offset))).start_loc.s, (*(D_PN(_children[0], _offset))).end, (D_PN(_ps, _offset)->globals)->r); return 0;} + + D_Reduction d_reduction_65_dparser_gram = {1, 31, NULL, d_final_reduction_code_31_65_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_31_66_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 81 "grammar.g" + (D_PN(_ps, _offset)->globals)->e = new_code((D_PN(_ps, _offset)->globals), (*(D_PN(_children[1], _offset))).start_loc.s, (*(D_PN(_children[1], _offset))).end, (D_PN(_ps, _offset)->globals)->r); return 0;} + + D_Reduction d_reduction_66_dparser_gram = {3, 31, NULL, d_final_reduction_code_31_66_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_31_67_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 82 "grammar.g" + + (D_PN(_ps, _offset)->globals)->e = new_elem_nterm((D_PN(_ps, _offset)->globals)->p, (D_PN(_children[1], _offset)->user).r); + (D_PN(_ps, _offset)->globals)->p = (D_PN(_children[1], _offset)->user).p; + (D_PN(_ps, _offset)->globals)->r = (D_PN(_children[1], _offset)->user).r; + vec_add(&(D_PN(_ps, _offset)->globals)->r->elems, (D_PN(_ps, _offset)->globals)->e); + return 0;} + + D_Reduction d_reduction_67_dparser_gram = {4, 31, NULL, d_final_reduction_code_31_67_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_68_dparser_gram = {2, 32, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_69_dparser_gram = {1, 32, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_70_dparser_gram = {1, 33, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_33_71_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 92 "grammar.g" + + Production *p = new_internal_production((D_PN(_ps, _offset)->globals), NULL); + Rule *r = new_rule((D_PN(_ps, _offset)->globals), p); + vec_add(&p->rules, r); + r->speculative_code.code = dup_str((*(D_PN(_children[0], _offset))).start_loc.s + 1, (*(D_PN(_children[0], _offset))).end - 1); + r->speculative_code.line = (*(D_PN(_children[0], _offset))).start_loc.line; + (D_PN(_ps, _offset)->globals)->e = new_elem_nterm(p, (D_PN(_ps, _offset)->globals)->r); + vec_add(&(D_PN(_ps, _offset)->globals)->r->elems, (D_PN(_ps, _offset)->globals)->e); + return 0;} + + D_Reduction d_reduction_71_dparser_gram = {1, 33, NULL, d_final_reduction_code_33_71_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_33_72_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 101 "grammar.g" + + Production *p = new_internal_production((D_PN(_ps, _offset)->globals), NULL); + Rule *r = new_rule((D_PN(_ps, _offset)->globals), p); + vec_add(&p->rules, r); + r->final_code.code = dup_str((*(D_PN(_children[0], _offset))).start_loc.s + 1, (*(D_PN(_children[0], _offset))).end - 1); + r->final_code.line = (*(D_PN(_children[0], _offset))).start_loc.line; + (D_PN(_ps, _offset)->globals)->e = new_elem_nterm(p, (D_PN(_ps, _offset)->globals)->r); + vec_add(&(D_PN(_ps, _offset)->globals)->r->elems, (D_PN(_ps, _offset)->globals)->e); + return 0;} + + D_Reduction d_reduction_72_dparser_gram = {1, 33, NULL, d_final_reduction_code_33_72_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_34_73_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 112 "grammar.g" + + (D_PN(_ps, _offset)->user).p = (D_PN(_ps, _offset)->globals)->p; + (D_PN(_ps, _offset)->user).r = (D_PN(_ps, _offset)->globals)->r; + (D_PN(_ps, _offset)->globals)->p = new_internal_production((D_PN(_ps, _offset)->globals), (D_PN(_ps, _offset)->globals)->p); + (D_PN(_ps, _offset)->globals)->r = new_rule((D_PN(_ps, _offset)->globals), (D_PN(_ps, _offset)->globals)->p); + return 0;} + + D_Reduction d_reduction_73_dparser_gram = {0, 34, NULL, d_final_reduction_code_34_73_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_35_74_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 120 "grammar.g" + + if ((D_PN(_ps, _offset)->globals)->e->kind != ELEM_TERM) + d_fail("terminal priority on non-terminal"); + (D_PN(_ps, _offset)->globals)->e->e.term->term_priority = strtol((*(D_PN(_children[1], _offset))).start_loc.s, NULL, 0); + return 0;} + + D_Reduction d_reduction_74_dparser_gram = {2, 35, NULL, d_final_reduction_code_35_74_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_35_75_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 125 "grammar.g" + + if ((D_PN(_ps, _offset)->globals)->e->kind != ELEM_TERM) + d_fail("ignore-case (/i) on non-terminal"); + (D_PN(_ps, _offset)->globals)->e->e.term->ignore_case = 1; + return 0;} + + D_Reduction d_reduction_75_dparser_gram = {1, 35, NULL, d_final_reduction_code_35_75_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_35_76_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 130 "grammar.g" + conditional_EBNF((D_PN(_ps, _offset)->globals)); return 0;} + + D_Reduction d_reduction_76_dparser_gram = {1, 35, NULL, d_final_reduction_code_35_76_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_35_77_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 131 "grammar.g" + star_EBNF((D_PN(_ps, _offset)->globals)); return 0;} + + D_Reduction d_reduction_77_dparser_gram = {1, 35, NULL, d_final_reduction_code_35_77_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_35_78_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 132 "grammar.g" + plus_EBNF((D_PN(_ps, _offset)->globals)); return 0;} + + D_Reduction d_reduction_78_dparser_gram = {1, 35, NULL, d_final_reduction_code_35_78_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_79_dparser_gram = {2, 36, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_37_80_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 137 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->op_assoc = ASSOC_UNARY_RIGHT; return 0;} + + D_Reduction d_reduction_80_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_80_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_37_81_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 138 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->op_assoc = ASSOC_UNARY_LEFT; return 0;} + + D_Reduction d_reduction_81_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_81_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_37_82_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 139 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->op_assoc = ASSOC_BINARY_RIGHT; return 0;} + + D_Reduction d_reduction_82_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_82_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_37_83_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 140 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->op_assoc = ASSOC_BINARY_LEFT; return 0;} + + D_Reduction d_reduction_83_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_83_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_37_84_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 141 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->rule_assoc = ASSOC_UNARY_RIGHT; return 0;} + + D_Reduction d_reduction_84_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_84_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_37_85_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 142 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->rule_assoc = ASSOC_UNARY_LEFT; return 0;} + + D_Reduction d_reduction_85_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_85_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_37_86_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 143 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->rule_assoc = ASSOC_BINARY_RIGHT; return 0;} + + D_Reduction d_reduction_86_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_86_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_37_87_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 144 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->rule_assoc = ASSOC_BINARY_LEFT; return 0;} + + D_Reduction d_reduction_87_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_87_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_37_88_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 145 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->rule_assoc = ASSOC_NARY_RIGHT; return 0;} + + D_Reduction d_reduction_88_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_88_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_37_89_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 146 "grammar.g" + (D_PN(_ps, _offset)->globals)->r->rule_assoc = ASSOC_NARY_LEFT; return 0;} + + D_Reduction d_reduction_89_dparser_gram = {1, 37, NULL, d_final_reduction_code_37_89_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_38_90_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 149 "grammar.g" + + if ((D_PN(_ps, _offset)->globals)->r->op_assoc) (D_PN(_ps, _offset)->globals)->r->op_priority = strtol((*(D_PN(_children[0], _offset))).start_loc.s, NULL, 0); + else (D_PN(_ps, _offset)->globals)->r->rule_priority = strtol((*(D_PN(_children[0], _offset))).start_loc.s, NULL, 0); + return 0;} + + D_Reduction d_reduction_90_dparser_gram = {1, 38, NULL, d_final_reduction_code_38_90_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_91_dparser_gram = {3, 39, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_92_dparser_gram = {2, 40, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_93_dparser_gram = {0, 40, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_94_dparser_gram = {1, 41, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_95_dparser_gram = {0, 41, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_96_dparser_gram = {1, 42, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_97_dparser_gram = {0, 42, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + int d_final_reduction_code_43_98_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 156 "grammar.g" + + (D_PN(_ps, _offset)->globals)->r->speculative_code.code = dup_str((*(D_PN(_children[0], _offset))).start_loc.s + 1, (*(D_PN(_children[0], _offset))).end - 1); + (D_PN(_ps, _offset)->globals)->r->speculative_code.line = (*(D_PN(_children[0], _offset))).start_loc.line; + return 0;} + + D_Reduction d_reduction_98_dparser_gram = {1, 43, NULL, d_final_reduction_code_43_98_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_44_99_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 161 "grammar.g" + + (D_PN(_ps, _offset)->globals)->r->final_code.code = dup_str((*(D_PN(_children[0], _offset))).start_loc.s + 1, (*(D_PN(_children[0], _offset))).end - 1); + (D_PN(_ps, _offset)->globals)->r->final_code.line = (*(D_PN(_children[0], _offset))).start_loc.line; + return 0;} + + D_Reduction d_reduction_99_dparser_gram = {1, 44, NULL, d_final_reduction_code_44_99_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + int d_final_reduction_code_45_100_dparser_gram(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser) { + #line 166 "grammar.g" + + add_pass_code((D_PN(_ps, _offset)->globals), (D_PN(_ps, _offset)->globals)->r, (*(D_PN(_children[0], _offset))).start_loc.s, (*(D_PN(_children[0], _offset))).end, (*(D_PN(_children[2], _offset))).start_loc.s+1, + (*(D_PN(_children[2], _offset))).end-1, (*(D_PN(_children[0], _offset))).start_loc.line, (*(D_PN(_children[2], _offset))).start_loc.line); + return 0;} + + D_Reduction d_reduction_100_dparser_gram = {3, 45, NULL, d_final_reduction_code_45_100_dparser_gram, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_101_dparser_gram = {3, 46, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_102_dparser_gram = {2, 47, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_103_dparser_gram = {0, 47, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_104_dparser_gram = {3, 48, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_105_dparser_gram = {2, 49, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_106_dparser_gram = {0, 49, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_107_dparser_gram = {3, 50, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_110_dparser_gram = {1, 50, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_115_dparser_gram = {2, 51, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_116_dparser_gram = {0, 51, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_117_dparser_gram = {2, 52, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_118_dparser_gram = {0, 52, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_119_dparser_gram = {2, 53, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_120_dparser_gram = {0, 53, NULL, NULL, 0, 0, 0, 0, -1, 0, NULL}; + D_Reduction d_reduction_121_dparser_gram = {1, 54, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_122_dparser_gram = {1, 55, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_123_dparser_gram = {1, 56, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_124_dparser_gram = {1, 57, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_125_dparser_gram = {1, 58, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_128_dparser_gram = {1, 59, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_129_dparser_gram = {1, 60, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + D_Reduction d_reduction_130_dparser_gram = {1, 61, NULL, NULL, 0, 0, 0, 0, 0, 0, NULL}; + D_Shift d_shift_0_dparser_gram = { 62, 0, 0, 0, 0, NULL }; + D_Shift d_shift_1_dparser_gram = { 63, 0, 0, 0, 0, NULL }; + D_Shift d_shift_2_dparser_gram = { 64, 0, 0, 0, 0, NULL }; + D_Shift d_shift_3_dparser_gram = { 65, 0, 0, 0, 0, NULL }; + D_Shift d_shift_4_dparser_gram = { 66, 0, 0, 0, 0, NULL }; + D_Shift d_shift_5_dparser_gram = { 67, 0, 0, 0, 0, NULL }; + D_Shift d_shift_6_dparser_gram = { 68, 0, 0, 0, 0, NULL }; + D_Shift d_shift_7_dparser_gram = { 69, 0, 0, 0, 0, NULL }; + D_Shift d_shift_8_dparser_gram = { 70, 0, 0, 0, 0, NULL }; + D_Shift d_shift_9_dparser_gram = { 71, 0, 0, 0, 0, NULL }; + D_Shift d_shift_10_dparser_gram = { 72, 0, 0, 0, 0, NULL }; + D_Shift d_shift_11_dparser_gram = { 73, 0, 0, 0, 0, NULL }; + D_Shift d_shift_12_dparser_gram = { 74, 0, 0, 0, 0, NULL }; + D_Shift d_shift_13_dparser_gram = { 75, 0, 0, 0, 0, NULL }; + D_Shift d_shift_14_dparser_gram = { 76, 0, 0, 0, 0, NULL }; + D_Shift d_shift_15_dparser_gram = { 77, 0, 0, 0, 0, NULL }; + D_Shift d_shift_16_dparser_gram = { 78, 0, 0, 0, 0, NULL }; + D_Shift d_shift_17_dparser_gram = { 79, 0, 0, 0, 0, NULL }; + D_Shift d_shift_18_dparser_gram = { 80, 0, 0, 0, 0, NULL }; + D_Shift d_shift_19_dparser_gram = { 81, 0, 0, 0, 0, NULL }; + D_Shift d_shift_20_dparser_gram = { 82, 0, 0, 0, 0, NULL }; + D_Shift d_shift_21_dparser_gram = { 83, 0, 0, 0, 0, NULL }; + D_Shift d_shift_22_dparser_gram = { 84, 0, 0, 0, 0, NULL }; + D_Shift d_shift_23_dparser_gram = { 85, 0, 0, 0, 0, NULL }; + D_Shift d_shift_24_dparser_gram = { 86, 0, 0, 0, 0, NULL }; + D_Shift d_shift_25_dparser_gram = { 87, 0, 0, 0, 0, NULL }; + D_Shift d_shift_26_dparser_gram = { 88, 0, 0, 0, 0, NULL }; + D_Shift d_shift_27_dparser_gram = { 89, 0, 0, 0, 0, NULL }; + D_Shift d_shift_28_dparser_gram = { 90, 0, 0, 0, 0, NULL }; + D_Shift d_shift_29_dparser_gram = { 91, 0, 0, 0, 0, NULL }; + D_Shift d_shift_30_dparser_gram = { 92, 0, 0, 0, 0, NULL }; + D_Shift d_shift_31_dparser_gram = { 93, 0, 0, 0, 0, NULL }; + D_Shift d_shift_32_dparser_gram = { 94, 0, 0, 0, 0, NULL }; + D_Shift d_shift_33_dparser_gram = { 95, 0, 0, 0, 0, NULL }; + D_Shift d_shift_34_dparser_gram = { 96, 0, 0, 0, 0, NULL }; + D_Shift d_shift_35_dparser_gram = { 97, 0, 0, 0, 0, NULL }; + D_Shift d_shift_36_dparser_gram = { 98, 0, 0, 0, 0, NULL }; + D_Shift d_shift_37_dparser_gram = { 99, 0, 0, 0, 0, NULL }; + D_Shift d_shift_38_dparser_gram = { 100, 0, 0, 0, 0, NULL }; + D_Shift d_shift_39_dparser_gram = { 101, 0, 0, 0, 0, NULL }; + D_Shift d_shift_40_dparser_gram = { 102, 0, 0, 0, 0, NULL }; + D_Shift d_shift_41_dparser_gram = { 103, 0, 0, 0, 0, NULL }; + D_Shift d_shift_42_dparser_gram = { 104, 0, 0, 0, 0, NULL }; + D_Shift d_shift_43_dparser_gram = { 105, 0, 0, 0, 0, NULL }; + D_Shift d_shift_44_dparser_gram = { 106, 0, 0, 0, 0, NULL }; + D_Shift d_shift_45_dparser_gram = { 107, 0, 0, 0, 0, NULL }; + D_Shift d_shift_46_dparser_gram = { 108, 0, 0, 0, 0, NULL }; + D_Shift d_shift_47_dparser_gram = { 109, 0, 0, 0, 0, NULL }; + D_Shift d_shift_48_dparser_gram = { 110, 0, 0, 0, 0, NULL }; + D_Shift d_shift_49_dparser_gram = { 111, 0, 0, 0, 0, NULL }; + D_Shift d_shift_50_dparser_gram = { 112, 0, 0, 0, 0, NULL }; + D_Shift d_shift_51_dparser_gram = { 113, 0, 0, 0, 0, NULL }; + D_Shift d_shift_52_dparser_gram = { 114, 0, 0, 0, 0, NULL }; + D_Shift d_shift_53_dparser_gram = { 115, 0, 0, 0, 0, NULL }; + D_Shift d_shift_54_dparser_gram = { 116, 0, 0, 0, 0, NULL }; + D_Shift d_shift_55_dparser_gram = { 117, 0, 0, 0, 0, NULL }; + D_Shift d_shift_56_dparser_gram = { 118, 0, 0, 0, 0, NULL }; + D_Shift d_shift_57_dparser_gram = { 119, 0, 0, 0, 0, NULL }; + D_Shift d_shift_58_dparser_gram = { 120, 0, 0, 0, 0, NULL }; + D_Shift d_shift_59_dparser_gram = { 121, 0, 0, 0, 0, NULL }; + D_Shift d_shift_60_dparser_gram = { 122, 0, 0, 0, 0, NULL }; + D_Shift d_shift_61_dparser_gram = { 123, 0, 0, 0, 0, NULL }; + D_Shift d_shift_62_dparser_gram = { 124, 0, 0, 0, -1, NULL }; + D_Shift d_shift_63_dparser_gram = { 125, 0, 0, 0, 0, NULL }; + D_Shift d_shift_64_dparser_gram = { 126, 0, 0, 0, 0, NULL }; + D_Shift d_shift_65_dparser_gram = { 127, 0, 0, 0, 0, NULL }; + + D_Shift *d_shifts_3_dparser_gram[] = { + &d_shift_0_dparser_gram, &d_shift_2_dparser_gram, &d_shift_4_dparser_gram, &d_shift_6_dparser_gram, &d_shift_7_dparser_gram, &d_shift_23_dparser_gram, &d_shift_27_dparser_gram, &d_shift_49_dparser_gram, &d_shift_62_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_3_0_dparser_gram[] = {0}; + D_Shift *d_accepts_diff_3_1_dparser_gram[] = {&d_shift_27_dparser_gram,0}; + D_Shift **d_accepts_diff_3_dparser_gram[] = { + d_accepts_diff_3_0_dparser_gram, + d_accepts_diff_3_1_dparser_gram + }; + + unsigned char d_scanner_3_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0, + }; + + unsigned char d_accepts_diff_3_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,5, + 0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,6,0,0,0,0, + }; + + unsigned char d_scanner_3_0_2_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_1_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0, + }; + + D_Shift *d_shift_3_2_dparser_gram[] = { &d_shift_23_dparser_gram, NULL}; + + unsigned char d_scanner_3_3_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 4,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_3_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,4, + 0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,0, + }; + + D_Shift *d_shift_3_3_dparser_gram[] = { &d_shift_62_dparser_gram, NULL}; + + unsigned char d_accepts_diff_3_4_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0, + }; + + unsigned char d_accepts_diff_3_4_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1, + 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, + }; + + D_Shift *d_shift_3_4_dparser_gram[] = { &d_shift_27_dparser_gram, NULL}; + + D_Shift *d_shift_3_5_dparser_gram[] = { &d_shift_49_dparser_gram, NULL}; + + unsigned char d_scanner_3_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,8,0,0,9,0,0,0,0,0,0,0,0,0,0,0, + 10,0,0,11,12,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_7_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,13,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_8_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_9_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_10_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_11_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_12_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_13_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,19,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_14_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_15_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_16_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,22,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_17_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,23,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_18_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_19_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_20_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_21_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,27,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_22_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_23_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_3_24_dparser_gram[] = { &d_shift_7_dparser_gram, NULL}; + + unsigned char d_scanner_3_25_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_26_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_27_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_28_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_29_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,34,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_3_30_dparser_gram[] = { &d_shift_4_dparser_gram, NULL}; + + unsigned char d_scanner_3_31_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,35,0,0, + }; + + unsigned char d_scanner_3_32_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,36,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_3_33_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,37,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_3_34_dparser_gram[] = { &d_shift_6_dparser_gram, NULL}; + + D_Shift *d_shift_3_35_dparser_gram[] = { &d_shift_2_dparser_gram, NULL}; + + D_Shift *d_shift_3_36_dparser_gram[] = { &d_shift_0_dparser_gram, NULL}; + + D_Shift *d_shifts_4_dparser_gram[] = { + &d_shift_31_dparser_gram, &d_shift_49_dparser_gram, &d_shift_51_dparser_gram, &d_shift_59_dparser_gram, &d_shift_60_dparser_gram, &d_shift_61_dparser_gram, &d_shift_62_dparser_gram, &d_shift_63_dparser_gram, &d_shift_64_dparser_gram, &d_shift_65_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_4_0_dparser_gram[] = {0}; + D_Shift *d_accepts_diff_4_1_dparser_gram[] = {&d_shift_59_dparser_gram,0}; + D_Shift *d_accepts_diff_4_2_dparser_gram[] = {&d_shift_65_dparser_gram,0}; + D_Shift **d_accepts_diff_4_dparser_gram[] = { + d_accepts_diff_4_0_dparser_gram, + d_accepts_diff_4_1_dparser_gram, + d_accepts_diff_4_2_dparser_gram + }; + + unsigned char d_scanner_4_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,2,3,2,2,2,2,4,5,0,2,2,2,6,2,2, + 7,8,8,8,8,8,8,8,8,8,2,2,2,2,2,2, + }; + + unsigned char d_scanner_4_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 2,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 9,9,9,9,9,9,9,9,9,9,9,10,2,0,2,11, + 2,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 9,9,9,9,9,9,9,9,9,9,9,12,2,0,2,0, + }; + + D_Shift *d_shift_4_1_dparser_gram[] = { &d_shift_59_dparser_gram, NULL}; + + unsigned char d_scanner_4_2_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, + 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, + 13,13,14,13,13,13,13,13,13,13,13,13,13,13,13,13, + 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, + }; + + unsigned char d_scanner_4_2_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, + 13,13,13,13,13,13,13,13,13,13,13,13,15,13,13,13, + 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, + 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, + }; + + unsigned char d_scanner_4_2_2_dparser_gram[SCANNER_BLOCK_SIZE] = { + 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, + 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, + 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, + 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, + }; + + unsigned char d_scanner_4_3_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,17,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + }; + + unsigned char d_scanner_4_3_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,18,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + }; + + unsigned char d_scanner_4_3_2_dparser_gram[SCANNER_BLOCK_SIZE] = { + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + }; + + D_Shift *d_shift_4_4_dparser_gram[] = { &d_shift_31_dparser_gram, NULL}; + + unsigned char d_scanner_4_5_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 7,8,8,8,8,8,8,8,8,8,0,0,0,0,0,0, + }; + + D_Shift *d_shift_4_5_dparser_gram[] = { &d_shift_59_dparser_gram, NULL}; + + unsigned char d_scanner_4_6_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 19,19,19,19,19,19,19,19,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_4_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0, + 0,0,0,0,0,20,0,0,21,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0, + 0,0,0,0,0,20,0,0,22,0,0,0,0,0,0,0, + }; + + unsigned char d_accepts_diff_4_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_4_6_dparser_gram[] = { &d_shift_65_dparser_gram, NULL}; + + unsigned char d_scanner_4_7_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 8,8,8,8,8,8,8,8,8,8,0,0,0,0,0,0, + }; + + unsigned char d_scanner_4_7_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,23,0,0,0, + 0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,23,0,0,0, + 0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_4_7_dparser_gram[] = { &d_shift_63_dparser_gram, NULL}; + + unsigned char d_scanner_4_8_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 9,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0, + }; + + unsigned char d_scanner_4_8_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,9, + 0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 9,9,9,9,9,9,9,9,9,9,9,0,0,0,0,0, + }; + + D_Shift *d_shift_4_9_dparser_gram[] = { &d_shift_51_dparser_gram, NULL}; + + D_Shift *d_shift_4_10_dparser_gram[] = { &d_shift_59_dparser_gram, NULL}; + + D_Shift *d_shift_4_13_dparser_gram[] = { &d_shift_61_dparser_gram, NULL}; + + unsigned char d_scanner_4_14_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24, + 24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24, + 24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24, + 24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24, + }; + + unsigned char d_scanner_4_14_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24, + 24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24, + 24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24, + 24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24, + }; + + D_Shift *d_shift_4_16_dparser_gram[] = { &d_shift_60_dparser_gram, NULL}; + + unsigned char d_scanner_4_17_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, + 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, + 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, + 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, + }; + + unsigned char d_scanner_4_17_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, + 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, + 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, + 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, + }; + + unsigned char d_scanner_4_18_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0, + 0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0, + 0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_4_18_dparser_gram[] = { &d_shift_65_dparser_gram, NULL}; + + D_Shift *d_shift_4_19_dparser_gram[] = { &d_shift_65_dparser_gram, NULL}; + + unsigned char d_scanner_4_20_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 26,26,26,26,26,26,26,26,26,26,0,0,0,0,0,0, + }; + + unsigned char d_scanner_4_20_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,26,26,26,26,26,26,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,26,26,26,26,26,26,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_4_22_dparser_gram[] = { &d_shift_63_dparser_gram, NULL}; + + unsigned char d_scanner_4_25_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,26,26,26,26,26,26,0,0,0,0,0,27,0,0,0, + 0,0,0,0,0,27,0,0,0,0,0,0,0,0,0,0, + 0,26,26,26,26,26,26,0,0,0,0,0,27,0,0,0, + 0,0,0,0,0,27,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_4_25_dparser_gram[] = { &d_shift_64_dparser_gram, NULL}; + + D_Shift *d_shift_4_26_dparser_gram[] = { &d_shift_64_dparser_gram, NULL}; + + D_Shift *d_shifts_5_dparser_gram[] = { + &d_shift_14_dparser_gram, &d_shift_15_dparser_gram, &d_shift_16_dparser_gram, &d_shift_17_dparser_gram, &d_shift_18_dparser_gram, &d_shift_19_dparser_gram, &d_shift_20_dparser_gram, &d_shift_21_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_5_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_5_dparser_gram[] = { + d_accepts_diff_5_0_dparser_gram + }; + + unsigned char d_scanner_5_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,2,0,0,0,0,0,0,0,0,0,0,3,0,0,0, + 0,0,0,4,5,0,0,6,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_1_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_2_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_3_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,9,0,0,0,10,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_4_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_5_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,13,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_7_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_8_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_9_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,17,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_10_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_11_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,19,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_12_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_13_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_14_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,22,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_15_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_16_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_17_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_18_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,26,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_19_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,27,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_20_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0, + 0,0,0,29,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_21_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,30,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_22_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_23_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_24_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_25_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_26_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_27_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_28_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,37,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_29_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,38,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_30_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 39,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_31_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_32_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,41,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_33_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,42,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_34_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,43,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_35_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,44,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_36_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,45,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_37_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,46,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_38_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_39_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_40_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,49,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_41_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,50,0,0,0,0,0, + }; + + unsigned char d_scanner_5_42_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 51,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_43_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,52,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_44_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 53,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_45_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_46_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,55,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_47_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_48_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,57,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_49_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,58,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_50_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_51_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,60,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_52_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_53_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,62,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_54_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,63,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_55_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_56_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,65,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_5_57_dparser_gram[] = { &d_shift_14_dparser_gram, NULL}; + + unsigned char d_scanner_5_58_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,66,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_59_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,67,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_60_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,68,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_61_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_62_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,70,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_63_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,71,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_5_64_dparser_gram[] = { &d_shift_20_dparser_gram, NULL}; + + unsigned char d_scanner_5_65_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,72,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_66_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,73,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_67_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,74,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_68_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,75,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_69_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,76, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_70_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_5_71_dparser_gram[] = { &d_shift_16_dparser_gram, NULL}; + + D_Shift *d_shift_5_72_dparser_gram[] = { &d_shift_17_dparser_gram, NULL}; + + unsigned char d_scanner_5_73_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,78,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_74_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,79,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_75_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,80,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_76_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,81,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_77_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,82,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_78_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,83,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_79_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,84,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_80_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,85,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_81_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,86,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_5_82_dparser_gram[] = { &d_shift_15_dparser_gram, NULL}; + + unsigned char d_scanner_5_83_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,87,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_84_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,88,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_5_85_dparser_gram[] = { &d_shift_19_dparser_gram, NULL}; + + unsigned char d_scanner_5_86_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,89,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_87_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,90,0,0,0,0,0,0, + }; + + D_Shift *d_shift_5_88_dparser_gram[] = { &d_shift_21_dparser_gram, NULL}; + + unsigned char d_scanner_5_89_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,91, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_90_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,92,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_91_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,93,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_92_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_93_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,95,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_94_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_95_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,97,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_96_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,98,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_97_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,99,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_5_98_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_5_99_dparser_gram[] = { &d_shift_18_dparser_gram, NULL}; + + D_Shift *d_shifts_6_dparser_gram[] = { + &d_shift_62_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_6_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_6_dparser_gram[] = { + d_accepts_diff_6_0_dparser_gram + }; + + unsigned char d_scanner_6_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,2, + 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0, + }; + + unsigned char d_scanner_6_1_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0, + }; + + D_Shift *d_accepts_diff_8_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_8_dparser_gram[] = { + d_accepts_diff_8_0_dparser_gram + }; + + D_Shift *d_shifts_13_dparser_gram[] = { + &d_shift_23_dparser_gram, &d_shift_27_dparser_gram, &d_shift_62_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_13_0_dparser_gram[] = {0}; + D_Shift *d_accepts_diff_13_1_dparser_gram[] = {&d_shift_27_dparser_gram,0}; + D_Shift **d_accepts_diff_13_dparser_gram[] = { + d_accepts_diff_13_0_dparser_gram, + d_accepts_diff_13_1_dparser_gram + }; + + unsigned char d_scanner_13_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0, + }; + + unsigned char d_scanner_13_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,4, + 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0, + }; + + unsigned char d_scanner_13_2_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0, + }; + + unsigned char d_scanner_13_2_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,3, + 0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0, + }; + + D_Shift *d_shifts_17_dparser_gram[] = { + &d_shift_22_dparser_gram, &d_shift_26_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_17_0_dparser_gram[] = {0}; + D_Shift *d_accepts_diff_17_1_dparser_gram[] = {&d_shift_22_dparser_gram,0}; + D_Shift **d_accepts_diff_17_dparser_gram[] = { + d_accepts_diff_17_0_dparser_gram, + d_accepts_diff_17_1_dparser_gram + }; + + unsigned char d_scanner_17_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0, + }; + + unsigned char d_scanner_17_1_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0, + }; + + unsigned char d_accepts_diff_17_1_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0, + }; + + D_Shift *d_shift_17_1_dparser_gram[] = { &d_shift_22_dparser_gram, NULL}; + + unsigned char d_scanner_17_2_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0, + }; + + D_Shift *d_shift_17_3_dparser_gram[] = { &d_shift_26_dparser_gram, NULL}; + + D_Shift *d_shifts_30_dparser_gram[] = { + &d_shift_1_dparser_gram, &d_shift_31_dparser_gram, &d_shift_49_dparser_gram, &d_shift_51_dparser_gram, &d_shift_59_dparser_gram, &d_shift_60_dparser_gram, &d_shift_61_dparser_gram, &d_shift_62_dparser_gram, &d_shift_63_dparser_gram, &d_shift_64_dparser_gram, &d_shift_65_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_30_0_dparser_gram[] = {0}; + D_Shift *d_accepts_diff_30_1_dparser_gram[] = {&d_shift_59_dparser_gram,0}; + D_Shift *d_accepts_diff_30_2_dparser_gram[] = {&d_shift_65_dparser_gram,0}; + D_Shift **d_accepts_diff_30_dparser_gram[] = { + d_accepts_diff_30_0_dparser_gram, + d_accepts_diff_30_1_dparser_gram, + d_accepts_diff_30_2_dparser_gram + }; + + unsigned char d_scanner_30_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 2,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 9,9,9,9,9,9,9,9,9,9,9,10,2,0,2,11, + 2,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 9,9,9,9,9,9,9,9,9,9,9,12,2,13,2,0, + }; + + unsigned char d_scanner_30_2_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, + 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, + 14,14,15,14,14,14,14,14,14,14,14,14,14,14,14,14, + 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, + }; + + unsigned char d_scanner_30_2_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, + 14,14,14,14,14,14,14,14,14,14,14,14,16,14,14,14, + 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, + 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, + }; + + unsigned char d_scanner_30_2_2_dparser_gram[SCANNER_BLOCK_SIZE] = { + 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, + 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, + 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, + 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, + }; + + unsigned char d_scanner_30_3_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, + 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, + 17,17,17,17,17,17,17,18,17,17,17,17,17,17,17,17, + 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, + }; + + unsigned char d_scanner_30_3_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, + 17,17,17,17,17,17,17,17,17,17,17,17,19,17,17,17, + 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, + 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, + }; + + unsigned char d_scanner_30_3_2_dparser_gram[SCANNER_BLOCK_SIZE] = { + 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, + 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, + 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, + 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, + }; + + unsigned char d_scanner_30_6_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 20,20,20,20,20,20,20,20,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_30_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0, + 0,0,0,0,0,21,0,0,22,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0, + 0,0,0,0,0,21,0,0,23,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_30_7_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0, + 0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0, + 0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_30_12_dparser_gram[] = { &d_shift_1_dparser_gram, NULL}; + + unsigned char d_scanner_30_18_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26, + 26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26, + 26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26, + 26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26, + }; + + unsigned char d_scanner_30_18_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26, + 26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26, + 26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26, + 26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26, + }; + + unsigned char d_scanner_30_19_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0, + 0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0, + 0,0,0,0,0,21,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_30_21_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 27,27,27,27,27,27,27,27,27,27,0,0,0,0,0,0, + }; + + unsigned char d_scanner_30_21_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,27,27,27,27,27,27,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,27,27,27,27,27,27,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_30_26_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,27,27,27,27,27,27,0,0,0,0,0,28,0,0,0, + 0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0, + 0,27,27,27,27,27,27,0,0,0,0,0,28,0,0,0, + 0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shifts_49_dparser_gram[] = { + &d_shift_1_dparser_gram, &d_shift_62_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_49_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_49_dparser_gram[] = { + d_accepts_diff_49_0_dparser_gram + }; + + unsigned char d_scanner_49_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,2, + 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 2,2,2,2,2,2,2,2,2,2,2,0,0,3,0,0, + }; + + D_Shift *d_shifts_52_dparser_gram[] = { + &d_shift_9_dparser_gram, &d_shift_10_dparser_gram, &d_shift_11_dparser_gram, &d_shift_12_dparser_gram, &d_shift_13_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_52_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_52_dparser_gram[] = { + d_accepts_diff_52_0_dparser_gram + }; + + unsigned char d_scanner_52_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,2,0,0,0,0,0,0,3,0,0, + 4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_1_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_2_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_3_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7, + 0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_4_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_5_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_7_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_8_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_9_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_10_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_11_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_12_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_13_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_14_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_15_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,21,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_16_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,22,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_17_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_19_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_20_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,26,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_21_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,27,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_22_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_52_23_dparser_gram[] = { &d_shift_11_dparser_gram, NULL}; + + unsigned char d_scanner_52_24_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,29,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_52_26_dparser_gram[] = { &d_shift_12_dparser_gram, NULL}; + + unsigned char d_scanner_52_27_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,31,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_28_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_30_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,34,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_31_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_52_32_dparser_gram[] = { &d_shift_9_dparser_gram, NULL}; + + unsigned char d_scanner_52_33_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,36,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_52_34_dparser_gram[] = { &d_shift_10_dparser_gram, NULL}; + + unsigned char d_scanner_52_35_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_36_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,38,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_52_37_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,39,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_52_38_dparser_gram[] = { &d_shift_13_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_53_0_dparser_gram[] = {0}; + D_Shift *d_accepts_diff_53_1_dparser_gram[] = {&d_shift_59_dparser_gram,0}; + D_Shift *d_accepts_diff_53_2_dparser_gram[] = {&d_shift_65_dparser_gram,0}; + D_Shift **d_accepts_diff_53_dparser_gram[] = { + d_accepts_diff_53_0_dparser_gram, + d_accepts_diff_53_1_dparser_gram, + d_accepts_diff_53_2_dparser_gram + }; + + D_Shift *d_shifts_55_dparser_gram[] = { + &d_shift_0_dparser_gram, &d_shift_2_dparser_gram, &d_shift_4_dparser_gram, &d_shift_6_dparser_gram, &d_shift_7_dparser_gram, &d_shift_49_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_55_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_55_dparser_gram[] = { + d_accepts_diff_55_0_dparser_gram + }; + + unsigned char d_scanner_55_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0, + }; + + unsigned char d_scanner_55_1_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0, + }; + + unsigned char d_scanner_55_3_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,5,0,0,6,0,0,0,0,0,0,0,0,0,0,0, + 7,0,0,8,9,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_4_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_5_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_8_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_11_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,17,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_12_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_15_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,21,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_16_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,22,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_18_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_19_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_20_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_22_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_23_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_24_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_25_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_28_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0, + }; + + unsigned char d_scanner_55_29_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,33,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_55_30_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,34,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shifts_59_dparser_gram[] = { + &d_shift_31_dparser_gram, &d_shift_32_dparser_gram, &d_shift_49_dparser_gram, &d_shift_51_dparser_gram, &d_shift_59_dparser_gram, &d_shift_60_dparser_gram, &d_shift_61_dparser_gram, &d_shift_62_dparser_gram, &d_shift_63_dparser_gram, &d_shift_64_dparser_gram, &d_shift_65_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_59_0_dparser_gram[] = {0}; + D_Shift *d_accepts_diff_59_1_dparser_gram[] = {&d_shift_59_dparser_gram,0}; + D_Shift *d_accepts_diff_59_2_dparser_gram[] = {&d_shift_65_dparser_gram,0}; + D_Shift **d_accepts_diff_59_dparser_gram[] = { + d_accepts_diff_59_0_dparser_gram, + d_accepts_diff_59_1_dparser_gram, + d_accepts_diff_59_2_dparser_gram + }; + + unsigned char d_scanner_59_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,2,3,2,2,2,2,4,5,6,2,2,2,7,2,2, + 8,9,9,9,9,9,9,9,9,9,2,2,2,2,2,2, + }; + + unsigned char d_scanner_59_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 2,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, + 10,10,10,10,10,10,10,10,10,10,10,11,2,0,2,12, + 2,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, + 10,10,10,10,10,10,10,10,10,10,10,13,2,0,2,0, + }; + + D_Shift *d_shift_59_5_dparser_gram[] = { &d_shift_32_dparser_gram, NULL}; + + unsigned char d_scanner_59_6_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 8,9,9,9,9,9,9,9,9,9,0,0,0,0,0,0, + }; + + unsigned char d_scanner_59_9_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 10,10,10,10,10,10,10,10,10,10,0,0,0,0,0,0, + }; + + unsigned char d_scanner_59_9_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, + 10,10,10,10,10,10,10,10,10,10,10,0,0,0,0,10, + 0,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10, + 10,10,10,10,10,10,10,10,10,10,10,0,0,0,0,0, + }; + + D_Shift *d_accepts_diff_60_0_dparser_gram[] = {0}; + D_Shift *d_accepts_diff_60_1_dparser_gram[] = {&d_shift_59_dparser_gram,0}; + D_Shift *d_accepts_diff_60_2_dparser_gram[] = {&d_shift_65_dparser_gram,0}; + D_Shift **d_accepts_diff_60_dparser_gram[] = { + d_accepts_diff_60_0_dparser_gram, + d_accepts_diff_60_1_dparser_gram, + d_accepts_diff_60_2_dparser_gram + }; + + D_Shift *d_shifts_61_dparser_gram[] = { + &d_shift_31_dparser_gram, &d_shift_49_dparser_gram, &d_shift_51_dparser_gram, &d_shift_52_dparser_gram, &d_shift_59_dparser_gram, &d_shift_60_dparser_gram, &d_shift_61_dparser_gram, &d_shift_62_dparser_gram, &d_shift_63_dparser_gram, &d_shift_64_dparser_gram, &d_shift_65_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_61_0_dparser_gram[] = {0}; + D_Shift *d_accepts_diff_61_1_dparser_gram[] = {&d_shift_65_dparser_gram,0}; + D_Shift *d_accepts_diff_61_2_dparser_gram[] = {&d_shift_59_dparser_gram,0}; + D_Shift **d_accepts_diff_61_dparser_gram[] = { + d_accepts_diff_61_0_dparser_gram, + d_accepts_diff_61_1_dparser_gram, + d_accepts_diff_61_2_dparser_gram + }; + + unsigned char d_scanner_61_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 2,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 9,9,9,9,9,9,9,9,9,9,9,10,2,11,2,12, + 2,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 9,9,9,9,9,9,9,9,9,9,9,13,2,0,2,0, + }; + + unsigned char d_accepts_diff_61_5_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 2,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0, + }; + + unsigned char d_accepts_diff_61_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_61_10_dparser_gram[] = { &d_shift_52_dparser_gram, NULL}; + + unsigned char d_accepts_diff_61_11_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,2, + 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, + 2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0, + }; + + D_Shift *d_accepts_diff_64_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_64_dparser_gram[] = { + d_accepts_diff_64_0_dparser_gram + }; + + D_Shift *d_shifts_72_dparser_gram[] = { + &d_shift_1_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_72_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_72_dparser_gram[] = { + d_accepts_diff_72_0_dparser_gram + }; + + unsigned char d_scanner_72_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0, + }; + + D_Shift *d_accepts_diff_73_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_73_dparser_gram[] = { + d_accepts_diff_73_0_dparser_gram + }; + + D_Shift *d_shifts_77_dparser_gram[] = { + &d_shift_23_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_77_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_77_dparser_gram[] = { + d_accepts_diff_77_0_dparser_gram + }; + + D_Shift *d_accepts_diff_80_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_80_dparser_gram[] = { + d_accepts_diff_80_0_dparser_gram + }; + + D_Shift *d_shifts_92_dparser_gram[] = { + &d_shift_28_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_92_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_92_dparser_gram[] = { + d_accepts_diff_92_0_dparser_gram + }; + + unsigned char d_scanner_92_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, + }; + + D_Shift *d_shift_92_1_dparser_gram[] = { &d_shift_28_dparser_gram, NULL}; + + D_Shift *d_shifts_95_dparser_gram[] = { + &d_shift_29_dparser_gram, &d_shift_31_dparser_gram, &d_shift_49_dparser_gram, &d_shift_51_dparser_gram, &d_shift_60_dparser_gram, &d_shift_61_dparser_gram, &d_shift_62_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_95_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_95_dparser_gram[] = { + d_accepts_diff_95_0_dparser_gram + }; + + unsigned char d_scanner_95_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,2,0,3,0,0,4,5,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_95_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 6,6,6,6,6,6,6,6,6,6,6,7,0,0,0,6, + 0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 6,6,6,6,6,6,6,6,6,6,6,8,0,0,0,0, + }; + + unsigned char d_scanner_95_1_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 9,9,10,9,9,9,9,9,9,9,9,9,9,9,9,9, + 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + }; + + unsigned char d_scanner_95_1_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 9,9,9,9,9,9,9,9,9,9,9,9,11,9,9,9, + 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + }; + + unsigned char d_scanner_95_1_2_dparser_gram[SCANNER_BLOCK_SIZE] = { + 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, + }; + + unsigned char d_scanner_95_2_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0, + }; + + unsigned char d_scanner_95_3_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, + 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, + 13,13,13,13,13,13,13,14,13,13,13,13,13,13,13,13, + 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, + }; + + unsigned char d_scanner_95_5_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 6,6,6,6,6,6,6,6,6,6,0,0,0,0,0,0, + }; + + unsigned char d_scanner_95_5_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 6,6,6,6,6,6,6,6,6,6,6,0,0,0,0,6, + 0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 6,6,6,6,6,6,6,6,6,6,6,0,0,0,0,0, + }; + + unsigned char d_scanner_95_10_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + }; + + unsigned char d_scanner_95_14_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, + 18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, + 18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, + 18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, + }; + + unsigned char d_scanner_95_14_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, + 18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, + 18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, + 18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, + }; + + unsigned char d_scanner_95_18_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_95_19_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_95_20_dparser_gram[] = { &d_shift_29_dparser_gram, NULL}; + + D_Shift *d_shifts_99_dparser_gram[] = { + &d_shift_38_dparser_gram, &d_shift_39_dparser_gram, &d_shift_40_dparser_gram, &d_shift_41_dparser_gram, &d_shift_42_dparser_gram, &d_shift_43_dparser_gram, &d_shift_44_dparser_gram, &d_shift_45_dparser_gram, &d_shift_46_dparser_gram, &d_shift_47_dparser_gram, &d_shift_51_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_99_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_99_dparser_gram[] = { + d_accepts_diff_99_0_dparser_gram + }; + + unsigned char d_scanner_99_0_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_1_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,4,0,0,0,0,0,0,0,0,0,5,0,0,0, + 0,0,6,0,0,7,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_3_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_4_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_5_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,10,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_7_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_8_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,13,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_9_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_11_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_13_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_14_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_15_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_99_16_dparser_gram[] = { &d_shift_47_dparser_gram, NULL}; + + unsigned char d_scanner_99_17_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,21,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_18_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,22,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_19_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,23,0,0,0,0,0,0, + }; + + D_Shift *d_shift_99_20_dparser_gram[] = { &d_shift_46_dparser_gram, NULL}; + + unsigned char d_scanner_99_22_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_23_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,26,0,0,27, + 0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_24_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,30, + 0,0,31,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_26_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_27_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,34,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_29_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_30_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,37,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_31_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,38,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_32_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_33_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_34_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,41,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_35_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_36_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,43,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_38_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,45,0,0,0, + 0,0,46,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_39_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_40_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_41_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,49,0,0,0, + 0,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_42_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,51,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_99_43_dparser_gram[] = { &d_shift_43_dparser_gram, NULL}; + + unsigned char d_scanner_99_44_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,52,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_45_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,53,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_46_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,54,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_99_47_dparser_gram[] = { &d_shift_45_dparser_gram, NULL}; + + unsigned char d_scanner_99_48_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,55,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_49_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,56,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_50_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,57,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_51_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,58,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_52_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,59,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_99_53_dparser_gram[] = { &d_shift_42_dparser_gram, NULL}; + + unsigned char d_scanner_99_54_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,60,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_55_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,61,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_99_56_dparser_gram[] = { &d_shift_44_dparser_gram, NULL}; + + unsigned char d_scanner_99_57_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,62,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_58_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,63,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_59_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_99_60_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,65,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_99_61_dparser_gram[] = { &d_shift_39_dparser_gram, NULL}; + + unsigned char d_scanner_99_62_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,66,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_99_63_dparser_gram[] = { &d_shift_41_dparser_gram, NULL}; + + unsigned char d_scanner_99_64_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,67,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_99_65_dparser_gram[] = { &d_shift_38_dparser_gram, NULL}; + + D_Shift *d_shift_99_66_dparser_gram[] = { &d_shift_40_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_100_0_dparser_gram[] = {0}; + D_Shift *d_accepts_diff_100_1_dparser_gram[] = {&d_shift_59_dparser_gram,0}; + D_Shift *d_accepts_diff_100_2_dparser_gram[] = {&d_shift_65_dparser_gram,0}; + D_Shift **d_accepts_diff_100_dparser_gram[] = { + d_accepts_diff_100_0_dparser_gram, + d_accepts_diff_100_1_dparser_gram, + d_accepts_diff_100_2_dparser_gram + }; + + D_Shift *d_shifts_123_dparser_gram[] = { + &d_shift_63_dparser_gram, &d_shift_64_dparser_gram, &d_shift_65_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_123_0_dparser_gram[] = {0}; + D_Shift *d_accepts_diff_123_1_dparser_gram[] = {&d_shift_65_dparser_gram,0}; + D_Shift **d_accepts_diff_123_dparser_gram[] = { + d_accepts_diff_123_0_dparser_gram, + d_accepts_diff_123_1_dparser_gram + }; + + unsigned char d_scanner_123_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0, + 3,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0, + }; + + unsigned char d_scanner_123_1_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 3,4,4,4,4,4,4,4,4,4,0,0,0,0,0,0, + }; + + unsigned char d_scanner_123_2_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 5,5,5,5,5,5,5,5,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_123_2_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0, + 0,0,0,0,0,6,0,0,7,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0, + 0,0,0,0,0,6,0,0,8,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_123_3_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0, + 0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,9,0,0,0, + 0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_123_4_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0, + 0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0, + 0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_123_6_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,10,10,10,10,10,10,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,10,10,10,10,10,10,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_123_9_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,10,10,10,10,10,10,0,0,0,0,0,11,0,0,0, + 0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0, + 0,10,10,10,10,10,10,0,0,0,0,0,11,0,0,0, + 0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shifts_125_dparser_gram[] = { + &d_shift_49_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_125_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_125_dparser_gram[] = { + d_accepts_diff_125_0_dparser_gram + }; + + D_Shift *d_accepts_diff_128_0_dparser_gram[] = {0}; + D_Shift *d_accepts_diff_128_1_dparser_gram[] = {&d_shift_59_dparser_gram,0}; + D_Shift *d_accepts_diff_128_2_dparser_gram[] = {&d_shift_65_dparser_gram,0}; + D_Shift **d_accepts_diff_128_dparser_gram[] = { + d_accepts_diff_128_0_dparser_gram, + d_accepts_diff_128_1_dparser_gram, + d_accepts_diff_128_2_dparser_gram + }; + + D_Shift *d_accepts_diff_131_0_dparser_gram[] = {0}; + D_Shift *d_accepts_diff_131_1_dparser_gram[] = {&d_shift_65_dparser_gram,0}; + D_Shift *d_accepts_diff_131_2_dparser_gram[] = {&d_shift_59_dparser_gram,0}; + D_Shift **d_accepts_diff_131_dparser_gram[] = { + d_accepts_diff_131_0_dparser_gram, + d_accepts_diff_131_1_dparser_gram, + d_accepts_diff_131_2_dparser_gram + }; + + D_Shift *d_shifts_132_dparser_gram[] = { + &d_shift_33_dparser_gram, &d_shift_34_dparser_gram, &d_shift_35_dparser_gram, &d_shift_36_dparser_gram, &d_shift_37_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_132_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_132_dparser_gram[] = { + d_accepts_diff_132_0_dparser_gram + }; + + unsigned char d_scanner_132_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,2,0,0,0,0,0,3,4,0,0,0,5, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6, + }; + + unsigned char d_scanner_132_1_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_132_2_dparser_gram[] = { &d_shift_36_dparser_gram, NULL}; + + D_Shift *d_shift_132_3_dparser_gram[] = { &d_shift_37_dparser_gram, NULL}; + + D_Shift *d_shift_132_5_dparser_gram[] = { &d_shift_35_dparser_gram, NULL}; + + D_Shift *d_shift_132_7_dparser_gram[] = { &d_shift_34_dparser_gram, NULL}; + + unsigned char d_scanner_132_8_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + unsigned char d_scanner_132_9_1_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_shift_132_10_dparser_gram[] = { &d_shift_33_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_133_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_133_dparser_gram[] = { + d_accepts_diff_133_0_dparser_gram + }; + + D_Shift *d_shifts_141_dparser_gram[] = { + &d_shift_32_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_141_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_141_dparser_gram[] = { + d_accepts_diff_141_0_dparser_gram + }; + + unsigned char d_scanner_141_0_0_dparser_gram[SCANNER_BLOCK_SIZE] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + }; + + D_Shift *d_accepts_diff_144_0_dparser_gram[] = {0}; + D_Shift *d_accepts_diff_144_1_dparser_gram[] = {&d_shift_65_dparser_gram,0}; + D_Shift **d_accepts_diff_144_dparser_gram[] = { + d_accepts_diff_144_0_dparser_gram, + d_accepts_diff_144_1_dparser_gram + }; + + D_Shift *d_accepts_diff_151_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_151_dparser_gram[] = { + d_accepts_diff_151_0_dparser_gram + }; + + D_Shift *d_shifts_155_dparser_gram[] = { + &d_shift_22_dparser_gram, NULL}; + + D_Shift *d_accepts_diff_155_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_155_dparser_gram[] = { + d_accepts_diff_155_0_dparser_gram + }; + + D_Shift *d_accepts_diff_156_0_dparser_gram[] = {0}; + D_Shift **d_accepts_diff_156_dparser_gram[] = { + d_accepts_diff_156_0_dparser_gram + }; + + SB_uint8 d_scanner_3_dparser_gram[37] = { + { NULL, {d_scanner_3_0_0_dparser_gram, d_scanner_3_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_1_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_2_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_3_dparser_gram, {d_scanner_3_3_0_dparser_gram, d_scanner_3_3_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_4_dparser_gram, {d_scanner_3_3_0_dparser_gram, d_scanner_3_3_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_10_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_11_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_12_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_13_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_14_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_15_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_16_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_17_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_18_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_20_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_22_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_23_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_24_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_25_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_26_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_27_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_28_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_29_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_30_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_31_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_32_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_33_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_34_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_35_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_36_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_3_dparser_gram[37] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_4_0_dparser_gram, d_accepts_diff_3_4_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_4_dparser_gram[27] = { + { NULL, {d_scanner_4_0_0_dparser_gram, d_scanner_4_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_10_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_4_2_0_dparser_gram, d_scanner_4_2_1_dparser_gram, + d_scanner_4_2_2_dparser_gram, d_scanner_4_2_2_dparser_gram}}, + { NULL, {d_scanner_4_3_0_dparser_gram, d_scanner_4_3_1_dparser_gram, + d_scanner_4_3_2_dparser_gram, d_scanner_4_3_2_dparser_gram}}, + { d_shift_4_4_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_10_dparser_gram, {d_scanner_4_5_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_19_dparser_gram, {d_scanner_4_6_0_dparser_gram, d_scanner_4_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_22_dparser_gram, {d_scanner_4_7_0_dparser_gram, d_scanner_4_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_3_dparser_gram, {d_scanner_4_8_0_dparser_gram, d_scanner_4_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_9_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_10_dparser_gram, {d_scanner_4_8_0_dparser_gram, d_scanner_4_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_4_2_0_dparser_gram, d_scanner_4_2_1_dparser_gram, + d_scanner_4_2_2_dparser_gram, d_scanner_4_2_2_dparser_gram}}, + { d_shift_4_13_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_4_14_0_dparser_gram, d_scanner_4_14_1_dparser_gram, + d_scanner_4_14_1_dparser_gram, d_scanner_4_14_1_dparser_gram}}, + { NULL, {d_scanner_4_3_0_dparser_gram, d_scanner_4_3_1_dparser_gram, + d_scanner_4_3_2_dparser_gram, d_scanner_4_3_2_dparser_gram}}, + { d_shift_4_16_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_4_17_0_dparser_gram, d_scanner_4_17_1_dparser_gram, + d_scanner_4_17_1_dparser_gram, d_scanner_4_17_1_dparser_gram}}, + { d_shift_4_19_dparser_gram, {d_scanner_4_6_0_dparser_gram, d_scanner_4_18_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_19_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_4_20_0_dparser_gram, d_scanner_4_20_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_4_20_0_dparser_gram, d_scanner_4_20_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_22_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_4_2_0_dparser_gram, d_scanner_4_2_1_dparser_gram, + d_scanner_4_2_2_dparser_gram, d_scanner_4_2_2_dparser_gram}}, + { NULL, {d_scanner_4_3_0_dparser_gram, d_scanner_4_3_1_dparser_gram, + d_scanner_4_3_2_dparser_gram, d_scanner_4_3_2_dparser_gram}}, + { d_shift_4_26_dparser_gram, {d_scanner_4_20_0_dparser_gram, d_scanner_4_25_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_26_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_4_dparser_gram[27] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_4_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_4_6_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_4_0_dparser_gram, d_accepts_diff_3_4_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_5_dparser_gram[100] = { + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_1_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_2_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_3_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_4_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_5_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_10_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_11_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_12_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_13_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_14_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_15_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_16_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_17_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_18_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_20_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_22_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_23_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_24_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_25_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_26_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_27_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_28_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_29_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_30_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_31_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_32_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_33_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_34_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_35_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_36_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_37_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_38_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_39_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_40_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_41_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_42_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_43_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_44_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_45_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_46_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_47_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_48_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_49_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_50_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_51_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_52_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_53_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_54_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_55_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_56_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_5_57_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_58_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_59_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_60_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_61_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_62_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_63_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_5_64_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_65_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_66_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_67_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_68_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_69_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_70_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_5_71_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_5_72_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_73_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_74_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_75_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_76_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_77_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_78_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_79_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_80_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_81_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_5_82_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_83_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_84_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_5_85_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_86_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_87_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_5_88_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_89_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_90_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_91_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_92_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_93_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_94_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_95_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_96_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_97_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_98_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_5_99_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_5_dparser_gram[100] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_6_dparser_gram[2] = { + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_6_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_3_dparser_gram, {d_scanner_6_1_0_dparser_gram, d_scanner_6_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_6_dparser_gram[2] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_13_dparser_gram[4] = { + { NULL, {d_scanner_13_0_0_dparser_gram, d_scanner_13_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_2_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_3_dparser_gram, {d_scanner_13_2_0_dparser_gram, d_scanner_13_2_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_4_dparser_gram, {d_scanner_13_2_0_dparser_gram, d_scanner_13_2_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_13_dparser_gram[4] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_4_0_dparser_gram, d_accepts_diff_3_4_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_17_dparser_gram[4] = { + { NULL, {d_scanner_17_0_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_17_1_dparser_gram, {d_scanner_17_1_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_17_2_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_17_3_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_17_dparser_gram[4] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_17_1_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_30_dparser_gram[28] = { + { NULL, {d_scanner_4_0_0_dparser_gram, d_scanner_30_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_10_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, + { NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, + { d_shift_4_4_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_10_dparser_gram, {d_scanner_4_5_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_19_dparser_gram, {d_scanner_30_6_0_dparser_gram, d_scanner_30_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_22_dparser_gram, {d_scanner_4_7_0_dparser_gram, d_scanner_30_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_3_dparser_gram, {d_scanner_4_8_0_dparser_gram, d_scanner_4_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_9_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_10_dparser_gram, {d_scanner_4_8_0_dparser_gram, d_scanner_4_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_30_12_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, + { d_shift_4_13_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_4_17_0_dparser_gram, d_scanner_4_17_1_dparser_gram, + d_scanner_4_17_1_dparser_gram, d_scanner_4_17_1_dparser_gram}}, + { NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, + { d_shift_4_16_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_18_0_dparser_gram, d_scanner_30_18_1_dparser_gram, + d_scanner_30_18_1_dparser_gram, d_scanner_30_18_1_dparser_gram}}, + { d_shift_4_19_dparser_gram, {d_scanner_30_6_0_dparser_gram, d_scanner_30_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_19_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_21_0_dparser_gram, d_scanner_30_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_21_0_dparser_gram, d_scanner_30_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_22_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, + { NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, + { d_shift_4_26_dparser_gram, {d_scanner_30_21_0_dparser_gram, d_scanner_30_26_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_26_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_30_dparser_gram[28] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_4_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_4_6_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_4_0_dparser_gram, d_accepts_diff_3_4_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_49_dparser_gram[3] = { + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_49_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_3_dparser_gram, {d_scanner_6_1_0_dparser_gram, d_scanner_6_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_30_12_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_49_dparser_gram[3] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_52_dparser_gram[39] = { + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_1_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_2_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_3_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_4_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_5_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_10_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_11_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_12_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_13_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_14_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_15_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_16_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_17_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_18_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_20_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_22_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_52_23_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_24_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_52_26_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_27_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_28_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_28_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_30_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_31_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_52_32_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_33_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_52_34_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_35_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_36_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_37_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_52_38_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_52_dparser_gram[39] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_55_dparser_gram[34] = { + { NULL, {d_scanner_55_0_0_dparser_gram, d_scanner_55_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_1_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_3_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_4_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_5_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_10_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_10_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_11_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_12_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_11_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_12_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_15_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_16_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_17_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_18_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_20_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_24_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_22_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_23_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_24_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_25_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_27_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_30_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_28_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_29_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_30_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_34_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_35_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_36_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_55_dparser_gram[34] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_59_dparser_gram[28] = { + { NULL, {d_scanner_59_0_0_dparser_gram, d_scanner_59_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_10_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, + { NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, + { d_shift_4_4_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_59_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_10_dparser_gram, {d_scanner_59_6_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_19_dparser_gram, {d_scanner_30_6_0_dparser_gram, d_scanner_30_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_22_dparser_gram, {d_scanner_4_8_0_dparser_gram, d_scanner_30_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_3_dparser_gram, {d_scanner_59_9_0_dparser_gram, d_scanner_59_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_9_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_10_dparser_gram, {d_scanner_59_9_0_dparser_gram, d_scanner_59_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, + { d_shift_4_13_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_4_17_0_dparser_gram, d_scanner_4_17_1_dparser_gram, + d_scanner_4_17_1_dparser_gram, d_scanner_4_17_1_dparser_gram}}, + { NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, + { d_shift_4_16_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_18_0_dparser_gram, d_scanner_30_18_1_dparser_gram, + d_scanner_30_18_1_dparser_gram, d_scanner_30_18_1_dparser_gram}}, + { d_shift_4_19_dparser_gram, {d_scanner_30_6_0_dparser_gram, d_scanner_30_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_19_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_21_0_dparser_gram, d_scanner_30_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_21_0_dparser_gram, d_scanner_30_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_22_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, + { NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, + { d_shift_4_26_dparser_gram, {d_scanner_30_21_0_dparser_gram, d_scanner_30_26_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_26_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_59_dparser_gram[28] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_4_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_4_6_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_4_0_dparser_gram, d_accepts_diff_3_4_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_61_dparser_gram[28] = { + { NULL, {d_scanner_4_0_0_dparser_gram, d_scanner_61_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_10_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, + { NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, + { d_shift_4_4_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_10_dparser_gram, {d_scanner_4_5_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_19_dparser_gram, {d_scanner_30_6_0_dparser_gram, d_scanner_30_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_22_dparser_gram, {d_scanner_4_7_0_dparser_gram, d_scanner_30_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_3_dparser_gram, {d_scanner_4_8_0_dparser_gram, d_scanner_4_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_9_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_61_10_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_10_dparser_gram, {d_scanner_4_8_0_dparser_gram, d_scanner_4_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, + { d_shift_4_13_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_4_17_0_dparser_gram, d_scanner_4_17_1_dparser_gram, + d_scanner_4_17_1_dparser_gram, d_scanner_4_17_1_dparser_gram}}, + { NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, + { d_shift_4_16_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_18_0_dparser_gram, d_scanner_30_18_1_dparser_gram, + d_scanner_30_18_1_dparser_gram, d_scanner_30_18_1_dparser_gram}}, + { d_shift_4_19_dparser_gram, {d_scanner_30_6_0_dparser_gram, d_scanner_30_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_19_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_21_0_dparser_gram, d_scanner_30_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_21_0_dparser_gram, d_scanner_30_21_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_22_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_30_2_0_dparser_gram, d_scanner_30_2_1_dparser_gram, + d_scanner_30_2_2_dparser_gram, d_scanner_30_2_2_dparser_gram}}, + { NULL, {d_scanner_30_3_0_dparser_gram, d_scanner_30_3_1_dparser_gram, + d_scanner_30_3_2_dparser_gram, d_scanner_30_3_2_dparser_gram}}, + { d_shift_4_26_dparser_gram, {d_scanner_30_21_0_dparser_gram, d_scanner_30_26_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_26_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_61_dparser_gram[28] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_61_5_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_61_6_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_61_5_0_dparser_gram, d_accepts_diff_61_11_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_72_dparser_gram[2] = { + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_72_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_30_12_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_72_dparser_gram[2] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_77_dparser_gram[2] = { + { NULL, {d_scanner_13_0_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_2_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_77_dparser_gram[2] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_92_dparser_gram[2] = { + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_92_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_92_1_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_92_dparser_gram[2] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_95_dparser_gram[21] = { + { NULL, {d_scanner_95_0_0_dparser_gram, d_scanner_95_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_95_1_0_dparser_gram, d_scanner_95_1_1_dparser_gram, + d_scanner_95_1_2_dparser_gram, d_scanner_95_1_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_95_2_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_95_3_0_dparser_gram, d_scanner_4_2_1_dparser_gram, + d_scanner_4_2_2_dparser_gram, d_scanner_4_2_2_dparser_gram}}, + { d_shift_4_4_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_3_dparser_gram, {d_scanner_95_5_0_dparser_gram, d_scanner_95_5_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_9_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_95_1_0_dparser_gram, d_scanner_95_1_1_dparser_gram, + d_scanner_95_1_2_dparser_gram, d_scanner_95_1_2_dparser_gram}}, + { d_shift_4_13_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_95_10_0_dparser_gram, d_scanner_4_3_2_dparser_gram, + d_scanner_4_3_2_dparser_gram, d_scanner_4_3_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_55_11_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_95_3_0_dparser_gram, d_scanner_4_2_1_dparser_gram, + d_scanner_4_2_2_dparser_gram, d_scanner_4_2_2_dparser_gram}}, + { d_shift_4_16_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_95_14_0_dparser_gram, d_scanner_95_14_1_dparser_gram, + d_scanner_95_14_1_dparser_gram, d_scanner_95_14_1_dparser_gram}}, + { NULL, {d_scanner_95_1_0_dparser_gram, d_scanner_95_1_1_dparser_gram, + d_scanner_95_1_2_dparser_gram, d_scanner_95_1_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_13_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_95_3_0_dparser_gram, d_scanner_4_2_1_dparser_gram, + d_scanner_4_2_2_dparser_gram, d_scanner_4_2_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_95_18_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_95_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_95_20_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_95_dparser_gram[21] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_99_dparser_gram[67] = { + { NULL, {d_scanner_55_0_0_dparser_gram, d_scanner_99_0_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_1_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_9_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_3_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_4_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_5_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_7_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_3_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_11_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_13_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_14_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_15_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_99_16_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_17_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_18_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_19_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_99_20_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_16_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_22_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_23_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_24_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_52_28_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_26_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_27_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_26_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_29_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_30_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_31_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_32_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_33_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_34_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_35_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_36_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_5_35_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_38_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_39_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_40_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_41_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_42_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_99_43_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_44_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_45_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_46_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_99_47_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_48_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_49_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_50_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_51_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_52_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_99_53_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_54_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_55_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_99_56_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_57_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_58_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_59_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_60_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_99_61_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_62_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_99_63_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_64_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_99_65_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_99_66_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_99_dparser_gram[67] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_123_dparser_gram[11] = { + { NULL, {d_scanner_123_0_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_123_1_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_19_dparser_gram, {d_scanner_123_2_0_dparser_gram, d_scanner_123_2_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_22_dparser_gram, {d_scanner_3_3_0_dparser_gram, d_scanner_123_3_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_19_dparser_gram, {d_scanner_123_2_0_dparser_gram, d_scanner_123_4_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_19_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_59_9_0_dparser_gram, d_scanner_123_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_59_9_0_dparser_gram, d_scanner_123_6_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_22_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_26_dparser_gram, {d_scanner_59_9_0_dparser_gram, d_scanner_123_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_4_26_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_123_dparser_gram[11] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_61_6_1_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_125_dparser_gram[2] = { + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_13_0_0_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_3_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_125_dparser_gram[2] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_132_dparser_gram[11] = { + { NULL, {d_scanner_132_0_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_132_1_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_132_2_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_132_3_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_3_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_132_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_99_4_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_132_7_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_132_8_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { NULL, {d_scanner_3_0_2_dparser_gram, d_scanner_132_9_1_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_132_10_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_132_dparser_gram[11] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_141_dparser_gram[2] = { + { NULL, {d_scanner_141_0_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_59_5_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_141_dparser_gram[2] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + SB_uint8 d_scanner_155_dparser_gram[2] = { + { NULL, {d_scanner_17_0_0_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}}, + { d_shift_17_1_dparser_gram, {d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram, + d_scanner_3_0_2_dparser_gram, d_scanner_3_0_2_dparser_gram}} + }; + + SB_trans_uint8 d_transition_155_dparser_gram[2] = { + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}}, + {{ d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram, + d_accepts_diff_3_0_0_dparser_gram, d_accepts_diff_3_0_0_dparser_gram}} + }; + + unsigned char d_goto_valid_0_dparser_gram[] = { + 0x46, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_0_dparser_gram[] = {&d_reduction_9_dparser_gram}; + D_Reduction *d_reductions_2_dparser_gram[] = {&d_reduction_1_dparser_gram}; + unsigned char d_goto_valid_3_dparser_gram[] = { + 0x98, 0x80, 0x6, 0x0, 0x0, 0x40, 0x0, 0x42, 0x35, 0x0, 0x20, 0x2, 0x0, 0x80, 0x0, 0x10}; + unsigned char d_goto_valid_4_dparser_gram[] = { + 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0xc4, 0x3f, 0x0, 0x0, 0x0, 0x20, 0x0, 0x80, 0x2, 0xfe}; + unsigned char d_goto_valid_5_dparser_gram[] = { + 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0}; + unsigned char d_goto_valid_6_dparser_gram[] = { + 0x0, 0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10}; + D_Reduction *d_reductions_7_dparser_gram[] = {&d_reduction_14_dparser_gram}; + unsigned char d_goto_valid_8_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10}; + D_Reduction *d_reductions_9_dparser_gram[] = {&d_reduction_40_dparser_gram}; + D_Reduction *d_reductions_10_dparser_gram[] = {&d_reduction_43_dparser_gram}; + unsigned char d_goto_valid_11_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_11_dparser_gram[] = {&d_reduction_103_dparser_gram}; + D_Reduction *d_reductions_12_dparser_gram[] = {&d_reduction_124_dparser_gram}; + unsigned char d_goto_valid_13_dparser_gram[] = { + 0x10, 0x80, 0x6, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x20, 0x2, 0x0, 0x0, 0x0, 0x10}; + D_Reduction *d_reductions_13_dparser_gram[] = {&d_reduction_2_dparser_gram}; + D_Reduction *d_reductions_14_dparser_gram[] = {&d_reduction_4_dparser_gram}; + D_Reduction *d_reductions_15_dparser_gram[] = {&d_reduction_8_dparser_gram}; + unsigned char d_goto_valid_16_dparser_gram[] = { + 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_16_dparser_gram[] = {&d_reduction_7_dparser_gram}; + D_RightEpsilonHint d_right_epsilon_hints_16_dparser_gram[] = {{ 0, 55, &d_reduction_5_dparser_gram}}; + unsigned char d_goto_valid_17_dparser_gram[] = { + 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x1, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_18_dparser_gram[] = {&d_reduction_42_dparser_gram}; + D_Reduction *d_reductions_19_dparser_gram[] = {&d_reduction_10_dparser_gram}; + D_Reduction *d_reductions_20_dparser_gram[] = {&d_reduction_43_dparser_gram}; + unsigned char d_goto_valid_21_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_21_dparser_gram[] = {&d_reduction_120_dparser_gram}; + unsigned char d_goto_valid_22_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_22_dparser_gram[] = {&d_reduction_116_dparser_gram}; + unsigned char d_goto_valid_23_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_23_dparser_gram[] = {&d_reduction_118_dparser_gram}; + D_Reduction *d_reductions_24_dparser_gram[] = {&d_reduction_121_dparser_gram}; + D_Reduction *d_reductions_25_dparser_gram[] = {&d_reduction_122_dparser_gram}; + D_Reduction *d_reductions_26_dparser_gram[] = {&d_reduction_123_dparser_gram}; + D_Reduction *d_reductions_27_dparser_gram[] = {&d_reduction_128_dparser_gram}; + D_Reduction *d_reductions_28_dparser_gram[] = {&d_reduction_129_dparser_gram}; + D_Reduction *d_reductions_29_dparser_gram[] = {&d_reduction_130_dparser_gram}; + unsigned char d_goto_valid_30_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4, 0xbf, 0x0, 0x0, 0x0, 0x20, 0x0, 0x80, 0x2, 0xfe}; + D_Reduction *d_reductions_31_dparser_gram[] = {&d_reduction_21_dparser_gram}; + D_Reduction *d_reductions_32_dparser_gram[] = {&d_reduction_110_dparser_gram}; + D_Reduction *d_reductions_33_dparser_gram[] = {&d_reduction_110_dparser_gram}; + D_Reduction *d_reductions_34_dparser_gram[] = {&d_reduction_110_dparser_gram}; + D_Reduction *d_reductions_35_dparser_gram[] = {&d_reduction_110_dparser_gram}; + D_Reduction *d_reductions_36_dparser_gram[] = {&d_reduction_110_dparser_gram}; + D_Reduction *d_reductions_37_dparser_gram[] = {&d_reduction_125_dparser_gram}; + D_Reduction *d_reductions_38_dparser_gram[] = {&d_reduction_125_dparser_gram}; + D_Reduction *d_reductions_39_dparser_gram[] = {&d_reduction_125_dparser_gram}; + D_Reduction *d_reductions_40_dparser_gram[] = {&d_reduction_29_dparser_gram}; + D_Reduction *d_reductions_41_dparser_gram[] = {&d_reduction_30_dparser_gram}; + D_Reduction *d_reductions_42_dparser_gram[] = {&d_reduction_31_dparser_gram}; + D_Reduction *d_reductions_43_dparser_gram[] = {&d_reduction_32_dparser_gram}; + D_Reduction *d_reductions_44_dparser_gram[] = {&d_reduction_33_dparser_gram}; + D_Reduction *d_reductions_45_dparser_gram[] = {&d_reduction_34_dparser_gram}; + D_Reduction *d_reductions_46_dparser_gram[] = {&d_reduction_35_dparser_gram}; + D_Reduction *d_reductions_47_dparser_gram[] = {&d_reduction_36_dparser_gram}; + unsigned char d_goto_valid_48_dparser_gram[] = { + 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_48_dparser_gram[] = {&d_reduction_19_dparser_gram}; + unsigned char d_goto_valid_49_dparser_gram[] = { + 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x82, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10}; + D_Reduction *d_reductions_50_dparser_gram[] = {&d_reduction_17_dparser_gram}; + D_Reduction *d_reductions_51_dparser_gram[] = {&d_reduction_37_dparser_gram}; + unsigned char d_goto_valid_52_dparser_gram[] = { + 0x0, 0x18, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_52_dparser_gram[] = {&d_reduction_22_dparser_gram}; + unsigned char d_goto_valid_53_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4, 0xbf, 0x0, 0x0, 0x0, 0x20, 0x0, 0x80, 0x2, 0xfe}; + D_Reduction *d_reductions_54_dparser_gram[] = {&d_reduction_3_dparser_gram}; + unsigned char d_goto_valid_55_dparser_gram[] = { + 0x80, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x40, 0x35, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0}; + D_Reduction *d_reductions_55_dparser_gram[] = {&d_reduction_5_dparser_gram}; + unsigned char d_goto_valid_56_dparser_gram[] = { + 0x0, 0x0, 0x48, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_56_dparser_gram[] = {&d_reduction_62_dparser_gram}; + D_RightEpsilonHint d_right_epsilon_hints_56_dparser_gram[] = {{ 1, 92, &d_reduction_45_dparser_gram}, { 3, 124, &d_reduction_49_dparser_gram}}; + D_Reduction *d_reductions_57_dparser_gram[] = {&d_reduction_41_dparser_gram}; + unsigned char d_goto_valid_58_dparser_gram[] = { + 0x0, 0x0, 0x48, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_58_dparser_gram[] = {&d_reduction_62_dparser_gram}; + D_RightEpsilonHint d_right_epsilon_hints_58_dparser_gram[] = {{ 1, 92, &d_reduction_45_dparser_gram}, { 3, 124, &d_reduction_49_dparser_gram}}; + unsigned char d_goto_valid_59_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4, 0x3f, 0x0, 0x0, 0x0, 0x60, 0x0, 0x80, 0x2, 0xfe}; + unsigned char d_goto_valid_60_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4, 0xbf, 0x0, 0x0, 0x0, 0x20, 0x0, 0x80, 0x2, 0xfe}; + unsigned char d_goto_valid_61_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4, 0x3f, 0x0, 0x0, 0x0, 0x20, 0x0, 0x80, 0x6, 0xfe}; + D_Reduction *d_reductions_62_dparser_gram[] = {&d_reduction_11_dparser_gram}; + D_Reduction *d_reductions_63_dparser_gram[] = {&d_reduction_20_dparser_gram}; + unsigned char d_goto_valid_64_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x82, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10}; + D_Reduction *d_reductions_65_dparser_gram[] = {&d_reduction_13_dparser_gram}; + D_Reduction *d_reductions_66_dparser_gram[] = {&d_reduction_16_dparser_gram}; + D_Reduction *d_reductions_67_dparser_gram[] = {&d_reduction_24_dparser_gram}; + D_Reduction *d_reductions_68_dparser_gram[] = {&d_reduction_25_dparser_gram}; + D_Reduction *d_reductions_69_dparser_gram[] = {&d_reduction_26_dparser_gram}; + D_Reduction *d_reductions_70_dparser_gram[] = {&d_reduction_27_dparser_gram}; + D_Reduction *d_reductions_71_dparser_gram[] = {&d_reduction_28_dparser_gram}; + unsigned char d_goto_valid_72_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + unsigned char d_goto_valid_73_dparser_gram[] = { + 0x0, 0x18, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_73_dparser_gram[] = {&d_reduction_22_dparser_gram}; + D_RightEpsilonHint d_right_epsilon_hints_73_dparser_gram[] = {{ 0, 90, &d_reduction_23_dparser_gram}}; + D_Reduction *d_reductions_74_dparser_gram[] = {&d_reduction_101_dparser_gram}; + D_Reduction *d_reductions_75_dparser_gram[] = {&d_reduction_102_dparser_gram}; + D_Reduction *d_reductions_76_dparser_gram[] = {&d_reduction_6_dparser_gram}; + unsigned char d_goto_valid_77_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0}; + unsigned char d_goto_valid_78_dparser_gram[] = { + 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_78_dparser_gram[] = {&d_reduction_47_dparser_gram}; + D_RightEpsilonHint d_right_epsilon_hints_78_dparser_gram[] = {{ 0, 92, &d_reduction_45_dparser_gram}}; + unsigned char d_goto_valid_79_dparser_gram[] = { + 0x0, 0x0, 0x0, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_79_dparser_gram[] = {&d_reduction_53_dparser_gram, &d_reduction_58_dparser_gram}; + D_RightEpsilonHint d_right_epsilon_hints_79_dparser_gram[] = {{ 2, 124, &d_reduction_49_dparser_gram}}; + unsigned char d_goto_valid_80_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_81_dparser_gram[] = {&d_reduction_107_dparser_gram}; + D_Reduction *d_reductions_82_dparser_gram[] = {&d_reduction_119_dparser_gram}; + D_Reduction *d_reductions_83_dparser_gram[] = {&d_reduction_107_dparser_gram}; + D_Reduction *d_reductions_84_dparser_gram[] = {&d_reduction_115_dparser_gram}; + D_Reduction *d_reductions_85_dparser_gram[] = {&d_reduction_107_dparser_gram}; + D_Reduction *d_reductions_86_dparser_gram[] = {&d_reduction_117_dparser_gram}; + D_Reduction *d_reductions_87_dparser_gram[] = {&d_reduction_12_dparser_gram}; + D_Reduction *d_reductions_88_dparser_gram[] = {&d_reduction_18_dparser_gram}; + D_Reduction *d_reductions_89_dparser_gram[] = {&d_reduction_15_dparser_gram}; + D_Reduction *d_reductions_90_dparser_gram[] = {&d_reduction_23_dparser_gram}; + D_Reduction *d_reductions_91_dparser_gram[] = {&d_reduction_38_dparser_gram}; + unsigned char d_goto_valid_92_dparser_gram[] = { + 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_92_dparser_gram[] = {&d_reduction_45_dparser_gram}; + unsigned char d_goto_valid_93_dparser_gram[] = { + 0x0, 0x0, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_93_dparser_gram[] = {&d_reduction_51_dparser_gram}; + D_RightEpsilonHint d_right_epsilon_hints_93_dparser_gram[] = {{ 1, 124, &d_reduction_49_dparser_gram}}; + D_Reduction *d_reductions_94_dparser_gram[] = {&d_reduction_52_dparser_gram}; + unsigned char d_goto_valid_95_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x90, 0x2, 0x40, 0x81, 0x3, 0x0, 0x0, 0x0, 0x28, 0x0, 0x80, 0x2, 0x1c}; + D_Reduction *d_reductions_96_dparser_gram[] = {&d_reduction_38_dparser_gram}; + unsigned char d_goto_valid_97_dparser_gram[] = { + 0x0, 0x0, 0x40, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_97_dparser_gram[] = {&d_reduction_62_dparser_gram}; + D_RightEpsilonHint d_right_epsilon_hints_97_dparser_gram[] = {{ 0, 111, &d_reduction_48_dparser_gram}, { 3, 124, &d_reduction_49_dparser_gram}}; + D_Reduction *d_reductions_98_dparser_gram[] = {&d_reduction_46_dparser_gram}; + unsigned char d_goto_valid_99_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0xb0, 0xc, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0x3f, 0x2, 0x0}; + D_Reduction *d_reductions_99_dparser_gram[] = {&d_reduction_97_dparser_gram}; + D_RightEpsilonHint d_right_epsilon_hints_99_dparser_gram[] = {{ 0, 124, &d_reduction_49_dparser_gram}, { 2, 151, &d_reduction_91_dparser_gram}}; + unsigned char d_goto_valid_100_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0xc4, 0x3f, 0x0, 0x0, 0x0, 0x20, 0x0, 0x80, 0x2, 0xfe}; + unsigned char d_goto_valid_101_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_101_dparser_gram[] = {&d_reduction_73_dparser_gram}; + unsigned char d_goto_valid_102_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_102_dparser_gram[] = {&d_reduction_106_dparser_gram}; + D_Reduction *d_reductions_103_dparser_gram[] = {&d_reduction_57_dparser_gram}; + unsigned char d_goto_valid_104_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_104_dparser_gram[] = {&d_reduction_56_dparser_gram, &d_reduction_70_dparser_gram}; + D_RightEpsilonHint d_right_epsilon_hints_104_dparser_gram[] = {{ 0, 132, &d_reduction_54_dparser_gram}}; + unsigned char d_goto_valid_105_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_105_dparser_gram[] = {&d_reduction_61_dparser_gram}; + D_RightEpsilonHint d_right_epsilon_hints_105_dparser_gram[] = {{ 0, 133, &d_reduction_59_dparser_gram}}; + D_Reduction *d_reductions_106_dparser_gram[] = {&d_reduction_72_dparser_gram}; + D_Reduction *d_reductions_107_dparser_gram[] = {&d_reduction_71_dparser_gram}; + D_Reduction *d_reductions_108_dparser_gram[] = {&d_reduction_63_dparser_gram}; + D_Reduction *d_reductions_109_dparser_gram[] = {&d_reduction_64_dparser_gram}; + D_Reduction *d_reductions_110_dparser_gram[] = {&d_reduction_65_dparser_gram}; + D_Reduction *d_reductions_111_dparser_gram[] = {&d_reduction_48_dparser_gram}; + D_Reduction *d_reductions_112_dparser_gram[] = {&d_reduction_80_dparser_gram}; + D_Reduction *d_reductions_113_dparser_gram[] = {&d_reduction_81_dparser_gram}; + D_Reduction *d_reductions_114_dparser_gram[] = {&d_reduction_82_dparser_gram}; + D_Reduction *d_reductions_115_dparser_gram[] = {&d_reduction_83_dparser_gram}; + D_Reduction *d_reductions_116_dparser_gram[] = {&d_reduction_84_dparser_gram}; + D_Reduction *d_reductions_117_dparser_gram[] = {&d_reduction_85_dparser_gram}; + D_Reduction *d_reductions_118_dparser_gram[] = {&d_reduction_86_dparser_gram}; + D_Reduction *d_reductions_119_dparser_gram[] = {&d_reduction_87_dparser_gram}; + D_Reduction *d_reductions_120_dparser_gram[] = {&d_reduction_88_dparser_gram}; + D_Reduction *d_reductions_121_dparser_gram[] = {&d_reduction_89_dparser_gram}; + D_Reduction *d_reductions_122_dparser_gram[] = {&d_reduction_50_dparser_gram}; + unsigned char d_goto_valid_123_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x3c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe0}; + D_Reduction *d_reductions_124_dparser_gram[] = {&d_reduction_49_dparser_gram}; + unsigned char d_goto_valid_125_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x52, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0}; + D_Reduction *d_reductions_125_dparser_gram[] = {&d_reduction_95_dparser_gram}; + D_RightEpsilonHint d_right_epsilon_hints_125_dparser_gram[] = {{ 1, 151, &d_reduction_91_dparser_gram}}; + D_Reduction *d_reductions_126_dparser_gram[] = {&d_reduction_96_dparser_gram}; + D_Reduction *d_reductions_127_dparser_gram[] = {&d_reduction_98_dparser_gram}; + unsigned char d_goto_valid_128_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4, 0xbf, 0x0, 0x0, 0x0, 0x20, 0x0, 0x80, 0x2, 0xfe}; + D_Reduction *d_reductions_129_dparser_gram[] = {&d_reduction_69_dparser_gram}; + unsigned char d_goto_valid_130_dparser_gram[] = { + 0x0, 0x0, 0x48, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_130_dparser_gram[] = {&d_reduction_62_dparser_gram}; + D_RightEpsilonHint d_right_epsilon_hints_130_dparser_gram[] = {{ 1, 92, &d_reduction_45_dparser_gram}, { 3, 124, &d_reduction_49_dparser_gram}}; + unsigned char d_goto_valid_131_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4, 0x3f, 0x0, 0x0, 0x0, 0x20, 0x0, 0x80, 0x6, 0xfe}; + unsigned char d_goto_valid_132_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0xf, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_132_dparser_gram[] = {&d_reduction_54_dparser_gram}; + unsigned char d_goto_valid_133_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0xf, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_133_dparser_gram[] = {&d_reduction_59_dparser_gram}; + D_Reduction *d_reductions_134_dparser_gram[] = {&d_reduction_79_dparser_gram}; + D_Reduction *d_reductions_135_dparser_gram[] = {&d_reduction_90_dparser_gram}; + unsigned char d_goto_valid_136_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_136_dparser_gram[] = {&d_reduction_93_dparser_gram}; + D_RightEpsilonHint d_right_epsilon_hints_136_dparser_gram[] = {{ 0, 151, &d_reduction_91_dparser_gram}}; + D_Reduction *d_reductions_137_dparser_gram[] = {&d_reduction_94_dparser_gram}; + D_Reduction *d_reductions_138_dparser_gram[] = {&d_reduction_99_dparser_gram}; + D_Reduction *d_reductions_139_dparser_gram[] = {&d_reduction_66_dparser_gram}; + D_Reduction *d_reductions_140_dparser_gram[] = {&d_reduction_68_dparser_gram}; + unsigned char d_goto_valid_141_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0}; + D_Reduction *d_reductions_142_dparser_gram[] = {&d_reduction_104_dparser_gram}; + D_Reduction *d_reductions_143_dparser_gram[] = {&d_reduction_105_dparser_gram}; + unsigned char d_goto_valid_144_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe0}; + D_Reduction *d_reductions_145_dparser_gram[] = {&d_reduction_75_dparser_gram}; + D_Reduction *d_reductions_146_dparser_gram[] = {&d_reduction_76_dparser_gram}; + D_Reduction *d_reductions_147_dparser_gram[] = {&d_reduction_77_dparser_gram}; + D_Reduction *d_reductions_148_dparser_gram[] = {&d_reduction_78_dparser_gram}; + D_Reduction *d_reductions_149_dparser_gram[] = {&d_reduction_55_dparser_gram}; + D_Reduction *d_reductions_150_dparser_gram[] = {&d_reduction_60_dparser_gram}; + unsigned char d_goto_valid_151_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x20, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10}; + D_Reduction *d_reductions_151_dparser_gram[] = {&d_reduction_91_dparser_gram}; + D_Reduction *d_reductions_152_dparser_gram[] = {&d_reduction_67_dparser_gram}; + D_Reduction *d_reductions_153_dparser_gram[] = {&d_reduction_74_dparser_gram}; + D_Reduction *d_reductions_154_dparser_gram[] = {&d_reduction_92_dparser_gram}; + unsigned char d_goto_valid_155_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0}; + unsigned char d_goto_valid_156_dparser_gram[] = { + 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0}; + D_Reduction *d_reductions_157_dparser_gram[] = {&d_reduction_100_dparser_gram}; + unsigned short d_gotos_dparser_gram[547] = { + 2,3,14,15,31,4,16,49,54,50,56,53,60,55,17,51, + 18,19,59,61,62,65,78,90,17,79,18,19,92,89,93,81, + 97,80,79,88,67,99,100,73,74,131,80,132,32,20,133,134, + 33,34,35,36,37,38,39,40,21,152,52,94,95,5,96,6, + 153,7,21,8,9,157,41,42,43,44,45,46,47,48,13,52, + 142,112,0,79,10,66,57,22,11,80,58,80,137,0,10,138, + 13,139,11,68,69,70,71,72,158,23,98,24,0,77,12,0, + 0,0,0,25,26,27,13,28,29,30,0,13,150,13,0,0, + 0,0,64,0,155,13,33,34,35,36,37,38,39,40,0,63, + 156,0,13,76,20,0,0,33,34,35,36,37,38,39,40,0, + 75,0,12,0,5,0,6,151,7,12,8,9,83,22,0,0, + 33,34,35,36,37,38,39,40,145,146,147,148,149,0,22,23, + 0,24,0,0,0,154,38,39,40,25,26,27,13,28,29,30, + 23,0,24,13,0,12,0,22,82,135,25,26,27,13,28,29, + 30,91,74,145,146,147,148,149,0,23,0,24,0,136,38,39, + 40,0,0,25,26,27,13,28,29,30,85,0,0,0,33,34, + 35,36,37,38,39,40,0,84,28,29,30,87,0,0,0,33, + 34,35,36,37,38,39,40,0,0,0,0,0,0,68,69,70, + 71,72,0,0,0,22,0,123,124,0,125,0,0,126,127,0, + 28,29,30,128,0,0,22,23,0,24,0,0,0,0,0,0, + 0,25,26,27,13,28,29,30,23,104,24,86,105,0,106,0, + 0,0,25,26,27,13,28,29,30,0,0,107,0,108,0,0, + 129,0,0,0,109,110,111,113,114,115,116,117,118,119,120,121, + 122,0,130,0,103,0,33,34,35,36,37,38,39,40,0,0, + 0,0,0,0,0,0,0,141,101,0,102,33,34,35,36,37, + 38,39,40,0,140,0,0,0,0,0,0,0,12,22,103,0, + 0,0,0,0,0,0,0,26,27,13,0,0,0,0,0,23, + 0,24,22,0,0,0,0,0,0,25,26,27,13,28,29,30, + 0,0,0,0,23,0,24,0,0,0,0,0,0,0,25,26, + 27,13,28,29,30,144,0,0,0,33,34,35,36,37,38,39, + 40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,23,0,24,143,0,0,0,0,0,0,25,26,27,13, + 28,29,30}; + + D_ErrorRecoveryHint d_error_recovery_hints_3_dparser_gram[] = { + { 0, 7, "}"}, + { 0, 15, ";"}}; + D_ErrorRecoveryHint d_error_recovery_hints_4_dparser_gram[] = { + { 0, 7, "}"}, + { 0, 50, ")"}, + { 0, 50, "]"}}; + D_ErrorRecoveryHint d_error_recovery_hints_5_dparser_gram[] = {{ 1, 7, "}"}}; + D_ErrorRecoveryHint d_error_recovery_hints_11_dparser_gram[] = {{ 1, 46, "}"}}; + D_ErrorRecoveryHint d_error_recovery_hints_13_dparser_gram[] = {{ 0, 15, ";"}}; + D_ErrorRecoveryHint d_error_recovery_hints_17_dparser_gram[] = {{ 1, 15, ";"}}; + D_ErrorRecoveryHint d_error_recovery_hints_21_dparser_gram[] = {{ 1, 50, ")"}}; + D_ErrorRecoveryHint d_error_recovery_hints_22_dparser_gram[] = {{ 1, 50, "}"}}; + D_ErrorRecoveryHint d_error_recovery_hints_23_dparser_gram[] = {{ 1, 50, "]"}}; + D_ErrorRecoveryHint d_error_recovery_hints_48_dparser_gram[] = {{ 2, 7, "}"}}; + D_ErrorRecoveryHint d_error_recovery_hints_53_dparser_gram[] = { + { 0, 46, "}"}, + { 0, 50, ")"}, + { 0, 50, "]"}}; + D_ErrorRecoveryHint d_error_recovery_hints_55_dparser_gram[] = {{ 0, 7, "}"}}; + D_ErrorRecoveryHint d_error_recovery_hints_56_dparser_gram[] = {{ 2, 15, ";"}}; + D_ErrorRecoveryHint d_error_recovery_hints_59_dparser_gram[] = { + { 0, 50, ")"}, + { 0, 50, "]"}, + { 0, 50, "}"}}; + D_ErrorRecoveryHint d_error_recovery_hints_62_dparser_gram[] = {{ 3, 7, "}"}}; + D_ErrorRecoveryHint d_error_recovery_hints_74_dparser_gram[] = {{ 3, 46, "}"}}; + D_ErrorRecoveryHint d_error_recovery_hints_77_dparser_gram[] = {{ 3, 15, ";"}}; + D_ErrorRecoveryHint d_error_recovery_hints_81_dparser_gram[] = {{ 3, 50, ")"}}; + D_ErrorRecoveryHint d_error_recovery_hints_83_dparser_gram[] = {{ 3, 50, "}"}}; + D_ErrorRecoveryHint d_error_recovery_hints_85_dparser_gram[] = {{ 3, 50, "]"}}; + D_ErrorRecoveryHint d_error_recovery_hints_87_dparser_gram[] = {{ 4, 7, "}"}}; + D_ErrorRecoveryHint d_error_recovery_hints_91_dparser_gram[] = {{ 4, 15, ";"}}; + D_ErrorRecoveryHint d_error_recovery_hints_95_dparser_gram[] = { + { 0, 31, "}"}, + { 0, 31, ")"}, + { 0, 48, "]"}}; + D_ErrorRecoveryHint d_error_recovery_hints_99_dparser_gram[] = {{ 0, 48, "]"}}; + D_ErrorRecoveryHint d_error_recovery_hints_100_dparser_gram[] = { + { 0, 31, "}"}, + { 0, 50, ")"}, + { 0, 50, "]"}}; + D_ErrorRecoveryHint d_error_recovery_hints_101_dparser_gram[] = {{ 1, 31, ")"}}; + D_ErrorRecoveryHint d_error_recovery_hints_102_dparser_gram[] = {{ 1, 48, "]"}}; + D_ErrorRecoveryHint d_error_recovery_hints_125_dparser_gram[] = {{ 0, 46, "}"}}; + D_ErrorRecoveryHint d_error_recovery_hints_130_dparser_gram[] = {{ 2, 31, ")"}}; + D_ErrorRecoveryHint d_error_recovery_hints_131_dparser_gram[] = { + { 0, 48, "]"}, + { 0, 50, ")"}, + { 0, 50, "}"}}; + D_ErrorRecoveryHint d_error_recovery_hints_139_dparser_gram[] = {{ 3, 31, "}"}}; + D_ErrorRecoveryHint d_error_recovery_hints_141_dparser_gram[] = {{ 3, 31, ")"}}; + D_ErrorRecoveryHint d_error_recovery_hints_142_dparser_gram[] = {{ 3, 48, "]"}}; + D_ErrorRecoveryHint d_error_recovery_hints_152_dparser_gram[] = {{ 4, 31, ")"}}; + + D_State d_states_dparser_gram[] = { + { d_goto_valid_0_dparser_gram, 1, { 1, d_reductions_0_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 0, NULL}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 1, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_2_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_3_dparser_gram, 1, { 0, NULL}, { 0, NULL}, { 2, d_error_recovery_hints_3_dparser_gram}, d_shifts_3_dparser_gram, NULL, (void*)d_scanner_3_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_3_dparser_gram, d_accepts_diff_3_dparser_gram, -1}, + { d_goto_valid_4_dparser_gram, 6, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_4_dparser_gram}, d_shifts_4_dparser_gram, NULL, (void*)d_scanner_4_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_4_dparser_gram, d_accepts_diff_4_dparser_gram, -1}, + { d_goto_valid_5_dparser_gram, 6, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_5_dparser_gram}, d_shifts_5_dparser_gram, NULL, (void*)d_scanner_5_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_5_dparser_gram, d_accepts_diff_5_dparser_gram, -1}, + { d_goto_valid_6_dparser_gram, -1, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_5_dparser_gram}, d_shifts_6_dparser_gram, NULL, (void*)d_scanner_6_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_6_dparser_gram, d_accepts_diff_6_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_7_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_8_dparser_gram, 46, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_5_dparser_gram}, d_shifts_6_dparser_gram, NULL, (void*)d_scanner_6_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_6_dparser_gram, d_accepts_diff_6_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_9_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_10_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_11_dparser_gram, 39, { 1, d_reductions_11_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_11_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_12_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_13_dparser_gram, -9, { 1, d_reductions_13_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_13_dparser_gram}, d_shifts_13_dparser_gram, NULL, (void*)d_scanner_13_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_13_dparser_gram, d_accepts_diff_13_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_14_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_15_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_16_dparser_gram, -5, { 1, d_reductions_16_dparser_gram}, { 1, d_right_epsilon_hints_16_dparser_gram}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_17_dparser_gram, -2, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_17_dparser_gram}, d_shifts_17_dparser_gram, NULL, (void*)d_scanner_17_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_17_dparser_gram, d_accepts_diff_17_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_18_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_19_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_20_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_21_dparser_gram, 41, { 1, d_reductions_21_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_21_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_22_dparser_gram, 32, { 1, d_reductions_22_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_22_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_23_dparser_gram, 32, { 1, d_reductions_23_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_23_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_24_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_25_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_26_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_27_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_28_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_29_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_30_dparser_gram, -80, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_4_dparser_gram}, d_shifts_30_dparser_gram, NULL, (void*)d_scanner_30_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_30_dparser_gram, d_accepts_diff_30_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_31_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_32_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_33_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_34_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_35_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_36_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_37_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_38_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_39_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_40_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_41_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_42_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_43_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_44_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_45_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_46_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_47_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_48_dparser_gram, -12, { 1, d_reductions_48_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_48_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_49_dparser_gram, -22, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_48_dparser_gram}, d_shifts_49_dparser_gram, NULL, (void*)d_scanner_49_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_49_dparser_gram, d_accepts_diff_49_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_50_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_51_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_52_dparser_gram, -28, { 1, d_reductions_52_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_48_dparser_gram}, d_shifts_52_dparser_gram, NULL, (void*)d_scanner_52_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_52_dparser_gram, d_accepts_diff_52_dparser_gram, -1}, + { d_goto_valid_53_dparser_gram, -97, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_53_dparser_gram}, d_shifts_30_dparser_gram, NULL, (void*)d_scanner_30_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_30_dparser_gram, d_accepts_diff_30_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_54_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_55_dparser_gram, -102, { 1, d_reductions_55_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_55_dparser_gram}, d_shifts_55_dparser_gram, NULL, (void*)d_scanner_55_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_55_dparser_gram, d_accepts_diff_55_dparser_gram, -1}, + { d_goto_valid_56_dparser_gram, -3, { 1, d_reductions_56_dparser_gram}, { 2, d_right_epsilon_hints_56_dparser_gram}, { 1, d_error_recovery_hints_56_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_57_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_58_dparser_gram, -12, { 1, d_reductions_58_dparser_gram}, { 2, d_right_epsilon_hints_58_dparser_gram}, { 1, d_error_recovery_hints_56_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_59_dparser_gram, -122, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_59_dparser_gram}, d_shifts_59_dparser_gram, NULL, (void*)d_scanner_59_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_59_dparser_gram, d_accepts_diff_59_dparser_gram, -1}, + { d_goto_valid_60_dparser_gram, -200, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_59_dparser_gram}, d_shifts_30_dparser_gram, NULL, (void*)d_scanner_30_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_30_dparser_gram, d_accepts_diff_30_dparser_gram, -1}, + { d_goto_valid_61_dparser_gram, -217, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_59_dparser_gram}, d_shifts_61_dparser_gram, NULL, (void*)d_scanner_61_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_61_dparser_gram, d_accepts_diff_61_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_62_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_62_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_63_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_64_dparser_gram, 28, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_62_dparser_gram}, d_shifts_49_dparser_gram, NULL, (void*)d_scanner_49_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_49_dparser_gram, d_accepts_diff_49_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_65_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_62_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_66_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_67_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_68_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_69_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_70_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_71_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_72_dparser_gram, 40, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_62_dparser_gram}, d_shifts_72_dparser_gram, NULL, (void*)d_scanner_72_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_72_dparser_gram, d_accepts_diff_72_dparser_gram, -1}, + { d_goto_valid_73_dparser_gram, -214, { 1, d_reductions_73_dparser_gram}, { 1, d_right_epsilon_hints_73_dparser_gram}, { 0, NULL}, d_shifts_52_dparser_gram, NULL, (void*)d_scanner_52_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_52_dparser_gram, d_accepts_diff_52_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_74_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_74_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_75_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_76_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_77_dparser_gram, 57, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_77_dparser_gram}, d_shifts_77_dparser_gram, NULL, (void*)d_scanner_77_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_77_dparser_gram, d_accepts_diff_77_dparser_gram, -1}, + { d_goto_valid_78_dparser_gram, -10, { 1, d_reductions_78_dparser_gram}, { 1, d_right_epsilon_hints_78_dparser_gram}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_79_dparser_gram, -35, { 2, d_reductions_79_dparser_gram}, { 1, d_right_epsilon_hints_79_dparser_gram}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_80_dparser_gram, 53, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_77_dparser_gram}, d_shifts_77_dparser_gram, NULL, (void*)d_scanner_77_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_77_dparser_gram, d_accepts_diff_77_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_81_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_81_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_82_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_83_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_83_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_84_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_85_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_85_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_86_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_87_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_87_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_88_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_89_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_87_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_90_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_91_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_91_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_92_dparser_gram, -16, { 1, d_reductions_92_dparser_gram}, { 0, NULL}, { 0, NULL}, d_shifts_92_dparser_gram, NULL, (void*)d_scanner_92_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_92_dparser_gram, d_accepts_diff_92_dparser_gram, -1}, + { d_goto_valid_93_dparser_gram, -15, { 1, d_reductions_93_dparser_gram}, { 1, d_right_epsilon_hints_93_dparser_gram}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_94_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_95_dparser_gram, -301, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_95_dparser_gram}, d_shifts_95_dparser_gram, NULL, (void*)d_scanner_95_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_95_dparser_gram, d_accepts_diff_95_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_96_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_91_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_97_dparser_gram, -59, { 1, d_reductions_97_dparser_gram}, { 2, d_right_epsilon_hints_97_dparser_gram}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_98_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_99_dparser_gram, -259, { 1, d_reductions_99_dparser_gram}, { 2, d_right_epsilon_hints_99_dparser_gram}, { 1, d_error_recovery_hints_99_dparser_gram}, d_shifts_99_dparser_gram, NULL, (void*)d_scanner_99_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_99_dparser_gram, d_accepts_diff_99_dparser_gram, -1}, + { d_goto_valid_100_dparser_gram, -320, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_100_dparser_gram}, d_shifts_4_dparser_gram, NULL, (void*)d_scanner_4_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_4_dparser_gram, d_accepts_diff_4_dparser_gram, -1}, + { d_goto_valid_101_dparser_gram, -7, { 1, d_reductions_101_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_101_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_102_dparser_gram, 6, { 1, d_reductions_102_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_102_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_103_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_104_dparser_gram, -20, { 2, d_reductions_104_dparser_gram}, { 1, d_right_epsilon_hints_104_dparser_gram}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_105_dparser_gram, -18, { 1, d_reductions_105_dparser_gram}, { 1, d_right_epsilon_hints_105_dparser_gram}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_106_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_107_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_108_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_109_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_110_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_111_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_112_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_113_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_114_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_115_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_116_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_117_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_118_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_119_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_120_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_121_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_122_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_123_dparser_gram, -179, { 0, NULL}, { 0, NULL}, { 0, NULL}, d_shifts_123_dparser_gram, NULL, (void*)d_scanner_123_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_123_dparser_gram, d_accepts_diff_123_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_124_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_125_dparser_gram, -51, { 1, d_reductions_125_dparser_gram}, { 1, d_right_epsilon_hints_125_dparser_gram}, { 1, d_error_recovery_hints_125_dparser_gram}, d_shifts_125_dparser_gram, NULL, (void*)d_scanner_125_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_125_dparser_gram, d_accepts_diff_125_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_126_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_127_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_128_dparser_gram, -341, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_100_dparser_gram}, d_shifts_30_dparser_gram, NULL, (void*)d_scanner_30_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_30_dparser_gram, d_accepts_diff_30_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_129_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_130_dparser_gram, -61, { 1, d_reductions_130_dparser_gram}, { 2, d_right_epsilon_hints_130_dparser_gram}, { 1, d_error_recovery_hints_130_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_131_dparser_gram, -419, { 0, NULL}, { 0, NULL}, { 3, d_error_recovery_hints_131_dparser_gram}, d_shifts_61_dparser_gram, NULL, (void*)d_scanner_61_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_61_dparser_gram, d_accepts_diff_61_dparser_gram, -1}, + { d_goto_valid_132_dparser_gram, -89, { 1, d_reductions_132_dparser_gram}, { 0, NULL}, { 0, NULL}, d_shifts_132_dparser_gram, NULL, (void*)d_scanner_132_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_132_dparser_gram, d_accepts_diff_132_dparser_gram, -1}, + { d_goto_valid_133_dparser_gram, -132, { 1, d_reductions_133_dparser_gram}, { 0, NULL}, { 0, NULL}, d_shifts_132_dparser_gram, NULL, (void*)d_scanner_132_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_132_dparser_gram, d_accepts_diff_132_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_134_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_135_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_136_dparser_gram, -17, { 1, d_reductions_136_dparser_gram}, { 1, d_right_epsilon_hints_136_dparser_gram}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_137_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_138_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_139_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_139_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_140_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_141_dparser_gram, 30, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_141_dparser_gram}, d_shifts_141_dparser_gram, NULL, (void*)d_scanner_141_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_141_dparser_gram, d_accepts_diff_141_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_142_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_142_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_143_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_144_dparser_gram, -139, { 0, NULL}, { 0, NULL}, { 0, NULL}, d_shifts_123_dparser_gram, NULL, (void*)d_scanner_123_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_123_dparser_gram, d_accepts_diff_123_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_145_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_146_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_147_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_148_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_149_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_150_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_151_dparser_gram, -87, { 1, d_reductions_151_dparser_gram}, { 0, NULL}, { 0, NULL}, d_shifts_6_dparser_gram, NULL, (void*)d_scanner_6_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_6_dparser_gram, d_accepts_diff_6_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_152_dparser_gram}, { 0, NULL}, { 1, d_error_recovery_hints_152_dparser_gram}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_153_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { NULL, -2147483647, { 1, d_reductions_154_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1}, + { d_goto_valid_155_dparser_gram, 15, { 0, NULL}, { 0, NULL}, { 0, NULL}, d_shifts_155_dparser_gram, NULL, (void*)d_scanner_155_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_155_dparser_gram, d_accepts_diff_155_dparser_gram, -1}, + { d_goto_valid_156_dparser_gram, -58, { 0, NULL}, { 0, NULL}, { 1, d_error_recovery_hints_125_dparser_gram}, d_shifts_125_dparser_gram, NULL, (void*)d_scanner_125_dparser_gram, sizeof(unsigned char), 0, D_SCAN_ALL, (void*)d_transition_125_dparser_gram, d_accepts_diff_125_dparser_gram, -1}, + { NULL, -2147483647, { 1, d_reductions_157_dparser_gram}, { 0, NULL}, { 0, NULL}, NULL, NULL, NULL, sizeof(unsigned char), 0, D_SCAN_ALL, NULL, (D_Shift***)NULL, -1} + }; + + D_Symbol d_symbols_dparser_gram[] = { + {D_SYMBOL_INTERNAL, "0 Start", 7}, + {D_SYMBOL_INTERNAL, "1 Start", 7}, + {D_SYMBOL_NTERM, "grammar", 7}, + {D_SYMBOL_INTERNAL, "grammar.6", 9}, + {D_SYMBOL_INTERNAL, "grammar.4", 9}, + {D_SYMBOL_INTERNAL, "grammar.4.5", 11}, + {D_SYMBOL_INTERNAL, "grammar.3", 9}, + {D_SYMBOL_NTERM, "global_code", 11}, + {D_SYMBOL_INTERNAL, "global_code.10", 14}, + {D_SYMBOL_INTERNAL, "global_code.9", 13}, + {D_SYMBOL_INTERNAL, "global_code.8", 13}, + {D_SYMBOL_NTERM, "pass_types", 10}, + {D_SYMBOL_NTERM, "pass_type", 9}, + {D_SYMBOL_NTERM, "declarationtype", 15}, + {D_SYMBOL_NTERM, "token_identifier", 16}, + {D_SYMBOL_NTERM, "production", 10}, + {D_SYMBOL_NTERM, "regex_production", 16}, + {D_SYMBOL_NTERM, "production_name", 15}, + {D_SYMBOL_INTERNAL, "production_name.18", 18}, + {D_SYMBOL_NTERM, "rules", 5}, + {D_SYMBOL_INTERNAL, "rules.21", 8}, + {D_SYMBOL_INTERNAL, "rules.20", 8}, + {D_SYMBOL_NTERM, "rule", 4}, + {D_SYMBOL_INTERNAL, "rule.29", 7}, + {D_SYMBOL_INTERNAL, "rule.28", 7}, + {D_SYMBOL_INTERNAL, "rule.23", 7}, + {D_SYMBOL_INTERNAL, "rule.23.27", 10}, + {D_SYMBOL_INTERNAL, "rule.23.26", 10}, + {D_SYMBOL_INTERNAL, "rule.23.24", 10}, + {D_SYMBOL_INTERNAL, "rule.23.24.25", 13}, + {D_SYMBOL_NTERM, "new_rule", 8}, + {D_SYMBOL_NTERM, "simple_element", 14}, + {D_SYMBOL_INTERNAL, "simple_element.32", 17}, + {D_SYMBOL_NTERM, "element", 7}, + {D_SYMBOL_NTERM, "new_subrule", 11}, + {D_SYMBOL_NTERM, "element_modifier", 16}, + {D_SYMBOL_NTERM, "rule_modifier", 13}, + {D_SYMBOL_NTERM, "rule_assoc", 10}, + {D_SYMBOL_NTERM, "rule_priority", 13}, + {D_SYMBOL_NTERM, "rule_code", 9}, + {D_SYMBOL_INTERNAL, "rule_code.42", 12}, + {D_SYMBOL_INTERNAL, "rule_code.41", 12}, + {D_SYMBOL_INTERNAL, "rule_code.40", 12}, + {D_SYMBOL_NTERM, "speculative_code", 16}, + {D_SYMBOL_NTERM, "final_code", 10}, + {D_SYMBOL_NTERM, "pass_code", 9}, + {D_SYMBOL_NTERM, "curly_code", 10}, + {D_SYMBOL_INTERNAL, "curly_code.47", 13}, + {D_SYMBOL_NTERM, "bracket_code", 12}, + {D_SYMBOL_INTERNAL, "bracket_code.49", 15}, + {D_SYMBOL_NTERM, "balanced_code", 13}, + {D_SYMBOL_INTERNAL, "balanced_code.53", 16}, + {D_SYMBOL_INTERNAL, "balanced_code.52", 16}, + {D_SYMBOL_INTERNAL, "balanced_code.51", 16}, + {D_SYMBOL_NTERM, "symbols", 7}, + {D_SYMBOL_NTERM, "string", 6}, + {D_SYMBOL_NTERM, "regex", 5}, + {D_SYMBOL_NTERM, "identifier", 10}, + {D_SYMBOL_NTERM, "integer", 7}, + {D_SYMBOL_NTERM, "decimalint", 10}, + {D_SYMBOL_NTERM, "hexint", 6}, + {D_SYMBOL_NTERM, "octalint", 8}, + {D_SYMBOL_STRING, "${scanner", 9}, + {D_SYMBOL_STRING, "}", 1}, + {D_SYMBOL_STRING, "${declare", 9}, + {D_SYMBOL_STRING, "}", 1}, + {D_SYMBOL_STRING, "${token", 7}, + {D_SYMBOL_STRING, "}", 1}, + {D_SYMBOL_STRING, "${action}", 9}, + {D_SYMBOL_STRING, "${pass", 6}, + {D_SYMBOL_STRING, "}", 1}, + {D_SYMBOL_STRING, "preorder", 8}, + {D_SYMBOL_STRING, "postorder", 9}, + {D_SYMBOL_STRING, "manual", 6}, + {D_SYMBOL_STRING, "for_all", 7}, + {D_SYMBOL_STRING, "for_undefined", 13}, + {D_SYMBOL_STRING, "tokenize", 8}, + {D_SYMBOL_STRING, "longest_match", 13}, + {D_SYMBOL_STRING, "whitespace", 10}, + {D_SYMBOL_STRING, "all_matches", 11}, + {D_SYMBOL_STRING, "set_op_priority_from_rule", 25}, + {D_SYMBOL_STRING, "all_subparsers", 14}, + {D_SYMBOL_STRING, "subparser", 9}, + {D_SYMBOL_STRING, "save_parse_tree", 15}, + {D_SYMBOL_STRING, ":", 1}, + {D_SYMBOL_STRING, ";", 1}, + {D_SYMBOL_STRING, ";", 1}, + {D_SYMBOL_STRING, ";", 1}, + {D_SYMBOL_STRING, "::=", 3}, + {D_SYMBOL_STRING, "_", 1}, + {D_SYMBOL_STRING, "|", 1}, + {D_SYMBOL_STRING, "${scan", 6}, + {D_SYMBOL_STRING, "}", 1}, + {D_SYMBOL_STRING, "(", 1}, + {D_SYMBOL_STRING, ")", 1}, + {D_SYMBOL_STRING, "$term", 5}, + {D_SYMBOL_STRING, "/i", 2}, + {D_SYMBOL_STRING, "?", 1}, + {D_SYMBOL_STRING, "*", 1}, + {D_SYMBOL_STRING, "+", 1}, + {D_SYMBOL_STRING, "$unary_op_right", 15}, + {D_SYMBOL_STRING, "$unary_op_left", 14}, + {D_SYMBOL_STRING, "$binary_op_right", 16}, + {D_SYMBOL_STRING, "$binary_op_left", 15}, + {D_SYMBOL_STRING, "$unary_right", 12}, + {D_SYMBOL_STRING, "$unary_left", 11}, + {D_SYMBOL_STRING, "$binary_right", 13}, + {D_SYMBOL_STRING, "$binary_left", 12}, + {D_SYMBOL_STRING, "$right", 6}, + {D_SYMBOL_STRING, "$left", 5}, + {D_SYMBOL_STRING, ":", 1}, + {D_SYMBOL_STRING, "{", 1}, + {D_SYMBOL_STRING, "}", 1}, + {D_SYMBOL_STRING, "[", 1}, + {D_SYMBOL_STRING, "]", 1}, + {D_SYMBOL_STRING, "(", 1}, + {D_SYMBOL_STRING, ")", 1}, + {D_SYMBOL_STRING, "[", 1}, + {D_SYMBOL_STRING, "]", 1}, + {D_SYMBOL_STRING, "{", 1}, + {D_SYMBOL_STRING, "}", 1}, + {D_SYMBOL_REGEX, "[!~`@#$%^&*\\\\-_+=|:;\\\\\\\\<,>.?/]", 37}, + {D_SYMBOL_REGEX, "'([^'\\\\\\\\]|\\\\\\\\[^])*'", 29}, + {D_SYMBOL_REGEX, "\\\"([^\\\"\\\\\\\\]|\\\\\\\\[^])*\\\"", 38}, + {D_SYMBOL_REGEX, "[a-zA-Z_][a-zA-Z_0-9]*", 22}, + {D_SYMBOL_REGEX, "-?[1-9][0-9]*[uUlL]?", 20}, + {D_SYMBOL_REGEX, "-?(0x|0X)[0-9a-fA-F]+[uUlL]?", 28}, + {D_SYMBOL_REGEX, "-?0[0-7]*[uUlL]?", 16}, + }; + + D_ParserTables parser_tables_dparser_gram = { + 158, d_states_dparser_gram, d_gotos_dparser_gram, 0, 128, d_symbols_dparser_gram, NULL, 0, NULL, 0}; Index: llvm/test/Programs/MultiSource/Applications/d/index.html diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/index.html:1.1 *** /dev/null Thu Jan 1 10:50:46 2004 --- llvm/test/Programs/MultiSource/Applications/d/index.html Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,127 ---- + + + + + D Parser Homepage + + +
DParser
+ (you know... 'da parser)
+

+

+
Introduction
+
+
DParser is an simple but powerful tool for parsing.  You + can specify the form of the text to be parsed using a combination of + regular expressions and grammar productions.  Because of the + parsing technique (technically a scannerless GLR parser based on the + Tomita algorithm) there are no restrictions.   The grammar can be + ambiguous, right or left recursive, have any number of null + productions, + and because there is no seperate tokenizer, can include whitespace in + terminals and have terminals which are prefixes of other terminals. +   DParser handles not just well formed computer languages and data + files, but just about any wacky situation that occurs in the real world.
+
+ Features
+
+
    +
  • Powerful GLR parsing
    +
  • +
  • Simple EBNF-style grammars and regular expression terminals
  • +
  • Priorities and associativities for token and rules
  • +
  • Built-in error recovery
  • +
  • Speculative actions (for semantic disambiguation)
  • +
  • Auto-building of parse tree (optionally)
  • +
  • Final actions as you go, or on the complete parse tree
  • +
  • Tree walkers and default actions (multi-pass compilation support)
    +
  • +
  • Symbol table built for ambiguous parsing
  • +
  • Partial parses, recursive parsing, parsing starting with any + non-terminal
  • +
  • Whitespace can be specified as a subgrammar
  • +
  • External (C call interface) tokenizers and external terminal + scanners 
  • +
  • Good asymptotically efficiency
  • +
  • Comes with ANSI-C, Python and Verilog grammars
    +
  • +
  • Comes with full source
  • +
  • Portable C for easy compilation and linking
    +
  • +
  • BSD licence, so you can included it in your application without + worrying about licensing
    +
  • +
+ Examples
+
+         ANSI + C grammar
+
        Python + grammar
+
        Verilog + grammar
+  

+ Documentation
+
+         +
Man page for + parser generator
+
    +     Manual
+
    +     FAQ
+
+
Public Headers
+
+         dparse.h  +                - main + parser data structures and functions
+         dparse_tables.h +     - parse tables data structures
+         dsymtab.h    +            - optional symbol + table
+
+
Download
+
+      Source + (tar.gz)
+     
Binaries + for Linux, FreeBSD and Windows (cygwin)
+
+
+
Additional + Information at Sourceforge +
+ + + + + +
+ Contact the author: jplevyak at source + forge (users.sourceforge.net)
+
+ SourceForge.net Logo

+
+
+
+
+ + Index: llvm/test/Programs/MultiSource/Applications/d/lex.c diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/lex.c:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/lex.c Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,572 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + + #include "d.h" + + typedef struct NFAState { + uint index; + Vec(struct NFAState*) chars[256]; + Vec(struct NFAState*) epsilon; + Vec(Action*) accepts; + Vec(Action*) live; + } NFAState; + + typedef struct DFAState { + Vec(struct NFAState*) states; + struct DFAState *chars[256]; + ScanState *scan; + } DFAState; + + typedef Vec(DFAState *) VecDFAState; + typedef Vec(NFAState *) VecNFAState; + + typedef struct LexState { + uint nfa_index; + VecNFAState allnfas; + uint transitions; + uint scanners; + uint ignore_case; + } LexState; + + static NFAState * + new_NFAState(LexState *ls) { + NFAState *n = MALLOC(sizeof(NFAState)); + memset(n, 0, sizeof(NFAState)); + n->index = ls->nfa_index++; + vec_add(&ls->allnfas, n); + return n; + } + + static DFAState * + new_DFAState() { + DFAState *n = MALLOC(sizeof(DFAState)); + memset(n, 0, sizeof(DFAState)); + return n; + } + + static void + free_DFAState(DFAState *y) { + vec_free(&y->states); + FREE(y); + } + + static void + free_VecDFAState(VecDFAState *dfas) { + int i; + for (i = 0; i < dfas->n; i++) + free_DFAState(dfas->v[i]); + vec_free(dfas); + } + + static void + free_NFAState(NFAState *y) { + int i; + for (i = 0; i < 256; i++) + vec_free(&y->chars[i]); + vec_free(&y->epsilon); + vec_free(&y->accepts); + FREE(y); + } + + static void + free_VecNFAState(VecNFAState *nfas) { + int i; + for (i = 0; i < nfas->n; i++) + free_NFAState(nfas->v[i]); + vec_free(nfas); + } + + static ScanState * + new_ScanState() { + ScanState *n = MALLOC(sizeof(ScanState)); + memset(n, 0, sizeof(ScanState)); + return n; + } + + static int + nfacmp(const void *ai, const void *aj) { + uint32 i = (*(NFAState**)ai)->index; + uint32 j = (*(NFAState**)aj)->index; + return (i > j) ? 1 : ((i < j) ? -1 : 0); + } + + static void + nfa_closure(DFAState *x) { + int i, j, k; + + for (i = 0; i < x->states.n; i++) + for (j = 0; j < x->states.v[i]->epsilon.n; j++) { + for (k = 0; k < x->states.n; k++) + if (x->states.v[i]->epsilon.v[j] == x->states.v[k]) + goto Lbreak; + vec_add(&x->states, x->states.v[i]->epsilon.v[j]); + Lbreak:; + } + qsort(x->states.v, x->states.n, sizeof(x->states.v[0]), nfacmp); + } + + static int + eq_dfa_state(DFAState *x, DFAState *y) { + int i; + + if (x->states.n != y->states.n) + return 0; + for (i = 0; i < x->states.n; i++) + if (x->states.v[i] != y->states.v[i]) + return 0; + return 1; + } + + static void + dfa_to_scanner(VecDFAState *alldfas, VecScanState *scanner) { + int i, j, k, highest, p; + + vec_clear(scanner); + for (i = 0; i < alldfas->n; i++) { + alldfas->v[i]->scan = new_ScanState(); + alldfas->v[i]->scan->index = i; + vec_add(scanner, alldfas->v[i]->scan); + } + for (i = 0; i < alldfas->n; i++) { + for (j = 0; j < 256; j++) + if (alldfas->v[i]->chars[j]) + alldfas->v[i]->scan->chars[j] = alldfas->v[i]->chars[j]->scan; + highest = INT_MIN; + for (j = 0; j < alldfas->v[i]->states.n; j++) + for (k = 0; k < alldfas->v[i]->states.v[j]->accepts.n; k++) { + p = alldfas->v[i]->states.v[j]->accepts.v[k]->term->term_priority; + if (highest < p) + highest = p; + } + for (j = 0; j < alldfas->v[i]->states.n; j++) + for (k = 0; k < alldfas->v[i]->states.v[j]->accepts.n; k++) { + p = alldfas->v[i]->states.v[j]->accepts.v[k]->term->term_priority; + if (p == highest) + vec_add(&alldfas->v[i]->scan->accepts, + alldfas->v[i]->states.v[j]->accepts.v[k]); + } + } + } + + static void + nfa_to_scanner(NFAState *n, Scanner *s) { + DFAState *x = new_DFAState(), *y; + VecDFAState alldfas; + int i, i_alldfas, i_states, i_char; + VecScanState *scanner = &s->states; + + memset(&alldfas, 0, sizeof(alldfas)); + vec_add(&x->states, n); + nfa_closure(x); + vec_add(&alldfas, x); + for (i_alldfas = 0; i_alldfas < alldfas.n; i_alldfas++) { + x = alldfas.v[i_alldfas]; + for (i_char = 0; i_char < 256; i_char++) { + y = NULL; + for (i_states = 0; i_states < x->states.n; i_states++) { + for (i = 0; i < x->states.v[i_states]->chars[i_char].n; i++) { + if (!y) + y = new_DFAState(); + set_add(&y->states, x->states.v[i_states]->chars[i_char].v[i]); + } + } + if (y) { + set_to_vec(&y->states); + nfa_closure(y); + for (i = 0; i < alldfas.n; i++) + if (eq_dfa_state(y, alldfas.v[i])) { + free_DFAState(y); + y = alldfas.v[i]; + goto Lnext; + } + vec_add(&alldfas, y); + Lnext: + x->chars[i_char] = y; + } + } + } + dfa_to_scanner(&alldfas, scanner); + free_VecDFAState(&alldfas); + } + + /* build a NFA for the regular expression */ + static void + build_regex_nfa(LexState *ls, uint8 **areg, NFAState *pp, NFAState *nn) { + uint8 c, pc, *reg = *areg; + NFAState *p = pp, *s, *x, *n = nn; + int reversed, i; + uint8 mark[256]; + + s = p; + while ((c = *reg++)) { + switch(c) { + case '(': + build_regex_nfa(ls, ®, s, (x = new_NFAState(ls))); + p = s; + s = x; + break; + case ')': + goto Lreturn; + case '|': + vec_add(&s->epsilon, nn); + vec_add(&pp->epsilon, (s = new_NFAState(ls))); + break; + case '[': + if (*reg == '^') { + reg++; + reversed = 1; + } else + reversed = 0; + memset(mark, 0, sizeof(mark)); + pc = UCHAR_MAX; + while ((c = *reg++)) { + switch(c) { + case ']': + goto Lsetdone; + case '-': + c = *reg++; + if (!c) + goto Lerror; + if (c == '\\') + c = *reg++; + if (!c) + goto Lerror; + for (;pc <= c; pc++) + mark[pc] = 1; + break; + case '\\': + c = *reg++; + /* fall through */ + default: + pc = c; + mark[c] = 1; + break; + } + } + Lsetdone: + x = new_NFAState(ls); + for (i = 1; i < 256; i++) + if ((!reversed && mark[i]) || (reversed && !mark[i])) + vec_add(&s->chars[i], x); + p = s; + s = x; + break; + case '?': + vec_add(&p->epsilon, s); + break; + case '*': + vec_add(&p->epsilon, s); + vec_add(&s->epsilon, p); + break; + case '+': + vec_add(&s->epsilon, p); + break; + case '\\': + c = *reg++; + if (!c) + goto Lerror; + /* fall through */ + default: + if (!ls->ignore_case || !isalpha(c)) + vec_add(&s->chars[c], (x = new_NFAState(ls))); + else { + vec_add(&s->chars[tolower(c)], (x = new_NFAState(ls))); + vec_add(&s->chars[toupper(c)], x); + } + p = s; + s = x; + break; + } + } + Lreturn: + vec_add(&s->epsilon, n); + *areg = reg; + return; + Lerror: + d_fail("bad (part of) regex: %s\n", *areg); + } + + static void + action_diff(VecAction *a, VecAction *b, VecAction *c) { + int bb = 0, cc = 0; + while (1) { + if (bb >= b->n) + break; + Lagainc: + if (cc >= c->n) { + while (bb < b->n) + vec_add(a, b->v[bb++]); + break; + } + Lagainb: + if (b->v[bb]->index == c->v[cc]->index) { + bb++; + cc++; + continue; + } + if (b->v[bb]->index < c->v[cc]->index) { + vec_add(a, b->v[bb++]); + if (bb >= b->n) + break; + goto Lagainb; + } + cc++; + goto Lagainc; + } + } + + static void + action_intersect(VecAction *a, VecAction *b, VecAction *c) { + int bb = 0, cc = 0; + while (1) { + if (bb >= b->n) + break; + Lagainc: + if (cc >= c->n) + break; + Lagainb: + if (b->v[bb]->index == c->v[cc]->index) { + vec_add(a, b->v[bb++]); + cc++; + continue; + } + if (b->v[bb]->index < c->v[cc]->index) { + bb++; + if (bb >= b->n) + break; + goto Lagainb; + } + cc++; + goto Lagainc; + } + } + + static void + compute_liveness(Scanner *scanner) { + int i, j, changed = 1; + ScanState *ss, *sss; + VecScanState *states = &scanner->states; + + /* basis */ + for (i = 0; i < states->n; i++) { + ss = states->v[i]; + set_union(&ss->live, &ss->accepts); + } + while (changed) { + changed = 0; + for (i = 0; i < states->n; i++) { + ss = states->v[i]; + for (j = 0; j < 256; j++) { + if ((sss = ss->chars[j])) { + if (ss != sss) + if (set_union(&ss->live, &sss->live)) + changed = 1; + } + } + } + } + for (i = 0; i < states->n; i++) { + ss = states->v[i]; + set_to_vec(&ss->live); + sort_VecAction(&ss->live); + } + } + + static uint32 + trans_hash_fn(ScanStateTransition *a, hash_fns_t *fns) { + uint h = 0; + int i; + + if (!fns->data[0]) + for (i = 0; i < a->live_diff.n; i++) + h += 3 * a->live_diff.v[i]->index; + for (i = 0; i < a->accepts_diff.n; i++) + h += 3 * a->accepts_diff.v[i]->index; + return h; + } + + static int + trans_cmp_fn(ScanStateTransition *a, ScanStateTransition *b, hash_fns_t *fns) { + int i; + + if (!fns->data[0]) + if (a->live_diff.n != b->live_diff.n) + return 1; + if (a->accepts_diff.n != b->accepts_diff.n) + return 1; + if (!fns->data[0]) + for (i = 0; i < a->live_diff.n; i++) + if (a->live_diff.v[i] != b->live_diff.v[i]) + return 1; + for (i = 0; i < a->accepts_diff.n; i++) + if (a->accepts_diff.v[i] != b->accepts_diff.v[i]) + return 1; + return 0; + } + + static hash_fns_t trans_hash_fns = { + (hash_fn_t)trans_hash_fn, + (cmp_fn_t)trans_cmp_fn, + { 0, 0 } + }; + + static void + build_transitions(LexState *ls, Scanner *s) { + int i, j; + ScanState *ss; + ScanStateTransition *trans = NULL, *x; + VecScanState *states = &s->states; + + #ifdef LIVE_DIFF_IN_TRANSITIONS + trans_hash_fns.data[0] = (void*)0; + #else + trans_hash_fns.data[0] = (void*)1; + #endif + for (i = 0; i < states->n; i++) { + ss = states->v[i]; + for (j = 0; j < 256; j++) { + if (!trans) { + trans = MALLOC(sizeof(*trans)); + memset(trans, 0, sizeof(*trans)); + } + if (ss->chars[j]) { + action_diff(&trans->live_diff, &ss->live, &ss->chars[j]->live); + action_intersect(&trans->accepts_diff, &ss->accepts, + &trans->live_diff); + } + if ((x = set_add_fn(&s->transitions, trans, &trans_hash_fns)) == trans) + trans = NULL; + else { + vec_free(&trans->live_diff); + vec_free(&trans->accepts_diff); + } + ss->transition[j] = x; + } + } + j = 0; + set_to_vec(&s->transitions); + for (i = 0; i < s->transitions.n; i++) + s->transitions.v[i]->index = i; + ls->transitions += s->transitions.n; + } + + static void + compute_transitions(LexState *ls, Scanner *s) { + compute_liveness(s); + build_transitions(ls, s); + } + + static void + build_state_scanner(LexState *ls, State *s) { + NFAState *n, *nn, *nnn; + Action *a; + uint8 *c, *reg; + int j, one; + + one = 0; + n = new_NFAState(ls); + /* first strings since they can be trivially combined as a tree */ + for (j = 0; j < s->shift_actions.n; j++) { + a = s->shift_actions.v[j]; + if (a->kind == ACTION_ACCEPT) { + one = 1; + if (!n->chars[0].n) + vec_add(&n->chars[0], (nnn = new_NFAState(ls))); + else + nnn = n->chars[0].v[0]; + vec_add(&nnn->accepts, a); + } else if (a->kind == ACTION_SHIFT && a->term->kind == TERM_STRING) { + one = 1; + nn = n; + if (!a->term->ignore_case) { + for (c = a->term->string; *c; c++) { + if (!nn->chars[*c].n) + vec_add(&nn->chars[*c], (nnn = new_NFAState(ls))); + else + nnn = nn->chars[*c].v[0]; + nn = nnn; + } + } else { /* use new states */ + for (c = a->term->string; *c; c++) { + if (isalpha(*c)) { + vec_add(&nn->chars[toupper(*c)], (nnn = new_NFAState(ls))); + vec_add(&nn->chars[tolower(*c)], nnn); + } else + vec_add(&nn->chars[*c], (nnn = new_NFAState(ls))); + nn = nnn; + } + } + vec_add(&nn->accepts, a); + } + } + /* now regexes */ + for (j = 0; j < s->shift_actions.n; j++) { + a = s->shift_actions.v[j]; + if (a->kind == ACTION_SHIFT && a->term->kind == TERM_REGEX) { + one = 1; + reg = a->term->string; + vec_add(&n->epsilon, (nnn = new_NFAState(ls))); + nn = new_NFAState(ls); + ls->ignore_case = a->term->ignore_case; + build_regex_nfa(ls, ®, nnn, nn); + vec_add(&nn->accepts, a); + } + } + if (one) { + nfa_to_scanner(n, &s->scanner); + compute_transitions(ls, &s->scanner); + } + free_VecNFAState(&ls->allnfas); + ls->scanners++; + } + + static LexState * + new_LexState() { + LexState *ls = MALLOC(sizeof(LexState)); + memset(ls, 0, sizeof(LexState)); + vec_clear(&ls->allnfas); + return ls; + } + + void + build_scanners(Grammar *g) { + int i, j, k; + State *s; + LexState *ls = new_LexState(); + + /* detect identical scanners */ + for (i = 0; i < g->states.n; i++) { + s = g->states.v[i]; + if (s->same_shifts) + continue; + for (j = 0; j < i; j++) { + if (g->states.v[j]->same_shifts) + continue; + if (g->states.v[j]->shift_actions.n != g->states.v[i]->shift_actions.n) + continue; + for (k = 0; k < g->states.v[j]->shift_actions.n; k++) + if (g->states.v[i]->shift_actions.v[k]->term != + g->states.v[j]->shift_actions.v[k]->term) + break; + if (k >= g->states.v[j]->shift_actions.n) { + s->same_shifts = g->states.v[j]; + break; + } + } + } + /* build scanners */ + for (i = 0; i < g->states.n; i++) { + s = g->states.v[i]; + if (s->shift_actions.n) { + if (s->same_shifts) + s->scanner = s->same_shifts->scanner; + else + build_state_scanner(ls, s); + } + } + if (verbose_level) + printf("%d scanners %d transitions\n", ls->scanners, ls->transitions); + FREE(ls); + } + Index: llvm/test/Programs/MultiSource/Applications/d/lex.h diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/lex.h:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/lex.h Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,28 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + + #ifndef _lex_H_ + #define _lex_H_ + + /* #define LIVE_DIFF_IN_TRANSITIONS */ + + struct Grammar; + + typedef struct ScanStateTransition { + uint index; + VecAction live_diff; + VecAction accepts_diff; + } ScanStateTransition; + + typedef struct ScanState { + uint index; + struct ScanState *chars[256]; + VecAction accepts; + VecAction live; + ScanStateTransition *transition[256]; + } ScanState; + + void build_scanners(struct Grammar *g); + + #endif Index: llvm/test/Programs/MultiSource/Applications/d/lr.c diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/lr.c:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/lr.c Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,391 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + + #include "d.h" + + #define INITIAL_ALLITEMS 3359 + + #define item_hash(_i) \ + (((uint)(_i)->rule->index << 8) + \ + ((uint)((_i)->kind != ELEM_END ? (_i)->index : (_i)->rule->elems.n))) + + static int + insert_item(State *s, Elem *e) { + Item *i = e; + if (set_add(&s->items_hash, i)) { + vec_add(&s->items, i); + return 1; + } + return 0; + } + + static int + itemcmp(const void *ai, const void *aj) { + uint i = item_hash(*(Item**)ai); + uint j = item_hash(*(Item**)aj); + return (i > j) ? 1 : ((i < j) ? -1 : 0); + } + + static State * + new_state() { + State *s = MALLOC(sizeof(State)); + memset(s, 0, sizeof(State)); + return s; + } + + static void + free_state(State *s) { + vec_free(&s->items); + vec_free(&s->items_hash); + FREE(s); + } + + static State * + maybe_add_state(Grammar *g, State *s) { + int i, j; + + for (i = 0; i < g->states.n; i++) { + if (s->hash == g->states.v[i]->hash && + s->items.n == g->states.v[i]->items.n) { + for (j = 0; j < s->items.n; j++) + if (s->items.v[j] != g->states.v[i]->items.v[j]) + goto Lcont; + free_state(s); + return g->states.v[i]; + Lcont:; + } + } + s->index = g->states.n; + vec_add(&g->states, s); + return s; + } + + static Elem * + next_elem(Item *i) { + if (i->index + 1 >= i->rule->elems.n) + return i->rule->end; + else + return i->rule->elems.v[i->index + 1]; + } + + static State * + build_closure(Grammar *g, State *s) { + int j, k; + + for (j = 0; j < s->items.n; j++) { + Item *i = s->items.v[j]; + Elem *e = i; + if (e->kind == ELEM_NTERM) { + Production *pp = e->e.nterm; + for (k = 0; k < e->e.nterm->rules.n; k++) + insert_item(s, pp->rules.v[k]->elems.v ? + pp->rules.v[k]->elems.v[0] : pp->rules.v[k]->end); + } + } + qsort(s->items.v, s->items.n, sizeof(Item*), itemcmp); + s->hash = 0; + for (j = 0; j < s->items.n; j++) + s->hash += item_hash(s->items.v[j]); + return maybe_add_state(g, s); + } + + static Elem * + clone_elem(Elem *e) { + Elem *ee = MALLOC(sizeof(*ee)); + memcpy(ee, e, sizeof(*ee)); + return ee; + } + + static void + add_goto(State *s, State *ss, Elem *e) { + Goto *g = MALLOC(sizeof(Goto)); + g->state = ss; + g->elem = clone_elem(e); + vec_add(&s->gotos, g); + } + + static void + build_state_for(Grammar *g, State *s, Elem *e) { + int j; + Item *i; + State *ss = NULL; + + for (j = 0; j < s->items.n; j++) { + i = s->items.v[j]; + if (i->kind != ELEM_END && i->kind == e->kind && + i->e.term_or_nterm == e->e.term_or_nterm) + { + if (!ss) ss = new_state(); + insert_item(ss, next_elem(i)); + } + } + if (ss) + add_goto(s, build_closure(g, ss), e); + } + + static void + build_new_states(Grammar *g) { + int i, j; + State *s; + Elem e; + + for (i = 0; i < g->states.n; i++) { + s = g->states.v[i]; + for (j = 0; j < g->terminals.n; j++) { + e.kind = ELEM_TERM; + e.e.term = g->terminals.v[j]; + build_state_for(g, s, &e); + } + for (j = 0; j < g->productions.n; j++) { + e.kind = ELEM_NTERM; + e.e.nterm = g->productions.v[j]; + build_state_for(g, s, &e); + } + } + } + + static void + build_states_for_each_production(Grammar *g) { + int i; + for (i = 0; i < g->productions.n; i++) + if (!g->productions.v[i]->internal && g->productions.v[i]->elem) { + State *s = new_state(); + insert_item(s, g->productions.v[i]->elem); + g->productions.v[i]->state = build_closure(g, s); + } + } + + uint + elem_symbol(Grammar *g, Elem *e) { + if (e->kind == ELEM_NTERM) + return e->e.nterm->index; + else + return g->productions.n + e->e.term->index; + } + + static int + gotocmp(const void *aa, const void *bb) { + Goto *a = *(Goto **)aa, *b = *(Goto **)bb; + int i = a->state->index, j = b->state->index; + return ((i > j) ? 1 : ((i < j) ? -1 : 0)); + } + + static void + sort_Gotos(Grammar *g) { + int i; + + for (i = 0; i < g->states.n; i++) { + VecGoto *vg = &g->states.v[i]->gotos; + qsort(vg->v, vg->n, sizeof(Goto*), gotocmp); + } + } + + static void + build_LR_sets(Grammar *g) { + State *s = new_state(); + insert_item(s, g->productions.v[0]->rules.v[0]->elems.v[0]); + build_closure(g, s); + build_states_for_each_production(g); + build_new_states(g); + sort_Gotos(g); + } + + static Action * + new_Action(Grammar *g, int akind, Term *aterm, Rule *arule, State *astate) { + Action *a = MALLOC(sizeof(Action)); + a->kind = akind; + a->term = aterm; + a->rule = arule; + a->state = astate; + a->index = g->action_count++; + return a; + } + + static void + add_action(Grammar *g, State *s, int akind, Term *aterm, + Rule *arule, State *astate) + { + int i; + Action *a; + + if (akind == ACTION_REDUCE) { + /* eliminate duplicates */ + for (i = 0; i < s->reduce_actions.n; i++) + if (s->reduce_actions.v[i]->rule == arule) + return; + a = new_Action(g, akind, aterm, arule, astate); + vec_add(&s->reduce_actions, a); + } else { + /* eliminate duplicates */ + for (i = 0; i < s->shift_actions.n; i++) + if (s->shift_actions.v[i]->term == aterm && + s->shift_actions.v[i]->state == astate && + s->shift_actions.v[i]->kind == akind) + return; + a = new_Action(g, akind, aterm, arule, astate); + vec_add(&s->shift_actions, a); + } + } + + static void + init_LR(Grammar *g) { + g->action_count = 0; + } + + static int + actioncmp(const void *aa, const void *bb) { + Action *a = *(Action **)aa, *b = *(Action **)bb; + int i, j; + if (a->kind == ACTION_SHIFT) + i = a->term->index + 1000000; + else + i = a->rule->index; + if (b->kind == ACTION_SHIFT) + j = b->term->index + 1000000; + else + j = b->rule->index; + return ((i > j) ? 1 : ((i < j) ? -1 : 0)); + } + + void + sort_VecAction(VecAction *v) { + qsort(v->v, v->n, sizeof(Action*), actioncmp); + } + + static void + build_actions(Grammar *g) { + int x, y, z; + State *s; + Elem *e; + + for (x = 0; x < g->states.n; x++) { + s = g->states.v[x]; + for (y = 0; y < s->items.n; y++) { + e = s->items.v[y]; + if (e->kind != ELEM_END) { + if (e->kind == ELEM_TERM) { + for (z = 0; z < s->gotos.n; z++) { + if (s->gotos.v[z]->elem->e.term == e->e.term) + add_action(g, s, ACTION_SHIFT, + e->e.term, 0, s->gotos.v[z]->state); + } + } + } else if (e->rule->prod->index) + add_action(g, s, ACTION_REDUCE, NULL, e->rule, 0); + else + s->accept = 1; + } + sort_VecAction(&s->shift_actions); + sort_VecAction(&s->reduce_actions); + } + } + + State * + goto_State(State *s, Elem *e) { + int i; + for (i = 0; i < s->gotos.n; i++) + if (s->gotos.v[i]->elem->e.term_or_nterm == e->e.term_or_nterm) + return s->gotos.v[i]->state; + return NULL; + } + + static Hint * + new_Hint(uint d, State *s, Rule *r) { + Hint *h = MALLOC(sizeof(*h)); + h->depth = d; + h->state = s; + h->rule = r; + return h; + } + + static int + hintcmp(const void *ai, const void *aj) { + Hint *i = *(Hint**)ai; + Hint *j = *(Hint**)aj; + return + (i->depth > j->depth) ? 1 : ( + (i->depth < j->depth) ? -1 : ( + (i->rule->index > j->rule->index) ? 1 : ( + (i->rule->index < j->rule->index) ? -1 : 0))); + } + + static void + build_right_epsilon_hints(Grammar *g) { + int x, y, z; + State *s, *ss; + Elem *e; + Rule *r; + + for (x = 0; x < g->states.n; x++) { + s = g->states.v[x]; + for (y = 0; y < s->items.n; y++) { + e = s->items.v[y]; + r = e->rule; + if (e->kind != ELEM_END) { + for (z = e->index; z < r->elems.n; z++) { + if ((r->elems.v[z]->kind != ELEM_NTERM || + !r->elems.v[z]->e.nterm->nullable)) + goto Lnext; + } + ss = s; + for (z = e->index; z < r->elems.n; z++) + ss = goto_State(ss, r->elems.v[z]); + if (ss && r->elems.n) + vec_add(&s->right_epsilon_hints, + new_Hint(r->elems.n - e->index - 1, ss, r)); + else /* ignore for states_for_each_productions */; + } + Lnext:; + } + if (s->right_epsilon_hints.n > 1) + qsort(s->right_epsilon_hints.v, s->right_epsilon_hints.n, + sizeof(Hint*), hintcmp); + } + } + + static void + build_error_recovery(Grammar *g) { + int i, j, k, depth; + State *s; + Rule *r, *rr; + Elem *e, *ee; + + for (i = 0; i < g->states.n; i++) { + s = g->states.v[i]; + for (j = 0; j < s->items.n; j++) { + r = s->items.v[j]->rule; + if (r->elems.n > 1 && + r->elems.v[r->elems.n - 1]->kind == ELEM_TERM && + r->elems.v[r->elems.n - 1]->e.term->kind == TERM_STRING) + { + depth = s->items.v[j]->index; + e = r->elems.v[r->elems.n - 1]; + for (k = 0; k < s->error_recovery_hints.n; k++) { + rr = s->error_recovery_hints.v[k]->rule; + ee = rr->elems.v[rr->elems.n - 1]; + if (e->e.term->string_len == ee->e.term->string_len && + !strcmp(e->e.term->string, ee->e.term->string)) + { + if (s->error_recovery_hints.v[k]->depth > depth) + s->error_recovery_hints.v[k]->depth = depth; + goto Ldone; + } + } + vec_add(&s->error_recovery_hints, new_Hint(depth, NULL, r)); + Ldone:; + } + } + qsort(s->error_recovery_hints.v, s->error_recovery_hints.n, + sizeof(Hint*), hintcmp); + } + } + + void + build_LR_tables(Grammar *g) { + init_LR(g); + build_LR_sets(g); + build_actions(g); + build_right_epsilon_hints(g); + build_error_recovery(g); + } Index: llvm/test/Programs/MultiSource/Applications/d/lr.h diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/lr.h:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/lr.h Thu Jan 1 10:50:35 2004 *************** *** 0 **** --- 1,13 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + + #ifndef _lr_H_ + #define _lr_H_ + + void build_LR_tables(Grammar *g); + void sort_VecAction(VecAction *v); + uint elem_symbol(Grammar *g, Elem *e); + State *goto_State(State *s, Elem *e); + + #endif Index: llvm/test/Programs/MultiSource/Applications/d/make_dparser.1 diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/make_dparser.1:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/make_dparser.1 Thu Jan 1 10:50:36 2004 *************** *** 0 **** --- 1,105 ---- + .TH make_dparser 1 "Mar 2003" Unix "User Manuals" + .SH NAME + .PP + make_dparser \- D Parser Generator + .SH SYNOPSIS + .PP + .B make_dparser + [\fIoptions\fP] \fIgrammar\fP + .SH DESCRIPTION + .PP + make_dparser is a scannerless GLR parser generator based on the Tomita + algorithm. It is self-hosted and very easy to use. Grammars are written in a + natural style of EBNF and regular expressions and support both speculative and + final actions. + .SH OPTIONS + .PP + .IP "-l" + Toggle longest match lexical ambiguity resolution. + When ON the scanner only recognizing the longest matching tokens + in a given state. This provides an easy way to build + grammars for languages which use longest match lexical + ambiguity resolution (e.g. ANSI-C, C++). (OFF by default) + .IP "-T" + Toggle building of a tokenizer for START. When ON, instead of generating + a unique scanner for each state (i.e. a 'scannerless' parser), + generate a single scanner (tokenizer) for the entire grammar. This provides + an easy way to build grammars for languages which assume a + tokenizer (e.g. ANSI C). (OFF by default) + .IP "-H \fI-1/0/1\fP" + Write header, 0 : no, 1 : yes, -1 : only if not empty. + .IP "-t \fI0/1\fP" + Token type, 0 : #define, 1 : enum. + .IP "-C" + Toggle computing whitespace states. If 'whitespace' is + defined in the grammar, then use it as a subparser to + consume whitespace. (ON by default) + .IP "-A" + Toggle computing states for all non-terminals. Ensures that there is a unique + state for each non-terminal so that a subparsers can be invoked for + that non-terminal. (OFF by default) + .IP "-i \fItag\fP" + Tag for grammar data structures so that multiple sets of tables can + be included in one file/application. (defaults to 'gram') + .IP "-b \fIblocks\fP" + Number of blocks to which scanner tables are broken up into. + Larger numbers permit more sharing with more overhead. 4 seems to be optimal + for most grammars. (defaults to 4) + files. + .IP "-p" + Toggle setting of operator priority from rules. Setting of operator + priorities on operator tokens can increase the size of the tables but + can permit unnecessary parse stacks to be pruned earlier. (OFF by default) + .IP "-r" + Toggle use of right recursion for EBNF productions. Do not change this + unless you really know what you are doing. (OFF by default) + .IP "-L" + Toggle writing of line numbers. Used to debug the parsing table + generator itself. (ON by default) + .IP "-v" + Increase verbosity. + .IP "-d" + Increase debugging. + .IP "-h" + Display help. + .SH ENVIRONMENT + .PP + All the options are available through environment variables + with the names: + + .na + .nh + D_MAKE_PARSER_HEADER, + D_MAKE_PARSER_TOKEN, + D_MAKE_PARSER_GRAMMAR_IDENT, + D_MAKE_PARSER_SCANNER_BLOCKS, + D_MAKE_PARSER_SET_PRIORITY, + D_MAKE_PARSER_WRITE_LINE_DIRECTIVES, + D_MAKE_PARSER_VERBOSE, + D_MAKE_PARSER_DEBUG. + .ad + .hy + .SH FEATURES + .PP + The features are covered in the documentation. See the README file. + .SH FILES + .PP + None. + .SH NO WARRANTIES + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + COPYRIGHT for more details. + .SH SEE ALSO + .PP + .BR flex (1), + .BR yacc (1), + .BR bison (1) + .PP + D Parser Home Page: http://dparser.sourceforge.net/ + .PP + The BSD General Public License. + .SH AUTHOR + .PP + John Plevyak. Use to contact. + Index: llvm/test/Programs/MultiSource/Applications/d/make_dparser.c diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/make_dparser.c:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/make_dparser.c Thu Jan 1 10:50:36 2004 *************** *** 0 **** --- 1,105 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + #include "gramgram.h" + #include "d.h" + + static void help(ArgumentState *arg_state, char *arg_unused); + + static int set_op_priority_from_rule = 0; + static int right_recursive_BNF = 0; + static int states_for_whitespace = 1; + static int states_for_all_nterms = 0; + static int tokenizer = 0; + static int longest_match = 0; + static char grammar_ident[256] = "gram"; + static int scanner_blocks = 4; + static int scanner_block_size; + static int write_line_directives = 1; + static int write_header = -1; + static int token_type = 0; + + static ArgumentDescription arg_desc[] = { + {"longest_match", 'l', "Use Longest Match Rule for Tokens", "T", + &longest_match, "D_MAKE_LONGEST_MATCH", NULL}, + {"tokenizer", 'T', "Tokenizer for START", "T", &tokenizer, + "D_MAKE_PARSER_TOKENIZER", NULL}, + {"write_header", 'H', "Write Header (-1:if not empty)", "I", &write_header, + "D_MAKE_PARSER_HEADER", NULL}, + {"token_type", 't', "Token Type (0:define, 1:enum)", "I", &token_type, + "D_MAKE_PARSER_TOKEN", NULL}, + {"whitespace_states", 'C', "Compute Whitespace States", "T", + &states_for_whitespace, "D_MAKE_PARSER_WHITESPACE", NULL}, + {"all_states", 'A', "Compute States For All NTERMs", "T", + &states_for_all_nterms, "D_MAKE_PARSER_ALL_NTERMS", NULL}, + {"grammar_ident", 'i', "Grammar Identifier", "S255", grammar_ident, + "D_MAKE_PARSER_GRAMMAR_IDENT", NULL}, + {"scanner_blocks", 'b', "Scanner Blocks", "I", &scanner_blocks, + "D_MAKE_PARSER_SCANNER_BLOCKS", NULL}, + {"op_pri_from_rule", 'p', "Set Operator Priority From Rule", "T", + &set_op_priority_from_rule, "D_MAKE_PARSER_SET_PRIORITY", NULL}, + {"right_recurse_BNF", 'r', "Use Right Recursion For */+", "T", + &right_recursive_BNF, "D_MAKE_PARSER_RIGHT_RECURSIVE_BNF", NULL}, + {"write_lines", 'L', "Write #line(s)", "T", + &write_line_directives, "D_MAKE_PARSER_WRITE_LINE_DIRECTIVES", NULL}, + {"verbose", 'v', "Verbose", "+", &verbose_level, + "D_MAKE_PARSER_VERBOSE", NULL}, + {"debug", 'd', "Debug", "+", &debug_level, + "D_MAKE_PARSER_DEBUG", NULL}, + {"help", 'h', "Help", NULL, NULL, NULL, help}, + {0} + }; + + static ArgumentState arg_state = { + 0, 0, + "program", + arg_desc + }; + + extern D_ParserTables parser_tables_dparser_gram; + + static void + help(ArgumentState *arg_state, char *arg_unused) { + char ver[30]; + d_version(ver); + fprintf(stderr, "D Make Parser Version %s ", ver); + fprintf(stderr, "Copyright (c) 2002-2003 John Plevyak\n"); + usage(arg_state, arg_unused); + } + + int + main(int argc, char *argv[]) { + char *grammar_pathname; + Grammar *g; + + process_args(&arg_state, argv); + if (arg_state.nfile_arguments != 1) + help(&arg_state, NULL); + grammar_pathname = arg_state.file_argument[0]; + g = new_D_Grammar(grammar_pathname); + /* grammar construction options */ + g->set_op_priority_from_rule = set_op_priority_from_rule; + g->right_recursive_BNF = right_recursive_BNF; + g->states_for_whitespace = states_for_whitespace; + g->states_for_all_nterms = states_for_all_nterms; + g->tokenizer = tokenizer; + g->longest_match = longest_match; + /* grammar writing options */ + strcpy(g->grammar_ident, grammar_ident); + g->scanner_blocks = scanner_blocks; + g->scanner_block_size = scanner_block_size; + g->write_line_directives = write_line_directives; + g->write_header = write_header; + g->token_type = token_type; + + if (parse_grammar(g, &parser_tables_dparser_gram, sizeof(ParseNode_User)) < 0) + d_fail("unable to parse grammar '%s'", grammar_pathname); + if (build_grammar(g) < 0) + d_fail("unable to load grammar '%s'", grammar_pathname); + if (write_ctables(g) < 0) + d_fail("unable to write C tables '%s'", grammar_pathname); + free_D_Grammar(g); + return 0; + } + + Index: llvm/test/Programs/MultiSource/Applications/d/make_dparser.cat diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/make_dparser.cat:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/make_dparser.cat Thu Jan 1 10:50:36 2004 *************** *** 0 **** --- 1,103 ---- + make_dparser(1) User Manuals make_dparser(1) + + + + NAME + make_dparser - D Parser Generator + + SYNOPSIS + make_dparser [options] grammar + + DESCRIPTION + make_dparser is a scannerless GLR parser generator based on the Tomita + algorithm. It is self-hosted and very easy to use. Grammars are written + in a natural style of EBNF and regular expressions and support both + speculative and final actions. + + OPTIONS + -l Toggle longest match lexical ambiguity resolution. When ON the + scanner only recognizing the longest matching tokens in a given + state. This provides an easy way to build grammars for languages + which use longest match lexical ambiguity resolution (e.g. ANSI- + C, C++). (OFF by default) + + -T Toggle building of a tokenizer for START. When ON, instead of + generating a unique scanner for each state (i.e. a 'scannerless' + parser), generate a single scanner (tokenizer) for the entire + grammar. This provides an easy way to build grammars for lan- + guages which assume a tokenizer (e.g. ANSI C). (OFF by default) + + -H -1/0/1 + Write header, 0 : no, 1 : yes, -1 : only if not empty. + + -t 0/1 Token type, 0 : #define, 1 : enum. + + -C Toggle computing whitespace states. If 'whitespace' is defined + in the grammar, then use it as a subparser to consume whites- + pace. (ON by default) + + -A Toggle computing states for all non-terminals. Ensures that + there is a unique state for each non-terminal so that a sub- + parsers can be invoked for that non-terminal. (OFF by default) + + -i tag Tag for grammar data structures so that multiple sets of tables + can be included in one file/application. (defaults to 'gram') + + -b blocks + Number of blocks to which scanner tables are broken up into. + Larger numbers permit more sharing with more overhead. 4 seems + to be optimal for most grammars. (defaults to 4) files. + + -p Toggle setting of operator priority from rules. Setting of + operator priorities on operator tokens can increase the size of + the tables but can permit unnecessary parse stacks to be pruned + earlier. (OFF by default) + + -r Toggle use of right recursion for EBNF productions. Do not + change this unless you really know what you are doing. (OFF by + default) + + -L Toggle writing of line numbers. Used to debug the parsing table + generator itself. (ON by default) + + -v Increase verbosity. + + -d Increase debugging. + + -h Display help. + + ENVIRONMENT + All the options are available through environment variables with the + names: + + D_MAKE_PARSER_HEADER, D_MAKE_PARSER_TOKEN, D_MAKE_PARSER_GRAMMAR_IDENT, + D_MAKE_PARSER_SCANNER_BLOCKS, D_MAKE_PARSER_SET_PRIORITY, + D_MAKE_PARSER_WRITE_LINE_DIRECTIVES, D_MAKE_PARSER_VERBOSE, + D_MAKE_PARSER_DEBUG. + + FEATURES + The features are covered in the documentation. See the README file. + + FILES + None. + + NO WARRANTIES + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of MER- + CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the COPYRIGHT + for more details. + + SEE ALSO + flex(1), yacc(1), bison(1) + + D Parser Home Page: http://dparser.sourceforge.net/ + + The BSD General Public License. + + AUTHOR + John Plevyak. Use to contact. + + + + + Unix Mar 2003 make_dparser(1) Index: llvm/test/Programs/MultiSource/Applications/d/manual.html diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/manual.html:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/manual.html Thu Jan 1 10:50:36 2004 *************** *** 0 **** --- 1,788 ---- + + + + + manual.html + + +
  DParser Manual
+
+

+
+ Contents
+
+
    +
  1. Installation
  2. +
  3. Getting Started
  4. +
  5. Comments
    +
  6. +
  7. Productions
  8. +
  9. Global Code
    +
  10. +
  11. Terminals
  12. +
      +
    1. Strings
    2. +
    3. Regular Expressions
    4. +
    5. External (C) scanners
    6. +
    7. Tokenizers
    8. +
    9. Longest Match
      +
    10. +
    +
  13. Priorities and Associativity
  14. +
      +
    1. Token Priorities
    2. +
    3. Operator Priorities
    4. +
    5. Rule Priorities
    6. +
    +
  15. Actions
  16. +
      +
    1. Speculative Actions
    2. +
    3. Final Actions
    4. +
    5. Embedded
      +
    6. +
    7. Pass Actions
      +
    8. +
    9. Default Actions
      +
    10. +
    +
  17. Attributes and Action Specifiers
  18. +
      +
    1. Global State
    2. +
    3. Parse Nodes
    4. +
    5. Misc
    6. +
    +
  19. Symbol Table
  20. +
  21. Whitespace
  22. +
  23. Ambiguities
  24. +
  25. Error Recovery
  26. +
  27. Parsing Options
    +
  28. +
  29. Grammar Grammar
    +
  30. +
+ 1. Installation
+    
+ To build: + 'gmake'              + (only available with source code package)
+
+ To test: 'gmake + test'          (only + available with source code package)
+
+ To install, 'gmake install'    (binary or source code + packages)
+
+ 2. Getting Started
+
+ 2.1. Create your grammar, for example, in the file "my.g":
+   
+    E: E '+' E | "[abc]";
+   
+ 2.2. Convert grammar into parsing tables:
+
+   % make_dparser -g my.g
+
+ 2.3. Create a driver program, for example, in the file + "my.c":  
+           
+ #include <stdio.h>
+ #include <dparse.h>
+ extern D_ParserTables parser_tables_gram;
+ int
+ main(int argc, char *argv[]) {
+   char s[256], *ss;
+   D_Parser *p = new_D_Parser(&parser_tables_gram, 0);
+   if (fgets(s,255,stdin) && dparse(p, s, strlen(s)) + && !p->syntax_errors)
+     printf("success\n");
+   else
+     printf("failure\n");
+ }
+
+ 2.4. Compile:
+
+   % cc -I/usr/local/include my.c my.g.d_parser.c -L/usr/local/lib + -ldparse
+  
+ 2.5. Run:
+   
+   % a.out
+   a=
+   syntax error, '' line 1
+   failure
+   %
+   
+   % a.out
+   a+b
+   success
+   %
+
+  We'll come back to this example later.
+
+ 3. Comments
+
+   Grammars can include C/C++ style comments.
+
+ EXAMPLE
+
+ // My first grammar
+    E: E '+' E | "[abc]";
+ /* is this right? */
+
+ 4. Productions
+
+   4.1. The first production is the root of your grammar (what you + will be trying to parse).
+   4.2. Productions start with the non-terminal being defined + followed by a colon ':', a set of right hand sides seperated by '|' + (or) + consisting of elements (non-terminals or terminals).
+   4.3. Elements can be grouped with parens '(', and the normal + regular expression symbols can be used ('+' '*' '?' '|').
+
+ EXAMPLE
+
+ program: statements+ |  comment* (function |  procedure)?;
+
+   4.4. NOTE: Instead of + using '[' ']' for optional elements we use the more familar and + consistent '?' operator.  The square brackets are reserved for + speculative actions (below).
+
+ 5. Global Code
+
+ Global (or static) C code can be intermixed with productions by + surrounding the code with brackets '{'.
+
+ EXAMPLE
+
+ { void dr_s() { printf("Dr. S\n"); }
+ S: 'the' 'cat' 'and' 'the' 'hat' { dr_s(); } | T;
+ { void twain() { printf("Mark Twain\n"); }
+ T: 'Huck' 'Finn' { twain(); };
+
+ 6. Terminals
+
+   6.1. Strings terminals are surrounded with single quotes. +  For example:
+
+ block: '{' statements* '}';
+ whileblock: 'while' '(' expression ')' block;
+
+   6.2. Regular expressions are surrounded with double quotes. +  For example:
+
+ hexint: "(0x|0X)[0-9a-fA-F]+[uUlL]?";
+
+   NOTE: only the simple + regular expression operators are currently supported (v1.3).  This + include parens, square parens, ranges, and '*', '+', '?'.   If you + need something more, request a feature or implement it yourself; the + code is in scan.c.
+
+   6.3. External (C) Scanners
+
+   There are two types of external scanners, those which read a + single terminal, and those which are global (called for every + terminal). +  Here is an example of a scanner for a single terminal. +  Notice how it can be mixed with regular string terminals.
+
+ {
+ extern char *ops;
+ extern void *ops_cache;
+ int ops_scan(char *ops, void *ops_cache, char **as,
+     int *col, int *line, unsigned short *op_assoc, int + *op_priority);
+ }
+
+ X: '1' (${scan ops_scan(ops, ops_cache)} '2')*;
+
+   The user provides the 'ops_scan' function.  This example is + from tests/g4.test.g in the source distribution.
+
+   The second type of scanner is a global scanner:
+
+ {
+ #include "g7.test.g.d_parser.h"
+ int myscanner(char **s, int *col, int *line, unsigned short *symbol,
+       int *term_priority, unsigned short + *op_assoc, int *op_priority)
+ {
+   if (**s == 'a') {
+     (*s)++;
+     *symbol = A;
+     return 1;
+   } else if (**s == 'b') {
+     (*s)++;
+     *symbol = BB;
+     return 1;
+   } else if (**s == 'c') {
+     (*s)++;
+     *symbol = CCC;
+     return 1;
+   } else if (**s == 'd') {
+     (*s)++;
+     *symbol = DDDD;
+     return 1;
+   } else
+     return 0;
+ }
+ ${scanner myscanner}
+ ${token A BB CCC DDDD}
+
+ S: A (BB CCC)+ SS;
+ SS: DDDD;
+
+   Notice how the you need to include the header file generated by make_dparser which contains the + token + definitions.
+
+ 6.4. Tokenizers
+
+   Tokenizers are non-context sensitive global scanners which + produce only one token for any given input string.  Some + programming languages (for example C) + are easier to specify using a tokenizer because (for example) reserved + words can be handled simply by lowering the terminal priority for + identifiers.
+
+ EXAMPLE:
+
+ S : 'if' '(' S ')' S ';' | 'do' S 'while' '(' S ')' ';' | ident;
+ ident: "[a-z]+" $term -1;
+
+   The sentence: if ( while ) a; + is legal because while cannot + appear at the start of S and + so + it doesn't conflict with the parsing of while + as an ident in that position. +  However, if a tokenizer is specified, all tokens will be possible + at each position and the sentense will produce a syntax error.
+
+   DParser provides two + ways to specify tokenizers: globally as an option (-T) to make_dparser and locally with a + ${declare tokenize ...} specifier (see the ANSI C grammar for an + example).  The ${declare tokenize ...} declartion allows a + tokenizer to be specified over a subset of the parsing states so that + (for example) ANSI C could be a subgrammar of another larger grammar. +  Currently the parse states are not split so that the productions + for the substates must be disjoint.
+
+ 6.5 Longest Match
+
+   Longest match lexical ambiguity resolution is a technique used + by seperate phase lexers to help decide (along
+ with lexical priorities) which single token to select for a given input + string.  It is used in the definition of ANSI-C, but not in C++ + because of a snafu in the definition of templates whereby templates of + templates (List<List <Int>>) can end with the right shift + token ('>>").  Since DParser + does not have a seperate lexical phase, it does not require longest + match disambiguation, but provides it as an option.
+
+   There are two ways to specify longest match disabiguation: + globally as an option (-l) to make_dparser + or locally with with a ${declare ... longest_match}.  If global + longest match disambiguation is ON, + it can be locally disabled with {$declare ... all_matches} .  As + with Tokenizers above, local declarations operate on disjoint subsets + of + parsing states.
+
+ 7. Priorities and Associativity
+
+
  Priorities can very from MININT to MAXINT and are + specified as integers.  Associativity can take the values:
+
+ assoc : '$unary_op_right' | '$unary_op_left' | '$binary_op_right'
+            | + '$binary_op_left' | '$unary_right' | '$unary_left'
+            | + '$binary_right' | '$binary_left' | '$right' | '$left' ;
+
+ 7.1. Token Prioritites
+
+   Currently (v1.0) the automatically generated scanners use the longest match rule so that, for + example:
+
+ OP: '>' | '>>';
+
+ will match the string '>>' only as '>>' instead of + ambiguously as either '>' or '>>'.   A planned feature is + to make this optional.
+
+   Termininal priorities apply after the longest match string has + been found and the terminal with the highest priority is selected.
+ They are introduced after a terminal by the specifier $term.  We saw an example of + token priorities with the definition of ident.
+
+ EXAMPLE:
+
+ S : 'if' '(' S ')' S ';' | 'do' S 'while' '(' S ')' ';' | ident;
+ ident: "[a-z]+" $term -1;
+
+ 7.2. Operator Priorities
+
+   Operator priorities specify the priority of a operator symbol + (either a terminal or a non-terminal).  This corresponds to the yacc or bison %left etc. declaration. +  However, since DParser + is + doesn't require a global tokenizer, operator priorities and + associativities are specified on the reduction which creates the token. +  Moreover, the associativity includes the operator usage as well + since it cannot be infered from rule context.  Possible operator + associativies are:
+
+ operator_assoc : '$unary_op_right' | '$unary_op_left' | + '$binary_op_right'
+            | + '$binary_op_left' | '$unary_right' | '$unary_left'
+            | + '$binary_right' | '$binary_left';
+
+ EXAMPLE:
+
+ E: ident op ident;
+ ident: '[a-z]+';
+ op: '*' $binary_op_left 2 |
+       '+' $binary_op_left 1;
+
+ 7.3. Rule Priorities
+
+   Rule priorities specify the priority of the reduction itself and + have the possible associativies:
+
+ rule_assoc: '$right' | '$left';
+
+   Rule and operator priorities can be intermixed and are + interpreted at run time (not + when + the tables are built).  This make it possible for user-defined + scanners to return the associativities and priorities of tokens.
+
+ 8. Actions
+
+
  Actions are the bits of code which run when a reduction + occurs.
+
+ EXAMPLE
+
+ S: this | that;
+ this: 'this' { printf("got this\n"); };
+ that: 'that' { printf("got that\n"); };
+
+ 8.1 Speculative Action
+
+   Speculative actions occur when the reduction takes place during + the speculative parsing process.  It is possible
+ that the reduction will not be part of the final parse or that it will + occur a different number of times.  For example:
+
+ S: this | that;
+ this: hi 'mom';
+ that: ho 'dad';
+ ho: 'hello' [ printf("ho\n"); ];
+ hi: 'hello' [ printf("hi\n"); ];
+
+ Will print both 'hi' and 'ho' when given the input 'hello dad' because + at the time hello is reduced, the following token is not known.
+
+ 8.2 Final Actions
+
+   Final actions occur only when the reduction must be part of any + legal final parse (committed).  It is possible to do final actions + during parsing or delay them till the entire parse tree is constructed + (see Options).  Final actions are executed in order and in number + according the the single final unambiguous parse.
+
+ S: A S 'b' | 'x';
+ A: [ printf("speculative e-reduce A\n"); ]
+    { printf("final e-reduce A\n"); };
+
+   On input:
+
+ xbbb
+
+   Will produce:
+
+ speculative e-reduce A
+ final e-reduce A
+ final e-reduce A
+ final e-reduce A
+
+ 8.3 Embedded Actions
+
+   Actions can be embedded into rule. These actions are executed + as if they were replaced with a synthetic production with a single null + rule containing the actions.  For example:
+
+ S: A { printf("X"); } B;
+ A: 'a' { printf("a"); };
+ B: 'b' { printf("b"); };
+
+   On input:
+
+ ab
+
+   Will produce:
+
+ aXb
+
+ 8.4 Pass Actions
+
+   DParser supports + multiple pass compilation.  The passes are declared at the top of + the grammar, and the actions are associated with individual rules.
+
+ EXAMPLE
+
+ ${pass sym for_all postorder}
+ ${pass gen for_all postorder}
+
+ translation_unit: statement*;
+
+ statement
+   : expression ';' {
+     d_pass(${parser}, &$n, ${pass sym});
+     d_pass(${parser}, &$n, ${pass gen});
+   }
+   ;
+
+ expression :  integer
+   gen: { printf("gen integer\n"); }
+   sym: { printf("sym integer\n"); }
+   | expression '+' expression $right 2
+   sym: { printf("sym +\n"); }
+   ;
+
+   A pass name then a colon indicate that the following action is + associated with a particular pass. Passes can be either for_all or for_undefined (which means that the + automatic traversal only applies to rules without actions defined for + this pass).   Furthermore, passes can be postorder, preorder, and manual (you have to call d_pass yourself).  Passes can + be initiated in the final action of any rule.
+
+ 8.5 Default Actions
+
+   The special production "_" + can be defined with a single rule whose actions become the default when + no other action is specified.  Default actions can be specified + for speculative, final and pass actions and apply to each seperately.
+
+ EXAMPLE
+
+ _: { printf("final action"); }
+     gen: { printf("default gen action"); }
+     sym: { printf("default sym action"); }
+     ;
+
+ 9. Attributes and Action Specifiers
+
+ 9.1.  Global State ($g)
+
+   Global state is declared by define'ing D_ParseNodeGlobals (see the ANSI C + grammar for a similar declaration for symbols). Global state can be + accessed in any action with $g. +  Because DParser handles + ambiguous parsing global state can be accessed on different speculative + parses.  In the future automatic splitting of global state may be + implemented (if there is demand). Currently, the global state can be + copied and assigned to $g to + ensure that the changes made only effect subsequent speculative parses + derived from the particular parse.
+
+ EXAMPLE
+
+   [ $g = copy_globals($g);
+     $g->my_variable = 1;
+   ]
+
+   The symbol table (Section 10) can be used to manage state + information safely for different speculative parses.
+
+ 9.2. Parse Node State
+
+   Each parse node includes a set of system state variables and can + have a set of user-defined state variables.  User defined parse + node state is declared by define'ing D_ParseNodeUser.   Parse node + state is accessed with:
+
+  $# - number of child nodes
+  $$ - user parse node + state + for parent node (non-terminal defined by the production)
+  $X (where X is a number) + - + the user parse node state of element X of the production
+  $nX - the system parse + node state of element X of the production
+
+   The system parse node state is defined in dparse.h which is installed with DParser.  It contains such + information as the symbol, the location of the parsed string, and + pointers to the start and end of the parsed string.
+
+ 9.3. Misc
+
+   ${scope} - the current + symbol table scope
+   ${reject} - in + speculative actions permits the current parse to be rejected
+
+ 10. Symbol Table
+
+   The symbol table can be + updated down different speculative paths while sharing the bulk of the + data.  It defines the following functions in the file (dsymtab.h):
+  
+ struct D_Scope *new_D_Scope(struct D_Scope *st);
+ struct D_Scope *enter_D_Scope(struct D_Scope *current, struct D_Scope + *scope);
+ D_Sym *NEW_D_SYM(struct D_Scope *st, char *name, char *end);
+ D_Sym *find_D_Sym(struct D_Scope *st, char *name, char *end);
+ D_Sym *UPDATE_D_SYM(struct D_Scope *st, D_Sym *sym);
+ D_Sym *current_D_Sym(struct D_Scope *st, D_Sym *sym);
+ D_Sym *find_D_Sym_in_Scope(struct D_Scope *st, char *name, char *end);
+
+ 'new_D_Scope' creates a new scope below 'st' or NULL for a 'top level' + scope.  'enter_D_Scope' returns to a previous scoping level.  + NOTE: do not simply assign ${scope} to a previous scope as any updated + symbol information will be lost.  'commit_D_Scope' can be used in + final actions to compress the update list for the top level scope and + improve efficiency.
+
+ 'find_D_Sym' finds the most current version of a symbol in a given + scope.  'UPDATE_D_SYM' updates the value of symbol (creates a + difference record on the current speculative parse path).  + 'current_D_Sym' is used to retrive the current version of a symbol, the + pointer to which may have been stored in some other attribute or + variable.  Symbols with the same name should not be created in the + same scope.  The function 'find_D_Sym_in_Scope' is provided to + detect this case.
+  
+   User data can be attached to symbols by define'ing D_UserSym.  See the ANSI C + grammar for an example.
+
+ Here is a full example of scope usage (from tests/g29.test.g):
+
+ #include <stdio.h>
+
+ typedef struct My_Sym {
+   int value;
+ } My_Sym;
+ #define D_UserSym My_Sym
+ typedef struct My_ParseNode {
+   int value;
+   struct D_Scope *scope;
+ } My_ParseNode;
+ #define D_ParseNode_User My_ParseNode
+ }
+
+ translation_unit: statement*;
+  
+ statement
+   : expression ';'
+   { printf("%d\n", $0.value); }
+   | '{' new_scope statement* '}'
+   [ ${scope} = enter_D_Scope(${scope}, $n0.scope); ]
+   { ${scope} = commit_D_Scope(${scope}); }
+   ;
+
+ new_scope: [ ${scope} = new_D_Scope(${scope}); ];
+
+ expression
+   : identifier ':' expression
+   [
+     D_Sym *s;
+     if (find_D_Sym_in_Scope(${scope}, $n0.start_loc.s, + $n0.end))
+       printf("duplicate identifier line %d\n", + $n0.start_loc.line);
+     s = NEW_D_SYM(${scope}, $n0.start_loc.s, $n0.end);
+     s->user.value = $2.value;
+     $$.value = s->user.value;
+   ]
+   | identifier '=' expression
+   [ D_Sym *s = find_D_Sym(${scope}, $n0.start_loc.s, $n0.end);
+     s = UPDATE_D_SYM(${scope}, s);
+     s->user.value = $2.value;
+     $$.value = s->user.value;
+   ]
+   | integer
+   [ $$.value = atoi($n0.start_loc.s); ]
+   | identifier
+   [ D_Sym *s = find_D_Sym(${scope}, $n0.start_loc.s, $n0.end);
+     if (s)
+       $$.value = s->user.value;
+   ]
+   | expression '+' expression
+   [ $$.value = $0.value + $1.value; ]
+   ;
+
+ integer: "-?([0-9]|0(x|X))[0-9]*(u|U|b|B|w|W|L|l)*" $term -1;
+ identifier: "[a-zA-Z_][a-zA-Z_0-9]*";
+
+

+ 11. Whitespace
+
+   Whitespace can be specified two ways: C function which can be + user-defined, or as a subgrammar.  The default whitespace parser + is + compatible with C/C++ #line directives and comments.  It can be + replaced with any user specified function as a parsing option (see + Options).
+
+   Additionally, if the (optionally) reserved production whitespace is defined, the + subgrammar + it defines will be used to consume whitespace for the main grammar. +   This subgrammar can include normal actions.
+
+ EXAMPLE
+
+ S: 'a' 'b' 'c';
+ whitespace: "[ \t\n]*";
+
+   Whitespace can be accessed on a per parse node basis using the + functions: d_ws_before and d_ws_after, which return the start + of the whitespace before start_loc.s + and after end respectively.
+
+ 12. Ambiguities
+

+   Ambiguities are resolved automatically based on priorities and + associativities.  In addition, when the other resolution + techniques + fail, user defined ambiguity resolution is possible.   The default + ambiguity handler produces a fatal error on an unresolved + ambiguity.  This behavior can be replaced with a user defined + resolvers the signature of which is provided in dparse.h.
+
+   If the verbose_level + flag is set, the default ambiguity handler will print out parenthesized + versions of the ambiguous parse trees.   This may be of some + assistence in disambiguating a grammar.
+
+ 13. Error Recovery
+
+   DParser
implements an error recovery scheme appropriate + to + scannerless parsers.  I haven't had time to investigate all the + prior work in this area, so I am not sure if it is novel.  Suffice + for now that it is optional and works well with C/C++ like grammars.
+
+ 14. Parsing Options
+
+   Parser are instantiated with the function new_D_Parser.  The resulting data + structure contains a number of user configurable options (see dparser.h).  These are provided + reasonable default values and include:
+
    +
  • initial_globals - the + initial global variables accessable through $g
  • +
  • initial_skip_space_fn - the initial + whitespace function
  • +
  • initial_scope - the initial symbol + table scope
  • +
  • syntax_error_fn - the function + called + on a syntax error
  • +
  • ambiguity_fn - the + function called on an unresolved ambiguity
  • +
  • loc - the initial + location + (set on an error).
  • +
+ In addtion, there are the following user configurables:
+
    +
  • sizeof_user_parse_node - + the sizeof D_ParseNodeUser
  • +
  • save_parse_tree - whether + or not the parse tree should be save once the final actions have been + executed
  • +
  • dont_fixup_internal_productions - to + not convert the Kleene star into a variable number of children from a + tree of reductions
  • +
  • dont_merge_epsilon_trees + - + to not automatically remove ambiguities which result from trees of + epsilon reductions without actions
  • +
  • dont_use_eagerness_for_disambiguation + - do not use the rule that the longest parse which reduces to the same + token should be used to disambiguate parses.  This rule is used to + handle the case (if then else?) + relatively cleanly.
  • +
  • dont_use_height_for_disambiguation + - do not use the rule that the least deep parse which reduces to the + same token should be used to disabiguate parses.  This rule is + used + to handle recursive grammars relatiively cleanly.
  • +
  • dont_compare_stacks - + disables comparing stacks to handle certain exponential cases during + ambiguous operator priority resolution.  This feature is + relatively + new, and this disables the new code.
    +
  • +
  • commit_actions_interval - + how often to commit final actions (0 is immediate, MAXINT is + essentially + not till the end of parsing)
  • +
  • error_recovery - whether or not to + use error recovery (defaults ON)
  • +
+ An the following result values:
+
    +
  • syntax_errors - how many + syntax errors (if error_recovery + was on)
  • +
+ This final value should be checked to see if parse was successful.
+
+ 15. Grammar Grammar
+
+   DParser is fully + self-hosted (would you trust a parser generator which wasn't?).   + The grammar grammar is here (Grammar Grammar). +  
+
+
+
+
+ + Index: llvm/test/Programs/MultiSource/Applications/d/parse.c diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/parse.c:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/parse.c Thu Jan 1 10:50:36 2004 *************** *** 0 **** --- 1,2077 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + + #include "d.h" + + /* tunables */ + #define DEFAULT_COMMIT_ACTIONS_INTERVAL 100 + #define PNODE_HASH_INITIAL_SIZE_INDEX 10 + #define SNODE_HASH_INITIAL_SIZE_INDEX 8 + #define ERROR_RECOVERY_QUEUE_SIZE 10000 + + #define GOTO_STATE(_p, _pn, _ps) \ + ((_p)->t->goto_table[(_pn)->parse_node.symbol - \ + (_ps)->state->goto_table_offset] - 1) + #define GOTO_STATE_INDEX(_p, _symbol, _si) \ + ((_p)->t->goto_table[(_symbol) - (_p)->t->state[_si].goto_table_offset] - 1) + #define is_unreduced_epsilon_PNode(_pn) \ + (is_epsilon_PNode(_pn) && ((_pn)->reduction && (_pn)->reduction->final_code)) + + #ifndef USE_GC + static void free_SNode(struct Parser *p, struct SNode *s); + #define ref_pn(_pn) do { (_pn)->refcount++; } while (0) + #define ref_sn(_sn) do { (_sn)->refcount++; } while (0) + #define unref_pn(_p, _pn) do { if (!--(_pn)->refcount) free_PNode(_p, _pn); } while (0) + #define unref_sn(_p, _sn) do { if (!--(_sn)->refcount) free_SNode(_p, _sn); } while (0) + #else + #define ref_pn(_pn) + #define ref_sn(_sn) + #define unref_pn(_p, _pn) + #define unref_sn(_p, _sn) + #endif + + typedef Stack(struct PNode*) StackPNode; + typedef Stack(struct SNode*) StackSNode; + typedef Stack(int) StackInt; + + static int exhaustive_parse(Parser *p, int state); + + void + print_paren(PNode *p) { + int i; + char *c; + if (!p->error_recovery) { + if (p->children.n) { + if (p->children.n > 1) + printf("("); + for (i = 0; i < p->children.n; i++) + print_paren(p->children.v[i]); + if (p->children.n > 1) + printf(")"); + } else if (p->parse_node.start_loc.s != p->parse_node.end_skip) { + printf(" "); + for (c = p->parse_node.start_loc.s; c < p->parse_node.end_skip; c++) + printf("%c", *c); + printf(" "); + } + } + } + + void + xprint_paren(Parser *pp, PNode *p) { + int i; + char *c; + if (!p->error_recovery) { + printf("[%s]", pp->t->symbols[p->parse_node.symbol].name); + if (p->children.n) { + printf("("); + for (i = 0; i < p->children.n; i++) + xprint_paren(pp, p->children.v[i]); + printf(")"); + } else if (p->parse_node.start_loc.s != p->parse_node.end_skip) { + printf(" "); + for (c = p->parse_node.start_loc.s; c < p->parse_node.end_skip; c++) + printf("%c", *c); + printf(" "); + } + } + } + + void xpp(Parser *pp, PNode *p) { xprint_paren(pp, p); printf("\n"); } + void pp(PNode *p) { print_paren(p); printf("\n"); } + + #define D_ParseNode_to_PNode(_apn) \ + ((PNode*)D_PN(_apn, -(int)&((PNode*)(NULL))->parse_node)) + + #define PNode_to_D_ParseNode(_apn) \ + ((D_ParseNode*)&((PNode*)(_apn))->parse_node) + + D_ParseNode * + d_get_child(D_ParseNode *apn, int child) { + PNode *pn = D_ParseNode_to_PNode(apn); + if (child < 0 || child >= pn->children.n) + return NULL; + return &pn->children.v[child]->parse_node; + } + + int + d_get_number_of_children(D_ParseNode *apn) { + PNode *pn = D_ParseNode_to_PNode(apn); + return pn->children.n; + } + + D_ParseNode * + d_find_in_tree(D_ParseNode *apn, int symbol) { + PNode *pn = D_ParseNode_to_PNode(apn); + D_ParseNode *res; + int i; + + if (pn->parse_node.symbol == symbol) + return apn; + for (i = 0; i < pn->children.n; i++) + if ((res = d_find_in_tree(&pn->children.v[i]->parse_node, symbol))) + return res; + return NULL; + } + + char * + d_ws_before(D_Parser *ap, D_ParseNode *apn) { + PNode *pn = D_ParseNode_to_PNode(apn); + return pn->ws_before; + } + + char * + d_ws_after(D_Parser *ap, D_ParseNode *apn) { + PNode *pn = D_ParseNode_to_PNode(apn); + return pn->ws_after; + } + + #define SNODE_HASH(_s, _sc, _g) ((((uint)(_s)) << 12) + (((uint)(_sc))) + ((uint)(_g))) + + SNode * + find_SNode(Parser *p, uint state, D_Scope *sc, void *g) { + SNodeHash *ph = &p->snode_hash; + SNode *sn; + uint h = SNODE_HASH(state, sc, g); + if (ph->v) + for (sn = ph->v[h % ph->m]; sn; sn = sn->bucket_next) + if (sn->state - p->t->state == state && + sn->initial_scope == sc && + sn->initial_globals == g) + return sn; + return NULL; + } + + void + insert_SNode_internal(Parser *p, SNode *sn) { + SNodeHash *ph = &p->snode_hash; + uint h = SNODE_HASH(sn->state - p->t->state, sn->initial_scope, sn->initial_globals), i; + SNode *t; + + if (ph->n + 1 > ph->m) { + SNode **v = ph->v; + int m = ph->m; + ph->i++; + ph->m = prime2[ph->i]; + ph->v = (SNode**)MALLOC(ph->m * sizeof(*ph->v)); + memset(ph->v, 0, ph->m * sizeof(*ph->v)); + for (i = 0; i < m; i++) + while ((t = v[i])) { + v[i] = v[i]->bucket_next; + insert_SNode_internal(p, t); + } + FREE(v); + } + sn->bucket_next = ph->v[h % ph->m]; + ph->v[h % ph->m] = sn; + ph->n++; + } + + static void + insert_SNode(Parser *p, SNode *sn) { + insert_SNode_internal(p, sn); + ref_sn(sn); + sn->all_next = p->snode_hash.all; + p->snode_hash.all = sn; + } + + static SNode * + new_SNode(Parser *p, D_State *state, d_loc_t *loc, D_Scope *sc, void *g) { + SNode *sn = p->free_snodes; + if (!sn) + sn = MALLOC(sizeof *sn); + else + p->free_snodes = sn->all_next; + sn->depth = 0; + vec_clear(&sn->zns); + #ifndef USE_GC + sn->refcount = 0; + #endif + sn->all_next = 0; + p->states++; + sn->state = state; + sn->initial_scope = sc; + sn->initial_globals = g; + sn->loc = *loc; + insert_SNode(p, sn); + if (sn->state->accept) { + if (!p->accept) { + ref_sn(sn); + p->accept = sn; + } else if (sn->loc.s > p->accept->loc.s) { + ref_sn(sn); + unref_sn(p, p->accept); + p->accept = sn; + } + } + return sn; + } + + static ZNode * + new_ZNode(Parser *p, PNode *pn) { + ZNode *z = p->free_znodes; + if (!z) + z = MALLOC(sizeof *z); + else + p->free_znodes = znode_next(z); + z->pn = pn; + vec_clear(&z->sns); + return z; + } + + static void + free_PNode(Parser *p, PNode *pn) { + PNode *amb; + int i; + if (p->user.free_node_fn) + p->user.free_node_fn(&pn->parse_node); + for (i = 0; i < pn->children.n; i++) + unref_pn(p, pn->children.v[i]); + vec_free(&pn->children); + if ((amb = pn->ambiguities)) { + pn->ambiguities = NULL; + free_PNode(p, amb); + } + if (pn->latest != pn) + unref_pn(p, pn->latest); + pn->all_next = p->free_pnodes; + p->free_pnodes = pn; + #ifdef TRACK_PNODES + if (pn->xprev) + pn->xprev->xnext = pn->xnext; + else + p->xall = pn->xnext; + if (pn->xnext) + pn->xnext->xprev = pn->xprev; + pn->xprev = NULL; + pn->xnext = NULL; + #endif + } + + #ifndef USE_GC + static void + free_ZNode(Parser *p, ZNode *z, SNode *s) { + int i; + unref_pn(p, z->pn); + for (i = 0; i < z->sns.n; i++) + if (s != z->sns.v[i]) + unref_sn(p, z->sns.v[i]); + vec_free(&z->sns); + znode_next(z) = p->free_znodes; + p->free_znodes = z; + } + + static void + free_SNode(Parser *p, struct SNode *s) { + int i; + for (i = 0; i < s->zns.n; i++) + if (s->zns.v[i]) + free_ZNode(p, s->zns.v[i], s); + vec_free(&s->zns); + s->all_next = p->free_snodes; + p->free_snodes = s; + } + #endif + + #define PNODE_HASH(_si, _ei, _s, _sc, _g) \ + ((((uint)_si) << 8) + (((uint)_ei) << 16) + (((uint)_s)) + (((uint)_sc)) + (((uint)_g))) + + PNode * + find_PNode(Parser *p, char *start, char *end_skip, int symbol, D_Scope *sc, void *g) { + PNodeHash *ph = &p->pnode_hash; + PNode *pn; + uint h = PNODE_HASH(start, end_skip, symbol, sc, g); + if (ph->v) + for (pn = ph->v[h % ph->m]; pn; pn = pn->bucket_next) + if (pn->parse_node.symbol == symbol && + pn->parse_node.start_loc.s == start && + pn->parse_node.end_skip == end_skip && + pn->initial_scope == sc && + pn->initial_globals == g) + return pn; + return NULL; + } + + void + insert_PNode_internal(Parser *p, PNode *pn) { + PNodeHash *ph = &p->pnode_hash; + uint h = PNODE_HASH(pn->parse_node.start_loc.s, pn->parse_node.end_skip, + pn->parse_node.symbol, pn->initial_scope, pn->initial_globals), i; + PNode *t; + + if (ph->n + 1 > ph->m) { + PNode **v = ph->v; + int m = ph->m; + ph->i++; + ph->m = prime2[ph->i]; + ph->v = (PNode**)MALLOC(ph->m * sizeof(*ph->v)); + memset(ph->v, 0, ph->m * sizeof(*ph->v)); + for (i = 0; i < m; i++) + while ((t = v[i])) { + v[i] = v[i]->bucket_next; + insert_PNode_internal(p, t); + } + FREE(v); + } + pn->bucket_next = ph->v[h % ph->m]; + ph->v[h % ph->m] = pn; + ph->n++; + } + + static void + insert_PNode(Parser *p, PNode *pn) { + insert_PNode_internal(p, pn); + ref_pn(pn); + pn->all_next = p->pnode_hash.all; + p->pnode_hash.all = pn; + } + + static void + free_old_nodes(Parser *p) { + int i; + uint h; + PNode *pn = p->pnode_hash.all, *tpn, **lpn; + SNode *sn = p->snode_hash.all, *tsn, **lsn; + while (sn) { + h = SNODE_HASH(sn->state - p->t->state, sn->initial_scope, sn->initial_globals); + lsn = &p->snode_hash.v[h % p->snode_hash.m]; + tsn = sn; sn = sn->all_next; + while (*lsn != tsn) lsn = &(*lsn)->bucket_next; + *lsn = (*lsn)->bucket_next; + } + sn = p->snode_hash.last_all; + while (sn) { + tsn = sn; sn = sn->all_next; + unref_sn(p, tsn); + } + p->snode_hash.last_all = p->snode_hash.all; + p->snode_hash.all = NULL; + while (pn) { + for (i = 0; i < pn->children.n; i++) { + if (pn->children.v[i] != pn->children.v[i]->latest) { + ref_pn(pn->children.v[i]->latest); + unref_pn(p, pn->children.v[i]); + pn->children.v[i] = pn->children.v[i]->latest; + } + } + h = PNODE_HASH(pn->parse_node.start_loc.s, pn->parse_node.end_skip, + pn->parse_node.symbol, pn->initial_scope, pn->initial_globals); + lpn = &p->pnode_hash.v[h % p->pnode_hash.m]; + tpn = pn; pn = pn->all_next; + while (*lpn != tpn) lpn = &(*lpn)->bucket_next; + *lpn = (*lpn)->bucket_next; + unref_pn(p, tpn); + } + p->pnode_hash.n = 0; + p->pnode_hash.all = NULL; + } + + static void + alloc_parser_working_data(Parser *p) { + p->pnode_hash.i = PNODE_HASH_INITIAL_SIZE_INDEX; + p->pnode_hash.m = prime2[p->pnode_hash.i]; + p->pnode_hash.v = + (PNode**)MALLOC(p->pnode_hash.m * sizeof(*p->pnode_hash.v)); + memset(p->pnode_hash.v, 0, p->pnode_hash.m * sizeof(*p->pnode_hash.v)); + p->snode_hash.i = SNODE_HASH_INITIAL_SIZE_INDEX; + p->snode_hash.m = prime2[p->snode_hash.i]; + p->snode_hash.v = + (SNode**)MALLOC(p->snode_hash.m * sizeof(*p->snode_hash.v)); + memset(p->snode_hash.v, 0, p->snode_hash.m * sizeof(*p->snode_hash.v)); + p->shift_results = MALLOC(p->t->nsymbols * sizeof(ShiftResult)); + } + + static void + free_parser_working_data(Parser *p) { + int i; + + free_old_nodes(p); + free_old_nodes(p); /* to catch SNodes saved for error repair */ + if (p->pnode_hash.v) + FREE(p->pnode_hash.v); + if (p->snode_hash.v) + FREE(p->snode_hash.v); + memset(&p->pnode_hash, 0, sizeof(p->pnode_hash)); + memset(&p->snode_hash, 0, sizeof(p->snode_hash)); + while (p->reductions_todo) { + Reduction *r = p->free_reductions->next; + unref_sn(p, p->reductions_todo->snode); + FREE(p->free_reductions); p->free_reductions = r; + } + while (p->shifts_todo) { + Shift *s = p->free_shifts->next; + unref_sn(p, p->shifts_todo->snode); + FREE(p->free_shifts); p->free_shifts = s; + } + while (p->free_reductions) { + Reduction *r = p->free_reductions->next; + FREE(p->free_reductions); p->free_reductions = r; + } + while (p->free_shifts) { + Shift *s = p->free_shifts->next; + FREE(p->free_shifts); p->free_shifts = s; + } + while (p->free_pnodes) { + PNode *pn = p->free_pnodes->all_next; + FREE(p->free_pnodes); p->free_pnodes = pn; + } + while (p->free_znodes) { + ZNode *zn = znode_next(p->free_znodes); + FREE(p->free_znodes); p->free_znodes = zn; + } + while (p->free_snodes) { + SNode *sn = p->free_snodes->all_next; + FREE(p->free_snodes); p->free_snodes = sn; + } + for (i = 0; i < p->error_reductions.n; i++) + FREE(p->error_reductions.v[i]); + vec_free(&p->error_reductions); + if (p->whitespace_parser) + free_parser_working_data(p->whitespace_parser); + FREE(p->shift_results); + p->shift_results = NULL; + } + + static int + znode_depth(ZNode *z) { + int i, d = 0; + if (!z) + return INT_MAX; + for (i = 0; i < z->sns.n; i++) + d = d < z->sns.v[i]->depth ? z->sns.v[i]->depth : d; + return d; + } + + static Reduction * + add_Reduction(Parser *p, ZNode *z, SNode *sn, D_Reduction *reduction) { + Reduction *x, **l = &p->reductions_todo; + int d = znode_depth(z), dd; + for (x = p->reductions_todo; x; l = &x->next, x = x->next) { + if (sn->loc.s < x->snode->loc.s) + break; + dd = znode_depth(x->znode); + if ((sn->loc.s == x->snode->loc.s && d >= dd)) { + if (d == dd) + while (x) { + if (sn == x->snode && z == x->znode && reduction == x->reduction) + return NULL; + x = x->next; + } + break; + } + } + { + Reduction *r = p->free_reductions; + if (!r) + r = MALLOC(sizeof *r); + else + p->free_reductions = r->next; + r->znode = z; + r->snode = sn; + r->new_snode = NULL; + ref_sn(sn); + r->reduction = reduction; + r->next = *l; + *l = r; + return r; + } + } + + static void + add_Shift(Parser *p, SNode *snode) { + Shift *x, **l = &p->shifts_todo; + Shift *s = p->free_shifts; + if (!s) + s = MALLOC(sizeof *s); + else + p->free_shifts = s->next; + s->snode = snode; + ref_sn(s->snode); + for (x = p->shifts_todo; x; l = &x->next, x = x->next) + if (snode->loc.s <= x->snode->loc.s) break; + s->next = *l; + *l = s; + } + + static SNode * + add_SNode(Parser *p, D_State *state, d_loc_t *loc, D_Scope *sc, void *g) { + int i; + SNode *sn = find_SNode(p, state - p->t->state, sc, g); + if (sn) + return sn; + sn = new_SNode(p, state, loc, sc, g); + if (sn->state->shifts) + add_Shift(p, sn); + for (i = 0; i < sn->state->reductions.n; i++) + if (!sn->state->reductions.v[i]->nelements) + add_Reduction(p, 0, sn, sn->state->reductions.v[i]); + return sn; + } + + static int + reduce_actions(Parser *p, PNode *pn, D_Reduction *r) { + int i, height = 0; + PNode *c; + + for (i = 0; i < pn->children.n; i++) { + c = pn->children.v[i]; + if (c->op_assoc) { + pn->assoc = c->op_assoc; + pn->priority = c->op_priority; + } + if (c->height >= height) + height = c->height + 1; + } + pn->op_assoc = r->op_assoc; + pn->op_priority = r->op_priority; + pn->height = height; + if (r->rule_assoc) { + pn->assoc = r->rule_assoc; + pn->priority = r->rule_priority; + } + if (r->speculative_code) + return r->speculative_code( + pn, (void**)&pn->children.v[0], pn->children.n, + (int)&((PNode*)(NULL))->parse_node, (D_Parser*)p); + return 0; + } + + #define x 666 /* impossible */ + static int child_table[4][3][6] = { + { + /* binary parent, child on left */ + /* priority of child vs parent, or = with child|parent associativity + > < =LL =LR =RL =RR + */ + { 1, 0, 1, 1, 0, 0}, /* binary child */ + { 1, 1, 1, 1, x, x}, /* left unary child */ + { 1, 0, x, x, 1, 1} /* right unary child */ + }, + { /* binary parent, child on right */ + { 1, 0, 0, 0, 1, 1}, /* binary child */ + { 1, 0, 1, 1, x, x}, /* left unary child */ + { 1, 1, x, x, 1, 1} /* right unary child */ + }, + { /* left unary parent */ + { 1, 0, 0, x, 0, x}, /* binary child */ + { 1, 0, 1, x, x, x}, /* left unary child */ + { 1, 1, x, x, 1, x} /* right unary child */ + }, + { /* right unary parent */ + { 1, 0, x, 0, x, 0}, /* binary child */ + { 1, 1, x, 1, x, x}, /* left unary child */ + { 1, 0, x, x, x, 1} /* right unary child */ + } + }; + #undef x + + /* returns 1 if legal for child reduction and illegal for child shift */ + static int + check_child(int ppri, AssocKind passoc, int cpri, AssocKind cassoc, + int left, int right) + { + int p = IS_BINARY_NARY_ASSOC(passoc) ? (right ? 1 : 0) : + (passoc == ASSOC_UNARY_LEFT ? 2 : 3); + int c = IS_BINARY_NARY_ASSOC(cassoc) ? 0 : + (cassoc == ASSOC_UNARY_LEFT ? 1 : 2); + int r = + cpri > ppri ? 0 : ( + cpri < ppri ? 1 : ( 2 + ( + (IS_RIGHT_ASSOC(cassoc) ? 2 : 0) + + (IS_RIGHT_ASSOC(passoc) ? 1 : 0)))); + return child_table[p][c][r]; + } + + /* check assoc/priority legality, 0 is OK, -1 is bad */ + static int + check_assoc_priority(PNode *pn0, PNode *pn1, PNode *pn2) { + if (!IS_UNARY_BINARY_ASSOC(pn0->op_assoc)) { + if (IS_UNARY_BINARY_ASSOC(pn1->op_assoc)) { /* second token is operator */ + /* check expression pn0 (child of pn1) */ + if (pn0->assoc) { + if (!check_child(pn1->op_priority, pn1->op_assoc, + pn0->priority, pn0->assoc, 0, 1)) + return -1; + } + } + } else { /* pn0 is an operator */ + if (pn1->op_assoc) { + /* check pn0 (child of operator pn1) */ + if (!check_child(pn1->op_priority, pn1->op_assoc, + pn0->op_priority, pn0->op_assoc, 0, 1)) + return -1; + } else if (pn2) { + /* check pn0 (child of operator pn2) */ + if (pn2->op_assoc && + !check_child(pn2->op_priority, pn2->op_assoc, + pn0->op_priority, pn0->op_assoc, 0, 1)) + return -1; + } + /* check expression pn1 (child of pn0) */ + if (pn1->assoc) { + if (!check_child(pn0->op_priority, pn0->op_assoc, + pn1->priority, pn1->assoc, 1, 0)) + return -1; + } + } + return 0; + } + + /* check to see if a path is legal with respect to + the associativity and priority of its operators */ + static int + check_path_priorities_internal(VecZNode *path) { + int i = 0, j, k, jj, kk, one = 0; + ZNode *z, *zz, *zzz; + PNode *pn0, *pn1; + + if (path->n < i + 1) + return 0; + pn0 = path->v[i]->pn; + if (!pn0->op_assoc) { /* deal with top expression directly */ + i = 1; + if (path->n < i + 1) + return 0; + pn1 = path->v[i]->pn; + if (!pn1->op_assoc) + return 0; + if (pn0->assoc) { + if (!check_child(pn1->op_priority, pn1->op_assoc, + pn0->priority, pn0->assoc, 0, 1)) + return -1; + } + pn0 = pn1; + } + if (path->n > i + 1) { /* entirely in the path */ + pn1 = path->v[i + 1]->pn; + if (path->n > i + 2) + return check_assoc_priority(pn0, pn1, path->v[i + 2]->pn); + else { /* one level from the stack beyond the path */ + z = path->v[i + 1]; + for (k = 0; k < z->sns.n; k++) + for (j = 0; j < z->sns.v[k]->zns.n; j++) { + one = 1; + zz = z->sns.v[k]->zns.v[j]; + if (zz && !check_assoc_priority(pn0, pn1, zz->pn)) + return 0; + } + if (!one) + return check_assoc_priority(pn0, pn1, NULL); + } + } else { /* two levels from the stack beyond the path */ + z = path->v[i]; + for (k = 0; k < z->sns.n; k++) + for (j = 0; j < z->sns.v[k]->zns.n; j++) { + zz = z->sns.v[k]->zns.v[j]; + if (zz) + for (kk = 0; kk < zz->sns.n; kk++) + for (jj = 0; jj < zz->sns.v[kk]->zns.n; jj++) { + one = 1; + zzz = zz->sns.v[kk]->zns.v[jj]; + if (zzz && !check_assoc_priority(pn0, zz->pn, zzz->pn)) + return 0; + } + } + return 0; + } + return -1; + } + + /* avoid cases without operator priorities */ + #define check_path_priorities(_p) ((_p)->n > 1 && \ + ((_p)->v[0]->pn->op_assoc || (_p)->v[1]->pn->op_assoc) && \ + check_path_priorities_internal(_p)) + + static int + cmp_priorities(int xpri[], int xn, int ypri[], int yn) { + int i = 0; + + while (i < xn && i < yn) { + if (xpri[i] > ypri[i]) + return -1; + if (xpri[i] < ypri[i]) + return 1; + i++; + } + return 0; + } + + static void + intsort(int *xp, int n) { + int again = 1, i, t; + while (again) { + again = 0; + for (i = 0; i < n - 1; i++) { + if (xp[i] > xp[i+1]) { + t = xp[i]; + xp[i] = xp[i + 1]; + xp[i + 1] = t; + again = 1; + } + } + } + } + + /* sort by deepest, then by address */ + static void + priority_insert(StackPNode *psx, PNode *x) { + PNode *t, **start, **cur; + + stack_push(psx, x); + start = psx->start; + cur = psx->cur; + for (;cur > start + 1;cur--) { + if (cur[-1]->height > cur[-2]->height) + continue; + if (cur[-1]->height == cur[-2]->height && cur[-1] > cur[-2]) + continue; + t = cur[-1]; + cur[-1] = cur[-2]; + cur[-2] = t; + } + } + + static void + get_exp_all(PNode *x, StackInt *psx) { + int i; + + if (x->assoc) + stack_push(psx, x->priority); + for (i = 0; i < x->children.n; i++) + get_exp_all(x->children.v[i]->latest, psx); + } + + static void + get_exp_one(PNode *x, StackPNode *psx, StackInt *isx) { + int i; + + if (!IS_NARY_ASSOC(x->assoc)) + priority_insert(psx, x); + else { + stack_push(isx, x->priority); + for (i = 0; i < x->children.n; i++) + if (x->children.v[i]->assoc) + get_exp_one(x->children.v[i], psx, isx); + } + } + + static void + get_exp_one_down(PNode *x, StackPNode *psx, StackInt *isx) { + int i; + + stack_push(isx, x->priority); + for (i = 0; i < x->children.n; i++) + if (x->children.v[i]->assoc) + get_exp_one(x->children.v[i], psx, isx); + } + + /* get the set of priorities for unshared nodes, + eliminating shared subtrees via priority queues */ + static void + get_unshared_priorities(StackPNode *psx, StackPNode *psy, + StackInt *isx, StackInt *isy) + { + StackPNode *psr; + PNode *t; + + while (1) { + if (is_stack_empty(psx)) { + psr = psy; + break; + } else if (is_stack_empty(psy)) { + psr = psx; + break; + } + if (stack_head(psx)->height > stack_head(psy)->height) + psr = psx; + else if (stack_head(psx)->height < stack_head(psy)->height) + psr = psy; + else if (stack_head(psx) > stack_head(psy)) + psr = psx; + else if (stack_head(psx) < stack_head(psy)) + psr = psy; + else { + (void)stack_pop(psx); + (void)stack_pop(psy); + continue; + } + t = stack_pop(psr); + if (psr == psx) + get_exp_one_down(t, psx, isx); + else + get_exp_one_down(t, psy, isy); + } + while (!is_stack_empty(psr)) { + t = stack_pop(psr); + if (psr == psx) + get_exp_all(t, isx); + else + get_exp_all(t, isy); + } + return; + } + + static int + cmp_eagerness(PNode *x, PNode *y) { + int i, n; + char *xx, *yy; + + n = x->children.n < y->children.n ? x->children.n : y->children.n; + for (i = 0; i < n; i++) { + xx = x->children.v[i]->parse_node.end_skip; + yy = y->children.v[i]->parse_node.end_skip; + /* if the child is a symbol, the end_skip of the last child + will not equal that of the entire parse tree */ + xx = i == x->children.n - 1 ? x->parse_node.end_skip : xx; + yy = i == y->children.n - 1 ? y->parse_node.end_skip : yy; + if (xx > yy) + return -1; + if (xx < yy) + return 1; + } + return 0; + } + + static int + cmp_pnodes(Parser *p, PNode *x, PNode *y) { + StackPNode psx, psy; + StackInt isx, isy; + int r = 0; + + if (x->assoc && y->assoc) { + /* simple case */ + if (!IS_NARY_ASSOC(x->assoc) && !IS_NARY_ASSOC(y->assoc)) { + if (x->priority > y->priority) + return -1; + if (x->priority < y->priority) + return 1; + } + /* compare the priorities of operators in two trees + while eliminating common subtrees for efficiency. */ + stack_clear(&psx); stack_clear(&psy); stack_clear(&isx); stack_clear(&isy); + get_exp_one(x, &psx, &isx); + get_exp_one(y, &psy, &isy); + get_unshared_priorities(&psx, &psy, &isx, &isy); + intsort(isx.start, stack_depth(&isx)); + intsort(isy.start, stack_depth(&isy)); + r = cmp_priorities(isx.start, stack_depth(&isx), + isy.start, stack_depth(&isy)); + stack_free(&psx); stack_free(&psy); stack_free(&isx); stack_free(&isy); + if (r) + return r; + } + if (!p->user.dont_use_eagerness_for_disambiguation) + if ((r = cmp_eagerness(x, y))) + return r; + if (!p->user.dont_use_height_for_disambiguation) { + if (x->height < y->height) + return -1; + if (x->height > y->height) + return 1; + } + return r; + } + + static char * + find_ws_before(Parser *p, ZNode *zn) { + while (zn && is_epsilon_PNode(zn->pn)) { + zn = zn->sns.n ? (zn->sns.v[0]->zns.n ? zn->sns.v[0]->zns.v[0] : NULL) : NULL; + } + if (zn) + return zn->pn->parse_node.end; + else + return p->start; + } + + static PNode * + make_PNode(Parser *p, int symbol, d_loc_t *start_loc, char *e, PNode *pn, + D_Reduction *r, VecZNode *path, D_Shift *sh) + { + int i, l = sizeof(PNode) - sizeof(d_voidp) + p->user.sizeof_user_parse_node; + PNode *new_pn = p->free_pnodes; + if (!new_pn) + new_pn = MALLOC(l); + else + p->free_pnodes = new_pn->all_next; + p->pnodes++; + memset(new_pn, 0, l); + #ifdef TRACK_PNODES + new_pn->xnext = p->xall; + if (p->xall) + p->xall->xprev = new_pn; + p->xall = new_pn; + #endif + new_pn->parse_node.symbol = symbol; + new_pn->parse_node.start_loc = *start_loc; + if (!r || !path) { /* end of last parse node of path for non-epsilon reductions */ + new_pn->parse_node.end = e; + new_pn->ws_before = e; + } else { + new_pn->parse_node.end = pn->parse_node.end; + new_pn->ws_before = find_ws_before(p, path->v[path->n-1]->sns.v[0]->zns.v[0]); + } + new_pn->parse_node.end_skip = e; + new_pn->shift = sh; + new_pn->reduction = r; + new_pn->parse_node.scope = pn->parse_node.scope; + new_pn->initial_scope = new_pn->parse_node.scope; + new_pn->parse_node.globals = pn->parse_node.globals; + new_pn->initial_globals = new_pn->parse_node.globals; + new_pn->parse_node.white_space = pn->parse_node.white_space; + new_pn->latest = new_pn; + new_pn->ws_after = e; + if (sh) { + new_pn->op_assoc = sh->op_assoc; + new_pn->op_priority = sh->op_priority; + if (sh->speculative_code) + if (sh->speculative_code( + pn, (void**)&pn->children.v[0], pn->children.n, + (int)&((PNode*)(NULL))->parse_node, (D_Parser*)p)) + { + free_PNode(p, new_pn); + return NULL; + } + } else if (r) { + if (path) + for (i = path->n - 1; i >= 0; i--) { + PNode *latest = path->v[i]->pn->latest; + vec_add(&new_pn->children, latest); + ref_pn(latest); + } + if (reduce_actions(p, new_pn, r)) { + free_PNode(p, new_pn); + return NULL; + } + if (path && path->n > 1) { + int n = path->n; + for (i = 0; i < n; i += n-1) { + PNode *child = new_pn->children.v[i]; + if (child->assoc && + !check_child(new_pn->priority, new_pn->assoc, + child->priority, child->assoc, i == 0, i == n - 1)) + { + free_PNode(p, new_pn); + return NULL; + } + } + } + } + return new_pn; + } + + static int + PNode_equal(PNode *pn, D_Reduction *r, VecZNode *path, D_Shift *sh) { + int i, n = pn->children.n; + if (sh) + return sh == pn->shift; + if (r != pn->reduction) + return 0; + if (!path && !n) + return 1; + if (n == path->n) { + for (i = 0; i < n; i++) { + if (pn->children.v[i]->latest != path->v[n - i - 1]->pn->latest) + return 0; + } + return 1; + } + return 0; + } + + /* find/create PNode */ + static PNode * + add_PNode(Parser *p, int symbol, d_loc_t *start_loc, char *e, PNode *pn, + D_Reduction *r, VecZNode *path, D_Shift *sh) + { + PNode *old_pn = find_PNode(p, start_loc->s, e, symbol, pn->initial_scope, pn->initial_globals), + *new_pn; + if (old_pn && PNode_equal(old_pn, r, path, sh)) + return old_pn; + new_pn = make_PNode(p, symbol, start_loc, e, pn, r, path, sh); + if (!old_pn) { + old_pn = new_pn; + if (!new_pn) + return NULL; + insert_PNode(p, new_pn); + goto Lreturn; + } + if (!new_pn) + goto Lreturn; + p->compares++; + switch (cmp_pnodes(p, new_pn, old_pn)) { + case 0: + new_pn->ambiguities = old_pn->ambiguities; + old_pn->ambiguities = new_pn; + break; + case -1: + insert_PNode(p, new_pn); + old_pn->latest = new_pn; + ref_pn(new_pn); + old_pn = new_pn; + break; + case 1: + free_PNode(p, new_pn); + break; + } + Lreturn: + return old_pn; + } + + /* The set of znodes associated with a state can be very large + because of cascade reductions (for example, large expression trees). + Use an adaptive data structure starting with a short list and + then falling back to a direct map hash table. + */ + + static void set_add_znode(VecZNode *v, ZNode *z); + + static void + set_union_znode(VecZNode *v, VecZNode *vv) { + int i; + for (i = 0; i < vv->n; i++) + if (vv->v[i]) + set_add_znode(v, vv->v[i]); + } + + static ZNode * + set_find_znode(VecZNode *v, PNode *pn) { + uint i, j, n = v->n, h; + if (n <= INTEGRAL_VEC_SIZE) { + for (i = 0; i < n; i++) + if (v->v[i]->pn == pn) + return v->v[i]; + return NULL; + } + h = ((uint)pn) % n; + for (i = h, j = 0; + i < v->n && j < SET_MAX_SEQUENTIAL; + i = ((i + 1) % n), j++) + { + if (!v->v[i]) + return NULL; + else if (v->v[i]->pn == pn) + return v->v[i]; + } + return NULL; + } + + static void + set_add_znode_hash(VecZNode *v, ZNode *z) { + VecZNode vv; + int i, j, n = v->n; + if (n) { + uint h = ((uint)z->pn) % n; + for (i = h, j = 0; + i < v->n && j < SET_MAX_SEQUENTIAL; + i = ((i + 1) % n), j++) + { + if (!v->v[i]) { + v->v[i] = z; + return; + } + } + } + if (!n) { + vv.v = NULL; + v->i = INITIAL_SET_SIZE_INDEX; + } else { + vv.v = (void*)v->v; + vv.n = v->n; + v->i = v->i + 2; + } + v->n = prime2[v->i]; + v->v = MALLOC(v->n * sizeof(void *)); + memset(v->v, 0, v->n * sizeof(void *)); + if (vv.v) { + set_union_znode(v, &vv); + FREE(vv.v); + } + set_add_znode(v, z); + } + + static void + set_add_znode(VecZNode *v, ZNode *z) { + VecZNode vv; + int i, n = v->n; + if (n < INTEGRAL_VEC_SIZE) { + vec_add(v, z); + return; + } + if (n == INTEGRAL_VEC_SIZE) { + vv = *v; + vec_clear(v); + for (i = 0; i < n; i++) + set_add_znode_hash(v, vv.v[i]); + } + set_add_znode_hash(v, z); + } + + static SNode * + goto_PNode(Parser *p, d_loc_t *loc, PNode *pn, SNode *ps) { + SNode *new_ps, *pre_ps; + ZNode *z = NULL; + D_State *state; + int i, j, k, state_index; + + if (!IS_BIT_SET(ps->state->goto_valid, pn->parse_node.symbol)) + return NULL; + state_index = GOTO_STATE(p, pn, ps); + state = &p->t->state[state_index]; + new_ps = add_SNode(p, state, loc, pn->initial_scope, pn->initial_globals); + new_ps->last_pn = pn; + DBG(printf("goto %d (%s) -> %d %X\n", + ps->state - p->t->state, + p->t->symbols[pn->parse_node.symbol].name, + state_index, (uint)new_ps)); + if (ps != new_ps && new_ps->depth < ps->depth + 1) + new_ps->depth = ps->depth + 1; + /* find/create ZNode */ + z = set_find_znode(&new_ps->zns, pn); + if (!z) { /* not found */ + set_add_znode(&new_ps->zns, (z = new_ZNode(p, pn))); + ref_pn(pn); + for (j = 0; j < new_ps->state->reductions.n; j++) + if (new_ps->state->reductions.v[j]->nelements) + add_Reduction(p, z, new_ps, new_ps->state->reductions.v[j]); + if (!pn->shift) + for (j = 0; j < new_ps->state->right_epsilon_hints.n; j++) { + D_RightEpsilonHint *h = &new_ps->state->right_epsilon_hints.v[j]; + pre_ps = find_SNode(p, h->preceeding_state, new_ps->initial_scope, new_ps->initial_globals); + if (!pre_ps) continue; + for (k = 0; k < pre_ps->zns.n; k++) + if (pre_ps->zns.v[k]) { + Reduction *r = + add_Reduction(p, pre_ps->zns.v[k], pre_ps, h->reduction); + if (r) { + r->new_snode = new_ps; + r->new_depth = h->depth; + } + } + } + } + for (i = 0; i < z->sns.n; i++) + if (z->sns.v[i] == ps) break; + if (i >= z->sns.n) { /* not found */ + vec_add(&z->sns, ps); + if (new_ps != ps) + ref_sn(ps); + } + return new_ps; + } + + static void + parse_whitespace(D_Parser *ap, d_loc_t *loc, void **p_globals) { + Parser *pp = ((Parser*)ap)->whitespace_parser; + pp->start = loc->s; + if (!exhaustive_parse(pp, ((Parser *)ap)->t->whitespace_state)) { + if (pp->accept) { + *loc = pp->accept->loc; + unref_sn(pp, pp->accept); + pp->accept = NULL; + } + } + } + + static void + shift_one(Parser *p, Shift *s) { + int i, nshifts = 0; + d_loc_t loc, skip_loc; + D_WhiteSpaceFn skip_fn = NULL; + PNode *new_pn; + D_State *state = s->snode->state; + ShiftResult *r; + + loc = s->snode->loc; + skip_loc.s = NULL; + p->scans++; + if (state->scanner_code) { + p->code_shift.term_priority = 0; + p->code_shift.op_assoc = 0; + p->shift_results[nshifts].loc = loc; + if ((state->scanner_code( + &p->shift_results[nshifts].loc.s, + &p->shift_results[nshifts].loc.col, + &p->shift_results[nshifts].loc.line, + &p->code_shift.symbol, &p->code_shift.term_priority, + &p->code_shift.op_assoc, &p->code_shift.op_priority))) + { + p->shift_results[nshifts++].shift = &p->code_shift; + } + } + if (state->scanner_table) + nshifts += scan_buffer(&loc, state, &p->shift_results[nshifts]); + for (i = 0; i < nshifts ;i++) { + r = &p->shift_results[i]; + p->shifts++; + DBG(printf("shift %d %X %d (%s)\n", + s->snode->state - p->t->state, (uint)s->snode, r->shift->symbol, + p->t->symbols[r->shift->symbol].name)); + new_pn = add_PNode(p, r->shift->symbol, &s->snode->loc, r->loc.s, + s->snode->last_pn, NULL, NULL, r->shift); + if (new_pn) { + if (!skip_loc.s || skip_loc.s != r->loc.s || skip_fn != new_pn->parse_node.white_space) { + skip_loc = r->loc; + skip_fn = new_pn->parse_node.white_space; + new_pn->parse_node.white_space( + (D_Parser*)p, &skip_loc, (void**)&new_pn->parse_node.globals); + skip_loc.previous_col = s->snode->loc.col >= 0 ? s->snode->loc.col : + s->snode->loc.previous_col; + new_pn->ws_before = find_ws_before(p, s->snode->zns.v[0]); + new_pn->ws_after = skip_loc.s; + } + goto_PNode(p, &skip_loc, new_pn, s->snode); + } + } + unref_sn(p, s->snode); + s->next = p->free_shifts; + p->free_shifts = s; + } + + static VecZNode path1; /* static first path for speed */ + + static VecZNode * + new_VecZNode(VecVecZNode *paths, int n, int parent) { + int i; + VecZNode *pv; + + if (!paths->n) + pv = &path1; + else + pv = MALLOC(sizeof *pv); + vec_clear(pv); + if (parent >= 0) + for (i = 0; i < n; i++) + vec_add(pv, paths->v[parent]->v[i]); + return pv; + } + + static void + build_paths_internal(ZNode *z, VecVecZNode *paths, int parent, + int n, int n_to_go) + { + int j, k, l; + + vec_add(paths->v[parent], z); + if (n_to_go <= 1) + return; + for (k = 0; k < z->sns.n; k++) + for (j = 0, l = 0; j < z->sns.v[k]->zns.n; j++) { + if (z->sns.v[k]->zns.v[j]) { + if (k + l) { + vec_add(paths, new_VecZNode(paths, n - (n_to_go - 1), parent)); + parent = paths->n - 1; + } + build_paths_internal(z->sns.v[k]->zns.v[j], paths, parent, + n, n_to_go - 1); + l++; + } + } + } + + static void + build_paths(ZNode *z, VecVecZNode *paths, int nchildren_to_go) { + if (!nchildren_to_go) + return; + vec_add(paths, new_VecZNode(paths, 0, -1)); + build_paths_internal(z, paths, 0, nchildren_to_go, nchildren_to_go); + } + + static void + free_paths(VecVecZNode *paths) { + int i; + vec_free(&path1); + for (i = 1; i < paths->n; i++) { + vec_free(paths->v[i]); + FREE(paths->v[i]); + } + vec_free(paths); + } + + static void + reduce_one(Parser *p, Reduction *r) { + SNode *sn = r->snode; + PNode *pn, *last_pn; + ZNode *first_z; + int i, j, n = r->reduction->nelements; + VecVecZNode paths; + VecZNode *path; + + if (!r->znode) { /* epsilon reduction */ + if ((pn = add_PNode(p, r->reduction->symbol, &sn->loc, + sn->loc.s, sn->last_pn, r->reduction, 0, 0))) + goto_PNode(p, &sn->loc, pn, sn); + } else { + DBG(printf("reduce %d %X %d\n", r->snode->state - p->t->state, (uint)sn, n)); + vec_clear(&paths); + build_paths(r->znode, &paths, n); + for (i = 0; i < paths.n; i++) { + path = paths.v[i]; + if (r->new_snode) { /* prune paths by new right epsilon node */ + for (j = 0; j < path->v[r->new_depth]->sns.n; j++) + if (path->v[r->new_depth]->sns.v[j] == r->new_snode) + break; + if (j >= path->v[r->new_depth]->sns.n) + continue; + } + if (check_path_priorities(path)) + continue; + p->reductions++; + last_pn = path->v[0]->pn; + first_z = path->v[n - 1]; + pn = add_PNode(p, r->reduction->symbol, + &first_z->pn->parse_node.start_loc, + sn->loc.s, last_pn, r->reduction, path, NULL); + if (pn) + for (j = 0; j < first_z->sns.n; j++) + goto_PNode(p, &sn->loc, pn, first_z->sns.v[j]); + } + free_paths(&paths); + } + unref_sn(p, sn); + r->next = p->free_reductions; + p->free_reductions = r; + } + + static int + VecSNode_equal(VecSNode *vsn1, VecSNode *vsn2) { + int i, j; + if (vsn1->n != vsn2->n) + return 0; + for (i = 0; i < vsn1->n; i++) { + for (j = 0; j < vsn2->n; j++) { + if (vsn1->v[i] == vsn2->v[j]) + break; + } + if (j >= vsn2->n) + return 0; + } + return 1; + } + + static ZNode * + binary_op_ZNode(SNode *sn) { + ZNode *z; + if (sn->zns.n != 1) + return NULL; + z = sn->zns.v[0]; + if (z->pn->op_assoc == ASSOC_UNARY_RIGHT) { + if (z->sns.n != 1) + return NULL; + sn = z->sns.v[0]; + if (sn->zns.n != 1) + return NULL; + z = sn->zns.v[0]; + } + if (!IS_BINARY_ASSOC(z->pn->op_assoc)) + return NULL; + return z; + } + + static char *spaces = " "; + static void + print_stack(Parser *p, SNode *s, int indent) { + int i,j; + + printf("%d", s->state - p->t->state); + indent += 2; + for (i = 0; i < s->zns.n; i++) { + if (!s->zns.v[i]) + continue; + if (s->zns.n > 1) + printf("\n%s[", &spaces[99-indent]); + printf("(%s:", p->t->symbols[s->zns.v[i]->pn->parse_node.symbol].name); + print_paren(s->zns.v[i]->pn); + printf(")"); + for (j = 0; j < s->zns.v[i]->sns.n; j++) { + if (s->zns.v[i]->sns.n > 1) + printf("\n%s[", &spaces[98-indent]); + print_stack(p, s->zns.v[i]->sns.v[j], indent); + if (s->zns.v[i]->sns.n > 1) + printf("]"); + } + if (s->zns.n > 1) + printf("]"); + } + } + + /* compare two stacks with operators on top of identical substacks + eliminating the stack with the lower priority binary operator + - used to eliminate unnecessary stacks created by the + (empty) application binary operator + */ + static void + cmp_stacks(Parser *p) { + char *pos; + Shift *a, *b, **al, **bl; + ZNode *az, *bz; + + pos = p->shifts_todo->snode->loc.s; + DBG({ + int i = 0; + for (al = &p->shifts_todo, a = *al; a && a->snode->loc.s == pos; + al = &a->next, a = a->next) + { + if (++i < 2) printf("\n"); + print_stack(p, a->snode, 0); + printf("\n"); + }}); + for (al = &p->shifts_todo, a = *al; a && a->snode->loc.s == pos; + al = &a->next, a = a->next) + { + if (!(az = binary_op_ZNode(a->snode))) + continue; + for (bl = &a->next, b = a->next; b && b->snode->loc.s == pos; + bl = &b->next, b = b->next) { + if (!(bz = binary_op_ZNode(b->snode))) + continue; + if (!VecSNode_equal(&az->sns, &bz->sns)) + continue; + if ((a->snode->state->reduces_to != b->snode->state - p->t->state) && + (b->snode->state->reduces_to != a->snode->state - p->t->state)) + continue; + if (az->pn->op_priority > bz->pn->op_priority) { + DBG(printf("DELETE "); + print_stack(p, b->snode, 0); + printf("\n")); + *bl = b->next; + unref_sn(p, b->snode); + FREE(b); + b = *bl; + break; + } + if (az->pn->op_priority < bz->pn->op_priority) { + DBG(printf("DELETE "); + print_stack(p, a->snode, 0); + printf("\n")); + *al = a->next; + unref_sn(p, a->snode); + FREE(a); + a = *al; + goto Lbreak2; + } + } + Lbreak2:; + } + } + + static void + free_ParseTreeBelow(Parser *p, PNode *pn) { + int i; + PNode *amb; + + for (i = 0; i < pn->children.n; i++) + unref_pn(p, pn->children.v[i]); + vec_free(&pn->children); + if ((amb = pn->ambiguities)) { + pn->ambiguities = NULL; + free_PNode(p, amb); + } + } + + void + free_D_ParseTreeBelow(D_Parser *p, D_ParseNode *dpn) { + free_ParseTreeBelow((Parser*)p, DPN_TO_PN(dpn)); + } + + D_ParseNode * + ambiguity_count_fn(D_Parser *pp, int n, D_ParseNode **v) { + Parser *p = (Parser*)pp; + p->ambiguities += n - 1; + return v[0]; + } + + D_ParseNode * + ambiguity_abort_fn(D_Parser *pp, int n, D_ParseNode **v) { + int i; + if (verbose_level) { + for (i = 0; i < n; i++) { + print_paren(D_ParseNode_to_PNode(v[i])); + printf("\n"); + } + } + d_fail("unresolved ambiguity line %d file %s", v[0]->start_loc.line, + v[0]->start_loc.pathname); + return v[0]; + } + + static int + final_actionless(PNode *pn) { + int i; + if (pn->reduction && pn->reduction->final_code) + return 0; + for (i = 0; i < pn->children.n; i++) + if (!final_actionless(pn->children.v[i])) + return 0; + return 1; + } + + static PNode * + resolve_ambiguities(Parser *p, PNode *pn) { + PNode *amb; + D_ParseNode *res; + int efa; + Vec(D_ParseNode*) pns; + + vec_clear(&pns); + efa = is_epsilon_PNode(pn) && final_actionless(pn); + vec_add(&pns, &pn->parse_node); + for (amb = pn->ambiguities; amb; amb = amb->ambiguities) { + if (!p->user.dont_merge_epsilon_trees) + if (efa && is_epsilon_PNode(amb) && final_actionless(amb)) + continue; + vec_add(&pns, &amb->parse_node); + } + if (pns.n == 1) { + res = pns.v[0]; + goto Ldone; + } + res = p->user.ambiguity_fn((D_Parser *)p, pns.n, pns.v); + Ldone: + vec_free(&pns); + return D_ParseNode_to_PNode(res); + } + + static void + fixup_internal_symbol(Parser *p, PNode *pn, int ichild) { + PNode *child = pn->children.v[ichild]; + int j, n, pnn; + n = child->children.n, pnn = pn->children.n; + if (pn == child) + d_fail("circular parse: unable to fixup internal symbol"); + if (n == 0) { + for (j = ichild; j < pnn - 1; j++) + pn->children.v[j] = pn->children.v[j + 1]; + pn->children.n--; + } else if (n == 1) { + ref_pn(child->children.v[0]); + pn->children.v[ichild] = child->children.v[0]; + } else { + for (j = 0; j < n - 1; j++) /* expand children vector */ + vec_add(&pn->children, NULL); + for (j = pnn - 1; j >= ichild + 1; j--) /* move to new places */ + pn->children.v[j - 1 + n] = pn->children.v[j]; + for (j = 0; j < n; j++) { + ref_pn(child->children.v[j]); + pn->children.v[ichild + j] = child->children.v[j]; + } + } + unref_pn(p, child); + } + + #define is_symbol_internal(_p, _pn) \ + ((_p)->t->symbols[(_pn)->parse_node.symbol].kind == D_SYMBOL_INTERNAL) + + static PNode * + commit_tree(Parser *p, PNode *pn) { + int i, n, fixup = 0, internal; + + if (pn->evaluated) + return pn; + if (!is_unreduced_epsilon_PNode(pn)) + pn->evaluated = 1; + if (pn->ambiguities) + pn = resolve_ambiguities(p, pn); + internal = is_symbol_internal(p, pn); + fixup = !p->user.dont_fixup_internal_productions && internal; + for (i = 0; i < pn->children.n; i++) { + pn->children.v[i] = commit_tree(p, pn->children.v[i]); + n = pn->children.v[i]->children.n; + if (fixup && is_symbol_internal(p, pn->children.v[i])) { + fixup_internal_symbol(p, pn, i); + i -= 1; + continue; + } + } + if (pn->reduction && pn->reduction->final_code) + pn->reduction->final_code( + pn, (void**)&pn->children.v[0], pn->children.n, + (int)&((PNode*)(NULL))->parse_node, (D_Parser*)p); + if (pn->evaluated) { + if (!p->user.save_parse_tree && !internal) + free_ParseTreeBelow(p, pn); + } + return pn; + } + + static int + commit_stack(Parser *p, SNode *sn) { + int res = 0; + if (sn->zns.n != 1) + return -1; + if (sn->zns.v[0]->sns.n > 1) + return -2; + if (is_unreduced_epsilon_PNode(sn->zns.v[0]->pn)) /* wait till reduced */ + return -3; + if (sn->zns.v[0]->sns.n) + if ((res = commit_stack(p, sn->zns.v[0]->sns.v[0])) < 0) + return res; + sn->zns.v[0]->pn = commit_tree(p, sn->zns.v[0]->pn); + return res; + } + + static char * + find_substr(char *str, char *s) { + int len = strlen(s); + if (len == 1) { + while (*str && *str != *s) str++; + if (*str == *s) + return str + 1; + } else + while (*str) { + if (!strncmp(s, str, len)) + return str + len; + str++; + } + return NULL; + } + + static void + syntax_error_report_fn(struct D_Parser *p) { + char *fn = d_dup_pathname_str(p->loc.pathname); + fprintf(stderr, "syntax error, '%s' line %d\n", fn, p->loc.line); + FREE(fn); + } + + static void + update_line(char *s, char *e, int *line) { + for (;s < e; s++) if (*s == '\n') (*line)++; + } + + static int + error_recovery(Parser *p) { + SNode *sn, *best_sn = NULL; + char *best_s = NULL, *ss, *s; + int i, j, head = 0, tail = 0, res = 1; + D_ErrorRecoveryHint *best_er = NULL; + SNode **q = MALLOC(ERROR_RECOVERY_QUEUE_SIZE * sizeof(SNode*)); + PNode *best_pn; + + if (!p->snode_hash.last_all) + return res; + p->user.loc = p->snode_hash.last_all->loc; + if (!p->user.error_recovery) + return res; + if (p->user.loc.line > p->last_syntax_error_line) { + p->last_syntax_error_line = p->user.loc.line; + p->user.syntax_errors++; + p->user.syntax_error_fn((D_Parser*)p); + } + for (sn = p->snode_hash.last_all; sn; sn = sn->all_next) { + if (tail < ERROR_RECOVERY_QUEUE_SIZE - 1) + q[tail++] = sn; + } + s = p->snode_hash.last_all->loc.s; + while (tail > head) { + sn = q[head++]; + if (sn->state->error_recovery_hints.n) { + for (i = 0; i < sn->state->error_recovery_hints.n; i++) { + D_ErrorRecoveryHint *er = &sn->state->error_recovery_hints.v[i]; + if ((ss = find_substr(s, er->string))) { + if (!best_sn || ss < best_s || + (best_sn && ss == best_s && + (best_sn->depth < sn->depth || + (best_sn->depth == sn->depth && + best_er->depth < er->depth)))) + { + best_sn = sn; + best_s = ss; + best_er = er; + } + } + } + } + for (i = 0; i < sn->zns.n; i++) + if (sn->zns.v[i]) + for (j = 0; j < sn->zns.v[i]->sns.n; j++) { + if (tail < ERROR_RECOVERY_QUEUE_SIZE - 1) + q[tail++] = sn->zns.v[i]->sns.v[j]; + } + } + if (best_sn) { + D_Reduction *rr = MALLOC(sizeof(*rr)); + Reduction *r = MALLOC(sizeof(*r)); + d_loc_t best_loc = p->user.loc; + PNode *new_pn; + SNode *new_sn; + ZNode *z; + + memset(rr, 0, sizeof(*rr)); + vec_add(&p->error_reductions, rr); + rr->nelements = best_er->depth + 1; + rr->symbol = best_er->symbol; + update_line(best_loc.s, best_s, &best_loc.line); + best_loc.s = best_s; + best_pn = best_sn->zns.v[0]->pn; + best_pn->parse_node.white_space( + (D_Parser*)p, &best_loc, (void**)&best_pn->parse_node.globals); + ref_sn(best_sn); + new_pn = add_PNode(p, 0, &p->user.loc, best_loc.s, best_pn, 0, 0, 0); + new_sn = new_SNode(p, best_sn->state, &best_loc, new_pn->initial_scope, new_pn->initial_globals); + new_sn->last_pn = new_pn; + set_add_znode(&new_sn->zns, (z = new_ZNode(p, new_pn))); + ref_pn(new_pn); + vec_add(&z->sns, best_sn); + r->znode = z; + r->snode = new_sn; + ref_sn(best_sn); + r->reduction = rr; + r->new_snode = NULL; + r->next = NULL; + free_old_nodes(p); + reduce_one(p, r); + for (i = 0; i < p->t->nstates; i++) + for (sn = p->snode_hash.v[i]; sn; sn = sn->bucket_next) + for (j = 0; j < sn->zns.n; j++) + if ((z = sn->zns.v[j])) + if (z->pn->reduction == rr) { + z->pn->evaluated = 1; + z->pn->error_recovery = 1; + } + if (p->shifts_todo || p->reductions_todo) + res = 0; + } + FREE(q); + return res; + } + + #define PASS_CODE_FOUND(_p, _pn) ((_pn)->reduction && (_pn)->reduction->npass_code > (_p)->index && \ + (_pn)->reduction->pass_code[(_p)->index]) + + static void + pass_call(Parser *p, D_Pass *pp, PNode *pn) { + if (PASS_CODE_FOUND(pp, pn)) + pn->reduction->pass_code[pp->index]( + pn, (void**)&pn->children.v[0], pn->children.n, + (int)&((PNode*)(NULL))->parse_node, (D_Parser*)p); + } + + static void + pass_preorder(Parser *p, D_Pass *pp, PNode *pn) { + int found = PASS_CODE_FOUND(pp, pn), i; + pass_call(p, pp, pn); + if ((pp->kind & D_PASS_FOR_ALL) || + ((pp->kind & D_PASS_FOR_UNDEFINED) && !found)) + for (i = 0; i < pn->children.n; i++) + pass_preorder(p, pp, pn->children.v[i]); + } + + static void + pass_postorder(Parser *p, D_Pass *pp, PNode *pn) { + int found = PASS_CODE_FOUND(pp, pn), i; + if ((pp->kind & D_PASS_FOR_ALL) || + ((pp->kind & D_PASS_FOR_UNDEFINED) && !found)) + for (i = 0; i < pn->children.n; i++) + pass_postorder(p, pp, pn->children.v[i]); + pass_call(p, pp, pn); + } + + void + d_pass(D_Parser *ap, D_ParseNode *apn, int pass_number) { + PNode *pn = D_ParseNode_to_PNode(apn); + Parser *p = (Parser*)ap; + D_Pass *pp; + + if (pass_number >= p->t->npasses) + d_fail("bad pass number: %d\n", pass_number); + pp = &p->t->passes[pass_number]; + if (pp->kind & D_PASS_MANUAL) + pass_call(p, pp, pn); + else if (pp->kind & D_PASS_PRE_ORDER) + pass_preorder(p, pp, pn); + else if (pp->kind & D_PASS_POST_ORDER) + pass_postorder(p, pp, pn); + } + + static int + exhaustive_parse(Parser *p, int state) { + Reduction *r; + Shift *s; + char *pos, *epos = NULL; + PNode *pn, tpn; + SNode *sn; + ZNode *z; + int progress = 0, ready = 0; + d_loc_t loc; + + pos = p->user.loc.s = p->start; + loc = p->user.loc; + p->user.initial_white_space_fn((D_Parser*)p, &loc, &p->user.initial_globals); + /* initial state */ + sn = add_SNode(p, &p->t->state[state], &loc, p->top_scope, p->user.initial_globals); + memset(&tpn, 0, sizeof(tpn)); + tpn.parse_node.white_space = p->user.initial_white_space_fn; + tpn.parse_node.globals = p->user.initial_globals; + tpn.initial_scope = tpn.parse_node.scope = p->top_scope; + tpn.parse_node.end = loc.s; + pn = add_PNode(p, 0, &loc, loc.s, &tpn, 0, 0, 0); + sn->last_pn = pn; + set_add_znode(&sn->zns, (z = new_ZNode(p, pn))); + ref_pn(pn); + while (1) { + /* reduce all */ + while (p->reductions_todo) { + pos = p->reductions_todo->snode->loc.s; + if (p->shifts_todo && p->shifts_todo->snode->loc.s < pos) + break; + if (pos > epos) { + epos = pos; + free_old_nodes(p); + } + for (;(r = p->reductions_todo) && r->snode->loc.s == pos;) { + p->reductions_todo = p->reductions_todo->next; + reduce_one(p, r); + } + } + /* done? */ + if (!p->shifts_todo) { + if (p->accept && + (p->accept->loc.s == p->end || p->user.partial_parses)) + return 0; + else { + if (error_recovery(p)) + return 1; + continue; + } + } else if (!p->user.dont_compare_stacks && p->shifts_todo->next) + cmp_stacks(p); + /* shift all */ + pos = p->shifts_todo->snode->loc.s; + if (pos > epos) { + epos = pos; + free_old_nodes(p); + } + progress++; + ready = progress > p->user.commit_actions_interval; + if (ready && !p->shifts_todo->next) { + commit_stack(p, p->shifts_todo->snode); + ready = progress = 0; + } + for (; (s = p->shifts_todo) && s->snode->loc.s == pos;) { + p->shifts_todo = p->shifts_todo->next; + shift_one(p, s); + } + if (ready && p->reductions_todo && !p->reductions_todo->next) { + commit_stack(p, p->reductions_todo->snode); + progress = 0; + } + } + } + + /* doesn't include nl */ + char _wspace[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 1, 1, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0 /* zero padded */ + }; + + #define wspace(_x) (_wspace[(unsigned char)_x]) + + static void + white_space(D_Parser *p, d_loc_t *loc, void **p_user_globals) { + int rec = 0; + char *s = loc->s, *scol; + + if (p->loc.s == s) + scol = s; + else + scol = 0; + if (*s == '#' && loc->previous_col == 0) { + Ldirective: + { + char *save = s; + s++; + while (wspace(*s)) s++; + if (!strncmp("line", s, 4)) { + if (wspace(s[4])) { + s += 5; + while (wspace(*s)) s++; + } + } + if (isdigit(*s)) { + loc->line = atoi(s) - 1; + while (isdigit(*s)) s++; + while (wspace(*s)) s++; + if (*s == '"') + loc->pathname = s; + } else { + s = save; + goto Ldone; + } + } + while (*s && *s != '\n') s++; + } + Lmore: + while (wspace(*s)) s++; + if (*s == '\n') { + loc->line++; + scol = s + 1; + s++; + if (*s == '#') + goto Ldirective; + else + goto Lmore; + } + if (s[0] == '/') { + if (s[1] == '/') { + while (*s && *s != '\n') { s++; } + loc->line++; + s++; + goto Lmore; + } + if (s[1] == '*') { + s += 2; + LnestComment: + rec++; + LmoreComment: + while (*s) { + if (s[0] == '*' && s[1] == '/') { + s += 2; + rec--; + if (!rec) + goto Lmore; + goto LmoreComment; + } + if (s[0] == '/' && s[1] == '*') { + s += 2; + goto LnestComment; + } + if (*s == '\n') { + loc->line++; + scol = s + 1; + } + s++; + } + } + } + Ldone: + if (scol) + loc->col = s - scol; + else + loc->col = -1; + loc->s = s; + return; + } + + void null_white_space(D_Parser *p, d_loc_t *loc, void **p_globals) { } + + D_Parser * + new_D_Parser(D_ParserTables *t, int sizeof_ParseNode_User) { + Parser *p = MALLOC(sizeof(Parser)); + memset(p, 0, sizeof(Parser)); + p->t = t; + p->user.loc.line = 1; + p->user.sizeof_user_parse_node = sizeof_ParseNode_User; + p->user.commit_actions_interval = DEFAULT_COMMIT_ACTIONS_INTERVAL; + p->user.syntax_error_fn = syntax_error_report_fn; + p->user.ambiguity_fn = ambiguity_abort_fn; + p->user.error_recovery = 1; + p->user.save_parse_tree = t->save_parse_tree; + if (p->t->default_white_space) + p->user.initial_white_space_fn = p->t->default_white_space; + else if (p->t->whitespace_state) + p->user.initial_white_space_fn = parse_whitespace; + else + p->user.initial_white_space_fn = white_space; + return (D_Parser*)p; + } + + void + free_D_Parser(D_Parser *ap) { + Parser *p = (Parser *)ap; + if (p->top_scope && !p->user.initial_scope) + free_D_Scope(p->top_scope, 0); + if (p->whitespace_parser) + free_D_Parser((D_Parser*)p->whitespace_parser); + FREE(ap); + } + + void + free_D_ParseNode(D_Parser * p, D_ParseNode *dpn) { + if (dpn != NO_DPN) { + unref_pn((Parser*)p, DPN_TO_PN(dpn)); + free_parser_working_data((Parser*)p); + } + #ifdef TRACK_PNODES + if (((Parser*)p)->xall) + printf("tracked pnodes\n"); + #endif + } + + Parser * + new_subparser(Parser *p) { + Parser * pp = (Parser *)new_D_Parser(p->t, p->user.sizeof_user_parse_node); + pp->end = p->end; + pp->pinterface1 = p->pinterface1; + alloc_parser_working_data(pp); + return pp; + } + + static void + initialize_whitespace_parser(Parser *p) { + if (p->t->whitespace_state) { + p->whitespace_parser = new_subparser(p); + p->whitespace_parser->user.initial_white_space_fn = null_white_space; + p->whitespace_parser->user.error_recovery = 0; + p->whitespace_parser->user.partial_parses = 1; + } + } + + D_ParseNode * + dparse(D_Parser *ap, char *buf, int buf_len) { + int r; + Parser *p = (Parser *)ap; + SNode *ps; + PNode *pn; + D_ParseNode *res = NULL; + + p->states = p->scans = p->shifts = p->reductions = p->compares = 0; + p->start = buf; + p->end = buf + buf_len; + + initialize_whitespace_parser(p); + alloc_parser_working_data(p); + if (p->user.initial_scope) + p->top_scope = p->user.initial_scope; + else { + if (p->top_scope) + free_D_Scope(p->top_scope, 0); + p->top_scope = new_D_Scope(NULL); + p->top_scope->kind = SCOPE_SEQUENTIAL; + } + r = exhaustive_parse(p, p->user.start_state); + if (!r) { + ps = p->accept; + if (ps->zns.n != 1 || ps->zns.v[0]->pn->children.n != 1) + d_fail("internal error: bad final reduction"); + pn = ps->zns.v[0]->pn->latest->children.v[0]; + pn = commit_tree(p, pn); + if (verbose_level) { + printf( + "%d states %d scans %d shifts %d reductions " + "%d compares %d ambiguities\n", + p->states, p->scans, p->shifts, p->reductions, + p->compares, p->ambiguities); + if (p->user.save_parse_tree) { + if (verbose_level > 1) + xprint_paren(p, pn); + else + print_paren(pn); + printf("\n"); + } + } + if (p->user.save_parse_tree) { + ref_pn(pn); + res = &pn->parse_node; + } else + res = NO_DPN; + unref_sn(p, p->accept); + p->accept = NULL; + } else + p->accept = NULL; + free_parser_working_data(p); + return res; + } + Index: llvm/test/Programs/MultiSource/Applications/d/parse.h diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/parse.h:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/parse.h Thu Jan 1 10:50:36 2004 *************** *** 0 **** --- 1,151 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + #ifndef _parse_H_ + #define _parse_H_ + + #define NO_DPN ((D_ParseNode*)0x1) + #define DPN_TO_PN(_dpn) \ + ((PNode *)(((char*)dpn)-(int)(&((PNode*)0)->parse_node))) + #define is_epsilon_PNode(_pn) \ + ((_pn)->parse_node.start_loc.s == (_pn)->parse_node.end) + + /* #define TRACK_PNODES 1 */ + + struct PNode; + struct SNode; + struct ZNode; + struct Parser; + + typedef Vec(struct ZNode*) VecZNode; + typedef Vec(VecZNode *) VecVecZNode; + typedef Vec(struct SNode*) VecSNode; + typedef Vec(struct PNode*) VecPNode; + + typedef struct PNodeHash { + struct PNode **v; + uint i; /* size index (power of 2) */ + uint m; /* max size (highest prime < i ** 2) */ + uint n; /* size */ + struct PNode *all; + } PNodeHash; + + typedef struct SNodeHash { + struct SNode **v; + uint i; /* size index (power of 2) */ + uint m; /* max size (highest prime < i ** 2) */ + uint n; /* size */ + struct SNode *all; + struct SNode *last_all; + } SNodeHash; + + typedef struct Reduction { + struct ZNode *znode; + struct SNode *snode; + struct D_Reduction *reduction; + struct SNode *new_snode; + int new_depth; + struct Reduction *next; + } Reduction; + + typedef struct Shift { + struct SNode *snode; + struct Shift *next; + } Shift; + + typedef struct Parser { + D_Parser user; + /* string to parse */ + char *start, *end; + struct D_ParserTables *t; + /* statistics */ + int states, pnodes, scans, shifts, reductions, compares, ambiguities; + /* parser state */ + PNodeHash pnode_hash; + SNodeHash snode_hash; + Reduction *reductions_todo; + Shift *shifts_todo; + D_Scope *top_scope; + struct SNode *accept; + int last_syntax_error_line; + /* memory management */ + Reduction *free_reductions; + Shift *free_shifts; + int live_pnodes; + struct PNode *free_pnodes; + struct SNode *free_snodes; + struct ZNode *free_znodes; + Vec(D_Reduction *) error_reductions; + ShiftResult *shift_results; + D_Shift code_shift; + /* comments */ + struct Parser *whitespace_parser; + /* interface support */ + void *pinterface1; + #ifdef TRACK_PNODES + struct PNode *xall; + #endif + } Parser; + + /* + Parse Node - the 'symbol' and the constructed parse subtrees. + */ + typedef struct PNode { + AssocKind assoc; + int priority; + AssocKind op_assoc; + int op_priority; + D_Reduction *reduction; + D_Shift *shift; + #ifndef USE_GC + uint32 refcount; + #endif + VecPNode children; + uint height; /* max tree height */ + uint8 evaluated; + uint8 error_recovery; + struct PNode *all_next; + struct PNode *bucket_next; + struct PNode *ambiguities; + struct PNode *latest; /* latest version of this PNode */ + char *ws_before; + char *ws_after; + D_Scope *initial_scope; + void *initial_globals; + D_ParseNode parse_node; /* public fields */ + #ifdef TRACK_PNODES + struct PNode *xnext; + struct PNode *xprev; + #endif + } PNode; + + /* + State Node - the 'state'. + */ + typedef struct SNode { + D_State *state; + D_Scope *initial_scope; + void *initial_globals; + d_loc_t loc; + uint depth; /* max stack depth (less loops) */ + PNode *last_pn; + VecZNode zns; + #ifndef USE_GC + uint32 refcount; + #endif + struct SNode *bucket_next; + struct SNode *all_next; + } SNode; + + /* + (Z)Symbol Node - holds one of the symbols associated with a state. + */ + typedef struct ZNode { + PNode *pn; + VecSNode sns; + } ZNode; + #define znode_next(_z) (*(ZNode**)&((_z)->pn)) + + D_ParseNode * ambiguity_count_fn(D_Parser *pp, int n, D_ParseNode **v); + + #endif Index: llvm/test/Programs/MultiSource/Applications/d/parser_tests diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/parser_tests:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/parser_tests Thu Jan 1 10:50:36 2004 *************** *** 0 **** --- 1,39 ---- + #!/bin/tcsh + + cp BUILD_VERSION Makefile *.c *.h tests + cd tests + $MAKE -s make_dparser + set failed = 0 + foreach g (*.test.g) + rm -f sample_parser + if (-e $g.flags) then + set flags = `cat $g.flags` + else + set flags = + endif + ./make_dparser $flags $g + $MAKE -s sample_parser SAMPLE_GRAMMAR=$g:t + foreach t ( $g.[0-9] $g.[0-9][0-9] ) + if (-e $t.flags) then + set flags = `cat $t.flags` + else + set flags = + endif + ./sample_parser $flags -v $t >&! $t.out + diff $t.out $t.check + if ($?) then + echo $t "******** FAILED ********" + set failed = `expr $failed + 1` + else + echo $t "PASSED" + endif + end + end + echo "---------------------------------------" + if (! $failed) then + echo "ALL tests PASSED" + else + echo "********" $failed "test(s) FAILED *********" + endif + rm -f sample_parser BUILD_VERSION Makefile *.c *.h *.o make_dparser libdparse.a + cd .. Index: llvm/test/Programs/MultiSource/Applications/d/sample.g.d_parser.h diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/sample.g.d_parser.h:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/sample.g.d_parser.h Thu Jan 1 10:50:36 2004 *************** *** 0 **** --- 1,20 ---- + #ifndef _gram_h + #define _gram_h + #define D_SYMBOL_program 2 + #define D_SYMBOL_statement 4 + #define D_SYMBOL_definition 5 + #define D_SYMBOL_external 6 + #define D_SYMBOL_external_type 11 + #define D_SYMBOL_expression 12 + #define D_SYMBOL_constant 17 + #define D_SYMBOL_strings 18 + #define D_SYMBOL_binary_operator 20 + #define D_SYMBOL_pre_operator 21 + #define D_SYMBOL_post_operator 22 + #define D_SYMBOL_builtin_types 23 + #define D_SYMBOL_character 24 + #define D_SYMBOL_string 25 + #define D_SYMBOL_integer 26 + #define D_SYMBOL_float 27 + #define D_SYMBOL_identifier 28 + #endif Index: llvm/test/Programs/MultiSource/Applications/d/scan.c diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/scan.c:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/scan.c Thu Jan 1 10:50:36 2004 *************** *** 0 **** --- 1,152 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + + #include "d.h" + + int + scan_buffer(d_loc_t *loc, D_State *parse_state, ShiftResult *results) { + char *s = loc->s, *scol = 0; + int col = loc->col, collast = col, line = loc->line; + int nresults = 0, i, j; + D_Shift **shift = NULL; + + if (parse_state->scan_kind != D_SCAN_LONGEST) { + /* all matches */ + SB_uint8 *st = (SB_uint8*)parse_state->scanner_table; + SB_trans_uint8 *tst = (SB_trans_uint8*)parse_state->transition_table; + uint8 state = 0, last = state; + uint8 c; + uint32 sb, so; + c = (uint8)*s++; + while ((state = st[state].scanner_block[(sb = (c >> SCANNER_BLOCK_SHIFT))] + [(so = c & SCANNER_BLOCK_MASK)])) + { + state -= 1; + if (st[state].shift) { + last = state; + loc->s = s; collast = col; loc->line = line; + shift = parse_state->accepts_diff[tst[state].scanner_block[sb][so]]; + for (; *shift; shift++) { + results[nresults].loc = *loc; + results[nresults++].shift = *shift; + } + } + if (c == '\n') { line++; col = 0; scol = s; } else col++; + c = (uint8)*s++; + } + loc->col = scol ? s - scol : -1; + shift = st[last].shift; + if (shift) { + loc->line = line; + for (; *shift; shift++) { + results[nresults].loc = *loc; + results[nresults++].shift = *shift; + } + } + if (nresults && parse_state->scan_kind == D_SCAN_MIXED) { + char *end = results[nresults-1].loc.s; + int longest = 0; + for (i = nresults - 1; i >= 0; i--) { + if (results[i].shift->shift_kind == D_SCAN_LONGEST) + longest = 1; + if (results[i].loc.s < end) + break; + } + if (!longest) { + /* only keep non-longest */ + for (j = i; j >= 0; j--) + if (results[j].shift->shift_kind != D_SCAN_LONGEST) { + if (i != j) + results[i] = results[j]; + i--; + } + nresults = nresults - i - 1; + if (i != -1) + memmove(&results[0], &results[i + 1], nresults * sizeof(results[0])); + } else { + /* keep only 'longest' */ + i = 0; + for (j = 0; j < nresults; j++) + if (results[j].loc.s == end) { + if (i != j) + results[i] = results[j]; + i++; + } + nresults = i; + } + } + return nresults; + } else { + /* longest match only */ + switch (parse_state->scanner_size) { + case 1: { + SB_uint8 *st = (SB_uint8*)parse_state->scanner_table; + uint8 state = 0, last = state; + uint8 c; + c = (uint8)*s++; + while ((state = st[state].scanner_block[c >> SCANNER_BLOCK_SHIFT] + [c & SCANNER_BLOCK_MASK])) + { + state -= 1; + if (st[state].shift) { + last = state; + loc->s = s; collast = col; loc->line = line; + } + if (c == '\n') { line++; col = 0; scol = s; } else col++; + c = (uint8)*s++; + } + shift = st[last].shift; + break; + } + case 2: { + SB_uint16 *st = (SB_uint16*)parse_state->scanner_table; + uint16 state = 0, last = state; + uint8 c; + c = (uint8)*s++; + while ((state = st[state].scanner_block[c >> SCANNER_BLOCK_SHIFT] + [c & SCANNER_BLOCK_MASK])) + { + state -= 1; + if (st[state].shift) { + last = state; + loc->s = s; collast = col; loc->line = line; + } + if (c == '\n') { line++; col = 0; scol = s; } else col++; + c = (uint8)*s++; + } + shift = st[last].shift; + break; + } + case 4: { + SB_uint32 *st = (SB_uint32*)parse_state->scanner_table; + uint32 state = 0, last = state; + uint8 c; + c = (uint8)*s++; + while ((state = st[state].scanner_block[c >> SCANNER_BLOCK_SHIFT] + [c & SCANNER_BLOCK_MASK])) + { + state -= 1; + if (st[state].shift) { + last = state; + loc->s = s; collast = col; loc->line = line; + } + if (c == '\n') { line++; col = 0; scol = s; } else col++; + c = (uint8)*s++; + } + shift = st[last].shift; + break; + } + } + loc->col = scol ? s - scol : -1; + if (shift) { + loc->line = line; + for (; *shift; shift++) { + results[nresults].loc = *loc; + results[nresults++].shift = *shift; + } + } + return nresults; + } + } + Index: llvm/test/Programs/MultiSource/Applications/d/scan.h diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/scan.h:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/scan.h Thu Jan 1 10:50:36 2004 *************** *** 0 **** --- 1,17 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + + #ifndef _scan_H_ + #define _scan_H_ + + #include "d.h" + + typedef struct ShiftResult { + D_Shift *shift; + d_loc_t loc; + } ShiftResult; + + int scan_buffer(d_loc_t *loc, D_State *st, ShiftResult *result); + + #endif Index: llvm/test/Programs/MultiSource/Applications/d/symtab.c diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/symtab.c:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/symtab.c Thu Jan 1 10:50:36 2004 *************** *** 0 **** --- 1,324 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + #include "d.h" + + #define INITIAL_SYMHASH_SIZE 3137 + + typedef struct D_SymHash { + int index; + int grow; + Vec(D_Sym*) syms; + } D_SymHash; + + /* + How this works. In a normal symbol table there is simply + a stack of scopes representing the scoping structure of + the program. Because of speculative parsing, this symbol table + also has a tree of all 'updates' representing different + views of the state of scoped variables by each speculative + parse state. Periodically, when the parse state collapses + to a single state (we are nolonger speculating), these changes + are can be 'committed' and the changes pushed into the top + level hash table. + + All D_Scope's except the top level just have a 'll' of symbols, the + top level has a 'hash'. + + 'updates' is a list of changes to symbols in other scopes. It is + searched to find the current version of a symbol with respect to the + speculative parse path represented by D_Scope. + + 'up' points to the enclosing scope, it isn't used much. + + 'up_updates' is the prior scope in speculative parsing, it is used find + the next D_Scope to look in for 'updates' after the current one has been + searched. + + 'down' and 'down_next' are used to hold enclosing scopes, or in the + case of the top level, sibling scopes (created by commmit). + */ + + + static void + symhash_add(D_SymHash *sh, D_Sym *s) { + uint i, h = s->hash % sh->syms.n, n; + D_Sym **v = sh->syms.v, *x; + Vec(D_Sym*) vv, tv; + + sh->index++; + s->next = v[h]; + v[h] = s; + + if (sh->index > sh->grow) { + vv.v = sh->syms.v; + vv.n = sh->syms.n; + sh->syms.n = sh->grow; + sh->grow = sh->grow * 2 + 1; + sh->syms.v = MALLOC(sh->syms.n * sizeof(void *)); + memset(sh->syms.v, 0, sh->syms.n * sizeof(void *)); + v = sh->syms.v; + n = sh->syms.n; + vec_clear(&tv); + for (i = 0; i < vv.n; i++) + /* use temporary to preserve order */ + while (vv.v[i]) { + x = vv.v[i]; + vv.v[i] = x->next; + vec_add(&tv, x); + } + while (tv.v[i]) { + x = tv.v[i]; + tv.v[i] = x->next; + h = x->hash % n; + x->next = v[h]; + v[h] = x; + } + FREE(vv.v); + } + } + + static D_SymHash * + new_D_SymHash() { + D_SymHash *sh = MALLOC(sizeof(D_SymHash)); + memset(sh, 0, sizeof(D_SymHash)); + sh->grow = INITIAL_SYMHASH_SIZE * 2 + 1; + sh->syms.n = INITIAL_SYMHASH_SIZE; + sh->syms.v = MALLOC(sh->syms.n * sizeof(void *)); + memset(sh->syms.v, 0, sh->syms.n * sizeof(void *)); + return sh; + } + + static void + free_D_SymHash(D_SymHash *sh) { + int i; + D_Sym *sym; + for (i = 0; i < sh->syms.n; i++) + for (; sh->syms.v[i]; sh->syms.v[i] = sym) { + sym = sh->syms.v[i]->next; + free_D_Sym(sh->syms.v[i]); + } + FREE(sh->syms.v); + FREE(sh); + } + + D_Scope * + new_D_Scope(D_Scope *parent) { + D_Scope *st = MALLOC(sizeof(D_Scope)); + memset(st, 0, sizeof(D_Scope)); + if (parent) { + st->kind = parent->kind; + st->search = parent; + st->up = parent; + st->up_updates = parent; + st->down_next = parent->down; + parent->down = st; + } else + st->hash = new_D_SymHash(); + return st; + } + + D_Scope * + enter_D_Scope(D_Scope *current, D_Scope *scope) { + D_Scope *st = MALLOC(sizeof(D_Scope)), *parent = scope->up; + memset(st, 0, sizeof(D_Scope)); + st->up = parent; + st->kind = scope->kind; + st->search = scope; + st->up_updates = current; + st->down_next = current->down; + current->down = st; + return st; + } + + void + free_D_Scope(D_Scope *st, int force) { + D_Scope *s; + D_Sym *sym; + for (; st->down; st->down = s) { + s = st->down->down_next; + free_D_Scope(st->down, 0); + } + if (st->owned_by_user && !force) + return; + if (st->hash) + free_D_SymHash(st->hash); + else + for (; st->ll; st->ll = sym) { + sym = st->ll->next; + free_D_Sym(st->ll); + } + for (; st->updates; st->updates = sym) { + sym = st->updates->next; + free_D_Sym(st->updates); + } + FREE(st); + } + + static void + commit_ll(D_Scope *st, D_SymHash *sh) { + D_Sym *sym; + if (st->search) { + commit_ll(st->search, sh); + for (; st->ll; st->ll = sym) { + sym = st->ll->next; + symhash_add(sh, st->ll); + } + } + } + + /* make direct links to the latest update */ + static void + commit_update(D_Scope *st, D_SymHash *sh) { + int i; + D_Sym *s; + + for (i = 0; i < sh->syms.n; i++) + for (s = sh->syms.v[i]; s; s = s->next) + s->update_of = current_D_Sym(st, s); + } + + /* currently only commit the top level scope */ + D_Scope * + commit_D_Scope(D_Scope *st) { + D_Scope *x = st; + if (st->up) + return st; + while (x->search) x = x->search; + commit_ll(st, x->hash); + commit_update(st, x->hash); + return x; + } + + D_Sym * + new_D_Sym(D_Scope *st, char *name, char *end, int sizeof_D_Sym) { + int len = end - name; + D_Sym *s = MALLOC(sizeof_D_Sym); + memset(s, 0, sizeof_D_Sym); + s->name = name; + s->len = len; + s->hash = strhashl(name, len); + if (st->hash) { + symhash_add(st->hash, s); + } else { + s->next = st->ll; + st->ll = s; + } + return s; + } + + void + free_D_Sym(D_Sym *s) { + FREE(s); + } + + D_Sym * + current_D_Sym(D_Scope *st, D_Sym *sym) { + D_Scope *sc; + D_Sym *uu; + + if (sym->update_of) sym = sym->update_of; + /* return the last update */ + for (sc = st; sc; sc = sc->up_updates) { + for (uu = sc->updates; uu; uu = uu->next) + if (uu->update_of == sym) + return uu; + } + return sym; + } + + D_Sym * + find_sym_internal(D_Scope *top, D_Scope *cur, char *name, int len, uint h) { + D_Sym *ll; + + if (!cur) + return NULL; + if (cur->hash) + ll = cur->hash->syms.v[h % cur->hash->syms.n]; + else + ll = cur->ll; + while (ll) { + if (ll->hash == h && ll->len == len && !strncmp(ll->name, name, len)) + break; + ll = ll->next; + } + if (!ll) { + if (cur->search) + return find_sym_internal(top, cur->search, name, len, h); + return ll; + } + return current_D_Sym(top, ll); + } + + D_Sym * + find_D_Sym(D_Scope *st, char *name, char *end) { + int len = end - name; + uint h = strhashl(name, len); + return find_sym_internal(st, st, name, len, h); + } + + D_Sym * + find_D_Sym_in_Scope(D_Scope *st, char *name, char *end) { + D_Sym *ll; + int len = end - name; + uint h = strhashl(name, len); + for (;st ; st = st->search) { + if (st->hash) + ll = st->hash->syms.v[h % st->hash->syms.n]; + else + ll = st->ll; + while (ll) { + if (ll->hash == h && ll->len == len && !strncmp(ll->name, name, len)) + return ll; + ll = ll->next; + } + if (!st->search || st->search->up != st->up) + break; + } + return NULL; + } + + D_Sym * + update_D_Sym(D_Scope *st, D_Sym *sym, int sizeof_D_Sym) { + D_Sym *s; + + sym = current_D_Sym(st, sym); + s = MALLOC(sizeof_D_Sym); + memcpy(s, sym, sizeof(D_Sym)); + if (sym->update_of) sym = sym->update_of; + s->update_of = sym; + s->next = st->updates; + st->updates = s; + return s; + } + + void + print_sym(D_Sym *s) { + char *c = (char*)MALLOC(s->len + 1); + memcpy(c, s->name, s->len); + s->name[s->len] = 0; + printf("%s, ", c); + FREE(c); + } + + void + print_scope(D_Scope *st) { + printf("SCOPE %X: ", (int)st); + printf(" owned: %d, kind: %d, ", st->owned_by_user, st->kind); + if (st->ll) printf(" LL\n"); + if (st->hash) printf(" HASH\n"); + if (st->hash) { + int i; + for (i = 0; i < st->hash->syms.n; i++) + if (st->hash->syms.v[i]) + print_sym(st->hash->syms.v[i]); + } else { + D_Sym *ll = st->ll; + while (ll) { + print_sym(ll); + ll = ll->next; + } + } + printf("\n\n"); + if (st->search) print_scope(st->search); + } Index: llvm/test/Programs/MultiSource/Applications/d/util.c diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/util.c:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/util.c Thu Jan 1 10:50:36 2004 *************** *** 0 **** --- 1,365 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + + #include "d.h" + + uint prime2[] = { + 1, 3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, + 16381, 32749, 65521, 131071, 262139, 524287, 1048573, 2097143, + 4194301, 8388593, 16777213, 33554393, 67108859, 134217689, + 268435399, 536870909 + }; + + int verbose_level = 0; + int debug_level = 0; + int test_level = 0; + + char * + d_dup_pathname_str(char *s) { + char *e = s; + if (!s) + return strdup(""); + if (*e == '"') { + e++; while (*e && *e != '"') e++; + return dup_str(s + 1, e); + } else + return dup_str(s, s+strlen(s)); + } + + char * + dup_str(char *s, char *e) { + int l = e-s; + char *ss = (char*)MALLOC(l+1); + memcpy(ss, s, l); + ss[l] = 0; + return ss; + } + + uint + strhashl(char *s, int l) { + uint h = 0, g; + int i = 0; + + for (;i < l;i++,s++) { + h = (h << 4) + *s; + if ((g = h & 0xf0000000)) + h = (h ^ (g >> 24)) ^ g; + } + return h; + } + + int + buf_read(char *pathname, char **buf, int *len) { + struct stat sb; + int fd; + + *buf = 0; + *len = 0; + fd = open(pathname, O_RDONLY); + if (fd <= 0) + return -1; + memset(&sb, 0, sizeof(sb)); + fstat(fd, &sb); + *len = sb.st_size; + *buf = (char*)MALLOC(*len + 2); + (*buf)[*len] = 0; /* terminator */ + (*buf)[*len + 1] = 0; /* sentinal */ + read(fd, *buf, *len); + close(fd); + return *len; + } + + char * + sbuf_read(char *pathname) { + char *buf; + int len; + + if (buf_read(pathname, &buf, &len) < 0) + return NULL; + return buf; + } + + void + d_fail(char *str, ...) { + char nstr[256]; + va_list ap; + va_start(ap, str); + snprintf(nstr, 255, "fail: %s\n", str); + vfprintf(stderr, nstr, ap); + va_end(ap); + exit(1); + } + + void + vec_add_internal(void *v, void *elem) { + AbstractVec *av = (AbstractVec*)v; + if (!av->n) { + av->v = av->e; + } else if (av->v == av->e) { + av->v = (void**)MALLOC(INITIAL_VEC_SIZE * sizeof(void *)); + memcpy(av->v, av->e, av->n * sizeof(void *)); + } else + if ((av->n & (INITIAL_VEC_SIZE - 1)) == 0) { + int l = av->n, nl = (1 + INITIAL_VEC_SHIFT); + l = l >> INITIAL_VEC_SHIFT; + while (!(l&1)) { l = l >> 1; nl++; } + l = l >> 1; + if (!av->n || !l) { + nl = 1 << nl; + av->v = (void**)REALLOC(av->v, nl * sizeof(void *)); + } + } + av->v[av->n++] = elem; + } + + int + vec_eq(void *v, void *vv) { + AbstractVec *av = (AbstractVec*)v; + AbstractVec *avv = (AbstractVec*)vv; + uint i; + + if (av->n != avv->n) + return 0; + for (i = 0; i < av->n; i++) + if (av->v[i] != avv->v[i]) + return 0; + return 1; + } + + void * + stack_push_internal(AbstractStack *s, void *elem) { + int n = s->cur - s->start; + if (s->start == s->initial) { + s->cur = (void**)MALLOC(n * 2 * sizeof(void*)); + memcpy(s->cur, s->start, n * sizeof(void*)); + } else + s->cur = (void**)REALLOC(s->start, n * 2 * sizeof(void*)); + s->end = s->start = s->cur; + s->cur += n; + s->end += n * 2; + *s->cur++ = elem; + return elem; + } + + int + set_add(void *av, void *t) { + AbstractVec *v = (AbstractVec*)av, vv; + int j, n = v->n; + uint i; + if (n) { + uint h = ((uint)t); + h = h % n; + for (i = h, j = 0; + i < v->n && j < SET_MAX_SEQUENTIAL; + i = ((i + 1) % n), j++) + { + if (!v->v[i]) { + v->v[i] = t; + return 1; + } else if (v->v[i] == t) + return 0; + } + } + if (!n) { + vv.v = NULL; + v->i = INITIAL_SET_SIZE_INDEX; + } else { + vv.v = v->v; + vv.n = v->n; + v->i = v->i + 1; + } + v->n = prime2[v->i]; + v->v = (void**)MALLOC(v->n * sizeof(void *)); + memset(v->v, 0, v->n * sizeof(void *)); + if (vv.v) { + set_union(av, &vv); + FREE(vv.v); + } + return set_add(v, t); + } + + void * + set_add_fn(void *av, void *t, hash_fns_t *fns) { + AbstractVec *v = (AbstractVec*)av, vv; + uint32 tt = fns->hash_fn(t, fns); + int j, n = v->n; + uint i; + if (n) { + uint h = tt % n; + for (i = h, j = 0; + i < v->n && j < SET_MAX_SEQUENTIAL; + i = ((i + 1) % n), j++) + { + if (!v->v[i]) { + v->v[i] = t; + return t; + } else { + if (!fns->cmp_fn(v->v[i], t, fns)) + return v->v[i]; + } + } + } + if (!n) { + vv.v = NULL; + v->i = INITIAL_SET_SIZE_INDEX; + } else { + vv.v = v->v; + vv.n = v->n; + v->i = v->i + 1; + } + v->n = prime2[v->i]; + v->v = (void**)MALLOC(v->n * sizeof(void *)); + memset(v->v, 0, v->n * sizeof(void *)); + if (vv.v) { + set_union_fn(av, &vv, fns); + FREE(vv.v); + } + return set_add_fn(v, t, fns); + } + + int + set_union(void *av, void *avv) { + AbstractVec *vv = (AbstractVec*)avv; + uint i, changed = 0; + + for (i = 0; i < vv->n; i++) + if (vv->v[i]) + changed = set_add(av, vv->v[i]) || changed; + return changed; + } + + void + set_union_fn(void *av, void *avv, hash_fns_t *fns) { + AbstractVec *vv = (AbstractVec*)avv; + uint i; + + for (i = 0; i < vv->n; i++) + if (vv->v[i]) + set_add_fn(av, vv->v[i], fns); + } + + void + set_to_vec(void *av) { + AbstractVec *v = (AbstractVec*)av, vv; + uint i; + + vv.n = v->n; + vv.v = v->v; + if (v->v == v->e) { + memcpy(vv.e, v->e, sizeof(v->e)); + vv.v = vv.e; + } + v->n = 0; + v->v = 0; + for (i = 0; i < vv.n; i++) + if (vv.v[i]) + vec_add_internal(v, vv.v[i]); + FREE(vv.v); + } + + void + int_list_diff(int *a, int *b, int *c) { + while (1) { + if (*b < 0) + break; + Lagainc: + if (*c < 0) { + while (*b >= 0) + *a++ = *b++; + break; + } + Lagainb: + if (*b == *c) { + b++; + c++; + continue; + } + if (*b < *c) { + *a++ = *b++; + if (*b < 0) + break; + goto Lagainb; + } + if (*c < *b) { + c++; + goto Lagainc; + } + } + *a++ = -1; + } + + void + int_list_intersect(int *a, int *b, int *c) { + while (1) { + if (*b < 0) + break; + Lagainc: + if (*c < 0) + break; + Lagainb: + if (*b == *c) { + *a++ = *b++; + c++; + continue; + } + if (*b < *c) { + b++; + if (*b < 0) + break; + goto Lagainb; + } + if (*c < *b) { + c++; + goto Lagainc; + } + } + *a++ = -1; + } + + int * + int_list_dup(int *aa) { + int *a = aa, *b, *bb; + while (*a != -1) { a++; } + bb = b = (int*)MALLOC((a - aa + 1) * sizeof(int)); + a = aa; + while (*a != -1) { *b++ = *a++; } + *b++ = -1; + return bb; + } + + #define ESC(_c) *ss++ = '\\'; *ss++ = _c; break; + char * + escape_string(char *s) { + char *ss = (char*)MALLOC((strlen(s) + 1) * 4), *sss = ss; + for (; *s; s++) { + switch (*s) { + case '\b': ESC('b'); + case '\f': ESC('f'); + case '\n': ESC('n'); + case '\r': ESC('r'); + case '\t': ESC('t'); + case '\v': ESC('v'); + case '\a': ESC('a'); + case '\\': + case '\"': + *ss++ = '\\'; + *ss++ = *s; break; + + default: + if (isprint(*s)) { + *ss++ = *s; + } else { + *ss++ = '\\'; + *ss++ = 'x'; + *ss++ = tohex2(*s); + *ss++ = tohex1(*s); + } + break; + } + } + *ss = 0; + return sss; + } + + void d_free(void *x) { FREE(x); } Index: llvm/test/Programs/MultiSource/Applications/d/util.h diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/util.h:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/util.h Thu Jan 1 10:50:36 2004 *************** *** 0 **** --- 1,127 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + + #define INITIAL_SET_SIZE_INDEX 2 + + #define INITIAL_VEC_SHIFT 3 + #define INITIAL_VEC_SIZE (1 << INITIAL_VEC_SHIFT) + #define INITIAL_VEC_SIZE (1 << INITIAL_VEC_SHIFT) + #define INTEGRAL_VEC_SIZE 3 + #define INTEGRAL_STACK_SIZE 8 + #define TRICK_VEC_SIZE (INITIAL_VEC_SIZE - INTEGRAL_VEC_ELEMENTS) + + #define SET_MAX_SEQUENTIAL 5 + + #define IS_BIT_SET(_v, _s) ((_v)[(_s) / 8] & 1 << ((_s) % 8)) + #define SET_BIT(_v, _s) (_v)[(_s) / 8] |= (1 << ((_s) %8)) + + typedef struct AbstractVec { + uint n; + uint i; /* size index for use with sets */ + void **v; + void *e[INTEGRAL_VEC_SIZE]; + } AbstractVec; + #define Vec(_x) struct { \ + uint n; \ + uint i; \ + _x *v; \ + _x e[INTEGRAL_VEC_SIZE]; \ + } + + typedef struct AbstractStack { + void **start; + void **end; + void **cur; + void *initial[INTEGRAL_STACK_SIZE]; + } AbstractStack; + #define Stack(_x) struct { \ + _x *start; _x *end; _x *cur; _x initial[INTEGRAL_STACK_SIZE]; \ + } + + #define vec_move(_a, _b) do { \ + (_a)->n = (_b)->n; \ + if ((_b)->v == (_b)->e) { \ + memcpy(&(_a)->e[0], &(_b)->e[0], sizeof((_a)->e)); \ + (_a)->v = (_a)->e; \ + } else (_a)->v = (_b)->v; \ + vec_clear(_b); \ + } while (0) + + struct hash_fns_t; + typedef uint32 (*hash_fn_t)(void *, struct hash_fns_t*); + typedef int (*cmp_fn_t)(void *, void *, struct hash_fns_t*); + typedef struct hash_fns_t { + hash_fn_t hash_fn; + cmp_fn_t cmp_fn; + void *data[2]; + } hash_fns_t; + + #define vec_add(_v, _i) do { \ + if (!(_v)->v) { \ + ((_v)->v = (_v)->e)[(_v)->n++] = (_i); \ + break; \ + } else if ((_v)->v == ((_v)->e)) { \ + if (((_v)->n < INTEGRAL_VEC_SIZE)) { \ + (_v)->v[(_v)->n++] = (_i); \ + break; \ + } \ + } else if ((_v)->n & (INITIAL_VEC_SIZE - 1)) { \ + (_v)->v[(_v)->n++] = (_i); \ + break; \ + } \ + vec_add_internal((_v), _i); \ + } while (0) + void vec_add_internal(void *v, void *elem); + int vec_eq(void *v, void *vv); + int set_add(void *v, void *t); + int set_union(void *v, void *vv); + void *set_add_fn(void *v, void *t, hash_fns_t *fns); + void set_union_fn(void *v, void *vv, hash_fns_t *fns); + void set_to_vec(void *av); + #define vec_clear(_v) do { (_v)->n = 0; (_v)->v = 0; } while(0) + #define vec_free(_v) do { \ + if ((_v)->v && (_v)->v != (_v)->e) FREE((_v)->v); vec_clear(_v); } while(0) + + #define stack_clear(_s) do { \ + (_s)->start = (_s)->cur = (_s)->end = (_s)->initial; \ + (_s)->end += INTEGRAL_STACK_SIZE; \ + } \ + while(0) + #define stack_free(_s) do { \ + if ((_s)->start != (_s)->initial) FREE((_s)->start); \ + stack_clear(_s); \ + } while(0) + #define stack_head(_s) ((_s)->cur[-1]) + #define is_stack_empty(_s) ((_s)->cur == (_s)->start) + #define stack_empty(_s) ((_s)->cur = (_s)->start) + #define stack_depth(_s) ((_s)->cur - (_s)->start) + #define stack_pop(_s) (*--((_s)->cur)) + #define stack_push(_s, _x) ((_s)->cur == (_s)->end ? \ + stack_push_internal((AbstractStack*)((_s)), (void*)_x) : \ + (void*)(*((_s)->cur)++ = (_x))) + void * stack_push_internal(AbstractStack*, void*); + + int buf_read(char *pathname, char **buf, int *len); + char *sbuf_read(char *pathname); + + #define STREQ(_x,_n,_s) \ + ((_n == sizeof(_s)-1) && !strncasecmp(_x,_s,sizeof(_s)-1)) + + void d_fail(char *str, ...); + char *dup_str(char *str, char *end); + uint strhashl(char *s, int len); + void d_free(void *); + + void int_list_diff(int *a, int *b, int *c); + void int_list_intersect(int *a, int *b, int *c); + int *int_list_dup(int *aa); + + char *escape_string(char *s); + + extern uint prime2[]; + extern int verbose_level; + extern int debug_level; + extern int test_level; + + Index: llvm/test/Programs/MultiSource/Applications/d/version.c diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/version.c:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/version.c Thu Jan 1 10:50:36 2004 *************** *** 0 **** --- 1,12 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + #include "d.h" + + void + d_version(char *v) { + v += sprintf(v, "%d.%d", D_MAJOR_VERSION, D_MINOR_VERSION); + if (D_BUILD_VERSION) + v += sprintf(v, ".%d", D_BUILD_VERSION); + } + Index: llvm/test/Programs/MultiSource/Applications/d/write_ctables.c diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/write_ctables.c:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/write_ctables.c Thu Jan 1 10:50:36 2004 *************** *** 0 **** --- 1,1106 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + #include "d.h" + + typedef struct ScannerBlock { + int state_index; + int scanner_index; + int block_index; + ScanState **chars; + ScanStateTransition **transitions; + } ScannerBlock; + typedef Vec(ScannerBlock*) VecScannerBlock; + typedef Vec(State *) VecState; + + static int + scanner_size(State *s) { + if (s->scanner.states.n < 255 && s->scanner.transitions.n < 255) + return 1; + if (s->scanner.states.n < 32384 && s->scanner.transitions.n < 32384) + return 2; + return 4; + } + + static char * + make_type(int i) { + switch (i) { + case 1: return "unsigned char"; + case 2: return "unsigned short"; + case 4: return "unsigned int"; + default: d_fail("bad case"); return ""; + } + } + + static char * + scanner_type(State *s) { + return make_type(scanner_size(s)); + } + + static char * + make_u_type(int i) { + switch (i) { + case 1: return "uint8"; + case 2: return "uint16"; + case 4: return "uint32"; + default: d_fail("bad case"); return ""; + } + } + + static char * + scanner_u_type(State *s) { + return make_u_type(scanner_size(s)); + } + + static uint32 + scanner_block_hash_fn(ScannerBlock *b, hash_fns_t *fns) { + uint32 hash = 0; + int i, block_size = (int)fns->data[0]; + ScanState **sb = b->chars; + + for (i = 0; i < block_size; i++) { + hash *= 17; + hash += sb[i] ? sb[i]->index + 2 : 1; + } + return hash; + } + + static int + scanner_block_cmp_fn(ScannerBlock *a, ScannerBlock *b, hash_fns_t *fns) { + int i, block_size = (int)fns->data[0]; + ScanState **sa = a->chars; + ScanState **sb = b->chars; + + for (i = 0; i < block_size; i++) { + if (sa[i] == sb[i]) + continue; + if (!sa[i] || !sb[i]) + return 1; + if (sa[i]->index != sb[i]->index) + return 1; + } + return 0; + } + + hash_fns_t + scanner_block_fns = { + (hash_fn_t)scanner_block_hash_fn, + (cmp_fn_t)scanner_block_cmp_fn, + {0, 0} + }; + + static uint32 + trans_scanner_block_hash_fn(ScannerBlock *b, hash_fns_t *fns) { + uint32 hash = 0; + int i, block_size = (int)fns->data[0]; + ScanStateTransition **sb = b->transitions; + + for (i = 0; i < block_size; i++) { + hash *= 3; + hash += sb[i] ? sb[i]->index + 1 : 0; + } + return hash; + } + + static int + trans_scanner_block_cmp_fn(ScannerBlock *a, ScannerBlock *b, hash_fns_t *fns) { + int i, block_size = (int)fns->data[0]; + ScanStateTransition **sa = a->transitions; + ScanStateTransition **sb = b->transitions; + + for (i = 0; i < block_size; i++) { + if (sa[i] == sb[i]) + continue; + if (!sa[i] || !sb[i]) + return 1; + if (sa[i]->index != sb[i]->index) + return 1; + } + return 0; + } + + hash_fns_t + trans_scanner_block_fns = { + (hash_fn_t)trans_scanner_block_hash_fn, + (cmp_fn_t)trans_scanner_block_cmp_fn, + {0, 0} + }; + + static uint32 + shift_hash_fn(Action *sa, hash_fns_t *fns) { + return sa->term->index; + } + + static int + shift_cmp_fn(Action *sa, Action *sb, hash_fns_t *fns) { + return sa->term->index != sb->term->index; + } + + hash_fns_t + shift_fns = { + (hash_fn_t)shift_hash_fn, + (cmp_fn_t)shift_cmp_fn, + {0, 0} + }; + + static void + write_scanner_data_as_C(FILE *fp, Grammar *g, char *tag) { + State *s; + ScannerBlock *vsblock, *xv, *yv; + VecScannerBlock scanner_block_hash[4], *pscanner_block_hash; + VecScannerBlock trans_scanner_block_hash[4], *ptrans_scanner_block_hash; + VecAction shift_hash; + int nvsblocks, ivsblock, i, j, k, x, xx; + Action *a; + VecScanState *ss; + char speculative_code[256]; + Term *t; + + /* shift_actions */ + for (i = 0; i < g->terminals.n; i++) { + t = g->terminals.v[i]; + if (t->regex_production && t->regex_production->rules.v[0]->speculative_code.code) + sprintf(speculative_code, "d_speculative_reduction_code_%d_%d_%s", + t->regex_production->index, t->regex_production->rules.v[0]->index, tag); + else + strcpy(speculative_code, "NULL"); + fprintf(fp, + "D_Shift d_shift_%d_%s = { %d, %d, %d, %d, %d, %s };\n", + i, tag, + g->terminals.v[i]->index + g->productions.n, + g->terminals.v[i]->scan_kind, + g->terminals.v[i]->op_assoc, + g->terminals.v[i]->op_priority, + g->terminals.v[i]->term_priority, + speculative_code); + } + fprintf(fp,"\n"); + /* scanners */ + nvsblocks = 0; + for (i = 0; i < g->states.n; i++) + nvsblocks += g->states.v[i]->scanner.states.n * g->scanner_blocks; + vsblock = MALLOC((nvsblocks ? nvsblocks : 1) * sizeof(ScannerBlock)); + for (i = 0; i < 4; i++) { + vec_clear(&scanner_block_hash[i]); + vec_clear(&trans_scanner_block_hash[i]); + } + scanner_block_fns.data[0] = (void*)g->scanner_block_size; + scanner_block_fns.data[1] = (void*)g; + trans_scanner_block_fns.data[0] = (void*)g->scanner_block_size; + trans_scanner_block_fns.data[1] = (void*)g; + /* shift */ + vec_clear(&shift_hash); + ivsblock = 0; + for (i = 0; i < g->states.n; i++) { + s = g->states.v[i]; + ss = &s->scanner.states; + /* build shifts */ + if (s->shift_actions.n && !s->same_shifts) { + fprintf(fp, "D_Shift *d_shifts_%d_%s[] = {\n", i, tag); + for (j = 0; j < s->shift_actions.n; j++) { + a = s->shift_actions.v[j]; + fprintf(fp, "&d_shift_%d_%s%s", a->term->index, tag, + j == s->shift_actions.n - 1 ? ", NULL" : ", "); + } + fprintf(fp, "};\n\n"); + } + /* build accepts differences */ + for (j = 0; j < s->scanner.transitions.n; j++) { + VecAction *va = &s->scanner.transitions.v[j]->accepts_diff; + fprintf(fp, "D_Shift *d_accepts_diff_%d_%d_%s[] = {", + i, j, tag); + for (k = 0; k < va->n; k++) + fprintf(fp, "&d_shift_%d_%s,", va->v[k]->term->index, tag); + fprintf(fp, "0};\n"); + } + if (s->scanner.transitions.n) { + fprintf(fp, "D_Shift **d_accepts_diff_%d_%s[] = {\n", i, tag); + for (j = 0; j < s->scanner.transitions.n; j++) { + fprintf(fp, "d_accepts_diff_%d_%d_%s%s", + i, j, tag, j == s->scanner.transitions.n - 1 ? "\n" : ",\n"); + } + fprintf(fp, "};\n\n"); + } + /* build scanner_block_hash */ + pscanner_block_hash = &scanner_block_hash[scanner_size(s)-1]; + ptrans_scanner_block_hash = &trans_scanner_block_hash[scanner_size(s)-1]; + for (j = 0; j < ss->n; j++) { + if (!s->same_shifts) { + for (k = 0; k < g->scanner_blocks; k++) { + vsblock[ivsblock].state_index = s->index; + vsblock[ivsblock].scanner_index = j; + vsblock[ivsblock].block_index = k; + vsblock[ivsblock].chars = + (void*)&ss->v[j]->chars[k * g->scanner_block_size]; + vsblock[ivsblock].transitions = + (void*)&ss->v[j]->transition[k * g->scanner_block_size]; + xv = &vsblock[ivsblock]; + ivsblock++; + assert(ivsblock <= nvsblocks); + /* output state scanner blocks */ + yv = set_add_fn(pscanner_block_hash, xv, &scanner_block_fns); + if (xv == yv) { + fprintf(fp, + "%s d_scanner_%d_%d_%d_%s[SCANNER_BLOCK_SIZE] = {\n", + scanner_type(s), i, j, k, tag); + for (x = 0; x < g->scanner_block_size; x++) { + xx = x + k * g->scanner_block_size; + fprintf(fp, "%d", ss->v[j]->chars[xx] ? + ss->v[j]->chars[xx]->index + 1 : 0); + if (x != g->scanner_block_size) fprintf(fp, ","); + if (x % 16 == 15) fprintf(fp, "\n"); + } + fprintf(fp, "};\n\n"); + } + if (s->scan_kind != D_SCAN_LONGEST) { + /* output accept_diff scanner blocks */ + yv = set_add_fn(ptrans_scanner_block_hash, xv, + &trans_scanner_block_fns); + if (xv == yv) { + fprintf(fp, + "%s d_accepts_diff_%d_%d_%d_%s[SCANNER_BLOCK_SIZE] = {\n", + scanner_type(s), i, j, k, tag); + for (x = 0; x < g->scanner_block_size; x++) { + xx = x + k * g->scanner_block_size; + fprintf(fp, "%d", ss->v[j]->transition[xx]->index); + if (x != g->scanner_block_size) fprintf(fp, ","); + if (x % 16 == 15) fprintf(fp, "\n"); + } + fprintf(fp, "};\n\n"); + } + } + } + /* output shifts */ + if (ss->v[j]->accepts.n) { + for (k = 0; k < ss->v[j]->accepts.n; k++) { + Action *a = ss->v[j]->accepts.v[k], *aa; + char tmp[256]; + sprintf(tmp, "d_shift_%d_%d_%s", i, j, tag); + if (ss->v[j]->accepts.n == 1) { + a->temp_string = strdup(tmp); + aa = set_add_fn(&shift_hash, a, &shift_fns); + if (aa != a) + continue; + } + /* output shifts */ + if (!k) + fprintf(fp, "D_Shift *%s[] = { ", tmp); + fprintf(fp, "&d_shift_%d_%s%s", + a->term->index, tag, k == ss->v[j]->accepts.n - 1 ? + ", NULL};\n\n" : ", "); + } + } + } + } + } + for (i = 0; i < g->states.n; i++) { + s = g->states.v[i]; + ss = &s->scanner.states; + ivsblock = 0; + if (ss->n && !s->same_shifts) { + /* output scanner state transition tables */ + fprintf(fp, "SB_%s d_scanner_%d_%s[%d] = {\n", + scanner_u_type(s), i, tag, ss->n); + pscanner_block_hash = &scanner_block_hash[scanner_size(s)-1]; + for (j = 0; j < ss->n; j++) { + Action *a; + if (ss->v[j]->accepts.n) { + a = ss->v[j]->accepts.v[0]; + if (ss->v[j]->accepts.n == 1) { + a = set_add_fn(&shift_hash, a, &shift_fns); + fprintf(fp, "{ %s, {", a->temp_string); + } else + fprintf(fp, "{ d_shift_%d_%d_%s, {", i, j, tag); + } else + fprintf(fp, "{ NULL, {"); + for (k = 0; k < g->scanner_blocks; k++) { + ScannerBlock vs; + vs.state_index = s->index; + vs.scanner_index = j; + vs.block_index = k; + vs.chars = (void*)&ss->v[j]->chars[k * g->scanner_block_size]; + vs.transitions = + (void*)&ss->v[j]->transition[k * g->scanner_block_size]; + xv = &vs; + yv = set_add_fn(pscanner_block_hash, xv, &scanner_block_fns); + assert(yv != xv); + fprintf(fp, "d_scanner_%d_%d_%d_%s", + yv->state_index, yv->scanner_index, + yv->block_index, tag); + if (k != g->scanner_blocks-1) { + fprintf(fp, ", "); + if ((k % 2) == 1) fprintf(fp,"\n "); + } + } + if (j != ss->n-1) + fprintf(fp, "}},\n"); + else + fprintf(fp, "}}\n"); + } + fprintf(fp, "};\n\n"); + if (s->scan_kind != D_SCAN_LONGEST) { + /* output scanner accepts diffs tables */ + fprintf(fp, "SB_trans_%s d_transition_%d_%s[%d] = {\n", + scanner_u_type(s), i, tag, ss->n); + ptrans_scanner_block_hash = + &trans_scanner_block_hash[scanner_size(s)-1]; + for (j = 0; j < ss->n; j++) { + fprintf(fp, "{{ "); + for (k = 0; k < g->scanner_blocks; k++) { + ScannerBlock vs; + vs.state_index = s->index; + vs.scanner_index = j; + vs.block_index = k; + vs.chars = (void*)&ss->v[j]->chars[k * g->scanner_block_size]; + vs.transitions = + (void*)&ss->v[j]->transition[k * g->scanner_block_size]; + xv = &vs; + yv = set_add_fn(ptrans_scanner_block_hash, xv, + &trans_scanner_block_fns); + assert(yv != xv); + fprintf(fp, "d_accepts_diff_%d_%d_%d_%s", + yv->state_index, yv->scanner_index, + yv->block_index, tag); + if (k != g->scanner_blocks-1) { + fprintf(fp, ", "); + if ((k % 2) == 1) fprintf(fp,"\n "); + } + } + if (j != ss->n-1) + fprintf(fp, "}},\n"); + else + fprintf(fp, "}}\n"); + } + fprintf(fp, "};\n\n"); + } + } + } + for (i = 0; i < 4; i++) + vec_free(&scanner_block_hash[i]); + FREE(vsblock); + } + + #define reduction_index(_r) \ + ((_r)->same_reduction ? (_r)->same_reduction->index : (_r)->index) + + static void + write_goto_data_as_C(FILE *fp, Grammar *g, char *tag) { + Vec(int) vgoto; + State *s; + uint8 *goto_valid = NULL; + int i, j, x, again, lowest, nvalid_bytes, sym, lowest_sym; + + nvalid_bytes = ((g->productions.n + g->terminals.n) + 7) / 8; + goto_valid = MALLOC(nvalid_bytes); + vec_clear(&vgoto); + for (i = 0; i < g->states.n; i++) { + s = g->states.v[i]; + if (s->gotos.n) { + /* check for goto on token */ + for (j = 0; j < s->gotos.n; j++) + if (s->gotos.v[j]->elem->kind == ELEM_TERM && + s->gotos.v[j]->elem->e.term->kind == TERM_TOKEN) + s->goto_on_token = 1; + /* find lowest goto, set valid bits */ + memset(goto_valid, 0, nvalid_bytes); + lowest = 0; + lowest_sym = elem_symbol(g, s->gotos.v[0]->elem); + SET_BIT(goto_valid, lowest_sym); + for (j = 1; j < s->gotos.n; j++) { + sym = elem_symbol(g, s->gotos.v[j]->elem); + SET_BIT(goto_valid, sym); + if (sym < lowest_sym) { + lowest = j; + lowest_sym = sym; + } + } + /* insert into vgoto */ + again = 1; + while (again) { + again = 0; + for (j = 0; j < s->gotos.n; j++) { + x = elem_symbol(g, s->gotos.v[j]->elem); + x -= lowest_sym; + while (vgoto.n <= x) + vec_add(&vgoto, 0); + if (vgoto.v[x]) { + again = 1; + /* undo the damage */ + for (--j;j >= 0;j--) { + x = elem_symbol(g, s->gotos.v[j]->elem); + x -= lowest_sym; + vgoto.v[x] = 0; + } + lowest_sym--; + break; + } else + vgoto.v[x] = s->gotos.v[j]->state->index + 1; + } + } + s->goto_table_offset = lowest_sym; + /* valid bits */ + fprintf(fp, "unsigned char d_goto_valid_%d_%s[] = {\n", i, tag); + for (j = 0; j < nvalid_bytes; j++) + fprintf(fp, "0x%x%s", goto_valid[j], + j == nvalid_bytes - 1 ? "" : ", "); + fprintf(fp, "};\n"); + } else + s->goto_table_offset = -INT_MAX; + /* reduce_actions */ + if (s->reduce_actions.n) { + fprintf(fp, "D_Reduction *d_reductions_%d_%s[] = {", i, tag); + for (j = 0; j < s->reduce_actions.n; j++) + fprintf(fp, "&d_reduction_%d_%s%s", + reduction_index(s->reduce_actions.v[j]->rule), tag, + j == s->reduce_actions.n - 1 ? "" : ", "); + fprintf(fp, "};\n"); + } + /* modified_reduce_actions */ + if (s->right_epsilon_hints.n) { + fprintf(fp, "D_RightEpsilonHint d_right_epsilon_hints_%d_%s[] = {", + i, tag); + for (j = 0; j < s->right_epsilon_hints.n; j++) { + fprintf(fp, "{ %d, %d, &d_reduction_%d_%s}%s", + s->right_epsilon_hints.v[j]->depth, + s->right_epsilon_hints.v[j]->state->index, + reduction_index(s->right_epsilon_hints.v[j]->rule), tag, + j == s->right_epsilon_hints.n - 1 ? "" : ", "); + } + fprintf(fp, "};\n"); + } + } + /* gotos */ + if (vgoto.n) { + fprintf(fp, "unsigned short d_gotos_%s[%d] = {\n", tag, vgoto.n); + for (j = 0; j < vgoto.n; j++) { + fprintf(fp, "%d", vgoto.v[j]); + if (j != vgoto.n - 1) fprintf(fp, ","); + if (j % 16 == 15) fprintf(fp, "\n"); + } + fprintf(fp, "};\n\n"); + } else + fprintf(fp, "unsigned short d_gotos_%s[1] = {0};\n", tag); + } + + static void + write_scanner_code_as_C(FILE *fp, Grammar *g, char *tag) { + int i, j, l; + Action *a; + State *s; + + for (i = 0; i < g->states.n; i++) { + s = g->states.v[i]; + for (j = 0; j < s->shift_actions.n; j++) { + a = s->shift_actions.v[j]; + if (a->kind == ACTION_SHIFT && a->term->kind == TERM_CODE) { + if (!s->scanner_code) { + s->scanner_code = 1; + fprintf(fp, "int d_scan_code_%d_%s(char **as, int *col, int *line," + "unsigned short *symbol, int *term_priority," + "unsigned char *op_assoc, int *op_priority) {\n" + " int res;\n", + i, tag); + } + fprintf(fp, " if ((res = "); + l = strlen(a->term->string); + if (a->term->string[l - 1] == ')') { + fwrite(a->term->string, l - 1, 1, fp); + fprintf(fp, ", "); + } else + fprintf(fp, "%s(", a->term->string); + fprintf(fp, "as, col, line, op_assoc, op_priority))) {\n" + " *symbol = %d;\n" + " *term_priority = %d;\n" + " return res;\n" + " }\n", + a->term->index + g->productions.n, + a->term->term_priority); + } + } + if (s->scanner_code) + fprintf(fp, " return 0;\n}\n\n"); + } + } + + static int + find_symbol(Grammar *g, char *s, char *e, int kind) { + while (*s && isspace(*s)) s++; + if (e > s) { + if (kind == D_SYMBOL_NTERM) { + Production *p; + if ((p = lookup_production(g, s, e-s))) + return p->index; + } else if (kind == D_SYMBOL_STRING) { + int i; + int found = -1; + for (i = 0; i < g->terminals.n;i++) + if (g->terminals.v[i]->kind == TERM_STRING && + g->terminals.v[i]->string_len == (e-s) && + !strncmp(s, g->terminals.v[i]->string, e-s)) { + if (found > 0) { + d_fail("attempt to find symbol for non-unique string '%s'\n", + g->terminals.v[i]->string); + } else + found = i; + } + if (found > 0) + return found + g->productions.n; + } + } + return -1; + } + + static void + write_code_as_C(FILE *fp, Grammar *g, Rule *r, char *code, + int line, char *pathname) + { + char *c; + + fprintf(fp, "{\n"); + if (g->write_line_directives) + fprintf(fp, "#line %d \"%s\"\n", line, pathname); + c = code; + while (*c) { + if (*c == '$') { + c++; + if (*c == '#') { + fprintf(fp, "(_n_children)"); + c++; + } else if (*c == 'g') { + fprintf(fp, "(D_PN(_ps, _offset)->globals)"); + c++; + } else if (*c == 'n') { + ++c; + if (isdigit(*c)) { + int n = atoi(c); + fprintf(fp, "(*(D_PN(_children[%d], _offset)))", n); + if (n > r->elems.n-1) + d_fail("$nXXXX greater than number of children at line %d", line); + while (isdigit(*c)) c++; + } else + fprintf(fp, "(*(D_PN(_ps, _offset)))"); + } else if (*c == '$') { + fprintf(fp, "(D_PN(_ps, _offset)->user)"); + c++; + } else if (isdigit(*c)) { + int n = atoi(c); + fprintf(fp, "(D_PN(_children[%d], _offset)->user)", n); + while (isdigit(*c)) c++; + } else if (*c == '{') { + char *e = ++c, *a; + while (*e && *e != '}' && !isspace(*e)) e++; + a = e; + if (isspace(*a)) a++; + while (*a && *a != '}') a++; + if (STREQ(c, e-c, "reject")) { + fprintf(fp, " return -1 "); + } else if (STREQ(c, e-c, "free_below")) { + fprintf(fp, " free_D_ParseTreeBelow(_parser, (D_PN(_ps, _offset)))"); + } else if (STREQ(c, e-c, "scope")) { + fprintf(fp, "(D_PN(_ps, _offset)->scope)"); + } else if (STREQ(c, e-c, "parser")) { + fprintf(fp, "_parser"); + } else if (STREQ(c, e-c, "nterm")) { + fprintf(fp, "%d", find_symbol(g, e, a, D_SYMBOL_NTERM)); + } else if (STREQ(c, e-c, "string")) { + fprintf(fp, "%d", find_symbol(g, e, a, D_SYMBOL_STRING)); + } else if (STREQ(c, e-c, "pass")) { + D_Pass *p = find_pass(g, e, a); + if (!p) + d_fail("unknown pass '%s' line %d", dup_str(e, a), line); + fprintf(fp, "%d", p->index); + } else + d_fail("bad $ escape in code line %u\n", line); + c = a + 1; + } else + d_fail("bad $ escape in code line %u\n", line); + } else { + fputc(*c, fp); + c++; + } + } + fprintf(fp, " return 0;"); + fprintf(fp, "}\n\n"); + } + + static void + write_global_code_as_C(FILE *fp, Grammar *g, char *tag) { + int i; + char *c; + + for (i = 0; i < g->ncode; i++) { + if (g->write_line_directives) + fprintf(fp, "#line %d \"%s\"\n", g->code[i].line, g->pathname); + c = g->code[i].code; + while (*c) { + if (*c == '$') { + c++; + if (*c == '{') { + char *e = ++c, *a; + while (*e && *e != '}' && !isspace(*e)) ++e; + a = e; + if (isspace(*a)) ++a; + while (*a && *a != '}') a++; + if (STREQ(c, e-c, "nterm")) { + fprintf(fp, "%d", find_symbol(g, e, a, D_SYMBOL_NTERM)); + } else if (STREQ(c, e-c, "string")) { + fprintf(fp, "%d", find_symbol(g, e, a, D_SYMBOL_STRING)); + } else + d_fail("bad $ escape in code line %u\n", g->code[i].line + i); + c = a + 1; + } + else + d_fail("bad $ escape in code line %u\n", g->code[i].line + i); + } else { + fputc(*c, fp); + c++; + } + } + fprintf(fp, "\n"); + } + } + + static char * reduction_args = "(void *_ps, void **_children, int _n_children, int _offset, D_Parser *_parser)"; + + static void + write_reductions_as_C(FILE *fp, Grammar *g, char *tag) { + int i, j, k, l, pmax; + Production *p, *pdefault; + Rule *r, *rdefault = NULL; + char final_code[256], speculative_code[256], pass_code[256]; + + pdefault = lookup_production(g, "_", 1); + if (pdefault) { + rdefault = pdefault->rules.v[0]; + fprintf(fp, "int d_speculative_reduction_code_%d_%d_%s%s;\n", + rdefault->prod->index, rdefault->index, tag, reduction_args); + fprintf(fp, "int d_final_reduction_code_%d_%d_%s%s;\n", + rdefault->prod->index, rdefault->index, tag, reduction_args); + fprintf(fp, "extern D_ReductionCode d_pass_code_%d_%d_%s[];\n", + rdefault->prod->index, rdefault->index, tag); + for (i = 0; i < rdefault->pass_code.n; i++) + fprintf(fp, "int d_pass_code_%d_%d_%d_%s%s;\n", + i, rdefault->prod->index, rdefault->index, tag, reduction_args); + } + for (i = 0; i < g->productions.n; i++) { + p = g->productions.v[i]; + for (j = p->rules.n - 1; j >= 0; j--) { + r = p->rules.v[j]; + for (k = 0; k < j; k++) + if (r->elems.n == p->rules.v[k]->elems.n && + r->speculative_code.code == p->rules.v[k]->speculative_code.code && + r->final_code.code == p->rules.v[k]->final_code.code && + r->op_priority == p->rules.v[k]->op_priority && + r->op_assoc == p->rules.v[k]->op_assoc && + r->rule_priority == p->rules.v[k]->rule_priority && + r->rule_assoc == p->rules.v[k]->rule_assoc && + r->action_index == p->rules.v[k]->action_index) + { + if (r->pass_code.n != p->rules.v[k]->pass_code.n) + continue; + for (l = 0; l < r->pass_code.n; l++) { + if (!r->pass_code.v[l] && !p->rules.v[k]->pass_code.v[l]) + continue; + if (!r->pass_code.v[l] || !p->rules.v[k]->pass_code.v[l]) + goto Lcontinue; + if (r->pass_code.v[l]->code != p->rules.v[k]->pass_code.v[l]->code) + goto Lcontinue; + } + r->same_reduction = p->rules.v[k]; + break; + Lcontinue:; + } + } + for (j = 0; j < p->rules.n; j++) { + r = p->rules.v[j]; + if (r->same_reduction) + continue; + if (r->speculative_code.code) { + fprintf(fp, "int d_speculative_reduction_code_%d_%d_%s%s ", + r->prod->index, r->index, tag, reduction_args); + write_code_as_C(fp, g, r, r->speculative_code.code, r->speculative_code.line, g->pathname); + } + if (r->final_code.code) { + fprintf(fp, "int d_final_reduction_code_%d_%d_%s%s ", + r->prod->index, r->index, tag, reduction_args); + write_code_as_C(fp, g, r, r->final_code.code, r->final_code.line, g->pathname); + } + for (k = 0; k < r->pass_code.n; k++) { + if (r->pass_code.v[k]) { + fprintf(fp, "int d_pass_code_%d_%d_%d_%s%s ", + k, r->prod->index, r->index, tag, reduction_args); + write_code_as_C(fp, g, r, r->pass_code.v[k]->code, r->pass_code.v[k]->line, g->pathname); + } + } + if (r->speculative_code.code) + sprintf(speculative_code, "d_speculative_reduction_code_%d_%d_%s", + r->prod->index, r->index, tag); + else if (rdefault && rdefault->speculative_code.code) + sprintf(speculative_code, "d_speculative_reduction_code_%d_%d_%s", + rdefault->prod->index, rdefault->index, tag); + else + strcpy(speculative_code, "NULL"); + if (r->final_code.code) + sprintf(final_code, "d_final_reduction_code_%d_%d_%s", r->prod->index, r->index, tag); + else if (rdefault && rdefault->final_code.code) + sprintf(final_code, "d_final_reduction_code_%d_%d_%s", + rdefault->prod->index, rdefault->index, tag); + else + strcpy(final_code, "NULL"); + pmax = r->pass_code.n; + if (r->pass_code.n || (rdefault && rdefault->pass_code.n)) { + if (rdefault && rdefault->pass_code.n > pmax) + pmax = rdefault->pass_code.n; + if (!r->pass_code.n) + sprintf(pass_code, "d_pass_code_%d_%d_%s", + rdefault->prod->index, rdefault->index, tag); + else { + sprintf(pass_code, "d_pass_code_%d_%d_%s", + r->prod->index, r->index, tag); + fprintf(fp, "D_ReductionCode %s[] = {", pass_code); + for (k = 0; k < pmax; k++) { + if (r->pass_code.n > k && r->pass_code.v[k]) + fprintf(fp, "d_pass_code_%d_%d_%d_%s%s", k, r->prod->index, r->index, tag, + k < pmax-1 ? ", " : ""); + else + if (rdefault && rdefault->pass_code.n > k && rdefault->pass_code.v[k]) + fprintf(fp, "d_pass_code_%d_%d_%d_%s%s", k, rdefault->prod->index, + rdefault->index, tag, k < pmax-1 ? ", " : ""); + else + fprintf(fp, "NULL%s", k < pmax-1 ? ", " : ""); + } + fprintf(fp, "};\n\n"); + } + } else + strcpy(pass_code, "NULL"); + fprintf(fp, "D_Reduction d_reduction_%d_%s = ", r->index, tag); + fprintf(fp, "{%d, %d, %s, %s, %d, %d, %d, %d, %d, %d, %s};\n", + r->elems.n, r->prod->index, + speculative_code, final_code, + r->op_assoc, r->rule_assoc, + r->op_priority, r->rule_priority, + r->prod->internal ? -1 : r->action_index, + pmax, pass_code); + } + } + } + + static uint32 + er_hint_hash_fn(State *a, hash_fns_t *fns) { + VecHint *sa = &a->error_recovery_hints; + uint32 hash = 0, i; + Term *ta; + + for (i = 0; i < sa->n; i++) { + ta = sa->v[i]->rule->elems.v[sa->v[i]->rule->elems.n - 1]->e.term; + hash += (sa->v[i]->depth + 1) * 13; + hash += strhashl(ta->string, ta->string_len); + if (sa->v[i]->rule) + hash += sa->v[i]->rule->prod->index * 10007; + } + return hash; + } + + static int + er_hint_cmp_fn(State *a, State *b, hash_fns_t *fns) { + int i; + VecHint *sa = &a->error_recovery_hints, *sb = &b->error_recovery_hints; + Term *ta, *tb; + if (sa->n != sb->n) + return 1; + for (i = 0; i < sa->n; i++) { + ta = sa->v[i]->rule->elems.v[sa->v[i]->rule->elems.n - 1]->e.term; + tb = sb->v[i]->rule->elems.v[sb->v[i]->rule->elems.n - 1]->e.term; + if (sa->v[i]->depth != sb->v[i]->depth || + strcmp(ta->string, tb->string) || + sa->v[i]->rule->prod->index != sb->v[i]->rule->prod->index) + return 1; + } + return 0; + } + + hash_fns_t + er_hint_hash_fns = { + (hash_fn_t)er_hint_hash_fn, + (cmp_fn_t)er_hint_cmp_fn, + {0, 0} + }; + + static void + write_error_data_as_C(FILE *fp, Grammar *g, VecState *er_hash, char *tag) { + int i, j; + State *s; + Term *t; + State *h; + char *ss; + + if (g->states.n) { + for (i = 0; i < g->states.n; i++) { + s = g->states.v[i]; + if (s->error_recovery_hints.n) { + h = set_add_fn(er_hash, s, &er_hint_hash_fns); + if (h == s) { + fprintf(fp, + "D_ErrorRecoveryHint d_error_recovery_hints_%d_%s[] = {%s", + i, tag, s->error_recovery_hints.n > 1 ? "\n" : ""); + for (j = 0; j < s->error_recovery_hints.n; j++) { + t = s->error_recovery_hints.v[j]->rule->elems.v[ + s->error_recovery_hints.v[j]->rule->elems.n - 1]->e.term; + ss = escape_string(t->string); + fprintf(fp, "{ %d, %d, \"%s\"}%s", + s->error_recovery_hints.v[j]->depth, + s->error_recovery_hints.v[j]->rule->prod->index, + ss, + j == s->error_recovery_hints.n - 1 ? "" : ",\n"); + FREE(ss); + } + fprintf(fp, "};\n"); + } + } + } + } + } + + static char *scan_kind_strings[] = {"D_SCAN_ALL", "D_SCAN_LONGEST", "D_SCAN_MIXED", NULL}; + + static void + write_state_data_as_C(FILE *fp, Grammar *g, VecState *er_hash, char *tag) { + int i; + State *s, *h; + + fprintf(fp, "\nD_State d_states_%s[] = ", tag); + if (g->states.n) { + fprintf(fp, "{\n"); + for (i = 0; i < g->states.n; i++) { + s = g->states.v[i]; + fprintf(fp, "{ "); + if (s->gotos.n) + fprintf(fp,"d_goto_valid_%d_%s, ", i, tag); + else + fprintf(fp,"NULL, "); + fprintf(fp,"%d, ", s->goto_table_offset); + if (s->reduce_actions.n) + fprintf(fp, "{ %d, d_reductions_%d_%s}, ", s->reduce_actions.n, + i, tag); + else + fprintf(fp, "{ 0, NULL}, "); + if (s->right_epsilon_hints.n) + fprintf(fp, "{ %d, d_right_epsilon_hints_%d_%s}, ", + s->right_epsilon_hints.n, i, tag); + else + fprintf(fp, "{ 0, NULL}, "); + if (s->error_recovery_hints.n) { + h = set_add_fn(er_hash, s, &er_hint_hash_fns); + fprintf(fp, "{ %d, d_error_recovery_hints_%d_%s}, ", + s->error_recovery_hints.n, h->index, tag); + } else + fprintf(fp, "{ 0, NULL}, "); + if (s->shift_actions.n) + fprintf(fp, "d_shifts_%d_%s, ", + s->same_shifts ? s->same_shifts->index : i, tag); + else if (s->scanner_code || (g->scanner.code && s->goto_on_token)) + fprintf(fp, "D_SHIFTS_CODE, "); + else + fprintf(fp, "NULL, "); + if (g->scanner.code) { + if (s->goto_on_token) + fprintf(fp, "%s, ", g->scanner.code); + else + fprintf(fp, "NULL, "); + } else if (s->scanner_code) + fprintf(fp, "d_scan_code_%d_%s, ", i, tag); + else + fprintf(fp, "NULL, "); + if (s->scanner.states.n) + fprintf(fp, "(void*)d_scanner_%d_%s, ", + s->same_shifts ? s->same_shifts->index : i, tag); + else + fprintf(fp, "NULL, "); + fprintf(fp, "sizeof(%s), ", scanner_type(s)); + fprintf(fp, s->accept ? "1, " : "0, "); + fprintf(fp, "%s, ", scan_kind_strings[s->scan_kind]); + if (s->scan_kind != D_SCAN_LONGEST && s->scanner.states.n) + fprintf(fp, "(void*)d_transition_%d_%s, ", + s->same_shifts ? s->same_shifts->index : i, tag); + else + fprintf(fp, "NULL, "); + if (s->scan_kind != D_SCAN_LONGEST && s->scanner.states.n) + fprintf(fp, "d_accepts_diff_%d_%s, ", + s->same_shifts ? s->same_shifts->index : i, tag); + else + fprintf(fp, "(D_Shift***)NULL, "); + if (s->reduces_to) + fprintf(fp, "%d", s->reduces_to->index); + else + fprintf(fp, "-1"); + fprintf(fp, "}%s\n", i == g->states.n - 1 ? "" : ","); + } + fprintf(fp, "};\n\n"); + } else + fprintf(fp, "{{0, {0, NULL}, 0, NULL}};\n\n"); + } + + static int + write_header_as_C(Grammar *g, char *base_pathname, char *tag) { + char pathname[FILENAME_MAX]; + int i, tokens = 0, states = 0, col; + FILE *hfp; + + for (i = 0; i < g->terminals.n; i++) + if (g->terminals.v[i]->kind == TERM_TOKEN) + tokens = 1; + if (g->states_for_all_nterms) + states = 1; + else + for (i = 0; i < g->productions.n; i++) + if (state_for_declaration(g, i)) + states = 1; + if (g->write_header > 0 || (g->write_header < 0 && (tokens || states))) { + strcpy(pathname, base_pathname); + strcat(pathname, ".d_parser.h"); + hfp = fopen(pathname, "w"); + if (!hfp) + d_fail("unable to open `%s` for write\n", pathname); + fprintf(hfp, "#ifndef _%s_h\n", tag); + fprintf(hfp, "#define _%s_h\n", tag); + if (tokens) { + if (!g->token_type) { + for (i = 0; i < g->terminals.n; i++) + if (g->terminals.v[i]->kind == TERM_TOKEN) + fprintf(hfp, "#define %s \t%d\n", + g->terminals.v[i]->string, + g->terminals.v[i]->index + g->productions.n); + } else { + fprintf(hfp, "enum D_Tokens_%s {\n", tag); + col = 0; + for (i = 0; i < g->terminals.n; i++) { + if (g->terminals.v[i]->kind == TERM_TOKEN) { + col += g->terminals.v[i]->string_len + 7; + if (col > 70) { printf("\n"); col = 0; } + fprintf(hfp, "%s = %d%s", + g->terminals.v[i]->string, + g->terminals.v[i]->index + g->productions.n, + i == g->terminals.n-1 ? "" : ", "); + } + } + fprintf(hfp, "\n};\n"); + } + } + if (states) { + for (i = 0; i < g->productions.n; i++) + if (!g->productions.v[i]->internal && g->productions.v[i]->elem) + fprintf(hfp, "#define D_START_STATE_%s \t%d\n", + g->productions.v[i]->name, g->productions.v[i]->state->index); + } + fprintf(hfp, "#endif\n"); + fclose(hfp); + return 1; + } + return 0; + } + + static char *d_internal[] = {"D_SYMBOL_NTERM", "D_SYMBOL_INTERNAL"}; + static char *d_symbol[] = { + "D_SYMBOL_STRING", "D_SYMBOL_REGEX", "D_SYMBOL_CODE", "D_SYMBOL_TOKEN" }; + static void + write_symbol_data_as_C(FILE *fp, Grammar *g, char *tag) { + int i; + fprintf(fp, "D_Symbol d_symbols_%s[] = {\n", tag); + for (i = 0; i < g->productions.n; i++) + fprintf(fp, "{%s, \"%s\", %d},\n", + d_internal[g->productions.v[i]->internal ? 1 : 0], + g->productions.v[i]->name, + g->productions.v[i]->name_len); + for (i = 0; i < g->terminals.n; i++) { + char *s = escape_string(g->terminals.v[i]->string); /* so it is a string */ + char *ss = escape_string(s); /* so it is printable */ + fprintf(fp, "{%s, \"%s\", %d},\n", d_symbol[g->terminals.v[i]->kind], + ss, (int) strlen(ss)); + FREE(s); + FREE(ss); + } + fprintf(fp, "};\n\n"); + } + + static void + write_passes_as_C(FILE *fp, Grammar *g, char *tag) { + int i; + if (g->passes.n) { + fprintf(fp, "D_Pass d_passes_%s[] = {\n", tag); + for (i = 0; i < g->passes.n; i++) { + D_Pass *p = g->passes.v[i]; + fprintf(fp, "{\"%s\", %d, 0x%X, %d}%s\n", + p->name, p->name_len, p->kind, p->index, + i < g->passes.n-1 ? ", " : ""); + } + fprintf(fp, "};\n\n"); + } + } + + void + write_parser_tables_as_C(Grammar *g, char *base_pathname, char *tag) { + char pathname[FILENAME_MAX]; + FILE *fp; + int whitespace_production = 0, header; + VecState er_hash; + Production *p; + + vec_clear(&er_hash); + + strcpy(pathname, base_pathname); + strcat(pathname, ".d_parser.c"); + fp = fopen(pathname, "w"); + if (!fp) + d_fail("unable to open `%s` for write\n", pathname); + + header = write_header_as_C(g, base_pathname, tag); + + write_global_code_as_C(fp, g, tag); + fprintf(fp, "#include \"dparse.h\"\n"); + if (header) + fprintf(fp, "#include \"%s.d_parser.h\"\n", base_pathname); + fprintf(fp, "\n"); + + write_reductions_as_C(fp, g, tag); + write_scanner_data_as_C(fp, g, tag); + write_scanner_code_as_C(fp, g, tag); + write_goto_data_as_C(fp, g, tag); + write_error_data_as_C(fp, g, &er_hash, tag); + write_state_data_as_C(fp, g, &er_hash, tag); + write_symbol_data_as_C(fp, g, tag); + write_passes_as_C(fp, g, tag); + + if ((p = lookup_production(g, "whitespace", sizeof("whitespace")-1))) + whitespace_production = p->state->index; + + fprintf(fp, "D_ParserTables parser_tables_%s = {\n", tag); + fprintf(fp, "%d, ", g->states.n); + fprintf(fp, "d_states_%s, ", tag); + fprintf(fp, "d_gotos_%s, ", tag); + fprintf(fp, "%d, ", whitespace_production); + fprintf(fp, "%d, ", g->productions.n + g->terminals.n); + fprintf(fp, "d_symbols_%s, ", tag); + if (g->default_white_space) + fprintf(fp, "%s, ", g->default_white_space); + else + fprintf(fp, "NULL, "); + fprintf(fp, "%d, ", g->passes.n); + if (g->passes.n) + fprintf(fp, "d_passes_%s, ", tag); + else + fprintf(fp, "NULL, "); + if (g->save_parse_tree) + fprintf(fp, "1"); + else + fprintf(fp, "0"); + fprintf(fp, "};\n"); + fclose(fp); + } + + int + write_ctables(Grammar *g) { + g->scanner_block_size = 256/g->scanner_blocks; + write_parser_tables_as_C(g, g->pathname, + *g->grammar_ident ? g->grammar_ident : NULL); + return 0; + } Index: llvm/test/Programs/MultiSource/Applications/d/write_ctables.h diff -c /dev/null llvm/test/Programs/MultiSource/Applications/d/write_ctables.h:1.1 *** /dev/null Thu Jan 1 10:50:47 2004 --- llvm/test/Programs/MultiSource/Applications/d/write_ctables.h Thu Jan 1 10:50:36 2004 *************** *** 0 **** --- 1,5 ---- + /* + Copyright 2002-2003 John Plevyak, All Rights Reserved + */ + + int write_ctables(Grammar *g); From criswell at cs.uiuc.edu Thu Jan 1 11:15:01 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu Jan 1 11:15:01 2004 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Applications/Makefile Message-ID: <200401011714.LAA15190@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Applications: Makefile updated: 1.3 -> 1.4 --- Log message: Enable the D Parser generator test for Linux. I'll probably enable it for Sparc soon, but it hasn't finished testing yet. --- Diffs of the changes: (+6 -1) Index: llvm/test/Programs/MultiSource/Applications/Makefile diff -u llvm/test/Programs/MultiSource/Applications/Makefile:1.3 llvm/test/Programs/MultiSource/Applications/Makefile:1.4 --- llvm/test/Programs/MultiSource/Applications/Makefile:1.3 Mon Dec 29 11:40:20 2003 +++ llvm/test/Programs/MultiSource/Applications/Makefile Thu Jan 1 11:14:25 2004 @@ -2,6 +2,11 @@ LEVEL = ../../../.. -PARALLEL_DIRS := Burg aha sgefa siod lambda-0.1.3 +include $(LEVEL)/Makefile.config + +PARALLEL_DIRS = Burg aha sgefa siod lambda-0.1.3 +ifeq ($(OS),Linux) +PARALLEL_DIRS += d +endif include $(LEVEL)/test/Programs/Makefile.programs From criswell at cs.uiuc.edu Thu Jan 1 17:59:01 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu Jan 1 17:59:01 2004 Subject: [llvm-commits] CVS: llvm/test/Regression/CFrontend/2004-01-01-UnknownInitSize.c Message-ID: <200401012358.RAA31570@choi.cs.uiuc.edu> Changes in directory llvm/test/Regression/CFrontend: 2004-01-01-UnknownInitSize.c added (r1.1) --- Log message: Regression test for initializers with members of unknown size. --- Diffs of the changes: (+12 -0) Index: llvm/test/Regression/CFrontend/2004-01-01-UnknownInitSize.c diff -c /dev/null llvm/test/Regression/CFrontend/2004-01-01-UnknownInitSize.c:1.1 *** /dev/null Thu Jan 1 17:58:18 2004 --- llvm/test/Regression/CFrontend/2004-01-01-UnknownInitSize.c Thu Jan 1 17:58:07 2004 *************** *** 0 **** --- 1,12 ---- + /* + * This regression test ensures that the C front end can compile initializers + * even when it cannot determine the size (as below). + */ + struct one + { + int a; + int values []; + }; + + struct one hobbit = {5, {1, 2, 3}}; + From criswell at cs.uiuc.edu Thu Jan 1 19:52:01 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Thu Jan 1 19:52:01 2004 Subject: [llvm-commits] CVS: llvm/test/Programs/SingleSource/Regression/C/2004-01-01-UnknownInitSize.c Message-ID: <200401020151.TAA10592@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/SingleSource/Regression/C: 2004-01-01-UnknownInitSize.c added (r1.1) --- Log message: Regression test that verifies that initializers with unknown initial sizes are compiled correctly. Second test case of 2004! --- Diffs of the changes: (+25 -0) Index: llvm/test/Programs/SingleSource/Regression/C/2004-01-01-UnknownInitSize.c diff -c /dev/null llvm/test/Programs/SingleSource/Regression/C/2004-01-01-UnknownInitSize.c:1.1 *** /dev/null Thu Jan 1 19:51:40 2004 --- llvm/test/Programs/SingleSource/Regression/C/2004-01-01-UnknownInitSize.c Thu Jan 1 19:51:30 2004 *************** *** 0 **** --- 1,25 ---- + /* + * This regression test ensures that the C front end can compile initializers + * correctly when their size is not static. + */ + struct one + { + int a; + int values []; + }; + + struct one hobbit = {5, {1, 2, 3}}; + + int + main () + { + int index; + + for (index=0; index < 3; index++) + { + printf ("%d\n", hobbit.values[index]); + } + + return 0; + } + From lattner at cs.uiuc.edu Thu Jan 1 20:34:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Thu Jan 1 20:34:01 2004 Subject: [llvm-commits] CVS: llvm-www/CurrentWork.html www-index.html Message-ID: <200401020233.UAA11703@zion.cs.uiuc.edu> Changes in directory llvm-www: CurrentWork.html updated: 1.1 -> 1.2 www-index.html updated: 1.95 -> 1.96 --- Log message: Fix broken links that Valery pointed out to me. --- Diffs of the changes: (+2 -4) Index: llvm-www/CurrentWork.html diff -u llvm-www/CurrentWork.html:1.1 llvm-www/CurrentWork.html:1.2 --- llvm-www/CurrentWork.html:1.1 Tue Nov 18 17:04:53 2003 +++ llvm-www/CurrentWork.html Thu Jan 1 20:33:41 2004 @@ -70,9 +70,7 @@ at runtime, by exploiting the LLVM instruction set and compiler architecture in ways that would not be possible with ordinary static compilation. - Our tracing and optimization strategy are described - in the section titled - Current Development. + Our tracing and optimization strategy are described above. Index: llvm-www/www-index.html diff -u llvm-www/www-index.html:1.95 llvm-www/www-index.html:1.96 --- llvm-www/www-index.html:1.95 Mon Dec 22 17:14:04 2003 +++ llvm-www/www-index.html Thu Jan 1 20:33:41 2004 @@ -41,7 +41,7 @@ back-ends for the SPARC v9 and X86 architectures, a back-end which emits portable C code, and a Just-In-Time compiler for X86 and SPARC v9 processors. See "Current Projects" for + href="CurrentWork.html">Current Projects" for information about other components under development.

From criswell at cs.uiuc.edu Sun Jan 4 15:32:00 2004 From: criswell at cs.uiuc.edu (John Criswell) Date: Sun Jan 4 15:32:00 2004 Subject: [llvm-commits] CVS: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/input Message-ID: <200401042131.PAA18380@choi.cs.uiuc.edu> Changes in directory llvm/test/Programs/MultiSource/Applications/lambda-0.1.3: input updated: 1.1 -> 1.2 --- Log message: Added an extra operation to increase the running time. I think it's between 10-20 seconds now. --- Diffs of the changes: (+1 -0) Index: llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/input diff -u llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/input:1.1 llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/input:1.2 --- llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/input:1.1 Mon Dec 29 11:37:35 2003 +++ llvm/test/Programs/MultiSource/Applications/lambda-0.1.3/input Sun Jan 4 15:31:42 2004 @@ -29,5 +29,6 @@ GT 3 2 EQ 4 (ADD 2 2) EQ 5 (ADD 3 3) +(EQ (ADD (MUL 2 (DIV 6 (MUL 3 (SUB 8 2))))) (ADD (MUL 2 (DIV 6 (MUL 3 (SUB 8 2)))))) quit From alkis at cs.uiuc.edu Sun Jan 4 17:10:01 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Sun Jan 4 17:10:01 2004 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp Message-ID: <200401042309.RAA23741@kain.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: TwoAddressInstructionPass.cpp updated: 1.2 -> 1.3 --- Log message: Update description. --- Diffs of the changes: (+10 -5) Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.2 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.3 --- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.2 Thu Dec 18 16:40:23 2003 +++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp Sun Jan 4 17:09:24 2004 @@ -7,11 +7,16 @@ // //===----------------------------------------------------------------------===// // -// This file implements the LiveInterval analysis pass which is used -// by the Linear Scan Register allocator. This pass linearizes the -// basic blocks of the function in DFS order and uses the -// LiveVariables pass to conservatively compute live intervals for -// each virtual and physical register. +// This file implements the TwoAddress instruction pass which is used +// by most register allocators. Two-Address instructions are rewritten +// from: +// +// A = B op C +// +// to: +// +// A = B +// A = A op C // //===----------------------------------------------------------------------===// From alkis at cs.uiuc.edu Sun Jan 4 20:26:01 2004 From: alkis at cs.uiuc.edu (Alkis Evlogimenos) Date: Sun Jan 4 20:26:01 2004 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp Message-ID: <200401050225.UAA24517@kain.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: TwoAddressInstructionPass.cpp updated: 1.3 -> 1.4 --- Log message: Currently we cannot handle two-address instructions of the form: A = B op C where A == C, but this cannot really occur in practice because of SSA form. Add an assert to check that just to be safe. --- Diffs of the changes: (+9 -0) Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.3 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.4 --- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.3 Sun Jan 4 17:09:24 2004 +++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp Sun Jan 4 20:25:45 2004 @@ -123,6 +123,15 @@ bool regAisPhysical = regA < MRegisterInfo::FirstVirtualRegister; bool regBisPhysical = regB < MRegisterInfo::FirstVirtualRegister; + // first make sure we do not have a use of a in the + // instruction (a = b + a for example) because our + // transofrmation will not work. This should never occur + // because of SSA. + for (unsigned i = 1; i < mi->getNumOperands(); ++i) { + assert(!mi->getOperand(i).isRegister() || + mi->getOperand(i).getAllocatedRegNum() != regA); + } + const TargetRegisterClass* rc = regAisPhysical ? mri_->getRegClass(regA) : mf_->getSSARegMap()->getRegClass(regA); From lattner at cs.uiuc.edu Sun Jan 4 23:07:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jan 4 23:07:01 2004 Subject: [llvm-commits] CVS: llvm/docs/SourceLevelDebugging.html venusflytrap.jpg Message-ID: <200401050506.XAA30432@zion.cs.uiuc.edu> Changes in directory llvm/docs: SourceLevelDebugging.html added (r1.1) venusflytrap.jpg added (r1.1) --- Log message: First version of this document. It is still missing some pretty big pieces, and the debugging information formats will likely change, but it's a start, and I have to move on to other things in the short-term, so it might be a while before I get back to working on this. --- Diffs of the changes: (+906 -0) Index: llvm/docs/SourceLevelDebugging.html diff -c /dev/null llvm/docs/SourceLevelDebugging.html:1.1 *** /dev/null Sun Jan 4 23:06:44 2004 --- llvm/docs/SourceLevelDebugging.html Sun Jan 4 23:06:33 2004 *************** *** 0 **** --- 1,906 ---- + + + + Source Level Debugging with LLVM + + + + +
Source Level Debugging with LLVM
+ + + + + + + +
+ +

This document is the central repository for all information pertaining to + debug information in LLVM. It describes how to use the llvm-db tool, which provides a + powerful source-level debugger to users of LLVM-based + compilers. When compiling a program in debug mode, the front-end in use adds + LLVM debugging information to the program in the form of normal LLVM program objects as well as a small set of LLVM intrinsic functions, which specify the mapping of the + program in LLVM form to the program in the source language. +

+ +
+ + + + +
+ +

+ The idea of the LLVM debugging information is to capture how the important + pieces of the source-language's Abstract Syntax Tree map onto LLVM code. + Several design aspects have shaped the solution that appears here. The + important ones are:

+ +

    +
  • Debugging information should have very little impact on the rest of the + compiler. No transformations, analyses, or code generators should need to be + modified because of debugging information.
  • + +
  • LLVM optimizations should interact in well-defined and + easily described ways with the debugging information.
  • + +
  • Because LLVM is designed to support arbitrary programming languages, + LLVM-to-LLVM tools should not need to know anything about the semantics of the + source-level-language.
  • + +
  • Source-level languages are often widely different from one another. + LLVM should not put any restrictions of the flavor of the source-language, and + the debugging information should work with any language.
  • + +
  • With code generator support, it should be possible to use an LLVM compiler + to compile a program to native machine code with standard debugging formats. + This allows compatibility with traditional machine-code level debuggers, like + GDB or DBX.
  • + +

+ +

+ The approach used by the LLVM implementation is to use a small set of intrinsic functions to define a mapping + between LLVM program objects and the source-level objects. The description of + the source-level program is maintained in LLVM global variables in an implementation-defined format (the C/C++ front-end + currently uses working draft 7 of the Dwarf 3 standard).

+ +

+ When a program is debugged, the debugger interacts with the user and turns the + stored debug information into source-language specific information. As such, + the debugger must be aware of the source-language, and is thus tied to a + specific language of family of languages. The LLVM + debugger is designed to be modular in its support for source-languages. +

+ +
+ + + + + +
+

+ An extremely high priority of LLVM debugging information is to make it interact + well with optimizations and analysis. In particular, the LLVM debug information + provides the following guarantees:

+ +

    + +
  • LLVM debug information always provides information to accurately read the + source-level state of the program, regardless of which LLVM optimizations + have been run, and without any modification to the optimizations themselves. + However, some optimizations may impact the ability to modify the current state + of the program with a debugger, such as setting program variables, or calling + function that have been deleted.
  • + +
  • LLVM optimizations gracefully interact with debugging information. If they + are not aware of debug information, they are automatically disabled as necessary + in the cases that would invalidate the debug info. This retains the LLVM + features making it easy to write new transformations.
  • + +
  • As desired, LLVM optimizations can be upgraded to be aware of the LLVM + debugging information, allowing them to update the debugging information as they + perform aggressive optimizations. This means that, with effort, the LLVM + optimizers could optimize debug code just as well as non-debug code.
  • + +
  • LLVM debug information does not prevent many important optimizations from + happening (for example inlining, basic block reordering/merging/cleanup, tail + duplication, etc), further reducing the amount of the compiler that eventually + is "aware" of debugging information.
  • + +
  • LLVM debug information is automatically optimized along with the rest of the + program, using existing facilities. For example, duplicate information is + automatically merged by the linker, and unused information is automatically + removed.
  • + +

+ +

+ Basically, the debug information allows you to compile a program with "-O0 + -g" and get full debug information, allowing you to arbitrarily modify the + program as it executes from the debugger. Compiling a program with "-O3 + -g" gives you full debug information that is always available and accurate + for reading (e.g., you get accurate stack traces despite tail call elimination + and inlining), but you might lose the ability to modify the program and call + functions where were optimized out of the program, or inlined away completely. +

+ +
+ + + + + +
+

+ There are several important extensions that could be eventually added to the + LLVM debugger. The most important extension would be to upgrade the LLVM code + generators to support debugging information. This would also allow, for + example, the X86 code generator to emit native objects that contain debugging + information consumable by traditional source-level debuggers like GDB or + DBX.

+ +

+ Additionally, LLVM optimizations can be upgraded to incrementally update the + debugging information, new commands can be added to the + debugger, and thread support could be added to the debugger.

+ +

+ The "SourceLanguage" modules provided by llvm-db could be substantially + improved to provide good support for C++ language features like namespaces and + scoping rules.

+ +

+ After working with the debugger for a while, perhaps the nicest improvement + would be to add some sort of line editor, such as GNU readline (but that is + compatible with the LLVM license).

+ +

+ For someone so inclined, it should be straight-forward to write different + front-ends for the LLVM debugger, as the LLVM debugging engine is cleanly + seperated from the llvm-db front-end. A GUI debugger or IDE would be + an interesting project. +

+ +
+ + + + + + +
+ +

+ The llvm-db tool provides a GDB-like interface for source-level + debugging of programs. This tool provides many standard commands for inspecting + and modifying the program as it executes, loading new programs, single stepping, + placing breakpoints, etc. This section describes how to use the debugger. +

+ +

llvm-db has been designed to be as similar to GDB in its user + interface as possible. This should make it extremely easy to learn + llvm-db if you already know GDB. In general, llvm-db + provides the subset of GDB commands that are applicable to LLVM debugging users. + If there is a command missing that make a reasonable amount of sense within the + limitations of llvm-db, please report it as + a bug or, better yet, submit a patch to add it. :)

+ +
+ + + + +
+ +

llvm-db is the first LLVM debugger, and as such was designed to be + quick to prototype and build, and simple to extend. It is missing many many + features, though they should be easy to add over time (patches welcomed!). + Because the (currently only) debugger backend (implemented in + "lib/Debugger/UnixLocalInferiorProcess.cpp") was designed to work without any + cooperation from the code generators, it suffers from the following inherent + limitations:

+ +

    + +
  • Running a program in llvm-db is a bit slower than running it with + lli.
  • + +
  • Inspection of the target hardware is not supported. This means that you + cannot, for example, print the contents of X86 registers.
  • + +
  • Inspection of LLVM code is not supported. This means that you cannot print + the contents of arbitrary LLVM values, or use commands such as stepi. + This also means that you cannot debug code without debug information.
  • + +
  • Portions of the debugger run in the same address space as the program being + debugged. This means that memory corruption by the program could trample on + portions of the debugger.
  • + +
  • Attaching to existing processes and core files is not currently + supported.
  • + +

+ +

That said, it is still quite useful, and all of these limitations can be + eliminated by integrating support for the debugger into the code generators. + See the future work section for ideas of how to extend + the LLVM debugger despite these limitations.

+ +
+ + + + + +
+ +

+ TODO +

+ +
+ + + + + + +
+ +

There are three ways to start up the llvm-db debugger:

+ +

When run with no options, just llvm-db, the debugger starts up + without a program loaded at all. You must use the file command to load a program, and the set args or run + commands to specify the arguments for the program.

+ +

If you start the debugger with one argument, as llvm-db + <program>, the debugger will start up and load in the specified + program. You can then optionally specify arguments to the program with the set args or run + commands.

+ +

The third way to start the program is with the --args option. This + option allows you to specify the program to load and the arguments to start out + with. Example use: llvm-db --args ls /home

+ +
+ + + + +
+ +

FIXME: this needs work obviously. See the GDB documentation for + information about what these do, or try 'help [command]' within + llvm-db to get information.

+ +

+

General usage:

+
    +
  • help [command]
  • +
  • quit
  • +
  • file [program]
  • +
+ +

Program inspection and interaction:

+
    +
  • create (start the program, stopping it ASAP in main)
  • +
  • kill
  • +
  • run [args]
  • +
  • step [num]
  • +
  • next [num]
  • +
  • cont
  • +
  • finish
  • + +
  • list [start[, end]]
  • +
  • info source
  • +
  • info sources
  • +
  • info functions
  • +
+ +

Call stack inspection:

+
    +
  • backtrace
  • +
  • up [n]
  • +
  • down [n]
  • +
  • frame [n]
  • +
+ + +

Debugger inspection and interaction:

+
    +
  • info target
  • +
  • show prompt
  • +
  • set prompt
  • +
  • show listsize
  • +
  • set listsize
  • +
  • show language
  • +
  • set language
  • +
+ +

TODO:

+
    +
  • info frame
  • +
  • break
  • +
  • print
  • +
  • ptype
  • + +
  • info types
  • +
  • info variables
  • +
  • info program
  • + +
  • info args
  • +
  • info locals
  • +
  • info catch
  • +
  • ... many others
  • +
+

+
+ + + + + +
+ +

+ lib/Debugger
+   - UnixLocalInferiorProcess.cpp
+ 
+ tools/llvm-db
+   - SourceLanguage interfaces
+   - ProgramInfo/RuntimeInfo
+   - Commands
+ 
+ 

+ +
+ + + + +
+ +

+ FIXME: this section will eventually go away. These are notes to myself of + things that should be implemented, but haven't yet. +

+ +

+ Breakpoints: Support is already implemented in the 'InferiorProcess' + class, though it hasn't been tested yet. To finish breakpoint support, we need + to implement breakCommand (which should reuse the linespec parser from the list + command), and handle the fact that 'break foo' or 'break file.c:53' may insert + multiple breakpoints. Also, if you say 'break file.c:53' and there is no + stoppoint on line 53, the breakpoint should go on the next available line. My + idea was to have the Debugger class provide a "Breakpoint" class which + encapsulated this messiness, giving the debugger front-end a simple interface. + The debugger front-end would have to map the really complex semantics of + temporary breakpoints and 'conditional' breakpoints onto this intermediate + level. Also, breakpoints should survive as much as possible across program + reloads. +

+ +

+ run (with args) & set args: These need to be implemented. + Currently run doesn't support setting arguments as part of the command. The + only tricky thing is handling quotes right and stuff.

+ +

+ UnixLocalInferiorProcess.cpp speedup: There is no reason for the debugged + process to code gen the globals corresponding to debug information. The + IntrinsicLowering object could instead change descriptors into constant expr + casts of the constant address of the LLVM objects for the descriptors. This + would also allow us to eliminate the mapping back and forth between physical + addresses that must be done.

+ +
+ + + + + +
+ +

LLVM debugging information has been carefully designed to make it possible + for the optimizer to optimize the program and debugging information without + necessarily having to know anything about debugging information. In particular, + the global constant merging pass automatically eliminates duplicated debugging + information (often caused by header files), the global dead code elimination + pass automatically deletes debugging information for a function if it decides to + delete the function, and the linker eliminates debug information when it merges + linkonce functions.

+ +

To do this, most of the debugging information (descriptors for types, + variables, functions, source files, etc) is inserted by the language front-end + in the form of LLVM global variables. These LLVM global variables are no + different from any other global variables, except that they have a web of LLVM + intrinsic functions that point to them. If the last references to a particular + piece of debugging information are deleted (for example, by the + -globaldce pass), the extraneous debug information will automatically + become dead and be removed by the optimizer.

+ +

The debugger is designed to be agnostic about the contents of most of the + debugging information. It uses a source-language-specific module to decode the + information that represents variables, types, functions, namespaces, etc: this + allows for arbitrary source-language semantics and type-systems to be used, as + long as there is a module written for the debugger to interpret the information. +

+ +

+ To provide basic functionality, the LLVM debugger does have to make some + assumptions about the source-level language being debugged, though it keeps + these to a minimum. The only common features that the LLVM debugger assumes + exist are source files, global objects (aka methods, messages, global + variables, etc), and local variables. + These abstract objects are used by the debugger to form stack traces, show + information about local variables, etc. + +

This section of the documentation first describes the representation aspects + common to any source-language. The next section + describes the data layout conventions used by the C and C++ + front-ends.

+ +
+ + + + +
+

+ One important aspect of the LLVM debug representation is that it allows the LLVM + debugger to efficiently index all of the global objects without having the scan + the program. To do this, all of the global objects use "anchor" globals of type + "{}", with designated names. These anchor objects obviously do not + contain any content or meaning by themselves, but all of the global objects of a + particular type (e.g., source file descriptors) contain a pointer to the anchor. + This pointer allows the debugger to use def-use chains to find all global + objects of that type. +

+ +

+ So far, the following names are recognized as anchors by the LLVM debugger: +

+ +

+   %llvm.dbg.translation_units = linkonce global {} {}
+   %llvm.dbg.globals         = linkonce global {} {}
+ 

+ +

+ Using anchors in this way (where the source file descriptor points to the + anchors, as opposed to having a list of source file descriptors) allows for the + standard dead global elimination and merging passes to automatically remove + unused debugging information. If the globals were kept track of through lists, + there would always be an object pointing to the descriptors, thus would never be + deleted. +

+ +
+ + + + + +
+ +

LLVM debugger "stop points" are a key part of the debugging representation + that allows the LLVM to maintain simple semantics for debugging optimized code. The basic idea is that the + front-end inserts calls to the %llvm.dbg.stoppoint intrinsic function + at every point in the program where the debugger should be able to inspect the + program (these correspond to places the debugger stops when you "step" + through it). The front-end can choose to place these as fine-grained as it + would like (for example, before every subexpression was evaluated), but it is + recommended to only put them after every source statement.

+ +

+ Using calls to this intrinsic function to demark legal points for the debugger + to inspect the program automatically disables any optimizations that could + potentially confuse debugging information. To non-debug-information-aware + transformations, these calls simply look like calls to an external function, + which they must assume to do anything (including reading or writing to any part + of reachable memory). On the other hand, it does not impact many optimizations, + such as code motion of non-trapping instructions, nor does it impact + optimization of subexpressions, or any other code between the stop points.

+ +

+ An important aspect of the calls to the %llvm.dbg.stoppoint intrinsic + is that the function-local debugging information is woven together with use-def + chains. This makes it easy for the debugger to, for example, locate the 'next' + stop point. For a concrete example of stop points, see the next section.

+ +
+ + + + + +
+

+ In many languages, the local variables in functions can have their lifetime or + scope limited to a subset of a function. In the C family of languages, for + example, variables are only live (readable and writable) within the source block + that they are defined in. In functional languages, values are only readable + after they have been defined. Though this is a very obvious concept, it is also + non-trivial to model in LLVM, because it has no notion of scoping in this sense, + and does not want to be tied to a language's scoping rules. +

+ +

+ In order to handle this, the LLVM debug format uses the notion of "regions" of a + function, delineated by calls to intrinsic functions. These intrinsic functions + define new regions of the program and indicate when the region lifetime expires. + Consider the following C fragment, for example: +

+ +

+ 1.  void foo() {
+ 2.    int X = ...;
+ 3.    int Y = ...;
+ 4.    {
+ 5.      int Z = ...;
+ 6.      ...
+ 7.    }
+ 8.    ...
+ 9.  }
+ 

+ +

+ Compiled to LLVM, this function would be represented like this (FIXME: CHECK AND + UPDATE THIS): +

+ +

+ void %foo() {
+     %X = alloca int
+     %Y = alloca int
+     %Z = alloca int
+     %D1 = call {}* %llvm.dbg.func.start(%lldb.global* %d.foo)
+     %D2 = call {}* %llvm.dbg.stoppoint({}* %D1, uint 2, uint 2, %lldb.compile_unit* %file)
+ 
+     %D3 = call {}* %llvm.dbg.DEFINEVARIABLE({}* %D2, ...)
+     ;; Evaluate expression on line 2, assigning to X.
+     %D4 = call {}* %llvm.dbg.stoppoint({}* %D3, uint 3, uint 2, %lldb.compile_unit* %file)
+ 
+     %D5 = call {}* %llvm.dbg.DEFINEVARIABLE({}* %D4, ...)
+     ;; Evaluate expression on line 3, assigning to Y.
+     %D6 = call {}* %llvm.dbg.stoppoint({}* %D5, uint 5, uint 4, %lldb.compile_unit* %file)
+ 
+     %D7 = call {}* %llvm.region.start({}* %D6)
+     %D8 = call {}* %llvm.dbg.DEFINEVARIABLE({}* %D7, ...)
+     ;; Evaluate expression on line 5, assigning to Z.
+     %D9 = call {}* %llvm.dbg.stoppoint({}* %D8, uint 6, uint 4, %lldb.compile_unit* %file)
+ 
+     ;; Code for line 6.
+     %D10 = call {}* %llvm.region.end({}* %D9)
+     %D11 = call {}* %llvm.dbg.stoppoint({}* %D10, uint 8, uint 2, %lldb.compile_unit* %file)
+ 
+     ;; Code for line 8.
+     %D12 = call {}* %llvm.region.end({}* %D11)
+     ret void
+ }
+ 

+ +

+ This example illustrates a few important details about the LLVM debugging + information. In particular, it shows how the various intrinsics used are woven + together with def-use and use-def chains, similar to how anchors are used with globals. This allows the + debugger to analyze the relationship between statements, variable definitions, + and the code used to implement the function.

+ +

+ In this example, two explicit regions are defined, one with the definition of the %D1 variable and one with the + definition of %D7. In the case of + %D1, the debug information indicates that the function whose descriptor is specified as an argument to the + intrinsic. This defines a new stack frame whose lifetime ends when the region + is ended by the %D12 call.

+ +

+ Representing the boundaries of functions with regions allows normal LLVM + interprocedural optimizations to change the boundaries of functions without + having to worry about breaking mapping information between LLVM and source-level + functions. In particular, the inlining optimization requires no modification to + support inlining with debugging information: there is no correlation drawn + between LLVM functions and their source-level counterparts.

+ +

+ Once the function has been defined, the stopping point corresponding to line #2 of the + function is encountered. At this point in the function, no local + variables are live. As lines 2 and 3 of the example are executed, their + variable definitions are automatically introduced into the program, without the + need to specify a new region. These variables do not require new regions to be + introduced because they go out of scope at the same point in the program: line + 9. +

+ +

+ In contrast, the Z variable goes out of scope at a different time, on + line 7. For this reason, it is defined within the + %D7 region, which kills the availability of Z before the + code for line 8 is executed. Through the use of LLVM debugger regions, + arbitrary source-language scoping rules can be supported, as long as they can + only be nested (ie, one scope cannot partially overlap with a part of another + scope). +

+ +

+ It is worth noting that this scoping mechanism is used to control scoping of all + declarations, not just variable declarations. For example, the scope of a C++ + using declaration is controlled with this, and the llvm-db C++ support + routines could use this to change how name lookup is performed (though this is + not yet implemented). +

+ +
+ + + + + +
+

+ The LLVM debugger expects the descriptors for global objects to start in a + canonical format, but the descriptors can include additional information + appended at the end. All LLVM debugging information is versioned, allowing + backwards compatibility in the case that the core structures need to change in + some way. The lowest-level descriptor are those describing the files containing the program source + code, all other descriptors refer to them. +

+
+ + + + + +
+

+ Source file descriptors were roughly patterned after the Dwarf "compile_unit" + object. The descriptor currently is defined to have the following LLVM + type:

+ +

+ %lldb.compile_unit = type {
+        ushort,               ;; LLVM debug version number
+        ushort,               ;; Dwarf language identifier
+        sbyte*,               ;; Filename
+        sbyte*,               ;; Working directory when compiled
+        sbyte*,               ;; Producer of the debug information
+        {}*                   ;; Anchor for llvm.dbg.translation_units
+ }
+ 

+ +

+ These descriptors contain the version number for the debug info, a source + language ID for the file (we use the Dwarf 3.0 ID numbers, such as + DW_LANG_C89, DW_LANG_C_plus_plus, DW_LANG_Cobol74, + etc), three strings describing the filename, working directory of the compiler, + and an identifier string for the compiler that produced it, and the anchor for the descriptor. Here is an example + descriptor: +

+ +

+ %arraytest_source_file = internal constant %lldb.compile_unit {
+     ushort 0,                                                     ; Version #0
+     ushort 1,                                                     ; DW_LANG_C89
+     sbyte* getelementptr ([12 x sbyte]* %.str_1, long 0, long 0), ; filename
+     sbyte* getelementptr ([12 x sbyte]* %.str_2, long 0, long 0), ; working dir
+     sbyte* getelementptr ([12 x sbyte]* %.str_3, long 0, long 0), ; producer
+     {}* %llvm.dbg.translation_units                               ; Anchor
+ }
+ %.str_1 = internal constant [12 x sbyte] c"arraytest.c\00"
+ %.str_2 = internal constant [12 x sbyte] c"/home/sabre\00"
+ %.str_3 = internal constant [12 x sbyte] c"llvmgcc 3.4\00"
+ 

+ + +
+ + + + + +
+

+ The LLVM debugger needs to know what the source-language global objects, in + order to build stack traces and other related activities. Because + source-languages have widly varying forms of global objects, the LLVM debugger + only expects the following fields in the descriptor for each global: +

+ +

+ %lldb.global = type {
+        %lldb.compile_unit*,   ;; The translation unit containing the global
+        sbyte*,                ;; The global object 'name'
+        [type]*,               ;; Source-language type descriptor for global
+        {}*                    ;; The anchor for llvm.dbg.globals
+ }
+ 

+ +

+ The first field contains a pointer to the translation unit the function is + defined in. This pointer allows the debugger to find out which version of debug + information the function corresponds to. The second field contains a string + that the debugger can use to identify the subprogram if it does not contain + explicit support for the source-language in use. This should be some sort of + unmangled string that corresponds to the function somehow. +

+ +

+ Note again that descriptors can be extended to include source-language-specific + information in addition to the fields required by the LLVM debugger. See the section on the C/C++ front-end for more + information. +

+
+ + + + + + +
+

+

+
+ + + + + +
+

+ +

+
+ + + + + + +
+ +

+ The C and C++ front-ends represent information about the program in a format + that is effectively identical to Dwarf 3.0 in terms of + information content. This allows code generators to trivially support native + debuggers by generating standard dwarf information, and contains enough + information for non-dwarf targets to translate it other as needed.

+ +

+ TODO: document extensions to standard debugging objects, document how we + represent source types, etc. +

+ +
+ + + + +
+

+ +

+
+ + + + +
+ + + + Index: llvm/docs/venusflytrap.jpg From lattner at cs.uiuc.edu Sun Jan 4 23:23:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jan 4 23:23:01 2004 Subject: [llvm-commits] CVS: llvm/include/llvm/Debugger/ Message-ID: <200401050522.XAA30533@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Debugger: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/include/llvm/Debugger added to the repository --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sun Jan 4 23:24:00 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jan 4 23:24:00 2004 Subject: [llvm-commits] CVS: llvm/include/llvm/Debugger/Debugger.h InferiorProcess.h ProgramInfo.h RuntimeInfo.h SourceFile.h SourceLanguage.h Message-ID: <200401050523.XAA30606@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Debugger: Debugger.h added (r1.1) InferiorProcess.h added (r1.1) ProgramInfo.h added (r1.1) RuntimeInfo.h added (r1.1) SourceFile.h added (r1.1) SourceLanguage.h added (r1.1) --- Log message: Initial implementation of some source-level debugging stuff --- Diffs of the changes: (+887 -0) Index: llvm/include/llvm/Debugger/Debugger.h diff -c /dev/null llvm/include/llvm/Debugger/Debugger.h:1.1 *** /dev/null Sun Jan 4 23:23:48 2004 --- llvm/include/llvm/Debugger/Debugger.h Sun Jan 4 23:23:38 2004 *************** *** 0 **** --- 1,169 ---- + //===- Debugger.h - LLVM debugger library interface -------------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the LLVM source-level debugger library interface. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_DEBUGGER_DEBUGGER_H + #define LLVM_DEBUGGER_DEBUGGER_H + + #include + #include + + namespace llvm { + class Module; + class InferiorProcess; + + /// Debugger class - This class implements the LLVM source-level debugger. + /// This allows clients to handle the user IO processing without having to + /// worry about how the debugger itself works. + /// + class Debugger { + // State the debugger needs when starting and stopping the program. + std::vector ProgramArguments; + + // The environment to run the program with. This should eventually be + // changed to vector of strings when we allow the user to edit the + // environment. + const char * const *Environment; + + // Program - The currently loaded program, or null if none is loaded. + Module *Program; + + // Process - The currently executing inferior process. + InferiorProcess *Process; + + Debugger(const Debugger &); // DO NOT IMPLEMENT + void operator=(const Debugger &); // DO NOT IMPLEMENT + public: + Debugger(); + ~Debugger(); + + //===------------------------------------------------------------------===// + // Methods for manipulating and inspecting the execution environment. + // + + /// initializeEnvironment - Specify the environment the program should run + /// with. This is used to initialize the environment of the program to the + /// environment of the debugger. + void initializeEnvironment(const char *const *envp) { + Environment = envp; + } + + /// setWorkingDirectory - Specify the working directory for the program to + /// be started from. + void setWorkingDirectory(const std::string &Dir) { + // FIXME: implement + } + + template + void setProgramArguments(It I, It E) { + ProgramArguments.assign(I, E); + } + + + //===------------------------------------------------------------------===// + // Methods for manipulating and inspecting the program currently loaded. + // + + /// isProgramLoaded - Return true if there is a program currently loaded. + /// + bool isProgramLoaded() const { return Program != 0; } + + /// getProgram - Return the LLVM module corresponding to the program. + /// + Module *getProgram() const { return Program; } + + /// getProgramPath - Get the path of the currently loaded program, or an + /// empty string if none is loaded. + std::string getProgramPath() const; + + /// loadProgram - If a program is currently loaded, unload it. Then search + /// the PATH for the specified program, loading it when found. If the + /// specified program cannot be found, an exception is thrown to indicate + /// the error. + void loadProgram(const std::string &Path); + + /// unloadProgram - If a program is running, kill it, then unload all traces + /// of the current program. If no program is loaded, this method silently + /// succeeds. + void unloadProgram(); + + //===------------------------------------------------------------------===// + // Methods for manipulating and inspecting the program currently running. + // + // If the program is running, and the debugger is active, then we know that + // the program has stopped. This being the case, we can inspect the + // program, ask it for its source location, set breakpoints, etc. + // + + /// isProgramRunning - Return true if a program is loaded and has a + /// currently active instance. + bool isProgramRunning() const { return Process != 0; } + + /// getRunningProcess - If there is no program running, throw an exception. + /// Otherwise return the running process so that it can be inspected by the + /// debugger. + const InferiorProcess &getRunningProcess() const { + if (Process == 0) throw "No process running."; + return *Process; + } + + /// createProgram - Create an instance of the currently loaded program, + /// killing off any existing one. This creates the program and stops it at + /// the first possible moment. If there is no program loaded or if there is + /// a problem starting the program, this method throws an exception. + void createProgram(); + + /// killProgram - If the program is currently executing, kill off the + /// process and free up any state related to the currently running program. + /// If there is no program currently running, this just silently succeeds. + /// If something horrible happens when killing the program, an exception + /// gets thrown. + void killProgram(); + + + //===------------------------------------------------------------------===// + // Methods for continuing execution. These methods continue the execution + // of the program by some amount. If the program is successfully stopped, + // execution returns, otherwise an exception is thrown. + // + // NOTE: These methods should always be used in preference to directly + // accessing the Dbg object, because these will delete the Process object if + // the process unexpectedly dies. + // + + /// stepProgram - Implement the 'step' command, continuing execution until + /// the next possible stop point. + void stepProgram(); + + /// nextProgram - Implement the 'next' command, continuing execution until + /// the next possible stop point that is in the current function. + void nextProgram(); + + /// finishProgram - Implement the 'finish' command, continuing execution + /// until the specified frame ID returns. + void finishProgram(void *Frame); + + /// contProgram - Implement the 'cont' command, continuing execution until + /// the next breakpoint is encountered. + void contProgram(); + }; + + class NonErrorException { + std::string Message; + public: + NonErrorException(const std::string &M) : Message(M) {} + const std::string &getMessage() const { return Message; } + }; + + } // end namespace llvm + + #endif Index: llvm/include/llvm/Debugger/InferiorProcess.h diff -c /dev/null llvm/include/llvm/Debugger/InferiorProcess.h:1.1 *** /dev/null Sun Jan 4 23:23:48 2004 --- llvm/include/llvm/Debugger/InferiorProcess.h Sun Jan 4 23:23:38 2004 *************** *** 0 **** --- 1,138 ---- + //===- InferiorProcess.h - Represent the program being debugged -*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the InferiorProcess class, which is used to represent, + // inspect, and manipulate a process under the control of the LLVM debugger. + // + // This is an abstract class which should allow various different types of + // implementations. Initially we implement a unix specific debugger backend + // that does not require code generator support, but we could eventually use + // code generator support with ptrace, support windows based targets, supported + // remote targets, etc. + // + // If the inferior process unexpectedly dies, an attempt to communicate with it + // will cause an InferiorProcessDead exception to be thrown, indicating the exit + // code of the process. When this occurs, no methods on the InferiorProcess + // class should be called except for the destructor. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_DEBUGGER_INFERIORPROCESS_H + #define LLVM_DEBUGGER_INFERIORPROCESS_H + + #include + #include + + namespace llvm { + class Module; + class GlobalVariable; + + /// InferiorProcessDead exception - This class is thrown by methods that + /// communicate with the interior process if the process unexpectedly exits or + /// dies. The instance variable indicates what the exit code of the process + /// was, or -1 if unknown. + class InferiorProcessDead { + int ExitCode; + public: + InferiorProcessDead(int EC) : ExitCode(EC) {} + int getExitCode() const { return ExitCode; } + }; + + /// InferiorProcess class - This class represents the process being debugged + /// by the debugger. Objects of this class should not be stack allocated, + /// because the destructor can throw exceptions. + /// + class InferiorProcess { + Module *M; + protected: + InferiorProcess(Module *m) : M(m) {} + public: + /// create - Create an inferior process of the specified module, and + /// stop it at the first opportunity. If there is a problem starting the + /// program (for example, it has no main), throw an exception. + static InferiorProcess *create(Module *M, + const std::vector &Arguments, + const char * const *envp); + + // InferiorProcess destructor - Kill the current process. If something + // terrible happens, we throw an exception from the destructor. + virtual ~InferiorProcess() {} + + //===------------------------------------------------------------------===// + // Status methods - These methods return information about the currently + // stopped process. + // + + /// getStatus - Return a status message that is specific to the current type + /// of inferior process that is created. This can return things like the + /// PID of the inferior or other potentially interesting things. + virtual std::string getStatus() const { + return ""; + } + + //===------------------------------------------------------------------===// + // Methods for inspecting the call stack. + // + + /// getPreviousFrame - Given the descriptor for the current stack frame, + /// return the descriptor for the caller frame. This returns null when it + /// runs out of frames. If Frame is null, the initial frame should be + /// returned. + virtual void *getPreviousFrame(void *Frame) const = 0; + + /// getSubprogramDesc - Return the subprogram descriptor for the current + /// stack frame. + virtual const GlobalVariable *getSubprogramDesc(void *Frame) const = 0; + + /// getFrameLocation - This method returns the source location where each + /// stack frame is stopped. + virtual void getFrameLocation(void *Frame, unsigned &LineNo, + unsigned &ColNo, + const GlobalVariable *&SourceDesc) const = 0; + + //===------------------------------------------------------------------===// + // Methods for manipulating breakpoints. + // + + /// addBreakpoint - This method adds a breakpoint at the specified line, + /// column, and source file, and returns a unique identifier for it. + /// + /// It is up to the debugger to determine whether or not there is actually a + /// stop-point that corresponds with the specified location. + virtual unsigned addBreakpoint(unsigned LineNo, unsigned ColNo, + const GlobalVariable *SourceDesc) = 0; + + /// removeBreakpoint - This deletes the breakpoint with the specified ID + /// number. + virtual void removeBreakpoint(unsigned ID) = 0; + + + //===------------------------------------------------------------------===// + // Execution methods - These methods cause the program to continue execution + // by some amount. If the program successfully stops, this returns. + // Otherwise, if the program unexpectedly terminates, an InferiorProcessDead + // exception is thrown. + // + + /// stepProgram - Implement the 'step' command, continuing execution until + /// the next possible stop point. + virtual void stepProgram() = 0; + + /// finishProgram - Implement the 'finish' command, continuing execution + /// until the current function returns. + virtual void finishProgram(void *Frame) = 0; + + /// contProgram - Implement the 'cont' command, continuing execution until + /// a breakpoint is encountered. + virtual void contProgram() = 0; + }; + } // end namespace llvm + + #endif + Index: llvm/include/llvm/Debugger/ProgramInfo.h diff -c /dev/null llvm/include/llvm/Debugger/ProgramInfo.h:1.1 *** /dev/null Sun Jan 4 23:23:48 2004 --- llvm/include/llvm/Debugger/ProgramInfo.h Sun Jan 4 23:23:38 2004 *************** *** 0 **** --- 1,245 ---- + //===- ProgramInfo.h - Information about the loaded program -----*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines various pieces of information about the currently loaded + // program. One instance of this object is created every time a program is + // loaded, and destroyed every time it is unloaded. + // + // The various pieces of information gathered about the source program are all + // designed to be extended by various SourceLanguage implementations. This + // allows source languages to keep any extended information that they support in + // the derived class portions of the class. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_DEBUGGER_PROGRAMINFO_H + #define LLVM_DEBUGGER_PROGRAMINFO_H + + #include + #include + #include + + namespace llvm { + class GlobalVariable; + class Module; + class SourceFile; + class SourceLanguage; + class ProgramInfo; + + /// SourceLanguageCache - SourceLanguage implementations are allowed to cache + /// stuff in the ProgramInfo object. The only requirement we have on these + /// instances is that they are destroyable. + struct SourceLanguageCache { + virtual ~SourceLanguageCache() {} + }; + + /// SourceFileInfo - One instance of this structure is created for each + /// source file in the program. + /// + class SourceFileInfo { + /// BaseName - The filename of the source file. + std::string BaseName; + + /// Directory - The working directory of this source file when it was + /// compiled. + std::string Directory; + + /// Version - The version of the LLVM debug information that this file was + /// compiled with. + unsigned Version; + + /// Language - The source language that the file was compiled with. This + /// pointer is never null. + /// + const SourceLanguage *Language; + + /// Descriptor - The LLVM Global Variable which describes the source file. + /// + const GlobalVariable *Descriptor; + + /// SourceText - The body of this source file, or null if it has not yet + /// been loaded. + mutable SourceFile *SourceText; + public: + SourceFileInfo(const GlobalVariable *Desc, const SourceLanguage &Lang); + ~SourceFileInfo(); + + const std::string &getBaseName() const { return BaseName; } + const std::string &getDirectory() const { return Directory; } + unsigned getDebugVersion() const { return Version; } + const GlobalVariable *getDescriptor() const { return Descriptor; } + SourceFile &getSourceText() const; + + const SourceLanguage &getLanguage() const { return *Language; } + }; + + + /// SourceFunctionInfo - An instance of this class is used to represent each + /// source function in the program. + /// + class SourceFunctionInfo { + /// Name - This contains an abstract name that is potentially useful to the + /// end-user. If there is no explicit support for the current language, + /// then this string is used to identify the function. + std::string Name; + + /// Descriptor - The descriptor for this function. + /// + const GlobalVariable *Descriptor; + + /// SourceFile - The file that this function is defined in. + /// + const SourceFileInfo *SourceFile; + + /// LineNo, ColNo - The location of the first stop-point in the function. + /// These are computed on demand. + mutable unsigned LineNo, ColNo; + + public: + SourceFunctionInfo(ProgramInfo &PI, const GlobalVariable *Desc); + virtual ~SourceFunctionInfo() {} + + /// getSymbolicName - Return a human-readable symbolic name to identify the + /// function (for example, in stack traces). + virtual std::string getSymbolicName() const { return Name; } + + /// getDescriptor - This returns the descriptor for the function. + /// + const GlobalVariable *getDescriptor() const { return Descriptor; } + + /// getSourceFile - This returns the source file that defines the function. + /// + const SourceFileInfo &getSourceFile() const { return *SourceFile; } + + /// getSourceLocation - This method returns the location of the first + /// stopping point in the function. If the body of the function cannot be + /// found, this returns zeros for both values. + void getSourceLocation(unsigned &LineNo, unsigned &ColNo) const; + }; + + + /// ProgramInfo - This object contains information about the loaded program. + /// When a new program is loaded, an instance of this class is created. When + /// the program is unloaded, the instance is destroyed. This object basically + /// manages the lazy computation of information useful for the debugger. + class ProgramInfo { + Module *M; + + /// ProgramTimeStamp - This is the timestamp of the executable file that we + /// currently have loaded into the debugger. + unsigned long long ProgramTimeStamp; + + /// SourceFiles - This map is used to transform source file descriptors into + /// their corresponding SourceFileInfo objects. This mapping owns the + /// memory for the SourceFileInfo objects. + /// + bool SourceFilesIsComplete; + std::map SourceFiles; + + /// SourceFileIndex - Mapping from source file basenames to the information + /// about the file. Note that there can be filename collisions, so this is + /// a multimap. This map is populated incrementally as the user interacts + /// with the program, through the getSourceFileFromDesc method. If ALL of + /// the source files are needed, the getSourceFiles() method scans the + /// entire program looking for them. + /// + std::multimap SourceFileIndex; + + /// SourceFunctions - This map contains entries functions in the source + /// program. If SourceFunctionsIsComplete is true, then this is ALL of the + /// functions in the program are in this map. + bool SourceFunctionsIsComplete; + std::map SourceFunctions; + + /// LanguageCaches - Each source language is permitted to keep a per-program + /// cache of information specific to whatever it needs. This vector is + /// effectively a small map from the languages that are active in the + /// program to their caches. This can be accessed by the language by the + /// "getLanguageCache" method. + std::vector > LanguageCaches; + public: + ProgramInfo(Module *m); + ~ProgramInfo(); + + /// getProgramTimeStamp - Return the time-stamp of the program when it was + /// loaded. + unsigned long long getProgramTimeStamp() const { return ProgramTimeStamp; } + + //===------------------------------------------------------------------===// + // Interfaces to the source code files that make up the program. + // + + /// getSourceFile - Return source file information for the specified source + /// file descriptor object, adding it to the collection as needed. This + /// method always succeeds (is unambiguous), and is always efficient. + /// + const SourceFileInfo &getSourceFile(const GlobalVariable *Desc); + + /// getSourceFile - Look up the file with the specified name. If there is + /// more than one match for the specified filename, prompt the user to pick + /// one. If there is no source file that matches the specified name, throw + /// an exception indicating that we can't find the file. Otherwise, return + /// the file information for that file. + /// + /// If the source file hasn't been discovered yet in the program, this + /// method might have to index the whole program by calling the + /// getSourceFiles() method. + /// + const SourceFileInfo &getSourceFile(const std::string &Filename); + + /// getSourceFiles - Index all of the source files in the program and return + /// them. This information is lazily computed the first time that it is + /// requested. Since this information can take a long time to compute, the + /// user is given a chance to cancel it. If this occurs, an exception is + /// thrown. + const std::map & + getSourceFiles(bool RequiresCompleteMap = true); + + //===------------------------------------------------------------------===// + // Interfaces to the functions that make up the program. + // + + /// getFunction - Return source function information for the specified + /// function descriptor object, adding it to the collection as needed. This + /// method always succeeds (is unambiguous), and is always efficient. + /// + const SourceFunctionInfo &getFunction(const GlobalVariable *Desc); + + /// getSourceFunctions - Index all of the functions in the program and + /// return them. This information is lazily computed the first time that it + /// is requested. Since this information can take a long time to compute, + /// the user is given a chance to cancel it. If this occurs, an exception + /// is thrown. + const std::map & + getSourceFunctions(bool RequiresCompleteMap = true); + + /// addSourceFunctionsRead - Return true if the source functions map is + /// complete: that is, all functions in the program have been read in. + bool allSourceFunctionsRead() const { return SourceFunctionsIsComplete; } + + /// getLanguageCache - This method is used to build per-program caches of + /// information, such as the functions or types visible to the program. + /// This can be used by SourceLanguage implementations because it requires + /// an accessible ::CacheType typedef, where is the C++ type of the + /// source-language subclass. + template + typename SL::CacheType &getLanguageCache(const SL *L) { + for (unsigned i = 0, e = LanguageCaches.size(); i != e; ++i) + if (LanguageCaches[i].first == L) + return *(typename SL::CacheType*)LanguageCaches[i].second; + typename SL::CacheType *NewCache = L->createSourceLanguageCache(*this); + LanguageCaches.push_back(std::make_pair(L, NewCache)); + return *NewCache; + } + }; + + } // end namespace llvm + + #endif Index: llvm/include/llvm/Debugger/RuntimeInfo.h diff -c /dev/null llvm/include/llvm/Debugger/RuntimeInfo.h:1.1 *** /dev/null Sun Jan 4 23:23:48 2004 --- llvm/include/llvm/Debugger/RuntimeInfo.h Sun Jan 4 23:23:38 2004 *************** *** 0 **** --- 1,141 ---- + //===- RuntimeInfo.h - Information about running program --------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines classes that capture various pieces of information about + // the currently executing, but stopped, program. One instance of this object + // is created every time a program is stopped, and destroyed every time it + // starts running again. This object's main goal is to make access to runtime + // information easy and efficient, by caching information as requested. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_DEBUGGER_RUNTIMEINFO_H + #define LLVM_DEBUGGER_RUNTIMEINFO_H + + #include + + namespace llvm { + class ProgramInfo; + class RuntimeInfo; + class InferiorProcess; + class GlobalVariable; + class SourceFileInfo; + + /// StackFrame - One instance of this structure is created for each stack + /// frame that is active in the program. + /// + class StackFrame { + RuntimeInfo &RI; + void *FrameID; + const GlobalVariable *FunctionDesc; + + /// LineNo, ColNo, FileInfo - This information indicates WHERE in the source + /// code for the program the stack frame is located. + unsigned LineNo, ColNo; + const SourceFileInfo *SourceInfo; + public: + StackFrame(RuntimeInfo &RI, void *ParentFrameID); + + StackFrame &operator=(const StackFrame &RHS) { + FrameID = RHS.FrameID; + FunctionDesc = RHS.FunctionDesc; + return *this; + } + + /// getFrameID - return the low-level opaque frame ID of this stack frame. + /// + void *getFrameID() const { return FrameID; } + + /// getFunctionDesc - Return the descriptor for the function that contains + /// this stack frame, or null if it is unknown. + /// + const GlobalVariable *getFunctionDesc(); + + /// getSourceLocation - Return the source location that this stack frame is + /// sitting at. + void getSourceLocation(unsigned &LineNo, unsigned &ColNo, + const SourceFileInfo *&SourceInfo); + }; + + + /// RuntimeInfo - This class collects information about the currently running + /// process. It is created whenever the program stops execution for the + /// debugger, and destroyed whenver execution continues. + class RuntimeInfo { + /// ProgInfo - This object contains static information about the program. + /// + ProgramInfo *ProgInfo; + + /// IP - This object contains information about the actual inferior process + /// that we are communicating with and aggregating information from. + const InferiorProcess &IP; + + /// CallStack - This caches information about the current stack trace of the + /// program. This is lazily computed as needed. + std::vector CallStack; + + /// CurrentFrame - The user can traverse the stack frame with the + /// up/down/frame family of commands. This index indicates the current + /// stack frame. + unsigned CurrentFrame; + + public: + RuntimeInfo(ProgramInfo *PI, const InferiorProcess &ip) + : ProgInfo(PI), IP(ip), CurrentFrame(0) { + // Make sure that the top of stack has been materialized. If this throws + // an exception, something is seriously wrong and the RuntimeInfo object + // would be unusable anyway. + getStackFrame(0); + } + + ProgramInfo &getProgramInfo() { return *ProgInfo; } + const InferiorProcess &getInferiorProcess() const { return IP; } + + //===------------------------------------------------------------------===// + // Methods for inspecting the call stack of the program. + // + + /// getStackFrame - Materialize the specified stack frame and return it. If + /// the specified ID is off of the bottom of the stack, throw an exception + /// indicating the problem. + StackFrame &getStackFrame(unsigned ID) { + if (ID >= CallStack.size()) + materializeFrame(ID); + return CallStack[ID]; + } + + /// getCurrentFrame - Return the current stack frame object that the user is + /// inspecting. + StackFrame &getCurrentFrame() { + assert(CallStack.size() > CurrentFrame && + "Must have materialized frame before making it current!"); + return CallStack[CurrentFrame]; + } + + /// getCurrentFrameIdx - Return the current frame the user is inspecting. + /// + unsigned getCurrentFrameIdx() const { return CurrentFrame; } + + /// setCurrentFrameIdx - Set the current frame index to the specified value. + /// Note that the specified frame must have been materialized with + /// getStackFrame before it can be made current. + void setCurrentFrameIdx(unsigned Idx) { + assert(Idx < CallStack.size() && + "Must materialize frame before making it current!"); + CurrentFrame = Idx; + } + private: + /// materializeFrame - Create and process all frames up to and including the + /// specified frame number. This throws an exception if the specified frame + /// ID is nonexistant. + void materializeFrame(unsigned ID); + }; + } + + #endif Index: llvm/include/llvm/Debugger/SourceFile.h diff -c /dev/null llvm/include/llvm/Debugger/SourceFile.h:1.1 *** /dev/null Sun Jan 4 23:23:48 2004 --- llvm/include/llvm/Debugger/SourceFile.h Sun Jan 4 23:23:38 2004 *************** *** 0 **** --- 1,95 ---- + //===- SourceFile.h - Class to represent a source code file -----*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the SourceFile class which is used to represent a single + // file of source code in the program, caching data from the file to make access + // efficient. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_DEBUGGER_SOURCEFILE_H + #define LLVM_DEBUGGER_SOURCEFILE_H + + #include + #include + + namespace llvm { + class GlobalVariable; + + class SourceFile { + /// Filename - This is the full path of the file that is loaded. + /// + std::string Filename; + + /// Descriptor - The debugging descriptor for this source file. If there + /// are multiple descriptors for the same file, this is just the first one + /// encountered. + /// + const GlobalVariable *Descriptor; + + /// FileStart, FileEnd - These pointers point to the start and end of the + /// file data for this file. If there was an error loading the file, these + /// pointers will both be null. + const char *FileStart, *FileEnd; + + /// LineOffset - This vector contains a mapping from source line numbers to + /// their offsets in the file. This data is computed lazily, the first time + /// it is asked for. If there are zero elements allocated in this vector, + /// then it has not yet been computed. + mutable std::vector LineOffset; + + public: + /// SourceFile constructor - Read in the specified source file if it exists, + /// but do not build the LineOffsets table until it is requested. This will + /// NOT throw an exception if the file is not found, if there is an error + /// reading it, or if the user cancels the operation. Instead, it will just + /// be an empty source file. + SourceFile(const std::string &fn, const GlobalVariable *Desc) + : Filename(fn), Descriptor(Desc), FileStart(0), FileEnd(0) { + readFile(); + } + ~SourceFile() { + delete[] FileStart; + } + + /// getDescriptor - Return the debugging decriptor for this source file. + /// + const GlobalVariable *getDescriptor() const { return Descriptor; } + + /// getFilename - Return the fully resolved path that this file was loaded + /// from. + const std::string &getFilename() const { return Filename; } + + /// getSourceLine - Given a line number, return the start and end of the + /// line in the file. If the line number is invalid, or if the file could + /// not be loaded, null pointers are returned for the start and end of the + /// file. Note that line numbers start with 0, not 1. This also strips off + /// any newlines from the end of the line, to ease formatting of the text. + void getSourceLine(unsigned LineNo, const char *&LineStart, + const char *&LineEnd) const; + + /// getNumLines - Return the number of lines the source file contains. + /// + unsigned getNumLines() const { + if (LineOffset.empty()) calculateLineOffsets(); + return LineOffset.size(); + } + + private: + /// readFile - Load Filename into FileStart and FileEnd. + /// + void readFile(); + + /// calculateLineOffsets - Compute the LineOffset vector for the current + /// file. + void calculateLineOffsets() const; + }; + } // end namespace llvm + + #endif Index: llvm/include/llvm/Debugger/SourceLanguage.h diff -c /dev/null llvm/include/llvm/Debugger/SourceLanguage.h:1.1 *** /dev/null Sun Jan 4 23:23:48 2004 --- llvm/include/llvm/Debugger/SourceLanguage.h Sun Jan 4 23:23:38 2004 *************** *** 0 **** --- 1,99 ---- + //===- SourceLanguage.h - Interact with source languages --------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the abstract SourceLanguage interface, which is used by the + // LLVM debugger to parse source-language expressions and render program objects + // into a human readable string. In general, these classes perform all of the + // analysis and interpretation of the language-specific debugger information. + // + // This interface is designed to be completely stateless, so all methods are + // const. + // + //===----------------------------------------------------------------------===// + + #ifndef LLVM_DEBUGGER_SOURCELANGUAGE_H + #define LLVM_DEBUGGER_SOURCELANGUAGE_H + + #include + + namespace llvm { + class GlobalVariable; + class SourceFileInfo; + class SourceFunctionInfo; + class ProgramInfo; + class RuntimeInfo; + + struct SourceLanguage { + virtual ~SourceLanguage() {} + + /// getSourceLanguageName - This method is used to implement the 'show + /// language' command in the debugger. + virtual const char *getSourceLanguageName() const = 0; + + //===------------------------------------------------------------------===// + // Methods used to implement debugger hooks. + // + + /// printInfo - Implementing this method allows the debugger to use + /// language-specific 'info' extensions, e.g., 'info selectors' for objc. + /// This method should return true if the specified string is recognized. + /// + virtual bool printInfo(const std::string &What) const { + return false; + } + + /// lookupFunction - Given a textual function name, return the + /// SourceFunctionInfo descriptor for that function, or null if it cannot be + /// found. If the program is currently running, the RuntimeInfo object + /// provides information about the current evaluation context, otherwise it + /// will be null. + /// + virtual SourceFunctionInfo *lookupFunction(const std::string &FunctionName, + ProgramInfo &PI, + RuntimeInfo *RI = 0) const { + return 0; + } + + + //===------------------------------------------------------------------===// + // Methods used to parse various pieces of program information. + // + + /// createSourceFileInfo - This method can be implemented by the front-end + /// if it needs to keep track of information beyond what the debugger + /// requires. + virtual SourceFileInfo * + createSourceFileInfo(const GlobalVariable *Desc, ProgramInfo &PI) const; + + /// createSourceFunctionInfo - This method can be implemented by the derived + /// SourceLanguage if it needs to keep track of more information than the + /// SourceFunctionInfo has. + virtual SourceFunctionInfo * + createSourceFunctionInfo(const GlobalVariable *Desc, ProgramInfo &PI) const; + + + //===------------------------------------------------------------------===// + // Static methods used to get instances of various source languages. + // + + /// get - This method returns a source-language instance for the specified + /// Dwarf 3 language identifier. If the language is unknown, an object is + /// returned that can support some minimal operations, but is not terribly + /// bright. + static const SourceLanguage &get(unsigned ID); + + /// get*Instance() - These methods return specific instances of languages. + /// + static const SourceLanguage &getCFamilyInstance(); + static const SourceLanguage &getCPlusPlusInstance(); + static const SourceLanguage &getUnknownLanguageInstance(); + }; + } + + #endif From lattner at cs.uiuc.edu Sun Jan 4 23:25:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jan 4 23:25:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Debugger/ Message-ID: <200401050524.XAA30632@zion.cs.uiuc.edu> Changes in directory llvm/lib/Debugger: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/lib/Debugger added to the repository --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sun Jan 4 23:26:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jan 4 23:26:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Debugger/Debugger.cpp Makefile ProgramInfo.cpp README.txt RuntimeInfo.cpp SourceFile.cpp SourceLanguage-CFamily.cpp SourceLanguage-CPlusPlus.cpp SourceLanguage-Unknown.cpp SourceLanguage.cpp UnixLocalInferiorProcess.cpp Message-ID: <200401050525.XAA30709@zion.cs.uiuc.edu> Changes in directory llvm/lib/Debugger: Debugger.cpp added (r1.1) Makefile added (r1.1) ProgramInfo.cpp added (r1.1) README.txt added (r1.1) RuntimeInfo.cpp added (r1.1) SourceFile.cpp added (r1.1) SourceLanguage-CFamily.cpp added (r1.1) SourceLanguage-CPlusPlus.cpp added (r1.1) SourceLanguage-Unknown.cpp added (r1.1) SourceLanguage.cpp added (r1.1) UnixLocalInferiorProcess.cpp added (r1.1) --- Log message: Initial checkin of the LLVM source-level debugger. This is still not finished, by any stretch of the imagination, but it is pretty cool and works :) --- Diffs of the changes: (+1983 -0) Index: llvm/lib/Debugger/Debugger.cpp diff -c /dev/null llvm/lib/Debugger/Debugger.cpp:1.1 *** /dev/null Sun Jan 4 23:25:20 2004 --- llvm/lib/Debugger/Debugger.cpp Sun Jan 4 23:25:10 2004 *************** *** 0 **** --- 1,212 ---- + //===-- Debugger.cpp - LLVM debugger library implementation ---------------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file contains the main implementation of the LLVM debugger library. + // + //===----------------------------------------------------------------------===// + + #include "llvm/Debugger/Debugger.h" + #include "llvm/Module.h" + #include "llvm/ModuleProvider.h" + #include "llvm/Bytecode/Reader.h" + #include "llvm/Debugger/InferiorProcess.h" + #include "Support/StringExtras.h" + using namespace llvm; + + /// Debugger constructor - Initialize the debugger to its initial, empty, state. + /// + Debugger::Debugger() : Environment(0), Program(0), Process(0) { + } + + Debugger::~Debugger() { + // Killing the program could throw an exception. We don't want to progagate + // the exception out of our destructor though. + try { + killProgram(); + } catch (const char *) { + } catch (const std::string &) { + } + + unloadProgram(); + } + + /// getProgramPath - Get the path of the currently loaded program, or an + /// empty string if none is loaded. + std::string Debugger::getProgramPath() const { + return Program ? Program->getModuleIdentifier() : ""; + } + + static Module * + getMaterializedModuleProvider(const std::string &Filename) { + try { + std::auto_ptr Result(getBytecodeModuleProvider(Filename)); + if (!Result.get()) return 0; + + Result->materializeModule(); + return Result.release()->releaseModule(); + } catch (...) { + return 0; + } + } + + /// loadProgram - If a program is currently loaded, unload it. Then search + /// the PATH for the specified program, loading it when found. If the + /// specified program cannot be found, an exception is thrown to indicate the + /// error. + void Debugger::loadProgram(const std::string &Filename) { + if ((Program = getMaterializedModuleProvider(Filename)) || + (Program = getMaterializedModuleProvider(Filename+".bc"))) + return; // Successfully loaded the program. + + // Search the program path for the file... + if (const char *PathS = getenv("PATH")) { + std::string Path = PathS; + + std::string Directory = getToken(Path, ":"); + while (!Directory.empty()) { + if ((Program = getMaterializedModuleProvider(Directory +"/"+ Filename)) || + (Program = getMaterializedModuleProvider(Directory +"/"+ Filename + + ".bc"))) + return; // Successfully loaded the program. + + Directory = getToken(Path, ":"); + } + } + + throw "Could not find program '" + Filename + "'!"; + } + + /// unloadProgram - If a program is running, kill it, then unload all traces + /// of the current program. If no program is loaded, this method silently + /// succeeds. + void Debugger::unloadProgram() { + if (!isProgramLoaded()) return; + killProgram(); + delete Program; + Program = 0; + } + + + /// createProgram - Create an instance of the currently loaded program, + /// killing off any existing one. This creates the program and stops it at + /// the first possible moment. If there is no program loaded or if there is a + /// problem starting the program, this method throws an exception. + void Debugger::createProgram() { + if (!isProgramLoaded()) + throw "Cannot start program: none is loaded."; + + // Kill any existing program. + killProgram(); + + // Add argv[0] to the arguments vector.. + std::vector Args(ProgramArguments); + Args.insert(Args.begin(), getProgramPath()); + + // Start the new program... this could throw if the program cannot be started. + Process = InferiorProcess::create(Program, Args, Environment); + } + + /// killProgram - If the program is currently executing, kill off the + /// process and free up any state related to the currently running program. If + /// there is no program currently running, this just silently succeeds. + void Debugger::killProgram() { + // The destructor takes care of the dirty work. + delete Process; + Process = 0; + } + + /// stepProgram - Implement the 'step' command, continuing execution until + /// the next possible stop point. + void Debugger::stepProgram() { + assert(isProgramRunning() && "Cannot step if the program isn't running!"); + try { + Process->stepProgram(); + } catch (InferiorProcessDead &IPD) { + delete Process; + Process = 0; + throw NonErrorException("The program stopped with exit code " + + itostr(IPD.getExitCode())); + } + } + + /// nextProgram - Implement the 'next' command, continuing execution until + /// the next possible stop point that is in the current function. + void Debugger::nextProgram() { + assert(isProgramRunning() && "Cannot next if the program isn't running!"); + try { + // This should step the process. If the process enters a function, then it + // should 'finish' it. However, figuring this out is tricky. In + // particular, the program can do any of: + // 0. Not change current frame. + // 1. Entering or exiting a region within the current function + // (which changes the frame ID, but which we shouldn't 'finish') + // 2. Exiting the current function (which changes the frame ID) + // 3. Entering a function (which should be 'finish'ed) + // For this reason, we have to be very careful about when we decide to do + // the 'finish'. + + // Get the current frame, but don't trust it. It could change... + void *CurrentFrame = Process->getPreviousFrame(0); + + // Don't trust the current frame: get the caller frame. + void *ParentFrame = Process->getPreviousFrame(CurrentFrame); + + // Ok, we have some information, run the program one step. + Process->stepProgram(); + + // Where is the new frame? The most common case, by far is that it has not + // been modified (Case #0), in which case we don't need to do anything more. + void *NewFrame = Process->getPreviousFrame(0); + if (NewFrame != CurrentFrame) { + // Ok, the frame changed. If we are case #1, then the parent frame will + // be identical. + void *NewParentFrame = Process->getPreviousFrame(NewFrame); + if (ParentFrame != NewParentFrame) { + // Ok, now we know we aren't case #0 or #1. Check to see if we entered + // a new function. If so, the parent frame will be "CurrentFrame". + if (CurrentFrame == NewParentFrame) + Process->finishProgram(NewFrame); + } + } + + } catch (InferiorProcessDead &IPD) { + delete Process; + Process = 0; + throw NonErrorException("The program stopped with exit code " + + itostr(IPD.getExitCode())); + } + } + + /// finishProgram - Implement the 'finish' command, continuing execution + /// until the specified frame ID returns. + void Debugger::finishProgram(void *Frame) { + assert(isProgramRunning() && "Cannot cont if the program isn't running!"); + try { + Process->finishProgram(Frame); + } catch (InferiorProcessDead &IPD) { + delete Process; + Process = 0; + throw NonErrorException("The program stopped with exit code " + + itostr(IPD.getExitCode())); + } + } + + /// contProgram - Implement the 'cont' command, continuing execution until + /// the next breakpoint is encountered. + void Debugger::contProgram() { + assert(isProgramRunning() && "Cannot cont if the program isn't running!"); + try { + Process->contProgram(); + } catch (InferiorProcessDead &IPD) { + delete Process; + Process = 0; + throw NonErrorException("The program stopped with exit code " + + itostr(IPD.getExitCode())); + } + } Index: llvm/lib/Debugger/Makefile diff -c /dev/null llvm/lib/Debugger/Makefile:1.1 *** /dev/null Sun Jan 4 23:25:20 2004 --- llvm/lib/Debugger/Makefile Sun Jan 4 23:25:10 2004 *************** *** 0 **** --- 1,13 ---- + ##===- lib/Debugger/Makefile -------------------------------*- Makefile -*-===## + # + # The LLVM Compiler Infrastructure + # + # This file was developed by the LLVM research group and is distributed under + # the University of Illinois Open Source License. See LICENSE.TXT for details. + # + ##===----------------------------------------------------------------------===## + + LEVEL = ../.. + LIBRARYNAME = debugger + + include $(LEVEL)/Makefile.common Index: llvm/lib/Debugger/ProgramInfo.cpp diff -c /dev/null llvm/lib/Debugger/ProgramInfo.cpp:1.1 *** /dev/null Sun Jan 4 23:25:20 2004 --- llvm/lib/Debugger/ProgramInfo.cpp Sun Jan 4 23:25:10 2004 *************** *** 0 **** --- 1,409 ---- + //===-- ProgramInfo.cpp - Compute and cache info about a program ----------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the ProgramInfo and related classes, by sorting through + // the loaded Module. + // + //===----------------------------------------------------------------------===// + + #include "llvm/Debugger/ProgramInfo.h" + #include "llvm/Constants.h" + #include "llvm/DerivedTypes.h" + #include "llvm/Intrinsics.h" + #include "llvm/iOther.h" + #include "llvm/Module.h" + #include "llvm/Debugger/SourceFile.h" + #include "llvm/Debugger/SourceLanguage.h" + #include "Support/FileUtilities.h" + #include "Support/SlowOperationInformer.h" + #include "Support/STLExtras.h" + using namespace llvm; + + /// getGlobalVariablesUsing - Return all of the global variables which have the + /// specified value in their initializer somewhere. + static void getGlobalVariablesUsing(Value *V, + std::vector &Found) { + for (Value::use_iterator I = V->use_begin(), E = V->use_end(); I != E; ++I) { + if (GlobalVariable *GV = dyn_cast(*I)) + Found.push_back(GV); + else if (Constant *C = dyn_cast(*I)) + getGlobalVariablesUsing(C, Found); + } + } + + /// getStringValue - Turn an LLVM constant pointer that eventually points to a + /// global into a string value. Return an empty string if we can't do it. + /// + static std::string getStringValue(Value *V, unsigned Offset = 0) { + if (GlobalVariable *GV = dyn_cast(V)) { + if (GV->hasInitializer() && isa(GV->getInitializer())) { + ConstantArray *Init = cast(GV->getInitializer()); + if (Init->getType()->getElementType() == Type::SByteTy || + Init->getType()->getElementType() == Type::UByteTy) { + std::string Result = Init->getAsString(); + if (Offset < Result.size()) { + // If we are pointing INTO The string, erase the beginning... + Result.erase(Result.begin(), Result.begin()+Offset); + + // Take off the null terminator, and any string fragments after it. + std::string::size_type NullPos = Result.find_first_of((char)0); + if (NullPos != std::string::npos) + Result.erase(Result.begin()+NullPos, Result.end()); + return Result; + } + } + } + } else if (Constant *C = dyn_cast(V)) { + if (ConstantPointerRef *CPR = dyn_cast(C)) + return getStringValue(CPR->getValue(), Offset); + else if (ConstantExpr *CE = dyn_cast(C)) { + if (CE->getOpcode() == Instruction::GetElementPtr) { + // Turn a gep into the specified offset. + if (CE->getNumOperands() == 3 && + cast(CE->getOperand(1))->isNullValue() && + isa(CE->getOperand(2))) { + return getStringValue(CE->getOperand(0), + Offset+cast(CE->getOperand(2))->getRawValue()); + } + } + } + } + return ""; + } + + /// getNextStopPoint - Follow the def-use chains of the specified LLVM value, + /// traversing the use chains until we get to a stoppoint. When we do, return + /// the source location of the stoppoint. If we don't find a stoppoint, return + /// null. + static const GlobalVariable *getNextStopPoint(const Value *V, unsigned &LineNo, + unsigned &ColNo) { + // The use-def chains can fork. As such, we pick the lowest numbered one we + // find. + const GlobalVariable *LastDesc = 0; + unsigned LastLineNo = ~0; + unsigned LastColNo = ~0; + + for (Value::use_const_iterator UI = V->use_begin(), E = V->use_end(); + UI != E; ++UI) { + bool ShouldRecurse = true; + if (cast(*UI)->getOpcode() == Instruction::PHI) { + // Infinite loops == bad, ignore PHI nodes. + ShouldRecurse = false; + } else if (const CallInst *CI = dyn_cast(*UI)) { + // If we found a stop point, check to see if it is earlier than what we + // already have. If so, remember it. + if (const Function *F = CI->getCalledFunction()) + if (F->getIntrinsicID() == Intrinsic::dbg_stoppoint) { + unsigned CurLineNo = ~0, CurColNo = ~0; + const GlobalVariable *CurDesc = 0; + if (const ConstantInt *C = dyn_cast(CI->getOperand(2))) + CurLineNo = C->getRawValue(); + if (const ConstantInt *C = dyn_cast(CI->getOperand(3))) + CurColNo = C->getRawValue(); + const Value *Op = CI->getOperand(4); + if (const ConstantPointerRef *CPR = dyn_cast(Op)) + Op = CPR->getValue(); + + if ((CurDesc = dyn_cast(Op)) && + (LineNo < LastLineNo || + (LineNo == LastLineNo && ColNo < LastColNo))) { + LastDesc = CurDesc; + LastLineNo = CurLineNo; + LastColNo = CurColNo; + } + ShouldRecurse = false; + } + + } + + // If this is not a phi node or a stopping point, recursively scan the users + // of this instruction to skip over region.begin's and the like. + if (ShouldRecurse) { + unsigned CurLineNo, CurColNo; + if (const GlobalVariable *GV = getNextStopPoint(*UI, CurLineNo,CurColNo)){ + if (LineNo < LastLineNo || (LineNo == LastLineNo && ColNo < LastColNo)){ + LastDesc = GV; + LastLineNo = CurLineNo; + LastColNo = CurColNo; + } + } + } + } + + if (LastDesc) { + LineNo = LastLineNo != ~0U ? LastLineNo : 0; + ColNo = LastColNo != ~0U ? LastColNo : 0; + } + return LastDesc; + } + + + //===----------------------------------------------------------------------===// + // SourceFileInfo implementation + // + + SourceFileInfo::SourceFileInfo(const GlobalVariable *Desc, + const SourceLanguage &Lang) + : Language(&Lang), Descriptor(Desc) { + Version = 0; + SourceText = 0; + + if (Desc && Desc->hasInitializer()) + if (ConstantStruct *CS = dyn_cast(Desc->getInitializer())) + if (CS->getNumOperands() > 4) { + if (ConstantUInt *CUI = dyn_cast(CS->getOperand(1))) + Version = CUI->getValue(); + + BaseName = getStringValue(CS->getOperand(3)); + Directory = getStringValue(CS->getOperand(4)); + } + } + + SourceFileInfo::~SourceFileInfo() { + delete SourceText; + } + + SourceFile &SourceFileInfo::getSourceText() const { + // FIXME: this should take into account the source search directories! + if (SourceText == 0) // Read the file in if we haven't already. + if (!Directory.empty() && FileOpenable(Directory+"/"+BaseName)) + SourceText = new SourceFile(Directory+"/"+BaseName, Descriptor); + else + SourceText = new SourceFile(BaseName, Descriptor); + return *SourceText; + } + + + //===----------------------------------------------------------------------===// + // SourceFunctionInfo implementation + // + SourceFunctionInfo::SourceFunctionInfo(ProgramInfo &PI, + const GlobalVariable *Desc) + : Descriptor(Desc) { + LineNo = ColNo = 0; + if (Desc && Desc->hasInitializer()) + if (ConstantStruct *CS = dyn_cast(Desc->getInitializer())) + if (CS->getNumOperands() > 2) { + // Entry #1 is the file descriptor. + if (const ConstantPointerRef *CPR = + dyn_cast(CS->getOperand(1))) + if (const GlobalVariable *GV = + dyn_cast(CPR->getValue())) + SourceFile = &PI.getSourceFile(GV); + + // Entry #2 is the function name. + Name = getStringValue(CS->getOperand(2)); + } + } + + /// getSourceLocation - This method returns the location of the first stopping + /// point in the function. + void SourceFunctionInfo::getSourceLocation(unsigned &RetLineNo, + unsigned &RetColNo) const { + // If we haven't computed this yet... + if (!LineNo) { + // Look at all of the users of the function descriptor, looking for calls to + // %llvm.dbg.func.start. + for (Value::use_const_iterator UI = Descriptor->use_begin(), + E = Descriptor->use_end(); UI != E; ++UI) + if (const CallInst *CI = dyn_cast(*UI)) + if (const Function *F = CI->getCalledFunction()) + if (F->getIntrinsicID() == Intrinsic::dbg_func_start) { + // We found the start of the function. Check to see if there are + // any stop points on the use-list of the function start. + const GlobalVariable *SD = getNextStopPoint(CI, LineNo, ColNo); + if (SD) { // We found the first stop point! + // This is just a sanity check. + if (getSourceFile().getDescriptor() != SD) + std::cout << "WARNING: first line of function is not in the" + " file that the function descriptor claims it is in.\n"; + break; + } + } + } + RetLineNo = LineNo; RetColNo = ColNo; + } + + //===----------------------------------------------------------------------===// + // ProgramInfo implementation + // + + ProgramInfo::ProgramInfo(Module *m) : M(m) { + assert(M && "Cannot create program information with a null module!"); + ProgramTimeStamp = getFileTimestamp(M->getModuleIdentifier()); + + SourceFilesIsComplete = false; + SourceFunctionsIsComplete = false; + } + + ProgramInfo::~ProgramInfo() { + // Delete cached information about source program objects... + for (std::map::iterator + I = SourceFiles.begin(), E = SourceFiles.end(); I != E; ++I) + delete I->second; + for (std::map::iterator + I = SourceFunctions.begin(), E = SourceFunctions.end(); I != E; ++I) + delete I->second; + + // Delete the source language caches. + for (unsigned i = 0, e = LanguageCaches.size(); i != e; ++i) + delete LanguageCaches[i].second; + } + + + //===----------------------------------------------------------------------===// + // SourceFileInfo tracking... + // + + /// getSourceFile - Return source file information for the specified source file + /// descriptor object, adding it to the collection as needed. This method + /// always succeeds (is unambiguous), and is always efficient. + /// + const SourceFileInfo & + ProgramInfo::getSourceFile(const GlobalVariable *Desc) { + SourceFileInfo *&Result = SourceFiles[Desc]; + if (Result) return *Result; + + // Figure out what language this source file comes from... + unsigned LangID = 0; // Zero is unknown language + if (Desc && Desc->hasInitializer()) + if (ConstantStruct *CS = dyn_cast(Desc->getInitializer())) + if (CS->getNumOperands() > 2) + if (ConstantUInt *CUI = dyn_cast(CS->getOperand(2))) + LangID = CUI->getValue(); + + const SourceLanguage &Lang = SourceLanguage::get(LangID); + SourceFileInfo *New = Lang.createSourceFileInfo(Desc, *this); + + // FIXME: this should check to see if there is already a Filename/WorkingDir + // pair that matches this one. If so, we shouldn't create the duplicate! + // + SourceFileIndex.insert(std::make_pair(New->getBaseName(), New)); + return *(Result = New); + } + + + /// getSourceFiles - Index all of the source files in the program and return + /// a mapping of it. This information is lazily computed the first time + /// that it is requested. Since this information can take a long time to + /// compute, the user is given a chance to cancel it. If this occurs, an + /// exception is thrown. + const std::map & + ProgramInfo::getSourceFiles(bool RequiresCompleteMap) { + // If we have a fully populated map, or if the client doesn't need one, just + // return what we have. + if (SourceFilesIsComplete || !RequiresCompleteMap) + return SourceFiles; + + // Ok, all of the source file descriptors (compile_unit in dwarf terms), + // should be on the use list of the llvm.dbg.translation_units global. + // + GlobalVariable *Units = + M->getGlobalVariable("llvm.dbg.translation_units", + StructType::get(std::vector())); + if (Units == 0) + throw "Program contains no debugging information!"; + + std::vector TranslationUnits; + getGlobalVariablesUsing(Units, TranslationUnits); + + SlowOperationInformer SOI("building source files index"); + + // Loop over all of the translation units found, building the SourceFiles + // mapping. + for (unsigned i = 0, e = TranslationUnits.size(); i != e; ++i) { + getSourceFile(TranslationUnits[i]); + SOI.progress(i+1, e); + } + + // Ok, if we got this far, then we indexed the whole program. + SourceFilesIsComplete = true; + return SourceFiles; + } + + /// getSourceFile - Look up the file with the specified name. If there is + /// more than one match for the specified filename, prompt the user to pick + /// one. If there is no source file that matches the specified name, throw + /// an exception indicating that we can't find the file. Otherwise, return + /// the file information for that file. + const SourceFileInfo &ProgramInfo::getSourceFile(const std::string &Filename) { + std::multimap::const_iterator Start, End; + getSourceFiles(); + tie(Start, End) = SourceFileIndex.equal_range(Filename); + + if (Start == End) throw "Could not find source file '" + Filename + "'!"; + const SourceFileInfo &SFI = *Start->second; + ++Start; + if (Start == End) return SFI; + + throw "FIXME: Multiple source files with the same name not implemented!"; + } + + + //===----------------------------------------------------------------------===// + // SourceFunctionInfo tracking... + // + + + /// getFunction - Return function information for the specified function + /// descriptor object, adding it to the collection as needed. This method + /// always succeeds (is unambiguous), and is always efficient. + /// + const SourceFunctionInfo & + ProgramInfo::getFunction(const GlobalVariable *Desc) { + SourceFunctionInfo *&Result = SourceFunctions[Desc]; + if (Result) return *Result; + + // Figure out what language this function comes from... + const GlobalVariable *SourceFileDesc = 0; + if (Desc && Desc->hasInitializer()) + if (ConstantStruct *CS = dyn_cast(Desc->getInitializer())) + if (CS->getNumOperands() > 0) + if (const ConstantPointerRef *CPR = + dyn_cast(CS->getOperand(1))) + SourceFileDesc = dyn_cast(CPR->getValue()); + + const SourceLanguage &Lang = getSourceFile(SourceFileDesc).getLanguage(); + return *(Result = Lang.createSourceFunctionInfo(Desc, *this)); + } + + + // getSourceFunctions - Index all of the functions in the program and return + // them. This information is lazily computed the first time that it is + // requested. Since this information can take a long time to compute, the user + // is given a chance to cancel it. If this occurs, an exception is thrown. + const std::map & + ProgramInfo::getSourceFunctions(bool RequiresCompleteMap) { + if (SourceFunctionsIsComplete || !RequiresCompleteMap) + return SourceFunctions; + + // Ok, all of the source function descriptors (subprogram in dwarf terms), + // should be on the use list of the llvm.dbg.translation_units global. + // + GlobalVariable *Units = + M->getGlobalVariable("llvm.dbg.globals", + StructType::get(std::vector())); + if (Units == 0) + throw "Program contains no debugging information!"; + + std::vector Functions; + getGlobalVariablesUsing(Units, Functions); + + SlowOperationInformer SOI("building functions index"); + + // Loop over all of the functions found, building the SourceFunctions mapping. + for (unsigned i = 0, e = Functions.size(); i != e; ++i) { + getFunction(Functions[i]); + SOI.progress(i+1, e); + } + + // Ok, if we got this far, then we indexed the whole program. + SourceFunctionsIsComplete = true; + return SourceFunctions; + } Index: llvm/lib/Debugger/README.txt diff -c /dev/null llvm/lib/Debugger/README.txt:1.1 *** /dev/null Sun Jan 4 23:25:20 2004 --- llvm/lib/Debugger/README.txt Sun Jan 4 23:25:10 2004 *************** *** 0 **** --- 1,8 ---- + //===-- llvm/lib/Debugger/ - LLVM Debugger interfaces ---------------------===// + + This directory contains the implementation of the LLVM debugger backend. This + directory builds into a library which can be used by various debugger + front-ends to debug LLVM programs. The current command line LLVM debugger, + llvm-db is currently the only client of this library, but others could be + built, to provide a GUI front-end for example. + Index: llvm/lib/Debugger/RuntimeInfo.cpp diff -c /dev/null llvm/lib/Debugger/RuntimeInfo.cpp:1.1 *** /dev/null Sun Jan 4 23:25:20 2004 --- llvm/lib/Debugger/RuntimeInfo.cpp Sun Jan 4 23:25:10 2004 *************** *** 0 **** --- 1,69 ---- + //===-- RuntimeInfo.cpp - Compute and cache info about running program ----===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the RuntimeInfo and related classes, by querying and + // cachine information from the running inferior process. + // + //===----------------------------------------------------------------------===// + + #include "llvm/Debugger/InferiorProcess.h" + #include "llvm/Debugger/ProgramInfo.h" + #include "llvm/Debugger/RuntimeInfo.h" + using namespace llvm; + + //===----------------------------------------------------------------------===// + // StackFrame class implementation + + StackFrame::StackFrame(RuntimeInfo &ri, void *ParentFrameID) + : RI(ri), SourceInfo(0) { + FrameID = RI.getInferiorProcess().getPreviousFrame(ParentFrameID); + if (FrameID == 0) throw "Stack frame does not exist!"; + + // Compute lazily as needed. + FunctionDesc = 0; + } + + const GlobalVariable *StackFrame::getFunctionDesc() { + if (FunctionDesc == 0) + FunctionDesc = RI.getInferiorProcess().getSubprogramDesc(FrameID); + return FunctionDesc; + } + + /// getSourceLocation - Return the source location that this stack frame is + /// sitting at. + void StackFrame::getSourceLocation(unsigned &lineNo, unsigned &colNo, + const SourceFileInfo *&sourceInfo) { + if (SourceInfo == 0) { + const GlobalVariable *SourceDesc = 0; + RI.getInferiorProcess().getFrameLocation(FrameID, LineNo,ColNo, SourceDesc); + SourceInfo = &RI.getProgramInfo().getSourceFile(SourceDesc); + } + + lineNo = LineNo; + colNo = ColNo; + sourceInfo = SourceInfo; + } + + //===----------------------------------------------------------------------===// + // RuntimeInfo class implementation + + /// materializeFrame - Create and process all frames up to and including the + /// specified frame number. This throws an exception if the specified frame + /// ID is nonexistant. + void RuntimeInfo::materializeFrame(unsigned ID) { + assert(ID >= CallStack.size() && "no need to materialize this frame!"); + void *CurFrame = 0; + if (!CallStack.empty()) + CurFrame = CallStack.back().getFrameID(); + + while (CallStack.size() <= ID) { + CallStack.push_back(StackFrame(*this, CurFrame)); + CurFrame = CallStack.back().getFrameID(); + } + } Index: llvm/lib/Debugger/SourceFile.cpp diff -c /dev/null llvm/lib/Debugger/SourceFile.cpp:1.1 *** /dev/null Sun Jan 4 23:25:20 2004 --- llvm/lib/Debugger/SourceFile.cpp Sun Jan 4 23:25:10 2004 *************** *** 0 **** --- 1,116 ---- + //===-- SourceFile.cpp - SourceFile implementation for the debugger -------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the SourceFile class for the LLVM debugger. + // + //===----------------------------------------------------------------------===// + + #include "llvm/Debugger/SourceFile.h" + #include "Support/SlowOperationInformer.h" + #include "Support/FileUtilities.h" + #include + #include + #include + #include + using namespace llvm; + + /// readFile - Load Filename into FileStart and FileEnd. + /// + void SourceFile::readFile() { + ssize_t FileSize = getFileSize(Filename); + if (FileSize != -1) { + FDHandle FD(open(Filename.c_str(), O_RDONLY)); + if (FD != -1) { + char *FilePos = new char[FileSize]; + FileStart = FilePos; + + // If this takes a long time, inform the user what we are doing. + SlowOperationInformer SOI("loading source file '" + Filename + "'"); + + try { + // Read in the whole buffer. + unsigned Amount = FileSize; + while (Amount) { + unsigned AmountToRead = 512*1024; + if (Amount < AmountToRead) AmountToRead = Amount; + ssize_t ReadAmount = read(FD, FilePos, AmountToRead); + if (ReadAmount < 0 && errno == EINTR) + continue; + else if (ReadAmount <= 0) { + // Couldn't read whole file just free memory and continue. + throw "Error reading file '" + Filename + "'!"; + } + Amount -= ReadAmount; + FilePos += ReadAmount; + + SOI.progress(FileSize-Amount, FileSize); + } + + } catch (const std::string &Msg) { + std::cout << Msg << "\n"; + // If the user cancels the operation, clean up after ourselves. + delete [] FileStart; + FileStart = 0; + return; + } + + FileEnd = FileStart+FileSize; + } + } + } + + /// calculateLineOffsets - Compute the LineOffset vector for the current file. + /// + void SourceFile::calculateLineOffsets() const { + assert(LineOffset.empty() && "Line offsets already computed!"); + const char *BufPtr = FileStart; + do { + LineOffset.push_back(BufPtr-FileStart); + + // Scan until we get to a newline. + while (BufPtr != FileEnd && *BufPtr != '\n' && *BufPtr != '\r') + ++BufPtr; + + if (BufPtr != FileEnd) { + ++BufPtr; // Skip over the \n or \r + if (BufPtr[-1] == '\r' && BufPtr != FileEnd && BufPtr[0] == '\n') + ++BufPtr; // Skip over dos/windows style \r\n's + } + } while (BufPtr != FileEnd); + } + + + /// getSourceLine - Given a line number, return the start and end of the line + /// in the file. If the line number is invalid, or if the file could not be + /// loaded, null pointers are returned for the start and end of the file. Note + /// that line numbers start with 0, not 1. + void SourceFile::getSourceLine(unsigned LineNo, const char *&LineStart, + const char *&LineEnd) const { + LineStart = LineEnd = 0; + if (FileStart == 0) return; // Couldn't load file, return null pointers + if (LineOffset.empty()) calculateLineOffsets(); + + // Asking for an out-of-range line number? + if (LineNo >= LineOffset.size()) return; + + // Otherwise, they are asking for a valid line, which we can fulfill. + LineStart = FileStart+LineOffset[LineNo]; + + if (LineNo+1 < LineOffset.size()) + LineEnd = FileStart+LineOffset[LineNo+1]; + else + LineEnd = FileEnd; + + // If the line ended with a newline, strip it off. + while (LineEnd != LineStart && (LineEnd[-1] == '\n' || LineEnd[-1] == '\r')) + --LineEnd; + + assert(LineEnd >= LineStart && "We somehow got our pointers swizzled!"); + } + Index: llvm/lib/Debugger/SourceLanguage-CFamily.cpp diff -c /dev/null llvm/lib/Debugger/SourceLanguage-CFamily.cpp:1.1 *** /dev/null Sun Jan 4 23:25:20 2004 --- llvm/lib/Debugger/SourceLanguage-CFamily.cpp Sun Jan 4 23:25:10 2004 *************** *** 0 **** --- 1,28 ---- + //===-- SourceLanguage-CFamily.cpp - C family SourceLanguage impl ---------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the SourceLanguage class for the C family of languages + // (K&R C, C89, C99, etc). + // + //===----------------------------------------------------------------------===// + + #include "llvm/Debugger/SourceLanguage.h" + using namespace llvm; + + #if 0 + namespace { + struct CSL : public SourceLanguage { + } TheCSourceLanguageInstance; + } + #endif + + const SourceLanguage &SourceLanguage::getCFamilyInstance() { + return get(0); // We don't have an implementation for C yet fall back on + // generic + } Index: llvm/lib/Debugger/SourceLanguage-CPlusPlus.cpp diff -c /dev/null llvm/lib/Debugger/SourceLanguage-CPlusPlus.cpp:1.1 *** /dev/null Sun Jan 4 23:25:20 2004 --- llvm/lib/Debugger/SourceLanguage-CPlusPlus.cpp Sun Jan 4 23:25:10 2004 *************** *** 0 **** --- 1,27 ---- + //===-- SourceLanguage-CPlusPlus.cpp - C++ SourceLanguage impl ------------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the SourceLanguage class for the C++ language. + // + //===----------------------------------------------------------------------===// + + #include "llvm/Debugger/SourceLanguage.h" + using namespace llvm; + + #if 0 + namespace { + struct CPPSL : public SourceLanguage { + } TheCPlusPlusLanguageInstance; + } + #endif + + const SourceLanguage &SourceLanguage::getCPlusPlusInstance() { + return get(0); // We don't have an implementation for C yet fall back on + // generic + } Index: llvm/lib/Debugger/SourceLanguage-Unknown.cpp diff -c /dev/null llvm/lib/Debugger/SourceLanguage-Unknown.cpp:1.1 *** /dev/null Sun Jan 4 23:25:20 2004 --- llvm/lib/Debugger/SourceLanguage-Unknown.cpp Sun Jan 4 23:25:10 2004 *************** *** 0 **** --- 1,136 ---- + //===-- SourceLanguage-Unknown.cpp - Implement itf for unknown languages --===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // If the LLVM debugger does not have a module for a particular language, it + // falls back on using this one to perform the source-language interface. This + // interface is not wonderful, but it gets the job done. + // + //===----------------------------------------------------------------------===// + + #include "llvm/Debugger/SourceLanguage.h" + #include "llvm/Debugger/ProgramInfo.h" + #include + using namespace llvm; + + //===----------------------------------------------------------------------===// + // Implement the SourceLanguage cache for the Unknown language. + // + + namespace { + /// SLUCache - This cache allows for efficient lookup of source functions by + /// name. + /// + struct SLUCache : public SourceLanguageCache { + ProgramInfo &PI; + std::multimap FunctionMap; + public: + SLUCache(ProgramInfo &pi); + + typedef std::multimap::const_iterator + fm_iterator; + + std::pair + getFunction(const std::string &Name) const { + return FunctionMap.equal_range(Name); + } + + SourceFunctionInfo *addSourceFunction(SourceFunctionInfo *SF) { + FunctionMap.insert(std::make_pair(SF->getSymbolicName(), SF)); + return SF; + } + }; + } + + SLUCache::SLUCache(ProgramInfo &pi) : PI(pi) { + } + + + //===----------------------------------------------------------------------===// + // Implement SourceLanguageUnknown class, which is used to handle unrecognized + // languages. + // + + namespace { + struct SLU : public SourceLanguage { + //===------------------------------------------------------------------===// + // Implement the miscellaneous methods... + // + virtual const char *getSourceLanguageName() const { + return "unknown"; + } + + /// lookupFunction - Given a textual function name, return the + /// SourceFunctionInfo descriptor for that function, or null if it cannot be + /// found. If the program is currently running, the RuntimeInfo object + /// provides information about the current evaluation context, otherwise it + /// will be null. + /// + virtual SourceFunctionInfo *lookupFunction(const std::string &FunctionName, + ProgramInfo &PI, + RuntimeInfo *RI = 0) const; + + //===------------------------------------------------------------------===// + // We do use a cache for information... + // + typedef SLUCache CacheType; + SLUCache *createSourceLanguageCache(ProgramInfo &PI) const { + return new SLUCache(PI); + } + + /// createSourceFunctionInfo - Create the new object and inform the cache of + /// the new function. + virtual SourceFunctionInfo * + createSourceFunctionInfo(const GlobalVariable *Desc, ProgramInfo &PI) const; + + } TheUnknownSourceLanguageInstance; + } + + const SourceLanguage &SourceLanguage::getUnknownLanguageInstance() { + return TheUnknownSourceLanguageInstance; + } + + + SourceFunctionInfo * + SLU::createSourceFunctionInfo(const GlobalVariable *Desc, + ProgramInfo &PI) const { + SourceFunctionInfo *Result = new SourceFunctionInfo(PI, Desc); + return PI.getLanguageCache(this).addSourceFunction(Result); + } + + + /// lookupFunction - Given a textual function name, return the + /// SourceFunctionInfo descriptor for that function, or null if it cannot be + /// found. If the program is currently running, the RuntimeInfo object + /// provides information about the current evaluation context, otherwise it will + /// be null. + /// + SourceFunctionInfo *SLU::lookupFunction(const std::string &FunctionName, + ProgramInfo &PI, RuntimeInfo *RI) const{ + SLUCache &Cache = PI.getLanguageCache(this); + std::pair IP + = Cache.getFunction(FunctionName); + + if (IP.first == IP.second) { + if (PI.allSourceFunctionsRead()) + return 0; // Nothing found + + // Otherwise, we might be able to find the function if we read all of them + // in. Do so now. + PI.getSourceFunctions(); + assert(PI.allSourceFunctionsRead() && "Didn't read in all functions?"); + return lookupFunction(FunctionName, PI, RI); + } + + SourceFunctionInfo *Found = IP.first->second; + ++IP.first; + if (IP.first != IP.second) + std::cout << "Whoa, found multiple functions with the same name. I should" + << " ask the user which one to use: FIXME!\n"; + return Found; + } Index: llvm/lib/Debugger/SourceLanguage.cpp diff -c /dev/null llvm/lib/Debugger/SourceLanguage.cpp:1.1 *** /dev/null Sun Jan 4 23:25:20 2004 --- llvm/lib/Debugger/SourceLanguage.cpp Sun Jan 4 23:25:10 2004 *************** *** 0 **** --- 1,54 ---- + //===-- SourceLanguage.cpp - Implement the SourceLanguage class -----------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements the SourceLanguage class. + // + //===----------------------------------------------------------------------===// + + #include "llvm/Debugger/SourceLanguage.h" + #include "llvm/Debugger/ProgramInfo.h" + using namespace llvm; + + const SourceLanguage &SourceLanguage::get(unsigned ID) { + switch (ID) { + case 1: // DW_LANG_C89 + case 2: // DW_LANG_C + case 12: // DW_LANG_C99 + return getCFamilyInstance(); + + case 4: // DW_LANG_C_plus_plus + return getCPlusPlusInstance(); + + case 3: // DW_LANG_Ada83 + case 5: // DW_LANG_Cobol74 + case 6: // DW_LANG_Cobol85 + case 7: // DW_LANG_Fortran77 + case 8: // DW_LANG_Fortran90 + case 9: // DW_LANG_Pascal83 + case 10: // DW_LANG_Modula2 + case 11: // DW_LANG_Java + case 13: // DW_LANG_Ada95 + case 14: // DW_LANG_Fortran95 + default: + return getUnknownLanguageInstance(); + } + } + + + SourceFileInfo * + SourceLanguage::createSourceFileInfo(const GlobalVariable *Desc, + ProgramInfo &PI) const { + return new SourceFileInfo(Desc, *this); + } + + SourceFunctionInfo * + SourceLanguage::createSourceFunctionInfo(const GlobalVariable *Desc, + ProgramInfo &PI) const { + return new SourceFunctionInfo(PI, Desc); + } Index: llvm/lib/Debugger/UnixLocalInferiorProcess.cpp diff -c /dev/null llvm/lib/Debugger/UnixLocalInferiorProcess.cpp:1.1 *** /dev/null Sun Jan 4 23:25:20 2004 --- llvm/lib/Debugger/UnixLocalInferiorProcess.cpp Sun Jan 4 23:25:10 2004 *************** *** 0 **** --- 1,911 ---- + //===-- UnixLocalInferiorProcess.cpp - A Local process on a Unixy system --===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file provides one implementation of the InferiorProcess class, which is + // designed to be used on unixy systems (those that support pipe, fork, exec, + // and signals). + // + // When the process is started, the debugger creates a pair of pipes, forks, and + // makes the child starts executing the program. The child executes the process + // with an IntrinsicLowering instance that turns debugger intrinsics into actual + // callbacks. + // + // This target takes advantage of the fact that the Module* addresses in the + // parent and the Module* addresses in the child will be the same, due to the + // use of fork(). As such, global addresses looked up in the child can be sent + // over the pipe to the debugger. + // + //===----------------------------------------------------------------------===// + + #include "llvm/Debugger/InferiorProcess.h" + #include "llvm/IntrinsicLowering.h" + #include "llvm/Constant.h" + #include "llvm/Module.h" + #include "llvm/ModuleProvider.h" + #include "llvm/Type.h" + #include "llvm/iOther.h" + #include "llvm/ExecutionEngine/GenericValue.h" + #include "llvm/ExecutionEngine/ExecutionEngine.h" + #include "Support/FileUtilities.h" + #include "Support/StringExtras.h" + #include + #include // Unix specific debugger support + #include + #include + using namespace llvm; + + // runChild - Entry point for the child process. + static void runChild(Module *M, const std::vector &Arguments, + const char * const *envp, + FDHandle ReadFD, FDHandle WriteFD); + + //===----------------------------------------------------------------------===// + // Parent/Child Pipe Protocol + //===----------------------------------------------------------------------===// + // + // The parent/child communication protocol is designed to have the child process + // responding to requests that the debugger makes. Whenever the child process + // has stopped (due to a break point, single stepping, etc), the child process + // enters a message processing loop, where it reads and responds to commands + // until the parent decides that it wants to continue execution in some way. + // + // Whenever the child process stops, it notifies the debugger by sending an + // character over the wire. + // + + namespace { + /// LocationToken - Objects of this type are sent across the pipe from the + /// child to the parent to indicate where various stack frames are located. + struct LocationToken { + unsigned Line, Col; + const GlobalVariable *File; + LocationToken(unsigned L = 0, unsigned C = 0, const GlobalVariable *F = 0) + : Line(L), Col(C), File(F) {} + }; + } + + // Once the debugger process has received the LocationToken, it can make + // requests of the child by sending one of the following enum values followed by + // any data required by that command. The child responds with data appropriate + // to the command. + // + namespace { + /// CommandID - This enum defines all of the commands that the child process + /// can respond to. The actual expected data and responses are defined as the + /// enum values are defined. + /// + enum CommandID { + //===------------------------------------------------------------------===// + // Execution commands - These are sent to the child to from the debugger to + // get it to do certain things. + // + + // StepProgram: void->char - This command causes the program to continue + // execution, but stop as soon as it reaches another stoppoint. + StepProgram, + + // FinishProgram: FrameDesc*->char - This command causes the program to + // continue execution until the specified function frame returns. + FinishProgram, + + // ContProgram: void->char - This command causes the program to continue + // execution, stopping at some point in the future. + ContProgram, + + // GetSubprogramDescriptor: FrameDesc*->GlobalValue* - This command returns + // the GlobalValue* descriptor object for the specified stack frame. + GetSubprogramDescriptor, + + // GetParentFrame: FrameDesc*->FrameDesc* - This command returns the frame + // descriptor for the parent stack frame to the specified one, or null if + // there is none. + GetParentFrame, + + // GetFrameLocation - FrameDesc*->LocationToken - This command returns the + // location that a particular stack frame is stopped at. + GetFrameLocation, + + // AddBreakpoint - LocationToken->unsigned - This command instructs the + // target to install a breakpoint at the specified location. + AddBreakpoint, + + // RemoveBreakpoint - unsigned->void - This command instructs the target to + // remove a breakpoint. + RemoveBreakpoint, + }; + } + + + + + //===----------------------------------------------------------------------===// + // Parent Process Code + //===----------------------------------------------------------------------===// + + namespace { + class IP : public InferiorProcess { + // ReadFD, WriteFD - The file descriptors to read/write to the inferior + // process. + FDHandle ReadFD, WriteFD; + + // ChildPID - The unix PID of the child process we forked. + mutable pid_t ChildPID; + public: + IP(Module *M, const std::vector &Arguments, + const char * const *envp); + ~IP(); + + std::string getStatus() const; + + /// Execution method implementations... + virtual void stepProgram(); + virtual void finishProgram(void *Frame); + virtual void contProgram(); + + + // Stack frame method implementations... + virtual void *getPreviousFrame(void *Frame) const; + virtual const GlobalVariable *getSubprogramDesc(void *Frame) const; + virtual void getFrameLocation(void *Frame, unsigned &LineNo, + unsigned &ColNo, + const GlobalVariable *&SourceDesc) const; + + // Breakpoint implementation methods + virtual unsigned addBreakpoint(unsigned LineNo, unsigned ColNo, + const GlobalVariable *SourceDesc); + virtual void removeBreakpoint(unsigned ID); + + + private: + /// startChild - This starts up the child process, and initializes the + /// ChildPID member. + /// + void startChild(Module *M, const std::vector &Arguments, + const char * const *envp); + + /// killChild - Kill or reap the child process. This throws the + /// InferiorProcessDead exception an exit code if the process had already + /// died, otherwise it just kills it and returns. + void killChild() const; + + private: + // Methods for communicating with the child process. If the child exits or + // dies while attempting to communicate with it, ChildPID is set to zero and + // an exception is thrown. + + /// readFromChild - Low-level primitive to read some data from the child, + /// throwing an exception if it dies. + void readFromChild(void *Buffer, unsigned Size) const; + + /// writeToChild - Low-level primitive to send some data to the child + /// process, throwing an exception if the child died. + void writeToChild(void *Buffer, unsigned Size) const; + + /// sendCommand - Send a command token and the request data to the child. + /// + void sendCommand(CommandID Command, void *Data, unsigned Size) const; + + /// waitForStop - This method waits for the child process to reach a stop + /// point. + void waitForStop(); + }; + } + + // create - This is the factory method for the InferiorProcess class. Since + // there is currently only one subclass of InferiorProcess, we just define it + // here. + InferiorProcess * + InferiorProcess::create(Module *M, const std::vector &Arguments, + const char * const *envp) { + return new IP(M, Arguments, envp); + } + + /// IP constructor - Create some pipes, them fork a child process. The child + /// process should start execution of the debugged program, but stop at the + /// first available opportunity. + IP::IP(Module *M, const std::vector &Arguments, + const char * const *envp) + : InferiorProcess(M) { + + // Start the child running... + startChild(M, Arguments, envp); + + // Okay, we created the program and it is off and running. Wait for it to + // stop now. + try { + waitForStop(); + } catch (InferiorProcessDead &IPD) { + throw "Error waiting for the child process to stop. " + "It exited with status " + itostr(IPD.getExitCode()); + } + } + + IP::~IP() { + // If the child is still running, kill it. + if (!ChildPID) return; + + killChild(); + } + + /// getStatus - Return information about the unix process being debugged. + /// + std::string IP::getStatus() const { + if (ChildPID == 0) + return "Unix target. ERROR: child process appears to be dead!\n"; + + return "Unix target: PID #" + utostr((unsigned)ChildPID) + "\n"; + } + + + /// startChild - This starts up the child process, and initializes the + /// ChildPID member. + /// + void IP::startChild(Module *M, const std::vector &Arguments, + const char * const *envp) { + // Create the pipes. Make sure to immediately assign the returned file + // descriptors to FDHandle's so they get destroyed if an exception is thrown. + int FDs[2]; + if (pipe(FDs)) throw "Error creating a pipe!"; + FDHandle ChildReadFD(FDs[0]); + WriteFD = FDs[1]; + + if (pipe(FDs)) throw "Error creating a pipe!"; + ReadFD = FDs[0]; + FDHandle ChildWriteFD(FDs[1]); + + // Fork off the child process. + switch (ChildPID = fork()) { + case -1: throw "Error forking child process!"; + case 0: // child + delete this; // Free parent pipe file descriptors + runChild(M, Arguments, envp, ChildReadFD, ChildWriteFD); + exit(1); + default: break; + } + } + + /// sendCommand - Send a command token and the request data to the child. + /// + void IP::sendCommand(CommandID Command, void *Data, unsigned Size) const { + writeToChild(&Command, sizeof(Command)); + writeToChild(Data, Size); + } + + /// stepProgram - Implement the 'step' command, continuing execution until + /// the next possible stop point. + void IP::stepProgram() { + sendCommand(StepProgram, 0, 0); + waitForStop(); + } + + /// finishProgram - Implement the 'finish' command, executing the program until + /// the current function returns to its caller. + void IP::finishProgram(void *Frame) { + sendCommand(FinishProgram, &Frame, sizeof(Frame)); + waitForStop(); + } + + /// contProgram - Implement the 'cont' command, continuing execution until + /// a breakpoint is encountered. + void IP::contProgram() { + sendCommand(ContProgram, 0, 0); + waitForStop(); + } + + + //===----------------------------------------------------------------------===// + // Stack manipulation methods + // + + /// getPreviousFrame - Given the descriptor for the current stack frame, + /// return the descriptor for the caller frame. This returns null when it + /// runs out of frames. + void *IP::getPreviousFrame(void *Frame) const { + sendCommand(GetParentFrame, &Frame, sizeof(Frame)); + readFromChild(&Frame, sizeof(Frame)); + return Frame; + } + + /// getSubprogramDesc - Return the subprogram descriptor for the current + /// stack frame. + const GlobalVariable *IP::getSubprogramDesc(void *Frame) const { + sendCommand(GetSubprogramDescriptor, &Frame, sizeof(Frame)); + const GlobalVariable *Desc; + readFromChild(&Desc, sizeof(Desc)); + return Desc; + } + + /// getFrameLocation - This method returns the source location where each stack + /// frame is stopped. + void IP::getFrameLocation(void *Frame, unsigned &LineNo, unsigned &ColNo, + const GlobalVariable *&SourceDesc) const { + sendCommand(GetFrameLocation, &Frame, sizeof(Frame)); + LocationToken Loc; + readFromChild(&Loc, sizeof(Loc)); + LineNo = Loc.Line; + ColNo = Loc.Col; + SourceDesc = Loc.File; + } + + + //===----------------------------------------------------------------------===// + // Breakpoint manipulation methods + // + unsigned IP::addBreakpoint(unsigned LineNo, unsigned ColNo, + const GlobalVariable *SourceDesc) { + LocationToken Loc; + Loc.Line = LineNo; + Loc.Col = ColNo; + Loc.File = SourceDesc; + sendCommand(AddBreakpoint, &Loc, sizeof(Loc)); + unsigned ID; + readFromChild(&ID, sizeof(ID)); + return ID; + } + + void IP::removeBreakpoint(unsigned ID) { + sendCommand(RemoveBreakpoint, &ID, sizeof(ID)); + } + + + //===----------------------------------------------------------------------===// + // Methods for communication with the child process + // + // Methods for communicating with the child process. If the child exits or dies + // while attempting to communicate with it, ChildPID is set to zero and an + // exception is thrown. + // + + /// readFromChild - Low-level primitive to read some data from the child, + /// throwing an exception if it dies. + void IP::readFromChild(void *Buffer, unsigned Size) const { + assert(ChildPID && + "Child process died and still attempting to communicate with it!"); + while (Size) { + ssize_t Amount = read(ReadFD, Buffer, Size); + if (Amount == 0) { + // If we cannot communicate with the process, kill it. + killChild(); + // If killChild succeeded, then the process must have closed the pipe FD + // or something, because the child existed, but we cannot communicate with + // it. + throw InferiorProcessDead(-1); + } else if (Amount == -1) { + if (errno != EINTR) { + ChildPID = 0; + killChild(); + throw "Error reading from child process!"; + } + } else { + // We read a chunk. + Buffer = (char*)Buffer + Amount; + Size -= Amount; + } + } + } + + /// writeToChild - Low-level primitive to send some data to the child + /// process, throwing an exception if the child died. + void IP::writeToChild(void *Buffer, unsigned Size) const { + while (Size) { + ssize_t Amount = write(WriteFD, Buffer, Size); + if (Amount < 0 && errno == EINTR) continue; + if (Amount <= 0) { + // If we cannot communicate with the process, kill it. + killChild(); + + // If killChild succeeded, then the process must have closed the pipe FD + // or something, because the child existed, but we cannot communicate with + // it. + throw InferiorProcessDead(-1); + } else { + // We wrote a chunk. + Buffer = (char*)Buffer + Amount; + Size -= Amount; + } + } + } + + /// killChild - Kill or reap the child process. This throws the + /// InferiorProcessDead exception an exit code if the process had already + /// died, otherwise it just returns the exit code if it had to be killed. + void IP::killChild() const { + assert(ChildPID != 0 && "Child has already been reaped!"); + + int Status = 0; + int PID; + do { + PID = waitpid(ChildPID, &Status, WNOHANG); + } while (PID < 0 && errno == EINTR); + if (PID < 0) throw "Error waiting for child to exit!"; + + // If the child process was already dead, then it died unexpectedly. + if (PID) { + assert(PID == ChildPID && "Didn't reap child?"); + ChildPID = 0; // Child has been reaped + if (WIFEXITED(Status)) + throw InferiorProcessDead(WEXITSTATUS(Status)); + else if (WIFSIGNALED(Status)) + throw InferiorProcessDead(WTERMSIG(Status)); + throw InferiorProcessDead(-1); + } + + // Otherwise, the child exists and has not yet been killed. + if (kill(ChildPID, SIGKILL) < 0) + throw "Error killing child process!"; + + do { + PID = waitpid(ChildPID, 0, 0); + } while (PID < 0 && errno == EINTR); + if (PID <= 0) throw "Error waiting for child to exit!"; + + assert(PID == ChildPID && "Didn't reap child?"); + } + + + /// waitForStop - This method waits for the child process to reach a stop + /// point. When it does, it fills in the CurLocation member and returns. + void IP::waitForStop() { + char Dummy; + readFromChild(&Dummy, sizeof(char)); + } + + + //===----------------------------------------------------------------------===// + // Child Process Code + //===----------------------------------------------------------------------===// + + namespace { + class SourceSubprogram; + + /// SourceRegion - Instances of this class represent the regions that are + /// active in the program. + class SourceRegion { + /// Parent - A pointer to the region that encloses the current one. + SourceRegion *Parent; + + /// CurSubprogram - The subprogram that contains this region. This allows + /// efficient stack traversals. + SourceSubprogram *CurSubprogram; + + /// CurLine, CurCol, CurFile - The last location visited by this region. + /// This is used for getting the source location of callers in stack frames. + unsigned CurLine, CurCol; + void *CurFileDesc; + + //std::vector ActiveObjects; + public: + SourceRegion(SourceRegion *p, SourceSubprogram *Subprogram = 0) + : Parent(p), CurSubprogram(Subprogram ? Subprogram : p->getSubprogram()) { + CurLine = 0; CurCol = 0; + CurFileDesc = 0; + } + + virtual ~SourceRegion() {} + + SourceRegion *getParent() const { return Parent; } + SourceSubprogram *getSubprogram() const { return CurSubprogram; } + + void updateLocation(unsigned Line, unsigned Col, void *File) { + CurLine = Line; + CurCol = Col; + CurFileDesc = File; + } + + /// Return a LocationToken for the place that this stack frame stopped or + /// called a sub-function. + LocationToken getLocation(ExecutionEngine *EE) { + LocationToken LT; + LT.Line = CurLine; + LT.Col = CurCol; + const GlobalValue *GV = EE->getGlobalValueAtAddress(CurFileDesc); + LT.File = dyn_cast_or_null(GV); + return LT; + } + }; + + /// SourceSubprogram - This is a stack-frame that represents a source program. + /// + class SourceSubprogram : public SourceRegion { + /// Desc - A pointer to the descriptor for the subprogram that this frame + /// represents. + void *Desc; + public: + SourceSubprogram(SourceRegion *P, void *desc) + : SourceRegion(P, this), Desc(desc) {} + void *getDescriptor() const { return Desc; } + }; + + + /// Child class - This class contains all of the information and methods used + /// by the child side of the debugger. The single instance of this object is + /// pointed to by the "TheChild" global variable. + class Child { + /// M - The module for the program currently being debugged. + /// + Module *M; + + /// EE - The execution engine that we are using to run the program. + /// + ExecutionEngine *EE; + + /// ReadFD, WriteFD - The file descriptor handles for this side of the + /// debugger pipe. + FDHandle ReadFD, WriteFD; + + /// RegionStack - A linked list of all of the regions dynamically active. + /// + SourceRegion *RegionStack; + + /// StopAtNextOpportunity - If this flag is set, the child process will stop + /// and report to the debugger at the next possible chance it gets. + volatile bool StopAtNextOpportunity; + + /// StopWhenSubprogramReturns - If this is non-null, the debugger requests + /// that the program stops when the specified function frame is destroyed. + SourceSubprogram *StopWhenSubprogramReturns; + + /// Breakpoints - This contains a list of active breakpoints and their IDs. + /// + std::vector > Breakpoints; + + /// CurBreakpoint - The last assigned breakpoint. + /// + unsigned CurBreakpoint; + + public: + Child(Module *m, ExecutionEngine *ee, FDHandle &Read, FDHandle &Write) + : M(m), EE(ee), ReadFD(Read), WriteFD(Write), + RegionStack(0), CurBreakpoint(0) { + StopAtNextOpportunity = true; + StopWhenSubprogramReturns = 0; + } + + /// writeToParent - Send the specified buffer of data to the debugger + /// process. + void writeToParent(const void *Buffer, unsigned Size); + + /// readFromParent - Read the specified number of bytes from the parent. + /// + void readFromParent(void *Buffer, unsigned Size); + + /// childStopped - This method is called whenever the child has stopped + /// execution due to a breakpoint, step command, interruption, or whatever. + /// This stops the process, responds to any requests from the debugger, and + /// when commanded to, can continue execution by returning. + /// + void childStopped(); + + /// startSubprogram - This method creates a new region for the subroutine + /// with the specified descriptor. + void startSubprogram(void *FuncDesc); + + /// startRegion - This method initiates the creation of an anonymous region. + /// + void startRegion(); + + /// endRegion - This method terminates the last active region. + /// + void endRegion(); + + /// reachedLine - This method is automatically called by the program every + /// time it executes an llvm.dbg.stoppoint intrinsic. If the debugger wants + /// us to stop here, we do so, otherwise we continue execution. + void reachedLine(unsigned Line, unsigned Col, void *SourceDesc); + }; + + /// TheChild - The single instance of the Child class, which only gets created + /// in the child process. + Child *TheChild = 0; + } // end anonymous namespace + + + // writeToParent - Send the specified buffer of data to the debugger process. + void Child::writeToParent(const void *Buffer, unsigned Size) { + while (Size) { + ssize_t Amount = write(WriteFD, Buffer, Size); + if (Amount < 0 && errno == EINTR) continue; + if (Amount <= 0) { + write(2, "ERROR: Connection to debugger lost!\n", 36); + abort(); + } else { + // We wrote a chunk. + Buffer = (const char*)Buffer + Amount; + Size -= Amount; + } + } + } + + // readFromParent - Read the specified number of bytes from the parent. + void Child::readFromParent(void *Buffer, unsigned Size) { + while (Size) { + ssize_t Amount = read(ReadFD, Buffer, Size); + if (Amount < 0 && errno == EINTR) continue; + if (Amount <= 0) { + write(2, "ERROR: Connection to debugger lost!\n", 36); + abort(); + } else { + // We read a chunk. + Buffer = (char*)Buffer + Amount; + Size -= Amount; + } + } + } + + /// childStopped - This method is called whenever the child has stopped + /// execution due to a breakpoint, step command, interruption, or whatever. + /// This stops the process, responds to any requests from the debugger, and when + /// commanded to, can continue execution by returning. + /// + void Child::childStopped() { + // Since we stopped, notify the parent that we did so. + char Token = 0; + writeToParent(&Token, sizeof(char)); + + StopAtNextOpportunity = false; + StopWhenSubprogramReturns = 0; + + // Now that the debugger knows that we stopped, read commands from it and + // respond to them appropriately. + CommandID Command; + while (1) { + SourceRegion *Frame; + const void *Result; + readFromParent(&Command, sizeof(CommandID)); + + switch (Command) { + case StepProgram: + // To step the program, just return. + StopAtNextOpportunity = true; + return; + + case FinishProgram: // Run until exit from the specified function... + readFromParent(&Frame, sizeof(Frame)); + // The user wants us to stop when the specified FUNCTION exits, not when + // the specified REGION exits. + StopWhenSubprogramReturns = Frame->getSubprogram(); + return; + + case ContProgram: + // To continue, just return back to execution. + return; + + case GetSubprogramDescriptor: + readFromParent(&Frame, sizeof(Frame)); + Result = + EE->getGlobalValueAtAddress(Frame->getSubprogram()->getDescriptor()); + writeToParent(&Result, sizeof(Result)); + break; + + case GetParentFrame: + readFromParent(&Frame, sizeof(Frame)); + Result = Frame ? Frame->getSubprogram()->getParent() : RegionStack; + writeToParent(&Result, sizeof(Result)); + break; + + case GetFrameLocation: { + readFromParent(&Frame, sizeof(Frame)); + LocationToken LT = Frame->getLocation(EE); + writeToParent(<, sizeof(LT)); + break; + } + case AddBreakpoint: { + LocationToken Loc; + readFromParent(&Loc, sizeof(Loc)); + // Convert the GlobalVariable pointer to the address it was emitted to. + Loc.File = (GlobalVariable*)EE->getPointerToGlobal(Loc.File); + unsigned ID = CurBreakpoint++; + Breakpoints.push_back(std::make_pair(ID, Loc)); + writeToParent(&ID, sizeof(ID)); + break; + } + case RemoveBreakpoint: { + unsigned ID = 0; + readFromParent(&ID, sizeof(ID)); + for (unsigned i = 0, e = Breakpoints.size(); i != e; ++i) + if (Breakpoints[i].first == ID) { + Breakpoints.erase(Breakpoints.begin()+i); + break; + } + break; + } + default: + assert(0 && "Unknown command!"); + } + } + } + + + + /// startSubprogram - This method creates a new region for the subroutine + /// with the specified descriptor. + void Child::startSubprogram(void *SPDesc) { + RegionStack = new SourceSubprogram(RegionStack, SPDesc); + } + + /// startRegion - This method initiates the creation of an anonymous region. + /// + void Child::startRegion() { + RegionStack = new SourceRegion(RegionStack); + } + + /// endRegion - This method terminates the last active region. + /// + void Child::endRegion() { + SourceRegion *R = RegionStack->getParent(); + + // If the debugger wants us to stop when this frame is destroyed, do so. + if (RegionStack == StopWhenSubprogramReturns) { + StopAtNextOpportunity = true; + StopWhenSubprogramReturns = 0; + } + + delete RegionStack; + RegionStack = R; + } + + + + + /// reachedLine - This method is automatically called by the program every time + /// it executes an llvm.dbg.stoppoint intrinsic. If the debugger wants us to + /// stop here, we do so, otherwise we continue execution. Note that the Data + /// pointer coming in is a pointer to the LLVM global variable that represents + /// the source file we are in. We do not use the contents of the global + /// directly in the child, but we do use its address. + /// + void Child::reachedLine(unsigned Line, unsigned Col, void *SourceDesc) { + if (RegionStack) + RegionStack->updateLocation(Line, Col, SourceDesc); + + // If we hit a breakpoint, stop the program. + for (unsigned i = 0, e = Breakpoints.size(); i != e; ++i) + if (Line == Breakpoints[i].second.Line && + SourceDesc == (void*)Breakpoints[i].second.File && + Col == Breakpoints[i].second.Col) { + childStopped(); + return; + } + + // If we are single stepping the program, make sure to stop it. + if (StopAtNextOpportunity) + childStopped(); + } + + + + + //===----------------------------------------------------------------------===// + // Child class wrapper functions + // + // These functions are invoked directly by the program as it executes, in place + // of the debugging intrinsic functions that it contains. + // + + + /// llvm_debugger_stop - Every time the program reaches a new source line, it + /// will call back to this function. If the debugger has a breakpoint or + /// otherwise wants us to stop on this line, we do so, and notify the debugger + /// over the pipe. + /// + extern "C" + void *llvm_debugger_stop(void *Dummy, unsigned Line, unsigned Col, + void *SourceDescriptor) { + TheChild->reachedLine(Line, Col, SourceDescriptor); + return Dummy; + } + + + /// llvm_dbg_region_start - This function is invoked every time an anonymous + /// region of the source program is entered. + /// + extern "C" + void *llvm_dbg_region_start(void *Dummy) { + TheChild->startRegion(); + return Dummy; + } + + /// llvm_dbg_subprogram - This function is invoked every time a source-language + /// subprogram has been entered. + /// + extern "C" + void *llvm_dbg_subprogram(void *FuncDesc) { + TheChild->startSubprogram(FuncDesc); + return 0; + } + + /// llvm_dbg_region_end - This function is invoked every time a source-language + /// region (started with llvm.dbg.region.start or llvm.dbg.func.start) is + /// terminated. + /// + extern "C" + void llvm_dbg_region_end(void *Dummy) { + TheChild->endRegion(); + } + + + + + namespace { + /// DebuggerIntrinsicLowering - This class implements a simple intrinsic + /// lowering class that revectors debugging intrinsics to call actual + /// functions (defined above), instead of being turned into noops. + struct DebuggerIntrinsicLowering : public DefaultIntrinsicLowering { + virtual void LowerIntrinsicCall(CallInst *CI) { + Module *M = CI->getParent()->getParent()->getParent(); + switch (CI->getCalledFunction()->getIntrinsicID()) { + case Intrinsic::dbg_stoppoint: + // Turn call into a call to llvm_debugger_stop + CI->setOperand(0, M->getOrInsertFunction("llvm_debugger_stop", + CI->getCalledFunction()->getFunctionType())); + break; + case Intrinsic::dbg_region_start: + // Turn call into a call to llvm_dbg_region_start + CI->setOperand(0, M->getOrInsertFunction("llvm_dbg_region_start", + CI->getCalledFunction()->getFunctionType())); + break; + + case Intrinsic::dbg_region_end: + // Turn call into a call to llvm_debugger_stop + CI->setOperand(0, M->getOrInsertFunction("llvm_dbg_region_end", + CI->getCalledFunction()->getFunctionType())); + break; + case Intrinsic::dbg_func_start: + // Turn call into a call to llvm_debugger_stop + CI->setOperand(0, M->getOrInsertFunction("llvm_dbg_subprogram", + CI->getCalledFunction()->getFunctionType())); + break; + default: + DefaultIntrinsicLowering::LowerIntrinsicCall(CI); + break; + } + } + }; + } // end anonymous namespace + + + static void runChild(Module *M, const std::vector &Arguments, + const char * const *envp, + FDHandle ReadFD, FDHandle WriteFD) { + + // Create an execution engine that uses our custom intrinsic lowering object + // to revector debugging intrinsic functions into actual functions defined + // above. + ExecutionEngine *EE = + ExecutionEngine::create(new ExistingModuleProvider(M), false, + new DebuggerIntrinsicLowering()); + assert(EE && "Couldn't create an ExecutionEngine, not even an interpreter?"); + + // Call the main function from M as if its signature were: + // int main (int argc, char **argv, const char **envp) + // using the contents of Args to determine argc & argv, and the contents of + // EnvVars to determine envp. + // + Function *Fn = M->getMainFunction(); + if (!Fn) exit(1); + + // Create the child class instance which will be used by the debugger + // callbacks to keep track of the current state of the process. + assert(TheChild == 0 && "A child process has already been created??"); + TheChild = new Child(M, EE, ReadFD, WriteFD); + + // Run main... + int Result = EE->runFunctionAsMain(Fn, Arguments, envp); + + // If the program didn't explicitly call exit, call exit now, for the program. + // This ensures that any atexit handlers get called correctly. + Function *Exit = M->getOrInsertFunction("exit", Type::VoidTy, Type::IntTy, 0); + + std::vector Args; + GenericValue ResultGV; + ResultGV.IntVal = Result; + Args.push_back(ResultGV); + EE->runFunction(Exit, Args); + abort(); + } From lattner at cs.uiuc.edu Sun Jan 4 23:27:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jan 4 23:27:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Makefile Message-ID: <200401050526.XAA30761@zion.cs.uiuc.edu> Changes in directory llvm/lib: Makefile updated: 1.16 -> 1.17 --- Log message: Add new dir --- Diffs of the changes: (+1 -1) Index: llvm/lib/Makefile diff -u llvm/lib/Makefile:1.16 llvm/lib/Makefile:1.17 --- llvm/lib/Makefile:1.16 Mon Oct 20 17:26:55 2003 +++ llvm/lib/Makefile Sun Jan 4 23:25:59 2004 @@ -8,7 +8,7 @@ ##===----------------------------------------------------------------------===## LEVEL = .. -PARALLEL_DIRS = VMCore Analysis Transforms AsmParser Bytecode CodeGen Target CWriter ExecutionEngine +PARALLEL_DIRS = VMCore Analysis Transforms AsmParser Bytecode CodeGen Target CWriter ExecutionEngine Debugger include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Jan 4 23:27:15 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jan 4 23:27:15 2004 Subject: [llvm-commits] CVS: llvm/tools/llvm-db/ Message-ID: <200401050526.XAA30789@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-db: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/tools/llvm-db added to the repository --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sun Jan 4 23:28:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jan 4 23:28:01 2004 Subject: [llvm-commits] CVS: llvm/tools/llvm-db/CLICommand.h CLIDebugger.cpp CLIDebugger.h Commands.cpp Makefile llvm-db.cpp Message-ID: <200401050527.XAA30854@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-db: CLICommand.h added (r1.1) CLIDebugger.cpp added (r1.1) CLIDebugger.h added (r1.1) Commands.cpp added (r1.1) Makefile added (r1.1) llvm-db.cpp added (r1.1) --- Log message: Initial checkin of the LLVM Source-Level Debugger. This is incomplete, but a good start. The status is documented in docs/SourceLevelDebugging.html --- Diffs of the changes: (+1546 -0) Index: llvm/tools/llvm-db/CLICommand.h diff -c /dev/null llvm/tools/llvm-db/CLICommand.h:1.1 *** /dev/null Sun Jan 4 23:27:41 2004 --- llvm/tools/llvm-db/CLICommand.h Sun Jan 4 23:27:31 2004 *************** *** 0 **** --- 1,110 ---- + //===- CLICommand.h - Classes used to represent commands --------*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines a small class hierarchy used to represent the various types + // of commands in the CLI debugger front-end. + // + //===----------------------------------------------------------------------===// + + #ifndef CLICOMMAND_H + #define CLICOMMAND_H + + #include + #include + + namespace llvm { + class CLIDebugger; + + /// CLICommand - Base class of the hierarchy, used to provide the abstract + /// interface common to all commands. + /// + class CLICommand { + /// ShortHelp, LongHelp - The short and long helps strings printed for the + /// command. The ShortHelp string should be a single line of text without a + /// newline. The LongHelp string should be a full description with + /// terminating newline. + std::string ShortHelp, LongHelp; + + /// RefCount - This contains the number of entries in the CLIDebugger + /// CommandTable that points to this command. + unsigned RefCount; + + /// OptionNames - This contains a list of names for the option. Keeping + /// track of this is done just to make the help output more helpful. + /// + std::vector OptionNames; + public: + CLICommand(const std::string &SH, const std::string &LH) + : ShortHelp(SH), LongHelp(LH), RefCount(0) {} + + virtual ~CLICommand() {} + + /// addRef/dropRef - Implement a simple reference counting scheme to make + /// sure we delete commands that are no longer used. + void addRef() { ++RefCount; } + void dropRef() { + if (--RefCount == 0) delete this; + } + + /// getPrimaryOptionName - Return the first name the option was added under. + /// This is the name we report for the option in the help output. + std::string getPrimaryOptionName() const { + return OptionNames.empty() ? "" : OptionNames[0]; + } + + /// getOptionName - Return all of the names the option is registered as. + /// + const std::vector &getOptionNames() const { + return OptionNames; + } + + /// addOptionName - Add a name that this option is known as. + /// + void addOptionName(const std::string &Name) { + OptionNames.push_back(Name); + } + + /// removeOptionName - Eliminate one of the names for this option. + /// + void removeOptionName(const std::string &Name) { + unsigned i = 0; + for (; OptionNames[i] != Name; ++i) + assert(i+1 < OptionNames.size() && "Didn't find option name!"); + OptionNames.erase(OptionNames.begin()+i); + } + + + /// getShortHelp - Return the short help string for this command. + /// + const std::string &getShortHelp() { return ShortHelp; } + + /// getLongHelp - Return the long help string for this command, if it + /// exists. + const std::string &getLongHelp() { return LongHelp; } + + virtual void runCommand(CLIDebugger &D, std::string &Arguments) = 0; + }; + + /// BuiltinCLICommand - This class represents commands that are built directly + /// into the debugger. + class BuiltinCLICommand : public CLICommand { + // Impl - Pointer to the method that implements the command + void (CLIDebugger::*Impl)(std::string&); + public: + BuiltinCLICommand(const std::string &ShortHelp, const std::string &LongHelp, + void (CLIDebugger::*impl)(std::string&)) + : CLICommand(ShortHelp, LongHelp), Impl(impl) {} + + void runCommand(CLIDebugger &D, std::string &Arguments) { + (D.*Impl)(Arguments); + } + }; + } + + #endif Index: llvm/tools/llvm-db/CLIDebugger.cpp diff -c /dev/null llvm/tools/llvm-db/CLIDebugger.cpp:1.1 *** /dev/null Sun Jan 4 23:27:41 2004 --- llvm/tools/llvm-db/CLIDebugger.cpp Sun Jan 4 23:27:31 2004 *************** *** 0 **** --- 1,285 ---- + //===-- CLIDebugger.cpp - Command Line Interface to the Debugger ----------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file contains the main implementation of the Command Line Interface to + // the debugger. + // + //===----------------------------------------------------------------------===// + + #include "CLIDebugger.h" + #include "CLICommand.h" + #include "llvm/Debugger/SourceFile.h" + #include "Support/StringExtras.h" + #include + using namespace llvm; + + /// CLIDebugger constructor - This initializes the debugger to its default + /// state, and initializes the command table. + /// + CLIDebugger::CLIDebugger() + : TheProgramInfo(0), TheRuntimeInfo(0), Prompt("(llvm-db) "), ListSize(10) { + // Initialize instance variables + CurrentFile = 0; + LineListedStart = 1; + LineListedEnd = 1; + LastCurrentFrame = 0; + CurrentLanguage = 0; + + CLICommand *C; + //===--------------------------------------------------------------------===// + // Program startup and shutdown options + // + addCommand("file", new BuiltinCLICommand( + "Use specified file as the program to be debugged", + "The debugger looks in the current directory and the program $PATH for the" + " specified LLVM program. It then unloads the currently loaded program and" + " loads the specified program.\n", + &CLIDebugger::fileCommand)); + + addCommand("create", new BuiltinCLICommand( + "Start the current program, stopping execution in main", + "This command creates an instance of the current program, but stops" + " execution immediately.", + &CLIDebugger::createCommand)); + + addCommand("kill", new BuiltinCLICommand( + "Kills the execution of the current program being debugged", "", + &CLIDebugger::killCommand)); + + addCommand("quit", new BuiltinCLICommand( + "Exit the debugger", "", + &CLIDebugger::quitCommand)); + + //===--------------------------------------------------------------------===// + // Program execution commands + // + addCommand("run", C = new BuiltinCLICommand( + "Start the program running from the beginning", "", + &CLIDebugger::runCommand)); + addCommand("r", C); + + addCommand("cont", C = new BuiltinCLICommand( + "Continue program being debugged until the next stop point", "", + &CLIDebugger::contCommand)); + addCommand("c", C); addCommand("fg", C); + + addCommand("step", C = new BuiltinCLICommand( + "Step program until it reaches a new source line", "", + &CLIDebugger::stepCommand)); + addCommand("s", C); + + addCommand("next", C = new BuiltinCLICommand( + "Step program until it reaches a new source line, stepping over calls", "", + &CLIDebugger::nextCommand)); + addCommand("n", C); + + addCommand("finish", new BuiltinCLICommand( + "Execute until the selected stack frame returns", + "Upon return, the value returned is printed and put in the value history.\n", + &CLIDebugger::finishCommand)); + + //===--------------------------------------------------------------------===// + // Stack frame commands + // + addCommand("backtrace", C = new BuiltinCLICommand( + "Print backtrace of all stack frames, or innermost COUNT frames", + "FIXME: describe. Takes 'n', '-n' or 'full'\n", + &CLIDebugger::backtraceCommand)); + addCommand("bt", C); + + addCommand("up", new BuiltinCLICommand( + "Select and print stack frame that called this one", + "An argument says how many frames up to go.\n", + &CLIDebugger::upCommand)); + + addCommand("down", new BuiltinCLICommand( + "Select and print stack frame called by this one", + "An argument says how many frames down go.\n", + &CLIDebugger::downCommand)); + + addCommand("frame", C = new BuiltinCLICommand( + "Select and print a stack frame", + "With no argument, print the selected stack frame. (See also 'info frame').\n" + "An argument specifies the frame to select.\n", + &CLIDebugger::frameCommand)); + addCommand("f", C); + + //===--------------------------------------------------------------------===// + // Breakpoint related commands + // + addCommand("break", C = new BuiltinCLICommand( + "Set breakpoint at specified line or function", + "FIXME: describe.\n", + &CLIDebugger::breakCommand)); + addCommand("b", C); + + + //===--------------------------------------------------------------------===// + // Miscellaneous commands + // + addCommand("info", new BuiltinCLICommand( + "Generic command for showing things about the program being debugged", + "FIXME: document\n", + &CLIDebugger::infoCommand)); + + addCommand("list", C = new BuiltinCLICommand( + "List specified function or line", + "FIXME: document\n", + &CLIDebugger::listCommand)); + addCommand("l", C); + + addCommand("set", new BuiltinCLICommand( + "Change program or debugger variable", + "FIXME: document\n", + &CLIDebugger::setCommand)); + + addCommand("show", new BuiltinCLICommand( + "Generic command for showing things about the debugger", + "FIXME: document\n", + &CLIDebugger::showCommand)); + + addCommand("help", C = new BuiltinCLICommand( + "Prints information about available commands", "", + &CLIDebugger::helpCommand)); + addCommand("h", C); + } + + + /// addCommand - Add a command to the CommandTable, potentially displacing a + /// preexisting command. + void CLIDebugger::addCommand(const std::string &Option, CLICommand *Cmd) { + assert(Cmd && "Cannot set a null command!"); + CLICommand *&CS = CommandTable[Option]; + if (CS == Cmd) return; // noop + + // If we already have a command, decrement the command's reference count. + if (CS) { + CS->removeOptionName(Option); + CS->dropRef(); + } + CS = Cmd; + + // Remember that we are using this command. + Cmd->addRef(); + Cmd->addOptionName(Option); + } + + static bool isValidPrefix(const std::string &Prefix, const std::string &Option){ + return Prefix.size() <= Option.size() && + Prefix == std::string(Option.begin(), Option.begin()+Prefix.size()); + } + + /// getCommand - This looks up the specified command using a fuzzy match. + /// If the string exactly matches a command or is an unambiguous prefix of a + /// command, it returns the command. Otherwise it throws an exception + /// indicating the possible ambiguous choices. + CLICommand *CLIDebugger::getCommand(const std::string &Command) { + + // Look up the command in the table. + std::map::iterator CI = + CommandTable.lower_bound(Command); + + if (Command == "") { + throw "Null command not implemented yet."; + } else if (CI == CommandTable.end() || + !isValidPrefix(Command, CI->first)) { + // If this command has no relation to anything in the command table, + // print the error message. + throw "Unknown command: '" + Command + + "'. Use 'help' for list of commands."; + } else if (CI->first == Command) { + // We have an exact match on the command + return CI->second; + } else { + // Otherwise, we have a prefix match. Check to see if this is + // unambiguous, and if so, run it. + std::map::iterator CI2 = CI; + + // If the next command is a valid completion of this one, we are + // ambiguous. + if (++CI2 != CommandTable.end() && isValidPrefix(Command, CI2->first)) { + std::string ErrorMsg = + "Ambiguous command '" + Command + "'. Options: " + CI->first; + for (++CI; CI != CommandTable.end() && + isValidPrefix(Command, CI->first); ++CI) + ErrorMsg += ", " + CI->first; + throw ErrorMsg; + } else { + // It's an unambiguous prefix of a command, use it. + return CI->second; + } + } + } + + + /// run - Start the debugger, returning when the user exits the debugger. This + /// starts the main event loop of the CLI debugger. + /// + int CLIDebugger::run() { + std::string Command; + std::cout << Prompt; + + // Continue reading commands until the end of file. + while (getline(std::cin, Command)) { + std::string Arguments = Command; + + // Split off the command from the arguments to the command. + Command = getToken(Arguments, " \t\n\v\f\r\\/;.*&"); + + try { + // Look up the command and execute it. + getCommand(Command)->runCommand(*this, Arguments); + + } catch (int RetVal) { + // The quit command exits the command loop by throwing an integer return + // code. + return RetVal; + } catch (const std::string &Error) { + std::cout << "Error: " << Error << "\n"; + } catch (const char *Error) { + std::cout << "Error: " << Error << "\n"; + } catch (const NonErrorException &E) { + std::cout << E.getMessage() << "\n"; + } catch (...) { + std::cout << "ERROR: Debugger caught unexpected exception!\n"; + // Attempt to continue. + } + + // Write the prompt to get the next bit of user input + std::cout << Prompt; + } + + return 0; + } + + + /// askYesNo - Ask the user a question, and demand a yes/no response. If + /// the user says yes, return true. + /// + bool CLIDebugger::askYesNo(const std::string &Message) const { + std::string Answer; + std::cout << Message << " (y or n) " << std::flush; + while (getline(std::cin, Answer)) { + std::string Val = getToken(Answer); + if (getToken(Answer).empty()) { + if (Val == "yes" || Val == "y" || Val == "YES" || Val == "Y" || + Val == "Yes") + return true; + if (Val == "no" || Val == "n" || Val == "NO" || Val == "N" || + Val == "No") + return false; + } + + std::cout << "Please answer y or n.\n" << Message << " (y or n) " + << std::flush; + } + + // Ran out of input? + return false; + } Index: llvm/tools/llvm-db/CLIDebugger.h diff -c /dev/null llvm/tools/llvm-db/CLIDebugger.h:1.1 *** /dev/null Sun Jan 4 23:27:41 2004 --- llvm/tools/llvm-db/CLIDebugger.h Sun Jan 4 23:27:31 2004 *************** *** 0 **** --- 1,200 ---- + //===- CLIDebugger.h - LLVM Command Line Interface Debugger -----*- C++ -*-===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file defines the CLIDebugger class, which implements a command line + // interface to the LLVM Debugger library. + // + //===----------------------------------------------------------------------===// + + #ifndef CLIDEBUGGER_H + #define CLIDEBUGGER_H + + #include "llvm/Debugger/Debugger.h" + #include + + namespace llvm { + class CLICommand; + class SourceFile; + class SourceLanguage; + class ProgramInfo; + class RuntimeInfo; + + /// CLIDebugger - This class implements the command line interface for the + /// LLVM debugger. + class CLIDebugger { + /// Dbg - The low-level LLVM debugger object that we use to do our dirty + /// work. + Debugger Dbg; + + /// CommandTable - This table contains a mapping from command names to the + /// CLICommand object that implements the command. + std::map CommandTable; + + //===------------------------------------------------------------------===// + // Data related to the program that is currently loaded. Note that the Dbg + // variable also captures some information about the loaded program. This + // pointer is non-null iff Dbg.isProgramLoaded() is true. + // + ProgramInfo *TheProgramInfo; + + //===------------------------------------------------------------------===// + // Data related to the program that is currently executing, but has stopped. + // Note that the Dbg variable also captures some information about the + // loaded program. This pointer is non-null iff Dbg.isProgramRunning() is + // true. + // + RuntimeInfo *TheRuntimeInfo; + + /// LastCurrentFrame - This variable holds the Frame ID of the top-level + /// stack frame from the last time that the program was executed. We keep + /// this because we only want to print the source location when the current + /// function changes. + void *LastCurrentFrame; + + //===------------------------------------------------------------------===// + // Data directly exposed through the debugger prompt + // + std::string Prompt; // set prompt, show prompt + unsigned ListSize; // set listsize, show listsize + + //===------------------------------------------------------------------===// + // Data to support user interaction + // + + /// CurrentFile - The current source file we are inspecting, or null if + /// none. + const SourceFile *CurrentFile; + unsigned LineListedStart, LineListedEnd; + + /// CurrentLanguage - This contains the source language in use, if one is + /// explicitly set by the user. If this is null (the default), the language + /// is automatically determined from the current stack frame. + /// + const SourceLanguage *CurrentLanguage; + + public: + CLIDebugger(); + + /// getDebugger - Return the current LLVM debugger implementation being + /// used. + Debugger &getDebugger() { return Dbg; } + + /// run - Start the debugger, returning when the user exits the debugger. + /// This starts the main event loop of the CLI debugger. + /// + int run(); + + /// addCommand - Add a command to the CommandTable, potentially displacing a + /// preexisting command. + void addCommand(const std::string &Option, CLICommand *Cmd); + + /// addSourceDirectory - Add a directory to search when looking for the + /// source code of the program. + void addSourceDirectory(const std::string &Dir) { + // FIXME: implement + } + + /// getCurrentLanguage - Return the current source language that the user is + /// playing around with. This is aquired from the current stack frame of a + /// running program if one exists, but this value can be explicitly set by + /// the user as well. + const SourceLanguage &getCurrentLanguage() const; + + /// getProgramInfo - Return a reference to the ProgramInfo object for the + /// currently loaded program. If there is no program loaded, throw an + /// exception. + ProgramInfo &getProgramInfo() const { + if (TheProgramInfo == 0) + throw "No program is loaded."; + return *TheProgramInfo; + } + + /// getRuntimeInfo - Return a reference to the current RuntimeInfo object. + /// If there is no program running, throw an exception. + RuntimeInfo &getRuntimeInfo() const { + if (TheRuntimeInfo == 0) + throw "No program is running."; + return *TheRuntimeInfo; + } + + private: // Internal implementation methods + + /// getCommand - This looks up the specified command using a fuzzy match. + /// If the string exactly matches a command or is an unambiguous prefix of a + /// command, it returns the command. Otherwise it throws an exception + /// indicating the possible ambiguous choices. + CLICommand *getCommand(const std::string &Command); + + /// askYesNo - Ask the user a question, and demand a yes/no response. If + /// the user says yes, return true. + bool askYesNo(const std::string &Message) const; + + /// printProgramLocation - Given a loaded and created child process that has + /// stopped, print its current source location. + void printProgramLocation(bool PrintLocation = true); + + /// eliminateRunInfo - We are about to run the program. Forget any state + /// about how the program used to be stopped. + void eliminateRunInfo(); + + /// programStoppedSuccessfully - This method updates internal data + /// structures to reflect the fact that the program just executed a while, + /// and has successfully stopped. + void programStoppedSuccessfully(); + + public: /// Builtin debugger commands, invokable by the user + // Program startup and shutdown options + void fileCommand(std::string &Options); // file + void createCommand(std::string &Options); // create + void killCommand(std::string &Options); // kill + void quitCommand(std::string &Options); // quit + + // Program execution commands + void runCommand(std::string &Options); // run|r + void contCommand(std::string &Options); // cont|c|fg + void stepCommand(std::string &Options); // step|s [count] + void nextCommand(std::string &Options); // next|n [count] + void finishCommand(std::string &Options); // finish + + // Stack frame commands + void backtraceCommand(std::string &Options); // backtrace|bt [count] + void upCommand(std::string &Options); // up + void downCommand(std::string &Options); // down + void frameCommand(std::string &Options); // frame + + + // Breakpoint related commands + void breakCommand(std::string &Options); // break|b + + // Miscellaneous commands + void infoCommand(std::string &Options); // info + void listCommand(std::string &Options); // list + void setCommand(std::string &Options); // set + void showCommand(std::string &Options); // show + void helpCommand(std::string &Options); // help + + private: + /// startProgramRunning - If the program has been updated, reload it, then + /// start executing the program. + void startProgramRunning(); + + /// parseLineSpec - Parses a line specifier, for use by the 'list' command. + /// If SourceFile is returned as a void pointer, then it was not specified. + /// If the line specifier is invalid, an exception is thrown. + void parseLineSpec(std::string &LineSpec, const SourceFile *&SourceFile, + unsigned &LineNo); + + /// printSourceLine - Print the specified line of the current source file. + /// If the specified line is invalid (the source file could not be loaded or + /// the line number is out of range), don't print anything, but return true. + bool printSourceLine(unsigned LineNo); + }; + } + + #endif Index: llvm/tools/llvm-db/Commands.cpp diff -c /dev/null llvm/tools/llvm-db/Commands.cpp:1.1 *** /dev/null Sun Jan 4 23:27:41 2004 --- llvm/tools/llvm-db/Commands.cpp Sun Jan 4 23:27:31 2004 *************** *** 0 **** --- 1,803 ---- + //===-- Commands.cpp - Implement various commands for the CLI -------------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This file implements many builtin user commands. + // + //===----------------------------------------------------------------------===// + + #include "CLIDebugger.h" + #include "CLICommand.h" + #include "llvm/Debugger/ProgramInfo.h" + #include "llvm/Debugger/RuntimeInfo.h" + #include "llvm/Debugger/SourceLanguage.h" + #include "llvm/Debugger/SourceFile.h" + #include "llvm/Debugger/InferiorProcess.h" + #include "Support/FileUtilities.h" + #include "Support/StringExtras.h" + #include + using namespace llvm; + + /// getCurrentLanguage - Return the current source language that the user is + /// playing around with. This is aquired from the current stack frame of a + /// running program if one exists, but this value can be explicitly set by the + /// user as well. + const SourceLanguage &CLIDebugger::getCurrentLanguage() const { + // If the user explicitly switched languages with 'set language', use what + // they asked for. + if (CurrentLanguage) { + return *CurrentLanguage; + } else if (Dbg.isProgramRunning()) { + // Otherwise, if the program is running, infer the current language from it. + const GlobalVariable *FuncDesc = + getRuntimeInfo().getCurrentFrame().getFunctionDesc(); + return getProgramInfo().getFunction(FuncDesc).getSourceFile().getLanguage(); + } else { + // Otherwise, default to C like GDB apparently does. + return SourceLanguage::getCFamilyInstance(); + } + } + + /// startProgramRunning - If the program has been updated, reload it, then + /// start executing the program. + void CLIDebugger::startProgramRunning() { + eliminateRunInfo(); + + // If the program has been modified, reload it! + std::string Program = Dbg.getProgramPath(); + if (TheProgramInfo->getProgramTimeStamp() != getFileTimestamp(Program)) { + std::cout << "'" << Program << "' has changed; re-reading program.\n"; + + // Unload an existing program. This kills the program if necessary. + Dbg.unloadProgram(); + delete TheProgramInfo; + TheProgramInfo = 0; + CurrentFile = 0; + + Dbg.loadProgram(Program); + TheProgramInfo = new ProgramInfo(Dbg.getProgram()); + } + + std::cout << "Starting program: " << Dbg.getProgramPath() << "\n"; + Dbg.createProgram(); + + // There was no current frame. + LastCurrentFrame = 0; + } + + /// printSourceLine - Print the specified line of the current source file. + /// If the specified line is invalid (the source file could not be loaded or + /// the line number is out of range), don't print anything, but return true. + bool CLIDebugger::printSourceLine(unsigned LineNo) { + assert(CurrentFile && "There is no current source file to print!"); + const char *LineStart, *LineEnd; + CurrentFile->getSourceLine(LineNo-1, LineStart, LineEnd); + if (LineStart == 0) return true; + std::cout << LineNo; + + // If this is the line the program is currently stopped at, print a marker. + if (Dbg.isProgramRunning()) { + unsigned CurLineNo, CurColNo; + const SourceFileInfo *CurSFI; + getRuntimeInfo().getCurrentFrame().getSourceLocation(CurLineNo, CurColNo, + CurSFI); + + if (CurLineNo == LineNo && CurrentFile == &CurSFI->getSourceText()) + std::cout << " ->"; + } + + std::cout << "\t" << std::string(LineStart, LineEnd) << "\n"; + return false; + } + + /// printProgramLocation - Print a line of the place where the current stack + /// frame has stopped and the source line it is on. + /// + void CLIDebugger::printProgramLocation(bool PrintLocation) { + assert(Dbg.isProgramLoaded() && Dbg.isProgramRunning() && + "Error program is not loaded and running!"); + + // Figure out where the program stopped... + StackFrame &SF = getRuntimeInfo().getCurrentFrame(); + unsigned LineNo, ColNo; + const SourceFileInfo *FileDesc; + SF.getSourceLocation(LineNo, ColNo, FileDesc); + + // If requested, print out some program information about WHERE we are. + if (PrintLocation) { + // FIXME: print the current function arguments + if (const GlobalVariable *FuncDesc = SF.getFunctionDesc()) + std::cout << getProgramInfo().getFunction(FuncDesc).getSymbolicName(); + else + std::cout << ""; + + CurrentFile = &FileDesc->getSourceText(); + + std::cout << " at " << CurrentFile->getFilename() << ":" << LineNo; + if (ColNo) std::cout << ":" << ColNo << "\n"; + } + + if (printSourceLine(LineNo)) + std::cout << "\n"; + else { + LineListedStart = LineNo-ListSize/2+1; + if ((int)LineListedStart < 1) LineListedStart = 1; + LineListedEnd = LineListedStart+1; + } + } + + /// eliminateRunInfo - We are about to run the program. Forget any state + /// about how the program used to be stopped. + void CLIDebugger::eliminateRunInfo() { + delete TheRuntimeInfo; + TheRuntimeInfo = 0; + } + + /// programStoppedSuccessfully - This method updates internal data + /// structures to reflect the fact that the program just executed a while, + /// and has successfully stopped. + void CLIDebugger::programStoppedSuccessfully() { + assert(TheRuntimeInfo==0 && "Someone forgot to release the old RuntimeInfo!"); + + TheRuntimeInfo = new RuntimeInfo(TheProgramInfo, Dbg.getRunningProcess()); + + // FIXME: if there are any breakpoints at the current location, print them as + // well. + + // Since the program as successfully stopped, print its location. + void *CurrentFrame = getRuntimeInfo().getCurrentFrame().getFrameID(); + printProgramLocation(CurrentFrame != LastCurrentFrame); + LastCurrentFrame = CurrentFrame; + } + + + + /// getUnsignedIntegerOption - Get an unsigned integer number from the Val + /// string. Check to make sure that the string contains an unsigned integer + /// token, and if not, throw an exception. If isOnlyOption is set, also throw + /// an exception if there is extra junk at the end of the string. + static unsigned getUnsignedIntegerOption(const char *Msg, std::string &Val, + bool isOnlyOption = true) { + std::string Tok = getToken(Val); + if (Tok.empty() || (isOnlyOption && !getToken(Val).empty())) + throw std::string(Msg) + " expects an unsigned integer argument."; + + char *EndPtr; + unsigned Result = strtoul(Tok.c_str(), &EndPtr, 0); + if (EndPtr != Tok.c_str()+Tok.size()) + throw std::string(Msg) + " expects an unsigned integer argument."; + + return Result; + } + + /// getOptionalUnsignedIntegerOption - This method is just like + /// getUnsignedIntegerOption, but if the argument value is not specified, a + /// default is returned instead of causing an error. + static unsigned + getOptionalUnsignedIntegerOption(const char *Msg, unsigned Default, + std::string &Val, bool isOnlyOption = true) { + // Check to see if the value was specified... + std::string TokVal = getToken(Val); + if (TokVal.empty()) return Default; + + // If it was specified, add it back to the value we are parsing... + Val = TokVal+Val; + + // And parse normally. + return getUnsignedIntegerOption(Msg, Val, isOnlyOption); + } + + + //===----------------------------------------------------------------------===// + // Program startup and shutdown options + //===----------------------------------------------------------------------===// + + + /// file command - If the user specifies an option, search the PATH for the + /// specified program/bytecode file and load it. If the user does not specify + /// an option, unload the current program. + void CLIDebugger::fileCommand(std::string &Options) { + std::string Prog = getToken(Options); + if (!getToken(Options).empty()) + throw "file command takes at most one argument."; + + // Check to make sure the user knows what they are doing + if (Dbg.isProgramRunning() && + !askYesNo("A program is already loaded. Kill it?")) + return; + + // Unload an existing program. This kills the program if necessary. + eliminateRunInfo(); + delete TheProgramInfo; + TheProgramInfo = 0; + Dbg.unloadProgram(); + CurrentFile = 0; + + // If requested, start the new program. + if (Prog.empty()) { + std::cout << "Unloaded program.\n"; + } else { + std::cout << "Loading program... " << std::flush; + Dbg.loadProgram(Prog); + assert(Dbg.isProgramLoaded() && + "loadProgram succeeded, but not program loaded!"); + TheProgramInfo = new ProgramInfo(Dbg.getProgram()); + std::cout << "success loading '" << Dbg.getProgramPath() << "'!\n"; + } + } + + + void CLIDebugger::createCommand(std::string &Options) { + if (!getToken(Options).empty()) + throw "create command does not take any arguments."; + if (!Dbg.isProgramLoaded()) throw "No program loaded."; + if (Dbg.isProgramRunning() && + !askYesNo("The program is already running. Restart from the beginning?")) + return; + + // Start the program running. + startProgramRunning(); + + // The program stopped! + programStoppedSuccessfully(); + } + + void CLIDebugger::killCommand(std::string &Options) { + if (!getToken(Options).empty()) + throw "kill command does not take any arguments."; + if (!Dbg.isProgramRunning()) + throw "No program is currently being run."; + + if (askYesNo("Kill the program being debugged?")) + Dbg.killProgram(); + eliminateRunInfo(); + } + + void CLIDebugger::quitCommand(std::string &Options) { + if (!getToken(Options).empty()) + throw "quit command does not take any arguments."; + + if (Dbg.isProgramRunning() && + !askYesNo("The program is running. Exit anyway?")) + return; + + // Throw exception to get out of the user-input loop. + throw 0; + } + + + //===----------------------------------------------------------------------===// + // Program execution commands + //===----------------------------------------------------------------------===// + + void CLIDebugger::runCommand(std::string &Options) { + if (!getToken(Options).empty()) throw "run arguments not supported yet."; + if (!Dbg.isProgramLoaded()) throw "No program loaded."; + if (Dbg.isProgramRunning() && + !askYesNo("The program is already running. Restart from the beginning?")) + return; + + eliminateRunInfo(); + + // Start the program running. + startProgramRunning(); + + // Start the program running... + Options = ""; + contCommand(Options); + } + + void CLIDebugger::contCommand(std::string &Options) { + if (!getToken(Options).empty()) throw "cont argument not supported yet."; + if (!Dbg.isProgramRunning()) throw "Program is not running."; + + eliminateRunInfo(); + + Dbg.contProgram(); + + // The program stopped! + programStoppedSuccessfully(); + } + + void CLIDebugger::stepCommand(std::string &Options) { + if (!Dbg.isProgramRunning()) throw "Program is not running."; + + // Figure out how many times to step. + unsigned Amount = + getOptionalUnsignedIntegerOption("'step' command", 1, Options); + + eliminateRunInfo(); + + // Step the specified number of times. + for (; Amount; --Amount) + Dbg.stepProgram(); + + // The program stopped! + programStoppedSuccessfully(); + } + + void CLIDebugger::nextCommand(std::string &Options) { + if (!Dbg.isProgramRunning()) throw "Program is not running."; + unsigned Amount = + getOptionalUnsignedIntegerOption("'next' command", 1, Options); + + eliminateRunInfo(); + + for (; Amount; --Amount) + Dbg.nextProgram(); + + // The program stopped! + programStoppedSuccessfully(); + } + + void CLIDebugger::finishCommand(std::string &Options) { + if (!getToken(Options).empty()) + throw "finish command does not take any arguments."; + if (!Dbg.isProgramRunning()) throw "Program is not running."; + + // Figure out where we are exactly. If the user requests that we return from + // a frame that is not the top frame, make sure we get it. + void *CurrentFrame = getRuntimeInfo().getCurrentFrame().getFrameID(); + + eliminateRunInfo(); + + Dbg.finishProgram(CurrentFrame); + + // The program stopped! + programStoppedSuccessfully(); + } + + //===----------------------------------------------------------------------===// + // Stack frame commands + //===----------------------------------------------------------------------===// + + void CLIDebugger::backtraceCommand(std::string &Options) { + // Accepts "full", n, -n + if (!getToken(Options).empty()) + throw "FIXME: bt command argument not implemented yet!"; + + RuntimeInfo &RI = getRuntimeInfo(); + ProgramInfo &PI = getProgramInfo(); + + try { + for (unsigned i = 0; ; ++i) { + StackFrame &SF = RI.getStackFrame(i); + std::cout << "#" << i; + if (i == RI.getCurrentFrameIdx()) + std::cout << " ->"; + std::cout << "\t" << SF.getFrameID() << " in "; + if (const GlobalVariable *G = SF.getFunctionDesc()) + std::cout << PI.getFunction(G).getSymbolicName(); + + unsigned LineNo, ColNo; + const SourceFileInfo *SFI; + SF.getSourceLocation(LineNo, ColNo, SFI); + if (!SFI->getBaseName().empty()) { + std::cout << " at " << SFI->getBaseName(); + if (LineNo) { + std::cout << ":" << LineNo; + if (ColNo) + std::cout << ":" << ColNo; + } + } + + // FIXME: when we support shared libraries, we should print ' from foo.so' + // if the stack frame is from a different object than the current one. + + std::cout << "\n"; + } + } catch (...) { + // Stop automatically when we run off the bottom of the stack. + } + } + + void CLIDebugger::upCommand(std::string &Options) { + unsigned Num = + getOptionalUnsignedIntegerOption("'up' command", 1, Options); + + RuntimeInfo &RI = getRuntimeInfo(); + unsigned CurFrame = RI.getCurrentFrameIdx(); + + // Check to see if we go can up the specified number of frames. + try { + RI.getStackFrame(CurFrame+Num); + } catch (...) { + if (Num == 1) + throw "Initial frame selected; you cannot go up."; + else + throw "Cannot go up " + utostr(Num) + " frames!"; + } + + RI.setCurrentFrameIdx(CurFrame+Num); + printProgramLocation(); + } + + void CLIDebugger::downCommand(std::string &Options) { + unsigned Num = + getOptionalUnsignedIntegerOption("'down' command", 1, Options); + + RuntimeInfo &RI = getRuntimeInfo(); + unsigned CurFrame = RI.getCurrentFrameIdx(); + + // Check to see if we can go up the specified number of frames. + if (CurFrame < Num) + if (Num == 1) + throw "Bottom (i.e., innermost) frame selected; you cannot go down."; + else + throw "Cannot go down " + utostr(Num) + " frames!"; + + RI.setCurrentFrameIdx(CurFrame-Num); + printProgramLocation(); + } + + void CLIDebugger::frameCommand(std::string &Options) { + RuntimeInfo &RI = getRuntimeInfo(); + unsigned CurFrame = RI.getCurrentFrameIdx(); + + unsigned Num = + getOptionalUnsignedIntegerOption("'frame' command", CurFrame, Options); + + // Check to see if we go to the specified frame. + RI.getStackFrame(Num); + + RI.setCurrentFrameIdx(Num); + printProgramLocation(); + } + + + //===----------------------------------------------------------------------===// + // Breakpoint related commands + //===----------------------------------------------------------------------===// + + void CLIDebugger::breakCommand(std::string &Options) { + throw "breakpoints not implemented yet!"; + } + + //===----------------------------------------------------------------------===// + // Miscellaneous commands + //===----------------------------------------------------------------------===// + + void CLIDebugger::infoCommand(std::string &Options) { + std::string What = getToken(Options); + + if (What.empty() || !getToken(Options).empty()) + throw "info command expects exactly one argument."; + + if (What == "frame") { + } else if (What == "functions") { + const std::map &Functions + = getProgramInfo().getSourceFunctions(); + std::cout << "All defined functions:\n"; + // FIXME: GDB groups these by source file. We could do that I guess. + for (std::map::const_iterator + I = Functions.begin(), E = Functions.end(); I != E; ++I) { + std::cout << I->second->getSymbolicName() << "\n"; + } + + } else if (What == "source") { + if (CurrentFile == 0) + throw "No current source file."; + + // Get the SourceFile information for the current file. + const SourceFileInfo &SF = + getProgramInfo().getSourceFile(CurrentFile->getDescriptor()); + + std::cout << "Current source file is: " << SF.getBaseName() << "\n" + << "Compilation directory is: " << SF.getDirectory() << "\n"; + if (unsigned NL = CurrentFile->getNumLines()) + std::cout << "Located in: " << CurrentFile->getFilename() << "\n" + << "Contains " << NL << " lines\n"; + else + std::cout << "Could not find source file.\n"; + std::cout << "Source language is " + << SF.getLanguage().getSourceLanguageName() << "\n"; + + } else if (What == "sources") { + const std::map &SourceFiles = + getProgramInfo().getSourceFiles(); + std::cout << "Source files for the program:\n"; + for (std::map::const_iterator I = + SourceFiles.begin(), E = SourceFiles.end(); I != E;) { + std::cout << I->second->getDirectory() << "/" + << I->second->getBaseName(); + ++I; + if (I != E) std::cout << ", "; + } + std::cout << "\n"; + } else if (What == "target") { + std::cout << Dbg.getRunningProcess().getStatus(); + } else { + // See if this is something handled by the current language. + if (getCurrentLanguage().printInfo(What)) + return; + + throw "Unknown info command '" + What + "'. Try 'help info'."; + } + } + + /// parseLineSpec - Parses a line specifier, for use by the 'list' command. + /// If SourceFile is returned as a void pointer, then it was not specified. + /// If the line specifier is invalid, an exception is thrown. + void CLIDebugger::parseLineSpec(std::string &LineSpec, + const SourceFile *&SourceFile, + unsigned &LineNo) { + SourceFile = 0; + LineNo = 0; + + // First, check to see if we have a : separator. + std::string FirstPart = getToken(LineSpec, ":"); + std::string SecondPart = getToken(LineSpec, ":"); + if (!getToken(LineSpec).empty()) throw "Malformed line specification!"; + + // If there is no second part, we must have either "function", "number", + // "+offset", or "-offset". + if (SecondPart.empty()) { + if (FirstPart.empty()) throw "Malformed line specification!"; + if (FirstPart[0] == '+') { + FirstPart.erase(FirstPart.begin(), FirstPart.begin()+1); + // For +n, return LineListedEnd+n + LineNo = LineListedEnd + + getUnsignedIntegerOption("Line specifier '+'", FirstPart); + + } else if (FirstPart[0] == '-') { + FirstPart.erase(FirstPart.begin(), FirstPart.begin()+1); + // For -n, return LineListedEnd-n + LineNo = LineListedEnd - + getUnsignedIntegerOption("Line specifier '-'", FirstPart); + if ((int)LineNo < 1) LineNo = 1; + } else if (FirstPart[0] == '*') { + throw "Address expressions not supported as source locations!"; + } else { + // Ok, check to see if this is just a line number. + std::string Saved = FirstPart; + try { + LineNo = getUnsignedIntegerOption("", Saved); + } catch (...) { + // Ok, it's not a valid line number. It must be a source-language + // entity name. + std::string Name = getToken(FirstPart); + if (!getToken(FirstPart).empty()) + throw "Extra junk in line specifier after '" + Name + "'."; + SourceFunctionInfo *SFI = + getCurrentLanguage().lookupFunction(Name, getProgramInfo(), + TheRuntimeInfo); + if (SFI == 0) + throw "Unknown identifier '" + Name + "'."; + + unsigned L, C; + SFI->getSourceLocation(L, C); + if (L == 0) throw "Could not locate '" + Name + "'!"; + LineNo = L; + SourceFile = &SFI->getSourceFile().getSourceText(); + return; + } + } + + } else { + // Ok, this must be a filename qualified line number or function name. + // First, figure out the source filename. + std::string SourceFilename = getToken(FirstPart); + if (!getToken(FirstPart).empty()) + throw "Invalid filename qualified source location!"; + + // Next, check to see if this is just a line number. + std::string Saved = SecondPart; + try { + LineNo = getUnsignedIntegerOption("", Saved); + } catch (...) { + // Ok, it's not a valid line number. It must be a function name. + throw "FIXME: Filename qualified function names are not support " + "as line specifiers yet!"; + } + + // Ok, we got the line number. Now check out the source file name to make + // sure it's all good. If it is, return it. If not, throw exception. + SourceFile =&getProgramInfo().getSourceFile(SourceFilename).getSourceText(); + } + } + + void CLIDebugger::listCommand(std::string &Options) { + if (!Dbg.isProgramLoaded()) + throw "No program is loaded. Use the 'file' command."; + + // Handle "list foo," correctly, by returning " " as the second token + Options += " "; + + std::string FirstLineSpec = getToken(Options, ","); + std::string SecondLineSpec = getToken(Options, ","); + if (!getToken(Options, ",").empty()) + throw "list command only expects two source location specifiers!"; + + // StartLine, EndLine - The starting and ending line numbers to print. + unsigned StartLine = 0, EndLine = 0; + + if (SecondLineSpec.empty()) { // No second line specifier provided? + // Handle special forms like "", "+", "-", etc. + std::string TmpSpec = FirstLineSpec; + std::string Tok = getToken(TmpSpec); + if (getToken(TmpSpec).empty() && (Tok == "" || Tok == "+" || Tok == "-")) { + if (Tok == "+" || Tok == "") { + StartLine = LineListedEnd; + EndLine = StartLine + ListSize; + } else { + assert(Tok == "-"); + StartLine = LineListedStart-ListSize; + EndLine = LineListedStart; + if ((int)StartLine < 0) StartLine = 1; + } + } else { + // Must be a normal line specifier. + const SourceFile *File; + unsigned LineNo; + parseLineSpec(FirstLineSpec, File, LineNo); + + // If the user only specified one file specifier, we should display + // ListSize lines centered at the specified line. + if (File != 0) CurrentFile = File; + StartLine = LineNo - (ListSize+1)/2; + if ((int)StartLine < 0) StartLine = 1; + EndLine = StartLine + ListSize; + } + + } else { + // Parse two line specifiers... + const SourceFile *StartFile, *EndFile; + unsigned StartLineNo, EndLineNo; + parseLineSpec(FirstLineSpec, StartFile, StartLineNo); + unsigned SavedLLE = LineListedEnd; + LineListedEnd = StartLineNo; + try { + parseLineSpec(SecondLineSpec, EndFile, EndLineNo); + } catch (...) { + LineListedEnd = SavedLLE; + throw; + } + + // Inherit file specified by the first line spec if there was one. + if (EndFile == 0) EndFile = StartFile; + + if (StartFile != EndFile) + throw "Start and end line specifiers are in different files!"; + CurrentFile = StartFile; + StartLine = StartLineNo; + EndLine = EndLineNo+1; + } + + assert((int)StartLine > 0 && (int)EndLine > 0 && StartLine <= EndLine && + "Error reading line specifiers!"); + + // If there was no current file, and the user didn't specify one to list, we + // have an error. + if (CurrentFile == 0) + throw "There is no current file to list."; + + // Remember for next time. + LineListedStart = StartLine; + LineListedEnd = StartLine; + + for (unsigned LineNo = StartLine; LineNo != EndLine; ++LineNo) { + // Print the source line, unless it is invalid. + if (printSourceLine(LineNo)) + break; + LineListedEnd = LineNo+1; + } + + // If we didn't print any lines, find out why. + if (LineListedEnd == StartLine) { + // See if we can read line #0 from the file, if not, we couldn't load the + // file. + const char *LineStart, *LineEnd; + CurrentFile->getSourceLine(0, LineStart, LineEnd); + if (LineStart == 0) + throw "Could not load source file '" + CurrentFile->getFilename() + "'!"; + else + std::cout << "\n"; + } + } + + void CLIDebugger::setCommand(std::string &Options) { + std::string What = getToken(Options); + + if (What.empty()) + throw "set command expects at least two arguments."; + if (What == "language") { + std::string Lang = getToken(Options); + if (!getToken(Options).empty()) + throw "set language expects one argument at most."; + if (Lang == "") { + std::cout << "The currently understood settings are:\n\n" + << "local or auto Automatic setting based on source file\n" + << "c Use the C language\n" + << "c++ Use the C++ language\n" + << "unknown Use when source language is not supported\n"; + } else if (Lang == "local" || Lang == "auto") { + CurrentLanguage = 0; + } else if (Lang == "c") { + CurrentLanguage = &SourceLanguage::getCFamilyInstance(); + } else if (Lang == "c++") { + CurrentLanguage = &SourceLanguage::getCPlusPlusInstance(); + } else if (Lang == "unknown") { + CurrentLanguage = &SourceLanguage::getUnknownLanguageInstance(); + } else { + throw "Unknown language '" + Lang + "'."; + } + + } else if (What == "listsize") { + ListSize = getUnsignedIntegerOption("'set prompt' command", Options); + } else if (What == "prompt") { + // Include any trailing whitespace or other tokens, but not leading + // whitespace. + Prompt = getToken(Options); // Strip leading whitespace + Prompt += Options; // Keep trailing whitespace or other stuff + } else { + // FIXME: Try to parse this as a source-language program expression. + throw "Don't know how to set '" + What + "'!"; + } + } + + void CLIDebugger::showCommand(std::string &Options) { + std::string What = getToken(Options); + + if (What.empty() || !getToken(Options).empty()) + throw "show command expects one argument."; + + if (What == "language") { + std::cout << "The current source language is '"; + if (CurrentLanguage) + std::cout << CurrentLanguage->getSourceLanguageName(); + else + std::cout << "auto; currently " + << getCurrentLanguage().getSourceLanguageName(); + std::cout << "'.\n"; + } else if (What == "listsize") { + std::cout << "Number of source lines llvm-db will list by default is " + << ListSize << ".\n"; + } else if (What == "prompt") { + std::cout << "llvm-db's prompt is \"" << Prompt << "\".\n"; + } else { + throw "Unknown show command '" + What + "'. Try 'help show'."; + } + } + + void CLIDebugger::helpCommand(std::string &Options) { + // Print out all of the commands in the CommandTable + std::string Command = getToken(Options); + if (!getToken(Options).empty()) + throw "help command takes at most one argument."; + + // Getting detailed help on a particular command? + if (!Command.empty()) { + CLICommand *C = getCommand(Command); + std::cout << C->getShortHelp() << ".\n" << C->getLongHelp(); + + // If there are aliases for this option, print them out. + const std::vector &Names = C->getOptionNames(); + if (Names.size() > 1) { + std::cout << "The '" << Command << "' command is known as: '" + << Names[0] << "'"; + for (unsigned i = 1, e = Names.size(); i != e; ++i) + std::cout << ", '" << Names[i] << "'"; + std::cout << "\n"; + } + + } else { + unsigned MaxSize = 0; + for (std::map::iterator I = CommandTable.begin(), + E = CommandTable.end(); I != E; ++I) + if (I->first.size() > MaxSize && + I->first == I->second->getPrimaryOptionName()) + MaxSize = I->first.size(); + + // Loop over all of the commands, printing the short help version + for (std::map::iterator I = CommandTable.begin(), + E = CommandTable.end(); I != E; ++I) + if (I->first == I->second->getPrimaryOptionName()) + std::cout << I->first << std::string(MaxSize - I->first.size(), ' ') + << " - " << I->second->getShortHelp() << "\n"; + } + } Index: llvm/tools/llvm-db/Makefile diff -c /dev/null llvm/tools/llvm-db/Makefile:1.1 *** /dev/null Sun Jan 4 23:27:41 2004 --- llvm/tools/llvm-db/Makefile Sun Jan 4 23:27:31 2004 *************** *** 0 **** --- 1,60 ---- + ##===- tools/llvm-db/Makefile ------------------------------*- Makefile -*-===## + # + # The LLVM Compiler Infrastructure + # + # This file was developed by the LLVM research group and is distributed under + # the University of Illinois Open Source License. See LICENSE.TXT for details. + # + ##===----------------------------------------------------------------------===## + + LEVEL = ../.. + TOOLNAME = llvm-db + + # Get the $(ARCH) setting + include $(LEVEL)/Makefile.config + + # Generic JIT libraries + JITLIBS = lli-jit codegen executionengine + ARCHLIBS = + + # You can enable the X86 JIT on a non-X86 host by setting the flag + # ENABLE_X86_JIT on the make command line. If not, it will still be + # enabled automagically on an X86 host. + ifeq ($(ARCH), x86) + ENABLE_X86_JIT = 1 + endif + + # What the X86 JIT requires + ifdef ENABLE_X86_JIT + CPPFLAGS += -DENABLE_X86_JIT + JITLIBS += x86 selectiondag + # X86 doesn't require any ARCHLIBS + endif + + # You can enable the Sparc JIT on a non-Sparc host by setting the flag + # ENABLE_SPARC_JIT on the make command line. If not, it will still be + # enabled automagically on an Sparc host. + ifeq ($(ARCH), Sparc) + ENABLE_SPARC_JIT = 1 + endif + + # What the Sparc JIT requires + ifdef ENABLE_SPARC_JIT + CPPFLAGS += -DENABLE_SPARC_JIT + JITLIBS += sparc + ARCHLIBS += sched livevar instrument.a profpaths \ + bcwriter transforms.a ipo.a ipa.a datastructure.a regalloc \ + select + endif + + USEDLIBS = lli-interpreter $(JITLIBS) $(ARCHLIBS) scalaropts analysis.a \ + transformutils.a debugger bcreader vmcore support target.a + + + # Have gcc tell the linker to export symbols from the program so that + # dynamically loaded modules can be linked against them. + # + TOOLLINKOPTS = $(PLATFORMLIBDL) + + include $(LEVEL)/Makefile.common + Index: llvm/tools/llvm-db/llvm-db.cpp diff -c /dev/null llvm/tools/llvm-db/llvm-db.cpp:1.1 *** /dev/null Sun Jan 4 23:27:41 2004 --- llvm/tools/llvm-db/llvm-db.cpp Sun Jan 4 23:27:31 2004 *************** *** 0 **** --- 1,88 ---- + //===- llvm-db.cpp - LLVM Debugger ----------------------------------------===// + // + // The LLVM Compiler Infrastructure + // + // This file was developed by the LLVM research group and is distributed under + // the University of Illinois Open Source License. See LICENSE.TXT for details. + // + //===----------------------------------------------------------------------===// + // + // This utility implements a simple text-mode front-end to the LLVM debugger + // library. + // + //===----------------------------------------------------------------------===// + + #include "CLIDebugger.h" + #include "Support/CommandLine.h" + #include + + using namespace llvm; + + namespace { + // Command line options for specifying the program to debug and options to use + cl::opt + InputFile(cl::desc(""), cl::Positional, cl::init("")); + + cl::list + InputArgs("args", cl::Positional, cl::desc(""), + cl::ZeroOrMore); + + // Command line options to control various directory related stuff + cl::list + SourceDirectories("directory", cl::value_desc("directory"), + cl::desc("Add directory to the search for source files")); + cl::alias SDA("d", cl::desc("Alias for --directory"), + cl::aliasopt(SourceDirectories)); + + cl::opt + WorkingDirectory("cd", cl::desc("Use directory as current working directory"), + cl::value_desc("directory")); + + // Command line options specific to the llvm-db debugger driver + cl::opt Version("version", cl::desc("Print version number and quit")); + cl::opt Quiet("quiet", cl::desc("Do not print introductory messages")); + cl::alias QA1("silent", cl::desc("Alias for -quiet"), cl::aliasopt(Quiet)); + cl::alias QA2("q", cl::desc("Alias for -quiet"), cl::aliasopt(Quiet)); + } + + //===----------------------------------------------------------------------===// + // main Driver function + // + int main(int argc, char **argv, char * const *envp) { + cl::ParseCommandLineOptions(argc, argv, + " llvm source-level debugger\n"); + + if (Version || !Quiet) { + std::cout << "llvm-db: The LLVM source-level debugger\n"; + if (Version) return 1; + } + + // Merge Inputfile and InputArgs into the InputArgs list... + if (!InputFile.empty() && InputArgs.empty()) + InputArgs.push_back(InputFile); + + // Create the CLI debugger... + CLIDebugger D; + + // Initialize the debugger with the command line options we read... + Debugger &Dbg = D.getDebugger(); + + // Initialize the debugger environment. + Dbg.initializeEnvironment(envp); + Dbg.setWorkingDirectory(WorkingDirectory); + for (unsigned i = 0, e = SourceDirectories.size(); i != e; ++i) + D.addSourceDirectory(SourceDirectories[i]); + + if (!InputArgs.empty()) { + try { + D.fileCommand(InputArgs[0]); + } catch (const std::string &Error) { + std::cout << "Error: " << Error << "\n"; + } + + Dbg.setProgramArguments(InputArgs.begin()+1, InputArgs.end()); + } + + // Now that we have initialized the debugger, run it. + return D.run(); + } From lattner at cs.uiuc.edu Sun Jan 4 23:29:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jan 4 23:29:01 2004 Subject: [llvm-commits] CVS: llvm/test/Debugger/ Message-ID: <200401050528.XAA30933@zion.cs.uiuc.edu> Changes in directory llvm/test/Debugger: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/test/Debugger added to the repository --- Diffs of the changes: (+0 -0) From lattner at cs.uiuc.edu Sun Jan 4 23:29:16 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jan 4 23:29:16 2004 Subject: [llvm-commits] CVS: llvm/tools/Makefile Message-ID: <200401050528.XAA30905@zion.cs.uiuc.edu> Changes in directory llvm/tools: Makefile updated: 1.26 -> 1.27 --- Log message: Add new directory --- Diffs of the changes: (+3 -2) Index: llvm/tools/Makefile diff -u llvm/tools/Makefile:1.26 llvm/tools/Makefile:1.27 --- llvm/tools/Makefile:1.26 Tue Oct 28 13:16:49 2003 +++ llvm/tools/Makefile Sun Jan 4 23:28:15 2004 @@ -1,4 +1,4 @@ -##===- tools/Makefile ------------------------------*- Makefile -*-===## +##===- tools/Makefile --------------------------------------*- Makefile -*-===## # # The LLVM Compiler Infrastructure # @@ -6,9 +6,10 @@ # the University of Illinois Open Source License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## + LEVEL := .. PARALLEL_DIRS := llvm-as llvm-dis opt gccas llc llvm-link lli gccld \ - analyze extract bugpoint llvm-nm llvm-prof llvm-ar + analyze extract bugpoint llvm-nm llvm-prof llvm-db llvm-ar include $(LEVEL)/Makefile.common From lattner at cs.uiuc.edu Sun Jan 4 23:33:00 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jan 4 23:33:00 2004 Subject: [llvm-commits] CVS: llvm/test/Debugger/funccall.c funccall.ll Message-ID: <200401050532.XAA31025@zion.cs.uiuc.edu> Changes in directory llvm/test/Debugger: funccall.c added (r1.1) funccall.ll added (r1.1) --- Log message: An example testcase for use in the debugger. Currently you can do stuff like stepping, next'ing, finish'ing, stacktraces, source listings, etc. You can't print program variables yet though. Oh, and I lost my nice commented version of funccall.ll :( Test with: llvm-as funccall.ll llvm-db funccall.bc This is not automatically testable yet, and the C front-end doesn't support debug information yet. That said, it's a start. --- Diffs of the changes: (+82 -0) Index: llvm/test/Debugger/funccall.c diff -c /dev/null llvm/test/Debugger/funccall.c:1.1 *** /dev/null Sun Jan 4 23:32:50 2004 --- llvm/test/Debugger/funccall.c Sun Jan 4 23:32:40 2004 *************** *** 0 **** --- 1,14 ---- + + static int q; + + void foo() { + int t = q; + q = t + 1; + } + int main() { + q = 0; + foo(); + q = q - 1; + + return q; + } Index: llvm/test/Debugger/funccall.ll diff -c /dev/null llvm/test/Debugger/funccall.ll:1.1 *** /dev/null Sun Jan 4 23:32:50 2004 --- llvm/test/Debugger/funccall.ll Sun Jan 4 23:32:40 2004 *************** *** 0 **** --- 1,68 ---- + %lldb.compile_unit = type { uint, ushort, ushort, sbyte*, sbyte*, sbyte*, { }* } + %lldb.global = type { uint, %lldb.compile_unit*, sbyte*, { }*, sbyte*, bool } + %lldb.local = type { %lldb.global*, sbyte*, sbyte* } + %llvm.dbg.translation_units = linkonce global { } { } ; <{ }*> [#uses=1] + %llvm.dbg.globals = linkonce global { } { } ; <{ }*> [#uses=1] + %.str_1 = internal constant [11 x sbyte] c"funccall.c\00" ; <[11 x sbyte]*> [#uses=1] + %.str_2 = internal constant [12 x sbyte] c"/home/sabre\00" ; <[12 x sbyte]*> [#uses=1] + %.str_3 = internal constant [14 x sbyte] c"llvmgcc 3.4.x\00" ; <[14 x sbyte]*> [#uses=1] + %d.compile_unit = internal constant %lldb.compile_unit { uint 17, ushort 0, ushort 1, sbyte* getelementptr ([11 x sbyte]* %.str_1, long 0, long 0), sbyte* getelementptr ([12 x sbyte]* %.str_2, long 0, long 0), sbyte* getelementptr ([14 x sbyte]* %.str_3, long 0, long 0), { }* %llvm.dbg.translation_units } ; <%lldb.compile_unit*> [#uses=9] + %.str_5 = internal global [5 x sbyte] c"main\00" ; <[5 x sbyte]*> [#uses=1] + %.str_6 = internal global [4 x sbyte] c"foo\00" ; <[4 x sbyte]*> [#uses=1] + %.str_7 = internal global [2 x sbyte] c"q\00" ; <[2 x sbyte]*> [#uses=1] + %d.main = global %lldb.global { uint 46, %lldb.compile_unit* %d.compile_unit, sbyte* getelementptr ([5 x sbyte]* %.str_5, long 0, long 0), { }* %llvm.dbg.globals, sbyte* null, bool true } ; <%lldb.global*> [#uses=1] + %d.foo = global %lldb.global { uint 46, %lldb.compile_unit* %d.compile_unit, sbyte* getelementptr ([4 x sbyte]* %.str_6, long 0, long 0), { }* %llvm.dbg.globals, sbyte* null, bool true } ; <%lldb.global*> [#uses=1] + %q = internal global int 0 ; [#uses=7] + %d.q = internal global { %lldb.global, int* } { %lldb.global { uint 52, %lldb.compile_unit* %d.compile_unit, sbyte* getelementptr ([2 x sbyte]* %.str_7, long 0, long 0), { }* %llvm.dbg.globals, sbyte* null, bool false }, int* %q } ; <{ %lldb.global, int* }*> [#uses=0] + + implementation ; Functions: + + declare { }* %llvm.dbg.stoppoint({ }*, uint, uint, %lldb.compile_unit*) + + declare { }* %llvm.dbg.func.start(%lldb.global*) + + declare { }* %llvm.dbg.region.start({ }*) + + declare { }* %llvm.dbg.region.end({ }*) + + void %foo() { + %t = alloca int ; [#uses=2] + %.1 = call { }* %llvm.dbg.func.start( %lldb.global* %d.foo ) ; <{ }*> [#uses=1] + %.2 = call { }* %llvm.dbg.stoppoint( { }* %.1, uint 5, uint 2, %lldb.compile_unit* %d.compile_unit ) ; <{ }*> [#uses=1] + %tmp.0 = load int* %q ; [#uses=1] + store int %tmp.0, int* %t + %.3 = call { }* %llvm.dbg.stoppoint( { }* %.2, uint 6, uint 2, %lldb.compile_unit* %d.compile_unit ) ; <{ }*> [#uses=1] + %tmp.01 = load int* %t ; [#uses=1] + %tmp.1 = add int %tmp.01, 1 ; [#uses=1] + store int %tmp.1, int* %q + %.4 = call { }* %llvm.dbg.stoppoint( { }* %.3, uint 7, uint 1, %lldb.compile_unit* %d.compile_unit ) ; <{ }*> [#uses=1] + call { }* %llvm.dbg.region.end( { }* %.4 ) ; <{ }*>:0 [#uses=0] + ret void + } + + int %main() { + entry: + %.1 = call { }* %llvm.dbg.func.start( %lldb.global* %d.main ) ; <{ }*> [#uses=1] + %result = alloca int ; [#uses=2] + %.2 = call { }* %llvm.dbg.stoppoint( { }* %.1, uint 9, uint 2, %lldb.compile_unit* %d.compile_unit ) ; <{ }*> [#uses=1] + store int 0, int* %q + %.3 = call { }* %llvm.dbg.stoppoint( { }* %.2, uint 10, uint 2, %lldb.compile_unit* %d.compile_unit ) ; <{ }*> [#uses=1] + call void %foo( ) + %.4 = call { }* %llvm.dbg.stoppoint( { }* %.3, uint 11, uint 2, %lldb.compile_unit* %d.compile_unit ) ; <{ }*> [#uses=1] + %tmp.2 = load int* %q ; [#uses=1] + %tmp.3 = sub int %tmp.2, 1 ; [#uses=1] + store int %tmp.3, int* %q + %.5 = call { }* %llvm.dbg.stoppoint( { }* %.4, uint 13, uint 2, %lldb.compile_unit* %d.compile_unit ) ; <{ }*> [#uses=1] + %tmp.4 = load int* %q ; [#uses=1] + store int %tmp.4, int* %result + br label %return + + after_ret: ; No predecessors! + br label %return + + return: ; preds = %entry, %after_ret + %tmp.5 = load int* %result ; [#uses=1] + %.6 = call { }* %llvm.dbg.stoppoint( { }* %.5, uint 14, uint 1, %lldb.compile_unit* %d.compile_unit ) ; <{ }*> [#uses=1] + call { }* %llvm.dbg.region.end( { }* %.6 ) ; <{ }*>:0 [#uses=0] + ret int %tmp.5 + } From lattner at cs.uiuc.edu Sun Jan 4 23:36:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jan 4 23:36:01 2004 Subject: [llvm-commits] CVS: llvm/include/llvm/Intrinsics.h Message-ID: <200401050535.XAA31139@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm: Intrinsics.h updated: 1.13 -> 1.14 --- Log message: Add some intrinsics --- Diffs of the changes: (+6 -0) Index: llvm/include/llvm/Intrinsics.h diff -u llvm/include/llvm/Intrinsics.h:1.13 llvm/include/llvm/Intrinsics.h:1.14 --- llvm/include/llvm/Intrinsics.h:1.13 Tue Nov 11 16:41:30 2003 +++ llvm/include/llvm/Intrinsics.h Sun Jan 4 23:35:34 2004 @@ -37,6 +37,12 @@ sigsetjmp, // Used to represent a sigsetjmp call in C siglongjmp, // Used to represent a siglongjmp call in C + // Debugging intrinsics... + dbg_stoppoint, // Represents source lines and breakpointable places + dbg_region_start, // Start of a region + dbg_region_end, // End of a region + dbg_func_start, // Start of a function + //===------------------------------------------------------------------===// // This section defines intrinsic functions used to represent Alpha // instructions... From lattner at cs.uiuc.edu Sun Jan 4 23:37:00 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jan 4 23:37:00 2004 Subject: [llvm-commits] CVS: llvm/lib/VMCore/Function.cpp IntrinsicLowering.cpp Verifier.cpp Message-ID: <200401050536.XAA31202@zion.cs.uiuc.edu> Changes in directory llvm/lib/VMCore: Function.cpp updated: 1.58 -> 1.59 IntrinsicLowering.cpp updated: 1.3 -> 1.4 Verifier.cpp updated: 1.74 -> 1.75 --- Log message: Add VMCore and code generator support for debugging intrinsics. By default code generators completely ignore them. --- Diffs of the changes: (+19 -0) Index: llvm/lib/VMCore/Function.cpp diff -u llvm/lib/VMCore/Function.cpp:1.58 llvm/lib/VMCore/Function.cpp:1.59 --- llvm/lib/VMCore/Function.cpp:1.58 Fri Nov 21 16:32:23 2003 +++ llvm/lib/VMCore/Function.cpp Sun Jan 4 23:36:30 2004 @@ -207,6 +207,12 @@ if (getName() == alpha_intrinsics[i].name) return alpha_intrinsics[i].id; break; + case 'd': + if (getName() == "llvm.dbg.stoppoint") return Intrinsic::dbg_stoppoint; + if (getName() == "llvm.dbg.region.start")return Intrinsic::dbg_region_start; + if (getName() == "llvm.dbg.region.end") return Intrinsic::dbg_region_end; + if (getName() == "llvm.dbg.func.start") return Intrinsic::dbg_func_start; + break; case 'l': if (getName() == "llvm.longjmp") return Intrinsic::longjmp; break; Index: llvm/lib/VMCore/IntrinsicLowering.cpp diff -u llvm/lib/VMCore/IntrinsicLowering.cpp:1.3 llvm/lib/VMCore/IntrinsicLowering.cpp:1.4 --- llvm/lib/VMCore/IntrinsicLowering.cpp:1.3 Sun Dec 28 15:23:38 2003 +++ llvm/lib/VMCore/IntrinsicLowering.cpp Sun Jan 4 23:36:30 2004 @@ -48,6 +48,14 @@ // Insert the call to abort new CallInst(M->getOrInsertFunction("abort", Type::VoidTy, 0), "", CI); break; + + case Intrinsic::dbg_stoppoint: + case Intrinsic::dbg_region_start: + case Intrinsic::dbg_region_end: + case Intrinsic::dbg_func_start: + if (CI->getType() != Type::VoidTy) + CI->replaceAllUsesWith(Constant::getNullValue(CI->getType())); + break; // Simply strip out debugging intrinsics } assert(CI->use_empty() && Index: llvm/lib/VMCore/Verifier.cpp diff -u llvm/lib/VMCore/Verifier.cpp:1.74 llvm/lib/VMCore/Verifier.cpp:1.75 --- llvm/lib/VMCore/Verifier.cpp:1.74 Fri Nov 21 16:32:23 2003 +++ llvm/lib/VMCore/Verifier.cpp Sun Jan 4 23:36:30 2004 @@ -548,6 +548,11 @@ case Intrinsic::longjmp: NumArgs = 2; break; case Intrinsic::sigsetjmp: NumArgs = 2; break; case Intrinsic::siglongjmp: NumArgs = 2; break; + + case Intrinsic::dbg_stoppoint: NumArgs = 4; break; + case Intrinsic::dbg_region_start:NumArgs = 1; break; + case Intrinsic::dbg_region_end: NumArgs = 1; break; + case Intrinsic::dbg_func_start: NumArgs = 1; break; case Intrinsic::alpha_ctlz: NumArgs = 1; break; case Intrinsic::alpha_cttz: NumArgs = 1; break; From lattner at cs.uiuc.edu Sun Jan 4 23:43:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jan 4 23:43:01 2004 Subject: [llvm-commits] CVS: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp Message-ID: <200401050542.XAA09377@zion.cs.uiuc.edu> Changes in directory llvm/lib/CodeGen: TwoAddressInstructionPass.cpp updated: 1.4 -> 1.5 --- Log message: fix warning --- Diffs of the changes: (+1 -1) Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.4 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.5 --- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.4 Sun Jan 4 20:25:45 2004 +++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp Sun Jan 4 23:42:17 2004 @@ -129,7 +129,7 @@ // because of SSA. for (unsigned i = 1; i < mi->getNumOperands(); ++i) { assert(!mi->getOperand(i).isRegister() || - mi->getOperand(i).getAllocatedRegNum() != regA); + mi->getOperand(i).getAllocatedRegNum() != (int)regA); } const TargetRegisterClass* rc = regAisPhysical ? From lattner at cs.uiuc.edu Sun Jan 4 23:46:01 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jan 4 23:46:01 2004 Subject: [llvm-commits] CVS: llvm/lib/Debugger/SourceLanguage-Unknown.cpp Message-ID: <200401050545.XAA15005@zion.cs.uiuc.edu> Changes in directory llvm/lib/Debugger: SourceLanguage-Unknown.cpp updated: 1.1 -> 1.2 --- Log message: /me slaps forehead --- Diffs of the changes: (+1 -0) Index: llvm/lib/Debugger/SourceLanguage-Unknown.cpp diff -u llvm/lib/Debugger/SourceLanguage-Unknown.cpp:1.1 llvm/lib/Debugger/SourceLanguage-Unknown.cpp:1.2 --- llvm/lib/Debugger/SourceLanguage-Unknown.cpp:1.1 Sun Jan 4 23:25:10 2004 +++ llvm/lib/Debugger/SourceLanguage-Unknown.cpp Sun Jan 4 23:45:25 2004 @@ -16,6 +16,7 @@ #include "llvm/Debugger/SourceLanguage.h" #include "llvm/Debugger/ProgramInfo.h" #include +#include using namespace llvm; //===----------------------------------------------------------------------===// From lattner at cs.uiuc.edu Sun Jan 4 23:46:16 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jan 4 23:46:16 2004 Subject: [llvm-commits] CVS: llvm/include/llvm/Debugger/RuntimeInfo.h Message-ID: <200401050545.XAA14045@zion.cs.uiuc.edu> Changes in directory llvm/include/llvm/Debugger: RuntimeInfo.h updated: 1.1 -> 1.2 --- Log message: /me slaps forehead --- Diffs of the changes: (+1 -0) Index: llvm/include/llvm/Debugger/RuntimeInfo.h diff -u llvm/include/llvm/Debugger/RuntimeInfo.h:1.1 llvm/include/llvm/Debugger/RuntimeInfo.h:1.2 --- llvm/include/llvm/Debugger/RuntimeInfo.h:1.1 Sun Jan 4 23:23:38 2004 +++ llvm/include/llvm/Debugger/RuntimeInfo.h Sun Jan 4 23:45:04 2004 @@ -19,6 +19,7 @@ #define LLVM_DEBUGGER_RUNTIMEINFO_H #include +#include namespace llvm { class ProgramInfo; From lattner at cs.uiuc.edu Sun Jan 4 23:48:00 2004 From: lattner at cs.uiuc.edu (Chris Lattner) Date: Sun Jan 4 23:48:00 2004 Subject: [llvm-commits] CVS: llvm/tools/llvm-db/CLICommand.h Message-ID: <200401050547.XAA17279@zion.cs.uiuc.edu> Changes in directory llvm/tools/llvm-db: CLICommand.h updated: 1.1 -> 1.2 --- Log message: /me slaps head --- Diffs of the changes: (+1 -0) Index: llvm/tools/llvm-db/CLICommand.h diff -u llvm/tools/llvm-db/CLICommand.h:1.1 llvm/tools/llvm-db/CLICommand.h:1.2 --- llvm/tools/llvm-db/CLICommand.h:1.1 Sun Jan 4 23:27:31 2004 +++ llvm/tools/llvm-db/CLICommand.h Sun Jan 4 23:47:19 2004 @@ -17,6 +17,7 @@ #include #include +#include namespace llvm { class CLIDebugger;