findent-3.1.1/0000755000175000017500000000000013476205436010156 500000000000000findent-3.1.1/m4/0000755000175000017500000000000013476205436010476 500000000000000findent-3.1.1/m4/ax_prog_flex.m40000644000175000017500000000462212556411700013330 00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_prog_flex.html # =========================================================================== # # SYNOPSIS # # AX_PROG_FLEX(ACTION-IF-TRUE,ACTION-IF-FALSE) # # DESCRIPTION # # Check whether flex is the scanner generator. Run ACTION-IF-TRUE if # successful, ACTION-IF-FALSE otherwise # # LICENSE # # Copyright (c) 2009 Francesco Salvestrini # Copyright (c) 2010 Diego Elio Petteno` # # 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, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 12 AC_DEFUN([AX_PROG_FLEX], [ AC_REQUIRE([AM_PROG_LEX]) AC_REQUIRE([AC_PROG_EGREP]) AC_CACHE_CHECK([if flex is the lexer generator],[ax_cv_prog_flex],[ AS_IF([$LEX --version 2>/dev/null | $EGREP -qw '^g?flex'], [ax_cv_prog_flex=yes], [ax_cv_prog_flex=no]) ]) AS_IF([test "$ax_cv_prog_flex" = "yes"], m4_ifnblank([$1], [[$1]]), m4_ifnblank([$2], [[$2]]) ) ]) findent-3.1.1/m4/ax_prog_bison.m40000644000175000017500000000527213043721100013474 00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_prog_bison.html # =========================================================================== # # SYNOPSIS # # AX_PROG_BISON(ACTION-IF-TRUE,ACTION-IF-FALSE) # # DESCRIPTION # # Check whether bison is the parser generator. Run ACTION-IF-TRUE if # successful, ACTION-IF-FALSE otherwise # # LICENSE # # Copyright (c) 2009 Francesco Salvestrini # Copyright (c) 2010 Diego Elio Petteno` # # 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, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 9 AC_DEFUN([AX_PROG_BISON], [ AC_REQUIRE([AC_PROG_YACC]) AC_REQUIRE([AC_PROG_EGREP]) AC_CACHE_CHECK([if bison is the parser generator],[ax_cv_prog_bison],[ AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '], [ax_cv_prog_bison=yes], [ax_cv_prog_bison=no]) ]) AS_IF([test "$ax_cv_prog_bison" = "yes"], [ dnl replace the yacc-compatible compiler with the real bison, as dnl otherwise autoconf limits us to the POSIX yacc. dnl We also change the generated filename to the old one, so that dnl automake's ylwrap can deal with it. YACC="${YACC% -y} -o y.tab.c" ] m4_ifnblank([$1], [[$1]]), m4_ifnblank([$2], [[$2]]) ) ]) findent-3.1.1/configure0000755000175000017500000064677613476205425012035 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for findent 3.1.1. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= 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 IFS=$as_save_IFS ;; 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and wvermin@gmail.com $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # 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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval 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="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='findent' PACKAGE_TARNAME='findent' PACKAGE_VERSION='3.1.1' PACKAGE_STRING='findent 3.1.1' PACKAGE_BUGREPORT='wvermin@gmail.com' PACKAGE_URL='' ac_unique_file="src/findent.cpp" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS CXXCPP SED am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX ac_ct_FC FCFLAGS FC USEFLEX_FALSE USEFLEX_TRUE LEXLIB am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC LEX_OUTPUT_ROOT LEX USEBISON_FALSE USEBISON_TRUE EGREP GREP YFLAGS YACC USEESOPE_FALSE USEESOPE_TRUE MAKEWIN_FALSE MAKEWIN_TRUE MAKEMAN_FALSE MAKEMAN_TRUE EXEEXT MINGW32 make_include MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode with_windows with_esope with_bison with_flex enable_dependency_tracking ' ac_precious_vars='build_alias host_alias target_alias YACC YFLAGS LEX CC CFLAGS LDFLAGS LIBS CPPFLAGS FC FCFLAGS CXX CXXFLAGS CCC CXXCPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # 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. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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 case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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 ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_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'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" 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 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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | 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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # 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 findent 3.1.1 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 \`..'] 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] --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] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/findent] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _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 findent 3.1.1:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-windows Build findent.exe [default=no] --with-esope Build with esope support [default=no] --with-bison Use bison to create parser [default=use-bison-if-available] --with-flex Use flex to create lexer [default=use-flex-if-available] Some influential environment variables: YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. LEX The 'Fast lexical analyser generator' to use CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory FC Fortran compiler command FCFLAGS Fortran compiler flags CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP 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 ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested 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 else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF findent configure 3.1.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 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 fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_fc_try_compile LINENO # --------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_fc_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_fc_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_fc_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_cxx_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## -------------------------------- ## ## Report this to wvermin@gmail.com ## ## -------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel # ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_cxx_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_compile cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by findent $as_me 3.1.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { 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` /usr/bin/hostinfo = `(/usr/bin/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=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&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. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # 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: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > 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 cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } 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. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_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 $ac_precious_vars; 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,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_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 # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_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. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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 am__api_version='1.16' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; 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 as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # 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" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&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/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /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_fn_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 rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir 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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$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' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # 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 ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file 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 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". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file 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 $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='findent' VERSION='3.1.1' 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"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ac_config_headers="$ac_config_headers config.h" make_include="include" # Check whether --with-windows was given. if test "${with_windows+set}" = set; then : withval=$with_windows; else with_windows=no fi mingw32="i686-w64-mingw32-g++" if test "x$with_windows" = xyes; then : # Extract the first word of "$mingw32", so it can be a program name with args. set dummy $mingw32; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MINGW32+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MINGW32"; then ac_cv_prog_MINGW32="$MINGW32" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MINGW32="$mingw32" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_MINGW32" && ac_cv_prog_MINGW32="none" fi fi MINGW32=$ac_cv_prog_MINGW32 if test -n "$MINGW32"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MINGW32" >&5 $as_echo "$MINGW32" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$MINGW32" = xnone; then : as_fn_error $? "Not found: $mingw32, set MINGW32 to a working mingw C++ compiler" "$LINENO" 5 fi if test "x$with_windows" = xyes; then : CXX=$MINGW32 { $as_echo "$as_me:${as_lineno-$LINENO}: mingw c++ compiler: $MINGW32" >&5 $as_echo "$as_me: mingw c++ compiler: $MINGW32" >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Will create WINDOWS executable findent.exe" >&5 $as_echo "$as_me: Will create WINDOWS executable findent.exe" >&6;} EXEEXT=.exe fi if test "x$with_windows" != "xyes"; then MAKEMAN_TRUE= MAKEMAN_FALSE='#' else MAKEMAN_TRUE='#' MAKEMAN_FALSE= fi if test "x$with_windows" = "xyes"; then MAKEWIN_TRUE= MAKEWIN_FALSE='#' else MAKEWIN_TRUE='#' MAKEWIN_FALSE= fi # Check whether --with-esope was given. if test "${with_esope+set}" = set; then : withval=$with_esope; else with_esope=no fi if test "x$with_esope" = "xyes"; then USEESOPE_TRUE= USEESOPE_FALSE='#' else USEESOPE_TRUE='#' USEESOPE_FALSE= fi # test if bison available etc... # Check whether --with-bison was given. if test "${with_bison+set}" = set; then : withval=$with_bison; else with_bison=use-bison-if-available fi usebison="$with_bison" if test "x$with_bison" != "xno"; then : # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_prog_bison.html # =========================================================================== # # SYNOPSIS # # AX_PROG_BISON(ACTION-IF-TRUE,ACTION-IF-FALSE) # # DESCRIPTION # # Check whether bison is the parser generator. Run ACTION-IF-TRUE if # successful, ACTION-IF-FALSE otherwise # # LICENSE # # Copyright (c) 2009 Francesco Salvestrini # Copyright (c) 2010 Diego Elio Petteno` # # 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, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 9 fi for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" if test "x$with_bison" = "xyes"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if bison is the parser generator" >&5 $as_echo_n "checking if bison is the parser generator... " >&6; } if ${ax_cv_prog_bison+:} false; then : $as_echo_n "(cached) " >&6 else if $YACC --version 2>/dev/null | $EGREP -q '^bison '; then : ax_cv_prog_bison=yes else ax_cv_prog_bison=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_prog_bison" >&5 $as_echo "$ax_cv_prog_bison" >&6; } if test "$ax_cv_prog_bison" = "yes"; then : YACC="${YACC% -y} -o y.tab.c" else as_fn_error $? "No valid bison found. Try --without-bison" "$LINENO" 5 fi fi if test "x$with_bison" = "xuse-bison-if-available"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if bison is the parser generator" >&5 $as_echo_n "checking if bison is the parser generator... " >&6; } if ${ax_cv_prog_bison+:} false; then : $as_echo_n "(cached) " >&6 else if $YACC --version 2>/dev/null | $EGREP -q '^bison '; then : ax_cv_prog_bison=yes else ax_cv_prog_bison=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_prog_bison" >&5 $as_echo "$ax_cv_prog_bison" >&6; } if test "$ax_cv_prog_bison" = "yes"; then : YACC="${YACC% -y} -o y.tab.c" { $as_echo "$as_me:${as_lineno-$LINENO}: Will use bison if necessary to create parser." >&5 $as_echo "$as_me: Will use bison if necessary to create parser." >&6;} usebison="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: No bison found. Will use pre-built parser." >&5 $as_echo "$as_me: No bison found. Will use pre-built parser." >&6;} usebison="no" fi fi if test "x$usebison" = "xyes"; then USEBISON_TRUE= USEBISON_FALSE='#' else USEBISON_TRUE='#' USEBISON_FALSE= fi # test if flex available etc... # Check whether --with-flex was given. if test "${with_flex+set}" = set; then : withval=$with_flex; else with_flex=use-flex-if-available fi useflex="$with_flex" if test "x$with_flex" != "xno"; then : # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_prog_flex.html # =========================================================================== # # SYNOPSIS # # AX_PROG_FLEX(ACTION-IF-TRUE,ACTION-IF-FALSE) # # DESCRIPTION # # Check whether flex is the scanner generator. Run ACTION-IF-TRUE if # successful, ACTION-IF-FALSE otherwise # # LICENSE # # Copyright (c) 2009 Francesco Salvestrini # Copyright (c) 2010 Diego Elio Petteno` # # 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, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 12 fi DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # Check whether --enable-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='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= 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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_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" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS 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 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; 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 conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* 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; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; 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; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : 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_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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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 depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&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". rm -rf conftest.dir 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 # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub 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 am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # 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. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # 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. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi if test "x$with_flex" = "xyes"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if flex is the lexer generator" >&5 $as_echo_n "checking if flex is the lexer generator... " >&6; } if ${ax_cv_prog_flex+:} false; then : $as_echo_n "(cached) " >&6 else if $LEX --version 2>/dev/null | $EGREP -qw '^g?flex'; then : ax_cv_prog_flex=yes else ax_cv_prog_flex=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_prog_flex" >&5 $as_echo "$ax_cv_prog_flex" >&6; } if test "$ax_cv_prog_flex" = "yes"; then : else as_fn_error $? "No valid flex found. Try --without-flex" "$LINENO" 5 fi fi if test "x$with_flex" = "xuse-flex-if-available"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if flex is the lexer generator" >&5 $as_echo_n "checking if flex is the lexer generator... " >&6; } if ${ax_cv_prog_flex+:} false; then : $as_echo_n "(cached) " >&6 else if $LEX --version 2>/dev/null | $EGREP -qw '^g?flex'; then : ax_cv_prog_flex=yes else ax_cv_prog_flex=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_prog_flex" >&5 $as_echo "$ax_cv_prog_flex" >&6; } if test "$ax_cv_prog_flex" = "yes"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Will use flex if necessary to create lexer." >&5 $as_echo "$as_me: Will use flex if necessary to create lexer." >&6;} useflex="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: No flex found. Will use pre-built lexer." >&5 $as_echo "$as_me: No flex found. Will use pre-built lexer." >&6;} useflex="no" fi fi if test "x$useflex" = "xyes"; then USEFLEX_TRUE= USEFLEX_FALSE='#' else USEFLEX_TRUE='#' USEFLEX_FALSE= fi # test for working gfortran (only used in make check): ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in gfortran 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_FC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$FC"; then ac_cv_prog_FC="$FC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_FC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi FC=$ac_cv_prog_FC if test -n "$FC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 $as_echo "$FC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$FC" && break done fi if test -z "$FC"; then ac_ct_FC=$FC for ac_prog in gfortran do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_FC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_FC"; then ac_cv_prog_ac_ct_FC="$ac_ct_FC" # 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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_FC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_FC=$ac_cv_prog_ac_ct_FC if test -n "$ac_ct_FC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5 $as_echo "$ac_ct_FC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_FC" && break done if test "x$ac_ct_FC" = x; then FC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac FC=$ac_ct_FC fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran compiler" >&5 $as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; } if ${ac_cv_fc_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF if ac_fn_fc_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_fc_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5 $as_echo "$ac_cv_fc_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FCFLAGS=${FCFLAGS+set} ac_save_FCFLAGS=$FCFLAGS FCFLAGS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5 $as_echo_n "checking whether $FC accepts -g... " >&6; } if ${ac_cv_prog_fc_g+:} false; then : $as_echo_n "(cached) " >&6 else FCFLAGS=-g cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_fc_try_compile "$LINENO"; then : ac_cv_prog_fc_g=yes else ac_cv_prog_fc_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5 $as_echo "$ac_cv_prog_fc_g" >&6; } if test "$ac_test_FCFLAGS" = set; then FCFLAGS=$ac_save_FCFLAGS elif test $ac_cv_prog_fc_g = yes; then if test "x$ac_cv_fc_compiler_gnu" = xyes; then FCFLAGS="-g -O2" else FCFLAGS="-g" fi else if test "x$ac_cv_fc_compiler_gnu" = xyes; then FCFLAGS="-O2" else FCFLAGS= fi fi if test $ac_compiler_gnu = yes; then GFC=yes else GFC= 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 if test "x$FC" = "xgfortran"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: gfortran will be used to compile test sources in 'make check'" >&5 $as_echo "$as_me: gfortran will be used to compile test sources in 'make check'" >&6;} else { $as_echo "$as_me:${as_lineno-$LINENO}: No gfortran compiler found. 'make check' will not try to compile test sources" >&5 $as_echo "$as_me: No gfortran compiler found. 'make check' will not try to compile test sources" >&6;} fi ac_config_files="$ac_config_files test/prelude" ac_config_files="$ac_config_files test/postlude" ac_config_files="$ac_config_files test/test-compile.sh" ac_config_files="$ac_config_files test/doit" ac_config_files="$ac_config_files test/init.sh" ac_config_files="$ac_config_files test/progfixed-dos.f.try.f.ref" ac_config_files="$ac_config_files test/progfixed-dos.f" ac_config_files="$ac_config_files test/progfixed.f.try.f.ref" ac_config_files="$ac_config_files test/progfixed.f" ac_config_files="$ac_config_files test/progfixed1.f.try.f.ref" ac_config_files="$ac_config_files test/progfixed1.f" ac_config_files="$ac_config_files test/progfixedfree-dos.f.try.f.ref" ac_config_files="$ac_config_files test/progfixedfree-dos.f" ac_config_files="$ac_config_files test/progfixedfree.f.try.f.ref" ac_config_files="$ac_config_files test/progfixedfree.f" ac_config_files="$ac_config_files test/progfree-dos.f.try.f.ref" ac_config_files="$ac_config_files test/progfree-dos.f" ac_config_files="$ac_config_files test/progfree.f.try.f.ref" ac_config_files="$ac_config_files test/progfree.f" ac_config_files="$ac_config_files test/progfree1.f.try.f.ref" ac_config_files="$ac_config_files test/progfree1.f" ac_config_files="$ac_config_files test/progfreefixed.f.try.f.ref" ac_config_files="$ac_config_files test/progfreefixed.f" ac_config_files="$ac_config_files test/esope.f.try.f.ref" ac_config_files="$ac_config_files test/esope.f" ac_config_files="$ac_config_files test/emacs_findent.ref" ac_config_files="$ac_config_files test/emacs_help.ref" ac_config_files="$ac_config_files test/gedit_external.ref" ac_config_files="$ac_config_files test/gedit_help.ref" ac_config_files="$ac_config_files test/gedit_plugin.ref" ac_config_files="$ac_config_files test/gedit_plugin_py.ref" ac_config_files="$ac_config_files test/help.ref" ac_config_files="$ac_config_files test/makefdeps.ref" ac_config_files="$ac_config_files test/manpage.ref" ac_config_files="$ac_config_files test/readme.ref" ac_config_files="$ac_config_files test/vim_findent.ref" ac_config_files="$ac_config_files test/vim_fortran.ref" ac_config_files="$ac_config_files test/vim_help.ref" ac_ext=cpp 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 -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$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 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="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&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". rm -rf conftest.dir 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 # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub 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 am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # 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. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # 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. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed ac_ext=cpp 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 ac_ext=cpp 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #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)) return 2; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h 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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in iostream string stack vector cstdio queue algorithm sstream do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else as_fn_error $? "Exiting" "$LINENO" 5 fi done ac_config_files="$ac_config_files Makefile src/Makefile scripts/Makefile test/Makefile vim/Makefile gedit/Makefile emacs/Makefile doc/Makefile deps/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 overridden 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, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} 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}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKEMAN_TRUE}" && test -z "${MAKEMAN_FALSE}"; then as_fn_error $? "conditional \"MAKEMAN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKEWIN_TRUE}" && test -z "${MAKEWIN_FALSE}"; then as_fn_error $? "conditional \"MAKEWIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USEESOPE_TRUE}" && test -z "${USEESOPE_FALSE}"; then as_fn_error $? "conditional \"USEESOPE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USEBISON_TRUE}" && test -z "${USEBISON_FALSE}"; then as_fn_error $? "conditional \"USEBISON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USEFLEX_TRUE}" && test -z "${USEFLEX_FALSE}"; then as_fn_error $? "conditional \"USEFLEX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $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 ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= 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 IFS=$as_save_IFS ;; 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 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval 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="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by findent $as_me 3.1.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -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_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ findent config.status 3.1.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "test/prelude") CONFIG_FILES="$CONFIG_FILES test/prelude" ;; "test/postlude") CONFIG_FILES="$CONFIG_FILES test/postlude" ;; "test/test-compile.sh") CONFIG_FILES="$CONFIG_FILES test/test-compile.sh" ;; "test/doit") CONFIG_FILES="$CONFIG_FILES test/doit" ;; "test/init.sh") CONFIG_FILES="$CONFIG_FILES test/init.sh" ;; "test/progfixed-dos.f.try.f.ref") CONFIG_FILES="$CONFIG_FILES test/progfixed-dos.f.try.f.ref" ;; "test/progfixed-dos.f") CONFIG_FILES="$CONFIG_FILES test/progfixed-dos.f" ;; "test/progfixed.f.try.f.ref") CONFIG_FILES="$CONFIG_FILES test/progfixed.f.try.f.ref" ;; "test/progfixed.f") CONFIG_FILES="$CONFIG_FILES test/progfixed.f" ;; "test/progfixed1.f.try.f.ref") CONFIG_FILES="$CONFIG_FILES test/progfixed1.f.try.f.ref" ;; "test/progfixed1.f") CONFIG_FILES="$CONFIG_FILES test/progfixed1.f" ;; "test/progfixedfree-dos.f.try.f.ref") CONFIG_FILES="$CONFIG_FILES test/progfixedfree-dos.f.try.f.ref" ;; "test/progfixedfree-dos.f") CONFIG_FILES="$CONFIG_FILES test/progfixedfree-dos.f" ;; "test/progfixedfree.f.try.f.ref") CONFIG_FILES="$CONFIG_FILES test/progfixedfree.f.try.f.ref" ;; "test/progfixedfree.f") CONFIG_FILES="$CONFIG_FILES test/progfixedfree.f" ;; "test/progfree-dos.f.try.f.ref") CONFIG_FILES="$CONFIG_FILES test/progfree-dos.f.try.f.ref" ;; "test/progfree-dos.f") CONFIG_FILES="$CONFIG_FILES test/progfree-dos.f" ;; "test/progfree.f.try.f.ref") CONFIG_FILES="$CONFIG_FILES test/progfree.f.try.f.ref" ;; "test/progfree.f") CONFIG_FILES="$CONFIG_FILES test/progfree.f" ;; "test/progfree1.f.try.f.ref") CONFIG_FILES="$CONFIG_FILES test/progfree1.f.try.f.ref" ;; "test/progfree1.f") CONFIG_FILES="$CONFIG_FILES test/progfree1.f" ;; "test/progfreefixed.f.try.f.ref") CONFIG_FILES="$CONFIG_FILES test/progfreefixed.f.try.f.ref" ;; "test/progfreefixed.f") CONFIG_FILES="$CONFIG_FILES test/progfreefixed.f" ;; "test/esope.f.try.f.ref") CONFIG_FILES="$CONFIG_FILES test/esope.f.try.f.ref" ;; "test/esope.f") CONFIG_FILES="$CONFIG_FILES test/esope.f" ;; "test/emacs_findent.ref") CONFIG_FILES="$CONFIG_FILES test/emacs_findent.ref" ;; "test/emacs_help.ref") CONFIG_FILES="$CONFIG_FILES test/emacs_help.ref" ;; "test/gedit_external.ref") CONFIG_FILES="$CONFIG_FILES test/gedit_external.ref" ;; "test/gedit_help.ref") CONFIG_FILES="$CONFIG_FILES test/gedit_help.ref" ;; "test/gedit_plugin.ref") CONFIG_FILES="$CONFIG_FILES test/gedit_plugin.ref" ;; "test/gedit_plugin_py.ref") CONFIG_FILES="$CONFIG_FILES test/gedit_plugin_py.ref" ;; "test/help.ref") CONFIG_FILES="$CONFIG_FILES test/help.ref" ;; "test/makefdeps.ref") CONFIG_FILES="$CONFIG_FILES test/makefdeps.ref" ;; "test/manpage.ref") CONFIG_FILES="$CONFIG_FILES test/manpage.ref" ;; "test/readme.ref") CONFIG_FILES="$CONFIG_FILES test/readme.ref" ;; "test/vim_findent.ref") CONFIG_FILES="$CONFIG_FILES test/vim_findent.ref" ;; "test/vim_fortran.ref") CONFIG_FILES="$CONFIG_FILES test/vim_fortran.ref" ;; "test/vim_help.ref") CONFIG_FILES="$CONFIG_FILES test/vim_help.ref" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "vim/Makefile") CONFIG_FILES="$CONFIG_FILES vim/Makefile" ;; "gedit/Makefile") CONFIG_FILES="$CONFIG_FILES gedit/Makefile" ;; "emacs/Makefile") CONFIG_FILES="$CONFIG_FILES emacs/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "deps/Makefile") CONFIG_FILES="$CONFIG_FILES deps/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 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 # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #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. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # 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. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "test/test-compile.sh":F) chmod +x test/test-compile.sh ;; "test/doit":F) chmod +x test/doit ;; "test/init.sh":F) chmod +x test/init.sh ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # 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=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || 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 || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi findent-3.1.1/INSTALL0000644000175000017500000003661413476205425011137 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command './configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this 'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a 'Makefile' in each directory of the package. It may also create one or more '.h' files containing system-dependent definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a file 'config.log' containing compiler output (useful mainly for debugging 'configure'). It can also use an optional file (typically called 'config.cache' and enabled with '--cache-file=config.cache' or simply '-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how 'configure' could check whether to do them, and mail diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at some point 'config.cache' contains results you don't want to keep, you may remove or edit it. The file 'configure.ac' (or 'configure.in') is used to create 'configure' by a program called 'autoconf'. You need 'configure.ac' if you want to change it or regenerate 'configure' using a newer version of 'autoconf'. The simplest way to compile this package is: 1. 'cd' to the directory containing the package's source code and type './configure' to configure the package for your system. Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type 'make' to compile the package. 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the 'make install' phase executed with root privileges. 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing 'make clean'. To also remove the files that 'configure' created (so you can compile the package for a different kind of computer), type 'make distclean'. There is also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. You can give 'configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in the directory that 'configure' is in and in '..'. This is known as a "VPATH" build. With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple '-arch' options to the compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the 'lipo' tool if you have problems. Installation Names ================== By default, 'make install' installs the package's commands under '/usr/local/bin', include files under '/usr/local/include', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like '--bindir=DIR' to specify different values for particular kinds of files. Run 'configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of '${prefix}', so that specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the 'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of '${prefix}'. Any directories that were specified during 'configure', but not in terms of '${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the 'DESTDIR' variable. For example, 'make install DESTDIR=/alternate/directory' will prepend '/alternate/directory' before all installation names. The approach of 'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of '${prefix}' at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving 'configure' the option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. Some packages pay attention to '--enable-FEATURE' options to 'configure', where FEATURE indicates an optional part of the package. They may also pay attention to '--with-PACKAGE' options, where PACKAGE is something like 'gnu-as' or 'x' (for the X Window System). The 'README' should mention any '--enable-' and '--with-' options that the package recognizes. For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, you can use the 'configure' options '--x-includes=DIR' and '--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be overridden with 'make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX 'make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its '' header file. The option '-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in '/usr/bin'. So, if you need '/usr/ucb' in your 'PATH', put it _after_ '/usr/bin'. On Haiku, software installed for all users goes in '/boot/common', not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the '--build=TYPE' option. TYPE can either be a short name for the system type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file 'config.sub' for the possible values of each field. If 'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with '--host=TYPE'. Sharing Defaults ================ If you want to set default values for 'configure' scripts to share, you can create a site shell script called 'config.site' that gives default values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' looks for 'PREFIX/share/config.site' if it exists, then 'PREFIX/etc/config.site' if it exists. Or, you can set the 'CONFIG_SITE' environment variable to the location of the site script. A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 'configure' Invocation ====================== 'configure' recognizes the following options to control how it operates. '--help' '-h' Print a summary of all of the options to 'configure', and exit. '--help=short' '--help=recursive' Print a summary of the options unique to this package's 'configure', and exit. The 'short' variant lists options used only in the top level, while the 'recursive' variant lists options also present in any nested packages. '--version' '-V' Print the version of Autoconf used to generate the 'configure' script, and exit. '--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. '--config-cache' '-C' Alias for '--cache-file=config.cache'. '--quiet' '--silent' '-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). '--srcdir=DIR' Look for the package's source code in directory DIR. Usually 'configure' can determine that directory automatically. '--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. '--no-create' '-n' Run the configure checks, but stop before creating any output files. 'configure' also accepts some other, not widely useful, options. Run 'configure --help' for more details. findent-3.1.1/README.2nd0000644000175000017500000000153013250464277011437 00000000000000Extra maintainer scripts: - bootstrap: Distribute version to various files. autoreconf -fvi Creates the output of flex and bison for usage on systems that do not have bison and/or flex installed. (make sure YOU have bison and flex installed) make distclean - maketar: Calls ./bootstrap. Creates, using make -distcheck, a tarball in ../versions . - makezip: Creates zipfile for usage in wondows in ../versions . - makesid: Calls ./maketar. Creates a sid debian distribution in ../debian . Usage is made from pbuilder. The makesid script contains information about the details. - makesid all After creating a sid debian distribution in ../debian, it creates wheezy-amd64 and wheezy-1386 debian distributions in ../debian . - makedeb: obsolete findent-3.1.1/debian/0000755000175000017500000000000013476205423011374 500000000000000findent-3.1.1/debian/compat0000644000175000017500000000000313306477602012515 0000000000000011 findent-3.1.1/debian/source/0000755000175000017500000000000013022025060012654 500000000000000findent-3.1.1/debian/source/format0000644000175000017500000000001413035714517014022 000000000000003.0 (quilt) findent-3.1.1/debian/watch0000644000175000017500000000010713035714517012343 00000000000000version=4 http://sf.net/findent/ findent-(.*)\.tar\.gz debian uupdate findent-3.1.1/debian/tests/0000755000175000017500000000000013475216312012534 500000000000000findent-3.1.1/debian/tests/progfixed.f0000644000175000017500000001641113476205431014616 00000000000000! -I0 -i5 -a1 -b2 -d3 -f4 -m5 -Rr module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum contains function f(x) print *,'abc 9 def' print *,"abcd 8 efgh" return end #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end subroutine ticket7 integer :: int real :: float logical :: bool #define COND \ if (float > 1.) then; \ continue ; \ end if COND if (.true.) then int = int + 1 end if end program progfixed type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm@@@(10) #endif real do(100) integer x(100) type(mytype) xyz character*1000 astring continue a_ap: do i=1,20 continue enddo a_ap end = 10 if ( e .eq. n .and. * e .eq. m )then npar = npar + 1 endif do i=1, c a comment c a comment x 1 c a comment x 0 continue enddo do 123 i=1,2 continue 123 continue print *,'; function ',indx," function " continue 99880 FORMAT (' function ') 99870 FORMAT(1X,'Invalid species name',2X,A8) do i=1,10 do (i) = 5 continue do(i) = 5 continue enddo x = y ! function values continue astring = " ! this x is x no comment!" print *,a,b, x c,d x ,e,f continue print *,a,b, x c,d x ,e,f loop: do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo loop bbb: block continue end block bbb sc: select case(ja) case(1) continue case(2) continue end select sc continue do i=1,20 block continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical wv: if ( a.eq.b) then continue endif wv if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue d print *,'debug i=',i D print *,'debug j=',j x = 4 + c next line starts with 1 5 + c next line starts with 2 5+ c next line starts with 3 5+ c next line starts with 4 5+ c next line starts with 5 5+ c next line starts with 6 5 return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou xtine five continue return end subroutine seven a = 1 x + 2 ! comment 1 y + 3 ! comment 2 y + 4 y + 5 y + 6 a = 1 x + 2 ! comment 1 y + 3 ! comment 2 #ifdef klm y + 4 syntax error y + 5 syntax error #endif y + 6 end subroutine multiline_preproc #ifdef one\ two\ three do i=1,10 #elif \ defined(q) do i=1,5 #else do i=1,7 #endif x=x+4 enddo end subroutine nok implicit none type domain_data real, dimension(:, :), allocatable :: temperature integer:: ibound, icopy, todomain end type type(domain_data), dimension(2), target :: dom allocate(dom(1) % temperature(20, 20)) dom(1) % temperature = 0. dom(1) % temperature(:, 1) = 1. end subroutine nok ! testing with findentfix: subroutine testfix implicit none integer i,j,k do i=1,10 c comment continue do j=1,6 continue ! findentfix: do do k=1,7 continue enddo C FINDENTFIX: enddo enddo * findentFIX: do;do continue * findentfix: enddo;enddo continue enddo end subroutine testfix subroutine testpointer integer, pointer :: subroutinesub integer, target :: i subroutinesub=>i ! must not be recognized as subroutine statement end subroutine omp integer i,j,k C$ integer m,n, c$ ! comment in omp sentinel ! normal comment *$ *$ 1 o,p print *,i,j,k !$ print*, m,n,o,p !$ do 100 i=1,20 !$ do 100 j=1,i c$ continue c$100 continue c$omp parallel c$omp do do i=1,20 continue enddo c$omp end parallel end subroutine label_excercise do 10 x 0 i=1,10 continue 01 00 continue do 02 0 i=1,10 continue 20 continue end findent-3.1.1/debian/tests/progfixedfree.f0000644000175000017500000001346313476205431015464 00000000000000! -Ia -i5 -a1 -b2 -d3 -f4 -m5 -ofree -ifixed module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum contains function f(x) print *,'abc 9 def' print *,"abcd #ifdef foo garbage #endif 8 efgh" return end function # ifdef usempi function f1(x,m) real x,m # elif defined(useopenmp) function f1(x,m,n) real x,m,n # else function f1(x) real x # endif continue end function f1 end module program progfixed type mytype ! mytype integer i c a comment ! a floating comment real x end type mytype #ifdef abcde real klm@@@(10) #endif real do(100) integer x(100) type(mytype) xyz character*1000 astring continue a_ap: do i=1,20 continue enddo a_ap end = 10 if ( e .eq. n .and. * e .eq. m )then npar = npar + 1 endif do i=1, c a comment c a comment x 1 c a comment x 0 continue enddo do 123 i=1,2 continue 123 continue print *,'; function ',indx," function " continue 99880 FORMAT (' function ') 99870 FORMAT(1X,'Invalid species name',2X,A8) do i=1,10 do (i) = 5 continue do(i) = 5 continue enddo x = y ! function values continue astring = " ! this x is x no comment!" print *,a,b, x c,d x ,e,f continue print *,a,b, x c,d x ,e,f loop: do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo loop bbb: block continue end block bbb sc: select case(ja) case(1) continue case(2) continue end select sc continue do i=1,20 block continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical wv: if ( a.eq.b) then continue endif wv if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue d print *,'debug i=',i c D print *,'debug j=',j x = 4 + c next line starts with 1 5 + c next line starts with 2 5+ c next line starts with 3 5+ c next line starts with 4 5+ c next line starts with 5 5+ c next line starts with 6 5 return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou xtine five continue return end subroutine seven a = 1 x + 2 ! comment 1 y + 3 ! comment 2 y + 4 y + 5 y + 6 a = 1 x + 2 ! comment 1 y + 3 ! comment 2 #ifdef klm y + 4 syntax error y + 5 syntax error #endif y + 6 end subroutine multiline_preproc #ifdef one\ two\ three do i=1,10 #elif \ defined(q) do i=1,5 #else do i=1,7 #endif x=x+4 enddo end subroutine omp integer i,j,k C$ integer m,n, c$ c$ !comment c$ *$ 1 o,p print *,i,j,k !$ print*, m,n,o,p !$ do 100 i=1,20 !$ do 100 j=1,i c$ continue c$100 continue end findent-3.1.1/debian/tests/progfixed-dos.f0000644000175000017500000000626613476205431015410 00000000000000! -I0 -i5 -a1 -b2 -d3 -f4 -m5 -ifixed module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum #ifdef foo garbage #endif contains function f(x) print *,'abc 9 def' print *,"abcd 8 efgh" return end function #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module program progfixed type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm(10) #endif integer x(100) type(mytype) xyz continue do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou xtine five continue return end findent-3.1.1/debian/tests/test9.sh0000744000175000017500000000022713476205431014063 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfixed1.f rc=$? . ../postlude exit $rc findent-3.1.1/debian/tests/progfreefixed.f0000644000175000017500000001204713476205431015461 00000000000000! -Ia -i5 -a1 -b2 -d3 -f4 -m5 -ifree -ofixed module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum contains function f(x) print *,'abc& & def' print *,"abcd& #ifdef foo garbage & #endif & efgh" return end function #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module program progfixed type mytype ! mytype integer i ! a comment ! a floating comment real x end type mytype #ifdef abcde real klm@@@(10) #endif real do(100) integer x(100) type(mytype) xyz character*1000 astring continue a_ap: do i=1,20 continue enddo a_ap end = 10 if ( e .eq. n .and.& & e .eq. m )then npar = npar + 1 endif do i=1,& ! a comment ! a comment &1& ! a comment &0 continue enddo do 123 i=1,2 continue 123 continue print *,'; function ',indx," function " continue 99880 FORMAT (' function ') 99870 FORMAT(1X,'Invalid species name',2X,A8) do i=1,10 do (i) = 5 continue do(i) = 5 continue enddo x = y ! function values continue astring = " ! this& & is& & no comment!" print *,a,b,& & c,d& & ,e,f continue print *,a,b,& & c,d& & ,e,f loop: do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo loop bbb: block continue end block bbb sc: select case(ja) case(1) continue case(2) continue end select sc continue do i=1,20 block continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical wv: if ( a.eq.b) then continue endif wv if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue !d print *,'debug i=',i ! !D print *,'debug j=',j x = 4 +& ! next line starts with &5 +& ! next line starts with &5+& ! next line starts with &5+& ! next line starts with &5+& ! next line starts with &5+& ! next line starts with &5 return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou& &tine five continue return end subroutine seven a = 1& &+ 2 &! comment 1 &+ 3 &! comment 2 &+ 4& &+ 5& &+ 6 a = 1& &+ 2 &! comment 1 &+ 3 &! comment 2 #ifdef klm &+ 4 syntax error& &+ 5 syntax error& #endif &+ 6 end subroutine multiline_preproc #ifdef one\ two\ three do i=1,10 #elif \ defined(q) do i=1,5 #else do i=1,7 #endif x=x+4 enddo end subroutine omp integer i,j,k !$ integer m,n, & !$ o,p print *,i,j,k !$ print*, m,n,o,p !$ do 100 i=1,20 !$ do 100 j=1,i continue !$ 100 enddo end findent-3.1.1/debian/tests/progfree-dos.f0000644000175000017500000000514213476205431015222 00000000000000! -I2 -i5 -a1 -b2 -d3 -f4 -m5 -ifree module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum type, public :: mytypea integer i end type mytypea contains function f(x) print *,'abc & def' print *,"abcd& & efgh" return end function #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module program progfree type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm(10) #endif integer x(100) type(mytype) xyz continue do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou& &tine five continue return end findent-3.1.1/debian/tests/progfree1.f0000644000175000017500000000006413476205431014516 00000000000000! -i- -I8 -ifree -Rr program programma continue end findent-3.1.1/debian/tests/progfree.f.try.f.ref0000644000175000017500000002303713476205431016256 00000000000000! -I2 -i5 -a1 -b2 -d3 -f4 -m5 -Rr ! ticket 1 block data pblockdata common /xcomm/ p end block data pblockdata block data qblockdata common /qcomm/ p end block data qblockdata block data rblockdata common /rcomm/ p end block data rblockdata ! submodule and 'module subroutine' not recognized by gfortran 4.8.2 #if 0 MODULE ancestor INTEGER :: i INTERFACE MODULE SUBROUTINE sub1(arg1) INTEGER :: arg1 end subroutine sub1 MODULE SUBROUTINE sub2(arg2) INTEGER :: arg2 end subroutine sub2 END INTERFACE end module ancestor SUBMODULE (ancestor) descendant INTEGER :: j CONTAINS MODULE SUBROUTINE sub1(arg1) INTEGER :: arg1 arg1 = 1 i = 2 j = 3 end subroutine sub1 module function fun1(arg1) integer :: arg1 fun1 = 10 end function fun1 MODULE PROCEDURE sub2 arg2 = 1 end procedure sub2 end submodule descendant #endif module some_module type :: onetype integer i end type onetype type name character(22) :: n end type complex ccc interface myinterface subroutine tx(a,b) real a,b end subroutine tx end interface interface anotherinterface module procedure funccc ! ! trata module procedure funcccc end interface abstract interface character*8 recursive function func(x) real :: x end function func end interface contains character*(8) impure function funcc(x) real :: x funcc = 'a' end function funcc integer(kind=4) pure function funccc(x) real, intent(in) :: x funccc = 2 end function funccc type(onetype) function funcccc(x) type(onetype) :: x funcccc = x end function funcccc integer elemental function funcx(x) integer, intent(in) :: x funcx = x end function funcx #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) /* Test for GCC >= 4.8.0 */ #if GCC_VERSION >= 40800 subroutine handleP(p) class(*), intent(in) :: p select type(p) type is (character(len=*)) write(*,*) len(p), ': ', p class is (name) write(*,*) len(p%n), ': ', p%n class default write(*,*) 'Unknown type' end select end subroutine handleP #endif double complex function compx(x) double complex x compx = x end function compx complex recursive function compxx(x) complex x compxx = x end function compxx real function alpha_integral_function(x) implicit none real:: x alpha_integral_function = 0 end function alpha_integral_function end module some_module ! end of this module ! /ticket 1 module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum type, public :: mytypea integer i end type mytypea integer, parameter, public :: i8=selected_int_kind(16) contains function f(x) print *,'abc & def' print *,"abcd& & efgh" return end function f integer(kind=i8) function func1(a, b) integer(kind=i8), intent(in) :: a, b func1 = a + b end function func1 integer(kind=i8)function funcx(a, b) integer(kind=i8), intent(in) :: a, b funcx = a + b end function funcx #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module m1 subroutine ticket7 integer :: int real :: float logical :: bool #define COND \ if (float > 1.) then; \ if (bool) write(*, *) 'nope'; \ end if COND if (.true.) then int = int + 1 end if end subroutine ticket7 program progfree type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm(10) #endif integer x(100) type(mytype) xyz real do(1000) continue loop: do i=1,20 continue enddo loop loop1 : do , i=1,20 continue enddo loop1 end = 10 do while(i.eq.0) continue enddo do , while(i.eq.0) continue enddo do concurrent(i=1:10) x(i) = 0 enddo do , concurrent(i=1:10) x(i) = 0 enddo if ( a.eq.b .and. & c.eq.r) then n=n+1 endif iff: if (a.eq.b) then continue endif iff lsele: select case(i) case(10) continue case(11) continue case default continue end select lsele lblock: block continue end block lblock x = 3.0*a + 4*b + & & 2 *c + y assign 90 to i do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo do i=1,10; do j=3,5; continue; enddo; enddo do i=1,7; do j=2,2 continue enddo continue enddo do ; enddo critical x=y do(3) = 123 endcritical critical x=y endcritical critical x=y end critical if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall hop:forall(i=1:4) ! forall x(i)=6 end forall hop where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program progfree subroutine one(a) continue entry myentry continue return end subroutine one subroutine two(a) continue a = 3 + &! comment1 4 + & ! comment 2 5 a = 3 + & ! test preprocessor within continuation 4 + & #ifdef abc this would cause a compilation error & #endif 5 return end subroutine two subroutine three(a) do 10 i=1,4 do 5 j=1,2 continue 5 enddo 10 enddo typecode = 9 continue return end subroutine three subroutine four(a) continue return end subroutine four subrou& &tine five continue return end subroutine five subroutine seven a = 1& &+ 2 &! comment 1 &+ 3 &! comment 2 &+ 4& &+ 5& &+ 6 a = 1& &+ 2 &! comment 1 &+ 3 &! comment 2 #ifdef klm &+ 4 syntax error& &+ 5 syntax error& #endif &+ 6 end subroutine seven subroutine multiline_preproc #ifdef one\ two\ three do i=1,10 #elif \ defined(q) do i=1,5 #else do i=1,7 #endif x=x+4 enddo end subroutine multiline_preproc subroutine nok implicit none type domain_data real, dimension(:, :), allocatable :: temperature integer:: ibound, icopy, todomain end type type(domain_data), dimension(2), target :: dom allocate(dom(1) % temperature(20, 20)) dom(1) % temperature = 0. dom(1) % temperature(:, 1) = 1. end subroutine nok ! testing with findentfix: subroutine testfix implicit none integer i,j,k do i=1,10 ! comment continue do j=1,6 continue ! findentfix: do do k=1,7 continue enddo ! FINDENTFIX: enddo enddo continue enddo end subroutine testfix subroutine omp integer i,j,k !$ integer m,n, & !$ o,p print *,i,j,k !$ print*, m,n,o,p !$ do i=1,20 continue !$ enddo end subroutine omp subroutine label_excercise do 010& &0 i=1,10 continue 01& &00 continue continue 120 do i=1,10 continue enddo end subroutine label_excercise findent-3.1.1/debian/tests/vim_help.ref0000644000175000017500000000015013476205431014752 00000000000000To enable findent for vim: find out in which directory the configuration files for vim are situated, findent-3.1.1/debian/tests/progfixed1.f0000644000175000017500000000013613476205431014674 00000000000000! -i- -I8 -ifixed program programma continue end findent-3.1.1/debian/tests/test1.sh0000744000175000017500000000023213476205431014047 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfixed-dos.f rc=$? . ../postlude exit $rc findent-3.1.1/debian/tests/vim_fortran.ref0000644000175000017500000000013613476205431015501 00000000000000" Vim indent file " Installation: Place this script in the $HOME/.vim/after/indent/ directory findent-3.1.1/debian/tests/vim_findent.ref0000644000175000017500000000012213476205431015450 00000000000000" to enable the findent Fortran indent program: " include this file in ~/.vimrc findent-3.1.1/debian/tests/postlude0000644000175000017500000000002213246542176014236 00000000000000cd .. rm -rf $dir findent-3.1.1/debian/tests/esope.f0000644000175000017500000000104213476205431013734 00000000000000! program esope ! 'normal' fortran compilers do not understand esope syntax #if 0 segment, test continue integer t endsegment SEGMENT, test continue integer t ENDSEGMENT 10 segment test1 30 continue endsegment segment continue segment = 10 continue segment tra = 10 continue segini,val segini ,val segsup , val #endif end findent-3.1.1/debian/tests/emacs_help.ref0000644000175000017500000000003313476205431015247 00000000000000Usage of findent in emacs findent-3.1.1/debian/tests/progfixedfree.f.try.f.ref0000644000175000017500000001224113476205431017271 00000000000000! -Ia -i5 -a1 -b2 -d3 -f4 -m5 -ofree -ifixed module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum contains function f(x) print *,'abc& & def' print *,"abcd& #ifdef foo garbage #endif & efgh" return end function # ifdef usempi function f1(x,m) real x,m # elif defined(useopenmp) function f1(x,m,n) real x,m,n # else function f1(x) real x # endif continue end function f1 end module program progfixed type mytype ! mytype integer i ! a comment ! a floating comment real x end type mytype #ifdef abcde real klm@@@(10) #endif real do(100) integer x(100) type(mytype) xyz character*1000 astring continue a_ap: do i=1,20 continue enddo a_ap end = 10 if ( e .eq. n .and.& &e .eq. m )then npar = npar + 1 endif do i=1,& ! a comment ! a comment &1& ! a comment &0 continue enddo do 123 i=1,2 continue 123 continue print *,'; function ',indx," function " continue 99880 FORMAT (' function ') 99870 FORMAT(1X,'Invalid species name',2X,A8) do i=1,10 do (i) = 5 continue do(i) = 5 continue enddo x = y ! function values continue astring = " ! this& & is& & no comment!" print *,a,b,& &c,d& &,e,f continue print *,a,b,& &c,d& &,e,f loop: do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo loop bbb: block continue end block bbb sc: select case(ja) case(1) continue case(2) continue end select sc continue do i=1,20 block continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical wv: if ( a.eq.b) then continue endif wv if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue !d print *,'debug i=',i ! !D print *,'debug j=',j x = 4 +& ! next line starts with &5 +& ! next line starts with &5+& ! next line starts with &5+& ! next line starts with &5+& ! next line starts with &5+& ! next line starts with &5 return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou& &tine five continue return end subroutine seven a = 1& &+ 2& ! comment 1 &+ 3& ! comment 2 &+ 4& &+ 5& &+ 6 a = 1& &+ 2& ! comment 1 &+ 3& ! comment 2 #ifdef klm &+ 4 syntax error& &+ 5 syntax error& #endif &+ 6 end subroutine multiline_preproc #ifdef one\ two\ three do i=1,10 #elif \ defined(q) do i=1,5 #else do i=1,7 #endif x=x+4 enddo end subroutine omp integer i,j,k !$ integer m,n,& !$ & & !$ & &!comment !$ & & !$ &o,p print *,i,j,k !$ print*, m,n,o,p !$ do 100 i=1,20 !$ do 100 j=1,i !$ continue !$ 100 continue end findent-3.1.1/debian/tests/gedit_plugin.ref0000644000175000017500000000003013476205431015616 00000000000000[Plugin] Loader=python3 findent-3.1.1/debian/tests/test12.sh0000744000175000017500000000352113476205431014135 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 cat << eof > prog program prog continue ! comment eof cat << eof > expect 3 eof ../doit "-lastusable --last_usable" "-ifree -Ia" "" rc=`expr $rc + $?` ../doit "-lastusable --last_usable" "-ifixed -Ia" "" rc=`expr $rc + $?` cat << eof > prog program prog include "a.inc" include 'b.inc' ?? include 'c.inc' ??include "d.inc" #include "e.inc" # include end eof cat << eof > expect inc a.inc inc b.inc cpp e.inc std f.inc coc c.inc coc d.inc eof ../doit "--deps" "-ifree" "" rc=`expr $rc + $?` cat << eof > prog program prog include "a.inc" include 'b.inc' ?? include 'c.inc' ??include "d.inc" #include "e.inc" # include end eof cat << eof > expect inc a.inc inc b.inc cpp e.inc std f.inc coc c.inc coc d.inc eof ../doit "--deps" "-ifixed" "" rc=`expr $rc + $?` cat << eof > main.f90 module mm integer i end program main use mymod use mm include "file.inc" #include "one.inc" continue end eof cat << eof > sub.f90 module mymod integer x contains subroutine sub continue end subroutine end module module mymod1 interface real module function f(a) real a end function end interface end module eof cat << eof > sub1.f90 submodule (mymod1) mymod2 contains module procedure f f = 10.0 end procedure end submodule eof cat << eof |sort > expect sub1.lo: sub.lo main.lo: sub.lo main.lo: file.inc one.inc eof touch file.inc one.inc # remove '\r' to facilitate dos executable $FINDENT --makefdeps | tr -d '\r' > makefdeps.sh chmod +x makefdeps.sh ./makefdeps.sh -s .lo main.f90 sub.f90 sub1.f90 | tr -d '\r' | sort > result if cmp -s expect result ; then echo "--makefdeps : OK" else echo "--makefdeps : NOT OK" echo "expected:" cat expect echo "got:" cat result rc=`expr $rc + 1` fi . ../postlude exit $rc findent-3.1.1/debian/tests/gedit_plugin_py.ref0000644000175000017500000000005213476205431016332 00000000000000# -*- coding: utf-8 -*- # Findent plugin findent-3.1.1/debian/tests/progfixed.f.try.f.ref0000644000175000017500000001707713476205431016443 00000000000000! -I0 -i5 -a1 -b2 -d3 -f4 -m5 -Rr module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum contains function f(x) print *,'abc 9 def' print *,"abcd 8 efgh" return end function f #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module m1 subroutine ticket7 integer :: int real :: float logical :: bool #define COND \ if (float > 1.) then; \ continue ; \ end if COND if (.true.) then int = int + 1 end if end subroutine ticket7 program progfixed type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm@@@(10) #endif real do(100) integer x(100) type(mytype) xyz character*1000 astring continue a_ap: do i=1,20 continue enddo a_ap end = 10 if ( e .eq. n .and. * e .eq. m )then npar = npar + 1 endif do i=1, c a comment c a comment x 1 c a comment x 0 continue enddo do 123 i=1,2 continue 123 continue print *,'; function ',indx," function " continue 99880 FORMAT (' function ') 99870 FORMAT(1X,'Invalid species name',2X,A8) do i=1,10 do (i) = 5 continue do(i) = 5 continue enddo x = y ! function values continue astring = " ! this x is x no comment!" print *,a,b, x c,d x ,e,f continue print *,a,b, x c,d x ,e,f loop: do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo loop bbb: block continue end block bbb sc: select case(ja) case(1) continue case(2) continue end select sc continue do i=1,20 block continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical wv: if ( a.eq.b) then continue endif wv if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program progfixed subroutine one(a) continue entry myentry continue return end subroutine one subroutine two(a) continue d print *,'debug i=',i D print *,'debug j=',j x = 4 + c next line starts with 1 5 + c next line starts with 2 5+ c next line starts with 3 5+ c next line starts with 4 5+ c next line starts with 5 5+ c next line starts with 6 5 return end subroutine two subroutine three(a) continue return end subroutine three subroutine four(a) continue return end subroutine four subrou xtine five continue return end subroutine five subroutine seven a = 1 x + 2 ! comment 1 y + 3 ! comment 2 y + 4 y + 5 y + 6 a = 1 x + 2 ! comment 1 y + 3 ! comment 2 #ifdef klm y + 4 syntax error y + 5 syntax error #endif y + 6 end subroutine seven subroutine multiline_preproc #ifdef one\ two\ three do i=1,10 #elif \ defined(q) do i=1,5 #else do i=1,7 #endif x=x+4 enddo end subroutine multiline_preproc subroutine nok implicit none type domain_data real, dimension(:, :), allocatable :: temperature integer:: ibound, icopy, todomain end type type(domain_data), dimension(2), target :: dom allocate(dom(1) % temperature(20, 20)) dom(1) % temperature = 0. dom(1) % temperature(:, 1) = 1. end subroutine nok ! testing with findentfix: subroutine testfix implicit none integer i,j,k do i=1,10 c comment continue do j=1,6 continue ! findentfix: do do k=1,7 continue enddo C FINDENTFIX: enddo enddo * findentFIX: do;do continue * findentfix: enddo;enddo continue enddo end subroutine testfix subroutine testpointer integer, pointer :: subroutinesub integer, target :: i subroutinesub=>i ! must not be recognized as subroutine statement end subroutine testpointer subroutine omp integer i,j,k C$ integer m,n, c$ ! comment in omp sentinel ! normal comment *$ *$ 1 o,p print *,i,j,k !$ print*, m,n,o,p !$ do 100 i=1,20 !$ do 100 j=1,i c$ continue c$100 continue c$omp parallel c$omp do do i=1,20 continue enddo c$omp end parallel end subroutine omp subroutine label_excercise do 10 x 0 i=1,10 continue 01 00 continue do 02 0 i=1,10 continue 20 continue end subroutine label_excercise findent-3.1.1/debian/tests/progfree.f0000644000175000017500000002054613476205431014444 00000000000000! -I2 -i5 -a1 -b2 -d3 -f4 -m5 -Rr ! ticket 1 block data pblockdata common /xcomm/ p end block data qblockdata common /qcomm/ p end block data qblockdata block data rblockdata common /rcomm/ p end block data ! submodule and 'module subroutine' not recognized by gfortran 4.8.2 #if 0 MODULE ancestor INTEGER :: i INTERFACE MODULE SUBROUTINE sub1(arg1) INTEGER :: arg1 END SUBROUTINE MODULE SUBROUTINE sub2(arg2) INTEGER :: arg2 END SUBROUTINE END INTERFACE END MODULE SUBMODULE (ancestor) descendant INTEGER :: j CONTAINS MODULE SUBROUTINE sub1(arg1) INTEGER :: arg1 arg1 = 1 i = 2 j = 3 END SUBROUTINE module function fun1(arg1) integer :: arg1 fun1 = 10 end MODULE PROCEDURE sub2 arg2 = 1 END END #endif module some_module type :: onetype integer i end type onetype type name character(22) :: n end type complex ccc interface myinterface subroutine tx(a,b) real a,b end end interface interface anotherinterface module procedure funccc ! ! trata module procedure funcccc end interface abstract interface character*8 recursive function func(x) real :: x end function func end interface contains character*(8) impure function funcc(x) real :: x funcc = 'a' end function funcc integer(kind=4) pure function funccc(x) real, intent(in) :: x funccc = 2 end function type(onetype) function funcccc(x) type(onetype) :: x funcccc = x end function integer elemental function funcx(x) integer, intent(in) :: x funcx = x end function #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) /* Test for GCC >= 4.8.0 */ #if GCC_VERSION >= 40800 subroutine handleP(p) class(*), intent(in) :: p select type(p) type is (character(len=*)) write(*,*) len(p), ': ', p class is (name) write(*,*) len(p%n), ': ', p%n class default write(*,*) 'Unknown type' end select end subroutine #endif double complex function compx(x) double complex x compx = x end function complex recursive function compxx(x) complex x compxx = x end function real function alpha_integral_function(x) implicit none real:: x alpha_integral_function = 0 end end ! end of this module ! /ticket 1 module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum type, public :: mytypea integer i end type mytypea integer, parameter, public :: i8=selected_int_kind(16) contains function f(x) print *,'abc & def' print *,"abcd& & efgh" return end function integer(kind=i8) function func1(a, b) integer(kind=i8), intent(in) :: a, b func1 = a + b end function func1 integer(kind=i8)function funcx(a, b) integer(kind=i8), intent(in) :: a, b funcx = a + b end function funcx #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module subroutine ticket7 integer :: int real :: float logical :: bool #define COND \ if (float > 1.) then; \ if (bool) write(*, *) 'nope'; \ end if COND if (.true.) then int = int + 1 end if end subroutine program progfree type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm(10) #endif integer x(100) type(mytype) xyz real do(1000) continue loop: do i=1,20 continue enddo loop loop1 : do , i=1,20 continue enddo loop1 end = 10 do while(i.eq.0) continue enddo do , while(i.eq.0) continue enddo do concurrent(i=1:10) x(i) = 0 enddo do , concurrent(i=1:10) x(i) = 0 enddo if ( a.eq.b .and. & c.eq.r) then n=n+1 endif iff: if (a.eq.b) then continue endif iff lsele: select case(i) case(10) continue case(11) continue case default continue end select lsele lblock: block continue end block lblock x = 3.0*a + 4*b + & & 2 *c + y assign 90 to i do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo do i=1,10; do j=3,5; continue; enddo; enddo do i=1,7; do j=2,2 continue enddo continue enddo do ; enddo critical x=y do(3) = 123 endcritical critical x=y endcritical critical x=y end critical if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall hop:forall(i=1:4) ! forall x(i)=6 end forall hop where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine two(a) continue a = 3 + &! comment1 4 + & ! comment 2 5 a = 3 + & ! test preprocessor within continuation 4 + & #ifdef abc this would cause a compilation error & #endif 5 return endsubroutine subroutine three(a) do 10 i=1,4 do 5 j=1,2 continue 5 enddo 10 enddo typecode = 9 continue return end subroutine four(a) continue return endsubroutine four subrou& &tine five continue return end subroutine seven a = 1& &+ 2 &! comment 1 &+ 3 &! comment 2 &+ 4& &+ 5& &+ 6 a = 1& &+ 2 &! comment 1 &+ 3 &! comment 2 #ifdef klm &+ 4 syntax error& &+ 5 syntax error& #endif &+ 6 end subroutine multiline_preproc #ifdef one\ two\ three do i=1,10 #elif \ defined(q) do i=1,5 #else do i=1,7 #endif x=x+4 enddo end subroutine nok implicit none type domain_data real, dimension(:, :), allocatable :: temperature integer:: ibound, icopy, todomain end type type(domain_data), dimension(2), target :: dom allocate(dom(1) % temperature(20, 20)) dom(1) % temperature = 0. dom(1) % temperature(:, 1) = 1. end subroutine nok ! testing with findentfix: subroutine testfix implicit none integer i,j,k do i=1,10 ! comment continue do j=1,6 continue ! findentfix: do do k=1,7 continue enddo ! FINDENTFIX: enddo enddo continue enddo end subroutine testfix subroutine omp integer i,j,k !$ integer m,n, & !$ o,p print *,i,j,k !$ print*, m,n,o,p !$ do i=1,20 continue !$ enddo end subroutine label_excercise do 010& &0 i=1,10 continue 01& &00 continue continue 120 do i=1,10 continue enddo end findent-3.1.1/debian/tests/help.ref0000644000175000017500000000002213476205431014075 00000000000000findent [options] findent-3.1.1/debian/tests/test20.sh0000744000175000017500000007202613476205431014142 00000000000000#!/bin/sh # vim: indentexpr=none # tests according to "Modern Fortran explaned" ISBN 978-0-19-881188-6 if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 cat << eof > prog ! if statement and if construct. pp 55-57 program p_if logical a,b if(a) continue if(a) then continue endif if (a) then continue else continue endif if (a) then continue elseif (b) then continue else continue endif l1: if(a) then continue endif l1 l2: if (a) then continue else l2 continue endif l2 l3: if (a) then continue else if (b) then l3 continue else l3 continue endif l3 continue end eof cat << eof > expect ! if statement and if construct. pp 55-57 program p_if logical a,b if(a) continue if(a) then continue endif if (a) then continue else continue endif if (a) then continue elseif (b) then continue else continue endif l1: if(a) then continue endif l1 l2: if (a) then continue else l2 continue endif l2 l3: if (a) then continue else if (b) then l3 continue else l3 continue endif l3 continue end eof ../doit "-f5 --indent-if=5 --indent_if=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! case construct pp 57-59 program p_case integer i select case (i) case (3) continue case (4) continue case default continue end select l1: select case (i) case (3) l1 continue case (4) l1 continue case default l1 continue end select l1 end eof cat << eof > expect ! case construct pp 57-59 program p_case integer i select case (i) case (3) continue case (4) continue case default continue end select l1: select case (i) case (3) l1 continue case (4) l1 continue case default l1 continue end select l1 end eof ../doit "-s5 --indent-select=5 --indent_select=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! do construct pp 59-63 program p_do do i=1,10 continue enddo l1: do i=1,10,2 continue enddo l1 do , i=1,10 continue end do l2: do, i=1,10,2 continue end do l2 continue end eof cat << eof > expect ! do construct pp 59-63 program p_do do i=1,10 continue enddo l1: do i=1,10,2 continue enddo l1 do , i=1,10 continue end do l2: do, i=1,10,2 continue end do l2 continue end eof ../doit "-d5 --indent-do=5 --indent_do=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Main program pp 70-71 program p_main continue end program main program p_main1 continue end program program p_main2 continue contains subroutine mysub continue end end eof cat << eof > expect ! Main program pp 70-71 program p_main continue end program main program p_main1 continue end program program p_main2 continue contains subroutine mysub continue end end eof ../doit "-r5 --indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! External subprograms pp 72-73 subroutine p_sub1 continue contains subroutine mysub continue end end subroutine p_sub1 real function myfunc() continue contains subroutine asub(x) continue end subroutine asub end function myfunc eof cat << eof > expect ! External subprograms pp 72-73 subroutine p_sub1 continue contains subroutine mysub continue end end subroutine p_sub1 real function myfunc() continue contains subroutine asub(x) continue end subroutine asub end function myfunc eof ../doit "-r5 --indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Modules pp 73-75 module p_module integer i contains subroutine mysub continue end subroutine mysub end module p_module1 integer j contains real function myfunc(x) continue myfunc=x end function end module p_module1 module p_module2 integer k contains real function afunc(x) continue myfunc=x*k end function end module eof cat << eof > expect ! Modules pp 73-75 module p_module integer i contains subroutine mysub continue end subroutine mysub end module p_module1 integer j contains real function myfunc(x) continue myfunc=x end function end module p_module1 module p_module2 integer k contains real function afunc(x) continue myfunc=x*k end function end module eof ../doit "-m5 --indent-module=5 --indent_module=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Arguments of procedures pp 76-83 subroutine s_arguments(x,y) integer, intent(inout) :: x,y continue end integer function f_arguments(x,y,z) integer x,y,z f_arguments = x+y+z end eof cat << eof > expect ! Arguments of procedures pp 76-83 subroutine s_arguments(x,y) integer, intent(inout) :: x,y continue end integer function f_arguments(x,y,z) integer x,y,z f_arguments = x+y+z end eof ../doit "-r5 --indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Explicit and implicit interfaces pp 83-84 program p_interface interface inter subroutine s(x) real x end end interface inter interface subroutine y(x) real x end end interface end program eof cat << eof > expect ! Explicit and implicit interfaces pp 83-84 program p_interface interface inter subroutine s(x) real x end end interface inter interface subroutine y(x) real x end end interface end program eof ../doit "-j5 --indent-interface=5 --indent_interface=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Direct recursion pp 92-93 recursive function f_recur(n) result(i) integer i,n i = n end function eof cat << eof > expect ! Direct recursion pp 92-93 recursive function f_recur(n) result(i) integer i,n i = n end function eof ../doit "-r5 --indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Overloading and generic interfaces pp 94-99 program p_overload interface doit real function doit1(x) real x end function doit1 real function doit2(x,y) real x,y end function doit2 end interface doit interface operator(*) logical function myand(a,b) logical, intent(in) :: a,b end function myand end interface operator(*) end eof cat << eof > expect ! Overloading and generic interfaces pp 94-99 program p_overload interface doit real function doit1(x) real x end function doit1 real function doit2(x,y) real x,y end function doit2 end interface doit interface operator(*) logical function myand(a,b) logical, intent(in) :: a,b end function myand end interface operator(*) end eof ../doit "-j5 --indent-interface=5 --indent_interface=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The subroutine and function statements pp 99-101 program p_subroutine end integer(4), pure elemental function myfunc(x) integer, intent(in) :: x myfunc = x end function pure function pfunc(x) result(y) real*8, intent(in) :: x real*8 y y=x end elemental subroutine mysub(i) integer, intent(inout) :: i i = 2*i continue end subroutine mysub pure subroutine psub(x,y) real, intent(inout) :: x real, intent(in) :: y x = x*y continue end eof cat << eof > expect ! The subroutine and function statements pp 99-101 program p_subroutine end integer(4), pure elemental function myfunc(x) integer, intent(in) :: x myfunc = x end function pure function pfunc(x) result(y) real*8, intent(in) :: x real*8 y y=x end elemental subroutine mysub(i) integer, intent(inout) :: i i = 2*i continue end subroutine mysub pure subroutine psub(x,y) real, intent(inout) :: x real, intent(in) :: y x = x*y continue end eof ../doit "-r5 --indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The where statement and construct pp 123-126 program p_where real a(10) where(a /= 0) a=1/a where (a /= 0) a=1/a end where where (a /= 0) a=1/a elsewhere a=9 end where where (a == 0) a = 1 elsewhere (a > -1) a=0.5 elsewhere (a > 4) a=3 end where l1: where (a /= 0) a=1/a end where l1 l2: where (a == 0) a = 1 elsewhere (a /= 24 )l2 a=0.5 elsewhere (a > 4) l2 a=3 end where l2 l3:where (a /= 0) a=1/a elsewhere l3 a=9 end where l3 end eof cat << eof > expect ! The where statement and construct pp 123-126 program p_where real a(10) where(a /= 0) a=1/a where (a /= 0) a=1/a end where where (a /= 0) a=1/a elsewhere a=9 end where where (a == 0) a = 1 elsewhere (a > -1) a=0.5 elsewhere (a > 4) a=3 end where l1: where (a /= 0) a=1/a end where l1 l2: where (a == 0) a = 1 elsewhere (a /= 24 )l2 a=0.5 elsewhere (a > 4) l2 a=3 end where l2 l3:where (a /= 0) a=1/a elsewhere l3 a=9 end where l3 end eof ../doit "-w5 --indent-where=5 --indent_where=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Impure elemental procedures pp 128-129 program p_impure contains impure elemental integer function myfunc(x) integer, intent(in) :: x myfunc = x+1 end function end program eof cat << eof > expect ! Impure elemental procedures pp 128-129 program p_impure contains impure elemental integer function myfunc(x) integer, intent(in) :: x myfunc = x+1 end function end program eof ../doit "-r5 --indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The do concurrent construct program p_doconcurrent real:: a(10) do concurrent(i=1:10) a(i) = 8 enddo l1: do concurrent(i=1:10) a(i) = 8 enddo l1 do, concurrent(i=1:10) a(i) = 8 enddo l2: do, concurrent(i=1:10) a(i) = 8 enddo l2 end eof cat << eof > expect ! The do concurrent construct program p_doconcurrent real:: a(10) do concurrent(i=1:10) a(i) = 8 enddo l1: do concurrent(i=1:10) a(i) = 8 enddo l1 do, concurrent(i=1:10) a(i) = 8 enddo l2: do, concurrent(i=1:10) a(i) = 8 enddo l2 end eof ../doit "-d5 --indent-do=5 --indent_do=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The block construct pp 168-170 program p_block block continue end block l1:block continue end block l1 end eof cat << eof > expect ! The block construct pp 168-170 program p_block block continue end block l1:block continue end block l1 end eof ../doit "-b5 --indent-block=5 --indent_block=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Derived-type definitions pp 173-177 module p_type type,public :: mytype integer a(10) end type mytype type :: atype integer a(10) end type type :: btype integer a(10) end type btype type anothertype integer x(10) end type end eof cat << eof > expect ! Derived-type definitions pp 173-177 module p_type type,public :: mytype integer a(10) end type mytype type :: atype integer a(10) end type type :: btype integer a(10) end type btype type anothertype integer x(10) end type end eof ../doit "-t5 --indent-type=5 --indent_type=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Advanced type parameter features program p_advancedtype type mytype(k,l) integer, kind :: k integer, len :: l real(k) :: a(l) end type mytype type(mytype(selected_real_kind(6),10)) :: x x%a(2) = 9 end eof cat << eof > expect ! Advanced type parameter features program p_advancedtype type mytype(k,l) integer, kind :: k integer, len :: l real(k) :: a(l) end type mytype type(mytype(selected_real_kind(6),10)) :: x x%a(2) = 9 end eof ../doit "-t5 --indent-type=5 --indent_type=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Abstract interfaces pp 285-287 program p_abstractinterfaces abstract interface integer function f(x,y) integer x,y end function end interface end eof cat << eof > expect ! Abstract interfaces pp 285-287 program p_abstractinterfaces abstract interface integer function f(x,y) integer x,y end function end interface end eof ../doit "-j5 --indent-interface=5 --indent_interface=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Type extension pp 291-293 program p_typeextension type x integer a end type x type, extends(x) :: y integer b end type y end eof cat << eof > expect ! Type extension pp 291-293 program p_typeextension type x integer a end type x type, extends(x) :: y integer b end type y end eof ../doit "-t5 --indent-type=5 --indent_type=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The associate construct pp 300-301 program p_associate implicit none type atype real x end type atype type(atype) :: a associate(x => a%x) x=10 end associate l1: associate(x => a%x) x=10 end associate l1 end eof cat << eof > expect ! The associate construct pp 300-301 program p_associate implicit none type atype real x end type atype type(atype) :: a associate(x => a%x) x=10 end associate l1: associate(x => a%x) x=10 end associate l1 end eof ../doit "-a5 --indent-associate=5 --indent_associate=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The select type construct module mymod implicit none type t real x end type type u integer i end type type, extends(u) :: w integer j end type end module mymod program p_selecttype use mymod implicit none type(t), target :: a type(u), target :: b type(w), target :: c class(*), pointer :: h a%x = 11 b%i = -10 c%i = 120 h => a call doit(h) h => b call doit(h) h => c call doit(h) contains subroutine doit(h) class(*), pointer :: h select type(h) type is (t) print *,h%x type is(u) print *,h%i class is (w) print *,h%i class default print *,'ai!' end select l1: select type(h) type is (t) l1 print *,h%x type is(u) l1 print *,h%i class is (w) l1 print *,h%i class default l1 print *,'ai!' end select l1 end end eof cat << eof > expect ! The select type construct module mymod implicit none type t real x end type type u integer i end type type, extends(u) :: w integer j end type end module mymod program p_selecttype use mymod implicit none type(t), target :: a type(u), target :: b type(w), target :: c class(*), pointer :: h a%x = 11 b%i = -10 c%i = 120 h => a call doit(h) h => b call doit(h) h => c call doit(h) contains subroutine doit(h) class(*), pointer :: h select type(h) type is (t) print *,h%x type is(u) print *,h%i class is (w) print *,h%i class default print *,'ai!' end select l1: select type(h) type is (t) l1 print *,h%x type is(u) l1 print *,h%i class is (w) l1 print *,h%i class default l1 print *,'ai!' end select l1 end end eof ../doit "-s5 --indent-select=5 --indent_select=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Type and contains p 316 module mymod type mytype integer i contains procedure sub end type mytype contains subroutine sub(this) class(mytype) :: this continue end end module mymod program p_typecontains use mymod type(mytype) t end eof cat << eof > expect ! Type and contains p 316 module mymod type mytype integer i contains procedure sub end type mytype contains subroutine sub(this) class(mytype) :: this continue end end module mymod program p_typecontains use mymod type(mytype) t end eof ../doit "-t5 --indent-type=5 --indent_type=5 " "-C4 -ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Deferred bindings and abstract types pp 312-313 module mymod integer i type, abstract :: mytype contains procedure (sub), deferred, pass :: x end type mytype abstract interface subroutine sub(p) import mytype class(mytype) :: p end end interface type, abstract :: mt contains procedure(op), deferred :: plus generic :: operator(+) => plus end type mt abstract interface function op(a,b) result(r) import mt class(mt), intent(in) :: a,b class (mt), allocatable :: r end function end interface end module eof cat << eof > expect ! Deferred bindings and abstract types pp 312-313 module mymod integer i type, abstract :: mytype contains procedure (sub), deferred, pass :: x end type mytype abstract interface subroutine sub(p) import mytype class(mytype) :: p end end interface type, abstract :: mt contains procedure(op), deferred :: plus generic :: operator(+) => plus end type mt abstract interface function op(a,b) result(r) import mt class(mt), intent(in) :: a,b class (mt), allocatable :: r end function end interface end module eof ../doit "-t5 --indent-type=5 --indent_type=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Finalization pp 313-314 module mymod type mytype integer i contains final :: doit end type mytype contains subroutine doit(x) type(mytype) :: x end subroutine doit end module eof cat << eof > expect ! Finalization pp 313-314 module mymod type mytype integer i contains final :: doit end type mytype contains subroutine doit(x) type(mytype) :: x end subroutine doit end module eof ../doit "-t5 --indent-type=5 --indent_type=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Submodules pp 322-324 module base integer i interface integer module function square(i) integer i end function square end interface end module base submodule (base) deriv contains module procedure square square = i*i end procedure square end submodule deriv eof cat << eof > expect ! Submodules pp 322-324 module base integer i interface integer module function square(i) integer i end function square end interface end module base submodule (base) deriv contains module procedure square square = i*i end procedure square end submodule deriv eof ../doit "-m5 --indent-module=5 --indent_module=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Critical sections pp 340-341 program p_critical critical continue end critical l1: critical continue end critical l1 end eof cat << eof > expect ! Critical sections pp 340-341 program p_critical critical continue end critical l1: critical continue end critical l1 end eof ../doit "-x5 --indent-critical=5 --indent_critical=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Interoperability with C pp 367-381 module mymod type, bind(c) :: mytype integer i end type enum, bind(c) enumerator a=1, b=2 enumerator c end enum contains function f() bind(c) continue end function f su broutine sub bind(c) continue end subroutine sub1() bind(c) continue end end module eof cat << eof > expect ! Interoperability with C pp 367-381 module mymod type, bind(c) :: mytype integer i end type enum, bind(c) enumerator a=1, b=2 enumerator c end enum contains function f() bind(c) continue end function f su broutine sub bind(c) continue end subroutine sub1() bind(c) continue end end module eof ../doit "-m5 --indent-module=5 --indent_module=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Change team construct pp 385-388 ! not compiled program p_team use iso_fortran_env type(team_type) myteam change team(myteam) continue end team l1: change team(myteam) continue end team (stat=i)l1 critical continue end critical critical (stat=i) continue end critical l2:critical (stat=i) continue end critical l2 end eof cat << eof > expect ! Change team construct pp 385-388 ! not compiled program p_team use iso_fortran_env type(team_type) myteam change team(myteam) continue end team l1: change team(myteam) continue end team (stat=i)l1 critical continue end critical critical (stat=i) continue end critical l2:critical (stat=i) continue end critical l2 end eof ../doit "-r5--indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The include line p 447 program p_include do i=1,10 include 'file.inc' include "file2.inc" continue enddo end eof cat << eof > expect ! The include line p 447 program p_include do i=1,10 include 'file.inc' include "file2.inc" continue enddo end eof ../doit "-ifree" "-ifree -Ia" rc=`expr $rc + $?` ../doit "--include_left=0 --include-left=0" "-ifree -Ia" rc=`expr $rc + $?` cat << eof > expect ! The include line p 447 program p_include do i=1,10 include 'file.inc' include "file2.inc" continue enddo end eof ../doit "--include_left=1 --include-left=1" "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The include line p 447 program p_include do i=1,10 include 'file.inc' include "file2.inc" continue enddo end eof cat << eof > expect ! The include line p 447 program p_include do i=1,10 include 'file.inc' include "file2.inc" continue enddo end eof ../doit "-ifixed" "-ifixed -Ia" rc=`expr $rc + $?` ../doit "--include_left=0 --include-left=0" "-ifixed -Ia" rc=`expr $rc + $?` cat << eof > expect ! The include line p 447 program p_include do i=1,10 include 'file.inc' include "file2.inc" continue enddo end eof ../doit "--include_left=1 --include-left=1" "-ifixed -Ia" rc=`expr $rc + $?` cat << eof > prog ! The do while statement pp 447-448 program p_dowhile logical l do while (l) continue end do l1: do while(l) continue enddo l1 do 10 while(l) continue 10 continue do 20, while(l) continue 20 continue end eof cat << eof > expect ! The do while statement pp 447-448 program p_dowhile logical l do while (l) continue end do l1: do while(l) continue enddo l1 do 10 while(l) continue 10 continue do 20, while(l) continue 20 continue end eof ../doit "-r5--indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Character length specification with * p 458 character*10 function f() continue f='abc' end eof cat << eof > expect ! Character length specification with * p 458 character*10 function f() continue f='abc' end eof ../doit "-r5--indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Entry statement pp 462-463 subroutine sub integer i continue entry sub1 continue end eof cat << eof > expect ! Entry statement pp 462-463 subroutine sub integer i continue entry sub1 continue end eof ../doit "-e5 --indent-entry=5 --indent_entry=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Forall statement and construct pp 463-466 program p_forall integer a(20) forall(i=1:20) a(i) = 3*i ! statement forall(i=1:20) ! construct a(i) = 4*i end forall end eof cat << eof > expect ! Forall statement and construct pp 463-466 program p_forall integer a(20) forall(i=1:20) a(i) = 3*i ! statement forall(i=1:20) ! construct a(i) = 4*i end forall end eof ../doit "-F5 --indent-forall=5 --indent_forall=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The block data program unit block data common // i data i /1/ end block data eof cat << eof > expect ! The block data program unit block data common // i data i /1/ end block data eof ../doit "-r5 --indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The labelled do construct program p_dolabel do 10 i=1,5 continue 10 enddo do 20 i=1,5 continue do 15 j=1,5 continue 15 continue 20 continue do 50 i=1,5 do 50 j=1,5 continue 50 continue end eof cat << eof > expect ! The labelled do construct program p_dolabel do 10 i=1,5 continue 10 enddo do 20 i=1,5 continue do 15 j=1,5 continue 15 continue 20 continue do 50 i=1,5 do 50 j=1,5 continue 50 continue end eof ../doit "-d5 --indent-do=5 --indent_do=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Arithmetic if statement program p_aritif i = 2 if(i) 10,20,30 10 continue 20 continue 30 continue end eof cat << eof > expect ! Arithmetic if statement program p_aritif i = 2 if(i) 10,20,30 10 continue 20 continue 30 continue end eof ../doit "-d5 --indent-do=5 --indent_do=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Shared do-loop termination program p_shdolote do 20, i=1,8 do 20 ,j=1,6 continue 20 print *,i*j do 30, i=1,8 do 30, j=1,6 continue 30 continue end eof cat << eof > expect ! Shared do-loop termination program p_shdolote do 20, i=1,8 do 20 ,j=1,6 continue 20 print *,i*j do 30, i=1,8 do 30, j=1,6 continue 30 continue end eof ../doit "-d5 --indent-do=5 --indent_do=5 " "-ifree -Ia" rc=`expr $rc + $?` . ../postlude exit $rc findent-3.1.1/debian/tests/progfixedfree-dos.f0000644000175000017500000000646713476205431016255 00000000000000! -Ia -i5 -a1 -b2 -d3 -f4 -m5 -ofree module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum contains function f(x) print *,'abc 9 def' print *,"abcd 8 efgh" return end function end module program progfixed type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm@@@(10) #endif integer x(100) type(mytype) xyz character*1000 astring do i=1, c a comment c a comment x 1 c a comment ! a floating comment x 0 continue enddo continue astring = " ! this x is x no comment!" print *,a,b, x c,d x ,e,f do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou xtine five continue return end findent-3.1.1/debian/tests/test21.sh0000744000175000017500000000031013476205431014126 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi if test xyes = "x$ESOPE" ; then ../test-compile.sh ../esope.f rc=$? else rc=0 fi . ../postlude exit $rc findent-3.1.1/debian/tests/test18.sh0000744000175000017500000000144513476205431014146 00000000000000#!/bin/sh # test wfindent if test -e prelude ; then . ./prelude else unset FINDENT . ./debian/tests/prelude fi cat < prog1.f || exit 1 program prog1 continue end program prog1 eof cat << eof > prog2.f || exit 1 module modprog2 integer i end module program prog2 use modprog2 continue end program prog2 eof cat << eof > prog1.f.ref || exit 1 program prog1 continue end program prog1 eof cat << eof > prog2.f.ref || exit 1 module modprog2 integer i end module program prog2 use modprog2 continue end program prog2 eof $WFINDENT -i5 prog1.f prog2.f sed -i 's/\r//' prog1.f sed -i 's/\r//' prog2.f for i in 1 2 ; do cmp -s prog$i.f prog$i.f.ref if [ $? -ne 0 ] ; then echo "prog$i.f and prog$i.f.ref are not equal" exit 1 fi done . ../postlude exit 0 findent-3.1.1/debian/tests/test2.sh0000744000175000017500000000022613476205431014053 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfixed.f rc=$? . ../postlude exit $rc findent-3.1.1/debian/tests/test6.sh0000744000175000017500000000023113476205431014053 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfree-dos.f rc=$? . ../postlude exit $rc findent-3.1.1/debian/tests/test19.sh0000744000175000017500000000434113476205431014145 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 doit=../doit cat << eof > prog program main #define foo \\ bar \\ a contains #ifdef foo \\ bar \\ a subroutine sub() #elif bar==1 subroutine sub(a) #else subroutine sub(a,b) #endif continue end subroutine end program eof cat << eof > expect program main #define foo \\ bar \\ a contains #ifdef foo \\ bar \\ a subroutine sub() #elif bar==1 subroutine sub(a) #else subroutine sub(a,b) #endif continue end subroutine end program eof $doit "-ifixed --input_format=fixed" "-I0 -i3" "for fixed input" rc=`expr $rc + $?` cat << eof > expect program main #define foo \\ bar \\ a contains #ifdef foo \\ bar \\ a subroutine sub() #elif bar==1 subroutine sub(a) #else subroutine sub(a,b) #endif continue end subroutine end program eof $doit "-ifree --input_format=free" "-I0 -i3" "for free input" rc=`expr $rc + $?` cat << eof > prog program main ??logical::foo = .true. & ?? .or. & ?? .or. .false. contains ??if(foo) & ?? then subroutine sub() ??else if(bar) then subroutine sub(a) ??else subroutine sub(a,b) ??endif continue end subroutine ?? logical a= & ?? .true. end program eof cat << eof > expect program main ??logical::foo = .true. & ?? .or. & ?? .or. .false. contains ??if(foo) & ?? then subroutine sub() ??else if(bar) then subroutine sub(a) ??else subroutine sub(a,b) ??endif continue end subroutine ?? logical a= & ?? .true. end program eof $doit "-ifixed --input_format=fixed" "-I0 -i3" "for fixed input" rc=`expr $rc + $?` cat << eof > expect program main ??logical::foo = .true. & ?? .or. & ?? .or. .false. contains ??if(foo) & ?? then subroutine sub() ??else if(bar) then subroutine sub(a) ??else subroutine sub(a,b) ??endif continue end subroutine ?? logical a= & ?? .true. end program eof $doit "-ifree --input_format=free" "-I0 -i3" "for free input" rc=`expr $rc + $?` . ../postlude exit $rc findent-3.1.1/debian/tests/test17.sh0000744000175000017500000000106513476205431014143 00000000000000#!/bin/sh #test output of help-texts if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi exe=$FINDENT rc=0 for f in vim_help gedit_help vim_fortran vim_findent \ gedit_external gedit_plugin gedit_plugin_py \ emacs_help emacs_findent readme makefdeps; do flag="--$f" $exe $flag | head -n 2 | tr -d '\r' > $f.try cmp -s ../$f.ref $f.try r=$? if [ $r -eq 0 ] ; then echo "$flag : works OK" else echo "$flag : works NOT OK, compare $f.try and $f.ref" fi rc=`expr $rc + $r` done . ../postlude exit $rc findent-3.1.1/debian/tests/esope.f.try.f.ref0000644000175000017500000000105313476205431015552 00000000000000! program esope ! 'normal' fortran compilers do not understand esope syntax #if 0 segment, test continue integer t endsegment SEGMENT, test continue integer t ENDSEGMENT 10 segment test1 30 continue endsegment segment continue segment = 10 continue segment tra = 10 continue segini,val segini ,val segsup , val #endif end findent-3.1.1/debian/tests/test5.sh0000744000175000017500000000023213476205431014053 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfixedfree.f rc=$? . ../postlude exit $rc findent-3.1.1/debian/tests/manpage.ref0000644000175000017500000000007313476205431014563 00000000000000.\" DO NOT MODIFY THIS FILE! It was created by findent \-H findent-3.1.1/debian/tests/gedit_external.ref0000644000175000017500000000007313476205431016151 00000000000000#!/bin/bash # to be used in gedit to indent fortran source findent-3.1.1/debian/tests/control0000644000175000017500000000047113476205431014062 00000000000000Tests: test1.sh test2.sh test3.sh test4.sh test5.sh test6.sh test7.sh test8.sh test9.sh test10.sh test11.sh test12.sh test13.sh test14.sh test15.sh test16.sh test17.sh test18.sh test19.sh test20.sh test21.sh findent-3.1.1/debian/tests/makefdeps.ref0000644000175000017500000000003413476205431015107 00000000000000#!/bin/bash # - makefdeps - findent-3.1.1/debian/tests/readme.ref0000644000175000017500000000010513476205431014404 00000000000000For installation instructions and usage, see README.1st and INSTALL findent-3.1.1/debian/tests/progfreefixed.f.try.f.ref0000644000175000017500000001443113476205431017274 00000000000000! -Ia -i5 -a1 -b2 -d3 -f4 -m5 -ifree -ofixed module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum contains function f(x) print *,'abc & def' print *,"abcd #ifdef foo & garbage #endif & efgh" return end function #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module program progfixed type mytype ! mytype integer i ! a comment ! a floating comment real x end type mytype #ifdef abcde real klm@@@(10) #endif real do(100) integer x(100) type(mytype) xyz character*1000 astring continue a_ap: do i=1,20 continue enddo a_ap end = 10 if ( e .eq. n .and. & e .eq. m )then npar = npar + 1 endif do i=1, ! a comment ! a comment & 1 ! a comment & 0 continue enddo do 123 i=1,2 continue 123 continue print *,'; function ',indx," function " continue 99880 FORMAT (' function ') 99870 FORMAT(1X,'Invalid species name',2X,A8) do i=1,10 do (i) = 5 continue do(i) = 5 continue enddo x = y ! function values continue astring = " ! this & is & no comment!" print *,a,b, & c,d & ,e,f continue print *,a,b, & c,d & ,e,f loop: do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo loop bbb: block continue end block bbb sc: select case(ja) case(1) continue case(2) continue end select sc continue do i=1,20 block continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical wv: if ( a.eq.b) then continue endif wv if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue !d print *,'debug i=',i ! !D print *,'debug j=',j x = 4 + ! next line starts with & 5 + ! next line starts with & 5+ ! next line starts with & 5+ ! next line starts with & 5+ ! next line starts with & 5+ ! next line starts with & 5 return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou & tine five continue return end subroutine seven a = 1 & + 2 ! comment 1 & + 3 ! comment 2 & + 4 & + 5 & + 6 a = 1 & + 2 ! comment 1 & + 3 ! comment 2 #ifdef klm & + 4 syntax error & + 5 syntax error #endif & + 6 end subroutine multiline_preproc #ifdef one\ two\ three do i=1,10 #elif \ defined(q) do i=1,5 #else do i=1,7 #endif x=x+4 enddo end subroutine omp integer i,j,k !$ integer m,n, !$ & o,p print *,i,j,k !$ print*, m,n,o,p !$ do 100 i=1,20 !$ do 100 j=1,i continue !$100 enddo end findent-3.1.1/debian/tests/prelude0000644000175000017500000000021313324141415014025 00000000000000cd debian/tests export FINDENT=findent export WFINDENT=wfindent dir=`basename $0`.tmpdir rm -rf $dir mkdir $dir cd $dir # vim: filetype=sh findent-3.1.1/debian/tests/test10.sh0000744000175000017500000000173113476205431014134 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 prog=" program main 10 continue end " expect="program main 10 continue end" exe=$FINDENT for flag in -l0 --label_left=0 ; do a=`echo "$prog" | $exe "$flag" -I0 -i6 | tr -d '\r'` if [ "$a" = "$expect" ]; then echo "$flag works OK" else echo "$flag works NOT OK:" echo "expected:" echo "$expect" echo "got :" echo "$a" echo "program is:" echo "$prog" rc=`expr $rc + 1` fi done expect="program main 10 continue end" for flag in -l1 --label_left=1 ; do a=`echo "$prog" | $exe "$flag" -I0 -i6 | tr -d '\r'` if [ "$a" = "$expect" ]; then echo "$flag works OK" else echo "$flag works NOT OK:" echo "expected:" echo "$expect" echo "got :" echo "$a" echo "program is:" echo "$prog" rc=`expr $rc + 1` fi done . ../postlude exit $rc findent-3.1.1/debian/tests/test11.sh0000744000175000017500000000255513476205431014142 00000000000000#!/bin/sh # vim: indentexpr=none if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 cat << eof > prog program prog continue eof cat << eof > expect 5 eof ../doit "-lastindent --last_indent" "-ifree -Ia -i3" rc=`expr $rc + $?` cat << eof > prog endif eof cat << eof > expect 5 eof ../doit "-lastindent --last_indent" "-ifree -Ia -i3" rc=`expr $rc + $?` # test 2018 critical(stat = istat) cat << eof > prog program pcritical critical(stat=istat) continue end critical end eof cat << eof > expect program pcritical critical(stat=istat) continue end critical end eof ../doit "--indent-critical=4 -x4" "-ifree" rc=`expr $rc + $?` # test 2018 change team(), end team [()] cat << eof > prog program pchangeteam change team(newteam) continue end team continue change team(newteam) continue end team (stat=istat) l: change team(newteam) continue end team (stat=istat) l k: change team(newteam) continue end team k end eof cat << eof > expect program pchangeteam change team(newteam) continue end team continue change team(newteam) continue end team (stat=istat) l: change team(newteam) continue end team (stat=istat) l k: change team(newteam) continue end team k end eof ../doit "--indent-changeteam=4 --indent_changeteam=4" "-ifree" rc=`expr $rc + $?` . ../postlude exit $rc findent-3.1.1/debian/tests/test3.sh0000744000175000017500000000023213476205431014051 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfreefixed.f rc=$? . ../postlude exit $rc findent-3.1.1/debian/tests/progfree1.f.try.f.ref0000644000175000017500000000010613476205431016327 00000000000000! -i- -I8 -ifree -Rr program programma continue end program programma findent-3.1.1/debian/tests/test8.sh0000744000175000017500000000022613476205431014061 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfree1.f rc=$? . ../postlude exit $rc findent-3.1.1/debian/tests/test16.sh0000744000175000017500000001562013476205431014144 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 doit=../doit cat << eof > prog program main01 continue end eof cat << eof > expect program main01 continue end eof $doit "-I5 --start_indent=5" -i3 "for fixed input" rc=`expr $rc + $?` cat << eof > prog program main02 continue end eof cat << eof > expect program main02 continue end eof $doit "-I5 --start_indent=5" -i3 "for free input" rc=`expr $rc + $?` cat << eof > prog program main03 continue end eof cat << eof > expect program main03 continue end eof $doit "-Ia --start_indent=a" "-I0 -i3" "" rc=`expr $rc + $?` cat << eof > prog program main04 continue do i=1,10 do j=1,20 continue enddo enddo end eof cat << eof > expect program main04 continue do i=1,10 do j=1,20 continue enddo enddo end eof $doit "-i5 --indent=5" "-I0" "" rc=`expr $rc + $?` cat << eof > prog program main06 associate( z => sin(theta)) print *,z end associate end eof cat << eof > expect program main06 associate( z => sin(theta)) print *,z end associate end eof $doit "-a5 --indent_associate=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main07 block continue end block end eof cat << eof > expect program main07 block continue end block end eof $doit "-b5 --indent_block=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main08 do i=1,10 do j=1,5 print *,i,j enddo enddo end eof cat << eof > expect program main08 do i=1,10 do j=1,5 print *,i,j enddo enddo end eof $doit "-d5 --indent_do=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main09 if (i .eq. 7) then print *,'foo' continue endif continue end eof cat << eof > expect program main09 if (i .eq. 7) then print *,'foo' continue endif continue end eof $doit "-f5 --indent_if=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main10 enum, bind(c) enumerator :: red = 1, blue black = 5 enumerator yellow end enum end eof cat << eof > expect program main10 enum, bind(c) enumerator :: red = 1, blue black = 5 enumerator yellow end enum end eof $doit "-E5 --indent_enum=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main11 forall(k=1:1000) x(k) = 23 y(k) = 67 end forall end eof cat << eof > expect program main11 forall(k=1:1000) x(k) = 23 y(k) = 67 end forall end eof $doit "-F5 --indent_forall=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main12 interface myinterface subroutine mysub(x) real x end subroutine end interface end eof cat << eof > expect program main12 interface myinterface subroutine mysub(x) real x end subroutine end interface end eof $doit "-j5 --indent_interface=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog module mymodule01 integer x contains subroutine mysub continue end subroutine end module eof cat << eof > expect module mymodule01 integer x contains subroutine mysub continue end subroutine end module eof $doit "-m5 --indent_module=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog subroutine mysub01 continue end subroutine function myfun(x) real x end function eof cat << eof > expect subroutine mysub01 continue end subroutine function myfun(x) real x end function eof $doit "-r5 --indent_procedure=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main13 continue select case(i) case(1) x=2 case(3) x=4 end select continue end program eof cat << eof > expect program main13 continue select case(i) case(1) x=2 case(3) x=4 end select continue end program eof $doit "-s5 --indent_select=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main14 type mytype integer :: i real x,y end type mytype end program eof cat << eof > expect program main14 type mytype integer :: i real x,y end type mytype end program eof $doit "-t5 --indent_type=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main15 where(x>21) y=10 z=11 end where end program eof cat << eof > expect program main15 where(x>21) y=10 z=11 end where end program eof $doit "-w5 --indent_where=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main16 continue critical x=10 y=11 end critical end program eof cat << eof > expect program main16 continue critical x=10 y=11 end critical end program eof $doit "-x5 --indent_critical=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main17 continue contains subroutine mysub continue end subroutine mysub end program eof cat << eof > expect program main17 continue contains subroutine mysub continue end subroutine mysub end program eof $doit "-C- --indent_contains=restart" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main18 continue x = x + & & 10 y = y + & 5 end program eof cat << eof > expect program main18 continue x = x + & & 10 y = y + & 5 end program eof $doit "-k- --indent_continuation=none" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main19 continue select case(i) case(3) x=8 case(5) y=2 end select continue end program eof cat << eof > expect program main19 continue select case(i) case(3) x=8 case(5) y=2 end select continue end program eof $doit "-c4 --indent_case=4" "-i6 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main20 continue contains function foo(bar) real bar continue end function end program eof cat << eof > expect program main20 continue contains function foo(bar) real bar continue end function end program eof $doit "-C4 --indent_contains=4" "-i6 -I0" "" rc=`expr $rc + $?` cat << eof > prog subroutine mysub02 continue entry myentry continue end subroutine eof cat << eof > expect subroutine mysub02 continue entry myentry continue end subroutine eof $doit "-e4 --indent_entry=4" "-i6 -I0" "" rc=`expr $rc + $?` cat << eof > prog subroutine mysub03 do i=1,20 continue !$ continue enddo end subroutine eof cat << eof > expect subroutine mysub03 do i=1,20 continue !$ continue enddo end subroutine eof $doit "--openmp=0" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog subroutine mysub04 do i=1,20 continue !$ continue enddo end subroutine eof cat << eof > expect subroutine mysub04 do i=1,20 continue !$ continue enddo end subroutine eof $doit "--openmp=0" "-i3 -I0" "" rc=`expr $rc + $?` . ../postlude exit $rc findent-3.1.1/debian/tests/progfixed-dos.f.try.f.ref0000644000175000017500000000620513476205431017215 00000000000000! -I0 -i5 -a1 -b2 -d3 -f4 -m5 -ifixed module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum #ifdef foo garbage #endif contains function f(x) print *,'abc 9 def' print *,"abcd 8 efgh" return end function #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module program progfixed type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm(10) #endif integer x(100) type(mytype) xyz continue do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou xtine five continue return end findent-3.1.1/debian/tests/progfixed1.f.try.f.ref0000644000175000017500000000013613476205431016510 00000000000000! -i- -I8 -ifixed program programma continue end findent-3.1.1/debian/tests/test4.sh0000744000175000017500000000023613476205431014056 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfixedfree-dos.f rc=$? . ../postlude exit $rc findent-3.1.1/debian/tests/test-compile.sh0000744000175000017500000000365713476205431015432 00000000000000#!/bin/sh export FINDENT_FLAGS="$TEST_FINDENT_FLAGS" prog="$1" echo "$0: $prog" if test "x$FC" = x ; then gfortran=: echo "will not try to compile fortran sources" else gfortran="$FC" echo "will try to compile fortran sources using $gfortran" fi rc=0 exe=${FINDENT:-../src/findent} $exe -v bprog="`basename $prog`" rm -f "bprog.try.f" echo -n "$bprog: " case "$bprog" in *progfixed*) format="-ffixed-form -ffixed-line-length-none -fd-lines-as-comments" ;; *) format="-ffree-form -ffree-line-length-none" ;; esac $gfortran -fcoarray=single -cpp -fopenmp $format -o prog $prog >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo -n " original program does not compile using: -fcoarray=single -cpp -fopenmp $format -o prog $prog " rc=1 fi parms=`head -n1 < $prog | tr '!' ' '|tr '\r' ' '` $exe $parms < $prog > $bprog.try.f 2>/dev/null if [ -f $prog.try.f.ref ]; then if [ "$WINDOWS" = yes ] ; then case $prog in *dos*) : ;; *) sed -i 's/\r//' $bprog.try.f ;; esac fi cmp -s $bprog.try.f $prog.try.f.ref >/dev/null 2>&1 if [ "$?" -eq 0 ]; then echo -n "OK" else echo -n "WRONG" rc=1 fi echo else echo "cannot compare" rc=1 fi case "$bprog" in *free.f | *free1.f | *free-dos.f) format="-ffree-form -ffree-line-length-none" ;; *) format="-ffixed-form -ffixed-line-length-none -fd-lines-as-comments" ;; esac $gfortran -fcoarray=single -cpp -fopenmp $format -o prog $bprog.try.f >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo " converted program does not compile using: -fcoarray=single -cpp -fopenmp $format -o prog $bprog.try.f " rc=1 fi echo "END TESTING FINDENT rc=$rc" if [ $rc -ne 0 ] ; then echo "If you are sure $PWD/$bprog.try.f is correct:" echo "copy $PWD/$bprog.try.f" echo "to the corresponding .in file in the test directory" echo " and configure again." fi rm -f prog exit $rc findent-3.1.1/debian/tests/test7.sh0000744000175000017500000000022513476205431014057 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfree.f rc=$? . ../postlude exit $rc findent-3.1.1/debian/tests/test14.sh0000744000175000017500000000470413476205431014143 00000000000000#!/bin/sh # vim: indentexpr=none if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 doit=../doit cat << eof > prog program fixed001 continue # if xyz || \ abc x=1 # endif end eof cat << eof > expect fixed eof $doit "-q --query_fix_free" "" "for fixed input" rc=`expr $rc + $?` cat << eof > prog program free001 continue end eof cat << eof > expect free eof $doit "-q --query_fix_free" "" "for free input" rc=`expr $rc + $?` cat << eof > prog program p001 do i=1,10 continue enddo end eof cat << eof > expect program p001 do i=1,10 continue enddo end eof $doit "-M2 --max_indent=2" "-ifree -i8" "for free input" rc=`expr $rc + $?` cat << eof > expect program p001 do i=1,10 continue enddo end eof $doit "-M2 --max_indent=2" "-ifixed -i8" "for fixed input" rc=`expr $rc + $?` cat << eof > prog program p002 x=x+ & 10+ & & 20+ & 30 end eof cat << eof > expect program p002 x=x+ 1 10+ 2 20+ 3 30 end eof $doit "--continuation=0" "-ofixed" "--continuation=0 for free input" rc=`expr $rc + $?` cat << eof > expect program p002 x=x+ & 10+ & 20+ & 30 end eof $doit "--continuation= " "-ofixed" "--continuation=' ' for free input" rc=`expr $rc + $?` cat << eof > expect program p002 x=x+ + 10+ + 20+ + 30 end eof $doit "--continuation=+" "-ofixed" "--continuation=+ for free input" rc=`expr $rc + $?` cat << eof > prog program p003 x=9+ + 20 + ! abc ! abc ! abc + 30 end eof cat << eof > expect program p003 x=9+ + 20 + ! abc ! abc ! abc + 30 end eof $doit "--continuation= " "" "--continuation=' ' for fixed input" rc=`expr $rc + $?` cat << eof > expect program p003 x=9+ 9 20 + ! abc ! abc ! abc 9 30 end eof $doit "--continuation=9" "" "--continuation=9 for fixed input" cat << eof > prog #define W \ program program p004 continue end eof cat << eof > expect #define W \ program program p004 continue end eof $doit "-Ia --start-indent=a" "-ifree" "for free input" $doit "-Ia --start-indent=a" "-ifixed" "for fixed input" rc=`expr $rc + $?` . ../postlude exit $rc findent-3.1.1/debian/tests/test15.sh0000744000175000017500000000561113476205431014142 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 doit=../doit cat << eof > prog program main continue end eof cat << eof > expect program main continue end eof $doit "-iauto --input_format=auto -ifixed --input_format=fixed" "-I0 -i3" "for fixed input" rc=`expr $rc + $?` cat << eof > expect program main continue end eof $doit "-ifree --input_format=free" "-I0 -i3" "for fixed input" rc=`expr $rc + $?` cat << eof > prog program main continue end eof cat << eof > expect program main continue end eof $doit "-iauto --input_format=auto -ifree --input_format=free" "-I0 -i3" "for free input" rc=`expr $rc + $?` cat << eof > prog program main continue end eof cp prog expect $doit "-i- --indent=none" "" "" rc=`expr $rc + $?` cat << eof > prog program main x = 10 + 6 end eof cat << eof > expect program main x = 10 end eof $doit "-L42 --input_line_length=42" "-I0 -i3" "" rc=`expr $rc + $?` cat << eof > prog program main continue end eof cat << eof > expect program main continue end eof $doit "-ofree --output_format=free" "-I0 -i3" "" rc=`expr $rc + $?` cat << eof > prog program main continue end eof cat << eof > expect program main continue end eof $doit "-osame --output_format=same" "-I0 -i3" "for free input" rc=`expr $rc + $?` cat << eof > prog program main continue end eof cat << eof > expect program main continue end eof $doit "-osame --output_format=same" "-I0 -i3" "for fixed input" rc=`expr $rc + $?` cat << eof > prog program main continue contains subroutine mysub continue end end eof cat << eof > expect program main continue contains subroutine mysub continue end subroutine mysub end program main eof $doit "-Rr --refactor_procedures" "-I0 -i3" "for free input" rc=`expr $rc + $?` cat << eof > expect program main continue contains subroutine mysub continue END SUBROUTINE mysub END PROGRAM main eof $doit "-RR --refactor_procedures=upcase" "-I0 -i3" "for free input" rc=`expr $rc + $?` cat << eof > prog program main continue contains subroutine mysub continue end end eof cat << eof > expect program main continue contains subroutine mysub continue end subroutine mysub end program main eof $doit "-Rr --refactor_procedures" "-I0 -i3" "for fixed input" rc=`expr $rc + $?` cat << eof > expect program main continue contains subroutine mysub continue END SUBROUTINE mysub END PROGRAM main eof $doit "-RR --refactor_procedures=upcase" "-I0 -i3" "for fixed input" rc=`expr $rc + $?` . ../postlude exit $rc findent-3.1.1/debian/tests/test13.sh0000744000175000017500000000171413476205431014140 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 exe=$FINDENT for flag in -h --help ; do $exe "$flag" | head -n 1 | tr -d '\r' > help.try cmp -s ../help.ref help.try r=$? if [ $r -eq 0 ] ; then echo "$flag : works OK" else echo "$flag : works NOT OK, compare help.try and help.ref" fi rc=`expr $rc + $r` done for flag in -H --manpage ; do $exe "$flag" | head -n 1 | tr -d '\r' > manpage.try cmp -s ../manpage.ref manpage.try r=$? if [ $r -eq 0 ] ; then echo "$flag : OK" else echo "$flag : NOT OK, compare manpage.try and manpage.ref" fi rc=`expr $rc + $r` done for flag in -v --version ; do $exe $flag > result if grep -q "^findent version" result ; then echo "$flag: OK" else echo "$flag : NOT OK" echo "expected : findent version ..." echo "got:" cat result rc=`expr $rc + 1` fi done . ../postlude exit $rc findent-3.1.1/debian/tests/progfree-dos.f.try.f.ref0000644000175000017500000000544313476205431017042 00000000000000! -I2 -i5 -a1 -b2 -d3 -f4 -m5 -ifree module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum type, public :: mytypea integer i end type mytypea contains function f(x) print *,'abc & def' print *,"abcd& & efgh" return end function #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module program progfree type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm(10) #endif integer x(100) type(mytype) xyz continue do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou& &tine five continue return end findent-3.1.1/debian/tests/init.sh0000755000175000017500000000031013476205431013751 00000000000000#!/bin/bash # if checking windows executables, we start the wineserver here # and make it persistent for some seconds to speed things up if test xyes = "x$WINDOWS" ; then wineserver -p10 fi exit 0 findent-3.1.1/debian/tests/gedit_help.ref0000644000175000017500000000003313476205431015253 00000000000000Usage of findent in gedit findent-3.1.1/debian/tests/emacs_findent.ref0000644000175000017500000000017513476205431015755 00000000000000;;;; this file contains an interface to use findent within emacs. ;;;; the C-M-q command ("indent function") is redefined to findent-3.1.1/debian/tests/doit0000744000175000017500000000063013476205431013337 00000000000000#!/bin/sh rc=0 flags=$1 eflags=$2 comment=$3 exe=$FINDENT for flag in $flags ; do cat prog | $exe $eflags $flag | tr -d '\r' > result if cmp -s expect result ; then echo "$flag : OK $comment" else echo "$flag : NOT OK $comment" echo "expected:" cat expect echo "got:" cat result echo "program is:" cat prog rc=`expr $rc + 1` fi done exit $rc findent-3.1.1/debian/tests/progfixedfree-dos.f.try.f.ref0000644000175000017500000000561113476205431020057 00000000000000! -Ia -i5 -a1 -b2 -d3 -f4 -m5 -ofree module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum contains function f(x) print *,'abc& & def' print *,"abcd& & efgh" return end function end module program progfixed type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm@@@(10) #endif integer x(100) type(mytype) xyz character*1000 astring do i=1,& ! a comment ! a comment &1& ! a comment ! a floating comment &0 continue enddo continue astring = " ! this& & is& & no comment!" print *,a,b,& &c,d& &,e,f do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou& &tine five continue return end findent-3.1.1/debian/patches/0000755000175000017500000000000013035714514013020 500000000000000findent-3.1.1/debian/patches/series0000644000175000017500000000000013035714514014143 00000000000000findent-3.1.1/debian/rules0000744000175000017500000000026413246536154012377 00000000000000#!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed %: dh $@ findent-3.1.1/debian/control0000644000175000017500000000135213444172746012726 00000000000000Source: findent Section: devel Priority: optional Maintainer: Willem Vermin Build-Depends: debhelper (>= 11), flex, bison Standards-Version: 4.3.0 Homepage: https://sourceforge.net/projects/findent/ Package: findent Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: indents/converts Fortran sources Indents Fortran sources: free or fixed format. Optionally converts from fixed format to free format. Optionally generates dpendencies for Make, based on definition and usage of modules. Supports Fortran2008. Indentation is controlled by a number of flags. Easy integration with (g)vim, gedit, emacs. . wfindent is a wrapper for findent and facilitates in-place indenting of Fortran sources. findent-3.1.1/debian/copyright0000644000175000017500000000342413246533466013260 00000000000000Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: findent Source: http://findent.sourceforge.net Files: * Copyright: 2016,2017,2018 Willem Vermin License: BSD-3-Clause Files: debian/* Copyright: 2016,2017,2018 Willem Vermin License: BSD-3-Clause License: BSD-3-Clause 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. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``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 HOLDERS OR CONTRIBUTORS 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. findent-3.1.1/debian/changelog0000644000175000017500000000111113476205423013160 00000000000000findent (3.1.1-1) unstable; urgency=low * New upstream release * Changed Standards-Version: 4.2.0 * Removed Build Dependency gfortran -- Willem Vermin Thu, 06 Jun 2019 14:46:11 +0200 findent (2.8.2-1) unstable; urgency=low * New upstream release * Changed Standards-Version: 4.1.4 * Changed Build-Depends: debhelper (>=11) -- Willem Vermin Wed, 13 Jun 2018 05:09:12 +0200 findent (2.7.3-1) unstable; urgency=low * Initial release (Closes: #842166) -- Willem Vermin Tue, 20 Dec 2016 12:22:24 +0100 findent-3.1.1/doc/0000755000175000017500000000000013476205436010723 500000000000000findent-3.1.1/doc/README0000644000175000017500000006017613366075744011542 00000000000000For installation instructions and usage, see README.1st and INSTALL This document is a not very well structured story about findent. You can skip this and use findent after reading the output of findent -h. findent, what? ============== findent is an indenter for Fortran programs, fixed and free format. findent can also translate fixed format to free format and vice versa. Since version 3.0.0, findent can generate dependencies based on USE, MODULE, SUBMODULE, INCLUDE, #include, ??include and emit a bash script that, using findent, creates a dependency file to be used in a Makefile. findent will take care of: continuation lines multi-statement lines labelled and unlabelled do-loops IF IF ... THEN ... ENDIF where FORALL WHERE constructs FORALL constructs etc. see findentclass.cpp for details findent will remove trailing spaces and tabs, and convert tabs at the start of a line into spaces. By default, statement labels are placed at the start of a line. Apart from this and indenting, findent will not alter the input, trying to preserve alignment. For example, the alignment in: X = 3.0*A + 4*B + & & 2 *C + Y will remain intact. Optionally, findent will refactor lines that end a subroutine etc.: SUBROUTINE SUB ... END FUNCTION MYFUN will become: SUBROUTINE SUB ... END SUBROUTINE SUB findent is space-insensitive, for example a line like: REALFUN CTIONFUN(X) is recognized as the start of a function definition. Usage: findent -h findent, why? ============= There are a number of public domain Fortran indenting tools, for example: - vim is shipped with an simple Fortran indenter - emacs has a Fortran indenter - floppy, only for fixed format: http://www.netlib.org/floppy/ - convert.f90: converts from fixed to free format, and indents: ftp://ftp.numerical.rl.ac.uk/pub/MandR/convert.f90 - f2f90: based on convert.f90: http://www.fortran.com/f2f90.tar.gz - f90ppr: an impressive piece of software that beautifies Fortran code and contains a macro processor. http://fortranwiki.org/fortran/show/f90ppr - fprettify: an indenter and beautifier, written in Python. IMHO not mature at the time of this writing (august 2018). https://github.com/pseewald/fprettify For me, the problem with these tools is, that - they are too simple (for example, do not recognize labelled do-loops) - or do too much (destroying neatly aligned pieces of code) - or are for me too complicated to adapt and extend. Furthermore, I want that indenting does not make irreversible changes to the source: I want always be able to get back to the version after the first indenting. (Exceptions: converting from fixed to free format; adding 'subroutine foo' after 'end'). Therefore I decided, having some spare time after my retirement, to try to build a Fortran indenter, based on flex and bison for readability. As programming language I chose C++, because of the availability of string and deque. After more or less finishing the indenting part, I realized that findent should be able to play a role in determining the dependencies based on (sub)modules and various kinds of include's. So I added some lines to accomplish this. Together with an simple script dependencies are easily created. See 'man findent' under '--deps' for details. There are some tools that can generate dependencies for Fortran projects: - makedepf90: see https://github.com/outpaddling/makedepf90, also in debian and ubuntu. It seems that there is no support for submodules, but apart from that it seems to work well. - f90_mod_deps.py: see http://lagrange.mechse.illinois.edu/f90_mod_deps/f90_mod_deps.py does not seem to work properly. - fortdepend: see https://github.com/ZedThree/fort_depend.py Does not work with submodules and is picky about end statements. I did not investigate if these tools can cope with split MODULE and USE lines and fixed-format space-independent source code. findent, how? ============= So, here it is, a Fortran indenter to my taste, based on flex, bison and g++. The program performs the following major tasks: - determine the input format: free or fixed - glue together continuation lines removing comments - pre-process the assembled input line, to make it better processable by flex: remove white space, substitute strings, hollerith's, statement label and operators like .EQ. by special tokens - perform a two-stage parsing: - try if the line is an assignment - if it is not an assignment, parse the line using as tokens the Fortran keywords (SUBROUTINE, DO, ...) - based on the outcome of the parse, determine the indentation - output the lines that were read in to compose the full line, trying to preserve the lay-out after the original leading white space, optionally converting from fixed-form to free-form. Also optionally, lines that end a subroutine, program etc., are completed (or even modified) as in: END subroutine mysub Preprocessor statements are accounted for to prevent that code like: #ifdef one SUBROUTINE ONE #else SUBROUTINE TWO #endif would result in a double SUBROUTINE indentation. Moreover, track is kept of do-labels, in order to correctly indent constructs like: DO 10 I=1,20 DO 10 J=1,10 X(I) = Y(I)+J 10 CONTINUE Findent, structure ================== In version 2.8.4, a major reorganizing has been done, trying to make the source more readable and more object-oriented. These are the classes (all starting with a capital): - Debugostream This class contains code for debugging. - Docs This class contains code (often generated) to output help- texts (includeing this text) etcetera. - Findentclass Findentclass contains basic functions and variables that are used throughout the program, such as: int determine_fix_or_free() if the input format is not given (parameter -ifixed or -ifree), this function tries to find a proof that the program is free-format. If so, FREE is returned, else FIXED. Fortranline mygetline() Reads a line from STDIN. Optionally, the function builds a buffer to store the line just read, this option is used by determine_fixed_or_free(). Fortranline Getline() Uses the buffer from mygetline() or mygetline() to return a Fortranline. Optionally, maintains a buffer (wizardbuffer) to enable a look-ahead for the wizard functions. - Fortranline This class contains a line of fortran code, and has many frequently used functions operating on that line. - Fortran This is an abstract class with functions and variables needed to construct a 'full_statement': a string that is composed of pure fortran code (stripped from comments, preprocessor directives, ..) and a deque of lines that constructed the full_statement, including comments and preprocessor statements. The pure virtual functions are filled in by class Fixed or class Free, depending on the format of the input. The indentation required is computed from full_statement and the current indentation. Special provisions are made for storing labelled do statements, preprocessor statements and more. - Free This class is a child of Fortran, and contains functions to indent and output the deque containing the continuation lines of a free format fortran source. Also, when conversion from free to fixed format is required, there is code to store the continuation lines in a fixed (not properly indented) deque, and present this to Fixed to output this in a properly indented format. - Fixed Basically the same as Free, but vice-versa. There is a special issue: to determine if there are continuation lines, a wizard has been created that can look ahead, see getnext() in Findentclass. - Flags This class implements a container for the flags (-ifree, -i4 ...) and contains code to interpret the flags. - Globals This class implements a container for a few global variables. Maybe, one would be tempted to make these static, but I tried not to use static variables in order to able to run more than one Findent in one program, one reading from STDIN, the other from a file for example. - Line_prep This class contains code to pre-analyze a full_statement to make the work easier for the lexer and parser. - Pre_analyzer This class contains code to see if a line is a preprocessor statement or a findentfix: line. - Simpleostream This class implements a simple filter to std::cout. The program starts in findent.cpp, and goes on in fortranrun.cpp. The whole thing is somewhat more hairy than I would like to see. I did not succeed to make the whole thing strictly hierarchical, and solved this by giving classes access to the internals of other classes using pointers. But, like in biology, in creating a program, there is no law to keep it simple. findent, usage? =============== Findent reads from standard input and writes to standard output: findent < prog.f90 > prog1.f90 See also 'wfindent', later in this file. The command findent -h gives an overview of the possible flags and there effect. Most interesting are: -i example: -i5 which determines the amount of indent to be used by every item that calls for indenting -Ia The starting indent is determined from the first line (more or less), useful when using findent within vim, for example to intent a selected region: '<,'>:!findent -Ia -ofree converts from fixed format to free format. -L example: -L72 limit input line length to 72 characters. NOTE 1: findent knows about tabbed input: for fixed-format input, the following transformations are made: 10I= -> 10I= 1K*J -> 1K*J X=Y -> X=Y So, a tab followed by 1-9 is transformed to a continuation line, otherwise to a normal line, starting in column 7. NOTE 2: findent silently ignores errors in the flags NOTE 3: handling of continuation lines Example: a = & (/ 3, 10, 12, 4, & 5, 9, 1, 0, & 13, 2, 25, 6 /) After running findent, with standard parameters, you get this: a = & (/ 3, 10, 12, 4, & 5, 9, 1, 0, & 13, 2, 25, 6 /) That is probably not what you really want. The recommended solution is: add '&' at the start of the continuation lines: a = & & (/ 3, 10, 12, 4, & & 5, 9, 1, 0, & & 13, 2, 25, 6 /) Findent will indent this as: a = & & (/ 3, 10, 12, 4, & & 5, 9, 1, 0, & & 13, 2, 25, 6 /) Not recommended solution: You can use the '-k-' flag, like: findent -k- < prog.f90 > prog1.f90 Findent will in this case not touch continuation lines without a starting '&', but leave them as they are. NOTE 4: Findent does not check the length of an output line, so it could be that the length will be larger than 72 or 132 for fixed and free format respectively. In fact, indenting old fixed format sources will very likely result in lines longer than 72 columns. If you are lucky, the compiler will generate an error message, but too long lines can result in changing the semantics of a program without notice. Advice: use a compiler flag that allows long lines: gfortran, free format: -ffree-line-length-none # unlimited gfortran, fixed formtat: -ffixed-line-length-none # unlimited ifort, free format: # no flag needed, default is unlimited ifort, fixed format: -132 # max line length is 132 pgf90, free format: # max line length is 264, # error if longer pgf90, fixed format: -Mextend # max line length is 132, # no error if longer NOTE 4.1: Here a script to check for line length: >>>> snip ---------- checklength --------------------------------------- #!/bin/bash # checks file line lengths # Usage: # checklength [file ...] # outputs "filename:line number:line length:line" for lines longer than length # tabs are converted to spaces using expand # if no file is given, read from stdin usage() { echo "Usage:" echo "$0 [file ...]" } if [ -z "$1" ] ; then usage exit 1 fi l="$1" doit() { expand | awk -v l="$1" -v f="$2" '{ if (length($0) > l) printf "%s:%d:%d:%s\n",f,FNR,length($0),$0 }' } if [ -z "$2" ] ; then doit "$l" "-" exit 0 fi shift while [ "$1" ] ; do cat "$1" | doit "$l" "$1" shift done <<<< snip ---------- checklength -------------------------------------- Example of usage: checklength 72 *.f NOTE 5: handling of comment lines Findent indents comment lines, but does not touch comment lines with the '!' in column one. NOTE 5.1: handling of comment lines converting fixed to free format As said above, findent does not touch comments starting in column 1. Since all vintage comments start in column 1, this has the effect that these comments will not be indented when converting from fixed to free format (using -ofree). If you want the comments indented, convert to free format, add a space before every line and use findent again. Example if the stream editor 'sed' is available: findent -ofree < prog.f | sed 's/^/ /' | findent > prog.f90 If 'sed' is not available (on Windows for example), you can create the program 'addspace' or, on Windows, 'addspace.exe' by compiling this program: >>>> snip -------- addspace.f ------------------------------------------ program addspace implicit none character(1000) :: line integer :: io do read(*,'(a)',iostat=io) line if (io .ne. 0) exit write(*,'(1x,a)') trim(line) enddo end program addspace <<<< snip -------- addspace.f ------------------------------------------ Or, if you have a vintage Fortran-4 compiler, by compiling this program: >>>> snip -------- ADDSPACE.F ------------------------------------------ DIMENSION L(1000) DATA LB/1H / 10 DO 15 I=1,1000 15 L(I)=LB READ(5,100,END=30) L DO 20 I=1000,1,-1 IF (L(I)-LB) 25,20,25 20 CONTINUE WRITE(6,110) GOTO 10 25 WRITE(6,110) (L(J),J=1,I) GOTO 10 30 CONTINUE 100 FORMAT(1000A1) 110 FORMAT(1H ,1000A1) END <<<< snip -------- ADDSPACE.F ------------------------------------------ Use the generated program 'addspace' in stead of 'sed': findent -ofree < prog.f | addspace | findent > prog.f90 findent, failure, findentfix: ============================= One thing is certain: findent contains errors. I appreciate it if you bring errors to my attention. If possible I will fix them. On the other hand, it is possible to fool findent, for example by using #ifdef, #else, #endif in a way that confuses findent. Both cases can be solved using ! findentfix: , read on: The next program will not be indented correctly: >>>> snip -------- fixdemo.f90 ----------------------------------------- ! compile with: gfortran -cpp fixdemo.f90 ! or ! gfortran -cpp -DLOOPJ fixdemo.f90 program fixdemo implicit none integer i,j j=4 do i=1,3 #ifdef LOOPJ do j=1,2 #endif print *,i*j enddo #ifdef LOOPJ enddo print *,'with j-loop' #else print *,'without j-loop' #endif continue end program fixdemo <<<< snip -------- fixdemo.f90 ----------------------------------------- That is because findent takes the indentation from: #ifdef LOOPJ do j=1,2 #endif and #else print *,'without j-loop' #endif So, findent is missing an enddo for the j-loop. In this case, the solution would be to insert #else just before the first #endif. If, however, in a real-world example this is not possible, or when findent really makes an error, you can use findentfix. In the example above, insert directly after the last #endif: ! findentfix: enddo and findent will indent correctly. In general, the text after ! findentfix: will be used by findent as a normal source line, so the following could also be useful: ! FINDENTfix: subroutine dummy ! findentFIX: do;do;do ! FINDENTFIX: end;end ! findentfix: where () But the following would do nothing: ! findentfix: continue findent, creating a dependency file for use in an Makefile. =========================================================== findent --deps < prog.f90 prints the dependencies found in prog.f90, based on USE, MODULE, SUBMODULE, INCLUDE, #include and ??include. This is used by the bash script makefdeps to create a dependency file for use in an Makefile. Creation of the makefdeps script: findent --makefdeps > makefdeps chmod +x makefdeps The command: ./makefdeps *.f90 will output a dependency file, to be used in an Makefile. The dependencies are based on .o files, for example: main.o: sub1.o sub2.o sub1.o: sub1.inc Example Makefile and fortran sources to create 'program' from main.f90 sub1.f90 sub2.f90 sub.inc: >>>> snip ---------- Makefile --------------------------------------- SRCS = main.f90 sub1.f90 sub2.f90 OBJS = $(SRCS:.f90=.o) %.o: %.f90 gfortran -c -o $@ $< program: $(OBJS) gfortran -o $@ $(OBJS) include deps dep deps: findent --makefdeps < /dev/null > makefdeps.sh @if [ "`head -n 1 makefdeps.sh`" != "#!/bin/bash" ] ; then \ findent -v 1>&2; \ echo "Use findent version >= 3.0.0" 1>&2 ; exit 1 ; fi chmod +x makefdeps.sh ./makefdeps.sh $(SRCS) > deps clean: rm -f *.o *.mod *.smod program deps <<<< snip ---------- Makefile --------------------------------------- >>>> snip ---------- main.f90 --------------------------------------- program main use mymod1 use mymod call sub1 call sub end <<<< snip ---------- main.f90 --------------------------------------- >>>> snip ---------- sub1.f90 --------------------------------------- module mymod1 contains subroutine sub1 print *,'this is sub1' end end module mymod interface module subroutine sub end subroutine end interface end module <<<< snip ---------- sub1.f90 --------------------------------------- >>>> snip ---------- sub2.f90 --------------------------------------- submodule (mymod) mymod2 contains module procedure sub include 'sub.inc' end procedure end submodule <<<< snip ---------- sub2.f90 --------------------------------------- >>>> snip ---------- sub.inc --------------------------------------- print *,'this is sub' <<<< snip ---------- sub.inc --------------------------------------- The fortran sources will be compiled in correct order, you can even use parallel make (make -j). BTW: this example uses the SUBMODULE statement: you need to have gfortran >= 6 to compile. findent, installation: ====================== (For a more comprehensive text, see README.1st and INSTALL) Linux: $ ./configure --prefix=/usr/local $ make On systems with sudo (Debian, Ubuntu, Mint, ...): $ sudo make install On systems without sudo (Redhat, Scientific Linux, ...): $ su -c 'make install' Windows: copy findent.exe C:\WINDOWS wfindent ======== wfindent, a bash shell script, indents Fortran source in-place, performing a sanity check. It accepts all flags that findent accepts. Usage: wfindent [ findent flags ] files example wfindent -I4 *.f90 Installation: If you installed findent with the ./configure, make, make install method, wfindent is installed as well. Otherwise: On systems with sudo (Debian, Ubuntu, Mint, ...): $ sudo install scripts/wfindent /usr/local/bin On systems without sudo (Redhat, Scientific Linux, ...): $ su -c 'make install' wfindent.bat ============ wfindent.bat is for usage in the cmd shell of Windows and has the same functionality as wfindent, described just above. Installation: copy wfindent.bat C:\WINDOWS jfindent or jfindent.jar ======================== jfindent is a graphical front end for findent, and is available as a separate package on findent.sourceforge.net findent and vim =============== Findent is since version 2.7 very vim-aware. When using the vim scripts (look at findent --vim-help), findent is used as equalprg ( :help equalprg ) and indentexpr ( :help indentexpr ) This is possible because of the speed of findent: it indents about 50000 - 100000 lines per second. Findent can emit configuration files, look at the output of: findent --vim_help findent and gedit ================= To enable findent in gedit, look at the output of: findent --gedit_help findent and emacs ================= To enable findent in emacs, look at the output of: findent --emacs_help Issues ====== Since findent parses line-by-line, there are situations that are ambiguous: F(X) = X**2 An assignment or a statement function? ELSE WHERE Is this an ELSEWHERE as in WHERE(X .EQ. 0) Y=10 ELSE WHERE Y=1 END WHERE or is it part of an IF construct with name WHERE: WHERE: IF (X .EQ. 0) THEN Y=10 ELSE WHERE Y=1 ENDIF WHERE Findent chooses the first possibility. And there must be more ... Luckily, it seems that these ambiguities do not affect indentation. I tried to make findent Fortran-2008 compatible. This raised another ambiguity, because findent is space-insensitive: MODULE PROCEDURE MYPROC Is this an module PROCEDUREMYPROC or an moduleprocedure MYPROC? Findent assumes the last. Thanks to ========= It would not be possible for me to create findent if I could not stand of the shoulders of other free software projects. In alphabetical order (and probably forgetting some): autoconf: https://www.gnu.org/software/autoconf/autoconf.html bash: https://www.gnu.org/software/bash/ bison: https://www.gnu.org/software/bison/ debian: https://www.debian.org/ flex: https://github.com/westes/flex g++: https://gcc.gnu.org/ gcc: https://gcc.gnu.org/ gfortran: https://gcc.gnu.org/wiki/GFortran gnu software: https://www.gnu.org/ kcachegrind: https://kcachegrind.github.io/html/Home.html linux: https://en.wikipedia.org/wiki/Linux make: https://www.gnu.org/software/make/ ubuntu: https://www.ubuntu.com/ valgrind: http://valgrind.org/ vim: https://www.vim.org/ The website http://www.cplusplus.com/ helped me to find a way through C++. I like to thank the people who gave suggestions to improve the functionality of findent. ============================================================================= I am happy to receive comments, error reports and suggestions for improvements. October 2018, Willem Vermin, wvermin@gmail.com findent-3.1.1/doc/Makefile.am0000644000175000017500000000002413226412174012663 00000000000000EXTRA_DIST = README findent-3.1.1/doc/Makefile.in0000644000175000017500000002641713476205425012720 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_bison.m4 \ $(top_srcdir)/m4/ax_prog_flex.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC = @FC@ FCFLAGS = @FCFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MINGW32 = @MINGW32@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_FC = @ac_ct_FC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ make_include = @make_include@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = README all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: findent-3.1.1/makeupload0000744000175000017500000000200213444171116012126 00000000000000#!/bin/bash # creates directory for upload # BTW: it seems that ./makedeb produces exactly the same ... # version numbers for upstream releases: newversion=`./getversion` oldversion=2.8.2 curdir=`pwd` dist=sid tar=$curdir/../versions/findent-$newversion.tar.gz uploaddir=$curdir/../upload/upload-$newversion ./maketar echo removing $uploaddir ... mkdir -p $uploaddir sudo chown -R willem.willem $uploaddir rm -rf $uploaddir mkdir -p $uploaddir cd $uploaddir || exit 1 cp -v $tar . || exit 1 sudo bash `which pbuilder` --execute --bindmounts $PWD \ --configfile ~root/pbuilderrc.$dist \ -- $curdir/pbuilderscript $PWD $oldversion $newversion|| exit 1 sudo chown -R willem.willem $uploaddir rm -r findent-$oldversion rm findent_$oldversion-1.debian.tar.xz rm findent_$oldversion-1.dsc rm findent_$oldversion.orig.tar.gz rm -r findent-$newversion rm -r findent-$newversion.orig debsign *.changes echo to check: dput -s mentors $uploaddir/*.changes echo to upload: dput mentors $uploaddir/*.changes echo "$0 done" findent-3.1.1/bootstrap0000744000175000017500000000205413475171002012026 00000000000000#!/bin/bash version=`./getversion` date=`date -R` echo "version = $version" sed -i "/^AC_INIT(findent/s/^.*/AC_INIT(findent, $version, wvermin@gmail.com)/" configure.ac || exit 1 for d in debian debian.wheezy debian.disco debian.stretch debian.sid ; do if [ -e $d/changelog ] ; then sed -i "1s/(.*)/($version-1)/" $d/changelog || exit 1 sed -i "0,/^ --.*>/{/^ --.*>/s/> .*/> $date/}" $d/changelog || exit 1 fi done autoreconf -fvi || exit 1 ./configure || exit 1 cp test/*.f test/*.ref test/*.sh \ test/doit debian/tests || exit 1 echo "Tests:" > debian/tests/control || exit 1 for f in debian/tests/test?.sh debian/tests/test??.sh ; do echo " `basename $f`" >> debian/tests/control || exit 1 done make builtparser builtlexer || exit 1 make -C src includes || exit 1 make distclean || exit 1 echo "bootstrap done" findent-3.1.1/debian.disco/0000755000175000017500000000000013476205423012474 500000000000000findent-3.1.1/debian.disco/compat0000644000175000017500000000000213330374476013616 000000000000009 findent-3.1.1/debian.disco/control0000644000175000017500000000122213444175627014023 00000000000000Source: findent Section: devel Priority: optional Maintainer: Willem Vermin Build-Depends: debhelper (>= 9), flex, bison Standards-Version: 3.9.7 Homepage: https://sourceforge.net/projects/findent/ Package: findent Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: indents/converts Fortran sources Indents Fortran sources: free or fixed format. Optionally converts from fixed format to free format. Supports Fortran2008. Indentation is controlled by a number of flags. Easy integration with (g)vim, gedit, emacs. . wfindent is a wrapper for findent and facilitates in-place indenting of Fortran sources. findent-3.1.1/debian.disco/changelog0000644000175000017500000000065513476205423014274 00000000000000findent (3.1.1-1) unstable; urgency=low * New upstream release -- Willem Vermin Thu, 06 Jun 2019 14:46:11 +0200 findent (2.8.2-1) unstable; urgency=low * New upstream release -- Willem Vermin Wed, 13 Jun 2018 05:09:12 +0200 findent (2.7.3-1) unstable; urgency=low * Initial release (Closes: #842166) -- Willem Vermin Tue, 20 Dec 2016 12:22:24 +0100 findent-3.1.1/README0000644000175000017500000000022213250463212010736 00000000000000For installation instructions and usage, see README.1st and INSTALL For more in-depth information: see doc/README For maintainers: see README.2nd findent-3.1.1/test-driver0000755000175000017500000001104213476205425012270 00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2018-03-07.03; # UTC # Copyright (C) 2011-2018 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, see . # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>$log_file # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: findent-3.1.1/missing0000755000175000017500000001533613476205425011503 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written 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, see . # 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 case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: findent-3.1.1/vim/0000755000175000017500000000000013476205436010751 500000000000000findent-3.1.1/vim/findent.vim0000644000175000017500000000607013344675504013041 00000000000000" to enable the findent Fortran indent program: " include this file in ~/.vimrc " or place it in ~/.vim/plugin/ as findent.vim "Author: Willem Vermin wvermin@gmail.com "Licence: fair "Date: nov 2016 " if exists("g:use_findent") if !g:use_findent finish endif endif filetype plugin indent on " set default indent flag, if not already set if !exists("b:findent_flags") let b:findent_flags = "-i".&shiftwidth endif " " the nnoremap commands will define some shortcuts: " for example: " \= will indent whole file " \f let you change finden flags " see the nnoremap commands below " " indent whole buffer, can be used with all filetypes function! Indent() let view=winsaveview() execute "normal! gg=G" call winrestview(view) endfunction " indent whole buffer: nnoremap = :call Indent() function! Get_fortran_format() " b:fortran_format defined in auto/indent/fortran.vim if exists("b:fortran_format") return b:fortran_format endif return "unknown" endfunction function! Get_findent_use_whole_buffer() " b:findent_use_whole_buffer defined in auto/indent/fortran.vim if exists("b:findent_use_whole_buffer") if b:findent_use_whole_buffer if b:use_findent_indentexpr return "wb" endif endif endif return "" endfunction augroup fortfiletype autocmd! " allow tabs in fortran source autocmd Filetype fortran let fortran_have_tabs=1 " fortran_more_precise=1: very slow :syntax on if on end of large file "autocmd Filetype fortran let fortran_more_precise=1 " indent after subroutne etc (not used by findent) autocmd Filetype fortran let fortran_indent_more=1 " indent after do (not used by findent) autocmd Filetype fortran let fortran_do_enddo=1 " comment line: autocmd Filetype fortran nnoremap c I! " Change findent flags " Findent_set_flags defined in after/indent/fortran.vim autocmd Filetype fortran nnoremap f :call Findent_set_flags() " on input: do not create tabs on input autocmd Filetype fortran setlocal expandtab " no max line length autocmd Filetype fortran setlocal textwidth=0 " enable statusline autocmd Filetype fortran setlocal laststatus=2 " use indent of previous line autocmd Filetype fortran setlocal autoindent " define statusline autocmd Filetype fortran setlocal statusline=%<%t\ %m\ %r\ %y\ %{Get_fortran_format()}\ %{Get_findent_use_whole_buffer()}%=%l\ %c\ %LL\ %P " define toggle: use whole buffer for indenting or not autocmd Filetype fortran nnoremap w :call Findent_use_wb_toggle() " define == such that findent is called as if the line has been edited autocmd Filetype fortran nnoremap == il " make syntax aware of above " probably not needed. " uncommented, because autocmd commands in .vimrc are not executed " when a modeline for is presen, as in: " !directions for vi vim: filetype=fortran " autocmd Filetype fortran syntax on augroup END " vim filetype=vim findent-3.1.1/vim/README0000644000175000017500000000442513334306573011553 00000000000000To enable findent for vim: find out in which directory the configuration files for vim are situated, here we assume it is in $HOME/.vim . Enter the following commands: ############################################## vimroot=$HOME/.vim mkdir -p $vimroot/plugin findent --vim_findent > $vimroot/plugin/findent.vim mkdir -p $vimroot/after/indent findent --vim_fortran > $vimroot/after/indent/fortran.vim ############################################## In ~/.vimrc include the following lines: """""""""""""""""""""""""""""" filetype plugin indent on syntax on """""""""""""""""""""""""""""" If you do not want syntax highlighting, you can switch it off again with: syntax off In ~/.vimrc you can specify: let use_findent = 1 " use findent (default) let use_findent = 0 " do not use findent let findent = "location-of-findent" " default: 'findent' let use_findent_indentexpr = 1 " use findent for indentexpr let use_findent_indentexpr = 0 " do not use findent for indentexpr " see :help indentexpr let findent_flags = "" " specify flags for findent, e.g.: let findent_flags = "-i4" default is "-i".&shiftwidth let findent_setcolumns = 1 " for free format, width of window will " be forced to 132 columns let findent_setcolumns = 0 " no forcing of window width default is 0 In findent.vim, the following mappings are defined (assuming your LocalLeader = \): \w toggle: to determine the indent of the line being edited: use whole buffer (status line: wb) or use the last usable line \f set/change flags for findent \c comment current line \= indent whole buffer Furthermore, command '==' is redefined, such that is does what one would expect. In findent.vim the statusline is redefined. It shows the fortran format (free or fixed) and wb (see \w above) In fortran.vim the format (free or fixed) of the edited file is determined from the extension: fixed: .f .for .fpp .ftn .fortran .f77 free: .f90 .f95 .f03 .f08 If another extension is used (and filetype is fortran, of course), the format is deducted by findent: if in the first 4000 lines a proof is found for free format, the format is assumed to be free, else the format is assumed to be fixed. findent-3.1.1/vim/Makefile.am0000644000175000017500000000005413210254021012700 00000000000000EXTRA_DIST = findent.vim fortran.vim README findent-3.1.1/vim/Makefile.in0000644000175000017500000002644713476205425012751 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = vim ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_bison.m4 \ $(top_srcdir)/m4/ax_prog_flex.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC = @FC@ FCFLAGS = @FCFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MINGW32 = @MINGW32@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_FC = @ac_ct_FC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ make_include = @make_include@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = findent.vim fortran.vim README all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu vim/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu vim/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: findent-3.1.1/vim/fortran.vim0000644000175000017500000001675113344675504013074 00000000000000" Vim indent file " Installation: Place this script in the $HOME/.vim/after/indent/ directory " as fortran.vim and use it with Vim > 7.1 and findent: " findent.sourceforge.net " Author: Willem Vermin wvermin@gmail.com " Licence: fair " use findent for indenting, unless use_findent == 0 if !exists("g:use_findent") let b:use_findent = 1 else let b:use_findent = g:use_findent endif " use findent for indenting using indentexpr (see :help indentexpr) " unless use_findent_indentexpr == 0 if !exists("g:use_findent_indentexpr") let b:use_findent_indentexpr = 1 else let b:use_findent_indentexpr = g:use_findent_indentexpr endif " The location of findent: if !exists("g:findent") let g:findent = "findent" endif if !exists("b:use_findent") finish endif if !b:use_findent finish endif if !exists("b:use_findent_indentexpr") let b:use_findent_indentexpr = 1 endif autocmd BufEnter * unlet! g:fortran_free_source g:fortran_fixed_source autocmd BufEnter * unlet! b:fortran_free_source b:fortran_fixed_source " g:findent is probably set in .vimrc " if not: skip all if !exists("g:findent") finish endif " get fortran format from extension ext " return "free", "fixed" or "unknown" function! Get_format_from_extension(ext) if a:ext =~? '^f$\|^for$\|^fpp$\|^ftn$\|^fortran$\|^f77$' let format = "fixed" elseif a:ext =~? '^f90$\|^f95$\|^f03$\|^f08$' let format = "free" else let format = "unknown" endif return format endfunction " return string that represents external command to determine " if input is free or fixed format. " If no suitable command is found, return "" " The output of this external command must be "free" or "fixed" function! Findent_get_freefixed() let indentparmsq = ' -q' let f = g:findent.indentparmsq.' 2>/dev/null' if strpart(system(f," continue"),0,4) != "free" let f = "" endif return f endfunction " Return external command to get the indent of the last line of the input " Return "" if no such command can be found " side effect: s:findent_getindent is the command tried function! Findent_get_getindent() let getindent=g:findent.' -Ia -lastindent -i'.b:fortran_format.' '.b:findent_flags.' 2>/dev/null' let s:findent_getindent = getindent if system(getindent,' continue') == 4 return getindent else return "" endif endfunction " Return external command that indents the input " Return "" if no such command can be found " side effect: s:fortran_indentprog is the command tried function! Findent_get_indentprog() " first a test: let indentparms = ' -Ia -i'.b:fortran_format.' '.b:findent_flags let indentprog = g:findent.indentparms.' 2>/dev/null' let s:fortran_indentprog = indentprog if strpart(system(indentprog,"continue"),0,8) == "continue" return indentprog else return "" endif endfunction " Returns the indentation of the current line function! Findent_getindent() if b:findent_use_whole_buffer " use whole buffer up to current line to determine indent let startline = 1 else let maxlines = 10*&lines " use at most 'maxlines' previous lines to determine indent let s = max([v:lnum-maxlines,1]) "let startline = system(g:findent." -lastusable -i".b:fortran_format,join(getline(1,v:lnum-1),"\n")) let startline = s - 1 + system(g:findent." -lastusable -i".b:fortran_format,join(getline(s,v:lnum-1),"\n")) endif let startline = max([1,startline]) let getindent = Findent_get_getindent() let lnum = prevnonblank(v:lnum) let ind = system(getindent, join(getline(startline,lnum),"\n")) return ind endfunction function! Findent_set_flags() if !b:have_findent && !b:have_findent_getindent return endif let old = b:findent_flags let b:findent_flags = input("findent flags:",b:findent_flags) if b:have_findent if Findent_get_indentprog() != "" call Findent_set_indentprog() else let x = input( "Cannot use flags '".b:findent_flags."' Will use '".old."'") let b:findent_flags = old return endif endif if b:have_findent_getindent if Findent_get_getindent() != "" call Findent_set_getindent() else let x = input( "Cannot use flags '".b:findent_flags."' Will use '".old."'") let b:findent_flags = old return endif endif endfunction function! Findent_set_indentprog() let p = Findent_get_indentprog() if p == "" echomsg "Warning '".s:fortran_indentprog."' not usable as equalprg" echomsg "Using default for equalprg" setlocal equalprg= let b:have_findent = 0 else execute 'setlocal equalprg='.substitute(p,' ','\\ ','g') let b:have_findent = 1 endif endfunction function! Findent_set_getindent() if Findent_get_getindent() == "" echomsg "Warning '".s:findent_getindent."' not usable as indentexpr" echomsg "Using default for indentexpr" setlocal indentexpr= let b:have_findent_getindent = 0 else setlocal indentexpr=Findent_getindent() setlocal indentkeys=*,*,*,*,!^F,o,O,0# " fixed format: if first character is tab, indent the line if b:fortran_format == "fixed" setlocal indentkeys+=!0 endif let b:have_findent_getindent = 1 endif endfunction function! Findent_use_wb_toggle() if b:use_findent_indentexpr let b:findent_use_whole_buffer = !b:findent_use_whole_buffer if b:findent_use_whole_buffer let p = "ON" else let p = "OFF" endif echomsg "use whole buffer = ".p else echomsg "not using findent for indentexpr" endif endfunction function! Get_free_or_fixed_default() if exists("b:fortran_fixed_source") if b:fortran_fixed_source return "fixed" endif endif if exists("b:fortran_free_source") if b:fortran_free_source return "free" endif endif return "fixed" endfunction "========================================================================= if exists("g:findent_flags") let b:findent_flags = g:findent_flags endif if !exists("b:findent_flags") let b:findent_flags = "-i".&shiftwidth endif if !exists("b:findent_use_whole_buffer") let b:findent_use_whole_buffer = 0 endif if !exists("g:findent") let g:findent = "/usr/bin/findent" endif " determine fixed or free or unknown based on suffix let b:fortran_format = Get_format_from_extension(expand('%:e')) " if format is unknown, try to get it from the source if b:fortran_format == "unknown" " determine command to determine free or fixed let b:findent_freefixed = Findent_get_freefixed() if b:findent_freefixed == "" let b:fortran_format = Get_free_or_fixed_default() echomsg "Cannot determine format using findent, will use" b:fortran_format else let r=system(b:findent_freefixed,join(getline(1,10000),"\n")) if r =~ "free" let b:fortran_format = "free" else let b:fortran_format = "fixed" endif endif endif if b:fortran_format == "free" let g:fortran_free_source = 1 let b:fortran_free_source = 1 let b:fortran_fixed_source = 0 setlocal colorcolumn=133 if exists("g:findent_setcolumns") if(g:findent_setcolumns) setlocal numberwidth=6 if &columns < 132+&numberwidth let &columns=132+&numberwidth endif endif endif else let g:fortran_fixed_source = 1 let b:fortran_fixed_source = 1 let b:fortran_free_source = 0 setlocal colorcolumn=6,73 endif call Findent_set_indentprog() if b:use_findent_indentexpr call Findent_set_getindent() endif findent-3.1.1/simplemake.sh0000744000175000017500000000210613402502077012547 00000000000000#!/bin/sh # # this script tries to compile findent, without using the # configure ; make ; make install # suite. # # definitions: CPP='g++' # C++ compiler CPPFLAGS='-O2' # compile flags EXE='findent' # name of program to create # echo "C++ compiler: $CPP" echo "compile flags: $CPPFLAGS" echo "program: $EXE" SRCS=" debug.cpp docs.cpp findentclass.cpp findent.cpp findentrun.cpp fixed.cpp flags.cpp fortran.cpp fortranline.cpp free.cpp functions.cpp globals.cpp line_prep.cpp mylexer.cpp myparser.cpp pre_analyzer.cpp prop.cpp simpleostream.cpp " echo "compiling, this can take some time ..." cd src || exit 1 cp builtparser.h parser.h || exit 1 cp builtparser.cpp parser.cpp || exit 1 cp builtlexer.cpp lexer.cpp || exit 1 $CPP $CPPFLAGS -o $EXE $SRCS || exit 1 cd .. cp src/$EXE . || exit 1 echo "succesfully created: $EXE" echo "copy this file to the desired directory, for example" echo " cp $EXE \$HOME/bin" echo "or" echo " cp $EXE \$HOME/.local/bin" echo "or" echo " cp $EXE /usr/local/bin" findent-3.1.1/README.1st0000644000175000017500000001007413402730260011451 00000000000000findent: Indents/beautifies/converts Fortran sources. Prints dependencies based on: - definitions and uses of modules and submodules - include, #include and ??include statements Findent can emit a script that uses findent to create a dependencies file for use in an Makefile. - findent supports Fortran-66 up to Fortran-2018 - findent can convert from fixed form to free form and vice-versa - findent honours cpp and coco preprocess statements - findent is validated against all constructs in 'Modern Fortran explained, Incorporating Fortran 2018, Metcalf e.a.' - findent honours OpenMP conditionals - findent runs in Unix and Windows - high speed: 50K - 100K lines per second - wrapper for processing one or more files in one call available for Unix and Windows (wfindent and wfindent.bat respectively) - vim, gedit, emacs: findent optionally emits configuration files for these editors to use findent as a plugin. - gui frontent available in a separate package: jfindent Unix-Linux users with a 'decent' shell and make: prerequisites: gnumake, g++ make findent and wfindent: download findent-x.y.tgz $ tar xf findent-x.y.z.tgz $ cd findent-x.y $ ./configure --prefix= $ make clean $ make On systems with sudo (Debian, Ubuntu, Linux Mint, ...): $ sudo make install On systems without sudo (Redhat, Scientific Linux, ...): $ su -c 'make install' if bison or flex are found, they will be used to regenerate the parser and lexer sources. See ./configure --help You can create an Windows executable (requires Ubuntu package g++-mingw-w64-i686): $ ./configure --with-windows $ make clean $ make If things are ok: findent.exe will be available in src/ wfindent.bat is available in scripts/ Unix-Linux users for whom above recipe does not work: prerequisites: a Bourne shell (sh, bash), C++ compiler make findent: download findent-x.y.tgz $ tar xf findent-x.y.z.tgz $ cd findent-x.y edit simplemake.sh to fill in the correct values of the name of the C++ compiler, default: g++ the compile flags, default: -O2 the name of the program to create, default: findent $ sh simplemake.sh copy the generated program to the desired location ( e.g. $HOME/bin). make wfindent: in the directory 'scripts' you find a template for wfindent: wfindent.tmpl edit wfindent.tmpl: change 'findent-location' into the path to findent e.g. /usr/local/bin/findent. Copy wfindent.tmpl to the desired location, e.g.: $ cp wfindent.tmpl $HOME/bin/wfindent Windows users: download findent-x.y.zip $ unzip findent-x.y.zip $ copy findent.exe C:\WINDOWS $ copy wfindent.bat C:\WINDOWS All systems: Usage: $ findent -h Examples: $ findent < in.f90 > out.f90 $ findent -i4 -Rr < in.f > out.f90 $ wfindent -i4 -Rr *.f Usage with Make: $ findent --makefdeps > makefdeps $ chmod +x makefdeps use something like the following in your Makefile: include deps dep deps: ./makefdeps *.f90 > deps Of course, if makefdeps is not adequate for you, you can create your own script, possibly inspired by makefdeps. (g)vim users: Install findent, the following command shows instructions how to use findent in (g)vim: findent --vim_help Documentation: in (g)vim: :help equalprg :help indentexpr vim/README and the comments in the files vim/findent.vim and vim/fortran.vim gedit users: Install findent, the following command shows instructions how to use findent in gedit: findent --gedit_help emacs users: Install findent, the following command shows instructions how to use findent in emacs: findent --emacs_help findent-3.1.1/src/0000755000175000017500000000000013476205436010745 500000000000000findent-3.1.1/src/builtlexer.cpp0000644000175000017500000056062713476205431013563 00000000000000#line 2 "lexer.cpp" #line 4 "lexer.cpp" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 #define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #ifndef SIZE_MAX #define SIZE_MAX (~(size_t)0) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ /* begin standard C++ headers. */ /* TODO: this is always defined, so inline it */ #define yyconst const #if defined(__GNUC__) && __GNUC__ >= 3 #define yynoreturn __attribute__((__noreturn__)) #else #define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an * integer in range [0..255] for use as an array index. */ #define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ int yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = NULL; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart ( FILE *input_file ); void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); void yy_delete_buffer ( YY_BUFFER_STATE b ); void yy_flush_buffer ( YY_BUFFER_STATE b ); void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); void yypop_buffer_state ( void ); static void yyensure_buffer_stack ( void ); static void yy_load_buffer_state ( void ); static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); void *yyalloc ( yy_size_t ); void *yyrealloc ( void *, yy_size_t ); void yyfree ( void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ typedef flex_uint8_t YY_CHAR; FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #ifdef yytext_ptr #undef yytext_ptr #endif #define yytext_ptr yytext static yy_state_type yy_get_previous_state ( void ); static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); static int yy_get_next_buffer ( void ); static void yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 154 #define YY_END_OF_BUFFER 155 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static const flex_int16_t yy_acclist[690] = { 0, 155, 153, 154, 152, 154, 153, 154, 149, 153, 154, 148, 153, 154, 153, 154, 150, 153, 154, 151, 152, 154, 16, 17, 153, 154, 153, 154, 153, 154, 153, 154, 153, 154, 153, 154, 153, 154, 153, 154, 153, 154, 153, 154, 153, 154, 153, 154, 153, 154, 153, 154, 153, 154, 153, 154, 153, 154, 153, 154, 4, 154, 5, 154, 2, 4, 154, 3, 4, 154, 8, 154, 9, 154, 6, 8, 154, 7, 8, 154, 15, 154, 14, 154, 10, 15, 154, 12, 15, 154, 11, 15, 154, 13, 15, 154, 1, 154, 154, 154, 114, 154, 154, 114, 154, 154, 154, 154, 154, 154, 154, 154, 145, 154, 145, 154, 144, 154, 145, 154, 145, 154, 130, 145, 154, 145, 154, 145, 154, 119, 154, 118, 154, 119, 154, 123, 154, 122, 154, 123, 154, 123, 154, 18, 154, 20, 154, 19, 154, 146, 148, 16, 17, 17, 16, 17, 36, 72, 91, 114, 102, 114, 102, 114, 104, 114, 102, 106, 108, 109, 114, 130, 137, 117, 18, 147, 37, 53, 96, 53, 102, 104, 114, 102, 106, 108, 114, 102, 104, 102, 108, 103, 114, 106, 108, 109, 114, 104, 106, 108, 114, 106, 108, 114, 102, 109, 114, 102, 104, 109, 114, 102, 106, 109, 114, 101, 102, 114, 131, 117, 117, 121, 120, 27, 45, 69, 84, 85, 92, 93, 104, 108, 102, 104, 106, 108, 114, 102, 114, 102, 104, 114, 102, 106, 114, 102, 104, 108, 102, 102, 104, 103, 104, 114, 103, 106, 108, 114, 109, 114, 104, 109, 114, 106, 109, 114, 108, 104, 114, 104, 106, 114, 114, 106, 114, 104, 102, 104, 106, 109, 114, 101, 102, 104, 114, 101, 102, 106, 108, 114, 112, 114, 138, 117, 24, 31, 52, 57, 68, 94, 97, 104, 108, 102, 104, 106, 114, 103, 104, 106, 108, 114, 103, 114, 103, 104, 114, 103, 106, 114, 104, 106, 109, 114, 101, 102, 104, 106, 108, 114, 101, 102, 114, 101, 102, 104, 114, 101, 102, 106, 114, 104, 112, 114, 106, 108, 112, 114, 111, 114, 134, 133, 115, 117, 115, 23, 46, 70, 73, 78, 95, 103, 104, 106, 114, 101, 102, 104, 106, 114, 104, 106, 108, 112, 114, 112, 114, 104, 112, 114, 106, 112, 114, 104, 111, 114, 106, 108, 111, 114, 132, 140, 116, 116, 117, 115, 117, 115, 32, 33, 40, 54, 65, 66, 74, 75, 77, 83, 98, 102, 108, 114, 102, 104, 108, 114, 108, 114, 104, 108, 114, 113, 114, 105, 108, 114, 103, 108, 114, 103, 104, 108, 114, 101, 102, 108, 114, 101, 102, 104, 108, 114, 108, 112, 114, 104, 108, 112, 114, 108, 111, 114, 104, 108, 111, 114, 111, 114, 104, 111, 114, 139, 34, 35, 41, 49, 67, 71, 99, 102, 107, 108, 114, 102, 104, 107, 108, 114, 102, 107, 114, 102, 104, 107, 114, 107, 108, 114, 104, 107, 108, 114, 107, 114, 104, 107, 114, 104, 113, 114, 107, 108, 110, 113, 114, 105, 114, 105, 104, 105, 114, 107, 108, 113, 114, 103, 107, 108, 114, 103, 104, 107, 108, 114, 103, 107, 114, 107, 109, 114, 104, 107, 109, 114, 103, 104, 107, 114, 102, 107, 109, 114, 102, 104, 107, 109, 114, 101, 102, 107, 108, 114, 101, 102, 104, 107, 108, 114, 101, 102, 107, 114, 101, 102, 104, 107, 114, 107, 108, 112, 114, 104, 107, 108, 112, 114, 107, 112, 114, 104, 107, 112, 114, 107, 108, 111, 114, 104, 107, 108, 111, 114, 107, 111, 114, 104, 107, 111, 114,16519,16520, 141, 22, 25, 28, 44, 47, 55, 59, 62, 76, 82, 86, 89, 104, 107, 108, 113, 114, 110, 113, 114, 104, 110, 113, 114, 107, 110, 113, 114, 104, 105, 105, 113, 114, 104, 113, 114, 107, 113, 114, 16519,16520,16526,16527, 30, 61, 87, 88, 90, 100, 104, 107, 113, 114, 104, 107, 110, 113, 114,16526, 16527, 26, 51, 56, 8327, 8328, 29, 38, 48, 50, 58, 60, 64, 128, 129, 39, 42, 63, 8335, 8334, 81, 43, 79, 80, 124, 125, 21, 126, 127 } ; static const flex_int16_t yy_accept[1369] = { 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, 1, 1, 1, 1, 1, 1, 1, 2, 4, 6, 8, 11, 14, 16, 19, 22, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 67, 70, 72, 74, 77, 80, 82, 84, 87, 90, 93, 96, 98, 99, 100, 102, 103, 105, 106, 107, 108, 109, 110, 111, 112, 114, 116, 118, 120, 122, 125, 127, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 150, 150, 151, 151, 151, 153, 154, 156, 156, 156, 156, 156, 156, 156, 156, 156, 157, 157, 157, 157, 157, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 159, 159, 159, 159, 159, 159, 159, 160, 160, 162, 162, 162, 162, 163, 163, 163, 163, 164, 164, 164, 164, 164, 164, 164, 166, 166, 166, 166, 166, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 172, 172, 172, 172, 172, 172, 172, 173, 174, 174, 174, 174, 175, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 177, 177, 177, 177, 177, 177, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 179, 179, 180, 180, 180, 180, 180, 180, 180, 180, 180, 183, 183, 183, 183, 187, 187, 187, 187, 189, 189, 189, 189, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 193, 193, 193, 193, 193, 197, 197, 197, 197, 197, 197, 197, 201, 201, 201, 201, 204, 204, 204, 204, 207, 207, 207, 207, 207, 207, 207, 211, 211, 211, 215, 215, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 219, 219, 219, 219, 219, 219, 220, 221, 221, 222, 223, 223, 223, 223, 223, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 227, 228, 228, 228, 228, 228, 229, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 231, 231, 231, 232, 232, 232, 237, 237, 239, 242, 242, 245, 245, 245, 248, 249, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 254, 254, 254, 254, 258, 258, 258, 260, 260, 263, 263, 263, 266, 266, 267, 269, 269, 272, 273, 273, 275, 275, 275, 275, 275, 275, 275, 275, 275, 276, 276, 281, 281, 281, 281, 281, 285, 285, 285, 285, 290, 290, 290, 290, 290, 290, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, 293, 293, 294, 294, 294, 294, 294, 295, 295, 295, 295, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 296, 297, 297, 297, 297, 298, 298, 298, 298, 298, 298, 298, 298, 298, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 300, 300, 301, 301, 301, 301, 301, 301, 301, 301, 301, 301, 301, 301, 301, 301, 301, 301, 301, 303, 303, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, 312, 312, 314, 317, 317, 320, 320, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, 330, 330, 333, 337, 337, 341, 341, 341, 341, 341, 341, 341, 344, 344, 344, 344, 348, 348, 348, 348, 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, 350, 351, 352, 352, 352, 352, 352, 352, 352, 352, 352, 352, 354, 355, 355, 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, 357, 358, 358, 359, 359, 359, 359, 359, 360, 360, 360, 360, 360, 360, 360, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 361, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 365, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 375, 377, 380, 380, 383, 383, 383, 383, 383, 386, 386, 386, 386, 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, 390, 391, 391, 391, 391, 392, 392, 392, 392, 392, 393, 395, 397, 398, 398, 398, 398, 398, 398, 398, 398, 399, 400, 400, 400, 400, 400, 400, 400, 400, 401, 401, 401, 401, 401, 401, 402, 402, 402, 402, 402, 402, 402, 402, 402, 402, 403, 404, 404, 404, 405, 406, 406, 407, 407, 407, 407, 407, 408, 408, 408, 408, 408, 408, 408, 409, 409, 409, 409, 409, 409, 409, 409, 412, 412, 412, 412, 412, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 418, 418, 418, 418, 418, 421, 421, 421, 421, 421, 421, 421, 423, 423, 423, 423, 423, 423, 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 437, 437, 437, 437, 437, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 445, 445, 445, 445, 445, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, 452, 452, 452, 452, 452, 456, 456, 458, 458, 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, 461, 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, 463, 464, 464, 465, 465, 465, 465, 465, 465, 465, 466, 466, 466, 466, 466, 466, 466, 466, 466, 466, 466, 467, 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, 468, 469, 469, 473, 473, 478, 478, 481, 481, 485, 485, 488, 488, 492, 492, 494, 494, 497, 497, 500, 500, 500, 500, 505, 505, 505, 507, 507, 508, 508, 508, 511, 511, 511, 515, 515, 515, 515, 519, 519, 524, 524, 527, 527, 530, 530, 534, 534, 538, 538, 542, 542, 547, 547, 552, 552, 558, 558, 562, 562, 567, 567, 571, 571, 576, 576, 579, 579, 583, 583, 587, 587, 592, 592, 595, 595, 599, 599, 599, 599, 599, 599, 599, 599, 601, 601, 601, 602, 602, 602, 602, 603, 604, 604, 604, 605, 605, 605, 605, 605, 605, 606, 607, 607, 607, 607, 608, 608, 608, 609, 609, 609, 610, 610, 610, 611, 611, 611, 611, 612, 613, 613, 613, 614, 614, 614, 614, 614, 619, 619, 622, 622, 626, 626, 626, 630, 630, 632, 632, 633, 635, 638, 638, 641, 641, 641, 641, 641, 643, 643, 643, 643, 643, 645, 645, 645, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 647, 647, 647, 647, 647, 647, 648, 649, 650, 651, 651, 655, 655, 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, 662, 662, 662, 662, 663, 663, 663, 663, 663, 663, 663, 663, 664, 665, 665, 665, 665, 665, 665, 665, 665, 665, 665, 665, 666, 666, 667, 667, 667, 667, 667, 668, 668, 669, 669, 669, 670, 671, 672, 673, 674, 674, 674, 674, 674, 675, 676, 676, 676, 676, 677, 678, 678, 679, 679, 679, 679, 679, 679, 679, 680, 680, 681, 681, 681, 682, 682, 682, 682, 682, 682, 683, 684, 684, 684, 684, 684, 685, 685, 686, 686, 687, 688, 689, 690, 690 } ; static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1, 15, 16, 1, 1, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 1, 20, 21, 22, 23, 1, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 33, 40, 41, 42, 43, 44, 45, 46, 47, 33, 48, 1, 49, 50, 51, 1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 33, 61, 62, 63, 64, 65, 66, 33, 67, 68, 69, 70, 71, 72, 73, 74, 33, 1, 75, 1, 75, 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, 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, 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, 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, 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 } ; static const YY_CHAR yy_meta[76] = { 0, 1, 1, 2, 1, 1, 1, 1, 3, 3, 4, 1, 1, 1, 1, 1, 1, 5, 5, 6, 1, 1, 7, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 8, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1 } ; static const flex_int16_t yy_base[1608] = { 0, 0, 75, 150, 225, 298, 3582, 0, 71, 21, 23, 22, 24, 97, 98, 54, 55, 128, 174, 3570, 3569, 3558, 368, 27, 254, 3557, 257, 3538, 35, 3518, 3517, 3503, 3489, 3477, 6340, 6340, 42, 6340, 25, 3429, 6340, 6340, 36, 155, 85, 365, 110, 232, 244, 299, 159, 234, 245, 86, 276, 361, 279, 247, 369, 355, 6340, 6340, 6340, 6340, 6340, 6340, 6340, 6340, 6340, 6340, 6340, 6340, 6340, 6340, 6340, 6340, 3442, 6340, 59, 103, 435, 44, 112, 202, 510, 287, 584, 6340, 183, 6340, 250, 188, 289, 340, 3420, 6340, 6340, 3404, 6340, 6340, 211, 3403, 0, 6340, 6340, 6340, 285, 35, 3391, 0, 3385, 0, 175, 360, 393, 425, 440, 92, 357, 441, 297, 520, 451, 526, 246, 445, 3360, 517, 522, 329, 446, 519, 515, 443, 531, 447, 521, 3359, 532, 524, 551, 578, 582, 3358, 6340, 127, 204, 118, 411, 483, 245, 131, 215, 484, 397, 658, 465, 493, 624, 733, 496, 3337, 600, 680, 606, 684, 3340, 534, 693, 620, 808, 722, 706, 829, 833, 710, 837, 633, 769, 776, 358, 762, 833, 3300, 844, 664, 731, 848, 442, 847, 637, 648, 3291, 689, 0, 6340, 826, 852, 705, 746, 861, 845, 843, 866, 868, 866, 535, 553, 847, 743, 895, 933, 896, 880, 523, 900, 903, 742, 899, 910, 913, 965, 911, 914, 928, 912, 973, 960, 925, 3246, 963, 577, 958, 707, 711, 789, 466, 719, 1012, 786, 3241, 1008, 1017, 1029, 3231, 797, 1039, 931, 3202, 1004, 58, 1043, 3189, 3189, 1047, 1025, 1051, 1061, 1082, 1086, 1136, 1048, 1091, 1094, 557, 1095, 1110, 1097, 1114, 3175, 1118, 1158, 3164, 1123, 1119, 1162, 6340, 1167, 1170, 1185, 3154, 1120, 1189, 1171, 3151, 1193, 1202, 1211, 3071, 3012, 1198, 6340, 1215, 1224, 2998, 1227, 695, 1199, 1236, 1246, 1267, 1268, 1271, 1277, 1281, 1295, 1280, 1299, 1303, 1313, 1321, 739, 1247, 587, 6340, 771, 884, 1315, 1342, 1330, 700, 1218, 837, 6340, 6340, 1019, 1318, 1331, 1163, 1274, 1323, 1309, 1332, 1148, 1345, 1320, 1068, 843, 1341, 1339, 1367, 1365, 1370, 1349, 1372, 1369, 1373, 1376, 1401, 1389, 1384, 1391, 1400, 1404, 1393, 1351, 2972, 1410, 1395, 1414, 1416, 1443, 1422, 1428, 1446, 1442, 2970, 2936, 1448, 1431, 1449, 1456, 2935, 1465, 1461, 1476, 1472, 1493, 1489, 1503, 1508, 1520, 1524, 1533, 1523, 1537, 1541, 2926, 1240, 1550, 2917, 1546, 1555, 6340, 1558, 2916, 6340, 1567, 2906, 2889, 1571, 6340, 2886, 6340, 1573, 1576, 1585, 1581, 1590, 1593, 1602, 1598, 1611, 1621, 1642, 1646, 1696, 1650, 1599, 1662, 1658, 1671, 1607, 1675, 1608, 1680, 1684, 1717, 2870, 1719, 1721, 1730, 2866, 1727, 1745, 2826, 1733, 6340, 1749, 1758, 2782, 1578, 6340, 6340, 1754, 6340, 2770, 1770, 2768, 1773, 1767, 1782, 1778, 1787, 1791, 1800, 2758, 6340, 1796, 6340, 1804, 1805, 1814, 1810, 2734, 1819, 1822, 1831, 2727, 1827, 1840, 1850, 1871, 1872, 713, 1828, 1881, 1884, 1885, 1899, 1900, 1903, 1909, 1912, 1913, 1929, 1923, 1932, 1076, 1235, 1492, 1598, 1073, 1711, 1934, 1945, 1952, 1962, 6340, 1961, 1976, 1546, 1943, 1860, 1709, 1955, 1902, 1973, 1971, 1984, 1981, 1807, 1986, 1582, 1707, 1995, 1989, 1908, 1983, 1999, 1723, 1965, 1966, 2003, 2710, 2005, 2011, 2004, 2699, 2008, 2015, 2017, 2019, 2027, 2034, 2040, 2038, 2690, 2041, 2042, 2043, 2045, 2064, 2066, 2065, 2068, 2046, 2069, 2050, 2071, 2078, 2079, 6340, 2085, 2689, 2097, 2088, 1941, 1837, 2106, 2109, 1689, 961, 2126, 2686, 2132, 2683, 2139, 2142, 2158, 2154, 6340, 2162, 6340, 2164, 2144, 2168, 2165, 2174, 1129, 2177, 2674, 2181, 2654, 2185, 2188, 2191, 2194, 2197, 2211, 2214, 2198, 2217, 2231, 1195, 2235, 2652, 2239, 2218, 2243, 1228, 2246, 2632, 2250, 2618, 2254, 2257, 2261, 2615, 2264, 6340, 2267, 2611, 6340, 2270, 2598, 2274, 6340, 1594, 2598, 2277, 2523, 2281, 2284, 2288, 2291, 2220, 2219, 2295, 2298, 2300, 1654, 2307, 2465, 2311, 2449, 2303, 6340, 2315, 2410, 6340, 2318, 2404, 2323, 2344, 2345, 2348, 2357, 2353, 2387, 2362, 1843, 2365, 2388, 2354, 2373, 2376, 940, 2377, 2380, 2385, 2386, 2389, 2397, 2398, 2401, 2407, 2413, 2416, 2417, 1840, 6340, 6340, 1863, 1619, 2377, 2428, 2432, 2436, 2442, 2447, 2443, 1876, 2134, 2405, 2334, 2437, 2456, 2429, 2395, 2453, 2457, 2446, 2409, 2447, 2473, 2453, 2419, 2474, 2464, 2481, 2479, 2333, 2487, 2485, 2493, 2491, 2505, 2475, 2509, 2501, 2497, 2512, 2517, 2513, 2515, 2527, 2535, 2322, 2520, 2321, 2533, 2537, 2540, 2546, 2543, 2550, 2552, 2567, 2568, 2555, 2571, 2207, 2560, 2572, 2602, 2614, 2626, 2616, 2640, 2629, 2643, 2646, 2648, 2657, 2660, 2669, 2671, 2665, 2680, 2677, 2689, 2691, 2700, 2685, 2697, 2709, 2712, 2721, 2723, 2732, 2735, 2736, 2740, 2749, 2752, 2761, 2746, 2757, 2766, 2769, 2778, 2774, 2775, 2787, 2783, 2792, 2796, 2801, 2805, 6340, 2807, 2810, 2811, 2820, 2824, 2833, 2836, 2830, 2845, 2841, 2850, 2853, 2862, 2858, 2859, 2871, 2874, 2883, 6340, 2893, 2914, 2915, 2879, 2924, 2880, 2928, 2930, 2943, 2946, 2947, 2956, 6340, 2205, 6340, 2959, 2204, 2962, 2967, 2971, 2968, 2196, 2980, 2982, 2991, 2200, 2976, 2994, 2995, 3003, 3004, 3007, 3013, 3017, 3016, 2569, 6340, 2611, 2683, 2650, 3026, 3029, 3033, 3037, 3041, 6340, 2146, 2593, 6340, 2679, 2969, 2983, 3005, 3023, 3036, 2800, 2120, 2096, 2869, 2797, 2775, 2641, 3027, 3015, 3029, 2095, 3030, 3051, 3047, 3059, 2920, 2048, 3046, 3055, 3066, 3069, 3079, 3076, 3083, 3081, 3084, 2024, 2013, 3086, 3091, 1957, 1954, 3104, 1933, 3093, 3094, 3096, 3098, 1921, 3106, 3102, 3110, 3113, 3108, 3125, 985, 3142, 3157, 3168, 3159, 3183, 3185, 3194, 1906, 3173, 3198, 3179, 3203, 6340, 3207, 3216, 3212, 3225, 3221, 3229, 3230, 3239, 3235, 3244, 3247, 3256, 1902, 3252, 3265, 3253, 3269, 6340, 3274, 3278, 3283, 3287, 3292, 3295, 1315, 3303, 3300, 3312, 3315, 3324, 3327, 3301, 3336, 3339, 3309, 3348, 3321, 3352, 3354, 3363, 1844, 3333, 3367, 3371, 3372, 3381, 3385, 3389, 3394, 3390, 3399, 6340, 3403, 3412, 3416, 3421, 3425, 3430, 3434, 3436, 3439, 3448, 3444, 3453, 3457, 3462, 3466, 3470, 3471, 3480, 3476, 3485, 3488, 3497, 1823, 3493, 3506, 3494, 3510, 6340, 3515, 3519, 3524, 3528, 3533, 3543, 3564, 3565, 3568, 3577, 3573, 3586, 3592, 3596, 1807, 3574, 3605, 3601, 3610, 6340, 3619, 3622, 3631, 3634, 3637, 3640, 3649, 3645, 3654, 3657, 3666, 1806, 3662, 3675, 3663, 3679, 6340, 3684, 1774, 3688, 6340, 3692, 3696, 3700, 3704, 3708, 3712, 3716, 3122, 2702, 3195, 3721, 3725, 3726, 6340, 3731, 3730, 3717, 3656, 3719, 3290, 3723, 3234, 3737, 1746, 1706, 3281, 6340, 3475, 3567, 3731, 3741, 3739, 3720, 3689, 3743, 3744, 3767, 3122, 3765, 3769, 3746, 3771, 3773, 3772, 1686, 1676, 3783, 3785, 3788, 3791, 3789, 3790, 3793, 3775, 3801, 3786, 3800, 6340, 3828, 1649, 3852, 6340, 3863, 1615, 3867, 6340, 3876, 1580, 3872, 6340, 3885, 1562, 3881, 6340, 3721, 1556, 3890, 3893, 3902, 1540, 3833, 3906, 3910, 3914, 3918, 3848, 3849, 1528, 3922, 3931, 1511, 3919, 3935, 3944, 1507, 3940, 6340, 3953, 1488, 3957, 1474, 3962, 6340, 3966, 6340, 3975, 1464, 3971, 6340, 3984, 1450, 3980, 6340, 3993, 1411, 3989, 6340, 4002, 1391, 3998, 6340, 4011, 1361, 4007, 6340, 4020, 1349, 4016, 6340, 4029, 1306, 4025, 6340, 4033, 4037, 4041, 4045, 4049, 4053, 2813, 4058, 2894, 4063, 6340, 4064, 4068, 4034, 1291, 1270, 4042, 4054, 1256, 3829, 3438, 4055, 4056, 4060, 1244, 1226, 3878, 4057, 4075, 1204, 4063, 4081, 1160, 4065, 4074, 1159, 4070, 4061, 1126, 4097, 4099, 4102, 1051, 1041, 4110, 4115, 1018, 4117, 4107, 4129, 4144, 6340, 4153, 1024, 4149, 6340, 4158, 4175, 1021, 4155, 1022, 977, 921, 868, 6340, 4179, 839, 4183, 4187, 4191, 3015, 4196, 795, 765, 3303, 4201, 4202, 4122, 4153, 767, 4180, 3352, 4190, 4188, 4198, 4168, 4192, 4193, 4199, 4195, 4201, 756, 4205, 4212, 4214, 4219, 4224, 753, 700, 648, 638, 4267, 6340, 4276, 6340, 4271, 4282, 4285, 3573, 650, 4294, 610, 3949, 4180, 4297, 0, 0, 4254, 594, 4265, 4202, 4272, 4274, 4275, 4292, 4285, 580, 542, 4293, 4294, 4296, 4298, 4299, 4306, 4286, 4335, 472, 4351, 6340, 4361, 6340, 461, 423, 408, 4304, 391, 4297, 374, 4323, 4328, 358, 312, 286, 265, 262, 4339, 4313, 4349, 4351, 4333, 4334, 4373, 4378, 3806, 6340, 251, 4365, 202, 4367, 4366, 4355, 194, 186, 4405, 6340, 4410, 6340, 4386, 4379, 172, 4398, 4399, 4359, 4363, 4403, 130, 119, 4404, 4398, 4408, 4420, 88, 3588, 6340, 4396, 6340, 46, 6340, 6340, 6340, 4476, 4484, 4492, 4500, 4508, 4516, 4524, 4532, 4540, 4548, 4556, 4564, 4572, 4576, 4580, 4586, 4594, 4602, 4610, 4618, 4626, 4634, 4642, 4650, 4656, 4659, 4664, 4672, 4680, 4688, 4696, 4704, 4712, 4720, 4728, 4736, 4744, 4752, 4760, 4768, 4776, 4784, 4792, 4800, 4808, 4816, 4824, 4832, 4840, 4848, 4856, 4864, 4872, 4880, 4888, 4896, 4904, 4912, 4920, 4928, 4936, 4944, 4952, 4960, 4968, 4976, 4984, 4992, 5000, 5008, 5012, 5018, 5026, 5034, 5042, 5050, 5058, 5066, 5074, 5082, 5090, 5098, 5106, 5114, 5122, 5130, 5138, 5146, 5154, 5162, 5170, 5178, 5186, 5194, 5202, 5210, 5218, 5226, 5234, 5242, 5250, 5254, 5260, 5268, 5276, 5284, 5292, 5300, 5308, 5316, 5324, 5332, 5340, 5348, 5356, 5364, 5372, 5380, 5388, 5396, 5404, 5412, 5420, 5428, 5436, 5444, 5452, 5460, 5468, 5476, 5484, 5492, 5500, 5503, 5509, 5517, 5525, 5533, 5541, 5549, 5557, 5565, 5573, 5581, 5589, 5597, 5605, 5613, 5621, 5629, 5637, 5645, 5653, 5661, 5669, 5677, 5685, 5693, 5701, 5709, 5717, 5725, 5733, 5741, 5749, 5757, 5765, 5773, 5777, 5783, 5791, 5799, 5807, 5815, 5823, 5831, 5839, 5847, 5855, 5863, 5871, 5879, 5887, 5895, 5903, 5911, 5919, 5927, 5935, 5943, 5951, 5959, 5967, 5975, 5983, 5991, 5999, 6007, 6015, 6023, 6031, 6039, 6047, 6055, 6063, 6071, 6075, 6081, 6089, 6097, 6105, 6113, 6121, 6129, 6137, 6145, 6153, 6161, 6169, 6177, 6185, 6193, 6201, 6209, 6217, 6225, 6233, 6241, 6249, 6257, 6265, 6273, 6281, 6289, 6297, 6301, 6307, 6315, 6323, 6331 } ; static const flex_int16_t yy_def[1608] = { 0, 1368, 1368, 1369, 1369, 2, 5, 5, 5, 1370, 1370, 1371, 1371, 1372, 1372, 1372, 1372, 1372, 1372, 1373, 1373, 1374, 1375, 1376, 1376, 1377, 1377, 1378, 1378, 1379, 1379, 1380, 1380, 1367, 1367, 1367, 1367, 1367, 1367, 1381, 1367, 1367, 1382, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1383, 1367, 1384, 1385, 1386, 1387, 1388, 1389, 1386, 1384, 1388, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1390, 1367, 1367, 1367, 1367, 1367, 1381, 1391, 1392, 1393, 1382, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1383, 1367, 1394, 1395, 1396, 1397, 1385, 1395, 1398, 1399, 1400, 1395, 1401, 1402, 1403, 1404, 1401, 1402, 1405, 1406, 1407, 1408, 1408, 1409, 1410, 1408, 1411, 1412, 1400, 1400, 1400, 1400, 1400, 1400, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1413, 1367, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1367, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 211, 1381, 1414, 1415, 1416, 1395, 1417, 1409, 1415, 1405, 1418, 1416, 1416, 1409, 1418, 1416, 1398, 1405, 1419, 1399, 1399, 1409, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1423, 1421, 1426, 1424, 1395, 1427, 1428, 1425, 1425, 1409, 1429, 1425, 1405, 1367, 1426, 1426, 1367, 1426, 1422, 1422, 1409, 1426, 1422, 1430, 1409, 1431, 1430, 1430, 1409, 1432, 1431, 1367, 1431, 1430, 1409, 1433, 1395, 1434, 1435, 1436, 1437, 1420, 1420, 1420, 1420, 1420, 1420, 1420, 1420, 1420, 1420, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1367, 1367, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1438, 1439, 1440, 1441, 1440, 1442, 1441, 1441, 1442, 1441, 1443, 1405, 1432, 1409, 1409, 1442, 1442, 1367, 1442, 1409, 1367, 1441, 1409, 1444, 1444, 1367, 1409, 1367, 1445, 1446, 1447, 1446, 1448, 1447, 1447, 1448, 1447, 1449, 1450, 1451, 1449, 1450, 1452, 1453, 1451, 1451, 1454, 1451, 1448, 1448, 1448, 1452, 1405, 1455, 1453, 1453, 1409, 1455, 1453, 1409, 1454, 1367, 1454, 1451, 1409, 1367, 1367, 1367, 1448, 1367, 1409, 1447, 1409, 1456, 1457, 1456, 1457, 1457, 1456, 1456, 1432, 1367, 1457, 1367, 1458, 1459, 1460, 1459, 1405, 1461, 1460, 1460, 1409, 1461, 1460, 1462, 1463, 1463, 1464, 1465, 1466, 1467, 1467, 1468, 1468, 1468, 1468, 1468, 1468, 1468, 1468, 1468, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1367, 1367, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1469, 1367, 1469, 1469, 1469, 1469, 1470, 1471, 1472, 1471, 1473, 1472, 1472, 1473, 1472, 1473, 1473, 1473, 1472, 1432, 1367, 1473, 1367, 1474, 1475, 1476, 1475, 1477, 1476, 1476, 1477, 1476, 1477, 1477, 1477, 1476, 1474, 1478, 1479, 1474, 1478, 1480, 1481, 1479, 1479, 1482, 1479, 1480, 1483, 1481, 1481, 1483, 1481, 1482, 1482, 1479, 1477, 1483, 1483, 1367, 1483, 1409, 1367, 1481, 1409, 1482, 1367, 1484, 1485, 1484, 1485, 1485, 1484, 1485, 1484, 1486, 1487, 1488, 1487, 1489, 1488, 1488, 1489, 1488, 1489, 1489, 1367, 1489, 1409, 1367, 1488, 1409, 1490, 1491, 1491, 1492, 1493, 1492, 1494, 1495, 1493, 1493, 1409, 1495, 1493, 1496, 1497, 1498, 1499, 1474, 1496, 1496, 1474, 1474, 1474, 1474, 1474, 1474, 1496, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1500, 1367, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1367, 1367, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1501, 1502, 1503, 1504, 1503, 1505, 1504, 1504, 1505, 1505, 1505, 1504, 1505, 1506, 1507, 1508, 1507, 1509, 1508, 1508, 1509, 1509, 1509, 1508, 1509, 1510, 1511, 1510, 1512, 1513, 1514, 1515, 1515, 1516, 1513, 1517, 1514, 1514, 1517, 1516, 1515, 1517, 1517, 1514, 1516, 1517, 1367, 1518, 1519, 1519, 1518, 1519, 1518, 1520, 1521, 1522, 1521, 1523, 1522, 1522, 1523, 1523, 1523, 1522, 1523, 1367, 1524, 1525, 1525, 1526, 1527, 1526, 1528, 1527, 1527, 1528, 1528, 1528, 1367, 1529, 1367, 1527, 1529, 1530, 1531, 1532, 1531, 1533, 1534, 1532, 1532, 1529, 1534, 1535, 1535, 1530, 1535, 1535, 1535, 1535, 1535, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1367, 1367, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1537, 1538, 1539, 1538, 1540, 1539, 1539, 1529, 1540, 1539, 1540, 1540, 1367, 1540, 1539, 1540, 1539, 1540, 1535, 1541, 1542, 1541, 1543, 1542, 1542, 1529, 1543, 1542, 1543, 1543, 1367, 1543, 1542, 1543, 1542, 1543, 1544, 1545, 1544, 1546, 1547, 1548, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1553, 1555, 1554, 1554, 1529, 1555, 1554, 1556, 1557, 1556, 1556, 1557, 1557, 1555, 1555, 1367, 1555, 1554, 1556, 1555, 1554, 1557, 1555, 1558, 1559, 1558, 1559, 1559, 1558, 1559, 1558, 1560, 1561, 1562, 1561, 1563, 1562, 1562, 1529, 1563, 1562, 1563, 1563, 1367, 1563, 1562, 1563, 1562, 1563, 1564, 1565, 1565, 1566, 1567, 1566, 1568, 1567, 1567, 1529, 1568, 1567, 1568, 1568, 1367, 1568, 1567, 1568, 1567, 1569, 1570, 1571, 1570, 1572, 1571, 1571, 1529, 1572, 1571, 1572, 1572, 1367, 1572, 1529, 1571, 1367, 1573, 1573, 1569, 1573, 1573, 1573, 1573, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1367, 1367, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1574, 1367, 1575, 1529, 1576, 1367, 1575, 1529, 1576, 1367, 1577, 1529, 1578, 1367, 1577, 1529, 1578, 1367, 1579, 1580, 1581, 1582, 1582, 1529, 1583, 1582, 1584, 1584, 1584, 1585, 1586, 1587, 1588, 1588, 1529, 1581, 1588, 1589, 1529, 1590, 1367, 1589, 1529, 1591, 1529, 1592, 1367, 1590, 1367, 1593, 1529, 1594, 1367, 1595, 1529, 1596, 1367, 1595, 1529, 1596, 1367, 1597, 1529, 1598, 1367, 1597, 1529, 1598, 1367, 1599, 1529, 1600, 1367, 1599, 1529, 1600, 1367, 1601, 1601, 1602, 1601, 1602, 1602, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1367, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1581, 1581, 1367, 1581, 1529, 1583, 1367, 1583, 1582, 1529, 1585, 1587, 1587, 1587, 1529, 1367, 1588, 1529, 1601, 1601, 1601, 1367, 1367, 1604, 1605, 1367, 1367, 1367, 1603, 1603, 1603, 1603, 1367, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1581, 1367, 1583, 1367, 1602, 1601, 1602, 1367, 1604, 1604, 1605, 1605, 1367, 1367, 1606, 1607, 1603, 1603, 1603, 1367, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1602, 1367, 1604, 1367, 1605, 1367, 1367, 1606, 1607, 1603, 1603, 1367, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1603, 1367, 1367, 1606, 1607, 1603, 1367, 1603, 1603, 1603, 1603, 1603, 1603, 1367, 1367, 1606, 1367, 1607, 1367, 1603, 1603, 1603, 1603, 1603, 1367, 1367, 1603, 1603, 1603, 1603, 1367, 1367, 1603, 1603, 1367, 1367, 1367, 1367, 1603, 1367, 1367, 0, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367 } ; static const flex_int16_t yy_nxt[6416] = { 0, 34, 34, 35, 36, 34, 34, 34, 34, 34, 34, 34, 37, 34, 34, 34, 34, 38, 38, 34, 34, 34, 34, 34, 61, 65, 61, 65, 58, 88, 89, 88, 90, 62, 63, 62, 63, 100, 99, 100, 101, 59, 107, 107, 110, 111, 105, 161, 40, 34, 34, 34, 107, 107, 162, 109, 58, 69, 69, 106, 106, 402, 146, 253, 147, 109, 70, 70, 59, 148, 66, 67, 66, 67, 41, 34, 34, 34, 41, 36, 34, 34, 34, 34, 34, 34, 34, 37, 34, 34, 34, 34, 38, 38, 34, 34, 34, 34, 34, 58, 69, 69, 72, 72, 109, 109, 150, 109, 151, 70, 70, 109, 59, 152, 133, 154, 200, 156, 71, 71, 115, 240, 163, 40, 34, 34, 34, 58, 241, 109, 146, 69, 234, 73, 248, 73, 73, 235, 109, 59, 70, 249, 133, 73, 200, 72, 72, 115, 121, 109, 34, 34, 34, 35, 36, 34, 34, 34, 34, 34, 34, 34, 37, 34, 34, 34, 34, 38, 38, 34, 34, 34, 34, 34, 109, 121, 72, 69, 109, 73, 113, 73, 73, 110, 111, 177, 70, 177, 178, 73, 181, 109, 181, 178, 109, 182, 114, 129, 40, 34, 34, 34, 1351, 73, 165, 166, 165, 167, 113, 237, 1350, 183, 168, 191, 238, 191, 192, 251, 252, 251, 253, 109, 72, 114, 129, 34, 34, 34, 41, 36, 34, 34, 34, 34, 34, 34, 34, 37, 34, 34, 34, 34, 38, 38, 34, 34, 34, 34, 34, 73, 237, 109, 179, 109, 179, 238, 91, 89, 91, 90, 96, 92, 97, 109, 109, 109, 109, 122, 93, 123, 109, 97, 130, 40, 34, 34, 34, 94, 140, 180, 93, 109, 124, 97, 109, 131, 214, 125, 132, 105, 146, 184, 147, 184, 122, 109, 123, 148, 109, 130, 34, 35, 106, 106, 134, 109, 140, 180, 93, 124, 169, 97, 131, 214, 125, 132, 109, 185, 109, 135, 139, 186, 43, 44, 45, 46, 47, 48, 126, 204, 49, 109, 134, 50, 51, 127, 128, 52, 53, 54, 55, 56, 187, 57, 187, 185, 135, 139, 109, 186, 43, 44, 45, 46, 47, 48, 126, 204, 49, 219, 50, 51, 127, 128, 52, 53, 54, 55, 56, 188, 57, 79, 80, 81, 109, 82, 109, 109, 83, 109, 109, 201, 82, 142, 109, 84, 84, 219, 109, 116, 311, 85, 136, 109, 86, 82, 117, 188, 135, 137, 118, 196, 237, 119, 122, 120, 141, 238, 138, 201, 109, 142, 109, 243, 244, 243, 245, 116, 311, 1330, 136, 246, 86, 82, 117, 135, 137, 118, 196, 1329, 119, 122, 120, 141, 197, 138, 153, 153, 154, 155, 156, 153, 153, 153, 109, 158, 153, 153, 153, 153, 153, 153, 159, 159, 153, 153, 153, 153, 153, 109, 109, 197, 109, 198, 109, 109, 109, 223, 161, 224, 109, 237, 226, 220, 316, 262, 238, 202, 203, 209, 1328, 199, 215, 153, 153, 153, 150, 154, 151, 255, 198, 1327, 210, 152, 256, 223, 264, 224, 265, 161, 226, 220, 316, 266, 202, 203, 262, 209, 199, 215, 153, 153, 153, 154, 159, 156, 153, 153, 153, 210, 163, 153, 153, 153, 153, 153, 153, 159, 159, 153, 153, 153, 153, 153, 109, 205, 109, 291, 109, 109, 109, 109, 109, 109, 292, 109, 206, 357, 217, 227, 109, 109, 229, 211, 109, 222, 216, 221, 153, 153, 153, 109, 237, 207, 218, 208, 225, 238, 212, 213, 109, 228, 109, 338, 206, 357, 217, 227, 339, 230, 229, 211, 222, 216, 221, 153, 170, 154, 170, 156, 207, 218, 208, 225, 163, 212, 213, 109, 228, 109, 338, 109, 275, 276, 275, 231, 339, 230, 171, 284, 277, 285, 232, 109, 491, 172, 286, 225, 375, 173, 212, 213, 174, 296, 175, 297, 268, 269, 268, 270, 298, 176, 1280, 231, 271, 177, 171, 177, 178, 320, 232, 321, 491, 172, 225, 375, 173, 212, 213, 174, 191, 175, 191, 192, 322, 322, 1278, 109, 176, 254, 254, 154, 257, 255, 254, 254, 254, 109, 259, 254, 254, 254, 254, 254, 254, 260, 260, 254, 254, 254, 254, 254, 279, 280, 279, 281, 287, 166, 287, 285, 282, 323, 324, 323, 286, 293, 294, 293, 285, 312, 237, 313, 320, 286, 320, 238, 254, 254, 254, 154, 146, 255, 378, 154, 240, 255, 256, 379, 237, 109, 256, 381, 387, 238, 109, 154, 312, 255, 313, 388, 303, 328, 256, 254, 254, 254, 154, 260, 255, 254, 254, 254, 309, 256, 254, 254, 254, 254, 254, 254, 260, 260, 254, 254, 254, 254, 254, 301, 303, 328, 314, 109, 109, 302, 181, 109, 181, 178, 315, 182, 309, 179, 109, 179, 329, 109, 488, 360, 179, 341, 179, 254, 254, 254, 301, 183, 109, 1280, 314, 240, 302, 383, 244, 383, 384, 315, 381, 492, 180, 385, 396, 1278, 329, 488, 360, 180, 341, 394, 254, 254, 299, 154, 299, 255, 254, 254, 254, 254, 256, 254, 254, 254, 254, 254, 254, 492, 180, 254, 254, 254, 254, 254, 154, 180, 255, 184, 154, 184, 255, 256, 154, 501, 255, 256, 289, 109, 184, 256, 184, 317, 187, 317, 187, 304, 501, 501, 254, 254, 254, 254, 306, 185, 109, 310, 109, 186, 109, 305, 325, 307, 308, 109, 185, 289, 514, 318, 186, 188, 340, 319, 109, 304, 333, 254, 326, 109, 332, 109, 306, 185, 327, 310, 336, 186, 305, 325, 307, 308, 330, 109, 185, 331, 514, 318, 186, 188, 340, 319, 334, 333, 335, 337, 326, 332, 109, 109, 356, 327, 109, 109, 336, 493, 109, 342, 1230, 330, 358, 361, 331, 109, 109, 109, 109, 109, 248, 334, 355, 335, 337, 366, 369, 249, 362, 356, 109, 237, 359, 109, 493, 367, 238, 342, 109, 373, 358, 361, 363, 343, 344, 345, 346, 347, 348, 355, 395, 349, 742, 366, 369, 350, 362, 368, 351, 359, 352, 353, 367, 109, 354, 109, 1230, 373, 109, 363, 109, 343, 344, 345, 346, 347, 348, 364, 109, 349, 376, 365, 350, 372, 368, 351, 1092, 352, 353, 374, 109, 354, 400, 401, 400, 370, 392, 393, 392, 371, 389, 390, 389, 289, 394, 364, 395, 376, 384, 365, 372, 1230, 289, 385, 161, 289, 374, 383, 244, 383, 384, 408, 370, 109, 109, 385, 371, 397, 398, 397, 384, 251, 252, 251, 253, 385, 154, 161, 405, 410, 280, 410, 411, 406, 408, 502, 109, 412, 404, 404, 154, 413, 405, 404, 404, 404, 109, 415, 404, 404, 404, 404, 404, 404, 416, 416, 404, 404, 404, 404, 404, 264, 502, 418, 421, 269, 421, 422, 419, 425, 276, 425, 423, 264, 428, 418, 435, 426, 422, 670, 419, 429, 513, 423, 674, 404, 404, 404, 431, 432, 431, 433, 421, 269, 421, 422, 434, 437, 443, 443, 423, 441, 442, 441, 438, 426, 426, 670, 446, 513, 754, 674, 404, 404, 404, 154, 416, 405, 404, 404, 404, 109, 406, 404, 404, 404, 404, 404, 404, 416, 416, 404, 404, 404, 404, 404, 439, 440, 439, 422, 425, 276, 425, 109, 423, 444, 445, 444, 426, 446, 284, 411, 450, 426, 109, 109, 412, 451, 109, 510, 404, 404, 404, 410, 280, 410, 411, 447, 448, 447, 411, 412, 291, 505, 435, 412, 767, 291, 464, 453, 454, 294, 454, 450, 453, 465, 510, 404, 451, 455, 166, 455, 450, 458, 459, 458, 320, 451, 500, 109, 505, 453, 454, 294, 454, 450, 296, 612, 461, 772, 451, 501, 501, 462, 467, 468, 467, 469, 570, 571, 570, 109, 470, 404, 471, 154, 471, 405, 404, 404, 404, 404, 406, 404, 404, 404, 404, 404, 404, 109, 671, 404, 404, 404, 404, 404, 474, 154, 475, 405, 154, 109, 405, 476, 406, 489, 154, 406, 405, 154, 154, 405, 405, 406, 490, 109, 406, 406, 671, 109, 404, 404, 404, 404, 154, 478, 405, 506, 154, 477, 405, 406, 154, 489, 405, 406, 109, 289, 482, 406, 479, 490, 154, 317, 405, 317, 237, 404, 480, 406, 154, 238, 405, 478, 109, 506, 477, 406, 497, 508, 497, 483, 481, 109, 484, 109, 482, 479, 109, 318, 494, 485, 494, 319, 503, 480, 109, 109, 512, 507, 289, 486, 487, 504, 109, 498, 109, 508, 483, 481, 109, 484, 289, 499, 109, 511, 109, 318, 485, 509, 516, 319, 503, 495, 515, 496, 512, 507, 486, 487, 109, 504, 109, 498, 109, 109, 521, 109, 109, 518, 499, 109, 289, 511, 537, 517, 509, 516, 519, 109, 495, 515, 496, 522, 109, 523, 109, 524, 109, 525, 109, 520, 289, 521, 528, 109, 109, 518, 530, 109, 536, 537, 529, 517, 532, 109, 519, 531, 534, 109, 522, 109, 523, 539, 524, 526, 525, 109, 520, 533, 527, 538, 528, 109, 544, 530, 109, 535, 536, 529, 540, 289, 532, 549, 531, 541, 534, 109, 109, 545, 539, 109, 526, 109, 109, 289, 533, 527, 538, 542, 546, 109, 544, 552, 535, 289, 109, 540, 547, 543, 109, 549, 541, 550, 548, 554, 545, 109, 240, 289, 551, 109, 146, 553, 558, 561, 556, 542, 546, 559, 555, 563, 244, 563, 564, 547, 543, 240, 289, 565, 550, 548, 289, 554, 561, 533, 672, 551, 567, 393, 567, 553, 396, 395, 556, 564, 568, 1230, 555, 568, 565, 563, 244, 563, 564, 569, 398, 569, 564, 565, 387, 289, 533, 565, 672, 396, 683, 388, 389, 390, 389, 289, 568, 567, 393, 567, 572, 573, 572, 683, 683, 568, 273, 289, 568, 569, 398, 569, 564, 400, 401, 400, 154, 565, 575, 161, 441, 442, 441, 576, 161, 289, 578, 580, 280, 580, 581, 578, 584, 276, 584, 582, 446, 284, 581, 782, 585, 443, 428, 582, 580, 280, 580, 581, 585, 599, 437, 443, 582, 586, 448, 586, 581, 605, 585, 696, 289, 582, 574, 574, 154, 587, 575, 574, 574, 574, 673, 589, 574, 574, 574, 574, 574, 574, 590, 590, 574, 574, 574, 574, 574, 264, 696, 592, 595, 269, 595, 596, 593, 264, 289, 592, 597, 639, 673, 794, 593, 435, 837, 596, 601, 432, 601, 602, 597, 574, 574, 574, 603, 595, 269, 595, 596, 606, 440, 606, 596, 597, 584, 276, 584, 597, 607, 445, 607, 837, 585, 744, 393, 744, 585, 109, 574, 574, 574, 154, 590, 575, 574, 574, 574, 109, 576, 574, 574, 574, 574, 574, 574, 590, 590, 574, 574, 574, 574, 574, 428, 609, 610, 609, 612, 109, 602, 599, 109, 611, 613, 603, 601, 432, 601, 602, 437, 611, 675, 697, 603, 686, 109, 605, 574, 574, 574, 614, 615, 614, 602, 616, 617, 616, 703, 603, 607, 445, 607, 605, 606, 440, 606, 596, 585, 109, 675, 697, 597, 686, 291, 574, 586, 448, 586, 581, 284, 622, 619, 289, 582, 291, 703, 620, 623, 294, 623, 619, 622, 624, 459, 624, 620, 623, 294, 623, 619, 622, 624, 459, 624, 620, 625, 166, 625, 619, 622, 296, 464, 627, 620, 289, 289, 464, 628, 630, 632, 468, 632, 633, 630, 636, 637, 636, 634, 639, 109, 633, 289, 638, 640, 649, 634, 632, 468, 632, 633, 638, 650, 694, 240, 634, 641, 642, 641, 633, 813, 739, 809, 289, 634, 574, 643, 154, 643, 575, 574, 574, 574, 574, 576, 574, 574, 574, 574, 574, 574, 694, 835, 574, 574, 574, 574, 574, 474, 474, 646, 646, 846, 109, 847, 647, 647, 652, 653, 652, 654, 657, 657, 658, 658, 655, 836, 848, 659, 659, 835, 685, 574, 574, 574, 574, 154, 154, 575, 575, 154, 289, 575, 576, 576, 289, 154, 576, 575, 154, 154, 575, 575, 576, 836, 109, 576, 576, 685, 574, 154, 109, 575, 660, 688, 662, 154, 576, 575, 154, 494, 575, 494, 576, 109, 661, 576, 700, 146, 663, 736, 676, 665, 676, 664, 737, 109, 666, 678, 668, 678, 660, 688, 662, 669, 667, 109, 680, 497, 680, 497, 684, 661, 495, 700, 496, 663, 109, 109, 665, 109, 664, 320, 679, 682, 666, 687, 668, 109, 109, 677, 681, 669, 667, 109, 498, 109, 683, 683, 684, 495, 690, 496, 499, 109, 689, 109, 109, 705, 109, 704, 679, 109, 693, 687, 691, 695, 677, 109, 681, 692, 699, 109, 498, 701, 698, 109, 109, 109, 690, 499, 109, 702, 689, 109, 705, 109, 704, 109, 706, 109, 693, 109, 691, 695, 709, 711, 109, 692, 699, 109, 701, 707, 698, 710, 708, 714, 109, 713, 712, 702, 109, 715, 109, 109, 109, 109, 706, 109, 109, 717, 109, 709, 109, 711, 720, 721, 726, 719, 707, 718, 710, 708, 716, 714, 713, 712, 109, 109, 109, 715, 109, 109, 724, 109, 728, 722, 727, 717, 723, 725, 109, 109, 720, 721, 726, 719, 718, 109, 730, 716, 109, 741, 244, 741, 742, 240, 729, 109, 109, 109, 724, 728, 739, 722, 727, 731, 723, 725, 734, 732, 733, 741, 244, 741, 742, 713, 730, 745, 398, 745, 742, 848, 109, 729, 744, 393, 744, 746, 573, 746, 161, 320, 731, 320, 848, 734, 732, 751, 733, 570, 571, 570, 713, 745, 398, 745, 742, 746, 573, 746, 154, 161, 748, 753, 280, 753, 754, 749, 751, 756, 276, 756, 753, 280, 753, 754, 757, 448, 757, 754, 756, 276, 756, 758, 445, 758, 757, 448, 757, 754, 154, 759, 748, 264, 264, 763, 763, 760, 289, 273, 764, 764, 289, 289, 761, 761, 766, 269, 766, 767, 154, 761, 748, 428, 428, 464, 296, 749, 788, 109, 769, 769, 791, 789, 761, 761, 771, 432, 771, 772, 766, 269, 766, 767, 774, 440, 774, 767, 776, 610, 776, 771, 432, 771, 772, 777, 615, 777, 772, 778, 617, 778, 774, 440, 774, 767, 758, 445, 758, 776, 610, 776, 779, 780, 779, 777, 615, 777, 772, 778, 617, 778, 784, 294, 784, 782, 785, 459, 785, 784, 294, 784, 782, 785, 459, 785, 786, 166, 786, 782, 793, 468, 793, 794, 464, 796, 637, 796, 796, 637, 796, 791, 793, 468, 793, 794, 797, 642, 797, 794, 798, 799, 798, 797, 642, 797, 794, 747, 800, 154, 800, 748, 747, 747, 747, 747, 749, 747, 747, 747, 747, 747, 747, 109, 109, 747, 747, 747, 747, 747, 474, 474, 803, 803, 649, 109, 109, 804, 804, 649, 814, 806, 808, 653, 808, 809, 806, 811, 812, 811, 808, 653, 808, 809, 747, 747, 747, 747, 815, 816, 815, 809, 657, 821, 818, 824, 825, 824, 826, 819, 822, 154, 657, 748, 818, 657, 289, 818, 749, 819, 273, 747, 819, 154, 154, 748, 748, 154, 838, 748, 749, 749, 289, 154, 749, 748, 827, 109, 289, 154, 749, 748, 154, 657, 748, 818, 749, 109, 828, 749, 819, 109, 830, 676, 849, 676, 838, 839, 829, 839, 853, 678, 831, 678, 827, 834, 832, 841, 843, 841, 843, 109, 680, 833, 680, 640, 828, 861, 857, 109, 830, 852, 849, 840, 850, 829, 679, 853, 109, 109, 831, 640, 677, 834, 832, 109, 681, 842, 109, 109, 833, 844, 860, 851, 861, 857, 109, 858, 855, 852, 856, 840, 850, 863, 679, 109, 109, 109, 854, 677, 859, 109, 872, 109, 681, 842, 864, 109, 844, 109, 860, 851, 865, 109, 858, 109, 855, 856, 867, 109, 862, 863, 869, 109, 866, 854, 868, 109, 859, 291, 872, 109, 874, 864, 109, 109, 870, 109, 873, 109, 865, 876, 109, 875, 871, 877, 867, 862, 878, 109, 869, 866, 879, 868, 881, 109, 880, 109, 882, 109, 874, 884, 109, 870, 885, 109, 873, 887, 109, 876, 875, 871, 109, 877, 109, 889, 878, 109, 883, 879, 886, 881, 109, 880, 888, 890, 882, 891, 884, 109, 109, 893, 885, 109, 109, 887, 892, 895, 320, 899, 320, 897, 894, 889, 291, 883, 289, 886, 146, 1042, 902, 888, 890, 896, 891, 903, 898, 900, 893, 289, 240, 613, 240, 892, 437, 895, 899, 905, 897, 905, 894, 907, 908, 907, 909, 395, 1042, 909, 613, 910, 896, 1043, 910, 898, 900, 912, 913, 912, 915, 244, 915, 909, 396, 914, 396, 839, 910, 839, 437, 914, 443, 914, 916, 393, 916, 917, 398, 917, 909, 1043, 914, 161, 1061, 910, 918, 573, 918, 154, 923, 920, 443, 840, 914, 161, 921, 925, 926, 925, 927, 396, 923, 443, 396, 928, 930, 931, 930, 446, 932, 927, 1061, 109, 932, 443, 928, 933, 280, 933, 927, 840, 932, 109, 109, 928, 934, 276, 934, 935, 448, 935, 927, 109, 932, 1044, 1051, 928, 936, 445, 936, 938, 939, 940, 109, 1175, 932, 289, 941, 943, 944, 943, 945, 938, 264, 940, 948, 928, 428, 273, 946, 949, 1044, 1051, 437, 951, 953, 954, 953, 955, 435, 962, 958, 1175, 956, 428, 457, 959, 960, 269, 960, 958, 951, 964, 965, 964, 959, 612, 289, 955, 289, 966, 613, 437, 956, 967, 432, 967, 955, 966, 962, 613, 289, 956, 968, 440, 968, 958, 966, 969, 610, 969, 959, 970, 615, 970, 955, 966, 971, 617, 971, 956, 972, 780, 972, 284, 962, 974, 291, 291, 966, 109, 975, 1060, 109, 977, 977, 978, 294, 978, 974, 979, 459, 979, 1057, 975, 289, 1059, 464, 977, 980, 166, 980, 974, 296, 985, 982, 1238, 975, 464, 1060, 983, 987, 988, 987, 989, 985, 992, 993, 992, 990, 639, 1057, 989, 1059, 994, 640, 640, 990, 995, 468, 995, 989, 994, 994, 1238, 289, 990, 996, 637, 996, 997, 642, 997, 989, 273, 994, 649, 649, 990, 998, 799, 998, 109, 1005, 1005, 289, 403, 994, 919, 999, 154, 999, 920, 919, 919, 919, 919, 921, 919, 919, 919, 919, 919, 919, 1058, 289, 919, 919, 919, 919, 919, 474, 474, 1002, 1002, 289, 289, 1242, 1003, 1003, 1007, 1008, 1007, 1009, 1012, 1013, 1012, 813, 1010, 1009, 273, 1058, 1014, 109, 1010, 919, 919, 919, 919, 1015, 653, 1015, 1009, 814, 814, 1242, 1069, 1010, 109, 109, 1014, 1014, 1016, 812, 1016, 1017, 816, 1017, 1009, 657, 1014, 1019, 919, 1010, 821, 821, 1020, 1024, 1025, 1024, 1026, 1022, 1022, 1034, 1069, 1027, 1029, 1030, 1029, 1032, 1031, 1026, 109, 109, 1031, 109, 1027, 1033, 825, 1033, 1026, 154, 154, 920, 920, 1027, 109, 289, 921, 921, 657, 154, 1019, 920, 154, 1052, 920, 1020, 921, 457, 154, 921, 920, 154, 154, 920, 920, 921, 109, 1053, 921, 921, 1045, 1054, 1045, 841, 1036, 841, 109, 1047, 1035, 1047, 1052, 843, 1041, 843, 109, 1049, 1038, 1049, 109, 1276, 109, 109, 1037, 1055, 1053, 1063, 1065, 109, 1039, 1054, 1046, 1036, 1040, 842, 1048, 1035, 1056, 109, 109, 1062, 1041, 1064, 109, 1038, 844, 1067, 109, 1276, 289, 1037, 109, 1055, 1063, 1070, 1065, 1039, 1050, 109, 1046, 1040, 109, 842, 1048, 1066, 1056, 1068, 1062, 109, 1064, 1071, 109, 844, 109, 1067, 109, 109, 1073, 109, 1072, 1074, 1070, 1076, 109, 1050, 109, 109, 1079, 109, 1075, 109, 1066, 1077, 1068, 109, 1078, 109, 1071, 109, 1087, 109, 1080, 109, 1081, 1073, 109, 1072, 1083, 1074, 1082, 1076, 1085, 1084, 1090, 109, 1079, 1075, 109, 146, 1077, 902, 1089, 1078, 1086, 1199, 903, 1091, 1087, 1080, 289, 1088, 1081, 289, 240, 1083, 240, 1082, 1174, 1085, 1084, 905, 1090, 905, 1093, 1094, 1093, 909, 273, 1089, 396, 1086, 910, 1199, 289, 1091, 396, 914, 1088, 1095, 1096, 1095, 395, 914, 909, 1174, 403, 914, 289, 910, 907, 908, 907, 909, 1097, 1098, 1097, 909, 910, 912, 913, 912, 910, 1099, 1100, 1099, 273, 914, 916, 393, 916, 914, 915, 244, 915, 909, 914, 918, 573, 918, 910, 917, 398, 917, 909, 914, 154, 161, 920, 910, 289, 1176, 161, 921, 923, 1101, 1102, 1101, 927, 923, 1103, 1104, 1103, 928, 446, 273, 927, 109, 932, 443, 443, 928, 925, 926, 925, 927, 932, 932, 1176, 109, 928, 1105, 1106, 1105, 927, 930, 931, 930, 1186, 928, 1107, 1108, 1107, 932, 933, 280, 933, 927, 932, 934, 276, 934, 928, 935, 448, 935, 927, 932, 936, 445, 936, 928, 938, 193, 940, 1186, 932, 1110, 1122, 946, 938, 939, 940, 109, 1111, 932, 428, 941, 1113, 1114, 1113, 1115, 1117, 951, 945, 1188, 1116, 189, 428, 928, 943, 944, 943, 945, 1119, 951, 1120, 1184, 928, 1281, 613, 288, 1124, 1125, 1124, 1126, 264, 966, 948, 289, 1127, 273, 1188, 949, 1128, 1129, 1128, 955, 1130, 1131, 1130, 612, 956, 955, 1184, 144, 966, 1281, 956, 953, 954, 953, 955, 1132, 1133, 1132, 955, 956, 435, 437, 958, 956, 109, 109, 1288, 959, 962, 1134, 1135, 1134, 958, 960, 269, 960, 958, 959, 437, 613, 111, 959, 1136, 1137, 1136, 962, 966, 964, 965, 964, 962, 1138, 1139, 1138, 1288, 966, 109, 193, 190, 966, 967, 432, 967, 955, 968, 440, 968, 958, 956, 969, 610, 969, 959, 970, 615, 970, 955, 966, 971, 617, 971, 956, 972, 780, 972, 284, 962, 974, 291, 189, 966, 144, 975, 291, 109, 977, 1140, 1141, 1140, 974, 977, 1142, 1143, 1142, 975, 978, 294, 978, 974, 977, 979, 459, 979, 975, 980, 166, 980, 974, 977, 296, 464, 982, 975, 1367, 1249, 464, 983, 985, 1144, 1145, 1144, 989, 985, 1146, 1147, 1146, 990, 639, 104, 989, 109, 994, 640, 640, 990, 987, 988, 987, 989, 994, 994, 1249, 104, 990, 1148, 1149, 1148, 989, 992, 993, 992, 1189, 990, 1150, 1151, 1150, 994, 995, 468, 995, 989, 994, 996, 637, 996, 990, 997, 642, 997, 989, 994, 998, 799, 998, 990, 75, 75, 99, 1189, 994, 919, 999, 154, 999, 920, 919, 919, 919, 919, 921, 919, 919, 919, 919, 919, 919, 96, 77, 919, 919, 919, 919, 919, 474, 474, 1002, 1002, 649, 75, 75, 1003, 1003, 649, 814, 1005, 1152, 1153, 1152, 1009, 1005, 1014, 41, 109, 1010, 1154, 1155, 1154, 919, 919, 919, 919, 813, 1014, 1009, 1007, 1008, 1007, 1009, 1010, 1190, 814, 1367, 1010, 1156, 1157, 1156, 1009, 1014, 1012, 1013, 1012, 1010, 1367, 1365, 919, 1304, 1014, 1158, 1159, 1158, 1015, 653, 1015, 1009, 1367, 1014, 1190, 1367, 1010, 1016, 812, 1016, 1017, 816, 1017, 1009, 657, 1014, 1019, 821, 1010, 1365, 1304, 1020, 821, 1367, 1022, 1160, 1161, 1160, 1026, 1022, 1162, 1163, 1162, 1027, 1032, 1367, 1026, 1367, 1031, 1034, 1034, 1027, 1024, 1025, 1024, 1026, 1031, 1031, 1367, 109, 1027, 1164, 1165, 1164, 1026, 1029, 1030, 1029, 1182, 1027, 1166, 1167, 1166, 1031, 1033, 825, 1033, 1026, 1031, 154, 1367, 920, 1027, 154, 1367, 920, 921, 657, 1367, 1019, 921, 154, 109, 920, 1020, 154, 1182, 920, 921, 154, 1195, 920, 921, 154, 1168, 920, 921, 1045, 1110, 1045, 921, 1177, 1047, 1177, 1047, 1111, 1179, 1049, 1179, 1049, 109, 1169, 109, 109, 1172, 1367, 109, 1183, 1195, 1170, 1171, 1185, 1168, 1181, 109, 1173, 1194, 1046, 1178, 1048, 109, 1180, 109, 1191, 109, 1187, 109, 109, 1169, 109, 1367, 1193, 1172, 1196, 1202, 1183, 1170, 1171, 1050, 1185, 1192, 1181, 1173, 1197, 1194, 1046, 1178, 1048, 109, 1180, 109, 1191, 109, 1187, 109, 109, 109, 1200, 109, 1193, 1201, 1196, 1202, 1198, 1204, 1050, 109, 1192, 109, 109, 1197, 109, 109, 109, 109, 1206, 109, 1203, 1213, 1205, 1209, 1210, 1211, 109, 109, 1200, 1207, 1215, 1201, 109, 1208, 1198, 1204, 1214, 1093, 1094, 1093, 909, 1212, 1345, 1223, 1216, 910, 1206, 1203, 1213, 1205, 1224, 1209, 1210, 1211, 1367, 109, 1207, 1215, 1228, 1122, 1208, 1095, 1096, 1095, 1214, 456, 932, 1367, 1212, 914, 1345, 1216, 1097, 1098, 1097, 909, 1099, 1100, 1099, 1248, 910, 1103, 1104, 1103, 914, 1101, 1102, 1101, 927, 932, 1107, 1108, 1107, 928, 1105, 1106, 1105, 927, 932, 1218, 1219, 1218, 928, 1221, 109, 1115, 1248, 1220, 1367, 1253, 1116, 1113, 1114, 1113, 1115, 1225, 1226, 1225, 1115, 1116, 1119, 1367, 1120, 1116, 1119, 1367, 1120, 288, 1119, 1232, 1120, 288, 1231, 1367, 1126, 288, 1220, 1253, 1367, 1127, 1124, 1125, 1124, 1126, 1233, 1234, 1233, 1126, 1127, 1130, 1131, 1130, 1127, 1128, 1129, 1128, 955, 966, 1307, 1308, 1307, 956, 1132, 1133, 1132, 955, 1134, 1135, 1134, 958, 956, 1136, 1137, 1136, 959, 1138, 1139, 1138, 1280, 962, 1142, 1143, 1142, 966, 1140, 1141, 1140, 974, 977, 1146, 1147, 1146, 975, 1144, 1145, 1144, 989, 994, 1150, 1151, 1150, 990, 1148, 1149, 1148, 989, 994, 1154, 1155, 1154, 990, 1152, 1153, 1152, 1009, 1014, 1158, 1159, 1158, 1010, 1156, 1157, 1156, 1009, 1014, 1162, 1163, 1162, 1010, 1160, 1161, 1160, 1026, 1031, 1166, 1167, 1166, 1027, 1164, 1165, 1164, 1026, 1031, 154, 1367, 920, 1027, 154, 1367, 920, 921, 657, 1367, 1019, 921, 154, 1367, 920, 1020, 657, 109, 1019, 921, 657, 1235, 1019, 1020, 1239, 109, 1239, 1020, 1240, 1177, 1179, 1177, 1179, 1236, 1243, 1245, 1243, 109, 109, 109, 109, 1246, 1241, 109, 109, 1254, 109, 1250, 109, 1235, 1252, 1367, 1237, 109, 1247, 1180, 1178, 109, 109, 1251, 1244, 1236, 1245, 1255, 109, 1256, 1367, 1261, 1246, 1257, 1367, 1367, 1258, 1254, 1259, 1250, 1367, 1260, 1252, 1237, 109, 1247, 109, 1180, 1178, 109, 1251, 1262, 1244, 1263, 109, 1255, 1256, 109, 1261, 1367, 1232, 1257, 109, 1258, 109, 1259, 1265, 1220, 1260, 109, 1264, 1266, 1367, 1267, 1218, 1219, 1218, 1268, 1367, 1262, 1223, 1263, 1220, 1269, 1270, 1269, 1228, 1224, 1271, 1272, 1271, 1220, 1285, 456, 1265, 1367, 1224, 1264, 1367, 1266, 109, 1267, 1367, 1367, 1268, 1225, 1226, 1225, 1115, 1233, 1234, 1233, 1126, 1116, 154, 109, 920, 1127, 154, 1285, 920, 921, 154, 1286, 920, 921, 1239, 109, 1239, 921, 1240, 1243, 1282, 1243, 1282, 109, 1283, 109, 1292, 109, 109, 1284, 109, 1287, 1241, 109, 109, 1273, 109, 1296, 1286, 1290, 109, 1274, 1309, 1289, 1294, 1244, 1291, 109, 1275, 109, 1293, 1367, 1295, 1292, 109, 1314, 1298, 1297, 1287, 109, 1299, 1367, 1273, 1301, 1367, 1296, 1290, 1367, 1274, 1309, 1289, 1294, 1300, 1244, 1291, 1275, 1367, 1293, 1302, 1295, 1367, 1367, 1314, 1298, 1297, 1269, 1270, 1269, 1299, 109, 657, 1301, 1019, 1220, 1271, 1272, 1271, 1020, 1312, 1300, 109, 154, 1224, 920, 657, 1302, 1019, 109, 921, 109, 109, 1020, 1305, 1306, 1305, 1282, 1278, 1282, 1316, 1283, 109, 109, 1367, 1313, 1284, 1319, 1312, 109, 109, 109, 1315, 109, 1317, 109, 109, 1303, 1318, 1320, 1321, 109, 1322, 109, 1367, 1367, 1367, 1326, 1316, 1324, 109, 1325, 1313, 1323, 1367, 1319, 657, 1332, 1019, 1315, 109, 1317, 1331, 1020, 1303, 109, 1318, 1320, 1321, 1336, 1322, 1305, 1306, 1305, 1326, 1278, 109, 1324, 1334, 1325, 1323, 1307, 1308, 1307, 1332, 1335, 109, 1333, 109, 1331, 1339, 1340, 109, 1341, 1342, 1341, 1336, 1329, 1343, 1344, 1343, 1280, 109, 109, 109, 1349, 1334, 1330, 1367, 1367, 1337, 1338, 1367, 1335, 1333, 1356, 109, 1339, 1340, 1357, 1367, 1346, 1347, 109, 1348, 1341, 1342, 1341, 1352, 1329, 1343, 1344, 1343, 1349, 1353, 109, 109, 1337, 1338, 1330, 109, 109, 1356, 1366, 1354, 1360, 1357, 1358, 1346, 1347, 1359, 1348, 1367, 1361, 1355, 1362, 1352, 109, 1367, 1367, 1367, 1353, 1367, 1363, 1367, 1367, 1364, 1367, 1367, 1367, 1367, 1366, 1354, 1360, 1367, 1358, 1367, 1367, 1359, 1367, 1361, 1355, 1367, 1362, 1367, 1367, 1367, 1367, 1367, 1367, 1363, 1367, 1367, 1367, 1364, 39, 39, 39, 39, 39, 39, 39, 39, 42, 42, 42, 42, 42, 42, 42, 42, 60, 60, 60, 60, 60, 60, 60, 60, 64, 64, 64, 64, 64, 64, 64, 64, 68, 68, 68, 68, 68, 68, 68, 68, 74, 74, 74, 74, 74, 74, 74, 74, 76, 76, 76, 76, 76, 76, 76, 76, 78, 78, 78, 78, 78, 78, 78, 78, 87, 87, 87, 87, 87, 87, 87, 87, 95, 95, 95, 95, 95, 95, 95, 95, 98, 98, 98, 98, 98, 98, 98, 98, 102, 102, 102, 102, 102, 102, 102, 102, 103, 103, 103, 103, 103, 103, 103, 103, 108, 108, 112, 1367, 112, 112, 143, 143, 143, 143, 143, 143, 143, 143, 145, 145, 145, 145, 145, 145, 145, 145, 149, 149, 149, 149, 149, 149, 149, 149, 157, 157, 157, 157, 157, 157, 157, 157, 160, 160, 160, 160, 160, 160, 160, 160, 153, 153, 153, 153, 153, 153, 153, 153, 164, 164, 164, 164, 164, 164, 164, 164, 194, 194, 194, 194, 194, 194, 1367, 194, 195, 195, 195, 195, 195, 1367, 195, 195, 110, 1367, 110, 111, 1367, 111, 233, 233, 233, 233, 233, 233, 233, 233, 236, 236, 236, 236, 236, 236, 236, 236, 239, 239, 239, 239, 239, 239, 239, 239, 242, 242, 242, 242, 242, 242, 242, 242, 247, 247, 247, 247, 247, 247, 247, 247, 250, 250, 250, 250, 250, 250, 250, 250, 254, 254, 254, 254, 254, 254, 254, 254, 258, 258, 258, 258, 258, 258, 258, 258, 261, 261, 261, 261, 261, 261, 261, 261, 263, 263, 263, 263, 263, 263, 263, 263, 267, 267, 267, 267, 267, 267, 267, 267, 272, 272, 272, 272, 272, 272, 272, 272, 274, 274, 274, 274, 274, 274, 274, 274, 278, 278, 278, 278, 278, 278, 278, 278, 283, 283, 283, 283, 283, 283, 283, 283, 288, 288, 288, 288, 288, 288, 288, 288, 290, 290, 290, 290, 290, 290, 290, 290, 295, 295, 295, 295, 295, 295, 295, 295, 300, 300, 300, 300, 300, 300, 300, 300, 194, 194, 194, 194, 194, 194, 1367, 194, 377, 377, 377, 377, 377, 377, 377, 377, 380, 380, 380, 380, 380, 380, 380, 380, 382, 382, 382, 382, 382, 382, 382, 382, 386, 386, 386, 386, 386, 386, 386, 386, 391, 391, 391, 391, 391, 391, 391, 391, 399, 399, 399, 399, 399, 399, 399, 399, 404, 404, 404, 404, 404, 404, 404, 404, 407, 407, 407, 407, 407, 407, 407, 407, 409, 409, 409, 409, 409, 409, 409, 409, 414, 414, 414, 414, 414, 414, 414, 414, 417, 417, 417, 417, 417, 417, 417, 417, 420, 420, 420, 420, 420, 420, 420, 420, 424, 424, 424, 424, 424, 424, 424, 424, 427, 427, 427, 427, 427, 427, 427, 427, 430, 430, 430, 430, 430, 430, 430, 430, 436, 436, 436, 436, 436, 436, 436, 436, 449, 449, 449, 449, 449, 449, 449, 449, 452, 452, 452, 452, 452, 452, 452, 452, 456, 456, 456, 456, 456, 456, 456, 456, 460, 460, 460, 460, 460, 460, 460, 460, 463, 463, 463, 463, 463, 463, 463, 463, 466, 466, 466, 466, 466, 466, 466, 466, 472, 472, 472, 472, 472, 472, 472, 472, 473, 473, 473, 473, 473, 473, 473, 473, 108, 108, 557, 557, 557, 557, 557, 557, 557, 557, 560, 560, 560, 560, 560, 560, 560, 560, 562, 562, 562, 562, 562, 562, 562, 562, 566, 566, 566, 566, 566, 566, 566, 566, 386, 386, 386, 386, 386, 386, 386, 386, 399, 399, 399, 399, 399, 399, 399, 399, 574, 574, 574, 574, 574, 574, 574, 574, 577, 577, 577, 577, 577, 577, 577, 577, 579, 579, 579, 579, 579, 579, 579, 579, 583, 583, 583, 583, 583, 583, 583, 583, 588, 588, 588, 588, 588, 588, 588, 588, 591, 591, 591, 591, 591, 591, 591, 591, 594, 594, 594, 594, 594, 594, 594, 594, 598, 598, 598, 598, 598, 598, 598, 598, 600, 600, 600, 600, 600, 600, 600, 600, 604, 604, 604, 604, 604, 604, 604, 604, 608, 608, 608, 608, 608, 608, 608, 608, 618, 618, 618, 618, 618, 618, 618, 618, 621, 621, 621, 621, 621, 621, 621, 621, 626, 626, 626, 626, 626, 626, 626, 626, 629, 629, 629, 629, 629, 629, 629, 629, 631, 631, 631, 631, 631, 631, 631, 631, 635, 635, 635, 635, 635, 635, 635, 635, 644, 644, 644, 644, 644, 644, 644, 644, 645, 645, 645, 645, 645, 645, 645, 645, 236, 236, 236, 236, 236, 236, 236, 236, 648, 648, 648, 648, 648, 648, 648, 648, 651, 651, 651, 651, 651, 651, 651, 651, 656, 656, 656, 656, 656, 656, 656, 656, 574, 574, 574, 574, 574, 574, 574, 574, 108, 108, 735, 735, 735, 735, 735, 735, 735, 735, 738, 738, 738, 738, 738, 738, 738, 738, 740, 740, 740, 740, 740, 740, 740, 740, 743, 743, 743, 743, 743, 743, 743, 743, 747, 747, 747, 747, 747, 747, 747, 747, 750, 750, 750, 750, 750, 750, 750, 750, 752, 752, 752, 752, 752, 752, 752, 752, 755, 755, 755, 755, 755, 755, 755, 755, 762, 762, 762, 762, 762, 762, 762, 762, 765, 765, 765, 765, 765, 765, 765, 765, 768, 768, 768, 768, 768, 768, 768, 768, 770, 770, 770, 770, 770, 770, 770, 770, 773, 773, 773, 773, 773, 773, 773, 773, 775, 775, 775, 775, 775, 775, 775, 775, 781, 781, 781, 781, 781, 781, 781, 781, 783, 783, 783, 783, 783, 783, 783, 783, 787, 787, 787, 787, 787, 787, 787, 787, 790, 790, 790, 790, 790, 790, 790, 790, 792, 792, 792, 792, 792, 792, 792, 792, 795, 795, 795, 795, 795, 795, 795, 795, 801, 801, 801, 801, 801, 801, 801, 801, 802, 802, 802, 802, 802, 802, 802, 802, 805, 805, 805, 805, 805, 805, 805, 805, 807, 807, 807, 807, 807, 807, 807, 807, 272, 272, 272, 272, 272, 272, 272, 272, 810, 810, 810, 810, 810, 810, 810, 810, 817, 817, 817, 817, 817, 817, 817, 817, 236, 236, 236, 236, 236, 236, 236, 236, 820, 820, 820, 820, 820, 820, 820, 820, 823, 823, 823, 823, 823, 823, 823, 823, 845, 845, 845, 845, 845, 845, 845, 108, 108, 901, 901, 901, 901, 901, 901, 901, 901, 904, 904, 904, 904, 904, 904, 904, 904, 906, 906, 906, 906, 906, 906, 906, 906, 911, 911, 911, 911, 911, 911, 911, 911, 919, 919, 919, 919, 919, 919, 919, 919, 922, 922, 922, 922, 922, 922, 922, 922, 924, 924, 924, 924, 924, 924, 924, 924, 929, 929, 929, 929, 929, 929, 929, 929, 937, 937, 937, 937, 937, 937, 937, 937, 942, 942, 942, 942, 942, 942, 942, 942, 947, 947, 947, 947, 947, 947, 947, 947, 950, 950, 950, 950, 950, 950, 950, 950, 952, 952, 952, 952, 952, 952, 952, 952, 957, 957, 957, 957, 957, 957, 957, 957, 961, 961, 961, 961, 961, 961, 961, 961, 963, 963, 963, 963, 963, 963, 963, 963, 973, 973, 973, 973, 973, 973, 973, 973, 976, 976, 976, 976, 976, 976, 976, 976, 981, 981, 981, 981, 981, 981, 981, 981, 984, 984, 984, 984, 984, 984, 984, 984, 986, 986, 986, 986, 986, 986, 986, 986, 991, 991, 991, 991, 991, 991, 991, 991, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 288, 288, 288, 288, 288, 288, 288, 288, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 272, 272, 272, 272, 272, 272, 272, 272, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 919, 919, 919, 919, 919, 919, 919, 919, 108, 108, 901, 901, 901, 901, 901, 901, 901, 901, 904, 904, 904, 904, 904, 904, 904, 904, 906, 906, 906, 906, 906, 906, 906, 906, 911, 911, 911, 911, 911, 911, 911, 911, 922, 922, 922, 922, 922, 922, 922, 922, 924, 924, 924, 924, 924, 924, 924, 924, 929, 929, 929, 929, 929, 929, 929, 929, 937, 937, 937, 937, 937, 937, 937, 937, 236, 236, 236, 236, 236, 236, 236, 236, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 942, 942, 942, 942, 942, 942, 942, 942, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 947, 947, 947, 947, 947, 947, 947, 947, 950, 950, 950, 950, 950, 950, 950, 950, 952, 952, 952, 952, 952, 952, 952, 952, 963, 963, 963, 963, 963, 963, 963, 963, 957, 957, 957, 957, 957, 957, 957, 957, 961, 961, 961, 961, 961, 961, 961, 961, 973, 973, 973, 973, 973, 973, 973, 973, 976, 976, 976, 976, 976, 976, 976, 976, 981, 981, 981, 981, 981, 981, 981, 981, 984, 984, 984, 984, 984, 984, 984, 984, 986, 986, 986, 986, 986, 986, 986, 986, 991, 991, 991, 991, 991, 991, 991, 991, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1001, 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 919, 919, 919, 919, 919, 919, 919, 919, 108, 108, 906, 906, 906, 906, 906, 906, 906, 906, 911, 911, 911, 911, 911, 911, 911, 911, 924, 924, 924, 924, 924, 924, 924, 924, 929, 929, 929, 929, 929, 929, 929, 929, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 272, 272, 272, 272, 272, 272, 272, 272, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1217, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1227, 1227, 1227, 1227, 1227, 1227, 1227, 1227, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1229, 1229, 1229, 1367, 1229, 1229, 1229, 1229, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 952, 952, 952, 952, 952, 952, 952, 952, 963, 963, 963, 963, 963, 963, 963, 963, 957, 957, 957, 957, 957, 957, 957, 957, 961, 961, 961, 961, 961, 961, 961, 961, 973, 973, 973, 973, 973, 973, 973, 973, 976, 976, 976, 976, 976, 976, 976, 976, 986, 986, 986, 986, 986, 986, 986, 986, 991, 991, 991, 991, 991, 991, 991, 991, 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 919, 919, 919, 919, 919, 919, 919, 919, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 1018, 108, 108, 1277, 1367, 1277, 1277, 1277, 1277, 1277, 1277, 1279, 1367, 1279, 1279, 1279, 1279, 1279, 1279, 1310, 1367, 1310, 1310, 1310, 1310, 1310, 1310, 1311, 1367, 1311, 1311, 1311, 1311, 1311, 1311, 33, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367 } ; static const flex_int16_t yy_chk[6416] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 11, 10, 12, 7, 23, 23, 23, 23, 9, 9, 10, 10, 28, 28, 28, 28, 7, 38, 38, 42, 42, 36, 81, 1, 1, 1, 1, 107, 107, 81, 42, 7, 15, 16, 36, 36, 250, 78, 250, 78, 1364, 15, 16, 7, 78, 11, 11, 12, 12, 8, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 8, 13, 14, 15, 16, 44, 53, 79, 1359, 79, 13, 14, 117, 8, 79, 53, 82, 117, 82, 13, 14, 44, 147, 82, 2, 2, 2, 2, 8, 147, 46, 145, 17, 145, 17, 151, 17, 17, 145, 1354, 8, 17, 151, 53, 17, 117, 13, 14, 44, 46, 1353, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 43, 46, 17, 18, 50, 18, 43, 18, 18, 112, 112, 88, 18, 88, 88, 18, 91, 1347, 91, 91, 112, 91, 43, 50, 3, 3, 3, 3, 1340, 17, 83, 83, 83, 83, 43, 146, 1339, 91, 83, 100, 146, 100, 100, 152, 152, 152, 152, 1335, 18, 43, 50, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 18, 150, 47, 90, 51, 90, 150, 24, 24, 24, 24, 26, 24, 26, 48, 52, 124, 57, 47, 24, 47, 1333, 26, 51, 4, 4, 4, 4, 24, 57, 90, 24, 1322, 48, 26, 1321, 52, 124, 48, 52, 106, 85, 92, 85, 92, 47, 54, 47, 85, 56, 51, 4, 5, 106, 106, 54, 1320, 57, 90, 24, 48, 85, 26, 52, 124, 48, 52, 120, 92, 49, 54, 56, 92, 5, 5, 5, 5, 5, 5, 49, 120, 5, 1319, 54, 5, 5, 49, 49, 5, 5, 5, 5, 5, 93, 5, 93, 92, 54, 56, 129, 92, 5, 5, 5, 5, 5, 5, 49, 120, 5, 129, 5, 5, 49, 49, 5, 5, 5, 5, 5, 93, 5, 22, 22, 22, 59, 22, 118, 1318, 22, 113, 55, 118, 22, 59, 45, 22, 22, 129, 58, 45, 180, 22, 55, 1315, 22, 22, 45, 93, 59, 55, 45, 113, 154, 45, 58, 45, 58, 154, 55, 118, 1313, 59, 114, 148, 148, 148, 148, 45, 180, 1311, 55, 148, 22, 22, 45, 59, 55, 45, 113, 1310, 45, 58, 45, 58, 114, 55, 80, 80, 80, 80, 80, 80, 80, 80, 115, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 116, 119, 114, 133, 115, 125, 130, 135, 133, 156, 133, 122, 236, 135, 130, 188, 156, 236, 119, 119, 122, 1309, 116, 125, 80, 80, 80, 149, 153, 149, 153, 115, 1304, 122, 149, 153, 133, 157, 133, 157, 160, 135, 130, 188, 157, 119, 119, 160, 122, 116, 125, 80, 84, 84, 84, 84, 84, 84, 84, 84, 122, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 132, 121, 127, 167, 131, 121, 136, 128, 214, 139, 167, 123, 121, 214, 128, 136, 134, 138, 139, 123, 206, 132, 127, 131, 84, 84, 84, 1295, 264, 121, 128, 121, 134, 264, 123, 123, 140, 138, 207, 206, 121, 214, 128, 136, 207, 140, 139, 123, 132, 127, 131, 84, 86, 86, 86, 86, 121, 128, 121, 134, 86, 123, 123, 141, 138, 1294, 206, 142, 162, 162, 162, 141, 207, 140, 86, 164, 162, 164, 142, 1286, 313, 86, 164, 142, 231, 86, 141, 141, 86, 169, 86, 169, 158, 158, 158, 158, 169, 86, 1279, 141, 158, 177, 86, 177, 177, 190, 142, 190, 313, 86, 142, 231, 86, 141, 141, 86, 191, 86, 191, 191, 190, 190, 1277, 1268, 86, 155, 155, 155, 155, 155, 155, 155, 155, 1267, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 163, 163, 163, 163, 165, 165, 165, 165, 163, 193, 193, 193, 165, 168, 168, 168, 168, 185, 296, 185, 320, 168, 320, 296, 155, 155, 155, 172, 233, 172, 233, 175, 234, 175, 172, 233, 474, 1266, 175, 234, 237, 474, 198, 171, 185, 171, 185, 237, 172, 198, 171, 155, 159, 159, 159, 159, 159, 159, 159, 159, 175, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 171, 172, 198, 186, 217, 209, 171, 181, 199, 181, 181, 186, 181, 175, 178, 1265, 178, 199, 1259, 311, 217, 179, 209, 179, 159, 159, 159, 171, 181, 1247, 1241, 186, 239, 171, 235, 235, 235, 235, 186, 239, 315, 178, 235, 245, 1240, 199, 311, 217, 179, 209, 245, 159, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 315, 178, 170, 170, 170, 170, 170, 173, 179, 173, 182, 174, 182, 174, 173, 176, 322, 176, 174, 1234, 196, 184, 176, 184, 189, 187, 189, 187, 173, 322, 322, 170, 170, 170, 170, 174, 182, 202, 176, 201, 182, 208, 173, 196, 174, 174, 197, 184, 1231, 337, 189, 184, 187, 208, 189, 200, 173, 202, 170, 197, 203, 201, 204, 174, 182, 197, 176, 205, 182, 173, 196, 174, 174, 200, 213, 184, 200, 337, 189, 184, 187, 208, 189, 203, 202, 204, 205, 197, 201, 210, 212, 213, 197, 218, 215, 205, 316, 216, 210, 1230, 200, 215, 218, 200, 219, 222, 225, 220, 223, 247, 203, 212, 204, 205, 222, 225, 247, 219, 213, 228, 657, 216, 224, 316, 223, 657, 210, 211, 228, 215, 218, 220, 211, 211, 211, 211, 211, 211, 212, 562, 211, 562, 222, 225, 211, 219, 224, 211, 216, 211, 211, 223, 232, 211, 227, 1229, 228, 230, 220, 221, 211, 211, 211, 211, 211, 211, 221, 226, 211, 232, 221, 211, 227, 224, 211, 900, 211, 211, 230, 900, 211, 249, 249, 249, 226, 241, 241, 241, 226, 238, 238, 238, 238, 241, 221, 242, 232, 242, 221, 227, 1228, 1226, 242, 255, 1221, 230, 243, 243, 243, 243, 255, 226, 1214, 325, 243, 226, 246, 246, 246, 246, 251, 251, 251, 251, 246, 254, 261, 254, 256, 256, 256, 256, 254, 261, 325, 1211, 256, 257, 257, 257, 257, 257, 257, 257, 257, 1210, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, 258, 325, 258, 259, 259, 259, 259, 258, 262, 262, 262, 259, 263, 265, 263, 267, 262, 267, 488, 263, 265, 336, 267, 492, 257, 257, 257, 266, 266, 266, 266, 268, 268, 268, 268, 266, 270, 274, 281, 268, 273, 273, 273, 270, 274, 281, 488, 579, 336, 579, 492, 257, 260, 260, 260, 260, 260, 260, 260, 260, 1206, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 260, 271, 271, 271, 271, 275, 275, 275, 333, 271, 277, 277, 277, 275, 278, 283, 278, 283, 277, 1203, 1200, 278, 283, 328, 333, 260, 260, 260, 279, 279, 279, 279, 282, 282, 282, 282, 279, 285, 328, 594, 282, 594, 290, 297, 285, 286, 286, 286, 286, 290, 297, 333, 260, 286, 287, 287, 287, 287, 292, 292, 292, 321, 287, 321, 1197, 328, 292, 293, 293, 293, 293, 295, 600, 295, 600, 293, 321, 321, 295, 298, 298, 298, 298, 388, 388, 388, 1193, 298, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 1192, 489, 299, 299, 299, 299, 299, 300, 301, 300, 301, 302, 1186, 302, 300, 301, 312, 303, 302, 303, 306, 304, 306, 304, 303, 312, 1183, 306, 304, 489, 329, 299, 299, 299, 299, 305, 302, 305, 329, 307, 301, 307, 305, 308, 312, 308, 307, 1182, 1165, 306, 308, 303, 312, 309, 317, 309, 317, 938, 299, 304, 309, 310, 938, 310, 302, 331, 329, 301, 310, 319, 331, 319, 307, 305, 326, 307, 335, 306, 303, 330, 317, 318, 308, 318, 317, 326, 304, 327, 332, 335, 330, 1161, 309, 310, 327, 339, 319, 338, 331, 307, 305, 334, 307, 1157, 319, 343, 334, 355, 317, 308, 332, 339, 317, 326, 318, 338, 318, 335, 330, 309, 310, 341, 327, 340, 319, 345, 342, 343, 344, 346, 341, 319, 347, 1153, 334, 355, 340, 332, 339, 342, 350, 318, 338, 318, 344, 349, 345, 351, 346, 354, 347, 358, 342, 1149, 343, 349, 352, 348, 341, 350, 353, 354, 355, 349, 340, 352, 357, 342, 351, 353, 359, 344, 360, 345, 358, 346, 348, 347, 362, 342, 352, 348, 357, 349, 363, 362, 350, 369, 353, 354, 349, 359, 1145, 352, 369, 351, 360, 353, 365, 361, 363, 358, 364, 348, 368, 370, 1141, 352, 348, 357, 361, 364, 371, 362, 373, 353, 1135, 374, 359, 365, 361, 373, 369, 360, 370, 368, 374, 363, 376, 378, 1133, 371, 375, 377, 373, 377, 378, 376, 361, 364, 377, 375, 379, 379, 379, 379, 365, 361, 380, 1129, 379, 370, 368, 1125, 374, 380, 375, 490, 371, 381, 381, 381, 373, 384, 382, 376, 382, 381, 1122, 375, 384, 382, 383, 383, 383, 383, 385, 385, 385, 385, 383, 386, 1114, 375, 385, 490, 391, 501, 386, 389, 389, 389, 389, 391, 392, 392, 392, 394, 394, 394, 501, 501, 392, 1110, 1106, 394, 397, 397, 397, 397, 400, 400, 400, 404, 397, 404, 405, 441, 441, 441, 404, 407, 1102, 405, 406, 406, 406, 406, 407, 408, 408, 408, 406, 409, 618, 409, 618, 408, 411, 418, 409, 410, 410, 410, 410, 411, 418, 422, 424, 410, 412, 412, 412, 412, 422, 424, 513, 1098, 412, 413, 413, 413, 413, 413, 413, 413, 413, 491, 413, 413, 413, 413, 413, 413, 413, 413, 413, 413, 413, 413, 413, 413, 414, 513, 414, 415, 415, 415, 415, 414, 417, 1094, 417, 415, 631, 491, 631, 417, 420, 674, 420, 419, 419, 419, 419, 420, 413, 413, 413, 419, 421, 421, 421, 421, 423, 423, 423, 423, 421, 425, 425, 425, 423, 426, 426, 426, 674, 425, 561, 561, 561, 426, 1080, 413, 416, 416, 416, 416, 416, 416, 416, 416, 1079, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 416, 427, 429, 429, 429, 430, 1059, 430, 427, 504, 429, 433, 430, 431, 431, 431, 431, 436, 433, 493, 514, 431, 504, 520, 436, 416, 416, 416, 434, 434, 434, 434, 438, 438, 438, 520, 434, 444, 444, 444, 438, 439, 439, 439, 439, 444, 1058, 493, 514, 439, 504, 450, 416, 447, 447, 447, 447, 449, 450, 449, 1032, 447, 452, 520, 449, 451, 451, 451, 451, 452, 453, 453, 453, 451, 454, 454, 454, 454, 453, 458, 458, 458, 454, 455, 455, 455, 455, 458, 460, 461, 460, 455, 1025, 1008, 463, 460, 461, 462, 462, 462, 462, 463, 465, 465, 465, 462, 466, 511, 466, 988, 465, 469, 475, 466, 467, 467, 467, 467, 469, 475, 511, 558, 467, 470, 470, 470, 470, 651, 558, 651, 954, 470, 471, 471, 471, 471, 471, 471, 471, 471, 471, 471, 471, 471, 471, 471, 471, 471, 511, 670, 471, 471, 471, 471, 471, 472, 473, 472, 473, 682, 503, 682, 472, 473, 476, 476, 476, 476, 477, 478, 477, 478, 476, 673, 682, 477, 478, 670, 503, 471, 471, 471, 471, 479, 480, 479, 480, 481, 926, 481, 479, 480, 908, 482, 481, 482, 483, 484, 483, 484, 482, 673, 506, 483, 484, 503, 471, 486, 517, 486, 479, 506, 481, 485, 486, 485, 487, 494, 487, 494, 485, 893, 480, 487, 517, 557, 482, 557, 495, 484, 495, 483, 557, 888, 485, 496, 486, 496, 479, 506, 481, 487, 485, 502, 499, 497, 499, 497, 502, 480, 494, 517, 494, 482, 886, 505, 484, 885, 483, 500, 496, 500, 485, 505, 486, 521, 522, 495, 499, 487, 485, 508, 497, 507, 500, 500, 502, 494, 508, 494, 497, 510, 507, 518, 509, 522, 512, 521, 496, 516, 510, 505, 509, 512, 495, 515, 499, 509, 516, 519, 497, 518, 515, 523, 527, 525, 508, 497, 529, 519, 507, 526, 522, 882, 521, 530, 523, 531, 510, 532, 509, 512, 527, 530, 881, 509, 516, 533, 518, 525, 515, 529, 526, 533, 534, 532, 531, 519, 536, 534, 535, 538, 539, 540, 523, 541, 546, 536, 871, 527, 548, 530, 540, 541, 546, 539, 525, 538, 529, 526, 535, 533, 532, 531, 542, 544, 543, 534, 545, 547, 544, 549, 548, 542, 547, 536, 543, 545, 550, 551, 540, 541, 546, 539, 538, 553, 550, 535, 556, 559, 559, 559, 559, 560, 549, 865, 857, 555, 544, 548, 560, 542, 547, 551, 543, 545, 556, 553, 555, 563, 563, 563, 563, 555, 550, 565, 565, 565, 565, 683, 856, 549, 567, 567, 567, 568, 568, 568, 575, 846, 551, 846, 683, 556, 553, 575, 555, 570, 570, 570, 555, 569, 569, 569, 569, 572, 572, 572, 574, 577, 574, 576, 576, 576, 576, 574, 577, 578, 578, 578, 580, 580, 580, 580, 582, 582, 582, 582, 584, 584, 584, 585, 585, 585, 586, 586, 586, 586, 587, 587, 587, 588, 591, 588, 591, 587, 825, 821, 588, 591, 816, 813, 587, 587, 589, 589, 589, 589, 590, 590, 590, 592, 598, 627, 626, 590, 626, 732, 592, 598, 627, 626, 590, 590, 593, 593, 593, 593, 595, 595, 595, 595, 597, 597, 597, 597, 599, 599, 599, 601, 601, 601, 601, 603, 603, 603, 603, 605, 605, 605, 606, 606, 606, 606, 607, 607, 607, 609, 609, 609, 611, 611, 611, 614, 614, 614, 614, 616, 616, 616, 620, 620, 620, 620, 622, 622, 622, 623, 623, 623, 623, 624, 624, 624, 625, 625, 625, 625, 628, 628, 628, 628, 629, 630, 630, 630, 636, 636, 636, 629, 632, 632, 632, 632, 634, 634, 634, 634, 638, 638, 638, 641, 641, 641, 641, 643, 643, 643, 643, 643, 643, 643, 643, 643, 643, 643, 643, 643, 643, 643, 643, 720, 718, 643, 643, 643, 643, 643, 644, 645, 644, 645, 646, 702, 685, 644, 645, 648, 654, 646, 647, 647, 647, 647, 648, 650, 650, 650, 652, 652, 652, 652, 643, 643, 643, 643, 655, 655, 655, 655, 656, 658, 656, 659, 659, 659, 659, 656, 658, 660, 661, 660, 661, 662, 653, 662, 660, 661, 649, 643, 662, 663, 664, 663, 664, 665, 675, 665, 663, 664, 642, 666, 665, 666, 660, 689, 639, 667, 666, 667, 668, 669, 668, 669, 667, 684, 663, 668, 669, 693, 665, 676, 684, 676, 675, 677, 664, 677, 689, 678, 666, 678, 660, 668, 667, 679, 681, 679, 681, 688, 680, 667, 680, 635, 663, 697, 693, 686, 665, 688, 684, 677, 686, 664, 678, 689, 692, 694, 666, 633, 676, 668, 667, 690, 680, 679, 687, 691, 667, 681, 696, 687, 697, 693, 699, 694, 691, 688, 692, 677, 686, 699, 678, 695, 698, 708, 690, 676, 695, 701, 708, 700, 680, 679, 699, 704, 681, 703, 696, 687, 700, 706, 694, 705, 691, 692, 703, 711, 698, 699, 705, 710, 701, 690, 704, 707, 695, 621, 708, 709, 710, 699, 712, 714, 706, 715, 709, 713, 700, 712, 719, 711, 707, 712, 703, 698, 713, 716, 705, 701, 714, 704, 715, 721, 714, 717, 716, 722, 710, 719, 723, 706, 721, 725, 709, 723, 724, 712, 711, 707, 726, 712, 727, 725, 713, 730, 717, 714, 722, 715, 733, 714, 724, 725, 716, 725, 719, 728, 729, 727, 721, 731, 734, 723, 726, 729, 847, 733, 847, 730, 728, 725, 619, 717, 615, 722, 735, 835, 735, 724, 725, 729, 725, 735, 731, 734, 727, 612, 736, 608, 738, 726, 604, 729, 733, 736, 730, 738, 728, 737, 737, 737, 737, 740, 835, 740, 602, 737, 729, 837, 740, 731, 734, 739, 739, 739, 741, 741, 741, 741, 742, 739, 743, 839, 741, 839, 596, 742, 583, 743, 744, 744, 744, 745, 745, 745, 745, 837, 744, 748, 861, 745, 746, 746, 746, 747, 748, 747, 581, 839, 746, 750, 747, 749, 749, 749, 749, 566, 750, 754, 564, 749, 751, 751, 751, 752, 754, 752, 861, 849, 751, 755, 752, 753, 753, 753, 753, 839, 755, 554, 537, 753, 756, 756, 756, 757, 757, 757, 757, 528, 756, 838, 849, 757, 758, 758, 758, 759, 759, 759, 524, 1043, 758, 468, 759, 760, 760, 760, 760, 761, 762, 761, 762, 760, 763, 464, 761, 762, 838, 849, 767, 763, 764, 764, 764, 764, 765, 767, 765, 1043, 764, 768, 456, 765, 766, 766, 766, 766, 768, 769, 769, 769, 766, 770, 448, 770, 446, 769, 772, 773, 770, 771, 771, 771, 771, 772, 773, 775, 440, 771, 774, 774, 774, 774, 775, 776, 776, 776, 774, 777, 777, 777, 777, 776, 778, 778, 778, 777, 779, 779, 779, 781, 778, 781, 782, 783, 779, 859, 781, 860, 855, 782, 783, 784, 784, 784, 784, 785, 785, 785, 855, 784, 435, 859, 788, 785, 786, 786, 786, 786, 787, 788, 787, 1174, 786, 790, 860, 787, 789, 789, 789, 789, 790, 791, 791, 791, 789, 792, 855, 792, 859, 791, 794, 795, 792, 793, 793, 793, 793, 794, 795, 1174, 432, 793, 796, 796, 796, 797, 797, 797, 797, 428, 796, 803, 805, 797, 798, 798, 798, 858, 803, 805, 402, 399, 798, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 858, 398, 800, 800, 800, 800, 800, 801, 802, 801, 802, 395, 390, 1176, 801, 802, 804, 804, 804, 804, 806, 806, 806, 807, 804, 807, 387, 858, 806, 870, 807, 800, 800, 800, 800, 808, 808, 808, 808, 809, 810, 1176, 870, 808, 372, 367, 809, 810, 811, 811, 811, 815, 815, 815, 815, 817, 811, 817, 800, 815, 818, 820, 817, 819, 819, 819, 819, 818, 820, 826, 870, 819, 822, 822, 822, 823, 826, 823, 850, 366, 822, 356, 823, 824, 824, 824, 824, 827, 828, 827, 828, 824, 851, 294, 827, 828, 829, 830, 829, 830, 831, 850, 831, 829, 830, 289, 832, 831, 832, 834, 833, 834, 833, 832, 852, 851, 834, 833, 840, 852, 840, 841, 828, 841, 863, 842, 827, 842, 850, 843, 834, 843, 853, 844, 831, 844, 862, 1238, 864, 866, 830, 853, 851, 863, 866, 854, 832, 852, 840, 828, 833, 841, 842, 827, 854, 872, 868, 862, 834, 864, 867, 831, 843, 868, 873, 1238, 288, 830, 869, 853, 863, 872, 866, 832, 844, 874, 840, 833, 875, 841, 842, 867, 854, 869, 862, 877, 864, 873, 876, 843, 879, 868, 878, 880, 875, 883, 874, 876, 872, 878, 884, 844, 889, 890, 883, 891, 877, 892, 867, 879, 869, 895, 880, 887, 873, 894, 895, 898, 884, 896, 887, 875, 897, 874, 890, 876, 889, 878, 892, 891, 898, 1072, 883, 877, 899, 901, 879, 901, 897, 880, 894, 1072, 901, 899, 895, 884, 284, 896, 887, 280, 902, 890, 904, 889, 1042, 892, 891, 902, 898, 904, 903, 903, 903, 903, 272, 897, 909, 894, 903, 1072, 269, 899, 911, 909, 896, 905, 905, 905, 906, 911, 906, 1042, 253, 905, 252, 906, 907, 907, 907, 907, 910, 910, 910, 910, 907, 912, 912, 912, 910, 914, 914, 914, 248, 912, 916, 916, 916, 914, 915, 915, 915, 915, 916, 918, 918, 918, 915, 917, 917, 917, 917, 918, 919, 920, 919, 917, 244, 1044, 922, 919, 920, 921, 921, 921, 921, 922, 923, 923, 923, 921, 924, 240, 924, 1056, 923, 927, 929, 924, 925, 925, 925, 925, 927, 929, 1044, 229, 925, 928, 928, 928, 928, 930, 930, 930, 1056, 928, 932, 932, 932, 930, 933, 933, 933, 933, 932, 934, 934, 934, 933, 935, 935, 935, 935, 934, 936, 936, 936, 935, 937, 192, 937, 1056, 936, 940, 945, 937, 939, 939, 939, 1054, 940, 945, 948, 939, 941, 941, 941, 941, 942, 948, 942, 1060, 941, 183, 950, 942, 943, 943, 943, 943, 944, 950, 944, 1054, 943, 1242, 955, 944, 946, 946, 946, 946, 947, 955, 947, 166, 946, 161, 1060, 947, 949, 949, 949, 949, 951, 951, 951, 952, 949, 952, 1054, 143, 951, 1242, 952, 953, 953, 953, 953, 956, 956, 956, 956, 953, 957, 958, 957, 956, 137, 126, 1249, 957, 958, 959, 959, 959, 959, 960, 960, 960, 960, 959, 961, 963, 110, 960, 962, 962, 962, 961, 963, 964, 964, 964, 962, 966, 966, 966, 1249, 964, 108, 101, 97, 966, 967, 967, 967, 967, 968, 968, 968, 968, 967, 969, 969, 969, 968, 970, 970, 970, 970, 969, 971, 971, 971, 970, 972, 972, 972, 973, 971, 973, 974, 94, 972, 76, 973, 976, 39, 974, 975, 975, 975, 975, 976, 977, 977, 977, 975, 978, 978, 978, 978, 977, 979, 979, 979, 978, 980, 980, 980, 980, 979, 981, 982, 981, 980, 33, 1188, 984, 981, 982, 983, 983, 983, 983, 984, 985, 985, 985, 983, 986, 32, 986, 1062, 985, 989, 991, 986, 987, 987, 987, 987, 989, 991, 1188, 31, 987, 990, 990, 990, 990, 992, 992, 992, 1062, 990, 994, 994, 994, 992, 995, 995, 995, 995, 994, 996, 996, 996, 995, 997, 997, 997, 997, 996, 998, 998, 998, 997, 30, 29, 27, 1062, 998, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 25, 21, 999, 999, 999, 999, 999, 1000, 1001, 1000, 1001, 1002, 20, 19, 1000, 1001, 1004, 1009, 1002, 1003, 1003, 1003, 1003, 1004, 1009, 6, 1063, 1003, 1005, 1005, 1005, 999, 999, 999, 999, 1006, 1005, 1006, 1007, 1007, 1007, 1007, 1006, 1063, 1011, 0, 1007, 1010, 1010, 1010, 1010, 1011, 1012, 1012, 1012, 1010, 0, 1360, 999, 1276, 1012, 1014, 1014, 1014, 1015, 1015, 1015, 1015, 0, 1014, 1063, 0, 1015, 1016, 1016, 1016, 1017, 1017, 1017, 1017, 1018, 1016, 1018, 1019, 1017, 1360, 1276, 1018, 1021, 0, 1019, 1020, 1020, 1020, 1020, 1021, 1022, 1022, 1022, 1020, 1023, 0, 1023, 0, 1022, 1026, 1028, 1023, 1024, 1024, 1024, 1024, 1026, 1028, 0, 1052, 1024, 1027, 1027, 1027, 1027, 1029, 1029, 1029, 1052, 1027, 1031, 1031, 1031, 1029, 1033, 1033, 1033, 1033, 1031, 1035, 0, 1035, 1033, 1036, 0, 1036, 1035, 1037, 0, 1037, 1036, 1038, 1068, 1038, 1037, 1039, 1052, 1039, 1038, 1040, 1068, 1040, 1039, 1041, 1035, 1041, 1040, 1045, 1109, 1045, 1041, 1046, 1047, 1046, 1047, 1109, 1050, 1049, 1050, 1049, 1051, 1036, 1053, 1067, 1040, 0, 1055, 1053, 1068, 1038, 1039, 1055, 1035, 1051, 1064, 1041, 1067, 1045, 1046, 1047, 1057, 1050, 1066, 1064, 1065, 1057, 1069, 1070, 1036, 1075, 0, 1066, 1040, 1069, 1075, 1053, 1038, 1039, 1049, 1055, 1065, 1051, 1041, 1070, 1067, 1045, 1046, 1047, 1073, 1050, 1071, 1064, 1074, 1057, 1076, 1078, 1077, 1073, 1088, 1066, 1074, 1069, 1075, 1071, 1077, 1049, 1081, 1065, 1082, 1090, 1070, 1083, 1085, 1086, 1084, 1081, 1087, 1076, 1088, 1078, 1084, 1085, 1086, 1091, 1089, 1073, 1082, 1090, 1074, 1331, 1083, 1071, 1077, 1089, 1093, 1093, 1093, 1093, 1087, 1331, 1115, 1091, 1093, 1081, 1076, 1088, 1078, 1115, 1084, 1085, 1086, 0, 1187, 1082, 1090, 1120, 1121, 1083, 1095, 1095, 1095, 1089, 1120, 1121, 0, 1087, 1095, 1331, 1091, 1097, 1097, 1097, 1097, 1099, 1099, 1099, 1187, 1097, 1103, 1103, 1103, 1099, 1101, 1101, 1101, 1101, 1103, 1107, 1107, 1107, 1101, 1105, 1105, 1105, 1105, 1107, 1111, 1111, 1111, 1105, 1112, 1194, 1112, 1187, 1111, 0, 1194, 1112, 1113, 1113, 1113, 1113, 1116, 1116, 1116, 1116, 1113, 1117, 0, 1117, 1116, 1118, 0, 1118, 1117, 1119, 1126, 1119, 1118, 1123, 0, 1123, 1119, 1126, 1194, 0, 1123, 1124, 1124, 1124, 1124, 1127, 1127, 1127, 1127, 1124, 1130, 1130, 1130, 1127, 1128, 1128, 1128, 1128, 1130, 1280, 1280, 1280, 1128, 1132, 1132, 1132, 1132, 1134, 1134, 1134, 1134, 1132, 1136, 1136, 1136, 1134, 1138, 1138, 1138, 1280, 1136, 1142, 1142, 1142, 1138, 1140, 1140, 1140, 1140, 1142, 1146, 1146, 1146, 1140, 1144, 1144, 1144, 1144, 1146, 1150, 1150, 1150, 1144, 1148, 1148, 1148, 1148, 1150, 1154, 1154, 1154, 1148, 1152, 1152, 1152, 1152, 1154, 1158, 1158, 1158, 1152, 1156, 1156, 1156, 1156, 1158, 1162, 1162, 1162, 1156, 1160, 1160, 1160, 1160, 1162, 1166, 1166, 1166, 1160, 1164, 1164, 1164, 1164, 1166, 1168, 0, 1168, 1164, 1169, 0, 1169, 1168, 1170, 0, 1170, 1169, 1171, 0, 1171, 1170, 1172, 1181, 1172, 1171, 1173, 1168, 1173, 1172, 1175, 1184, 1175, 1173, 1175, 1177, 1179, 1177, 1179, 1169, 1180, 1181, 1180, 1185, 1189, 1190, 1195, 1184, 1175, 1191, 1205, 1195, 1198, 1189, 1201, 1168, 1191, 0, 1171, 1204, 1185, 1179, 1177, 1202, 1196, 1190, 1180, 1169, 1181, 1196, 1199, 1198, 0, 1205, 1184, 1199, 0, 0, 1201, 1195, 1202, 1189, 0, 1204, 1191, 1171, 1207, 1185, 1208, 1179, 1177, 1209, 1190, 1207, 1180, 1208, 1216, 1196, 1198, 1212, 1205, 0, 1217, 1199, 1213, 1201, 1215, 1202, 1212, 1217, 1204, 1245, 1209, 1213, 0, 1215, 1218, 1218, 1218, 1216, 0, 1207, 1222, 1208, 1218, 1220, 1220, 1220, 1227, 1222, 1224, 1224, 1224, 1220, 1245, 1227, 1212, 0, 1224, 1209, 0, 1213, 1246, 1215, 0, 0, 1216, 1225, 1225, 1225, 1225, 1233, 1233, 1233, 1233, 1225, 1235, 1253, 1235, 1233, 1236, 1245, 1236, 1235, 1237, 1246, 1237, 1236, 1239, 1248, 1239, 1237, 1239, 1243, 1244, 1243, 1244, 1251, 1244, 1250, 1253, 1254, 1255, 1244, 1257, 1248, 1239, 1252, 1256, 1235, 1258, 1257, 1246, 1251, 1260, 1236, 1281, 1250, 1255, 1243, 1252, 1261, 1237, 1262, 1254, 0, 1256, 1253, 1263, 1288, 1260, 1258, 1248, 1264, 1261, 0, 1235, 1263, 0, 1257, 1251, 0, 1236, 1281, 1250, 1255, 1262, 1243, 1252, 1237, 0, 1254, 1264, 1256, 0, 0, 1288, 1260, 1258, 1269, 1269, 1269, 1261, 1285, 1273, 1263, 1273, 1269, 1271, 1271, 1271, 1273, 1285, 1262, 1287, 1274, 1271, 1274, 1275, 1264, 1275, 1289, 1274, 1290, 1291, 1275, 1278, 1278, 1278, 1282, 1278, 1282, 1290, 1282, 1293, 1302, 0, 1287, 1282, 1293, 1285, 1292, 1296, 1297, 1289, 1298, 1291, 1299, 1300, 1274, 1292, 1296, 1297, 1312, 1298, 1301, 0, 0, 0, 1302, 1290, 1300, 1324, 1301, 1287, 1299, 0, 1293, 1303, 1314, 1303, 1289, 1316, 1291, 1312, 1303, 1274, 1317, 1292, 1296, 1297, 1324, 1298, 1305, 1305, 1305, 1302, 1305, 1323, 1300, 1317, 1301, 1299, 1307, 1307, 1307, 1314, 1323, 1325, 1316, 1326, 1312, 1327, 1328, 1338, 1329, 1329, 1329, 1324, 1329, 1330, 1330, 1330, 1307, 1334, 1337, 1336, 1338, 1317, 1330, 0, 0, 1325, 1326, 0, 1323, 1316, 1350, 1346, 1327, 1328, 1351, 0, 1334, 1336, 1345, 1337, 1341, 1341, 1341, 1345, 1341, 1343, 1343, 1343, 1338, 1346, 1348, 1349, 1325, 1326, 1343, 1352, 1355, 1350, 1362, 1348, 1356, 1351, 1352, 1334, 1336, 1355, 1337, 0, 1356, 1349, 1357, 1345, 1358, 0, 0, 0, 1346, 0, 1357, 0, 0, 1358, 0, 0, 0, 0, 1362, 1348, 1356, 0, 1352, 0, 0, 1355, 0, 1356, 1349, 0, 1357, 0, 0, 0, 0, 0, 0, 1357, 0, 0, 0, 1358, 1368, 1368, 1368, 1368, 1368, 1368, 1368, 1368, 1369, 1369, 1369, 1369, 1369, 1369, 1369, 1369, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1370, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1371, 1372, 1372, 1372, 1372, 1372, 1372, 1372, 1372, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1373, 1374, 1374, 1374, 1374, 1374, 1374, 1374, 1374, 1375, 1375, 1375, 1375, 1375, 1375, 1375, 1375, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1376, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1377, 1378, 1378, 1378, 1378, 1378, 1378, 1378, 1378, 1379, 1379, 1379, 1379, 1379, 1379, 1379, 1379, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1380, 1381, 1381, 1382, 0, 1382, 1382, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1383, 1384, 1384, 1384, 1384, 1384, 1384, 1384, 1384, 1385, 1385, 1385, 1385, 1385, 1385, 1385, 1385, 1386, 1386, 1386, 1386, 1386, 1386, 1386, 1386, 1387, 1387, 1387, 1387, 1387, 1387, 1387, 1387, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1389, 1390, 1390, 1390, 1390, 1390, 1390, 0, 1390, 1391, 1391, 1391, 1391, 1391, 0, 1391, 1391, 1392, 0, 1392, 1393, 0, 1393, 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1394, 1395, 1395, 1395, 1395, 1395, 1395, 1395, 1395, 1396, 1396, 1396, 1396, 1396, 1396, 1396, 1396, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1397, 1398, 1398, 1398, 1398, 1398, 1398, 1398, 1398, 1399, 1399, 1399, 1399, 1399, 1399, 1399, 1399, 1400, 1400, 1400, 1400, 1400, 1400, 1400, 1400, 1401, 1401, 1401, 1401, 1401, 1401, 1401, 1401, 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1402, 1403, 1403, 1403, 1403, 1403, 1403, 1403, 1403, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1405, 1405, 1405, 1405, 1405, 1405, 1405, 1405, 1406, 1406, 1406, 1406, 1406, 1406, 1406, 1406, 1407, 1407, 1407, 1407, 1407, 1407, 1407, 1407, 1408, 1408, 1408, 1408, 1408, 1408, 1408, 1408, 1409, 1409, 1409, 1409, 1409, 1409, 1409, 1409, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1410, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1411, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1412, 1413, 1413, 1413, 1413, 1413, 1413, 0, 1413, 1414, 1414, 1414, 1414, 1414, 1414, 1414, 1414, 1415, 1415, 1415, 1415, 1415, 1415, 1415, 1415, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1416, 1417, 1417, 1417, 1417, 1417, 1417, 1417, 1417, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1418, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1420, 1420, 1420, 1420, 1420, 1420, 1420, 1420, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1421, 1422, 1422, 1422, 1422, 1422, 1422, 1422, 1422, 1423, 1423, 1423, 1423, 1423, 1423, 1423, 1423, 1424, 1424, 1424, 1424, 1424, 1424, 1424, 1424, 1425, 1425, 1425, 1425, 1425, 1425, 1425, 1425, 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1426, 1427, 1427, 1427, 1427, 1427, 1427, 1427, 1427, 1428, 1428, 1428, 1428, 1428, 1428, 1428, 1428, 1429, 1429, 1429, 1429, 1429, 1429, 1429, 1429, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1431, 1431, 1431, 1431, 1431, 1431, 1431, 1431, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1433, 1433, 1433, 1433, 1433, 1433, 1433, 1433, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1434, 1435, 1435, 1435, 1435, 1435, 1435, 1435, 1435, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1436, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1437, 1438, 1438, 1439, 1439, 1439, 1439, 1439, 1439, 1439, 1439, 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1440, 1441, 1441, 1441, 1441, 1441, 1441, 1441, 1441, 1442, 1442, 1442, 1442, 1442, 1442, 1442, 1442, 1443, 1443, 1443, 1443, 1443, 1443, 1443, 1443, 1444, 1444, 1444, 1444, 1444, 1444, 1444, 1444, 1445, 1445, 1445, 1445, 1445, 1445, 1445, 1445, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1447, 1447, 1447, 1447, 1447, 1447, 1447, 1447, 1448, 1448, 1448, 1448, 1448, 1448, 1448, 1448, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1451, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1452, 1453, 1453, 1453, 1453, 1453, 1453, 1453, 1453, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1454, 1455, 1455, 1455, 1455, 1455, 1455, 1455, 1455, 1456, 1456, 1456, 1456, 1456, 1456, 1456, 1456, 1457, 1457, 1457, 1457, 1457, 1457, 1457, 1457, 1458, 1458, 1458, 1458, 1458, 1458, 1458, 1458, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1459, 1460, 1460, 1460, 1460, 1460, 1460, 1460, 1460, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1463, 1464, 1464, 1464, 1464, 1464, 1464, 1464, 1464, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1467, 1468, 1468, 1468, 1468, 1468, 1468, 1468, 1468, 1469, 1469, 1470, 1470, 1470, 1470, 1470, 1470, 1470, 1470, 1471, 1471, 1471, 1471, 1471, 1471, 1471, 1471, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1472, 1473, 1473, 1473, 1473, 1473, 1473, 1473, 1473, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1474, 1475, 1475, 1475, 1475, 1475, 1475, 1475, 1475, 1476, 1476, 1476, 1476, 1476, 1476, 1476, 1476, 1477, 1477, 1477, 1477, 1477, 1477, 1477, 1477, 1478, 1478, 1478, 1478, 1478, 1478, 1478, 1478, 1479, 1479, 1479, 1479, 1479, 1479, 1479, 1479, 1480, 1480, 1480, 1480, 1480, 1480, 1480, 1480, 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1482, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1484, 1485, 1485, 1485, 1485, 1485, 1485, 1485, 1485, 1486, 1486, 1486, 1486, 1486, 1486, 1486, 1486, 1487, 1487, 1487, 1487, 1487, 1487, 1487, 1487, 1488, 1488, 1488, 1488, 1488, 1488, 1488, 1488, 1489, 1489, 1489, 1489, 1489, 1489, 1489, 1489, 1490, 1490, 1490, 1490, 1490, 1490, 1490, 1490, 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1492, 1492, 1492, 1492, 1492, 1492, 1492, 1492, 1493, 1493, 1493, 1493, 1493, 1493, 1493, 1493, 1494, 1494, 1494, 1494, 1494, 1494, 1494, 1494, 1495, 1495, 1495, 1495, 1495, 1495, 1495, 1495, 1496, 1496, 1496, 1496, 1496, 1496, 1496, 1496, 1497, 1497, 1497, 1497, 1497, 1497, 1497, 1497, 1498, 1498, 1498, 1498, 1498, 1498, 1498, 1498, 1499, 1499, 1499, 1499, 1499, 1499, 1499, 1499, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1501, 1501, 1502, 1502, 1502, 1502, 1502, 1502, 1502, 1502, 1503, 1503, 1503, 1503, 1503, 1503, 1503, 1503, 1504, 1504, 1504, 1504, 1504, 1504, 1504, 1504, 1505, 1505, 1505, 1505, 1505, 1505, 1505, 1505, 1506, 1506, 1506, 1506, 1506, 1506, 1506, 1506, 1507, 1507, 1507, 1507, 1507, 1507, 1507, 1507, 1508, 1508, 1508, 1508, 1508, 1508, 1508, 1508, 1509, 1509, 1509, 1509, 1509, 1509, 1509, 1509, 1510, 1510, 1510, 1510, 1510, 1510, 1510, 1510, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1512, 1512, 1512, 1512, 1512, 1512, 1512, 1512, 1513, 1513, 1513, 1513, 1513, 1513, 1513, 1513, 1514, 1514, 1514, 1514, 1514, 1514, 1514, 1514, 1515, 1515, 1515, 1515, 1515, 1515, 1515, 1515, 1516, 1516, 1516, 1516, 1516, 1516, 1516, 1516, 1517, 1517, 1517, 1517, 1517, 1517, 1517, 1517, 1518, 1518, 1518, 1518, 1518, 1518, 1518, 1518, 1519, 1519, 1519, 1519, 1519, 1519, 1519, 1519, 1520, 1520, 1520, 1520, 1520, 1520, 1520, 1520, 1521, 1521, 1521, 1521, 1521, 1521, 1521, 1521, 1522, 1522, 1522, 1522, 1522, 1522, 1522, 1522, 1523, 1523, 1523, 1523, 1523, 1523, 1523, 1523, 1524, 1524, 1524, 1524, 1524, 1524, 1524, 1524, 1525, 1525, 1525, 1525, 1525, 1525, 1525, 1525, 1526, 1526, 1526, 1526, 1526, 1526, 1526, 1526, 1527, 1527, 1527, 1527, 1527, 1527, 1527, 1527, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1529, 1529, 1529, 1529, 1529, 1529, 1529, 1529, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1530, 1531, 1531, 1531, 1531, 1531, 1531, 1531, 1531, 1532, 1532, 1532, 1532, 1532, 1532, 1532, 1532, 1533, 1533, 1533, 1533, 1533, 1533, 1533, 1533, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1534, 1535, 1535, 1535, 1535, 1535, 1535, 1535, 1535, 1536, 1536, 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1540, 1540, 1540, 1540, 1540, 1540, 1540, 1540, 1541, 1541, 1541, 1541, 1541, 1541, 1541, 1541, 1542, 1542, 1542, 1542, 1542, 1542, 1542, 1542, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1544, 1544, 1544, 1544, 1544, 1544, 1544, 1544, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1546, 1546, 1546, 1546, 1546, 1546, 1546, 1546, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1548, 1548, 1548, 1548, 1548, 1548, 1548, 1548, 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1551, 1551, 1551, 1551, 1551, 1551, 1551, 1551, 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1553, 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1554, 1555, 1555, 1555, 1555, 1555, 1555, 1555, 1555, 1556, 1556, 1556, 1556, 1556, 1556, 1556, 1556, 1557, 1557, 1557, 1557, 1557, 1557, 1557, 1557, 1558, 1558, 1558, 1558, 1558, 1558, 1558, 1558, 1559, 1559, 1559, 1559, 1559, 1559, 1559, 1559, 1560, 1560, 1560, 1560, 1560, 1560, 1560, 1560, 1561, 1561, 1561, 1561, 1561, 1561, 1561, 1561, 1562, 1562, 1562, 1562, 1562, 1562, 1562, 1562, 1563, 1563, 1563, 1563, 1563, 1563, 1563, 1563, 1564, 1564, 1564, 1564, 1564, 1564, 1564, 1564, 1565, 1565, 1565, 1565, 1565, 1565, 1565, 1565, 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1569, 1570, 1570, 1570, 1570, 1570, 1570, 1570, 1570, 1571, 1571, 1571, 1571, 1571, 1571, 1571, 1571, 1572, 1572, 1572, 1572, 1572, 1572, 1572, 1572, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1573, 1574, 1574, 1575, 1575, 1575, 1575, 1575, 1575, 1575, 1575, 1576, 1576, 1576, 1576, 1576, 1576, 1576, 1576, 1577, 1577, 1577, 1577, 1577, 1577, 1577, 1577, 1578, 1578, 1578, 1578, 1578, 1578, 1578, 1578, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1580, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1582, 1583, 1583, 1583, 1583, 1583, 1583, 1583, 1583, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1584, 1585, 1585, 1585, 1585, 1585, 1585, 1585, 1585, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1586, 1587, 1587, 1587, 0, 1587, 1587, 1587, 1587, 1588, 1588, 1588, 1588, 1588, 1588, 1588, 1588, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1590, 1590, 1590, 1590, 1590, 1590, 1590, 1590, 1591, 1591, 1591, 1591, 1591, 1591, 1591, 1591, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1592, 1593, 1593, 1593, 1593, 1593, 1593, 1593, 1593, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1594, 1595, 1595, 1595, 1595, 1595, 1595, 1595, 1595, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1596, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1597, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1601, 1601, 1601, 1601, 1601, 1601, 1601, 1601, 1602, 1602, 1602, 1602, 1602, 1602, 1602, 1602, 1603, 1603, 1604, 0, 1604, 1604, 1604, 1604, 1604, 1604, 1605, 0, 1605, 1605, 1605, 1605, 1605, 1605, 1606, 0, 1606, 1606, 1606, 1606, 1606, 1606, 1607, 0, 1607, 1607, 1607, 1607, 1607, 1607, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367, 1367 } ; extern int yy_flex_debug; int yy_flex_debug = 0; static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; static char *yy_full_match; static int yy_lp; static int yy_looking_for_trail_begin = 0; static int yy_full_lp; static int *yy_full_state; #define YY_TRAILING_MASK 0x2000 #define YY_TRAILING_HEAD_MASK 0x4000 #define REJECT \ { \ *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \ yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ (yy_lp) = (yy_full_lp); /* restore orig. accepting pos. */ \ (yy_state_ptr) = (yy_full_state); /* restore orig. state */ \ yy_current_state = *(yy_state_ptr); /* restore curr. state */ \ ++(yy_lp); \ goto find_rule; \ } #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "lexer.l" #line 2 "lexer.l" #include #include #include #include #include "debug.h" #include "lexer.h" #include "line_prep.h" #include "parser.h" #define YY_DECL extern "C" int yylex() std::stack start_stack; std::string lexer_name, lexer_stlabel, lexeri_number, lexer_rest, lexer_string, lexer_lr; std::string lexer_include; std::string input_string; int lrlevel; bool lrreturn; Line_prep pline; #line 2471 "lexer.cpp" #line 32 "lexer.l" // following are keywords starting with c #line 2475 "lexer.cpp" #define INITIAL 0 #define state_identifier 1 #define state_keyword 2 #define state_esope 3 #define state_lr 4 #define state_lrb 5 #define state_skip 6 #define state_skipall 7 #define state_skipnoop 8 #define state_error 9 #define state_findformat 10 #define state_scanfixpre 11 #define state_scanompfixed 12 #define state_scanompfree 13 #define state_incfilename 14 #define state_char 15 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy ( void ); int yyget_debug ( void ); void yyset_debug ( int debug_flag ); YY_EXTRA_TYPE yyget_extra ( void ); void yyset_extra ( YY_EXTRA_TYPE user_defined ); FILE *yyget_in ( void ); void yyset_in ( FILE * _in_str ); FILE *yyget_out ( void ); void yyset_out ( FILE * _out_str ); int yyget_leng ( void ); char *yyget_text ( void ); int yyget_lineno ( void ); void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap ( void ); #else extern int yywrap ( void ); #endif #endif #ifndef YY_NO_UNPUT static void yyunput ( int c, char *buf_ptr ); #endif #ifndef yytext_ptr static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput ( void ); #else static int input ( void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ if ( yyleng > 0 ) \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ (yytext[yyleng - 1] == '\n'); \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif /* Create the reject buffer large enough to save one state per allowed character. */ if ( ! (yy_state_buf) ) (yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE ); if ( ! (yy_state_buf) ) YY_FATAL_ERROR( "out of dynamic memory in yylex()" ); if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_load_buffer_state( ); } { #line 34 "lexer.l" #line 2719 "lexer.cpp" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); (yy_state_ptr) = (yy_state_buf); *(yy_state_ptr)++ = yy_current_state; yy_match: do { YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1368 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; *(yy_state_ptr)++ = yy_current_state; ++yy_cp; } while ( yy_base[yy_current_state] != 6340 ); yy_find_action: yy_current_state = *--(yy_state_ptr); (yy_lp) = yy_accept[yy_current_state]; find_rule: /* we branch to this label when backing up */ for ( ; ; ) /* until we find what rule we matched */ { if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) { yy_act = yy_acclist[(yy_lp)]; if ( yy_act & YY_TRAILING_HEAD_MASK || (yy_looking_for_trail_begin) ) { if ( yy_act == (yy_looking_for_trail_begin) ) { (yy_looking_for_trail_begin) = 0; yy_act &= ~YY_TRAILING_HEAD_MASK; break; } } else if ( yy_act & YY_TRAILING_MASK ) { (yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK; (yy_looking_for_trail_begin) |= YY_TRAILING_HEAD_MASK; } else { (yy_full_match) = yy_cp; (yy_full_state) = (yy_state_ptr); (yy_full_lp) = (yy_lp); break; } ++(yy_lp); goto find_rule; } --yy_cp; yy_current_state = *--(yy_state_ptr); (yy_lp) = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 1: YY_RULE_SETUP #line 36 "lexer.l" { D(O("ERROR");Y;); return ERROR; } YY_BREAK case 2: YY_RULE_SETUP #line 39 "lexer.l" { D(O("lrplus");O(lrlevel);Y;); lrlevel++; } YY_BREAK case 3: YY_RULE_SETUP #line 43 "lexer.l" { D(O("lrmin");O(lrlevel);Y;); lrlevel--; if(lrlevel == 0) { D(O("state:");O(start_stack.top());O(lrreturn);); BEGIN(start_stack.top()); start_stack.pop(); if(lrreturn) { return LR; } } } YY_BREAK case 4: YY_RULE_SETUP #line 57 "lexer.l" { D(O("lrbla");O(lrlevel);Y;); lexer_lr += yytext; } YY_BREAK case 5: /* rule 5 can match eol */ YY_RULE_SETUP #line 60 "lexer.l" { D(O("lreol");O(lrlevel);Y;); yyless(0); BEGIN(start_stack.top()); } YY_BREAK case 6: YY_RULE_SETUP #line 65 "lexer.l" { D(O("lrb+");O(lrlevel);Y;); lrlevel++; } YY_BREAK case 7: YY_RULE_SETUP #line 69 "lexer.l" { D(O("lrb-");O(lrlevel);Y;); lrlevel--; if(lrlevel == 0) { D(O("state:");O(start_stack.top());O(lrreturn);); BEGIN(start_stack.top()); start_stack.pop(); if(lrreturn) { return LRB; } } } YY_BREAK case 8: YY_RULE_SETUP #line 83 "lexer.l" { D(O("lrbbla");O(lrlevel);Y;); } YY_BREAK case 9: /* rule 9 can match eol */ YY_RULE_SETUP #line 86 "lexer.l" { D(O("lrbeol");O(lrlevel);Y;) yyless(0); BEGIN(start_stack.top()); } YY_BREAK case 10: YY_RULE_SETUP #line 94 "lexer.l" { D(O("skipLPAREN");Y;); start_stack.push(YY_START); lrlevel = 1; lrreturn = 0; lexer_lr = ""; BEGIN(state_lr); } YY_BREAK case 11: YY_RULE_SETUP #line 102 "lexer.l" { D(O("skipLPAREN");Y;); start_stack.push(YY_START); lrlevel = 1; lrreturn = 0; BEGIN(state_lrb); } YY_BREAK case 12: YY_RULE_SETUP #line 110 "lexer.l" { D(O("NOSKIP");Y;); return yytext[yyleng-1]; } YY_BREAK case 13: YY_RULE_SETUP #line 111 "lexer.l" { D(O("NOSKIPNOOP");Y;); return yytext[yyleng-1]; } YY_BREAK case 14: /* rule 14 can match eol */ YY_RULE_SETUP #line 114 "lexer.l" { D(O("endSKIP");Y;); switch(YY_START) { case state_skip: return SKIP; case state_skipall: return SKIPALL; case state_skipnoop: return SKIPNOOP; } } YY_BREAK case 15: YY_RULE_SETUP #line 126 "lexer.l" { D(O("SKIP");Y;); } YY_BREAK case 16: YY_RULE_SETUP #line 130 "lexer.l" { D(O("IDENTIFIER");Y;); lexer_name = yytext; return IDENTIFIER; } YY_BREAK case 17: YY_RULE_SETUP #line 131 "lexer.l" { D(O("TIDENTIFIER");Y;); lexer_name = yytext; return TIDENTIFIER; } YY_BREAK /* to be used in '#include ' */ case 18: /* rule 18 can match eol */ YY_RULE_SETUP #line 135 "lexer.l" { D(O("INCFILENAME");Y;); lexer_string = yytext; BEGIN state_char; return INCFILENAME; } YY_BREAK case 19: /* rule 19 can match eol */ YY_RULE_SETUP #line 141 "lexer.l" { D(O("EOL");); return EOL; } YY_BREAK case 20: YY_RULE_SETUP #line 142 "lexer.l" { D(O("BLA");Y;); return yytext[0]; } YY_BREAK case 21: YY_RULE_SETUP #line 146 "lexer.l" { D(O("ABSTRACTINTERFACE");Y;); return ABSTRACTINTERFACE; } YY_BREAK case 22: YY_RULE_SETUP #line 147 "lexer.l" { D(O("ASSOCIATE");Y;); return ASSOCIATE; } YY_BREAK case 23: YY_RULE_SETUP #line 148 "lexer.l" { D(O("ASSIGN");Y;); return ASSIGN; } YY_BREAK case 24: YY_RULE_SETUP #line 149 "lexer.l" { D(O("BLOCK");Y;); return BLOCK; } YY_BREAK case 25: YY_RULE_SETUP #line 150 "lexer.l" { D(O("BLOCKDATA");Y;); return BLOCKDATA; } YY_BREAK case 26: YY_RULE_SETUP #line 151 "lexer.l" { D(O("CASEDEFAULT");Y); return CASEDEFAULT; } YY_BREAK case 27: YY_RULE_SETUP #line 152 "lexer.l" { D(O("CASE");Y); return CASE; } YY_BREAK case 28: YY_RULE_SETUP #line 153 "lexer.l" { D(O("CHARACTER");Y;); return BASICTYPE; } YY_BREAK case 29: YY_RULE_SETUP #line 154 "lexer.l" { D(O("CLASSDEFAULT");Y); return CLASSDEFAULT; } YY_BREAK case 30: YY_RULE_SETUP #line 155 "lexer.l" { D(O("CHANGETEAM");Y); return CHANGETEAM; } YY_BREAK case 31: YY_RULE_SETUP #line 156 "lexer.l" { D(O("CLASS");Y;); return CLASS; } YY_BREAK case 32: YY_RULE_SETUP #line 157 "lexer.l" { D(O("CLASSIS");Y); return CLASSIS; } YY_BREAK case 33: YY_RULE_SETUP #line 158 "lexer.l" { D(O("COMPLEX");Y;); return BASICTYPE; } YY_BREAK case 34: YY_RULE_SETUP #line 159 "lexer.l" { D(O("CONTAINS");Y); return CONTAINS; } YY_BREAK case 35: YY_RULE_SETUP #line 160 "lexer.l" { D(O("CRITICAL");Y;); return CRITICAL; } YY_BREAK case 36: YY_RULE_SETUP #line 161 "lexer.l" { D(O("DO");Y;); return DO; } YY_BREAK case 37: YY_RULE_SETUP #line 162 "lexer.l" { D(O("DO,");Y;); return DOCOMMA; } YY_BREAK case 38: YY_RULE_SETUP #line 163 "lexer.l" { D(O("DOCONCURRENT");Y;); return DOCONCURRENT; } YY_BREAK case 39: YY_RULE_SETUP #line 164 "lexer.l" { D(O("DO,CONCURRENT");Y;); return DOCONCURRENT; } YY_BREAK case 40: YY_RULE_SETUP #line 165 "lexer.l" { D(O("DOWHILE");Y;); return DOWHILE; } YY_BREAK case 41: YY_RULE_SETUP #line 166 "lexer.l" { D(O("DO,WHILE");Y;); return DOWHILE; } YY_BREAK case 42: YY_RULE_SETUP #line 167 "lexer.l" { D(O("DOUBLECOMPLEX");Y;); return BASICTYPE; } YY_BREAK case 43: YY_RULE_SETUP #line 168 "lexer.l" { D(O("DOUBLEPRECISION");Y;); return BASICTYPE; } YY_BREAK case 44: YY_RULE_SETUP #line 169 "lexer.l" { D(O("ELEMENTAL");Y;); return ELEMENTAL; } YY_BREAK case 45: YY_RULE_SETUP #line 170 "lexer.l" { D(O("ELSE");Y); return ELSE; } YY_BREAK case 46: YY_RULE_SETUP #line 171 "lexer.l" { D(O("ELSEIF");Y); return ELSEIF; } YY_BREAK case 47: YY_RULE_SETUP #line 172 "lexer.l" { D(O("ELSEWHERE");Y); return ELSEWHERE; } YY_BREAK case 48: YY_RULE_SETUP #line 173 "lexer.l" { D(O("ENDASSOCIATE");Y;); return ENDASSOCIATE; } YY_BREAK case 49: YY_RULE_SETUP #line 174 "lexer.l" { D(O("ENDBLOCK");Y;); return ENDBLOCK; } YY_BREAK case 50: YY_RULE_SETUP #line 175 "lexer.l" { D(O("ENDBLOCKDATA");Y;); return ENDBLOCKDATA; } YY_BREAK case 51: YY_RULE_SETUP #line 176 "lexer.l" { D(O("ENDCRITICAL");Y;); return ENDCRITICAL; } YY_BREAK case 52: YY_RULE_SETUP #line 177 "lexer.l" { D(O("ENDDO");Y;); return ENDDO; } YY_BREAK case 53: YY_RULE_SETUP #line 178 "lexer.l" { D(O("END");Y;); return END; } YY_BREAK case 54: YY_RULE_SETUP #line 179 "lexer.l" { D(O("ENDENUM");Y;); return ENDENUM; } YY_BREAK case 55: YY_RULE_SETUP #line 180 "lexer.l" { D(O("ENDFORALL");Y;); return ENDFORALL; } YY_BREAK case 56: YY_RULE_SETUP #line 181 "lexer.l" { D(O("ENDFUNCTION");Y;); return ENDFUNCTION; } YY_BREAK case 57: YY_RULE_SETUP #line 182 "lexer.l" { D(O("ENDIF");Y); return ENDIF; } YY_BREAK case 58: YY_RULE_SETUP #line 183 "lexer.l" { D(O("ENDINTERFACE");Y;); return ENDINTERFACE; } YY_BREAK case 59: YY_RULE_SETUP #line 184 "lexer.l" { D(O("ENDMODULE");Y;); return ENDMODULE; } YY_BREAK case 60: YY_RULE_SETUP #line 185 "lexer.l" { D(O("ENDPROCEDURE");Y;); return ENDPROCEDURE; } YY_BREAK case 61: YY_RULE_SETUP #line 186 "lexer.l" { D(O("ENDPROGRAM");Y;); return ENDPROGRAM; } YY_BREAK case 62: YY_RULE_SETUP #line 187 "lexer.l" { D(O("ENDSELECT");Y); return ENDSELECT; } YY_BREAK case 63: YY_RULE_SETUP #line 188 "lexer.l" { D(O("ENDSUBROUTINE");Y;); return ENDSUBROUTINE; } YY_BREAK case 64: YY_RULE_SETUP #line 189 "lexer.l" { D(O("ENDSUBMODULE");Y;); return ENDSUBMODULE; } YY_BREAK case 65: YY_RULE_SETUP #line 190 "lexer.l" { D(O("ENDTEAM");Y); return ENDTEAM; } YY_BREAK case 66: YY_RULE_SETUP #line 191 "lexer.l" { D(O("ENDTYPE");Y;); return ENDTYPE; } YY_BREAK case 67: YY_RULE_SETUP #line 192 "lexer.l" { D(O("ENDWHERE");Y;); return ENDWHERE; } YY_BREAK case 68: YY_RULE_SETUP #line 193 "lexer.l" { D(O("ENTRY");Y); return ENTRY; } YY_BREAK case 69: YY_RULE_SETUP #line 194 "lexer.l" { D(O("ENUM");Y;); return ENUM; } YY_BREAK case 70: YY_RULE_SETUP #line 195 "lexer.l" { D(O("FORALL");Y;); return FORALL; } YY_BREAK case 71: YY_RULE_SETUP #line 196 "lexer.l" { D(O("FUNCTION");Y;); return FUNCTION; } YY_BREAK case 72: YY_RULE_SETUP #line 197 "lexer.l" { D(O("IF");Y;); return IF; } YY_BREAK case 73: YY_RULE_SETUP #line 198 "lexer.l" { D(O("IMPURE");Y;); return IMPURE; } YY_BREAK case 74: YY_RULE_SETUP #line 199 "lexer.l" { D(O("INCLUDE");Y;); return INCLUDE; } YY_BREAK case 75: YY_RULE_SETUP #line 200 "lexer.l" { D(O("INTEGER");Y;); return BASICTYPE; } YY_BREAK case 76: YY_RULE_SETUP #line 201 "lexer.l" { D(O("INTERFACE");Y;); return INTERFACE; } YY_BREAK case 77: YY_RULE_SETUP #line 202 "lexer.l" { D(O("LOGICAL");Y;); return BASICTYPE; } YY_BREAK case 78: YY_RULE_SETUP #line 203 "lexer.l" { D(O("MODULE");Y); return MODULE; } YY_BREAK case 79: YY_RULE_SETUP #line 204 "lexer.l" { D(O("MODULEPROCEDURE");Y); return MODULEPROCEDURE; } YY_BREAK case 80: YY_RULE_SETUP #line 205 "lexer.l" { D(O("MODULESUBROUTINE");Y); return MODULESUBROUTINE; } YY_BREAK case 81: YY_RULE_SETUP #line 206 "lexer.l" { D(O("MODULEFUNCTION");Y); return MODULEFUNCTION; } YY_BREAK case 82: YY_RULE_SETUP #line 207 "lexer.l" { D(O("PROCEDURE");Y); return PROCEDURE; } YY_BREAK case 83: YY_RULE_SETUP #line 208 "lexer.l" { D(O("PROGRAM");Y;); return PROGRAM; } YY_BREAK case 84: YY_RULE_SETUP #line 209 "lexer.l" { D(O("PURE");Y;); return PURE; } YY_BREAK case 85: YY_RULE_SETUP #line 210 "lexer.l" { D(O("REAL");Y;); return BASICTYPE; } YY_BREAK case 86: YY_RULE_SETUP #line 211 "lexer.l" { D(O("RECURSIVE");Y;); return RECURSIVE; } YY_BREAK case 87: YY_RULE_SETUP #line 212 "lexer.l" { D(O("SELECTCASE");Y); return SELECTCASE; } YY_BREAK case 88: YY_RULE_SETUP #line 213 "lexer.l" { D(O("SELECTTYPE");Y); return SELECTTYPE; } YY_BREAK case 89: YY_RULE_SETUP #line 214 "lexer.l" { D(O("SUBMODULE");Y;); return SUBMODULE; } YY_BREAK case 90: YY_RULE_SETUP #line 215 "lexer.l" { D(O("SUBROUTINE");Y;); return SUBROUTINE; } YY_BREAK case 91: YY_RULE_SETUP #line 216 "lexer.l" { D(O("TO");Y;); return TO; } YY_BREAK case 92: YY_RULE_SETUP #line 217 "lexer.l" { D(O("THEN");Y;); return THEN; } YY_BREAK case 93: YY_RULE_SETUP #line 218 "lexer.l" { D(O("TYPE");Y;); return TYPE; } YY_BREAK case 94: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp = yy_bp + 4; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 219 "lexer.l" { D(O("TYPEC");Y;); return TYPEC; } YY_BREAK case 95: YY_RULE_SETUP #line 220 "lexer.l" { D(O("TYPEIS");Y); return TYPEIS; } YY_BREAK case 96: YY_RULE_SETUP #line 221 "lexer.l" { D(O("USE");Y); return USE; } YY_BREAK case 97: YY_RULE_SETUP #line 222 "lexer.l" { D(O("WHERE");Y;); return WHERE; } YY_BREAK case 98: YY_RULE_SETUP #line 226 "lexer.l" { D(O("SEGMENT");Y;); return SEGMENT; } YY_BREAK case 99: YY_RULE_SETUP #line 227 "lexer.l" { D(O("SEGMENT,");Y;); return SEGMENT; } YY_BREAK case 100: YY_RULE_SETUP #line 228 "lexer.l" { D(O("ENDSEGMENT");Y;); return ENDSEGMENT; } YY_BREAK case 101: /* rule 101 can match eol */ YY_RULE_SETUP #line 232 "lexer.l" { D(O("UNSURE");Y;); return UNSURE; } YY_BREAK case 102: /* rule 102 can match eol */ YY_RULE_SETUP #line 233 "lexer.l" { D(O("FREE");Y;); return FREE; } YY_BREAK case 103: /* rule 103 can match eol */ YY_RULE_SETUP #line 234 "lexer.l" { D(O("FREE");Y;); return FREE; } YY_BREAK case 104: /* rule 104 can match eol */ YY_RULE_SETUP #line 235 "lexer.l" { D(O("UNSURE");Y;); return UNSURE; } YY_BREAK case 105: /* rule 105 can match eol */ YY_RULE_SETUP #line 236 "lexer.l" { D(O("UNSURE");Y;); return UNSURE; } YY_BREAK case 106: /* rule 106 can match eol */ YY_RULE_SETUP #line 237 "lexer.l" { D(O("FREE");Y;); return FREE; } YY_BREAK case 107: /* rule 107 can match eol */ YY_RULE_SETUP #line 238 "lexer.l" { D(O("FREE");Y;); return FREE; } YY_BREAK case 108: /* rule 108 can match eol */ YY_RULE_SETUP #line 239 "lexer.l" { D(O("FREE");Y;); return FREE; } YY_BREAK case 109: /* rule 109 can match eol */ YY_RULE_SETUP #line 240 "lexer.l" { D(O("FREE");Y;); return FREE; } YY_BREAK case 110: /* rule 110 can match eol */ YY_RULE_SETUP #line 241 "lexer.l" { D(O("FREE");Y;); return FREE; } YY_BREAK case 111: /* rule 111 can match eol */ YY_RULE_SETUP #line 242 "lexer.l" { D(O("FREE");Y;); return FREE; } YY_BREAK case 112: /* rule 112 can match eol */ YY_RULE_SETUP #line 243 "lexer.l" { D(O("FIXED");Y;); return FIXED; } YY_BREAK case 113: /* rule 113 can match eol */ YY_RULE_SETUP #line 244 "lexer.l" { D(O("UNSURE");Y;); return UNSURE; } YY_BREAK case 114: /* rule 114 can match eol */ YY_RULE_SETUP #line 245 "lexer.l" { D(O("UNSURE");Y;); return UNSURE; } YY_BREAK case 115: #line 250 "lexer.l" case 116: /* rule 116 can match eol */ #line 251 "lexer.l" case 117: /* rule 117 can match eol */ YY_RULE_SETUP #line 251 "lexer.l" { D(O("FIXOMP");Y;); return OMP; } YY_BREAK case 118: /* rule 118 can match eol */ YY_RULE_SETUP #line 254 "lexer.l" { D(O("EOL");); return EOL; } YY_BREAK case 119: YY_RULE_SETUP #line 255 "lexer.l" { D(O("BLA");Y;); return yytext[0]; } YY_BREAK case 120: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 258 "lexer.l" case 121: YY_RULE_SETUP #line 259 "lexer.l" { D(O("OMP");Y;); return OMP; } YY_BREAK case 122: /* rule 122 can match eol */ YY_RULE_SETUP #line 262 "lexer.l" { D(O("EOL");); return EOL; } YY_BREAK case 123: YY_RULE_SETUP #line 263 "lexer.l" { D(O("BLA");Y;); return yytext[0]; } YY_BREAK case 124: YY_RULE_SETUP #line 266 "lexer.l" { D(O("FINDENTFIX P-ON");Y;); return P_ON; } YY_BREAK case 125: YY_RULE_SETUP #line 269 "lexer.l" { D(O("FIXFINDENTFIX P-ON");Y;); return P_ON; } YY_BREAK case 126: YY_RULE_SETUP #line 272 "lexer.l" { D(O("FINDENTFIX P-OFF");Y;); return P_OFF; } YY_BREAK case 127: YY_RULE_SETUP #line 275 "lexer.l" { D(O("FIXFINDENTFIX P-OFF");Y;); return P_OFF; } YY_BREAK case 128: YY_RULE_SETUP #line 278 "lexer.l" { D(O("FINDENTFIX");Y;); size_t l = input_string.length()-yyleng-1; lexer_rest = input_string.substr(yyleng,l); return FINDENTFIX; } YY_BREAK case 129: YY_RULE_SETUP #line 283 "lexer.l" { D(O("FIXFINDENTFIX");Y;); size_t l = input_string.length()-yyleng-1; lexer_rest = input_string.substr(yyleng,l); return FIXFINDENTFIX; } YY_BREAK case 130: YY_RULE_SETUP #line 288 "lexer.l" { D(O("CPP");Y;); return CPP; } YY_BREAK case 131: YY_RULE_SETUP #line 291 "lexer.l" { D(O("CPP_IF");Y;); return CPP_IF; } YY_BREAK case 132: YY_RULE_SETUP #line 294 "lexer.l" { D(O("CPP_ENDIF");Y;); return CPP_ENDIF; } YY_BREAK case 133: YY_RULE_SETUP #line 297 "lexer.l" { D(O("CPP_ELSE");Y;); return CPP_ELSE; } YY_BREAK case 134: YY_RULE_SETUP #line 300 "lexer.l" { D(O("CPP_ELIF");Y;); return CPP_ELIF; } YY_BREAK case 135: /* rule 135 can match eol */ YY_RULE_SETUP #line 303 "lexer.l" { D(O("INCLUDE_CPP");Y;); extract_include(); return INCLUDE_CPP; } YY_BREAK case 136: /* rule 136 can match eol */ YY_RULE_SETUP #line 307 "lexer.l" { D(O("INCLUDE_CPP_STD");Y;); extract_include(); return INCLUDE_CPP_STD; } YY_BREAK case 137: YY_RULE_SETUP #line 313 "lexer.l" { D(O("COCO");Y;); return COCO; } YY_BREAK case 138: YY_RULE_SETUP #line 316 "lexer.l" { D(O("COCO_IF");Y;); return COCO_IF; } YY_BREAK case 139: YY_RULE_SETUP #line 319 "lexer.l" { D(O("COCO_ENDIF");Y;); return COCO_ENDIF; } YY_BREAK case 140: YY_RULE_SETUP #line 322 "lexer.l" { D(O("COCO_ELSE");Y;); return COCO_ELSE; } YY_BREAK case 141: YY_RULE_SETUP #line 325 "lexer.l" { D(O("COCO_ELIF");Y;); return COCO_ELIF; } YY_BREAK case 142: /* rule 142 can match eol */ YY_RULE_SETUP #line 328 "lexer.l" { D(O("INCLUDE_COCO");Y;); /* coco statements must start with '??' in column 1. However, for this code that is somewhat inconvenient, so we allow white space before '??' */ extract_include(); return INCLUDE_COCO; } YY_BREAK case 143: /* rule 143 can match eol */ YY_RULE_SETUP #line 335 "lexer.l" { D(O("INCLUDE_COCO");Y;); /* coco statements must start with '??' in column 1. However, for this code that is somewhat inconvenient, so we allow white space before '??' */ extract_include(); return INCLUDE_COCO; } YY_BREAK case 144: /* rule 144 can match eol */ YY_RULE_SETUP #line 344 "lexer.l" { D(O("EOL");); return EOL; } YY_BREAK case 145: YY_RULE_SETUP #line 345 "lexer.l" { D(O("BLA");Y;); return yytext[0]; } YY_BREAK case 146: YY_RULE_SETUP #line 348 "lexer.l" { int type = pline.get_type(std::string(yytext)); D(O("found_special");O(type);O(pline.get_type_as_string(std::string(yytext)));Y;); D(O("encoded line");O(pline.get_line_encoded());); if (type == pline.is_string) { lexer_string = pline.get_value(std::string(yytext)); D(O("QSTRING");O(lexer_string);Y;); return QSTRING; } if (type == pline.is_stlabel) { lexer_stlabel = pline.get_value(std::string(yytext)); D(O("STLABEL");O(lexer_stlabel);Y;); return STLABEL; } if (type == pline.is_dotop) { D(O("DOTOPERATOR");); return DOTOPERATOR; } D(O("This should not happen");); } YY_BREAK case 147: /* rule 147 can match eol */ *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ YY_LINENO_REWIND_TO(yy_cp - 1); (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 373 "lexer.l" { D(O("NAMED_LABEL");Y;); lexer_name = yytext; lexer_name.erase(lexer_name.size()-1); return NAMED_LABEL; } YY_BREAK case 148: YY_RULE_SETUP #line 379 "lexer.l" { D(O("I_NUMBER");Y;); lexer_name = yytext; lexeri_number = yytext; return I_NUMBER; } YY_BREAK case 149: YY_RULE_SETUP #line 386 "lexer.l" { D(O("LPAREN");Y;); start_stack.push(YY_START); lrlevel = 1; lrreturn = 1; lexer_lr = ""; BEGIN(state_lr); } YY_BREAK case 150: YY_RULE_SETUP #line 394 "lexer.l" { D(O("LPARENB");Y;); start_stack.push(YY_START); lrlevel = 1; lrreturn = 1; BEGIN(state_lrb); } YY_BREAK case 151: /* rule 151 can match eol */ YY_RULE_SETUP #line 401 "lexer.l" { D(O("BLANK");); return BLANK; } YY_BREAK case 152: /* rule 152 can match eol */ YY_RULE_SETUP #line 403 "lexer.l" { D(O("EOL");); return EOL; } YY_BREAK case 153: YY_RULE_SETUP #line 404 "lexer.l" { D(O("BLA");Y;); return yytext[0]; } YY_BREAK case 154: YY_RULE_SETUP #line 406 "lexer.l" ECHO; YY_BREAK #line 3785 "lexer.cpp" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(state_identifier): case YY_STATE_EOF(state_keyword): case YY_STATE_EOF(state_esope): case YY_STATE_EOF(state_lr): case YY_STATE_EOF(state_lrb): case YY_STATE_EOF(state_skip): case YY_STATE_EOF(state_skipall): case YY_STATE_EOF(state_skipnoop): case YY_STATE_EOF(state_error): case YY_STATE_EOF(state_findformat): case YY_STATE_EOF(state_scanfixpre): case YY_STATE_EOF(state_scanompfixed): case YY_STATE_EOF(state_scanompfree): case YY_STATE_EOF(state_incfilename): case YY_STATE_EOF(state_char): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of user's declarations */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); /* "- 2" to take care of EOB's */ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { yy_state_type yy_current_state; char *yy_cp; yy_current_state = (yy_start); yy_current_state += YY_AT_BOL(); (yy_state_ptr) = (yy_state_buf); *(yy_state_ptr)++ = yy_current_state; for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1368 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; *(yy_state_ptr)++ = yy_current_state; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { int yy_is_jam; YY_CHAR yy_c = 1; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 1368 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 1367); if ( ! yy_is_jam ) *(yy_state_ptr)++ = yy_current_state; return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT static void yyunput (int c, char * yy_bp ) { char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ int number_to_move = (yy_n_chars) + 2; char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_init_buffer( YY_CURRENT_BUFFER, input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree( (void *) b->yy_ch_buf ); yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return NULL; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = NULL; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer( b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (const char * yystr ) { return yy_scan_bytes( yystr, (int) strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = (yy_size_t) (_yybytes_len + 2); buf = (char *) yyalloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yynoreturn yy_fatal_error (const char* msg ) { fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ int yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param _line_number line number * */ void yyset_lineno (int _line_number ) { yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param _in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * _in_str ) { yyin = _in_str ; } void yyset_out (FILE * _out_str ) { yyout = _out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int _bdebug ) { yy_flex_debug = _bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; (yy_state_buf) = 0; (yy_state_ptr) = 0; (yy_full_match) = 0; (yy_lp) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = NULL; yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; yyfree ( (yy_state_buf) ); (yy_state_buf) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, const char * s2, int n ) { int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (const char * s ) { int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return malloc(size); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return realloc(ptr, size); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 406 "lexer.l" void lexer_set(Line_prep p, const int state) { input_string = p.get_line_encoded()+'\n'; pline = p; yy_delete_buffer(YY_CURRENT_BUFFER); BEGIN(INITIAL); yy_scan_string(input_string.c_str()); D(O("lexer_set");O(input_string);O(p.get_type_as_string(0));); lexer_enable(state); } void lexer_set(const std::string &s, const int state) { input_string = s+'\n'; D(O("lexer_set");O(input_string);); yy_delete_buffer(YY_CURRENT_BUFFER); yy_scan_string(input_string.c_str()); lexer_enable(state); } void lexer_enable(const int k) { switch(k) { case CHAR: BEGIN(state_char); break; case IDENTIFIER: BEGIN(state_identifier); break; case INCFILENAME: BEGIN(state_incfilename); break; case SKIPALL: BEGIN(state_skipall); break; case SKIP: BEGIN(state_skip); break; case SKIPNOOP: BEGIN(state_skipnoop); break; case KEYWORD: BEGIN(state_keyword); break; case ESOPE: BEGIN(state_esope); break; case FINDFORMAT: BEGIN(state_findformat); break; case SCANFIXPRE: BEGIN(state_scanfixpre); break; case SCANOMPFIXED: BEGIN(state_scanompfixed); break; case SCANOMPFREE: BEGIN(state_scanompfree); break; default: D(O("invalid parameter in lexer_enable");O(k);); BEGIN(state_error); break; } D(O("enabled");O(k);O(YY_START);); } std::string lexer_getname() { return lexer_name; } std::string lexer_getstlabel() { return lexer_stlabel; } std::string lexer_geti_number() { return lexeri_number; } std::string lexer_getrest() { return lexer_rest; } std::string lexer_getstring() { D(O("lexer_string");O(lexer_string);); return lexer_string; } std::string lexer_getlr() { D(O("lexer_lr");O(lexer_lr);); return lexer_lr; } std::string lexer_getinclude() { D(O("lexer_getinclude");O(lexer_include);); return lexer_include; } void extract_include() { // removes first and last character of rest of input line // example: // #include "file.inc" // after scanning of '#include ', the string "file.inc", // without quotes is put in lexer_include size_t l = input_string.length()-yyleng-1; lexer_include = input_string.substr(yyleng,l); if (lexer_include.size() > 1) { lexer_include.erase(lexer_include.end()-1); lexer_include.erase(lexer_include.begin()); } D(O("lexer_include");O(lexer_include);); } #if 0 // maybe we need this in the future: // not sure if this works OK std::stack input_string_stack; void lexer_push(std::string s, const int state) { // https://sourceforge.net/p/flex/mailman/message/30542280/ input_string_stack.push(s); input_string = s+'\n'; yypush_buffer_state(YY_CURRENT_BUFFER); yy_scan_string(input_string.c_str()); lexer_enable(state); } void lexer_pop() { yypop_buffer_state(); input_string=input_string_stack.top(); input_string_stack.pop(); } #endif void quiet_compiler() // to prevent warning about unused unput { char *a=0; yyunput(1,a); } findent-3.1.1/src/functions.h0000644000175000017500000000445513342461150013043 00000000000000#ifndef FUNCTIONS_H #define FUNCTIONS_H #include #include #include #include "simpleostream.h" inline std::string blanks(const int x) { if (x > 0) return std::string((size_t) x ,' '); else return ""; } inline std::string ltrim(const std::string &str) { const std::string whitespace = " \t"; size_t strBegin = str.find_first_not_of(whitespace); if (strBegin == std::string::npos) return ""; // no content return str.substr(strBegin); } inline std::string rtrim(const std::string &str) { const std::string whitespace = " \t"; size_t strEnd = str.find_last_not_of(whitespace); if (strEnd == std::string::npos) return ""; // no content return str.substr(0,strEnd+1); } inline std::string trim(const std::string &str) { const std::string whitespace = " \t"; size_t strBegin = str.find_first_not_of(whitespace); if (strBegin == std::string::npos) return ""; // no content size_t strEnd = str.find_last_not_of(whitespace); size_t strRange = strEnd - strBegin + 1; return str.substr(strBegin, strRange); } inline char firstchar(const std::string &s) { if (s.length() == 0) return 0; return s[0]; } inline char lastchar(const std::string &s) { size_t l = s.length(); if (l == 0) return 0; return s[l-1]; } extern Simpleostream mycout; template std::string number2string ( T number ) { std::ostringstream ss; ss << number; return ss.str(); } template T string2number ( const std::string &text ) { std::istringstream ss(text); T result; return ss >> result ? result : 0; } bool cleanfive(const std::string &s); std::string firstchars(const std::string &s, const int n); char firstchar(const std::string &s); char fixedmissingquote(const std::string &s); bool isalnumplus(const char c); bool isfixedcmtp(const std::string &s); char lastchar(const std::string &s); std::string ltab2sp(const std::string& s); int num_leading_spaces(const std::string &s); std::string remove_blanks(const std::string &s); std::string remove_trailing_comment(const std::string &s, const char prevquote = ' '); std::string stolower(const std::string &s); std::string stoupper(const std::string &s); #endif findent-3.1.1/src/emacs_help.inc0000644000175000017500000000332313402501024013436 00000000000000 std::cout << "Usage of findent in emacs" << std::endl; std::cout << "" << std::endl; std::cout << "After following one of these two methods, the buffer is indented with Ctrl-Alt-q" << std::endl; std::cout << "" << std::endl; std::cout << "Method 1:" << std::endl; std::cout << " - Put the output of" << std::endl; std::cout << "" << std::endl; std::cout << " findent --emacs_findent" << std::endl; std::cout << "" << std::endl; std::cout << " to the directory where you store your emacs scripts, for example:" << std::endl; std::cout << "" << std::endl; std::cout << " mkdir -p ~/.emacs.d/lisp && findent --emacs_findent > ~/.emacs.d/lisp/findent.el" << std::endl; std::cout << "" << std::endl; std::cout << " - Edit .emacs or .emacs.el or .emacs.d/init.el :" << std::endl; std::cout << "" << std::endl; std::cout << " - If not already done, add the following two lines to extend load-path :" << std::endl; std::cout << "" << std::endl; std::cout << " (add-to-list 'load-path (concat user-emacs-directory" << std::endl; std::cout << " (convert-standard-filename \"lisp/\")))" << std::endl; std::cout << "" << std::endl; std::cout << " - Add a command to load findent.el :" << std::endl; std::cout << "" << std::endl; std::cout << " (load \"findent\")" << std::endl; std::cout << " " << std::endl; std::cout << "Method 2:" << std::endl; std::cout << "" << std::endl; std::cout << " - Add the output of " << std::endl; std::cout << "" << std::endl; std::cout << " findent --emacs_findent" << std::endl; std::cout << "" << std::endl; std::cout << " to ~/.emacs ~/.emacs.el or ~/.emacs.d/init.el" << std::endl; std::cout << "" << std::endl; findent-3.1.1/src/parser.h0000644000175000017500000001077713476205436012346 00000000000000/* A Bison parser, made by GNU Bison 3.3.2. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 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 3 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, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Undocumented macros, especially those whose name start with YY_, are private implementation details. Do not rely on them. */ #ifndef YY_YY_PARSER_HPP_INCLUDED # define YY_YY_PARSER_HPP_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { MODULE = 258, SUBFUN = 259, ENTRY = 260, SUBMODULE = 261, MODULESUBROUTINE = 262, MODULEFUNCTION = 263, END = 264, ENDSUBROUTINE = 265, ENDFUNCTION = 266, ENDPROGRAM = 267, ENDMODULE = 268, ENDSUBMODULE = 269, IF = 270, THEN = 271, ELSE = 272, ELSEIF = 273, ENDIF = 274, WHERE = 275, ENDWHERE = 276, FORALL = 277, ENDFORALL = 278, ELSEWHERE = 279, DO = 280, DOCOMMA = 281, DOWHILE = 282, DOCONCURRENT = 283, ENDDO = 284, SELECTCASE = 285, SELECTTYPE = 286, ENDSELECT = 287, CASE = 288, CASEDEFAULT = 289, TYPEIS = 290, CLASSIS = 291, CLASSDEFAULT = 292, INTERFACE = 293, ABSTRACTINTERFACE = 294, ENDINTERFACE = 295, CONTAINS = 296, BLOCK = 297, ENDBLOCK = 298, BLOCKDATA = 299, ENDBLOCKDATA = 300, ASSOCIATE = 301, ENDASSOCIATE = 302, CRITICAL = 303, ENDCRITICAL = 304, CHANGETEAM = 305, ENDTEAM = 306, ENUM = 307, ENDENUM = 308, ASSIGNMENT = 309, ASSIGN = 310, TO = 311, MODULEPROCEDURE = 312, PROCEDURE = 313, ENDPROCEDURE = 314, TIDENTIFIER = 315, BLANK = 316, CHAR = 317, FINDFORMAT = 318, UNKNOWN = 319, FREE = 320, FIXED = 321, UNSURE = 322, PROBFREE = 323, FINDENTFIX = 324, FIXFINDENTFIX = 325, P_ON = 326, P_OFF = 327, SCANFIXPRE = 328, CPP_IF = 329, CPP_ENDIF = 330, CPP_ELSE = 331, CPP_ELIF = 332, CPP = 333, COCO_IF = 334, COCO_ENDIF = 335, COCO_ELSE = 336, COCO_ELIF = 337, COCO = 338, INCLUDE = 339, INCLUDE_CPP = 340, INCLUDE_CPP_STD = 341, INCLUDE_COCO = 342, INCFILENAME = 343, USE = 344, SEGMENT = 345, ENDSEGMENT = 346, ESOPE = 347, IDENTIFIER = 348, SKIP = 349, SKIPALL = 350, SKIPNOOP = 351, KEYWORD = 352, ELEMENTAL = 353, IMPURE = 354, PURE = 355, RECURSIVE = 356, SUBROUTINE = 357, FUNCTION = 358, PROGRAM = 359, EOL = 360, NAMED_LABEL = 361, STLABEL = 362, TYPE = 363, ENDTYPE = 364, CLASS = 365, BASICTYPE = 366, TYPEC = 367, QSTRING = 368, HSTRING = 369, LR = 370, LRB = 371, DOTOPERATOR = 372, I_NUMBER = 373, UNCLASSIFIED = 374, ERROR = 375, OMP = 376, SCANOMPFIXED = 377, SCANOMPFREE = 378, LAST_TOKEN = 379 }; #endif /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_PARSER_HPP_INCLUDED */ findent-3.1.1/src/findent_types.h0000644000175000017500000000145013361274146013706 00000000000000#ifndef NFINDENT_TYPES_H #define NFINDENT_TYPES_H #include #include #include typedef std::deque dolabels_t; typedef std::deque dolabels_store_t; typedef std::deque indent_t; typedef std::deque indent_store_t; typedef std::deque fs_store_t; typedef std::deque nbseen_store_t; template std::ostream& operator <<(std::ostream &os, std::deque &obj) { // // to print a deque // if (obj.empty()) { os << ":empty"<::iterator it = obj.begin(); int i = 0; while (it != obj.end()) os << ++i << ":" << *it++ << std::endl; return os; } #endif findent-3.1.1/src/findent.cpp0000644000175000017500000000053013474470440013013 00000000000000#include #include "docs.h" #include "fixed.h" #include "fortran.h" #include "free.h" #include "findent.h" #include "findentclass.h" int main(int argc, char*argv[]) { Flags flags; int todo = flags.get_flags(argc, argv); Docs docs; if (docs.print(todo)) return 0; Findent findent(flags); findent.run(); } findent-3.1.1/src/docs.h0000644000175000017500000000111713363350222011753 00000000000000#ifndef DOCS_H #define DOCS_H #include class Docs { public: bool print(int todo); private: void emacs_findent(); void emacs_help(); void gedit_external(); void gedit_help(); void gedit_plugin(); void gedit_plugin_py(); void makefdeps(); void readme(); void usage(bool man); void version(); void vim_findent(); void vim_fortran(); void vim_help(); void manout(const std::string flag, const std::string txt); void replaceAll( std::string &s, const std::string &search, const std::string &replace ); bool doman; }; #endif findent-3.1.1/src/gedit_help.inc0000644000175000017500000001045413402501024013445 00000000000000 std::cout << "Usage of findent in gedit" << std::endl; std::cout << "" << std::endl; std::cout << "1) as an external tool:" << std::endl; std::cout << "" << std::endl; std::cout << " Enter the following commands:" << std::endl; std::cout << "" << std::endl; std::cout << "#################################################" << std::endl; std::cout << "mkdir -p $HOME/bin" << std::endl; std::cout << "findent --gedit_external > $HOME/bin/findent-gedit" << std::endl; std::cout << "chmod +x $HOME/bin/findent-gedit" << std::endl; std::cout << "#################################################" << std::endl; std::cout << "" << std::endl; std::cout << " Make sure the $HOME/bin is in the PATH environment variable." << std::endl; std::cout << "" << std::endl; std::cout << " Open gedit:" << std::endl; std::cout << " ----------------------- " << std::endl; std::cout << " (Edit ->) Preferences -> plugins : enable \"External Tools\"" << std::endl; std::cout << " Close gedit and start it again." << std::endl; std::cout << " Tools -> Manage External Tools -> Add" << std::endl; std::cout << " - rename \"New Tool\" into findent" << std::endl; std::cout << " - put " << std::endl; std::cout << " findent-gedit" << std::endl; std::cout << " in the tool" << std::endl; std::cout << " Shortcut Key: F11 (or something more to your liking)" << std::endl; std::cout << " Save: Nothing" << std::endl; std::cout << " Input: Current document" << std::endl; std::cout << " Output: Replace current document" << std::endl; std::cout << " Applicability: All documents Fortran 95" << std::endl; std::cout << " " << std::endl; std::cout << " ----------------------- " << std::endl; std::cout << "" << std::endl; std::cout << " Alternatively, if all is well, it would be sufficient to place" << std::endl; std::cout << " the command" << std::endl; std::cout << " findent -Ia -i3" << std::endl; std::cout << " in the tool, but the script findent-gedit does some sanity checks" << std::endl; std::cout << " to prevent \"oops\" experiences." << std::endl; std::cout << "" << std::endl; std::cout << "2) as plugin:" << std::endl; std::cout << "" << std::endl; std::cout << " Find the location of the directory where gedit expects the configuration" << std::endl; std::cout << " files, we assume here $HOME/.local/share/gedit/plugins" << std::endl; std::cout << " Enter the following commands:" << std::endl; std::cout << "" << std::endl; std::cout << "##################################################" << std::endl; std::cout << "geditroot=$HOME/.local/share/gedit/plugins" << std::endl; std::cout << "mkdir -p $geditroot" << std::endl; std::cout << "findent --gedit_plugin > $geditroot/findent.plugin" << std::endl; std::cout << "findent --gedit_plugin_py > $geditroot/findent.py" << std::endl; std::cout << "##################################################" << std::endl; std::cout << "" << std::endl; std::cout << " in gedit:" << std::endl; std::cout << " (Edit ->) Preferences -> plugins -> check: findent" << std::endl; std::cout << " findent is available in popup menu (right-click) and" << std::endl; std::cout << " shortcut f . You can change that in " << std::endl; std::cout << " findent.py, look for the definition of 'shortcut'." << std::endl; std::cout << "" << std::endl; std::cout << " Advantage of plugin over external tool: gedit scrolls" << std::endl; std::cout << " back to point where you called findent." << std::endl; std::cout << "" << std::endl; std::cout << "Flags for findent:" << std::endl; std::cout << "" << std::endl; std::cout << " both the external command as the plugin pass the environment" << std::endl; std::cout << " variable GEDIT_FINDENT_FLAGS to findent. Example: if you" << std::endl; std::cout << " want general indentation set to 2 but indentation of do-loops" << std::endl; std::cout << " set to 4, specify:" << std::endl; std::cout << " export GEDIT_FINDENT_FLAGS=\"-i2 -d4\"" << std::endl; std::cout << " Use" << std::endl; std::cout << " findent -h" << std::endl; std::cout << " for a list of flags." << std::endl; findent-3.1.1/src/line_prep.h0000644000175000017500000000431713340740147013011 00000000000000#ifndef LINE_PREP_H #define LINE_PREP_H #include #include #include #include "functions.h" class Line_prep { private: std::string line,sl,sv,sc,rest; char place_holder; struct whats { int type; std::string value; char stringtype; }; std::vector wv; public: enum { is_invalid, is_none, is_string, is_stlabel, is_dotop }; Line_prep(const std::string s); Line_prep() {} void set_place_holder(const char c) { place_holder = c; } char get_place_holder() { return place_holder; } std::string get_line() { return line; } std::string get_line_spaces_removed() { return sl; } std::string get_line_compressed() { return sv; } std::string get_line_encoded() { return sc; } std::string get_line_rest() { return rest; } int get_type(const unsigned int i) { if (i < wv.size()) return wv[i].type; else return is_invalid; } int get_type(const std::string &s) { return get_type(string2number(s)); } std::string get_type_as_string(const unsigned int i) { int k = get_type(i); switch(k) { case is_invalid: return ("invalid"); case is_none: return ("none"); case is_string: return ("string"); case is_stlabel: return ("label"); case is_dotop: return ("dotop"); default: return ("impossible"); } } std::string get_type_as_string(const std::string &s) { return get_type_as_string(string2number(s)); } std::string get_value(const unsigned i) { if (i < wv.size()) return wv[i].value; else return ""; } std::string get_value(const std::string &s) { return get_value(string2number(s)); } char get_stringtype(const unsigned i) { if (i < wv.size()) return wv[i].stringtype; else return ' '; } char get_stringtype(const std::string &s) { return get_stringtype(string2number(s)); } }; #endif findent-3.1.1/src/emacs_findent.inc0000644000175000017500000001060213402501024014133 00000000000000 std::cout << ";;;; this file contains an interface to use findent within emacs." << std::endl; std::cout << ";;;; the C-M-q command (\"indent function\") is redefined to" << std::endl; std::cout << ";;;; indent the whole buffer." << std::endl; std::cout << "; how to call findent for a fixed format Fortran source:" << std::endl; std::cout << "(defvar fortran-findent-command " << std::endl; std::cout << " \"findent -ifixed -Ia\"" << std::endl; std::cout << " \"findent command for fixed format fortran source\")" << std::endl; std::cout << ";" << std::endl; std::cout << "; how to call findent for a free format Fortran source:" << std::endl; std::cout << "(defvar f90-findent-command " << std::endl; std::cout << " \"findent -ifree -Ia\"" << std::endl; std::cout << " \"findent command for free format fortran source\")" << std::endl; std::cout << ";" << std::endl; std::cout << ";;;; define function findent-indent-buffer: it calls the program" << std::endl; std::cout << ";;;; findent with the whole buffer as input and output" << std::endl; std::cout << "(defun findent-indent-buffer()" << std::endl; std::cout << " \" " << std::endl; std::cout << " Function that uses findent to indent the whole buffer." << std::endl; std::cout << " The call to findent must be provided in the string findent-command," << std::endl; std::cout << " for example (setq findent-command \\\"findent -ifixed -Ia\\\")" << std::endl; std::cout << " Findent supports Fortran-2008, free and fixed format;" << std::endl; std::cout << " indents correctly DO statements that share a common label;" << std::endl; std::cout << " is in general not confused by #if, #ifdef or #else preprocessor" << std::endl; std::cout << " statements." << std::endl; std::cout << " \"" << std::endl; std::cout << " (interactive)" << std::endl; std::cout << " (let (" << std::endl; std::cout << " (lines (count-lines (point-min) (point-max)))" << std::endl; std::cout << " (lpos (line-number-at-pos))" << std::endl; std::cout << " (first-window-line)" << std::endl; std::cout << " (offset)" << std::endl; std::cout << " (linelength)" << std::endl; std::cout << " (pos (point))" << std::endl; std::cout << " )" << std::endl; std::cout << " ; this function tries to restore cursor and window" << std::endl; std::cout << " ; position after indenting, hence the extra code." << std::endl; std::cout << " ; If somebody knows something better ..." << std::endl; std::cout << " (beginning-of-line)" << std::endl; std::cout << " (end-of-line)" << std::endl; std::cout << " (skip-chars-backward \"[:blank:]\")" << std::endl; std::cout << " (setq offset (- (point) pos))" << std::endl; std::cout << " (if (< offset 0) (setq offset 0))" << std::endl; std::cout << " (move-to-window-line 0)" << std::endl; std::cout << " (setq first-window-line (line-number-at-pos))" << std::endl; std::cout << " (message \"indenting buffer ...\" )" << std::endl; std::cout << " (shell-command-on-region (point-min) (point-max) findent-command 1 1 )" << std::endl; std::cout << " (goto-line lpos)" << std::endl; std::cout << " (redisplay)" << std::endl; std::cout << " (move-to-window-line 0)" << std::endl; std::cout << " (scroll-down (- (line-number-at-pos) first-window-line))" << std::endl; std::cout << " (goto-line lpos)" << std::endl; std::cout << " (setq pos (point))" << std::endl; std::cout << " (end-of-line)" << std::endl; std::cout << " (setq linelength (- (point) pos))" << std::endl; std::cout << " (if (< offset linelength)" << std::endl; std::cout << " (backward-char offset)" << std::endl; std::cout << " (beginning-of-line))" << std::endl; std::cout << " (message \"indenting buffer ... %d lines indented\" lines)" << std::endl; std::cout << " )" << std::endl; std::cout << " )" << std::endl; std::cout << ";" << std::endl; std::cout << "(add-hook 'fortran-mode-hook (lambda() (setq findent-command fortran-findent-command)))" << std::endl; std::cout << "(add-hook 'f90-mode-hook (lambda() (setq findent-command f90-findent-command)))" << std::endl; std::cout << "(add-hook 'fortran-mode-hook (lambda() (local-set-key \"\\C-\\M-q\" 'findent-indent-buffer)))" << std::endl; std::cout << "(add-hook 'f90-mode-hook (lambda() (local-set-key \"\\C-\\M-q\" 'findent-indent-buffer)))" << std::endl; findent-3.1.1/src/fortranline.cpp0000644000175000017500000000615113343756223013715 00000000000000#include #include "fortranline.h" void Fortranline::print() { std::cout << "orig_line: [" << orig_line << "]" << std::endl; std::cout << "trim: [" << trim() << "]" << std::endl; std::cout << "ltrim: [" << ltrim() << "]" << std::endl; std::cout << "rtrim: [" << rtrim() << "]" << std::endl; std::cout << "trimmed_line: [" << trimmed_line() << "]" << std::endl; std::cout << "firstchar: [" << firstchar() << "]" << std::endl; std::cout << "lastchar: [" << lastchar() << "]" << std::endl; std::cout << "first2chars: [" << first2chars() << "]" << std::endl; std::cout << "scanfixpre: " << scanfixpre() << std::endl; std::cout << "rest: [" << rest() << "]" << std::endl; std::cout << "global_format:" << g_format2txt() << std::endl; } std::ostream& operator <<(std::ostream &os,Fortranline &obj) { os<<"["<global_omp) return 0; if (format() == FIXED) lexer_set(orig_line,SCANOMPFIXED); else lexer_set(orig_line,SCANOMPFREE); int rc = yylex(); return rc == OMP; } findent-3.1.1/src/findentrun.cpp0000644000175000017500000000320613474731262013545 00000000000000#include "findentclass.h" #include "free.h" #include "fixed.h" #include "fortran.h" #include "debug.h" int Findent::run() { handle_reading_from_tty(); if (input_format == UNKNOWN) input_format = determine_fix_or_free(); gl->global_format = input_format; if (flags.only_fix_free) { switch(input_format) { case FREE: std::cout << "free" << std::endl; break; case FIXED: std::cout << "fixed" << std::endl; break; default: std::cout << "free" << std::endl; break; } return what_to_return(); } start_indent = flags.start_indent; output_format = flags.output_format; if(output_format == 0) output_format = input_format; Fortran *source; switch (input_format) { case FREE: source = new Free(this); break; default: source = new Fixed(this); break; } init_indent(); if (flags.last_usable_only) { mycout.setoutput(0); source->handle_last_usable_only(); delete source; return what_to_return(); } if (flags.last_indent_only || flags.deps) mycout.setoutput(0); cur_indent = start_indent; while(1) { source->full_statement = ""; D(O("full_statement1");O(source->full_statement);); source->get_full_statement(); D(O("full_statement2");O(source->full_statement);); source->indent_and_output(); if (end_of_file) { if(flags.last_indent_only) std::cout << num_leading_spaces(mycout.get()) << endline; if(flags.deps) output_deps(); delete source; return what_to_return(); } } return what_to_return(); // never reached } findent-3.1.1/src/globals.h0000644000175000017500000000027113342236015012446 00000000000000#ifndef GLOBALS_H #define GLOBALS_H class Globals { public: int global_format; bool global_gnu_format; int global_line_length; bool global_omp; }; #endif findent-3.1.1/src/lexer.l0000644000175000017500000004644413447027625012175 00000000000000%{ #include #include #include #include #include "debug.h" #include "lexer.h" #include "line_prep.h" #include "parser.h" #define YY_DECL extern "C" int yylex() std::stack start_stack; std::string lexer_name, lexer_stlabel, lexeri_number, lexer_rest, lexer_string, lexer_lr; std::string lexer_include; std::string input_string; int lrlevel; bool lrreturn; Line_prep pline; %} %s state_identifier state_keyword state_esope %x state_lr state_lrb state_skip state_skipall state_skipnoop state_error %x state_findformat state_scanfixpre state_scanompfixed state_scanompfree %x state_incfilename state_char b [ \t] // following are keywords starting with c ckey call|close|common|continue|case|contains|cycle|class|codimension|contiguous|critical|complex|changeteam %% . { D(O("ERROR");Y;); return ERROR; } { "(" { D(O("lrplus");O(lrlevel);Y;); lrlevel++; } ")" { D(O("lrmin");O(lrlevel);Y;); lrlevel--; if(lrlevel == 0) { D(O("state:");O(start_stack.top());O(lrreturn);); BEGIN(start_stack.top()); start_stack.pop(); if(lrreturn) { return LR; } } } . { D(O("lrbla");O(lrlevel);Y;); lexer_lr += yytext; } \n { D(O("lreol");O(lrlevel);Y;); yyless(0); BEGIN(start_stack.top()); } } { "[" { D(O("lrb+");O(lrlevel);Y;); lrlevel++; } "]" { D(O("lrb-");O(lrlevel);Y;); lrlevel--; if(lrlevel == 0) { D(O("state:");O(start_stack.top());O(lrreturn);); BEGIN(start_stack.top()); start_stack.pop(); if(lrreturn) { return LRB; } } } . { D(O("lrbbla");O(lrlevel);Y;); } \n { D(O("lrbeol");O(lrlevel);Y;) yyless(0); BEGIN(start_stack.top()); } } { "(" { D(O("skipLPAREN");Y;); start_stack.push(YY_START); lrlevel = 1; lrreturn = 0; lexer_lr = ""; BEGIN(state_lr); } "[" { D(O("skipLPAREN");Y;); start_stack.push(YY_START); lrlevel = 1; lrreturn = 0; BEGIN(state_lrb); } } "=" { D(O("NOSKIP");Y;); return yytext[yyleng-1]; } [,|~!#$] { D(O("NOSKIPNOOP");Y;); return yytext[yyleng-1]; } { \n { D(O("endSKIP");Y;); switch(YY_START) { case state_skip: return SKIP; case state_skipall: return SKIPALL; case state_skipnoop: return SKIPNOOP; } } . { D(O("SKIP");Y;); } } { [[:alpha:]][[:alnum:]_$]* { D(O("IDENTIFIER");Y;); lexer_name = yytext; return IDENTIFIER; } [[:alpha:]][[:alnum:]_$%]* { D(O("TIDENTIFIER");Y;); lexer_name = yytext; return TIDENTIFIER; } } { /* to be used in '#include ' */ [^>]+ { D(O("INCFILENAME");Y;); lexer_string = yytext; BEGIN state_char; return INCFILENAME; } } { \n { D(O("EOL");); return EOL; } . { D(O("BLA");Y;); return yytext[0]; } } { abstractinterface { D(O("ABSTRACTINTERFACE");Y;); return ABSTRACTINTERFACE; } associate { D(O("ASSOCIATE");Y;); return ASSOCIATE; } assign { D(O("ASSIGN");Y;); return ASSIGN; } block { D(O("BLOCK");Y;); return BLOCK; } blockdata { D(O("BLOCKDATA");Y;); return BLOCKDATA; } casedefault { D(O("CASEDEFAULT");Y); return CASEDEFAULT; } case { D(O("CASE");Y); return CASE; } character { D(O("CHARACTER");Y;); return BASICTYPE; } classdefault { D(O("CLASSDEFAULT");Y); return CLASSDEFAULT; } changeteam { D(O("CHANGETEAM");Y); return CHANGETEAM; } class { D(O("CLASS");Y;); return CLASS; } classis { D(O("CLASSIS");Y); return CLASSIS; } complex { D(O("COMPLEX");Y;); return BASICTYPE; } contains { D(O("CONTAINS");Y); return CONTAINS; } critical { D(O("CRITICAL");Y;); return CRITICAL; } do { D(O("DO");Y;); return DO; } do, { D(O("DO,");Y;); return DOCOMMA; } doconcurrent { D(O("DOCONCURRENT");Y;); return DOCONCURRENT; } do,concurrent { D(O("DO,CONCURRENT");Y;); return DOCONCURRENT; } dowhile { D(O("DOWHILE");Y;); return DOWHILE; } do,while { D(O("DO,WHILE");Y;); return DOWHILE; } doublecomplex { D(O("DOUBLECOMPLEX");Y;); return BASICTYPE; } doubleprecision { D(O("DOUBLEPRECISION");Y;); return BASICTYPE; } elemental { D(O("ELEMENTAL");Y;); return ELEMENTAL; } else { D(O("ELSE");Y); return ELSE; } elseif { D(O("ELSEIF");Y); return ELSEIF; } elsewhere { D(O("ELSEWHERE");Y); return ELSEWHERE; } endassociate { D(O("ENDASSOCIATE");Y;); return ENDASSOCIATE; } endblock { D(O("ENDBLOCK");Y;); return ENDBLOCK; } endblockdata { D(O("ENDBLOCKDATA");Y;); return ENDBLOCKDATA; } endcritical { D(O("ENDCRITICAL");Y;); return ENDCRITICAL; } enddo { D(O("ENDDO");Y;); return ENDDO; } end { D(O("END");Y;); return END; } endenum { D(O("ENDENUM");Y;); return ENDENUM; } endforall { D(O("ENDFORALL");Y;); return ENDFORALL; } endfunction { D(O("ENDFUNCTION");Y;); return ENDFUNCTION; } endif { D(O("ENDIF");Y); return ENDIF; } endinterface { D(O("ENDINTERFACE");Y;); return ENDINTERFACE; } endmodule { D(O("ENDMODULE");Y;); return ENDMODULE; } endprocedure { D(O("ENDPROCEDURE");Y;); return ENDPROCEDURE; } endprogram { D(O("ENDPROGRAM");Y;); return ENDPROGRAM; } endselect { D(O("ENDSELECT");Y); return ENDSELECT; } endsubroutine { D(O("ENDSUBROUTINE");Y;); return ENDSUBROUTINE; } endsubmodule { D(O("ENDSUBMODULE");Y;); return ENDSUBMODULE; } endteam { D(O("ENDTEAM");Y); return ENDTEAM; } endtype { D(O("ENDTYPE");Y;); return ENDTYPE; } endwhere { D(O("ENDWHERE");Y;); return ENDWHERE; } entry { D(O("ENTRY");Y); return ENTRY; } enum { D(O("ENUM");Y;); return ENUM; } forall { D(O("FORALL");Y;); return FORALL; } function { D(O("FUNCTION");Y;); return FUNCTION; } if { D(O("IF");Y;); return IF; } impure { D(O("IMPURE");Y;); return IMPURE; } include { D(O("INCLUDE");Y;); return INCLUDE; } integer { D(O("INTEGER");Y;); return BASICTYPE; } interface { D(O("INTERFACE");Y;); return INTERFACE; } logical { D(O("LOGICAL");Y;); return BASICTYPE; } module { D(O("MODULE");Y); return MODULE; } moduleprocedure { D(O("MODULEPROCEDURE");Y); return MODULEPROCEDURE; } modulesubroutine { D(O("MODULESUBROUTINE");Y); return MODULESUBROUTINE; } modulefunction { D(O("MODULEFUNCTION");Y); return MODULEFUNCTION; } procedure { D(O("PROCEDURE");Y); return PROCEDURE; } program { D(O("PROGRAM");Y;); return PROGRAM; } pure { D(O("PURE");Y;); return PURE; } real { D(O("REAL");Y;); return BASICTYPE; } recursive { D(O("RECURSIVE");Y;); return RECURSIVE; } selectcase { D(O("SELECTCASE");Y); return SELECTCASE; } selecttype { D(O("SELECTTYPE");Y); return SELECTTYPE; } submodule { D(O("SUBMODULE");Y;); return SUBMODULE; } subroutine { D(O("SUBROUTINE");Y;); return SUBROUTINE; } to { D(O("TO");Y;); return TO; } then { D(O("THEN");Y;); return THEN; } type { D(O("TYPE");Y;); return TYPE; } type/\( { D(O("TYPEC");Y;); return TYPEC; } typeis { D(O("TYPEIS");Y); return TYPEIS; } use { D(O("USE");Y); return USE; } where { D(O("WHERE");Y;); return WHERE; } } { segment { D(O("SEGMENT");Y;); return SEGMENT; } segment, { D(O("SEGMENT,");Y;); return SEGMENT; } endsegment { D(O("ENDSEGMENT");Y;); return ENDSEGMENT; } } { ^\?\?.*\n { D(O("UNSURE");Y;); return UNSURE; } ^[^dDcC#!* 0-9].*\n { D(O("FREE");Y;); return FREE; } ^[ 0-9]{1,4}[[:alpha:]_%].*\n { D(O("FREE");Y;); return FREE; } ^[^!]*!.*\n { D(O("UNSURE");Y;); return UNSURE; } ^[ ]{5}&[^&]*\n { D(O("UNSURE");Y;); return UNSURE; } ^.{0,4}&{b}*\n { D(O("FREE");Y;); return FREE; } ^.{6,}&{b}*\n { D(O("FREE");Y;); return FREE; } ^[^&]*&{b}*\n { D(O("FREE");Y;); return FREE; } ^[ ]{0,4}&.*\n { D(O("FREE");Y;); return FREE; } ^[ ]{6,}&.*\n { D(O("FREE");Y;); return FREE; } ^{ckey}.*\n { D(O("FREE");Y;); return FREE; } ^c{b}+[[:alnum:]].*\n { D(O("FIXED");Y;); return FIXED; } ^[ 0123456789]{6}.*\n { D(O("UNSURE");Y;); return UNSURE; } .*\n { D(O("UNSURE");Y;); return UNSURE; } } { ^[c!\*]\$[ 0-9]{3}[ 0]{0,1} | /* a first line */ ^[c!\*]\$[ ]{3}[^ ^0] | /* a continuation line */ ^[c!\*]\${b}* { D(O("FIXOMP");Y;); return OMP; } \n { D(O("EOL");); return EOL; } . { D(O("BLA");Y;); return yytext[0]; } } { ^{b}*!\$$ | ^{b}*!\${b} { D(O("OMP");Y;); return OMP; } \n { D(O("EOL");); return EOL; } . { D(O("BLA");Y;); return yytext[0]; } } { {b}*\!{b}*findentfix:p-on { D(O("FINDENTFIX P-ON");Y;); return P_ON; } ^[c\*]{b}*findentfix:p-on { D(O("FIXFINDENTFIX P-ON");Y;); return P_ON; } {b}*\!{b}*findentfix:p-off { D(O("FINDENTFIX P-OFF");Y;); return P_OFF; } ^[c\*]{b}*findentfix:p-off { D(O("FIXFINDENTFIX P-OFF");Y;); return P_OFF; } {b}*\!{b}*findentfix: { D(O("FINDENTFIX");Y;); size_t l = input_string.length()-yyleng-1; lexer_rest = input_string.substr(yyleng,l); return FINDENTFIX; } ^[c\*]{b}*findentfix: { D(O("FIXFINDENTFIX");Y;); size_t l = input_string.length()-yyleng-1; lexer_rest = input_string.substr(yyleng,l); return FIXFINDENTFIX; } ^{b}*# { D(O("CPP");Y;); return CPP; } ^{b}*#{b}*if { D(O("CPP_IF");Y;); return CPP_IF; } ^{b}*#{b}*endif { D(O("CPP_ENDIF");Y;); return CPP_ENDIF; } ^{b}*#{b}*else { D(O("CPP_ELSE");Y;); return CPP_ELSE; } ^{b}*#{b}*elif { D(O("CPP_ELIF");Y;); return CPP_ELIF; } ^{b}*#{b}*include{b}*/\"[^\n]*\"{b}*\n { D(O("INCLUDE_CPP");Y;); extract_include(); return INCLUDE_CPP; } ^{b}*#{b}*include{b}*/<[^\n]*>{b}*\n { D(O("INCLUDE_CPP_STD");Y;); extract_include(); return INCLUDE_CPP_STD; } ^{b}*\?\? { D(O("COCO");Y;); return COCO; } ^{b}*\?\?{b}*i{b}*f { D(O("COCO_IF");Y;); return COCO_IF; } ^{b}*\?\?{b}*e{b}*n{b}*d{b}*i{b}*f { D(O("COCO_ENDIF");Y;); return COCO_ENDIF; } ^{b}*\?\?{b}*e{b}*l{b}*s{b}*e { D(O("COCO_ELSE");Y;); return COCO_ELSE; } ^{b}*\?\?{b}*e{b}*l{b}*s{b}*e{b}*i{b}*f { D(O("COCO_ELIF");Y;); return COCO_ELIF; } ^{b}*\?\?{b}*i{b}*n{b}*c{b}*l{b}*u{b}*d{b}*e{b}*/\'[^\n]+\'{b}*\n { D(O("INCLUDE_COCO");Y;); /* coco statements must start with '??' in column 1. However, for this code that is somewhat inconvenient, so we allow white space before '??' */ extract_include(); return INCLUDE_COCO; } ^{b}*\?\?{b}*i{b}*n{b}*c{b}*l{b}*u{b}*d{b}*e{b}*/\"[^\n]+\"{b}*\n { D(O("INCLUDE_COCO");Y;); /* coco statements must start with '??' in column 1. However, for this code that is somewhat inconvenient, so we allow white space before '??' */ extract_include(); return INCLUDE_COCO; } \n { D(O("EOL");); return EOL; } . { D(O("BLA");Y;); return yytext[0]; } } " "[0-9]*" " { int type = pline.get_type(std::string(yytext)); D(O("found_special");O(type);O(pline.get_type_as_string(std::string(yytext)));Y;); D(O("encoded line");O(pline.get_line_encoded());); if (type == pline.is_string) { lexer_string = pline.get_value(std::string(yytext)); D(O("QSTRING");O(lexer_string);Y;); return QSTRING; } if (type == pline.is_stlabel) { lexer_stlabel = pline.get_value(std::string(yytext)); D(O("STLABEL");O(lexer_stlabel);Y;); return STLABEL; } if (type == pline.is_dotop) { D(O("DOTOPERATOR");); return DOTOPERATOR; } D(O("This should not happen");); } [[:alpha:]][[:alnum:]_]*:/[^:] { D(O("NAMED_LABEL");Y;); lexer_name = yytext; lexer_name.erase(lexer_name.size()-1); return NAMED_LABEL; } [0-9][0-9]* { D(O("I_NUMBER");Y;); lexer_name = yytext; lexeri_number = yytext; return I_NUMBER; } "(" { D(O("LPAREN");Y;); start_stack.push(YY_START); lrlevel = 1; lrreturn = 1; lexer_lr = ""; BEGIN(state_lr); } "[" { D(O("LPARENB");Y;); start_stack.push(YY_START); lrlevel = 1; lrreturn = 1; BEGIN(state_lrb); } ^\n { D(O("BLANK");); return BLANK; } \n { D(O("EOL");); return EOL; } . { D(O("BLA");Y;); return yytext[0]; } %% void lexer_set(Line_prep p, const int state) { input_string = p.get_line_encoded()+'\n'; pline = p; yy_delete_buffer(YY_CURRENT_BUFFER); BEGIN(INITIAL); yy_scan_string(input_string.c_str()); D(O("lexer_set");O(input_string);O(p.get_type_as_string(0));); lexer_enable(state); } void lexer_set(const std::string &s, const int state) { input_string = s+'\n'; D(O("lexer_set");O(input_string);); yy_delete_buffer(YY_CURRENT_BUFFER); yy_scan_string(input_string.c_str()); lexer_enable(state); } void lexer_enable(const int k) { switch(k) { case CHAR: BEGIN(state_char); break; case IDENTIFIER: BEGIN(state_identifier); break; case INCFILENAME: BEGIN(state_incfilename); break; case SKIPALL: BEGIN(state_skipall); break; case SKIP: BEGIN(state_skip); break; case SKIPNOOP: BEGIN(state_skipnoop); break; case KEYWORD: BEGIN(state_keyword); break; case ESOPE: BEGIN(state_esope); break; case FINDFORMAT: BEGIN(state_findformat); break; case SCANFIXPRE: BEGIN(state_scanfixpre); break; case SCANOMPFIXED: BEGIN(state_scanompfixed); break; case SCANOMPFREE: BEGIN(state_scanompfree); break; default: D(O("invalid parameter in lexer_enable");O(k);); BEGIN(state_error); break; } D(O("enabled");O(k);O(YY_START);); } std::string lexer_getname() { return lexer_name; } std::string lexer_getstlabel() { return lexer_stlabel; } std::string lexer_geti_number() { return lexeri_number; } std::string lexer_getrest() { return lexer_rest; } std::string lexer_getstring() { D(O("lexer_string");O(lexer_string);); return lexer_string; } std::string lexer_getlr() { D(O("lexer_lr");O(lexer_lr);); return lexer_lr; } std::string lexer_getinclude() { D(O("lexer_getinclude");O(lexer_include);); return lexer_include; } void extract_include() { // removes first and last character of rest of input line // example: // #include "file.inc" // after scanning of '#include ', the string "file.inc", // without quotes is put in lexer_include size_t l = input_string.length()-yyleng-1; lexer_include = input_string.substr(yyleng,l); if (lexer_include.size() > 1) { lexer_include.erase(lexer_include.end()-1); lexer_include.erase(lexer_include.begin()); } D(O("lexer_include");O(lexer_include);); } #if 0 // maybe we need this in the future: // not sure if this works OK std::stack input_string_stack; void lexer_push(std::string s, const int state) { // https://sourceforge.net/p/flex/mailman/message/30542280/ input_string_stack.push(s); input_string = s+'\n'; yypush_buffer_state(YY_CURRENT_BUFFER); yy_scan_string(input_string.c_str()); lexer_enable(state); } void lexer_pop() { yypop_buffer_state(); input_string=input_string_stack.top(); input_string_stack.pop(); } #endif void quiet_compiler() // to prevent warning about unused unput { char *a=0; yyunput(1,a); } findent-3.1.1/src/parser.y0000644000175000017500000003563313447065507012366 00000000000000%{ #include #include "debug.h" #include "lexer.h" #include "line_prep.h" #include "prop.h" struct propstruct properties; %} %token MODULE SUBFUN ENTRY SUBMODULE %token MODULESUBROUTINE MODULEFUNCTION %token END ENDSUBROUTINE ENDFUNCTION ENDPROGRAM ENDMODULE ENDSUBMODULE %token IF THEN ELSE ELSEIF ENDIF %token WHERE ENDWHERE FORALL ENDFORALL ELSEWHERE %token DO DOCOMMA DOWHILE DOCONCURRENT ENDDO %token SELECTCASE SELECTTYPE ENDSELECT CASE CASEDEFAULT TYPEIS CLASSIS CLASSDEFAULT %token INTERFACE ABSTRACTINTERFACE ENDINTERFACE %token CONTAINS %token BLOCK ENDBLOCK %token BLOCKDATA ENDBLOCKDATA %token ASSOCIATE ENDASSOCIATE %token CRITICAL ENDCRITICAL %token CHANGETEAM ENDTEAM %token ENUM ENDENUM %token ASSIGNMENT %token ASSIGN TO %token MODULEPROCEDURE PROCEDURE ENDPROCEDURE %token TIDENTIFIER %token BLANK CHAR %token FINDFORMAT UNKNOWN FREE FIXED UNSURE PROBFREE FINDENTFIX FIXFINDENTFIX %token P_ON P_OFF %token SCANFIXPRE %token CPP_IF CPP_ENDIF CPP_ELSE CPP_ELIF CPP %token COCO_IF COCO_ENDIF COCO_ELSE COCO_ELIF COCO %token INCLUDE INCLUDE_CPP INCLUDE_CPP_STD INCLUDE_COCO INCFILENAME %token USE %token SEGMENT ENDSEGMENT ESOPE %token IDENTIFIER SKIP SKIPALL SKIPNOOP KEYWORD %token ELEMENTAL IMPURE PURE RECURSIVE SUBROUTINE FUNCTION PROGRAM %token EOL NAMED_LABEL %token STLABEL %token TYPE ENDTYPE CLASS %token BASICTYPE TYPEC %token QSTRING HSTRING %token LR LRB %token DOTOPERATOR %token I_NUMBER %token UNCLASSIFIED %token ERROR %token OMP SCANOMPFIXED SCANOMPFREE %token LAST_TOKEN %left '%' %% lline: labels line ; labels: empty | stlabel | named_label | stlabel named_label ; line: | abstractinterface { properties.kind = ABSTRACTINTERFACE; } | assignment { properties.kind = ASSIGNMENT; } | associate { properties.kind = ASSOCIATE; } | blank { properties.kind = BLANK; } | block { properties.kind = BLOCK; } | blockdata { properties.kind = BLOCKDATA; } | case { properties.kind = CASE; } | casedefault { properties.kind = CASEDEFAULT; } | changeteam { properties.kind = CHANGETEAM; } | classdefault { properties.kind = CLASSDEFAULT; } | classis { properties.kind = CLASSIS; } | contains { properties.kind = CONTAINS; } | critical { properties.kind = CRITICAL; } | do_construct { properties.kind = DO; } | else { properties.kind = ELSE; } | elseif { properties.kind = ELSEIF; } | elsewhere { properties.kind = ELSEWHERE; } | endassociate { properties.kind = ENDASSOCIATE; } | endblock { properties.kind = ENDBLOCK; } | endblockdata { properties.kind = ENDBLOCKDATA; } | endcritical { properties.kind = ENDCRITICAL; } | enddo { properties.kind = ENDDO; } | endenum { properties.kind = ENDENUM; } | endforall { properties.kind = ENDFORALL; } | endfunction { properties.kind = ENDFUNCTION; } | endif { properties.kind = ENDIF; } | endinterface { properties.kind = ENDINTERFACE; } | endmodule { properties.kind = ENDMODULE; } | endprocedure { properties.kind = ENDPROCEDURE; } | endprogram { properties.kind = ENDPROGRAM; } | endselect { properties.kind = ENDSELECT; } | endsubmodule { properties.kind = ENDSUBMODULE; } | endsubroutine { properties.kind = ENDSUBROUTINE; } | endteam { properties.kind = ENDTEAM; } | endtype { properties.kind = ENDTYPE; } | endwhere { properties.kind = ENDWHERE; } | entry { properties.kind = ENTRY; } | enum { properties.kind = ENUM; } | forall_construct { properties.kind = FORALL; } | if_construct { properties.kind = IF; } | include { properties.kind = INCLUDE; } | interface { properties.kind = INTERFACE; } | module { properties.kind = MODULE; } | moduleprocedure { properties.kind = PROCEDURE; } | program_stmt { properties.kind = PROGRAM; } | procedure { properties.kind = PROCEDURE; } | selectcase { properties.kind = SELECTCASE; } | selecttype { properties.kind = SELECTTYPE; } | simple_end { properties.kind = END; } | subroutine_stmt { properties.kind = SUBROUTINE; } | function_stmt { properties.kind = FUNCTION; } | submodule { properties.kind = SUBMODULE; } | type { properties.kind = TYPE; } | typeis { properties.kind = TYPEIS; } | use { properties.kind = USE; } | where_construct { properties.kind = WHERE; } | segment { properties.kind = SEGMENT; } | endsegment { properties.kind = ENDSEGMENT; } ; blank: BLANK ; stlabel: STLABEL getstlabel ; named_label: NAMED_LABEL ; module: MODULE enable_identifier IDENTIFIER getname EOL ; use: USE enable_identifier IDENTIFIER getname enable_skipall SKIPALL ; include: INCLUDE QSTRING getstring EOL {D(O("include"););} ; /* include "file.inc" */ abstractinterface: ABSTRACTINTERFACE EOL ; contains: CONTAINS EOL ; interface: INTERFACE skipall ; /* interface [name, operator(*), assignment(=) */ moduleprocedure: MODULEPROCEDURE enable_identifier IDENTIFIER getname EOL ; procedure: PROCEDURE enable_identifier IDENTIFIER getname EOL ; /* standard dictates that only */ /* PROGRAM program_name */ /* is allowed, but there is (or was) at least one dialect that allows: */ /* PROGRAM */ /* and another dialect that allows */ /* PROGRAM program_name(p1,...,p8), comment */ /* and */ /* PROGRAM program_name,p1,...,p8, comment */ /* so we will be a bit sloppy here */ program_stmt: PROGRAM enable_identifier IDENTIFIER getname enable_skip SKIP | PROGRAM enable_identifier EOL ; subroutine_stmt: subroutineprefix subroutine subroutinename enable_skip SKIP; subroutine: subroutine_spec ; subroutine_spec: SUBROUTINE | MODULESUBROUTINE ; subroutinename: enable_identifier IDENTIFIER getname ; subroutineprefix: empty | subroutineprefix subroutineprefix_spec ; subroutineprefix_spec: ELEMENTAL | IMPURE | PURE | RECURSIVE | intrinsic_type_spec | TYPEC LR | CLASS LR ; function_stmt: subroutineprefix function functionname LR enable_skip SKIP ; function: function_spec ; function_spec: FUNCTION | MODULEFUNCTION ; functionname: enable_identifier IDENTIFIER getname ; submodule: SUBMODULE LR getlr enable_identifier IDENTIFIER getname EOL ; intrinsic_type_spec: BASICTYPE | BASICTYPE kind_selector ; kind_selector: '*' I_NUMBER /* extension */ | '*' LR /* extension */ | LR ; entry: ENTRY enable_identifier IDENTIFIER skipall ; endassociate: ENDASSOCIATE construct_name EOL ; endblock: ENDBLOCK construct_name EOL ; endblockdata: ENDBLOCKDATA construct_name EOL ; endcritical: ENDCRITICAL construct_name EOL ; enddo: ENDDO construct_name EOL ; endenum: ENDENUM EOL ; endforall: ENDFORALL construct_name EOL ; endfunction: ENDFUNCTION construct_name EOL ; endif: ENDIF construct_name EOL ; endinterface: ENDINTERFACE skipall ; /* end interface [name, operator(*), assignment(=)] */ endmodule: ENDMODULE construct_name EOL ; endprocedure: ENDPROCEDURE construct_name EOL ; endprogram: ENDPROGRAM construct_name EOL ; endselect: ENDSELECT construct_name EOL ; endsubmodule: ENDSUBMODULE construct_name EOL ; endsubroutine: ENDSUBROUTINE construct_name EOL ; endteam: ENDTEAM lr_construct_name EOL ; endtype: ENDTYPE construct_name EOL ; endsegment: ENDSEGMENT EOL ; endwhere: ENDWHERE construct_name EOL ; simple_end: END EOL ; gidentifier: IDENTIFIER | TIDENTIFIER ; assignment: lvalue '=' skipnoop /* this includes '=>' */ | ASSIGN I_NUMBER TO enable_identifier gidentifier EOL ; else: ELSE construct_name EOL ; elseif: ELSEIF LR THEN construct_name EOL ; elsewhere: ELSEWHERE lr_construct_name EOL ; if_construct: IF LR THEN EOL ; where_construct: WHERE LR EOL ; forall_construct: FORALL LR EOL ; do_construct: do I_NUMBER getdolabel skipall /* do 100 i=1,10 */ | do gidentifier skipall /* do i=1,10 */ | docomma gidentifier skipall /* do, i=1,10 */ | do EOL /* do */ | DOWHILE LR EOL /* do while (i<10) */ /* do, while (i<10) */ | DOCONCURRENT LR EOL /* do concurrent (i=1:20) */ /* do, concurrent (i=1:20)*/ ; do: DO enable_identifier ; docomma: DOCOMMA enable_identifier ; selectcase: SELECTCASE LR EOL ; selecttype: SELECTTYPE LR skipall ; case: CASE enable_identifier LR EOL /* case (3) */ | CASE enable_identifier LR IDENTIFIER EOL; /* case (3) name */ casedefault: CASEDEFAULT construct_name EOL ; /* case default [name] */ classdefault: CLASSDEFAULT construct_name EOL ; classis: CLASSIS LR construct_name EOL ; typeis: TYPEIS LR construct_name EOL ; changeteam: CHANGETEAM LR EOL ; block: BLOCK EOL ; blockdata: BLOCKDATA construct_name EOL ; associate: ASSOCIATE LR EOL ; critical: CRITICAL EOL | CRITICAL LR EOL ; enum: ENUM ',' skipall ; type: type1 ',' skipall | type1 ':' skipall | type1 IDENTIFIER skipall ; type1: TYPE enable_identifier ; segment: SEGMENT enable_identifier IDENTIFIER EOL ; lvalue: gidentifier | gidentifier LR | lvalue '%' lvalue ; construct_name: enable_identifier empty /* */ | enable_identifier IDENTIFIER getname /* name */ ; lr_construct_name: enable_identifier empty /* */ | enable_identifier LR /* (..) */ | enable_identifier IDENTIFIER getname /* name */ | enable_identifier LR IDENTIFIER getname /* (..) name */ ; skipall: enable_skipall SKIPALL ; skipnoop: enable_skipnoop SKIPNOOP ; enable_identifier: {lexer_enable(IDENTIFIER);} ; enable_skip: {lexer_enable(SKIP);} ; enable_skipall: {lexer_enable(SKIPALL);} ; enable_skipnoop: {lexer_enable(SKIPNOOP);} ; getname: {properties.name=lexer_getname();} ; getstlabel: {properties.label=lexer_getstlabel();} ; getdolabel: {properties.dolabel=lexer_geti_number();} ; getstring: {properties.stringvalue=lexer_getstring();} ; getlr: {properties.lrvalue=lexer_getlr();} ; empty: /* empty */ ; %% void resetprop() { properties.kind = UNCLASSIFIED; properties.name = ""; properties.label = ""; properties.dolabel = ""; } propstruct parseline(Line_prep p) { D(O("entering parseline");); lexer_set(p,IDENTIFIER); resetprop(); yyparse(); if (properties.kind != UNCLASSIFIED) return properties; #ifdef USEESOPE lexer_set(p,ESOPE); // enables KEYWORD+ESOPE (SEGMENT, ENDSEGMENT) #else lexer_set(p,KEYWORD); // enables KEYWORD #endif yyparse(); return properties; } void yyerror(const char *c) { D(O("ERROR");O(c);); } extern "C" int yywrap() { D(O("yywrap");); return 1; } findent-3.1.1/src/flags.h0000644000175000017500000000470613446674316012145 00000000000000#ifndef FLAGS_H #define FLAGS_H class Flags { void set_defaults(void); void set_default_indents(); public: Flags() { set_defaults(); } int get_flags(int argc, char *argv[]); enum { DO_NOTHING = 1000, DO_CHANGETEAM, DO_CONCHAR, DO_DEPS, DO_EMACS_FINDENT, DO_EMACS_HELP, DO_GEDIT_EXTERNAL, DO_GEDIT_HELP, DO_GEDIT_PLUGIN, DO_GEDIT_PLUGIN_PY, DO_INCLUDE_LEFT, DO_INDENT, DO_INDENT_CONTAINS, DO_INPUT_FORMAT, DO_LABEL_LEFT, DO_LAST_INDENT, DO_LAST_USABLE, DO_MAKEFDEPS, DO_MANPAGE, DO_OMP, DO_README, DO_REFACTOR_PROCEDURE, DO_SEGMENT, DO_USAGE, DO_VERSION, DO_VIM_FINDENT, DO_VIM_FORTRAN, DO_VIM_HELP, }; bool apply_indent ; // 1: output indented line, else output original lines bool auto_firstindent ; char conchar ; // continuation character output by fixed2fixed, see manpage bool deps ; // output dependencies only bool include_left ; // 1: put include on the start of the line bool include_left_default ; bool indent_cont ; bool indent_contain ; bool input_format_gnu ; bool label_left ; // 1: put statement labels on the start of the line bool last_indent_only ; bool last_usable_only ; int max_indent ; // maximum allowed indent bool only_fix_free ; // 1: determine only if fixed or free (-q) bool refactor_routines ; // 1: refactor routine-end statements bool return_format ; // 1: return 2 if format==free, 4 if format==fixed bool upcase_routine_type ; // 1: use 'SUBROUTINE' etc in stead of 'subroutine' bool honour_omp ; // 1: treat openmp continuation lines as code, // 0: treat them as comment int all_indent; int associate_indent; int block_indent; int case_indent; int changeteam_indent; int cont_indent; int contains_indent; int critical_indent; int default_indent; int do_indent; int entry_indent; int enum_indent; int forall_indent; int if_indent; int input_format; int input_line_length; int interface_indent; int module_indent; int output_format; int routine_indent; #ifdef USEESOPE int segment_indent; #endif int select_indent; int start_indent; int type_indent; int where_indent; }; #endif findent-3.1.1/src/builtparser.cpp0000644000175000017500000023207713476205431013733 00000000000000/* A Bison parser, made by GNU Bison 3.3.2. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 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 3 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, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Undocumented macros, especially those whose name start with YY_, are private implementation details. Do not rely on them. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "3.3.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* First part of user prologue. */ #line 1 "parser.y" /* yacc.c:337 */ #include #include "debug.h" #include "lexer.h" #include "line_prep.h" #include "prop.h" struct propstruct properties; #line 81 "parser.cpp" /* yacc.c:337 */ # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # else # define YY_NULLPTR ((void*)0) # endif # endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* In a future release of Bison, this section will be replaced by #include "parser.hpp". */ #ifndef YY_YY_PARSER_HPP_INCLUDED # define YY_YY_PARSER_HPP_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { MODULE = 258, SUBFUN = 259, ENTRY = 260, SUBMODULE = 261, MODULESUBROUTINE = 262, MODULEFUNCTION = 263, END = 264, ENDSUBROUTINE = 265, ENDFUNCTION = 266, ENDPROGRAM = 267, ENDMODULE = 268, ENDSUBMODULE = 269, IF = 270, THEN = 271, ELSE = 272, ELSEIF = 273, ENDIF = 274, WHERE = 275, ENDWHERE = 276, FORALL = 277, ENDFORALL = 278, ELSEWHERE = 279, DO = 280, DOCOMMA = 281, DOWHILE = 282, DOCONCURRENT = 283, ENDDO = 284, SELECTCASE = 285, SELECTTYPE = 286, ENDSELECT = 287, CASE = 288, CASEDEFAULT = 289, TYPEIS = 290, CLASSIS = 291, CLASSDEFAULT = 292, INTERFACE = 293, ABSTRACTINTERFACE = 294, ENDINTERFACE = 295, CONTAINS = 296, BLOCK = 297, ENDBLOCK = 298, BLOCKDATA = 299, ENDBLOCKDATA = 300, ASSOCIATE = 301, ENDASSOCIATE = 302, CRITICAL = 303, ENDCRITICAL = 304, CHANGETEAM = 305, ENDTEAM = 306, ENUM = 307, ENDENUM = 308, ASSIGNMENT = 309, ASSIGN = 310, TO = 311, MODULEPROCEDURE = 312, PROCEDURE = 313, ENDPROCEDURE = 314, TIDENTIFIER = 315, BLANK = 316, CHAR = 317, FINDFORMAT = 318, UNKNOWN = 319, FREE = 320, FIXED = 321, UNSURE = 322, PROBFREE = 323, FINDENTFIX = 324, FIXFINDENTFIX = 325, P_ON = 326, P_OFF = 327, SCANFIXPRE = 328, CPP_IF = 329, CPP_ENDIF = 330, CPP_ELSE = 331, CPP_ELIF = 332, CPP = 333, COCO_IF = 334, COCO_ENDIF = 335, COCO_ELSE = 336, COCO_ELIF = 337, COCO = 338, INCLUDE = 339, INCLUDE_CPP = 340, INCLUDE_CPP_STD = 341, INCLUDE_COCO = 342, INCFILENAME = 343, USE = 344, SEGMENT = 345, ENDSEGMENT = 346, ESOPE = 347, IDENTIFIER = 348, SKIP = 349, SKIPALL = 350, SKIPNOOP = 351, KEYWORD = 352, ELEMENTAL = 353, IMPURE = 354, PURE = 355, RECURSIVE = 356, SUBROUTINE = 357, FUNCTION = 358, PROGRAM = 359, EOL = 360, NAMED_LABEL = 361, STLABEL = 362, TYPE = 363, ENDTYPE = 364, CLASS = 365, BASICTYPE = 366, TYPEC = 367, QSTRING = 368, HSTRING = 369, LR = 370, LRB = 371, DOTOPERATOR = 372, I_NUMBER = 373, UNCLASSIFIED = 374, ERROR = 375, OMP = 376, SCANOMPFIXED = 377, SCANOMPFREE = 378, LAST_TOKEN = 379 }; #endif /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_PARSER_HPP_INCLUDED */ #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE # if (defined __GNUC__ \ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C # define YY_ATTRIBUTE(Spec) __attribute__(Spec) # else # define YY_ATTRIBUTE(Spec) /* empty */ # endif #endif #ifndef YY_ATTRIBUTE_PURE # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) #endif #ifndef YY_ATTRIBUTE_UNUSED # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) #else # define YYUSE(E) /* empty */ #endif #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 9 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 377 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 130 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 93 /* YYNRULES -- Number of rules. */ #define YYNRULES 184 /* YYNSTATES -- Number of states. */ #define YYNSTATES 346 #define YYUNDEFTOK 2 #define YYMAXUTOK 379 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ static const yytype_uint8 yytranslate[] = { 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 125, 2, 2, 2, 2, 126, 2, 128, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 129, 2, 2, 127, 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, 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, 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, 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, 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, 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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 61, 61, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 128, 130, 131, 133, 135, 137, 139, 140, 141, 142, 143, 156, 157, 160, 161, 162, 163, 165, 166, 167, 169, 170, 171, 172, 173, 174, 175, 178, 179, 180, 181, 183, 185, 187, 188, 190, 191, 192, 195, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 222, 223, 226, 227, 228, 230, 231, 232, 234, 235, 236, 237, 238, 240, 244, 245, 247, 248, 250, 251, 252, 253, 254, 255, 257, 259, 260, 261, 262, 263, 264, 266, 267, 268, 270, 272, 275, 276, 277, 279, 280, 282, 283, 284, 285, 287, 289, 291, 293, 295, 297, 299, 301, 303, 305, 307, 310 }; #endif #if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "MODULE", "SUBFUN", "ENTRY", "SUBMODULE", "MODULESUBROUTINE", "MODULEFUNCTION", "END", "ENDSUBROUTINE", "ENDFUNCTION", "ENDPROGRAM", "ENDMODULE", "ENDSUBMODULE", "IF", "THEN", "ELSE", "ELSEIF", "ENDIF", "WHERE", "ENDWHERE", "FORALL", "ENDFORALL", "ELSEWHERE", "DO", "DOCOMMA", "DOWHILE", "DOCONCURRENT", "ENDDO", "SELECTCASE", "SELECTTYPE", "ENDSELECT", "CASE", "CASEDEFAULT", "TYPEIS", "CLASSIS", "CLASSDEFAULT", "INTERFACE", "ABSTRACTINTERFACE", "ENDINTERFACE", "CONTAINS", "BLOCK", "ENDBLOCK", "BLOCKDATA", "ENDBLOCKDATA", "ASSOCIATE", "ENDASSOCIATE", "CRITICAL", "ENDCRITICAL", "CHANGETEAM", "ENDTEAM", "ENUM", "ENDENUM", "ASSIGNMENT", "ASSIGN", "TO", "MODULEPROCEDURE", "PROCEDURE", "ENDPROCEDURE", "TIDENTIFIER", "BLANK", "CHAR", "FINDFORMAT", "UNKNOWN", "FREE", "FIXED", "UNSURE", "PROBFREE", "FINDENTFIX", "FIXFINDENTFIX", "P_ON", "P_OFF", "SCANFIXPRE", "CPP_IF", "CPP_ENDIF", "CPP_ELSE", "CPP_ELIF", "CPP", "COCO_IF", "COCO_ENDIF", "COCO_ELSE", "COCO_ELIF", "COCO", "INCLUDE", "INCLUDE_CPP", "INCLUDE_CPP_STD", "INCLUDE_COCO", "INCFILENAME", "USE", "SEGMENT", "ENDSEGMENT", "ESOPE", "IDENTIFIER", "SKIP", "SKIPALL", "SKIPNOOP", "KEYWORD", "ELEMENTAL", "IMPURE", "PURE", "RECURSIVE", "SUBROUTINE", "FUNCTION", "PROGRAM", "EOL", "NAMED_LABEL", "STLABEL", "TYPE", "ENDTYPE", "CLASS", "BASICTYPE", "TYPEC", "QSTRING", "HSTRING", "LR", "LRB", "DOTOPERATOR", "I_NUMBER", "UNCLASSIFIED", "ERROR", "OMP", "SCANOMPFIXED", "SCANOMPFREE", "LAST_TOKEN", "'%'", "'*'", "'='", "','", "':'", "$accept", "lline", "labels", "line", "blank", "stlabel", "named_label", "module", "use", "include", "abstractinterface", "contains", "interface", "moduleprocedure", "procedure", "program_stmt", "subroutine_stmt", "subroutine", "subroutine_spec", "subroutinename", "subroutineprefix", "subroutineprefix_spec", "function_stmt", "function", "function_spec", "functionname", "submodule", "intrinsic_type_spec", "kind_selector", "entry", "endassociate", "endblock", "endblockdata", "endcritical", "enddo", "endenum", "endforall", "endfunction", "endif", "endinterface", "endmodule", "endprocedure", "endprogram", "endselect", "endsubmodule", "endsubroutine", "endteam", "endtype", "endsegment", "endwhere", "simple_end", "gidentifier", "assignment", "else", "elseif", "elsewhere", "if_construct", "where_construct", "forall_construct", "do_construct", "do", "docomma", "selectcase", "selecttype", "case", "casedefault", "classdefault", "classis", "typeis", "changeteam", "block", "blockdata", "associate", "critical", "enum", "type", "type1", "segment", "lvalue", "construct_name", "lr_construct_name", "skipall", "skipnoop", "enable_identifier", "enable_skip", "enable_skipall", "enable_skipnoop", "getname", "getstlabel", "getdolabel", "getstring", "getlr", "empty", YY_NULLPTR }; #endif # ifdef YYPRINT /* YYTOKNUM[NUM] -- (External) token number corresponding to the (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 37, 42, 61, 44, 58 }; # endif #define YYPACT_NINF -290 #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-290))) #define YYTABLE_NINF -8 #define yytable_value_is_error(Yytable_value) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { -72, -290, -290, 13, 268, -85, -290, -290, -290, -290, -290, -290, -79, -75, -290, -290, -290, -290, -290, -78, -290, -77, -290, -74, -290, -65, -290, -290, -290, -290, -63, -62, -290, -59, -49, -290, -290, -290, -47, -45, -290, -290, -33, -290, -32, -31, -290, -290, -290, -40, -290, -90, -290, -39, -290, -88, -27, -37, -290, -290, -290, -290, -290, -70, -290, -290, -26, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, 0, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -29, -290, -290, -290, -290, -290, -290, -290, -290, -54, -46, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -83, -290, -105, -290, -290, -5, -3, -290, -290, -11, 3, -1, 2, 4, 8, 90, 9, 92, 11, 14, 15, 16, 17, 19, -84, -290, -290, 20, 21, 22, 23, -290, 24, 18, 25, -290, -290, 26, -290, 40, -290, -290, -290, -290, 31, 32, 34, 35, 36, -290, 37, 38, 42, 43, -290, -290, 62, 52, 56, 46, -290, 57, 59, -290, -82, -290, 48, -290, -290, -290, -290, -290, -290, -290, -290, 39, -99, 41, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -46, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, 50, -290, -290, -290, -290, -290, -290, -290, -290, -290, 64, -290, -290, -290, -290, -290, -290, -290, -81, -290, 54, 55, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, 58, -290, 60, -290, -290, -290, -290, -290, -86, -290, -290, -290, 68, 47, 71, -290, -290, -290, -290, -290, -290, -290, -290, 70, 63, -290, 74, -290, -290, 65, -290, -290, 66, -290, -290, -290, -46, 67, 69, -290, -290, -290, -290, -290, -290, 75, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, 72, -290, -290, 78, 81, -290, -290, 82, -290, 73, -290, -290, -290, -290, -290 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 184, 68, 180, 0, 184, 4, 5, 3, 67, 1, 175, 175, 0, 0, 175, 175, 175, 175, 175, 0, 175, 0, 175, 0, 175, 0, 175, 175, 175, 175, 0, 0, 175, 0, 0, 175, 175, 175, 0, 0, 175, 177, 0, 177, 0, 0, 175, 175, 175, 0, 175, 0, 175, 0, 175, 0, 0, 0, 175, 175, 175, 127, 66, 0, 175, 175, 0, 126, 175, 175, 175, 2, 11, 50, 62, 48, 8, 19, 49, 51, 53, 52, 57, 0, 58, 59, 44, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 65, 43, 56, 164, 9, 22, 23, 24, 47, 63, 46, 21, 0, 0, 54, 55, 14, 15, 17, 18, 61, 16, 12, 13, 10, 20, 45, 60, 0, 64, 0, 84, 6, 0, 0, 183, 125, 0, 184, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 184, 142, 143, 0, 0, 0, 0, 177, 0, 0, 0, 175, 175, 0, 74, 0, 72, 114, 73, 153, 0, 0, 0, 0, 0, 156, 0, 0, 0, 0, 177, 110, 0, 0, 0, 0, 182, 0, 0, 123, 0, 162, 0, 82, 96, 86, 87, 88, 89, 81, 95, 0, 99, 0, 175, 80, 85, 175, 94, 90, 165, 139, 181, 177, 177, 177, 177, 177, 0, 178, 179, 177, 175, 120, 179, 167, 112, 117, 115, 119, 0, 130, 175, 113, 134, 124, 135, 111, 132, 179, 170, 169, 140, 141, 109, 144, 145, 118, 0, 148, 0, 0, 149, 173, 106, 154, 107, 155, 105, 157, 108, 152, 121, 158, 175, 179, 179, 116, 0, 179, 0, 179, 78, 122, 92, 103, 0, 100, 91, 176, 0, 0, 0, 177, 137, 138, 161, 159, 160, 166, 128, 0, 0, 104, 0, 168, 133, 0, 171, 179, 0, 146, 151, 150, 0, 0, 0, 71, 177, 163, 176, 102, 101, 0, 179, 176, 179, 136, 174, 69, 179, 131, 172, 147, 0, 75, 76, 0, 0, 79, 83, 0, 97, 0, 129, 70, 77, 93, 98 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -290, -290, -290, -290, -290, -290, 179, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -114, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -290, -36, 45, 131, -41, -290, -10, -289, -129, -290, -189, -290, -290, -290, -290, 1 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 3, 4, 71, 72, 5, 6, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 211, 212, 286, 83, 213, 84, 214, 215, 288, 85, 216, 284, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 142, 156, 171, 297, 143, 320, 172, 298, 299, 8, 290, 275, 229, 7 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 138, 139, 174, 220, 221, 136, 61, 200, 201, 246, 222, 278, 307, 9, 61, 182, 282, 157, 158, 159, 225, 1, 226, 279, 308, 183, 166, 283, 335, 318, 141, 247, 319, 338, 1, 2, 140, 148, 150, 67, 187, 152, 302, 193, 157, 223, 224, 67, 190, 191, 154, 218, 160, 161, 194, 195, 163, 305, 197, 198, 144, 145, 146, 147, 219, 149, 164, 151, 168, 153, 169, 155, 173, 175, 176, 180, 185, 162, 188, 196, 165, 189, 167, 312, 313, 170, 217, 315, 227, 317, 228, 177, 178, 179, 230, 181, 231, 184, 202, 203, 204, 205, 206, 207, 233, 192, 237, 234, 239, 235, 208, 209, 210, 236, 238, 199, 240, 329, 271, 241, 242, 243, 244, 253, 245, 249, 250, 251, 252, 254, 256, 259, 337, 255, 339, 260, 261, 262, 340, 263, 264, 265, 266, 267, 232, 272, 270, 268, 269, 273, 276, 274, 277, 280, 281, 303, 285, 306, 248, 309, 310, 321, 322, 314, 323, 316, 325, 327, 326, 336, 328, 330, 332, 342, 333, 343, 344, 341, 345, 291, 292, 293, 294, 295, 137, 186, 334, 300, 0, 296, 0, 0, 0, 0, 0, 0, 0, 331, 0, 0, 0, 287, 0, 0, 289, 0, 0, 0, 0, 0, 0, 0, 0, 257, 258, 0, 0, 0, 0, 301, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 311, 0, 0, 0, 0, 0, 0, -7, 0, 0, 10, 0, 11, 12, 0, 0, 13, 14, 15, 16, 17, 18, 19, 304, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 0, 57, 0, 58, 59, 60, 61, 62, 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, 64, 65, 66, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 69, 70 }; static const yytype_int16 yycheck[] = { 10, 11, 43, 117, 118, 4, 60, 7, 8, 93, 93, 93, 93, 0, 60, 105, 115, 27, 28, 29, 125, 106, 127, 105, 105, 115, 36, 126, 317, 115, 105, 115, 118, 322, 106, 107, 115, 115, 115, 93, 128, 115, 231, 113, 54, 128, 129, 93, 58, 59, 115, 105, 115, 115, 64, 65, 115, 246, 68, 69, 15, 16, 17, 18, 118, 20, 115, 22, 115, 24, 115, 26, 105, 105, 105, 115, 115, 32, 105, 105, 35, 118, 37, 272, 273, 40, 115, 276, 93, 278, 93, 46, 47, 48, 105, 50, 93, 52, 98, 99, 100, 101, 102, 103, 105, 60, 16, 105, 16, 105, 110, 111, 112, 105, 105, 70, 105, 306, 56, 105, 105, 105, 105, 164, 105, 105, 105, 105, 105, 105, 105, 105, 321, 115, 323, 95, 105, 105, 327, 105, 105, 105, 105, 105, 143, 93, 187, 105, 105, 93, 93, 105, 93, 105, 115, 105, 115, 93, 157, 105, 105, 93, 115, 105, 93, 105, 96, 93, 105, 94, 105, 105, 105, 95, 105, 94, 94, 105, 105, 220, 221, 222, 223, 224, 5, 54, 315, 228, -1, 225, -1, -1, -1, -1, -1, -1, -1, 311, -1, -1, -1, 211, -1, -1, 214, -1, -1, -1, -1, -1, -1, -1, -1, 168, 169, -1, -1, -1, -1, 229, -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, -1, -1, -1, 290, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 271, -1, -1, -1, -1, -1, -1, 0, -1, -1, 3, -1, 5, 6, -1, -1, 9, 10, 11, 12, 13, 14, 15, 239, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, 55, -1, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 84, -1, -1, -1, -1, 89, 90, 91, -1, 93, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, -1, -1, -1, 108, 109 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 106, 107, 131, 132, 135, 136, 222, 218, 0, 3, 5, 6, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 55, 57, 58, 59, 60, 61, 84, 89, 90, 91, 93, 104, 108, 109, 133, 134, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 150, 152, 156, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 222, 136, 213, 213, 115, 105, 209, 213, 209, 209, 209, 209, 115, 209, 115, 209, 115, 209, 115, 209, 210, 213, 213, 213, 115, 115, 209, 115, 115, 209, 213, 209, 115, 115, 209, 211, 215, 105, 211, 105, 105, 209, 209, 209, 115, 209, 105, 115, 209, 115, 210, 128, 105, 118, 213, 213, 209, 113, 213, 213, 105, 213, 213, 209, 7, 8, 98, 99, 100, 101, 102, 103, 110, 111, 112, 147, 148, 151, 153, 154, 157, 115, 105, 118, 181, 181, 93, 128, 129, 125, 127, 93, 93, 221, 105, 93, 222, 105, 105, 105, 105, 16, 105, 16, 105, 105, 105, 105, 105, 105, 93, 115, 222, 105, 105, 105, 105, 211, 105, 115, 105, 209, 209, 105, 95, 105, 105, 105, 105, 105, 105, 105, 105, 105, 211, 56, 93, 93, 105, 220, 93, 93, 93, 105, 105, 115, 115, 126, 158, 115, 149, 213, 155, 213, 219, 211, 211, 211, 211, 211, 208, 212, 216, 217, 211, 213, 217, 105, 209, 217, 93, 93, 105, 105, 105, 213, 217, 217, 105, 217, 105, 217, 115, 118, 214, 93, 115, 93, 211, 96, 105, 93, 105, 217, 105, 181, 105, 105, 215, 214, 94, 217, 214, 217, 217, 105, 95, 94, 94, 105 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 130, 131, 132, 132, 132, 132, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 145, 146, 147, 148, 148, 149, 150, 150, 151, 151, 151, 151, 151, 151, 151, 152, 153, 154, 154, 155, 156, 157, 157, 158, 158, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 181, 182, 182, 183, 184, 185, 186, 187, 188, 189, 189, 189, 189, 189, 189, 190, 191, 192, 193, 194, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 203, 204, 205, 205, 205, 206, 207, 208, 208, 208, 209, 209, 210, 210, 210, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 2, 1, 1, 1, 2, 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, 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, 1, 1, 1, 1, 1, 1, 1, 2, 1, 5, 6, 4, 2, 2, 2, 5, 5, 6, 3, 5, 1, 1, 1, 3, 1, 2, 1, 1, 1, 1, 1, 2, 2, 6, 1, 1, 1, 3, 7, 1, 2, 2, 2, 1, 4, 3, 3, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 2, 1, 1, 3, 6, 3, 5, 3, 4, 3, 3, 4, 3, 3, 2, 3, 3, 2, 2, 3, 3, 4, 5, 3, 3, 4, 4, 3, 2, 3, 3, 2, 3, 3, 3, 3, 3, 2, 4, 1, 2, 3, 2, 3, 2, 2, 3, 4, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Error token number */ #define YYTERROR 1 #define YYERRCODE 256 /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT # define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*-----------------------------------. | Print this symbol's value on YYO. | `-----------------------------------*/ static void yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; YYUSE (yyoutput); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyo, yytoknum[yytype], *yyvaluep); # endif YYUSE (yytype); } /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ static void yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyo, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyo, yytype, yyvaluep); YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { unsigned long yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], &yyvsp[(yyi + 1) - (yynrhs)] ); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T yystrlen (const char *yystr) { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * yystpcpy (char *yydest, const char *yysrc) { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; else goto append; append: default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); } # endif /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message about the unexpected token YYTOKEN for the state stack whose top is YYSSP. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is not large enough to hold the message. In that case, also set *YYMSG_ALLOC to the required number of bytes. Return 2 if the required number of bytes is too large to store. */ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per "expected"). */ int yycount = 0; /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected tokens because there are none. - The only way there can be no lookahead present (in yychar) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to report. In that case, just report a simple "syntax error". - Don't assume there isn't a lookahead just because this state is a consistent state with a default action. There might have been a previous inconsistent state, consistent state with a non-default action, or user semantic action that manipulated yychar. - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the scanner and before detecting a syntax error. Thus, state merging (from LALR or IELR) and default reductions corrupt the expected token list. However, the list is correct for canonical LR with one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ if (yytoken != YYEMPTY) { int yyn = yypact[*yyssp]; yyarg[yycount++] = yytname[yytoken]; if (!yypact_value_is_default (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyx; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; break; } yyarg[yycount++] = yytname[yyx]; { YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) yysize = yysize1; else return 2; } } } } switch (yycount) { # define YYCASE_(N, S) \ case N: \ yyformat = S; \ break default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); # undef YYCASE_ } { YYSIZE_T yysize1 = yysize + yystrlen (yyformat); if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) yysize = yysize1; else return 2; } if (*yymsg_alloc < yysize) { *yymsg_alloc = 2 * yysize; if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; return 1; } /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ { char *yyp = *yymsg; int yyi = 0; while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyformat += 2; } else { yyp++; yyformat++; } } return 0; } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ int yyparse (void) { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: 'yyss': related to states. 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yyssp = yyss = yyssa; yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; /*------------------------------------------------------------. | yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; /*--------------------------------------------------------------------. | yynewstate -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: *yyssp = (yytype_int16) yystate; if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE goto yyexhaustedlab; #else { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); # if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = yylex (); } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 8: #line 69 "parser.y" /* yacc.c:1652 */ { properties.kind = ABSTRACTINTERFACE; } #line 1634 "parser.cpp" /* yacc.c:1652 */ break; case 9: #line 70 "parser.y" /* yacc.c:1652 */ { properties.kind = ASSIGNMENT; } #line 1640 "parser.cpp" /* yacc.c:1652 */ break; case 10: #line 71 "parser.y" /* yacc.c:1652 */ { properties.kind = ASSOCIATE; } #line 1646 "parser.cpp" /* yacc.c:1652 */ break; case 11: #line 72 "parser.y" /* yacc.c:1652 */ { properties.kind = BLANK; } #line 1652 "parser.cpp" /* yacc.c:1652 */ break; case 12: #line 73 "parser.y" /* yacc.c:1652 */ { properties.kind = BLOCK; } #line 1658 "parser.cpp" /* yacc.c:1652 */ break; case 13: #line 74 "parser.y" /* yacc.c:1652 */ { properties.kind = BLOCKDATA; } #line 1664 "parser.cpp" /* yacc.c:1652 */ break; case 14: #line 75 "parser.y" /* yacc.c:1652 */ { properties.kind = CASE; } #line 1670 "parser.cpp" /* yacc.c:1652 */ break; case 15: #line 76 "parser.y" /* yacc.c:1652 */ { properties.kind = CASEDEFAULT; } #line 1676 "parser.cpp" /* yacc.c:1652 */ break; case 16: #line 77 "parser.y" /* yacc.c:1652 */ { properties.kind = CHANGETEAM; } #line 1682 "parser.cpp" /* yacc.c:1652 */ break; case 17: #line 78 "parser.y" /* yacc.c:1652 */ { properties.kind = CLASSDEFAULT; } #line 1688 "parser.cpp" /* yacc.c:1652 */ break; case 18: #line 79 "parser.y" /* yacc.c:1652 */ { properties.kind = CLASSIS; } #line 1694 "parser.cpp" /* yacc.c:1652 */ break; case 19: #line 80 "parser.y" /* yacc.c:1652 */ { properties.kind = CONTAINS; } #line 1700 "parser.cpp" /* yacc.c:1652 */ break; case 20: #line 81 "parser.y" /* yacc.c:1652 */ { properties.kind = CRITICAL; } #line 1706 "parser.cpp" /* yacc.c:1652 */ break; case 21: #line 82 "parser.y" /* yacc.c:1652 */ { properties.kind = DO; } #line 1712 "parser.cpp" /* yacc.c:1652 */ break; case 22: #line 83 "parser.y" /* yacc.c:1652 */ { properties.kind = ELSE; } #line 1718 "parser.cpp" /* yacc.c:1652 */ break; case 23: #line 84 "parser.y" /* yacc.c:1652 */ { properties.kind = ELSEIF; } #line 1724 "parser.cpp" /* yacc.c:1652 */ break; case 24: #line 85 "parser.y" /* yacc.c:1652 */ { properties.kind = ELSEWHERE; } #line 1730 "parser.cpp" /* yacc.c:1652 */ break; case 25: #line 86 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDASSOCIATE; } #line 1736 "parser.cpp" /* yacc.c:1652 */ break; case 26: #line 87 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDBLOCK; } #line 1742 "parser.cpp" /* yacc.c:1652 */ break; case 27: #line 88 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDBLOCKDATA; } #line 1748 "parser.cpp" /* yacc.c:1652 */ break; case 28: #line 89 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDCRITICAL; } #line 1754 "parser.cpp" /* yacc.c:1652 */ break; case 29: #line 90 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDDO; } #line 1760 "parser.cpp" /* yacc.c:1652 */ break; case 30: #line 91 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDENUM; } #line 1766 "parser.cpp" /* yacc.c:1652 */ break; case 31: #line 92 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDFORALL; } #line 1772 "parser.cpp" /* yacc.c:1652 */ break; case 32: #line 93 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDFUNCTION; } #line 1778 "parser.cpp" /* yacc.c:1652 */ break; case 33: #line 94 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDIF; } #line 1784 "parser.cpp" /* yacc.c:1652 */ break; case 34: #line 95 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDINTERFACE; } #line 1790 "parser.cpp" /* yacc.c:1652 */ break; case 35: #line 96 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDMODULE; } #line 1796 "parser.cpp" /* yacc.c:1652 */ break; case 36: #line 97 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDPROCEDURE; } #line 1802 "parser.cpp" /* yacc.c:1652 */ break; case 37: #line 98 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDPROGRAM; } #line 1808 "parser.cpp" /* yacc.c:1652 */ break; case 38: #line 99 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDSELECT; } #line 1814 "parser.cpp" /* yacc.c:1652 */ break; case 39: #line 100 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDSUBMODULE; } #line 1820 "parser.cpp" /* yacc.c:1652 */ break; case 40: #line 101 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDSUBROUTINE; } #line 1826 "parser.cpp" /* yacc.c:1652 */ break; case 41: #line 102 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDTEAM; } #line 1832 "parser.cpp" /* yacc.c:1652 */ break; case 42: #line 103 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDTYPE; } #line 1838 "parser.cpp" /* yacc.c:1652 */ break; case 43: #line 104 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDWHERE; } #line 1844 "parser.cpp" /* yacc.c:1652 */ break; case 44: #line 105 "parser.y" /* yacc.c:1652 */ { properties.kind = ENTRY; } #line 1850 "parser.cpp" /* yacc.c:1652 */ break; case 45: #line 106 "parser.y" /* yacc.c:1652 */ { properties.kind = ENUM; } #line 1856 "parser.cpp" /* yacc.c:1652 */ break; case 46: #line 107 "parser.y" /* yacc.c:1652 */ { properties.kind = FORALL; } #line 1862 "parser.cpp" /* yacc.c:1652 */ break; case 47: #line 108 "parser.y" /* yacc.c:1652 */ { properties.kind = IF; } #line 1868 "parser.cpp" /* yacc.c:1652 */ break; case 48: #line 109 "parser.y" /* yacc.c:1652 */ { properties.kind = INCLUDE; } #line 1874 "parser.cpp" /* yacc.c:1652 */ break; case 49: #line 110 "parser.y" /* yacc.c:1652 */ { properties.kind = INTERFACE; } #line 1880 "parser.cpp" /* yacc.c:1652 */ break; case 50: #line 111 "parser.y" /* yacc.c:1652 */ { properties.kind = MODULE; } #line 1886 "parser.cpp" /* yacc.c:1652 */ break; case 51: #line 112 "parser.y" /* yacc.c:1652 */ { properties.kind = PROCEDURE; } #line 1892 "parser.cpp" /* yacc.c:1652 */ break; case 52: #line 113 "parser.y" /* yacc.c:1652 */ { properties.kind = PROGRAM; } #line 1898 "parser.cpp" /* yacc.c:1652 */ break; case 53: #line 114 "parser.y" /* yacc.c:1652 */ { properties.kind = PROCEDURE; } #line 1904 "parser.cpp" /* yacc.c:1652 */ break; case 54: #line 115 "parser.y" /* yacc.c:1652 */ { properties.kind = SELECTCASE; } #line 1910 "parser.cpp" /* yacc.c:1652 */ break; case 55: #line 116 "parser.y" /* yacc.c:1652 */ { properties.kind = SELECTTYPE; } #line 1916 "parser.cpp" /* yacc.c:1652 */ break; case 56: #line 117 "parser.y" /* yacc.c:1652 */ { properties.kind = END; } #line 1922 "parser.cpp" /* yacc.c:1652 */ break; case 57: #line 118 "parser.y" /* yacc.c:1652 */ { properties.kind = SUBROUTINE; } #line 1928 "parser.cpp" /* yacc.c:1652 */ break; case 58: #line 119 "parser.y" /* yacc.c:1652 */ { properties.kind = FUNCTION; } #line 1934 "parser.cpp" /* yacc.c:1652 */ break; case 59: #line 120 "parser.y" /* yacc.c:1652 */ { properties.kind = SUBMODULE; } #line 1940 "parser.cpp" /* yacc.c:1652 */ break; case 60: #line 121 "parser.y" /* yacc.c:1652 */ { properties.kind = TYPE; } #line 1946 "parser.cpp" /* yacc.c:1652 */ break; case 61: #line 122 "parser.y" /* yacc.c:1652 */ { properties.kind = TYPEIS; } #line 1952 "parser.cpp" /* yacc.c:1652 */ break; case 62: #line 123 "parser.y" /* yacc.c:1652 */ { properties.kind = USE; } #line 1958 "parser.cpp" /* yacc.c:1652 */ break; case 63: #line 124 "parser.y" /* yacc.c:1652 */ { properties.kind = WHERE; } #line 1964 "parser.cpp" /* yacc.c:1652 */ break; case 64: #line 125 "parser.y" /* yacc.c:1652 */ { properties.kind = SEGMENT; } #line 1970 "parser.cpp" /* yacc.c:1652 */ break; case 65: #line 126 "parser.y" /* yacc.c:1652 */ { properties.kind = ENDSEGMENT; } #line 1976 "parser.cpp" /* yacc.c:1652 */ break; case 71: #line 137 "parser.y" /* yacc.c:1652 */ {D(O("include"););} #line 1982 "parser.cpp" /* yacc.c:1652 */ break; case 175: #line 291 "parser.y" /* yacc.c:1652 */ {lexer_enable(IDENTIFIER);} #line 1988 "parser.cpp" /* yacc.c:1652 */ break; case 176: #line 293 "parser.y" /* yacc.c:1652 */ {lexer_enable(SKIP);} #line 1994 "parser.cpp" /* yacc.c:1652 */ break; case 177: #line 295 "parser.y" /* yacc.c:1652 */ {lexer_enable(SKIPALL);} #line 2000 "parser.cpp" /* yacc.c:1652 */ break; case 178: #line 297 "parser.y" /* yacc.c:1652 */ {lexer_enable(SKIPNOOP);} #line 2006 "parser.cpp" /* yacc.c:1652 */ break; case 179: #line 299 "parser.y" /* yacc.c:1652 */ {properties.name=lexer_getname();} #line 2012 "parser.cpp" /* yacc.c:1652 */ break; case 180: #line 301 "parser.y" /* yacc.c:1652 */ {properties.label=lexer_getstlabel();} #line 2018 "parser.cpp" /* yacc.c:1652 */ break; case 181: #line 303 "parser.y" /* yacc.c:1652 */ {properties.dolabel=lexer_geti_number();} #line 2024 "parser.cpp" /* yacc.c:1652 */ break; case 182: #line 305 "parser.y" /* yacc.c:1652 */ {properties.stringvalue=lexer_getstring();} #line 2030 "parser.cpp" /* yacc.c:1652 */ break; case 183: #line 307 "parser.y" /* yacc.c:1652 */ {properties.lrvalue=lexer_getlr();} #line 2036 "parser.cpp" /* yacc.c:1652 */ break; #line 2040 "parser.cpp" /* yacc.c:1652 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ { const int yylhs = yyr1[yyn] - YYNTOKENS; const int yyi = yypgoto[yylhs] + *yyssp; yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ? yytable[yyi] : yydefgoto[yylhs]); } goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) { char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; yysyntax_error_status = YYSYNTAX_ERROR; if (yysyntax_error_status == 0) yymsgp = yymsg; else if (yysyntax_error_status == 1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); if (!yymsg) { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; yysyntax_error_status = 2; } else { yysyntax_error_status = YYSYNTAX_ERROR; yymsgp = yymsg; } } yyerror (yymsgp); if (yysyntax_error_status == 2) goto yyexhaustedlab; } # undef YYSYNTAX_ERROR #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif /*-----------------------------------------------------. | yyreturn -- parsing is finished, return the result. | `-----------------------------------------------------*/ yyreturn: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif return yyresult; } #line 312 "parser.y" /* yacc.c:1918 */ void resetprop() { properties.kind = UNCLASSIFIED; properties.name = ""; properties.label = ""; properties.dolabel = ""; } propstruct parseline(Line_prep p) { D(O("entering parseline");); lexer_set(p,IDENTIFIER); resetprop(); yyparse(); if (properties.kind != UNCLASSIFIED) return properties; #ifdef USEESOPE lexer_set(p,ESOPE); // enables KEYWORD+ESOPE (SEGMENT, ENDSEGMENT) #else lexer_set(p,KEYWORD); // enables KEYWORD #endif yyparse(); return properties; } void yyerror(const char *c) { D(O("ERROR");O(c);); } extern "C" int yywrap() { D(O("yywrap");); return 1; } findent-3.1.1/src/fortran.h0000644000175000017500000001053313474503034012504 00000000000000#ifndef FORTRAN_H #define FORTRAN_H #include "findent_types.h" #include "findentclass.h" #include "fortranline.h" #include "simpleostream.h" #include "pre_analyzer.h" #include "debug.h" class Fortran { public: virtual ~Fortran(){ delete curline; } Fortran(Findent *f) { fi = f; gl = f->gl; cur_rprop = empty_rprop; curline = new Fortranline(gl); prev_props = empty_rprop; refactor_end_found = 0; // for get_full_statement: f_more = 0; first_call = 1; state = start; } virtual void build_statement(Fortranline &line, bool &f_more, bool &pushback) = 0; virtual void output(lines_t &lines,lines_t *freelines = 0) = 0; virtual void output_converted(lines_t &lines) = 0; void get_full_statement(); int get_num() { return fi->num_lines; } void handle_last_usable_only(); void indent_and_output(); std::string full_statement; protected: struct propstruct cur_rprop; Fortranline* curline; lines_t curlines; dolabels_store_t dolabels_store; dolabels_t dolabels; // to store labels, necessary for labelled do Findent* fi; fs_store_t fs_store; Globals* gl; indent_store_t indent_store; // to store indent store nbseen_store_t nbseen_store; // to store nbseen Pre_analyzer prea; struct propstruct prev_props; bool refactor_end_found; rprops_store_t rprops_store; rprops_t rprops; // to store routines (module, subroutine ...) int M(const int k) { // // used to delimit indentation // if (fi->flags.max_indent <= 0) return k; else return std::min(fi->flags.max_indent,k); } Fortranline F(const std::string &s) { return Fortranline(gl,s); } int pop_indent() { if (fi->indent.empty()) return 0; fi->indent.pop_back(); return top_indent(); } int top_indent() { if (fi->indent.empty()) return 0; return fi->indent.back(); } int top_dolabel() { if (dolabels.empty()) return -1; return dolabels.back(); } int pop_dolabel() { if (dolabels.empty()) return -1; dolabels.pop_back(); return top_dolabel(); } void push_indent(int p) { fi->indent.push_back(p); } void empty_dolabels() { while(!dolabels.empty()) dolabels.pop_back(); } void push_rprops(struct propstruct p) { rprops.push_back(p); } void push_dolabel(int p) { dolabels.push_back(p); } struct propstruct top_rprops() { if (rprops.empty()) return empty_rprop; return rprops.back(); } struct propstruct pop_rprops() { if (rprops.empty()) return empty_rprop; rprops.pop_back(); return top_rprops(); } void push_all() { dolabels_store.push_back(dolabels); indent_store.push_back(fi->indent); nbseen_store.push_back(fi->nbseen); rprops_store.push_back(rprops); } // end of push_all void top_all() { if (!dolabels_store.empty()) dolabels = dolabels_store.back(); if (!indent_store.empty()) fi->indent=indent_store.back(); if (!nbseen_store.empty()) fi->nbseen=nbseen_store.back(); if (!rprops_store.empty()) rprops = rprops_store.back(); } // end of top_all void pop_all() { if (!dolabels_store.empty()) dolabels_store.pop_back(); if (!indent_store.empty()) indent_store.pop_back(); if (!nbseen_store.empty()) nbseen_store.pop_back(); if (!rprops_store.empty()) rprops_store.pop_back(); } // end of pop_all void handle_pre(Fortranline &line, bool &p_more); bool is_findentfix(Fortranline &line); bool output_pre(lines_t &lines, lines_t *outlines); void output_line(); void handle_refactor(); private: // // for get_full_statement and handle_pre: // bool first_call; bool f_more; bool p_more; int pregentype; bool pushback; int state; enum { start=1, in_fortran, in_fortran_1, in_pre, end_start, end_fortran, end_pre, in_ffix }; }; #endif findent-3.1.1/src/vim_findent.inc0000644000175000017500000001505413402501024013644 00000000000000 std::cout << "\" to enable the findent Fortran indent program: " << std::endl; std::cout << "\" include this file in ~/.vimrc " << std::endl; std::cout << "\" or place it in ~/.vim/plugin/ as findent.vim" << std::endl; std::cout << "\"Author: Willem Vermin wvermin@gmail.com" << std::endl; std::cout << "\"Licence: fair" << std::endl; std::cout << "\"Date: nov 2016" << std::endl; std::cout << "\"" << std::endl; std::cout << "" << std::endl; std::cout << "if exists(\"g:use_findent\")" << std::endl; std::cout << " if !g:use_findent" << std::endl; std::cout << " finish" << std::endl; std::cout << " endif" << std::endl; std::cout << "endif" << std::endl; std::cout << "" << std::endl; std::cout << "filetype plugin indent on" << std::endl; std::cout << "" << std::endl; std::cout << "\" set default indent flag, if not already set" << std::endl; std::cout << "if !exists(\"b:findent_flags\")" << std::endl; std::cout << " let b:findent_flags = \"-i\".&shiftwidth" << std::endl; std::cout << "endif" << std::endl; std::cout << "" << std::endl; std::cout << "\" \" the nnoremap commands will define some shortcuts:" << std::endl; std::cout << "\" for example:" << std::endl; std::cout << "\" \\= will indent whole file" << std::endl; std::cout << "\" \\f let you change finden flags" << std::endl; std::cout << "\" see the nnoremap commands below" << std::endl; std::cout << "\"" << std::endl; std::cout << "" << std::endl; std::cout << "\" indent whole buffer, can be used with all filetypes" << std::endl; std::cout << "function! Indent()" << std::endl; std::cout << " let view=winsaveview()" << std::endl; std::cout << " execute \"normal! gg=G\"" << std::endl; std::cout << " call winrestview(view)" << std::endl; std::cout << "endfunction" << std::endl; std::cout << "" << std::endl; std::cout << "\" indent whole buffer:" << std::endl; std::cout << "nnoremap = :call Indent()" << std::endl; std::cout << "" << std::endl; std::cout << "function! Get_fortran_format()" << std::endl; std::cout << " \" b:fortran_format defined in auto/indent/fortran.vim" << std::endl; std::cout << " if exists(\"b:fortran_format\")" << std::endl; std::cout << " return b:fortran_format" << std::endl; std::cout << " endif" << std::endl; std::cout << " return \"unknown\"" << std::endl; std::cout << "endfunction" << std::endl; std::cout << "" << std::endl; std::cout << "function! Get_findent_use_whole_buffer()" << std::endl; std::cout << " \" b:findent_use_whole_buffer defined in auto/indent/fortran.vim" << std::endl; std::cout << " if exists(\"b:findent_use_whole_buffer\")" << std::endl; std::cout << " if b:findent_use_whole_buffer" << std::endl; std::cout << " if b:use_findent_indentexpr" << std::endl; std::cout << " return \"wb\"" << std::endl; std::cout << " endif" << std::endl; std::cout << " endif" << std::endl; std::cout << " endif" << std::endl; std::cout << " return \"\"" << std::endl; std::cout << "endfunction" << std::endl; std::cout << "" << std::endl; std::cout << "augroup fortfiletype" << std::endl; std::cout << "" << std::endl; std::cout << " autocmd!" << std::endl; std::cout << "" << std::endl; std::cout << " \" allow tabs in fortran source" << std::endl; std::cout << " autocmd Filetype fortran let fortran_have_tabs=1" << std::endl; std::cout << "" << std::endl; std::cout << " \" fortran_more_precise=1: very slow :syntax on if on end of large file" << std::endl; std::cout << " \"autocmd Filetype fortran let fortran_more_precise=1" << std::endl; std::cout << "" << std::endl; std::cout << " \" indent after subroutne etc (not used by findent)" << std::endl; std::cout << " autocmd Filetype fortran let fortran_indent_more=1" << std::endl; std::cout << "" << std::endl; std::cout << " \" indent after do (not used by findent)" << std::endl; std::cout << " autocmd Filetype fortran let fortran_do_enddo=1" << std::endl; std::cout << "" << std::endl; std::cout << " \" comment line:" << std::endl; std::cout << " autocmd Filetype fortran nnoremap c I!" << std::endl; std::cout << "" << std::endl; std::cout << " \" Change findent flags" << std::endl; std::cout << " \" Findent_set_flags defined in after/indent/fortran.vim" << std::endl; std::cout << " autocmd Filetype fortran nnoremap f :call Findent_set_flags()" << std::endl; std::cout << "" << std::endl; std::cout << " \" on input: do not create tabs on input " << std::endl; std::cout << " autocmd Filetype fortran setlocal expandtab" << std::endl; std::cout << "" << std::endl; std::cout << " \" no max line length" << std::endl; std::cout << " autocmd Filetype fortran setlocal textwidth=0" << std::endl; std::cout << "" << std::endl; std::cout << " \" enable statusline" << std::endl; std::cout << " autocmd Filetype fortran setlocal laststatus=2" << std::endl; std::cout << "" << std::endl; std::cout << " \" use indent of previous line" << std::endl; std::cout << " autocmd Filetype fortran setlocal autoindent" << std::endl; std::cout << "" << std::endl; std::cout << " \" define statusline" << std::endl; std::cout << " autocmd Filetype fortran setlocal statusline=%<%t\\ %m\\ %r\\ %y\\ %{Get_fortran_format()}\\ %{Get_findent_use_whole_buffer()}%=%l\\ %c\\ %LL\\ %P" << std::endl; std::cout << "" << std::endl; std::cout << " \" define toggle: use whole buffer for indenting or not" << std::endl; std::cout << " autocmd Filetype fortran nnoremap w :call Findent_use_wb_toggle()" << std::endl; std::cout << "" << std::endl; std::cout << " \" define == such that findent is called as if the line has been edited" << std::endl; std::cout << " autocmd Filetype fortran nnoremap == il" << std::endl; std::cout << "" << std::endl; std::cout << " \" make syntax aware of above" << std::endl; std::cout << " \" probably not needed." << std::endl; std::cout << " \" uncommented, because autocmd commands in .vimrc are not executed" << std::endl; std::cout << " \" when a modeline for is presen, as in:" << std::endl; std::cout << " \" !directions for vi vim: filetype=fortran" << std::endl; std::cout << " \" autocmd Filetype fortran syntax on" << std::endl; std::cout << "" << std::endl; std::cout << "augroup END" << std::endl; std::cout << "" << std::endl; std::cout << "" << std::endl; std::cout << "\" vim filetype=vim" << std::endl; findent-3.1.1/src/builtparser.h0000644000175000017500000001077713476205431013401 00000000000000/* A Bison parser, made by GNU Bison 3.3.2. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 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 3 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, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Undocumented macros, especially those whose name start with YY_, are private implementation details. Do not rely on them. */ #ifndef YY_YY_PARSER_HPP_INCLUDED # define YY_YY_PARSER_HPP_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { MODULE = 258, SUBFUN = 259, ENTRY = 260, SUBMODULE = 261, MODULESUBROUTINE = 262, MODULEFUNCTION = 263, END = 264, ENDSUBROUTINE = 265, ENDFUNCTION = 266, ENDPROGRAM = 267, ENDMODULE = 268, ENDSUBMODULE = 269, IF = 270, THEN = 271, ELSE = 272, ELSEIF = 273, ENDIF = 274, WHERE = 275, ENDWHERE = 276, FORALL = 277, ENDFORALL = 278, ELSEWHERE = 279, DO = 280, DOCOMMA = 281, DOWHILE = 282, DOCONCURRENT = 283, ENDDO = 284, SELECTCASE = 285, SELECTTYPE = 286, ENDSELECT = 287, CASE = 288, CASEDEFAULT = 289, TYPEIS = 290, CLASSIS = 291, CLASSDEFAULT = 292, INTERFACE = 293, ABSTRACTINTERFACE = 294, ENDINTERFACE = 295, CONTAINS = 296, BLOCK = 297, ENDBLOCK = 298, BLOCKDATA = 299, ENDBLOCKDATA = 300, ASSOCIATE = 301, ENDASSOCIATE = 302, CRITICAL = 303, ENDCRITICAL = 304, CHANGETEAM = 305, ENDTEAM = 306, ENUM = 307, ENDENUM = 308, ASSIGNMENT = 309, ASSIGN = 310, TO = 311, MODULEPROCEDURE = 312, PROCEDURE = 313, ENDPROCEDURE = 314, TIDENTIFIER = 315, BLANK = 316, CHAR = 317, FINDFORMAT = 318, UNKNOWN = 319, FREE = 320, FIXED = 321, UNSURE = 322, PROBFREE = 323, FINDENTFIX = 324, FIXFINDENTFIX = 325, P_ON = 326, P_OFF = 327, SCANFIXPRE = 328, CPP_IF = 329, CPP_ENDIF = 330, CPP_ELSE = 331, CPP_ELIF = 332, CPP = 333, COCO_IF = 334, COCO_ENDIF = 335, COCO_ELSE = 336, COCO_ELIF = 337, COCO = 338, INCLUDE = 339, INCLUDE_CPP = 340, INCLUDE_CPP_STD = 341, INCLUDE_COCO = 342, INCFILENAME = 343, USE = 344, SEGMENT = 345, ENDSEGMENT = 346, ESOPE = 347, IDENTIFIER = 348, SKIP = 349, SKIPALL = 350, SKIPNOOP = 351, KEYWORD = 352, ELEMENTAL = 353, IMPURE = 354, PURE = 355, RECURSIVE = 356, SUBROUTINE = 357, FUNCTION = 358, PROGRAM = 359, EOL = 360, NAMED_LABEL = 361, STLABEL = 362, TYPE = 363, ENDTYPE = 364, CLASS = 365, BASICTYPE = 366, TYPEC = 367, QSTRING = 368, HSTRING = 369, LR = 370, LRB = 371, DOTOPERATOR = 372, I_NUMBER = 373, UNCLASSIFIED = 374, ERROR = 375, OMP = 376, SCANOMPFIXED = 377, SCANOMPFREE = 378, LAST_TOKEN = 379 }; #endif /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_PARSER_HPP_INCLUDED */ findent-3.1.1/src/gedit_plugin_py.inc0000644000175000017500000003507413402501024014530 00000000000000 std::cout << "# -*- coding: utf-8 -*-" << std::endl; std::cout << "# Findent plugin" << std::endl; std::cout << "# This file is part of gedit" << std::endl; std::cout << "#" << std::endl; std::cout << "# Copyright (C) 2017 Willem Vermin" << std::endl; std::cout << "#" << std::endl; std::cout << "# This program is free software; you can redistribute it and/or modify" << std::endl; std::cout << "# it under the terms of the GNU General Public License as published by" << std::endl; std::cout << "# the Free Software Foundation; either version 2 of the License, or" << std::endl; std::cout << "# (at your option) any later version." << std::endl; std::cout << "#" << std::endl; std::cout << "# This program is distributed in the hope that it will be useful," << std::endl; std::cout << "# but WITHOUT ANY WARRANTY; without even the implied warranty of" << std::endl; std::cout << "# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" << std::endl; std::cout << "# GNU General Public License for more details." << std::endl; std::cout << "#" << std::endl; std::cout << "# You should have received a copy of the GNU General Public License" << std::endl; std::cout << "# along with this program; if not, write to the Free Software" << std::endl; std::cout << "# Foundation, Inc., 51 Franklin Street, Fifth Floor," << std::endl; std::cout << "# Boston, MA 02110-1301, USA." << std::endl; std::cout << "" << std::endl; std::cout << "from gi.repository import GObject, Gio, Gtk, Gedit" << std::endl; std::cout << "import gettext" << std::endl; std::cout << "import os.path" << std::endl; std::cout << "from subprocess import Popen,PIPE" << std::endl; std::cout << "" << std::endl; std::cout << "try:" << std::endl; std::cout << " gettext.bindtextdomain(GETTEXT_PACKAGE, GP_LOCALEDIR)" << std::endl; std::cout << " _ = lambda s: gettext.dgettext(GETTEXT_PACKAGE, s)" << std::endl; std::cout << "except:" << std::endl; std::cout << " _ = lambda s: s" << std::endl; std::cout << "" << std::endl; std::cout << "" << std::endl; std::cout << "class FindentAppActivatable(GObject.Object, Gedit.AppActivatable):" << std::endl; std::cout << " app = GObject.Property(type=Gedit.App)" << std::endl; std::cout << "" << std::endl; std::cout << " def __init__(self):" << std::endl; std::cout << " GObject.Object.__init__(self)" << std::endl; std::cout << " global shortcut" << std::endl; std::cout << " shortcut = \"f\"" << std::endl; std::cout << "" << std::endl; std::cout << " def do_activate(self):" << std::endl; std::cout << " self.app.add_accelerator(shortcut, \"win.findent\", None)" << std::endl; std::cout << "" << std::endl; std::cout << " def do_deactivate(self):" << std::endl; std::cout << " self.app.remove_accelerator(\"win.findent\", None)" << std::endl; std::cout << "" << std::endl; std::cout << "" << std::endl; std::cout << "class FindentWindowActivatable(GObject.Object, Gedit.WindowActivatable):" << std::endl; std::cout << "" << std::endl; std::cout << " window = GObject.Property(type=Gedit.Window)" << std::endl; std::cout << "" << std::endl; std::cout << " def __init__(self):" << std::endl; std::cout << " GObject.Object.__init__(self)" << std::endl; std::cout << " self.bottom_bar = Gtk.Box()" << std::endl; std::cout << "" << std::endl; std::cout << " def do_activate(self):" << std::endl; std::cout << " action = Gio.SimpleAction(name=\"findent\")" << std::endl; std::cout << " action.connect('activate', lambda a, p: self.do_findent())" << std::endl; std::cout << " self.window.add_action(action)" << std::endl; std::cout << " self._insert_bottom_panel()" << std::endl; std::cout << "" << std::endl; std::cout << " def do_deactivate(self):" << std::endl; std::cout << " self.window.remove_action(\"findent\")" << std::endl; std::cout << " self._remove_bottom_panel()" << std::endl; std::cout << "" << std::endl; std::cout << " def do_update_state(self):" << std::endl; std::cout << " view = self.window.get_active_view()" << std::endl; std::cout << " enable = view is not None and view.get_editable()" << std::endl; std::cout << " self.window.lookup_action(\"findent\").set_enabled(enable)" << std::endl; std::cout << " return" << std::endl; std::cout << "" << std::endl; std::cout << " def do_findent(self):" << std::endl; std::cout << " view = self.window.get_active_view()" << std::endl; std::cout << " if view and hasattr(view, \"findent_view_activatable\"):" << std::endl; std::cout << " view.findent_view_activatable.do_findent()" << std::endl; std::cout << "" << std::endl; std::cout << " def _insert_bottom_panel(self):" << std::endl; std::cout << " # Add elements to panel." << std::endl; std::cout << " self.findent_label = Gtk.Label()" << std::endl; std::cout << " self.findent_textbuffer = Gtk.TextBuffer()" << std::endl; std::cout << " global mesg" << std::endl; std::cout << " mesg = self.findent_textbuffer" << std::endl; std::cout << " self.findent_textview = Gtk.TextView()" << std::endl; std::cout << " self.findent_textview.set_buffer(self.findent_textbuffer)" << std::endl; std::cout << " self.bottom_bar.add(self.findent_textview)" << std::endl; std::cout << " # Get bottom bar (A Gtk.Stack) and add our bar. " << std::endl; std::cout << " panel = self.window.get_bottom_panel()" << std::endl; std::cout << " panel.add_titled(self.bottom_bar, 'findent_panel', \"Findent output\")" << std::endl; std::cout << " # Make sure everything shows up." << std::endl; std::cout << " panel.show()" << std::endl; std::cout << " self.bottom_bar.show_all()" << std::endl; std::cout << " panel.set_visible_child(self.bottom_bar)" << std::endl; std::cout << "" << std::endl; std::cout << " def _remove_bottom_panel(self):" << std::endl; std::cout << " panel = self.window.get_bottom_panel()" << std::endl; std::cout << " panel.remove(self.bottom_bar)" << std::endl; std::cout << "" << std::endl; std::cout << " def settext(self,text):" << std::endl; std::cout << " self.findent_textbuffer.set_text(text)" << std::endl; std::cout << "" << std::endl; std::cout << "class FindentViewActivatable(GObject.Object, Gedit.ViewActivatable):" << std::endl; std::cout << "" << std::endl; std::cout << " view = GObject.Property(type=Gedit.View)" << std::endl; std::cout << "" << std::endl; std::cout << " def __init__(self):" << std::endl; std::cout << " GObject.Object.__init__(self)" << std::endl; std::cout << " self.default_flags = \"-Ia -i3\"" << std::endl; std::cout << " self.executable = \"findent\"" << std::endl; std::cout << " self.userflags = os.getenv(\"GEDIT_FINDENT_FLAGS\")" << std::endl; std::cout << " if self.userflags == None:" << std::endl; std::cout << " self.userflags = \"\"" << std::endl; std::cout << "" << std::endl; std::cout << " def do_activate(self):" << std::endl; std::cout << " self.view.findent_view_activatable = self" << std::endl; std::cout << " self.view.connect('populate-popup', self.populate_popup)" << std::endl; std::cout << " mesg.set_text(\"Findent ready for use.\"+ \\" << std::endl; std::cout << " \" Shortcut: \"+shortcut+ \\" << std::endl; std::cout << " \" and in popup menu.\" + \\" << std::endl; std::cout << " \" Default flags: '\" + self.default_flags + \"'\" + \\" << std::endl; std::cout << " \"\\nflags from environment variable GEDIT_FINDENT_FLAGS: '\" + " << std::endl; std::cout << " self.userflags+\"'\")" << std::endl; std::cout << "" << std::endl; std::cout << " def do_deactivate(self):" << std::endl; std::cout << " delattr(self.view, \"findent_view_activatable\")" << std::endl; std::cout << "" << std::endl; std::cout << " def populate_popup(self, view, popup):" << std::endl; std::cout << " if not isinstance(popup, Gtk.MenuShell):" << std::endl; std::cout << " return" << std::endl; std::cout << "" << std::endl; std::cout << " item = Gtk.SeparatorMenuItem()" << std::endl; std::cout << " item.show()" << std::endl; std::cout << " popup.append(item)" << std::endl; std::cout << "" << std::endl; std::cout << " item = Gtk.MenuItem.new_with_mnemonic(_('_Findent'))" << std::endl; std::cout << " item.set_sensitive(self.view.get_editable())" << std::endl; std::cout << " item.show()" << std::endl; std::cout << " item.connect('activate', lambda i: self.do_findent())" << std::endl; std::cout << " popup.append(item)" << std::endl; std::cout << "" << std::endl; std::cout << "" << std::endl; std::cout << " def do_findent(self):" << std::endl; std::cout << " doc = self.view.get_buffer()" << std::endl; std::cout << " if doc is None:" << std::endl; std::cout << " return" << std::endl; std::cout << "" << std::endl; std::cout << " ctype = doc.get_content_type()" << std::endl; std::cout << " if ctype != \"text/x-fortran\":" << std::endl; std::cout << " mesg.set_text(\"Content type is '\"+ctype+\"'\" + \\" << std::endl; std::cout << " \". Findent handles only 'text/x-fortran'\")" << std::endl; std::cout << " return" << std::endl; std::cout << "" << std::endl; std::cout << " # run a simple test to see if findent is doing what we expect" << std::endl; std::cout << "" << std::endl; std::cout << " srcin = \"program test\\ncontinue\\nend program test\"" << std::endl; std::cout << " expected = \"program test\\n continue\\nend program test\\n\"" << std::endl; std::cout << "" << std::endl; std::cout << " try:" << std::endl; std::cout << " with Popen([self.executable,\"-i3\"], stdout=PIPE, stdin=PIPE) as proc:" << std::endl; std::cout << " srcout = proc.communicate(str.encode(srcin))[0].decode()" << std::endl; std::cout << " except OSError:" << std::endl; std::cout << " mesg.set_text(\"Cannot find findent.\" + \\" << std::endl; std::cout << " \"\\nTake care that the location of findent is in PATH\" +\\" << std::endl; std::cout << " \"\\nUsing '\"+self.executable+\"'\")" << std::endl; std::cout << " return" << std::endl; std::cout << "" << std::endl; std::cout << " if srcout != expected:" << std::endl; std::cout << " mesg.set_text(\"Findent is not functioning as expected.\" +\\" << std::endl; std::cout << " \"\\nTake care that the location of findent is in PATH\" +\\" << std::endl; std::cout << " \"\\nUsing '\"+self.executable+\"'\")" << std::endl; std::cout << " return" << std::endl; std::cout << "" << std::endl; std::cout << " xy = self.view.window_to_buffer_coords(Gtk.TextWindowType.TEXT,0,0)" << std::endl; std::cout << " z = self.view.get_line_at_y(xy[1])[0]" << std::endl; std::cout << " line = z.get_line()" << std::endl; std::cout << " cline = doc.get_iter_at_mark(doc.get_insert()).get_line()" << std::endl; std::cout << "" << std::endl; std::cout << " srcin = doc.get_text(doc.get_start_iter(),doc.get_end_iter(),True)" << std::endl; std::cout << "" << std::endl; std::cout << " uri = doc.get_location().get_uri()" << std::endl; std::cout << " suffix = os.path.splitext(uri)[1].lower()" << std::endl; std::cout << "" << std::endl; std::cout << " if suffix in {\".f\",\".for\",\".fpp\",\".ftn\",\".fortran\",\".f77\"}:" << std::endl; std::cout << " ff = \"-ifixed\"" << std::endl; std::cout << " elif suffix in {\".f90\",\".f95\",\".f03\",\".f08\"}:" << std::endl; std::cout << " ff = \"-ifree\"" << std::endl; std::cout << " else:" << std::endl; std::cout << " ff = \"-iauto\"" << std::endl; std::cout << "" << std::endl; std::cout << " flags = self.default_flags.split() + [ff] + self.userflags.split()" << std::endl; std::cout << "" << std::endl; std::cout << " try:" << std::endl; std::cout << " with Popen([self.executable]+flags, stdout=PIPE, stdin=PIPE) as proc:" << std::endl; std::cout << " srcout = proc.communicate(str.encode(srcin))[0].decode()" << std::endl; std::cout << " except OSError:" << std::endl; std::cout << " mesg.set_text(\"Cannot find findent.\" + \\" << std::endl; std::cout << " \"\\nTake care that the location of findent is in PATH\" +\\" << std::endl; std::cout << " \"\\nUsing '\"+self.executable+\"'\")" << std::endl; std::cout << " return" << std::endl; std::cout << "" << std::endl; std::cout << " orig_lines = doc.get_line_count()" << std::endl; std::cout << " doc.set_text(srcout)" << std::endl; std::cout << " while Gtk.events_pending():" << std::endl; std::cout << " Gtk.main_iteration_do(False)" << std::endl; std::cout << "" << std::endl; std::cout << " hop = doc.get_iter_at_line(line)" << std::endl; std::cout << " self.view.scroll_to_iter(hop,0,True,0,0)" << std::endl; std::cout << " doc.goto_line(cline)" << std::endl; std::cout << " lines = doc.get_line_count()" << std::endl; std::cout << " s = \"\"" << std::endl; std::cout << " for i in flags:" << std::endl; std::cout << " s = s+\" \"+i" << std::endl; std::cout << "" << std::endl; std::cout << " mesg.set_text(\"flags used: \"+s+\" \\n\"+ \\" << std::endl; std::cout << " str(lines)+\" lines indented\")" << std::endl; std::cout << " if lines == orig_lines+1:" << std::endl; std::cout << " mesg.insert_at_cursor(\", empty line added\")" << std::endl; std::cout << "" << std::endl; std::cout << " if lines != orig_lines and lines != orig_lines+1:" << std::endl; std::cout << " mesg.insert_at_cursor(\"\\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")" << std::endl; std::cout << " mesg.insert_at_cursor(\"\\nXX MALFUNCTION DETECTED, UNDO TWICE! XX\")" << std::endl; std::cout << " mesg.insert_at_cursor(\"\\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")" << std::endl; std::cout << "" << std::endl; std::cout << "# ex:ts=4:et:" << std::endl; findent-3.1.1/src/findentclass.h0000644000175000017500000000524013361276645013517 00000000000000#ifndef FINDENTCLASS_H #define FINDENTCLASS_H #include #include // pair #include #include "flags.h" #include "prop.h" #include "findent_types.h" #include "debug.h" #include "fortranline.h" #include "globals.h" class Findent { public: Findent() {} Findent(Flags &f) { // // public // gl = new Globals; cur_indent = 0; cur_rprop = empty_rprop; end_of_file = 0; endline = "\n"; flags = f; indent_handled = 0; labellength = 0; nbseen = 0; num_lines = 0; start_indent = 0; gl->global_format = UNKNOWN; gl->global_gnu_format = flags.input_format_gnu;; gl->global_line_length = flags.input_line_length; gl->global_omp = flags.honour_omp; // // private // all_indent = 0; endline_set = 0; input_format = flags.input_format; lines_read = 0; output_format = 0; reading_from_tty = 0; // // for getnext: // prevlastchar = 0; } ~Findent() { delete gl; } Fortranline getnext(bool &eof, bool use_wb = 1); Fortranline mygetline(bool &eof, bool buffer = 0); void handle_pre_light(Fortranline &line, bool &p_more); void init_indent(); int run(); int cur_indent; std::string endline; bool end_of_file; Flags flags; Globals* gl; bool indent_handled; indent_t indent; // to store indents int input_format; int labellength; bool nbseen; int num_lines; int output_format; int start_indent; std::set > includes; private: int all_indent; linebuffer_t curlinebuffer; // deque for source lines prop_t cur_rprop; bool endline_set; int lines_read; bool reading_from_tty; linebuffer_t wizardbuffer; // to store wizard lines and push back lines from handle_fortran int determine_fix_or_free(); int guess_fixedfree(Fortranline &line); int guess_indent(Fortranline line); std::string handle_dos(const std::string &s); void handle_reading_from_tty(); void output_deps(); std::string type2str(const int t); int what_to_return(); void push_indent(int p) { indent.push_back(p); } // for handle_pre_light: int pregentype; // for getnext: char prevlastchar; }; #endif findent-3.1.1/src/readme.inc0000644000175000017500000014055013402501024012577 00000000000000 std::cout << "For installation instructions and usage, see README.1st and INSTALL" << std::endl; std::cout << "" << std::endl; std::cout << "This document is a not very well structured story about findent." << std::endl; std::cout << "You can skip this and use findent after reading the output of" << std::endl; std::cout << " findent -h." << std::endl; std::cout << "" << std::endl; std::cout << "findent, what?" << std::endl; std::cout << "==============" << std::endl; std::cout << "" << std::endl; std::cout << " findent is an indenter for Fortran programs, fixed and free format." << std::endl; std::cout << " findent can also translate fixed format to free format and vice versa." << std::endl; std::cout << " Since version 3.0.0, findent can generate dependencies based on USE," << std::endl; std::cout << " MODULE, SUBMODULE, INCLUDE, #include, ??include and emit a bash script" << std::endl; std::cout << " that, using findent, creates a dependency file to be used in a Makefile." << std::endl; std::cout << "" << std::endl; std::cout << " findent will take care of:" << std::endl; std::cout << "" << std::endl; std::cout << " continuation lines" << std::endl; std::cout << " multi-statement lines" << std::endl; std::cout << " labelled and unlabelled do-loops" << std::endl; std::cout << " IF" << std::endl; std::cout << " IF ... THEN ... ENDIF" << std::endl; std::cout << " where" << std::endl; std::cout << " FORALL" << std::endl; std::cout << " WHERE constructs" << std::endl; std::cout << " FORALL constructs" << std::endl; std::cout << " etc. see findentclass.cpp for details" << std::endl; std::cout << "" << std::endl; std::cout << " findent will remove trailing spaces and tabs, and convert" << std::endl; std::cout << " tabs at the start of a line into spaces. By default, statement " << std::endl; std::cout << " labels are placed at the start of a line. Apart from this and" << std::endl; std::cout << " indenting, findent will not alter the input, trying to" << std::endl; std::cout << " preserve alignment. For example, the alignment in:" << std::endl; std::cout << "" << std::endl; std::cout << " X = 3.0*A + 4*B + &" << std::endl; std::cout << " & 2 *C + Y" << std::endl; std::cout << "" << std::endl; std::cout << " will remain intact." << std::endl; std::cout << "" << std::endl; std::cout << " Optionally, findent will refactor lines that end a subroutine etc.:" << std::endl; std::cout << "" << std::endl; std::cout << " SUBROUTINE SUB" << std::endl; std::cout << " ..." << std::endl; std::cout << " END FUNCTION MYFUN" << std::endl; std::cout << "" << std::endl; std::cout << " will become:" << std::endl; std::cout << "" << std::endl; std::cout << " SUBROUTINE SUB" << std::endl; std::cout << " ..." << std::endl; std::cout << " END SUBROUTINE SUB" << std::endl; std::cout << "" << std::endl; std::cout << " findent is space-insensitive, for example a line like:" << std::endl; std::cout << "" << std::endl; std::cout << " REALFUN CTIONFUN(X)" << std::endl; std::cout << "" << std::endl; std::cout << " is recognized as the start of a function definition." << std::endl; std::cout << "" << std::endl; std::cout << " Usage:" << std::endl; std::cout << "" << std::endl; std::cout << " findent -h" << std::endl; std::cout << "" << std::endl; std::cout << "findent, why?" << std::endl; std::cout << "=============" << std::endl; std::cout << "" << std::endl; std::cout << " There are a number of public domain Fortran indenting tools, for example:" << std::endl; std::cout << "" << std::endl; std::cout << " - vim is shipped with an simple Fortran indenter" << std::endl; std::cout << " - emacs has a Fortran indenter" << std::endl; std::cout << " - floppy, only for fixed format: http://www.netlib.org/floppy/" << std::endl; std::cout << " - convert.f90: converts from fixed to free format, and indents:" << std::endl; std::cout << " ftp://ftp.numerical.rl.ac.uk/pub/MandR/convert.f90" << std::endl; std::cout << " - f2f90: based on convert.f90: http://www.fortran.com/f2f90.tar.gz" << std::endl; std::cout << " - f90ppr: an impressive piece of software that beautifies" << std::endl; std::cout << " Fortran code and contains a macro processor." << std::endl; std::cout << " http://fortranwiki.org/fortran/show/f90ppr" << std::endl; std::cout << " - fprettify: an indenter and beautifier, written in Python." << std::endl; std::cout << " IMHO not mature at the time of this writing (august 2018)." << std::endl; std::cout << " https://github.com/pseewald/fprettify" << std::endl; std::cout << "" << std::endl; std::cout << " For me, the problem with these tools is, that " << std::endl; std::cout << "" << std::endl; std::cout << " - they are too simple (for example, do not recognize labelled " << std::endl; std::cout << " do-loops) " << std::endl; std::cout << " - or do too much (destroying neatly aligned pieces of code)" << std::endl; std::cout << " - or are for me too complicated to adapt and extend." << std::endl; std::cout << "" << std::endl; std::cout << " Furthermore, I want that indenting does not make irreversible changes " << std::endl; std::cout << " to the source: I want always be able to get back to the version after" << std::endl; std::cout << " the first indenting. (Exceptions: converting from fixed to free format;" << std::endl; std::cout << " adding 'subroutine foo' after 'end')." << std::endl; std::cout << "" << std::endl; std::cout << " Therefore I decided, having some spare time after my retirement, " << std::endl; std::cout << " to try to build a Fortran indenter, based on flex and bison for" << std::endl; std::cout << " readability." << std::endl; std::cout << " As programming language I chose C++, because of the availability" << std::endl; std::cout << " of string and deque." << std::endl; std::cout << "" << std::endl; std::cout << " After more or less finishing the indenting part, I realized that" << std::endl; std::cout << " findent should be able to play a role in determining the dependencies" << std::endl; std::cout << " based on (sub)modules and various kinds of include's. So I added some" << std::endl; std::cout << " lines to accomplish this. Together with an simple script " << std::endl; std::cout << " dependencies are easily created. See 'man findent' under '--deps' for" << std::endl; std::cout << " details. " << std::endl; std::cout << "" << std::endl; std::cout << " There are some tools that can generate dependencies for Fortran" << std::endl; std::cout << " projects:" << std::endl; std::cout << "" << std::endl; std::cout << " - makedepf90: see https://github.com/outpaddling/makedepf90, also" << std::endl; std::cout << " in debian and ubuntu. It seems that there is no support for" << std::endl; std::cout << " submodules, but apart from that it seems to work well." << std::endl; std::cout << " - f90_mod_deps.py: see " << std::endl; std::cout << " http://lagrange.mechse.illinois.edu/f90_mod_deps/f90_mod_deps.py" << std::endl; std::cout << " does not seem to work properly." << std::endl; std::cout << " - fortdepend: see https://github.com/ZedThree/fort_depend.py" << std::endl; std::cout << " Does not work with submodules and is picky about end statements." << std::endl; std::cout << "" << std::endl; std::cout << " I did not investigate if these tools can cope with split MODULE and" << std::endl; std::cout << " USE lines and fixed-format space-independent source code." << std::endl; std::cout << "" << std::endl; std::cout << "" << std::endl; std::cout << "findent, how?" << std::endl; std::cout << "=============" << std::endl; std::cout << "" << std::endl; std::cout << " So, here it is, a Fortran indenter to my taste, based on flex," << std::endl; std::cout << " bison and g++. " << std::endl; std::cout << "" << std::endl; std::cout << " The program performs the following major tasks:" << std::endl; std::cout << "" << std::endl; std::cout << " - determine the input format: free or fixed" << std::endl; std::cout << " - glue together continuation lines removing comments" << std::endl; std::cout << " - pre-process the assembled input line, to make it better processable " << std::endl; std::cout << " by flex: remove white space, substitute strings, hollerith's, " << std::endl; std::cout << " statement label and operators like .EQ. by special tokens" << std::endl; std::cout << " - perform a two-stage parsing:" << std::endl; std::cout << " - try if the line is an assignment" << std::endl; std::cout << " - if it is not an assignment, parse the line using as tokens the" << std::endl; std::cout << " Fortran keywords (SUBROUTINE, DO, ...)" << std::endl; std::cout << " - based on the outcome of the parse, determine the indentation" << std::endl; std::cout << " - output the lines that were read in to compose the full line," << std::endl; std::cout << " trying to preserve the lay-out after the original leading white" << std::endl; std::cout << " space, optionally converting from fixed-form to free-form." << std::endl; std::cout << " Also optionally, lines that end a subroutine, program etc.," << std::endl; std::cout << " are completed (or even modified) as in:" << std::endl; std::cout << " END subroutine mysub" << std::endl; std::cout << " Preprocessor statements are accounted for to prevent that code like:" << std::endl; std::cout << "" << std::endl; std::cout << " #ifdef one" << std::endl; std::cout << " SUBROUTINE ONE" << std::endl; std::cout << " #else" << std::endl; std::cout << " SUBROUTINE TWO" << std::endl; std::cout << " #endif" << std::endl; std::cout << "" << std::endl; std::cout << " would result in a double SUBROUTINE indentation." << std::endl; std::cout << " Moreover, track is kept of do-labels, in order to correctly indent" << std::endl; std::cout << " constructs like:" << std::endl; std::cout << "" << std::endl; std::cout << " DO 10 I=1,20" << std::endl; std::cout << " DO 10 J=1,10" << std::endl; std::cout << " X(I) = Y(I)+J" << std::endl; std::cout << " 10 CONTINUE" << std::endl; std::cout << "" << std::endl; std::cout << "Findent, structure" << std::endl; std::cout << "==================" << std::endl; std::cout << "" << std::endl; std::cout << " In version 2.8.4, a major reorganizing has been done, trying to" << std::endl; std::cout << " make the source more readable and more object-oriented." << std::endl; std::cout << "" << std::endl; std::cout << " These are the classes (all starting with a capital):" << std::endl; std::cout << "" << std::endl; std::cout << " - Debugostream" << std::endl; std::cout << "" << std::endl; std::cout << " This class contains code for debugging." << std::endl; std::cout << "" << std::endl; std::cout << " - Docs" << std::endl; std::cout << "" << std::endl; std::cout << " This class contains code (often generated) to output help-" << std::endl; std::cout << " texts (includeing this text) etcetera." << std::endl; std::cout << "" << std::endl; std::cout << " - Findentclass" << std::endl; std::cout << "" << std::endl; std::cout << " Findentclass contains basic functions and variables that" << std::endl; std::cout << " are used throughout the program, such as:" << std::endl; std::cout << "" << std::endl; std::cout << " int determine_fix_or_free()" << std::endl; std::cout << " if the input format is not given (parameter -ifixed" << std::endl; std::cout << " or -ifree), this function tries to find a proof that" << std::endl; std::cout << " the program is free-format. If so, FREE is returned," << std::endl; std::cout << " else FIXED." << std::endl; std::cout << "" << std::endl; std::cout << " Fortranline mygetline()" << std::endl; std::cout << " Reads a line from STDIN." << std::endl; std::cout << " Optionally, the function builds a buffer to store the" << std::endl; std::cout << " line just read, this option is used by determine_fixed_or_free()." << std::endl; std::cout << "" << std::endl; std::cout << " Fortranline Getline()" << std::endl; std::cout << " Uses the buffer from mygetline() or mygetline() to return" << std::endl; std::cout << " a Fortranline. Optionally, maintains a buffer (wizardbuffer)" << std::endl; std::cout << " to enable a look-ahead for the wizard functions." << std::endl; std::cout << " " << std::endl; std::cout << "" << std::endl; std::cout << " - Fortranline" << std::endl; std::cout << "" << std::endl; std::cout << " This class contains a line of fortran code, and has many" << std::endl; std::cout << " frequently used functions operating on that line." << std::endl; std::cout << "" << std::endl; std::cout << " - Fortran" << std::endl; std::cout << "" << std::endl; std::cout << " This is an abstract class with functions and variables needed" << std::endl; std::cout << " to construct a 'full_statement': a string that is composed" << std::endl; std::cout << " of pure fortran code (stripped from comments, preprocessor" << std::endl; std::cout << " directives, ..) and a deque of lines that constructed the" << std::endl; std::cout << " full_statement, including comments and preprocessor statements. " << std::endl; std::cout << "" << std::endl; std::cout << " The pure virtual functions are filled in by class Fixed or" << std::endl; std::cout << " class Free, depending on the format of the input." << std::endl; std::cout << "" << std::endl; std::cout << " The indentation required is computed from full_statement" << std::endl; std::cout << " and the current indentation." << std::endl; std::cout << "" << std::endl; std::cout << " Special provisions are made for storing labelled do statements," << std::endl; std::cout << " preprocessor statements and more." << std::endl; std::cout << "" << std::endl; std::cout << " - Free" << std::endl; std::cout << "" << std::endl; std::cout << " This class is a child of Fortran, and contains functions to" << std::endl; std::cout << " indent and output the deque containing the continuation lines" << std::endl; std::cout << " of a free format fortran source." << std::endl; std::cout << " Also, when conversion from free to fixed format is required, " << std::endl; std::cout << " there is code to store the continuation lines in a fixed" << std::endl; std::cout << " (not properly indented) deque, and present this to Fixed to" << std::endl; std::cout << " output this in a properly indented format." << std::endl; std::cout << "" << std::endl; std::cout << " - Fixed" << std::endl; std::cout << "" << std::endl; std::cout << " Basically the same as Free, but vice-versa. " << std::endl; std::cout << " There is a special issue: to determine if there are continuation" << std::endl; std::cout << " lines, a wizard has been created that can look ahead, see" << std::endl; std::cout << " getnext() in Findentclass." << std::endl; std::cout << "" << std::endl; std::cout << " - Flags" << std::endl; std::cout << "" << std::endl; std::cout << " This class implements a container for the flags (-ifree, -i4 ...)" << std::endl; std::cout << " and contains code to interpret the flags." << std::endl; std::cout << "" << std::endl; std::cout << " - Globals" << std::endl; std::cout << "" << std::endl; std::cout << " This class implements a container for a few global variables." << std::endl; std::cout << " Maybe, one would be tempted to make these static, but I tried " << std::endl; std::cout << " not to use static variables in order to able to run more than" << std::endl; std::cout << " one Findent in one program, one reading from STDIN, the other" << std::endl; std::cout << " from a file for example. " << std::endl; std::cout << "" << std::endl; std::cout << " - Line_prep" << std::endl; std::cout << "" << std::endl; std::cout << " This class contains code to pre-analyze a full_statement to" << std::endl; std::cout << " make the work easier for the lexer and parser." << std::endl; std::cout << "" << std::endl; std::cout << " - Pre_analyzer" << std::endl; std::cout << "" << std::endl; std::cout << " This class contains code to see if a line is a preprocessor" << std::endl; std::cout << " statement or a findentfix: line." << std::endl; std::cout << "" << std::endl; std::cout << " - Simpleostream" << std::endl; std::cout << "" << std::endl; std::cout << " This class implements a simple filter to std::cout." << std::endl; std::cout << "" << std::endl; std::cout << " The program starts in findent.cpp, and goes on in fortranrun.cpp." << std::endl; std::cout << "" << std::endl; std::cout << "" << std::endl; std::cout << " The whole thing is somewhat more hairy than I would like to see." << std::endl; std::cout << " I did not succeed to make the whole thing strictly hierarchical," << std::endl; std::cout << " and solved this by giving classes access to the internals of" << std::endl; std::cout << " other classes using pointers. But, like in biology, in creating" << std::endl; std::cout << " a program, there is no law to keep it simple." << std::endl; std::cout << "" << std::endl; std::cout << "" << std::endl; std::cout << "findent, usage?" << std::endl; std::cout << "===============" << std::endl; std::cout << "" << std::endl; std::cout << " Findent reads from standard input and writes to standard output:" << std::endl; std::cout << "" << std::endl; std::cout << " findent < prog.f90 > prog1.f90" << std::endl; std::cout << "" << std::endl; std::cout << " See also 'wfindent', later in this file." << std::endl; std::cout << "" << std::endl; std::cout << " The command" << std::endl; std::cout << "" << std::endl; std::cout << " findent -h" << std::endl; std::cout << "" << std::endl; std::cout << " gives an overview of the possible flags and there effect. Most" << std::endl; std::cout << " interesting are:" << std::endl; std::cout << "" << std::endl; std::cout << " -i " << std::endl; std::cout << " example: -i5" << std::endl; std::cout << " which determines the amount of indent to be used by every" << std::endl; std::cout << " item that calls for indenting" << std::endl; std::cout << " -Ia" << std::endl; std::cout << " The starting indent is determined from the first line (more" << std::endl; std::cout << " or less), useful when using findent within vim, for example" << std::endl; std::cout << " to intent a selected region:" << std::endl; std::cout << "" << std::endl; std::cout << " '<,'>:!findent -Ia" << std::endl; std::cout << "" << std::endl; std::cout << " -ofree" << std::endl; std::cout << " converts from fixed format to free format." << std::endl; std::cout << "" << std::endl; std::cout << " -L" << std::endl; std::cout << " example: -L72" << std::endl; std::cout << " limit input line length to 72 characters." << std::endl; std::cout << "" << std::endl; std::cout << " NOTE 1: findent knows about tabbed input: for fixed-format input," << std::endl; std::cout << " the following transformations are made:" << std::endl; std::cout << "" << std::endl; std::cout << " 10I= -> 10I=" << std::endl; std::cout << " 1K*J -> 1K*J" << std::endl; std::cout << " X=Y -> X=Y" << std::endl; std::cout << "" << std::endl; std::cout << " So, a tab followed by 1-9 is transformed to a continuation line," << std::endl; std::cout << " otherwise to a normal line, starting in column 7." << std::endl; std::cout << "" << std::endl; std::cout << " NOTE 2: findent silently ignores errors in the flags" << std::endl; std::cout << "" << std::endl; std::cout << " NOTE 3: handling of continuation lines" << std::endl; std::cout << " Example:" << std::endl; std::cout << "" << std::endl; std::cout << " a = &" << std::endl; std::cout << " (/ 3, 10, 12, 4, &" << std::endl; std::cout << " 5, 9, 1, 0, &" << std::endl; std::cout << " 13, 2, 25, 6 /)" << std::endl; std::cout << "" << std::endl; std::cout << " After running findent, with standard parameters, you get this:" << std::endl; std::cout << "" << std::endl; std::cout << " a = &" << std::endl; std::cout << " (/ 3, 10, 12, 4, &" << std::endl; std::cout << " 5, 9, 1, 0, &" << std::endl; std::cout << " 13, 2, 25, 6 /)" << std::endl; std::cout << "" << std::endl; std::cout << " That is probably not what you really want." << std::endl; std::cout << "" << std::endl; std::cout << " The recommended solution is: add '&' at the start of the " << std::endl; std::cout << " continuation lines:" << std::endl; std::cout << "" << std::endl; std::cout << " a = &" << std::endl; std::cout << " & (/ 3, 10, 12, 4, &" << std::endl; std::cout << " & 5, 9, 1, 0, &" << std::endl; std::cout << " & 13, 2, 25, 6 /) " << std::endl; std::cout << "" << std::endl; std::cout << " Findent will indent this as:" << std::endl; std::cout << "" << std::endl; std::cout << " a = &" << std::endl; std::cout << " & (/ 3, 10, 12, 4, &" << std::endl; std::cout << " & 5, 9, 1, 0, &" << std::endl; std::cout << " & 13, 2, 25, 6 /)" << std::endl; std::cout << "" << std::endl; std::cout << " Not recommended solution: You can use the '-k-' flag, like:" << std::endl; std::cout << " findent -k- < prog.f90 > prog1.f90" << std::endl; std::cout << " " << std::endl; std::cout << " Findent will in this case not touch continuation lines without " << std::endl; std::cout << " a starting '&', but leave them as they are." << std::endl; std::cout << "" << std::endl; std::cout << " NOTE 4:" << std::endl; std::cout << " " << std::endl; std::cout << " Findent does not check the length of an output line, so it could" << std::endl; std::cout << " be that the length will be larger than 72 or 132 for fixed and " << std::endl; std::cout << " free format respectively. In fact, indenting old fixed format" << std::endl; std::cout << " sources will very likely result in lines longer than 72 columns." << std::endl; std::cout << " If you are lucky, the compiler will generate an error message," << std::endl; std::cout << " but too long lines can result in changing the semantics of a " << std::endl; std::cout << " program without notice." << std::endl; std::cout << " Advice: use a compiler flag that allows long lines:" << std::endl; std::cout << "" << std::endl; std::cout << " gfortran, free format: -ffree-line-length-none # unlimited" << std::endl; std::cout << " gfortran, fixed formtat: -ffixed-line-length-none # unlimited" << std::endl; std::cout << " ifort, free format: # no flag needed, default is unlimited" << std::endl; std::cout << " ifort, fixed format: -132 # max line length is 132" << std::endl; std::cout << " pgf90, free format: # max line length is 264, " << std::endl; std::cout << " # error if longer" << std::endl; std::cout << " pgf90, fixed format: -Mextend # max line length is 132, " << std::endl; std::cout << " # no error if longer" << std::endl; std::cout << "" << std::endl; std::cout << " NOTE 4.1:" << std::endl; std::cout << " Here a script to check for line length:" << std::endl; std::cout << "" << std::endl; std::cout << ">>>> snip ---------- checklength ---------------------------------------" << std::endl; std::cout << "" << std::endl; std::cout << "" << std::endl; std::cout << "#!/bin/bash" << std::endl; std::cout << "# checks file line lengths" << std::endl; std::cout << "# Usage:" << std::endl; std::cout << "# checklength [file ...]" << std::endl; std::cout << "# outputs \"filename:line number:line length:line\" for lines longer than length" << std::endl; std::cout << "# tabs are converted to spaces using expand" << std::endl; std::cout << "# if no file is given, read from stdin" << std::endl; std::cout << "usage()" << std::endl; std::cout << "{" << std::endl; std::cout << " echo \"Usage:\"" << std::endl; std::cout << " echo \"$0 [file ...]\"" << std::endl; std::cout << "}" << std::endl; std::cout << "if [ -z \"$1\" ] ; then" << std::endl; std::cout << " usage" << std::endl; std::cout << " exit 1" << std::endl; std::cout << "fi" << std::endl; std::cout << "l=\"$1\"" << std::endl; std::cout << "doit()" << std::endl; std::cout << "{" << std::endl; std::cout << " expand | awk -v l=\"$1\" -v f=\"$2\" '{" << std::endl; std::cout << " if (length($0) > l)" << std::endl; std::cout << " printf \"%s:%d:%d:%s\\n\",f,FNR,length($0),$0" << std::endl; std::cout << " }'" << std::endl; std::cout << "}" << std::endl; std::cout << "" << std::endl; std::cout << "if [ -z \"$2\" ] ; then" << std::endl; std::cout << " doit \"$l\" \"-\"" << std::endl; std::cout << " exit 0" << std::endl; std::cout << "fi" << std::endl; std::cout << "" << std::endl; std::cout << "shift" << std::endl; std::cout << "while [ \"$1\" ] ; do" << std::endl; std::cout << " cat \"$1\" | doit \"$l\" \"$1\"" << std::endl; std::cout << " shift" << std::endl; std::cout << "done" << std::endl; std::cout << "" << std::endl; std::cout << "<<<< snip ---------- checklength --------------------------------------" << std::endl; std::cout << "" << std::endl; std::cout << " Example of usage:" << std::endl; std::cout << " checklength 72 *.f" << std::endl; std::cout << "" << std::endl; std::cout << " NOTE 5: handling of comment lines" << std::endl; std::cout << "" << std::endl; std::cout << " Findent indents comment lines, but does not touch comment lines" << std::endl; std::cout << " with the '!' in column one." << std::endl; std::cout << "" << std::endl; std::cout << " NOTE 5.1: handling of comment lines converting fixed to free format" << std::endl; std::cout << "" << std::endl; std::cout << " As said above, findent does not touch comments starting" << std::endl; std::cout << " in column 1. Since all vintage comments start in column 1," << std::endl; std::cout << " this has the effect that these comments will not be indented" << std::endl; std::cout << " when converting from fixed to free format (using -ofree)." << std::endl; std::cout << " If you want the comments indented, convert to free format," << std::endl; std::cout << " add a space before every line and use findent again." << std::endl; std::cout << "" << std::endl; std::cout << " Example if the stream editor 'sed' is available:" << std::endl; std::cout << "" << std::endl; std::cout << " findent -ofree < prog.f | sed 's/^/ /' | findent > prog.f90" << std::endl; std::cout << "" << std::endl; std::cout << " If 'sed' is not available (on Windows for example), you" << std::endl; std::cout << " can create the program 'addspace' or, on Windows, 'addspace.exe'" << std::endl; std::cout << " by compiling this program:" << std::endl; std::cout << "" << std::endl; std::cout << ">>>> snip -------- addspace.f ------------------------------------------" << std::endl; std::cout << "program addspace" << std::endl; std::cout << " implicit none" << std::endl; std::cout << " character(1000) :: line" << std::endl; std::cout << " integer :: io" << std::endl; std::cout << " do" << std::endl; std::cout << " read(*,'(a)',iostat=io) line" << std::endl; std::cout << " if (io .ne. 0) exit" << std::endl; std::cout << " write(*,'(1x,a)') trim(line)" << std::endl; std::cout << " enddo" << std::endl; std::cout << "end program addspace" << std::endl; std::cout << "<<<< snip -------- addspace.f ------------------------------------------" << std::endl; std::cout << "" << std::endl; std::cout << " Or, if you have a vintage Fortran-4 compiler, by compiling" << std::endl; std::cout << " this program:" << std::endl; std::cout << "" << std::endl; std::cout << ">>>> snip -------- ADDSPACE.F ------------------------------------------" << std::endl; std::cout << " DIMENSION L(1000)" << std::endl; std::cout << " DATA LB/1H /" << std::endl; std::cout << " 10 DO 15 I=1,1000" << std::endl; std::cout << " 15 L(I)=LB" << std::endl; std::cout << " READ(5,100,END=30) L" << std::endl; std::cout << " DO 20 I=1000,1,-1" << std::endl; std::cout << " IF (L(I)-LB) 25,20,25" << std::endl; std::cout << " 20 CONTINUE" << std::endl; std::cout << " WRITE(6,110)" << std::endl; std::cout << " GOTO 10" << std::endl; std::cout << " 25 WRITE(6,110) (L(J),J=1,I)" << std::endl; std::cout << " GOTO 10" << std::endl; std::cout << " 30 CONTINUE" << std::endl; std::cout << " 100 FORMAT(1000A1)" << std::endl; std::cout << " 110 FORMAT(1H ,1000A1)" << std::endl; std::cout << " END" << std::endl; std::cout << "<<<< snip -------- ADDSPACE.F ------------------------------------------" << std::endl; std::cout << "" << std::endl; std::cout << " Use the generated program 'addspace' in stead of 'sed':" << std::endl; std::cout << "" << std::endl; std::cout << " findent -ofree < prog.f | addspace | findent > prog.f90" << std::endl; std::cout << "" << std::endl; std::cout << "findent, failure, findentfix:" << std::endl; std::cout << "=============================" << std::endl; std::cout << "" << std::endl; std::cout << " One thing is certain: findent contains errors. I appreciate it " << std::endl; std::cout << " if you bring errors to my attention. If possible I will fix them." << std::endl; std::cout << "" << std::endl; std::cout << " On the other hand, it is possible to fool findent, for example" << std::endl; std::cout << " by using #ifdef, #else, #endif in a way that confuses findent." << std::endl; std::cout << "" << std::endl; std::cout << " Both cases can be solved using ! findentfix: , read on:" << std::endl; std::cout << "" << std::endl; std::cout << " The next program will not be indented correctly:" << std::endl; std::cout << "" << std::endl; std::cout << ">>>> snip -------- fixdemo.f90 -----------------------------------------" << std::endl; std::cout << "! compile with: gfortran -cpp fixdemo.f90" << std::endl; std::cout << "! or" << std::endl; std::cout << "! gfortran -cpp -DLOOPJ fixdemo.f90" << std::endl; std::cout << " program fixdemo" << std::endl; std::cout << " implicit none" << std::endl; std::cout << " integer i,j" << std::endl; std::cout << " j=4" << std::endl; std::cout << " do i=1,3" << std::endl; std::cout << "#ifdef LOOPJ" << std::endl; std::cout << " do j=1,2" << std::endl; std::cout << "#endif" << std::endl; std::cout << " print *,i*j" << std::endl; std::cout << " enddo" << std::endl; std::cout << "#ifdef LOOPJ" << std::endl; std::cout << " enddo" << std::endl; std::cout << " print *,'with j-loop'" << std::endl; std::cout << "#else" << std::endl; std::cout << " print *,'without j-loop'" << std::endl; std::cout << "#endif" << std::endl; std::cout << " continue" << std::endl; std::cout << " end program fixdemo" << std::endl; std::cout << "<<<< snip -------- fixdemo.f90 -----------------------------------------" << std::endl; std::cout << "" << std::endl; std::cout << " That is because findent takes the indentation from:" << std::endl; std::cout << "#ifdef LOOPJ" << std::endl; std::cout << " do j=1,2" << std::endl; std::cout << "#endif" << std::endl; std::cout << " and" << std::endl; std::cout << "#else" << std::endl; std::cout << " print *,'without j-loop'" << std::endl; std::cout << "#endif" << std::endl; std::cout << "" << std::endl; std::cout << " So, findent is missing an enddo for the j-loop." << std::endl; std::cout << "" << std::endl; std::cout << " In this case, the solution would be to insert #else just before the" << std::endl; std::cout << " first #endif. " << std::endl; std::cout << " If, however, in a real-world example this is not possible, or " << std::endl; std::cout << " when findent really makes an error, you can use findentfix." << std::endl; std::cout << " In the example above, insert directly after the last #endif:" << std::endl; std::cout << " ! findentfix: enddo" << std::endl; std::cout << " and findent will indent correctly. In general, the text after" << std::endl; std::cout << " ! findentfix:" << std::endl; std::cout << " will be used by findent as a normal source line, so the following" << std::endl; std::cout << " could also be useful:" << std::endl; std::cout << " ! FINDENTfix: subroutine dummy" << std::endl; std::cout << " ! findentFIX: do;do;do" << std::endl; std::cout << " ! FINDENTFIX: end;end" << std::endl; std::cout << " ! findentfix: where ()" << std::endl; std::cout << " But the following would do nothing:" << std::endl; std::cout << " ! findentfix: continue" << std::endl; std::cout << "" << std::endl; std::cout << "" << std::endl; std::cout << "findent, creating a dependency file for use in an Makefile." << std::endl; std::cout << "===========================================================" << std::endl; std::cout << "" << std::endl; std::cout << " findent --deps < prog.f90" << std::endl; std::cout << "" << std::endl; std::cout << " prints the dependencies found in prog.f90, based on USE," << std::endl; std::cout << " MODULE, SUBMODULE, INCLUDE, #include and ??include." << std::endl; std::cout << "" << std::endl; std::cout << " This is used by the bash script makefdeps to create a dependency" << std::endl; std::cout << " file for use in an Makefile. " << std::endl; std::cout << " Creation of the makefdeps script:" << std::endl; std::cout << "" << std::endl; std::cout << " findent --makefdeps > makefdeps" << std::endl; std::cout << " chmod +x makefdeps" << std::endl; std::cout << "" << std::endl; std::cout << " The command:" << std::endl; std::cout << "" << std::endl; std::cout << " ./makefdeps *.f90" << std::endl; std::cout << "" << std::endl; std::cout << " will output a dependency file, to be used in an Makefile." << std::endl; std::cout << " The dependencies are based on .o files, for example:" << std::endl; std::cout << "" << std::endl; std::cout << " main.o: sub1.o sub2.o" << std::endl; std::cout << " sub1.o: sub1.inc" << std::endl; std::cout << "" << std::endl; std::cout << " Example Makefile and fortran sources to create 'program' from " << std::endl; std::cout << " main.f90 sub1.f90 sub2.f90 sub.inc:" << std::endl; std::cout << "" << std::endl; std::cout << "" << std::endl; std::cout << ">>>> snip ---------- Makefile ---------------------------------------" << std::endl; std::cout << "SRCS = main.f90 sub1.f90 sub2.f90" << std::endl; std::cout << "OBJS = $(SRCS:.f90=.o)" << std::endl; std::cout << "%.o: %.f90" << std::endl; std::cout << " gfortran -c -o $@ $<" << std::endl; std::cout << "program: $(OBJS)" << std::endl; std::cout << " gfortran -o $@ $(OBJS)" << std::endl; std::cout << "include deps" << std::endl; std::cout << "dep deps:" << std::endl; std::cout << " findent --makefdeps < /dev/null > makefdeps.sh" << std::endl; std::cout << " @if [ \"`head -n 1 makefdeps.sh`\" != \"#!/bin/bash\" ] ; then \\" << std::endl; std::cout << " findent -v 1>&2; \\" << std::endl; std::cout << " echo \"Use findent version >= 3.0.0\" 1>&2 ; exit 1 ; fi" << std::endl; std::cout << " chmod +x makefdeps.sh" << std::endl; std::cout << " ./makefdeps.sh $(SRCS) > deps" << std::endl; std::cout << "clean: " << std::endl; std::cout << " rm -f *.o *.mod *.smod program deps" << std::endl; std::cout << "<<<< snip ---------- Makefile ---------------------------------------" << std::endl; std::cout << "" << std::endl; std::cout << ">>>> snip ---------- main.f90 ---------------------------------------" << std::endl; std::cout << " program main" << std::endl; std::cout << " use mymod1" << std::endl; std::cout << " use mymod" << std::endl; std::cout << " call sub1" << std::endl; std::cout << " call sub" << std::endl; std::cout << " end" << std::endl; std::cout << "<<<< snip ---------- main.f90 ---------------------------------------" << std::endl; std::cout << "" << std::endl; std::cout << ">>>> snip ---------- sub1.f90 ---------------------------------------" << std::endl; std::cout << " module mymod1" << std::endl; std::cout << " contains" << std::endl; std::cout << " subroutine sub1" << std::endl; std::cout << " print *,'this is sub1'" << std::endl; std::cout << " end" << std::endl; std::cout << " end" << std::endl; std::cout << " module mymod" << std::endl; std::cout << " interface" << std::endl; std::cout << " module subroutine sub" << std::endl; std::cout << " end subroutine" << std::endl; std::cout << " end interface" << std::endl; std::cout << " end module" << std::endl; std::cout << "<<<< snip ---------- sub1.f90 ---------------------------------------" << std::endl; std::cout << "" << std::endl; std::cout << ">>>> snip ---------- sub2.f90 ---------------------------------------" << std::endl; std::cout << " submodule (mymod) mymod2" << std::endl; std::cout << " contains" << std::endl; std::cout << " module procedure sub" << std::endl; std::cout << " include 'sub.inc'" << std::endl; std::cout << " end procedure" << std::endl; std::cout << " end submodule" << std::endl; std::cout << "<<<< snip ---------- sub2.f90 ---------------------------------------" << std::endl; std::cout << "" << std::endl; std::cout << ">>>> snip ---------- sub.inc ---------------------------------------" << std::endl; std::cout << "print *,'this is sub'" << std::endl; std::cout << "<<<< snip ---------- sub.inc ---------------------------------------" << std::endl; std::cout << "" << std::endl; std::cout << " The fortran sources will be compiled in correct order, you can even" << std::endl; std::cout << " use parallel make (make -j). BTW: this example uses the SUBMODULE" << std::endl; std::cout << " statement: you need to have gfortran >= 6 to compile." << std::endl; std::cout << "" << std::endl; std::cout << "" << std::endl; std::cout << "findent, installation:" << std::endl; std::cout << "======================" << std::endl; std::cout << "" << std::endl; std::cout << " (For a more comprehensive text, see README.1st and INSTALL)" << std::endl; std::cout << "" << std::endl; std::cout << " Linux:" << std::endl; std::cout << " $ ./configure --prefix=/usr/local" << std::endl; std::cout << " $ make" << std::endl; std::cout << " On systems with sudo (Debian, Ubuntu, Mint, ...):" << std::endl; std::cout << " $ sudo make install" << std::endl; std::cout << " On systems without sudo (Redhat, Scientific Linux, ...):" << std::endl; std::cout << " $ su -c 'make install'" << std::endl; std::cout << "" << std::endl; std::cout << " Windows:" << std::endl; std::cout << " copy findent.exe C:\\WINDOWS" << std::endl; std::cout << "" << std::endl; std::cout << "wfindent" << std::endl; std::cout << "========" << std::endl; std::cout << "" << std::endl; std::cout << " wfindent, a bash shell script, indents Fortran source in-place, " << std::endl; std::cout << " performing a sanity check." << std::endl; std::cout << " It accepts all flags that findent accepts." << std::endl; std::cout << "" << std::endl; std::cout << " Usage:" << std::endl; std::cout << "" << std::endl; std::cout << " wfindent [ findent flags ] files" << std::endl; std::cout << "" << std::endl; std::cout << " example" << std::endl; std::cout << "" << std::endl; std::cout << " wfindent -I4 *.f90" << std::endl; std::cout << "" << std::endl; std::cout << " Installation:" << std::endl; std::cout << " " << std::endl; std::cout << " If you installed findent with the ./configure, make, make install " << std::endl; std::cout << " method, wfindent is installed as well." << std::endl; std::cout << " Otherwise:" << std::endl; std::cout << " On systems with sudo (Debian, Ubuntu, Mint, ...):" << std::endl; std::cout << " $ sudo install scripts/wfindent /usr/local/bin" << std::endl; std::cout << " On systems without sudo (Redhat, Scientific Linux, ...):" << std::endl; std::cout << " $ su -c 'make install'" << std::endl; std::cout << "" << std::endl; std::cout << "wfindent.bat" << std::endl; std::cout << "============" << std::endl; std::cout << "" << std::endl; std::cout << " wfindent.bat is for usage in the cmd shell of Windows and has the same" << std::endl; std::cout << " functionality as wfindent, described just above." << std::endl; std::cout << "" << std::endl; std::cout << " Installation:" << std::endl; std::cout << "" << std::endl; std::cout << " copy wfindent.bat C:\\WINDOWS" << std::endl; std::cout << "" << std::endl; std::cout << "" << std::endl; std::cout << "jfindent or jfindent.jar" << std::endl; std::cout << "========================" << std::endl; std::cout << "" << std::endl; std::cout << " jfindent is a graphical front end for findent, and is available as" << std::endl; std::cout << " a separate package on findent.sourceforge.net" << std::endl; std::cout << "" << std::endl; std::cout << "findent and vim" << std::endl; std::cout << "===============" << std::endl; std::cout << "" << std::endl; std::cout << " Findent is since version 2.7 very vim-aware. When using the vim scripts" << std::endl; std::cout << " (look at findent --vim-help), findent is used as equalprg " << std::endl; std::cout << " ( :help equalprg )" << std::endl; std::cout << " and indentexpr ( :help indentexpr )" << std::endl; std::cout << " This is possible because of the speed of findent: it indents about " << std::endl; std::cout << " 50000 - 100000 lines per second." << std::endl; std::cout << "" << std::endl; std::cout << " Findent can emit configuration files, look at the output of:" << std::endl; std::cout << "" << std::endl; std::cout << " findent --vim_help" << std::endl; std::cout << "" << std::endl; std::cout << "findent and gedit" << std::endl; std::cout << "=================" << std::endl; std::cout << "" << std::endl; std::cout << " To enable findent in gedit, look at the output of:" << std::endl; std::cout << "" << std::endl; std::cout << " findent --gedit_help" << std::endl; std::cout << "" << std::endl; std::cout << "findent and emacs" << std::endl; std::cout << "=================" << std::endl; std::cout << "" << std::endl; std::cout << " To enable findent in emacs, look at the output of:" << std::endl; std::cout << "" << std::endl; std::cout << " findent --emacs_help" << std::endl; std::cout << "" << std::endl; std::cout << "Issues" << std::endl; std::cout << "======" << std::endl; std::cout << " " << std::endl; std::cout << " Since findent parses line-by-line, there are situations that are " << std::endl; std::cout << " ambiguous:" << std::endl; std::cout << "" << std::endl; std::cout << " F(X) = X**2 An assignment or a statement function?" << std::endl; std::cout << "" << std::endl; std::cout << " ELSE WHERE Is this an ELSEWHERE as in" << std::endl; std::cout << " WHERE(X .EQ. 0)" << std::endl; std::cout << " Y=10" << std::endl; std::cout << " ELSE WHERE" << std::endl; std::cout << " Y=1" << std::endl; std::cout << " END WHERE" << std::endl; std::cout << "" << std::endl; std::cout << " or is it part of an IF construct with name WHERE:" << std::endl; std::cout << " WHERE: IF (X .EQ. 0) THEN" << std::endl; std::cout << " Y=10" << std::endl; std::cout << " ELSE WHERE" << std::endl; std::cout << " Y=1" << std::endl; std::cout << " ENDIF WHERE" << std::endl; std::cout << "" << std::endl; std::cout << " Findent chooses the first possibility." << std::endl; std::cout << "" << std::endl; std::cout << " And there must be more ..." << std::endl; std::cout << " Luckily, it seems that these ambiguities do not affect indentation." << std::endl; std::cout << "" << std::endl; std::cout << " I tried to make findent Fortran-2008 compatible. This raised another" << std::endl; std::cout << " ambiguity, because findent is space-insensitive:" << std::endl; std::cout << "" << std::endl; std::cout << " MODULE PROCEDURE MYPROC Is this an module PROCEDUREMYPROC or" << std::endl; std::cout << " an moduleprocedure MYPROC?" << std::endl; std::cout << " Findent assumes the last." << std::endl; std::cout << "" << std::endl; std::cout << "Thanks to" << std::endl; std::cout << "=========" << std::endl; std::cout << "" << std::endl; std::cout << "It would not be possible for me to create findent if I could not stand" << std::endl; std::cout << "of the shoulders of other free software projects. In alphabetical order" << std::endl; std::cout << "(and probably forgetting some):" << std::endl; std::cout << "" << std::endl; std::cout << "autoconf: https://www.gnu.org/software/autoconf/autoconf.html" << std::endl; std::cout << "bash: https://www.gnu.org/software/bash/" << std::endl; std::cout << "bison: https://www.gnu.org/software/bison/" << std::endl; std::cout << "debian: https://www.debian.org/" << std::endl; std::cout << "flex: https://github.com/westes/flex" << std::endl; std::cout << "g++: https://gcc.gnu.org/" << std::endl; std::cout << "gcc: https://gcc.gnu.org/" << std::endl; std::cout << "gfortran: https://gcc.gnu.org/wiki/GFortran" << std::endl; std::cout << "gnu software: https://www.gnu.org/" << std::endl; std::cout << "kcachegrind: https://kcachegrind.github.io/html/Home.html" << std::endl; std::cout << "linux: https://en.wikipedia.org/wiki/Linux" << std::endl; std::cout << "make: https://www.gnu.org/software/make/" << std::endl; std::cout << "ubuntu: https://www.ubuntu.com/" << std::endl; std::cout << "valgrind: http://valgrind.org/" << std::endl; std::cout << "vim: https://www.vim.org/" << std::endl; std::cout << "" << std::endl; std::cout << "The website http://www.cplusplus.com/ helped me to find a way through C++." << std::endl; std::cout << "" << std::endl; std::cout << "I like to thank the people who gave suggestions to improve the functionality" << std::endl; std::cout << "of findent." << std::endl; std::cout << "" << std::endl; std::cout << "=============================================================================" << std::endl; std::cout << "" << std::endl; std::cout << "I am happy to receive comments, error reports and suggestions for" << std::endl; std::cout << "improvements." << std::endl; std::cout << "" << std::endl; std::cout << "October 2018, Willem Vermin, wvermin@gmail.com" << std::endl; std::cout << "" << std::endl; findent-3.1.1/src/fortran.cpp0000644000175000017500000004133713474503034013045 00000000000000#include "fortran.h" #include "pre_analyzer.h" #include "line_prep.h" #include "functions.h" #define Cur_indent fi->cur_indent #define FLAGS fi->flags #define Endline fi->endline #define End_of_file fi->end_of_file #define Getnext fi->getnext #define Includes fi->includes #define Curline (*curline) bool Fortran::output_pre(lines_t &lines, lines_t *outlines) { // // if the first line of lines is a preprocessor line // output this line and the continuation lines // popping lines // bool to_mycout = outlines == 0; if(lines.empty()) return 0; if (lines.front().pre()) { bool p_more = 0; while(1) { fi->handle_pre_light(lines.front(),p_more); if (lines.front().pre()) if (to_mycout) mycout << lines.front().trim() << Endline; else outlines->push_back(F(lines.front().trim())); else if (to_mycout) mycout << lines.front().str() << Endline; else outlines->push_back(F(lines.front().str())); lines.pop_front(); if (lines.empty() || !p_more) break; } return 1; } else return 0; } // end of output_pre void Fortran::handle_last_usable_only() { // // search for the last line that is usable to start indenting // using findent. // int usable_line = 1; fi->init_indent(); while(1) { int prev = fi->num_lines; get_full_statement(); Line_prep p(full_statement); propstruct props = parseline(p); switch (props.kind) { case BLANK: case CASE: case CASEDEFAULT: case CLASSIS: case CLASSDEFAULT: case CONTAINS: case ENTRY: case ELSE: case ELSEIF: case ELSEWHERE: case TYPEIS: break; default: usable_line = prev+1; break; } if (End_of_file) { std::cout << usable_line << Endline; return; } } } // end of last_usable_only void Fortran::get_full_statement() { // // this function collects 'full_statement': a complete // fortran line, concatenated from possible continuation lines, // comments and preprocessor lines removed // // full_statement is used to determine the indentation // // Also, every line is stored in 'lines' // // If the input starts with a comment or a preprocessor line, // full_statement = "", lines will contain the line, possibly // followed by preprocessor continuation lines as in: /* #define foo \ */ // bar // // A totally empty line is treated as a comment line, // // Comment lines and preprocessor lines can be embedded in // fortran continuation lines as in: // // subroutine compute( & // #ifdef one // x & // #else // x,y & // #endif // ) // // In this example, full_statement will contain: // // subroutine compute(x,y) // ( this is only correct if 'one' is not defined, but it // will not prevent correct indenting) // // // if things get hairy: try a finite state machine // // // see fortran.h for definitions of some variables // full_statement = ""; fi->indent_handled=0; if (first_call) { Curline = Getnext(End_of_file); first_call = 0; } while(!curlines.empty()) curlines.pop_back(); while(1) { switch(state) { case start: if (fs_store.empty()) full_statement = ""; else full_statement = fs_store.back(); if (End_of_file) { state = end_start; break; } pregentype = Curline.getpregentype(); if(pregentype == CPP || pregentype == COCO) { state = in_pre; break; } if (FLAGS.deps) { switch(pregentype) { case INCLUDE_CPP: case INCLUDE_CPP_STD: case INCLUDE_COCO: Includes.insert(std::make_pair(pregentype,Curline.getinclude())); } } if (is_findentfix(Curline)) { state = in_ffix; break; } state = in_fortran; break; case in_ffix: curlines.push_back(Curline); full_statement = rtrim(remove_trailing_comment(Curline.rest())); Curline = Getnext(End_of_file); state = start; return; case in_fortran: if(End_of_file) { state = end_fortran; break; } build_statement(Curline, f_more, pushback); if (f_more) { Curline = Getnext(End_of_file); if (End_of_file) { state = end_fortran; break; } pregentype = Curline.getpregentype(); if (pregentype == CPP || pregentype == COCO) { p_more = 0; while (1) { handle_pre(Curline,p_more); curlines.push_back(Curline); if(p_more) { Curline = Getnext(End_of_file); if (End_of_file) { state = end_fortran; break; } } else break; } Curline = Getnext(End_of_file); } if (FLAGS.deps) { switch(pregentype) { case INCLUDE_CPP: case INCLUDE_CPP_STD: case INCLUDE_COCO: Includes.insert(std::make_pair(pregentype,Curline.getinclude())); } } state = in_fortran; break; } state = in_fortran_1; // // need state in_fortran_1 to get correct result from last_usable // return; case in_fortran_1: if (!pushback) Curline = Getnext(End_of_file); state = start; break; case in_pre: p_more = 0; while(1) { handle_pre(Curline,p_more); curlines.push_back(Curline); if(p_more) { Curline = Getnext(End_of_file); if (End_of_file) { state = end_pre; break; } } else break; } Curline = Getnext(End_of_file); state = start; break; case end_start: case end_fortran: case end_pre: state = start; return; } } } // end of get_full_statement bool Fortran::is_findentfix(Fortranline &line) { bool rc = 0; switch (line.scanfixpre()) { case FINDENTFIX: rc = 1; break; case P_ON: ppp.on(); // debug.h, debug.cpp break; case P_OFF: ppp.off(); break; } return rc; } void Fortran::handle_pre(Fortranline &line, bool &p_more) { int ifelse; if((!p_more) && ( pregentype == CPP || pregentype == COCO)) { int pretype = line.scanfixpre(); switch(pretype) { case CPP: case COCO: case FINDENTFIX: break; default: ifelse = prea.analyze(line.trimmed_line(), pretype); switch(ifelse) { case Pre_analyzer::IF: push_all(); break; case Pre_analyzer::ELIF: top_all(); break; case Pre_analyzer::ELSE: top_all(); case Pre_analyzer::ENDIF: pop_all(); break; case Pre_analyzer::ENDIFE: break; default: return; break; } switch(ifelse) // full_statement needs apart treatment: { case Pre_analyzer::IF: fs_store.push_back(full_statement); break; case Pre_analyzer::ELIF: if(fs_store.empty()) full_statement = ""; else full_statement = fs_store.back(); break; case Pre_analyzer::ELSE: if(fs_store.empty()) full_statement = ""; else full_statement = fs_store.back(); break; case Pre_analyzer::ENDIF: case Pre_analyzer::ENDIFE: if(!fs_store.empty()) fs_store.pop_back(); break; } break; } } if(pregentype == CPP) p_more = (line.lastchar() == '\\'); else if(pregentype == COCO) p_more = (line.lastchar() == '&'); else p_more = 0; } // end of handle_pre void Fortran::indent_and_output() { std::string rest = full_statement; bool first_time = 1; while(1) { Line_prep p(rest); propstruct props = parseline(p); fi->labellength = props.label.size(); if (fi->labellength > 0) // // if there was a previous labeled do, handle it: // { int ilabel = string2number(props.label); while ( top_dolabel() == ilabel ) { pop_indent(); pop_dolabel(); Cur_indent = top_indent(); fi->indent_handled = 1; } } // // if the previous non-blank line was PROCEDURE (module procedure) // then determine if this was a procedure with content // if so: take delayed action with respect to indenting // if (prev_props.kind == PROCEDURE) { switch (props.kind) { case ASSIGNMENT: case UNCLASSIFIED: case BLOCK: case CHANGETEAM: case CONTAINS: case CRITICAL: case DO: case END: case ENDPROCEDURE: case ENTRY: case ENUM: case FORALL: case IF: case INCLUDE: case SELECTCASE: case SELECTTYPE: case TYPE: case WHERE: Cur_indent = top_indent(); push_indent(Cur_indent + FLAGS.routine_indent); empty_dolabels(); push_rprops(prev_props); break; default: break; } } Cur_indent = top_indent(); refactor_end_found = 0; // // for every entity that is eligible for refacoring it's end // e.g. subroutine // we will push props on the rprops stack // for every corresponding end-entity (e.g. endsubroutine) we will // pop the rprops stack // if (FLAGS.deps) { switch(props.kind) /* handle includes etc */ { case INCLUDE: case INCLUDE_CPP: case INCLUDE_CPP_STD: case INCLUDE_COCO: D(O("INCLUDE");O(props.stringvalue);O(FLAGS.deps);); Includes.insert(std::make_pair(props.kind,trim(props.stringvalue))); break; case USE: case MODULE: D(O("USE/MODULE");O(props.name);O(FLAGS.deps);); Includes.insert(std::make_pair(props.kind,trim(stolower(props.name)))); break; case SUBMODULE: D(O("SUBMODULE");O(props.lrvalue+":"+props.name);O(FLAGS.deps);); Includes.insert(std::make_pair(props.kind,trim(stolower(props.lrvalue))+":" +trim(stolower(props.name)))); Includes.insert(std::make_pair(USE,trim(stolower(props.lrvalue)))); } } else { switch(props.kind) //determine indent, refactor { case SUBROUTINE: case FUNCTION: case PROGRAM: case BLOCKDATA: Cur_indent = top_indent(); push_indent(Cur_indent + FLAGS.routine_indent); empty_dolabels(); push_rprops(props); break; case MODULE: case SUBMODULE: Cur_indent = top_indent(); push_indent(Cur_indent + FLAGS.module_indent); empty_dolabels(); push_rprops(props); break; case BLOCK: Cur_indent = top_indent(); push_indent(Cur_indent + FLAGS.block_indent); break; case CHANGETEAM: Cur_indent = top_indent(); push_indent(Cur_indent + FLAGS.changeteam_indent); break; case CRITICAL: Cur_indent = top_indent(); push_indent(Cur_indent + FLAGS.critical_indent); break; case ENUM: Cur_indent = top_indent(); push_indent(Cur_indent + FLAGS.enum_indent); empty_dolabels(); break; case ABSTRACTINTERFACE: case INTERFACE: Cur_indent = top_indent(); push_indent(Cur_indent + FLAGS.interface_indent); empty_dolabels(); break; case DO: Cur_indent = top_indent(); push_indent(Cur_indent + FLAGS.do_indent); if (props.dolabel != "") push_dolabel(string2number(props.dolabel)); break; case SELECTCASE: case SELECTTYPE: Cur_indent = top_indent(); push_indent(Cur_indent + FLAGS.select_indent); break; case CASE: case CASEDEFAULT: case CLASSDEFAULT: case CLASSIS: case TYPEIS: Cur_indent -= FLAGS.case_indent; break; case END: case ENDBLOCKDATA: case ENDFUNCTION: case ENDMODULE: case ENDPROCEDURE: case ENDPROGRAM: case ENDSUBROUTINE: refactor_end_found = 1; if (!fi->indent_handled) Cur_indent = pop_indent(); cur_rprop = top_rprops(); pop_rprops(); break; case ENDASSOCIATE: case ENDBLOCK: case ENDCRITICAL: case ENDDO: case ENDENUM: case ENDFORALL: case ENDIF: case ENDINTERFACE: case ENDSELECT: case ENDSUBMODULE: case ENDTEAM: case ENDTYPE: case ENDWHERE: if (!fi->indent_handled) Cur_indent = pop_indent(); break; case PROCEDURE: // in fact: moduleprocedure // // depending on what follows this will be // recognized as a module procedure with content // or only a moduleprocedure specification // break; case CONTAINS: if (FLAGS.indent_contain) Cur_indent -= FLAGS.contains_indent; else { Cur_indent = fi->start_indent; pop_indent(); push_indent(Cur_indent); } break; case IF: Cur_indent = top_indent(); push_indent(Cur_indent + FLAGS.if_indent); break; case ELSE: Cur_indent -= FLAGS.if_indent; break; case ELSEIF: Cur_indent -= FLAGS.if_indent; break; case ELSEWHERE: Cur_indent -= FLAGS.where_indent; break; case ENTRY: Cur_indent -= FLAGS.entry_indent; break; case WHERE: Cur_indent = top_indent(); push_indent(Cur_indent + FLAGS.where_indent); break; case ASSOCIATE: Cur_indent = top_indent(); push_indent(Cur_indent + FLAGS.associate_indent); break; case TYPE: Cur_indent = top_indent(); push_indent(Cur_indent + FLAGS.type_indent); break; case FORALL: Cur_indent = top_indent(); push_indent(Cur_indent + FLAGS.forall_indent); break; case INCLUDE: D(O("INCLUDE");O(FLAGS.include_left);O(fi->start_indent);); if (FLAGS.include_left) Cur_indent = fi->start_indent; else Cur_indent = top_indent(); break; #ifdef USEESOPE case SEGMENT: Cur_indent = top_indent(); push_indent(Cur_indent + FLAGS.segment_indent); break; case ENDSEGMENT: if (!fi->indent_handled) Cur_indent = pop_indent(); break; #endif default: Cur_indent = top_indent(); } // end determine indent and refactor switch(props.kind) { case BLANK: break; default: prev_props = props; } if(first_time) // check to handle multi-statement line like x=1;y=3 { output_line(); first_time = 0; } } rest = p.get_line_rest(); if (rest == "") break; } } // end of indent_and_output void Fortran::output_line() { if (curlines.empty()) return; mycout.reset(); handle_refactor(); if (!FLAGS.apply_indent) { // // no indentation requested: // while (! curlines.empty()) { mycout << curlines.front().str() << Endline; curlines.pop_front(); } return; } if (fi->input_format == fi->output_format) output(curlines); else output_converted(curlines); } // end of output_line void Fortran::handle_refactor() { if (FLAGS.refactor_routines && refactor_end_found) { // // handle refactor routines // if (cur_rprop.kind != 0) // check if corresponding start is ok { // // modify line to match the corrsponding module, subroutine ... line // first, we have to locate that line, the back of the deque // could have comment or empty lines // lines_t::reverse_iterator it = curlines.rbegin(); while (it != curlines.rend()) { if ( it->blank_or_comment_or_pre() ) it++; else break; } // starting at position labellength + spaces, scan lines[0] until isalnumplus() // returns false. The scanned characters will be replaced by something // like: 'end subroutine mysub' // //std::string s = curlines.back().trimmed_line(); std::string s = it->trimmed_line(); size_t startpos = s.find_first_not_of(' ',fi->labellength); size_t endpos = s.length(); for (size_t i=startpos; istr(s.substr(0,startpos) + replacement + s.substr(endpos)); } } } #undef Cur_indent #undef FLAGS #undef Endline #undef End_of_file #undef Getnext #undef Curline #undef Includes findent-3.1.1/src/debug.h0000644000175000017500000000242213343753743012126 00000000000000#ifndef DEBUG_H #define DEBUG_H #include #include #include #include "findent_types.h" #define O(x) {std::cerr << " [" << x << "] ";} #define Y O(yytext);O(YY_START) // macro to activate or deactivate debug output: #ifdef DEBUG #define D(x) {std::cerr << "WD: "<< __FILE__ <<":"<<__LINE__<<" "; x; std::cerr << std::endl; } #else #define D(x) #endif #define FL __func__<<__FILE__<<__LINE__<<':' // // ad-hoc debugging // turn on by !findentfix:p-on // turn off by !findentfix:p-off // or in the code: ppp.on() or ppp.off() // // a typical debug line would be: // ppp< Debugostream& operator<<( T val ) { if (output) { std::string name = typeid(val).name(); bool b = (typeid(val) == typeid(std::string)); if (name.length() > 2) b = b || (name.substr(name.length()-1)=="c"); if (b) std::cout << "["; std::cout << val; if (b) std::cout << "]"; } return *this; } }; extern Debugostream ppp; #endif findent-3.1.1/src/debug.cpp0000644000175000017500000000011713340224234012441 00000000000000#include "debug.h" bool p_on = 0; char endchar = '\n'; Debugostream ppp; findent-3.1.1/src/fixed.cpp0000644000175000017500000002324213365326132012465 00000000000000#include #include #include #include "fixed.h" #include "debug.h" #include "findent_types.h" #include "free.h" #include "simpleostream.h" void Fixed::build_statement(Fortranline &line, bool &f_more, bool &pushback) { // // adds line to curlines // adds line (stripped from comments, preprocessor stuff and // continuation stuff) to full_statement // f_more 1: more lines are to expected // 0: this line is complete // pushback = 0; if (line.blank_or_comment()) { curlines.push_back(line); if (curlines.size() ==1) f_more = 0; // do not expect continuation lines else f_more = 1; // but here we do return; } std::string s = line.strnomp(); std::string sl = s.substr(0,5); // // special attention for garbage lines: // if(!cleanfive(s)) { D(O("not clean");O(line);); curlines.push_back(line); f_more = 1; return; } if (s.length() >6) sl = sl+' '+s.substr(6); // // this is a line with code // if (curlines.empty()) { // // this is the first line // curlines.push_back(line); full_statement += trim(sl); full_statement = rtrim(remove_trailing_comment(full_statement)); if (!f_more) f_more = wizard(); // is there a continuation line in the future? return; } // // this is possibly a continuation line // if (!line.fixedcontinuation()) { // // this is not a continuation line // push it back, we will see it later // pushback = 1; f_more = 0; // do not look for further continuation lines return; } // // this is a continuation line // curlines.push_back(line); full_statement += rtrim((rtrim(sl)+" ").substr(6)); full_statement = rtrim(remove_trailing_comment(full_statement)); if(!f_more) f_more = wizard(); // look for more continuation lines } // end of build_statement void Fixed::output(lines_t &lines,lines_t *freelines) { // // output lines input: fixed format, output: fixed format // // lines optionally start with comments and/or preprocessor lines // lines ends with a fortran line // const std::string continuations = "123456789" "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; bool to_mycout = (freelines == 0); unsigned int old_indent = 0; unsigned int first_indent = 0; char prevquote = ' '; bool had_first = 0; std::ostringstream os; size_t cindex = 0; while(!lines.empty()) { mycout.reset(); if(output_pre(lines,freelines)) continue; if (lines.empty()) return; is_omp = lines.front().omp(); if(is_omp) { ompstr = lines.front().str().substr(0,2); cmpstr = "!$ "; } else { ompstr = ""; cmpstr = ""; } if (lines.front().blank()) { // // a completely blank line, that is simple: // if(to_mycout) mycout << ompstr << fi->endline; else { os << cmpstr; if(had_first && is_omp) os << " & &"; // to keep gfortran and ifort happy freelines->push_back(F(os.str())); os.str(""); } lines.pop_front(); continue; } if (lines.front().comment()) { // // output indentation blanks: // if (lines.front().firstchar() == '!') { if (lines.front()[0] != '!' || is_omp) // // take care of the situation that cur_indent == 0 // but the comment does not start in column 1 // { if(to_mycout) mycout << insert_omp(blanks(M(std::max(fi->cur_indent+6,1)))); else { os << cmpstr << ' '; if(had_first && is_omp) os << " & &"; // to keep gfortran and ifort happy } } } // // output comment: // if(to_mycout) mycout << lines.front().trim() << fi->endline; else { int l=1; if (!is_omp && toupper(lines.front().firstchar()) == 'D') l = 0; os << "!" << lines.front().trim().substr(l); freelines->push_back(F(os.str())); os.str(""); } lines.pop_front(); continue; } // // this is a line with (part of) a fortran statement // possibly a continuation line // std::string s = lines.front().strnomp(); // // garbage in, garbage out: // if(!cleanfive(s)) { // // garbage in, garbage out // if(to_mycout) mycout << insert_omp(lines.front().rtrim()) << fi->endline; else { os << cmpstr << lines.front().rtrim(); freelines->push_back(F(os.str())); os.str(""); } lines.pop_front(); continue; } // // this should be a normal line with code, maybe preceded with a label // if(s.length() > 6) // line is [label][c]statement { bool iscontinuation = lines.front().fixedcontinuation(); if (iscontinuation) { if (fi->flags.conchar != ' ') { if (fi->flags.conchar == '0') { s.at(5) = continuations[cindex]; cindex++; if (cindex >= continuations.length()) cindex = 0; } else s.at(5) = fi->flags.conchar; } } // // output label field including possible continuation character // if(to_mycout) mycout << insert_omp(s.substr(0,6)); else os << cmpstr << s.substr(0,5); // // try to honour current indentation // if this is a continuation line, count the number // of spaces after column 6. // if (iscontinuation) { std::string s6 = s.substr(6)+'x'; old_indent = s6.find_first_not_of(' '); if (!to_mycout) os << '&'; } else { // // count the number of spaces after column 6 of the first line // std::string s6 = s.substr(6)+'x'; first_indent = s6.find_first_not_of(' '); cindex = 0; } int adjust_indent = old_indent - first_indent; if (adjust_indent < 0) adjust_indent = 0; switch(prevquote) { case ' ' : // no dangling strings, output with indent if(to_mycout) mycout << blanks(M(std::max(adjust_indent+fi->cur_indent,0))) << trim(s.substr(6)); else os << trim(s.substr(6)); break; default: // dangling string, output asis if(to_mycout) mycout << s.substr(6); else os << s.substr(6); break; } // // investigate if this line terminates a string // prevquote = fixedmissingquote(prevquote + s); if(to_mycout) mycout << fi->endline; else { char c; if (wizard(lines)) // more fortran lines follow { c = ' '; if(iscontinuation) c = prevquote; if (is_omp) // an hack freelines->push_back(F('!'+add_amp(os.str().substr(1),c))); else freelines->push_back(F(add_amp(os.str(),c))); } else freelines->push_back(F(os.str())); os.str(""); } lines.pop_front(); had_first = 1; // here, the 1st line of a statement has been processed continue; } // // output a line that does not fulfill above conditions // if(to_mycout) mycout << insert_omp(s) << fi->endline; else { os << cmpstr << s; if (wizard(lines)) // more fortran lines follow { if (is_omp) // an hack freelines->push_back(F('!'+add_amp(os.str().substr(1),prevquote))); else freelines->push_back(F(add_amp(os.str(),prevquote))); } else freelines->push_back(F(os.str())); os.str(""); } lines.pop_front(); had_first = 1; // here, the 1st line of a statement has been processed } } // end of output void Fixed::output_converted(lines_t &lines) { lines_t freelines; output(lines, &freelines); Globals oldgl = *gl; gl->global_format = FREE; gl->global_line_length = 0; Free f(fi); lines_t::iterator it = freelines.begin(); // // clean all freelines: // while(it != freelines.end()) { it->clean(1); it++; } f.output(freelines); (*gl) = oldgl; } // end of output_converted bool Fixed::wizard() { // // Look ahead to see if the next fixed-format fortran line is a continuation // return 1 if a continuation is found, 0 otherwize. // For free format, always return 0. // if (gl->global_format == FREE) return 0; Fortranline line(gl); bool eof; while(1) { line = fi->getnext(eof,0); if (eof) return 0; if (line.pre()) { bool p_more = 0; while(1) { fi->handle_pre_light(line,p_more); if (p_more) { line = fi->getnext(eof,0); if (eof) return 0; } else break; } if(eof) return 0; continue; } if (line.fortran() && cleanfive(line.strnomp())) { // // return 1 if this is a fixed fortran continuation line // return line.fixedcontinuation(); } } return 0; } // end of wizard bool Fixed::wizard(lines_t lines) { // finds out if lines.front() gets a continuation line if(lines.empty()) return 0; lines_t::iterator it = lines.begin(); it++; while(it != lines.end()) { if (it-> fortran() && cleanfive(it->strnomp())) return it->fixedcontinuation(); it++; } return 0; } std::string Fixed::add_amp(const std::string s,const char p) { // // examples: // s = "abc ! xyz", p = ' ' : result = "abc& ! xyz" // s = "ab'c ! xyz", p = ' ' : result = "ab'c ! xyz&" // s = "abc ! xyz", p = '\'' : result = "abc ! xyz&" // s = "ab'c ! xyz", p = '\'' : result = "ab'c& ! xyz" // p can be ' ', '\'', '"' // std::string slt = rtrim(remove_trailing_comment(s,p)); return slt + "&" + s.substr(slt.length()); } findent-3.1.1/src/Makefile.am0000644000175000017500000001110513446671341012716 00000000000000AM_LDFLAGS = if MAKEWIN AM_CXXFLAGS = -static else AM_CXXFLAGS = -fPIC endif if USEESOPE AM_CXXFLAGS += -DUSEESOPE endif if USEBISON parser.cpp: parser.y $(YACC) -o parser.cpp -d $< if test -f parser.cpp.h ; then mv parser.cpp.h parser.h ; fi if test -f parser.hpp ; then mv parser.hpp parser.h ; fi parser.h: parser.cpp builtparser: parser.cpp mv parser.cpp builtparser.cpp mv parser.h builtparser.h else parser.cpp: builtparser.cpp @echo "" @echo "********************************************************" @echo "*** At configuration time, bison (or yacc) was not ***" @echo "*** available, or it was specified not to use bison. ***" @echo "*** I will use the pre-built parser. ***" @echo "********************************************************" cp $< $@ parser.h: builtparser.h cp $< $@ endif if USEFLEX lexer.cpp: lexer.l $(LEX) -i -o lexer.cpp $< builtlexer: lexer.cpp mv $< builtlexer.cpp else lexer.cpp: builtlexer.cpp @echo "" @echo "*******************************************************" @echo "*** At configuration time, flex (or lex) was not ***" @echo "*** available, or it was specified not to use flex. ***" @echo "*** I will use the pre-built lexer. ***" @echo "*******************************************************" cp $< $@ endif MOSTLYCLEANFILES = CLEANFILES = findent findent.exe findent.1 \ parser.cpp.h parser.hpp parser_report.txt \ parser.cpp parser.h lexer.cpp MAINTAINERCLEANFILES = builtparser.cpp builtparser.h builtlexer.cpp if MAKEMAN man1_MANS = findent.1 findent.1: findent : | ./findent -H > $@ endif findent.o: parser.h vim_plugin.o: vim_fortran.inc vim_findent.inc vim_help.inc gedit_plugin.o: gedit_external.inc gedit_plugin.inc gedit_plugin_py.inc \ gedit_help.inc emacs_plugin.o: emacs_findent.inc emacs_help.inc readme_plugin.o: readme.inc docs.o: vim_fortran.inc vim_findent.inc vim_help.inc \ gedit_external.inc gedit_plugin.inc gedit_plugin_py.inc gedit_help.inc \ emacs_findent.inc emacs_help.inc \ readme.inc makefdeps.inc DEPSDIR = $(top_srcdir)/deps EMACSDIR = $(top_srcdir)/emacs GEDITDIR = $(top_srcdir)/gedit READMEDIR = $(top_srcdir)/doc TOCPP = $(top_srcdir)/src/tocpp.sh VIMDIR = $(top_srcdir)/vim vim_fortran.inc: $(VIMDIR)/fortran.vim $(TOCPP) $(TOCPP) < $(VIMDIR)/fortran.vim > $@ vim_findent.inc: $(VIMDIR)/findent.vim $(TOCPP) $(TOCPP) < $(VIMDIR)/findent.vim > $@ vim_help.inc: $(VIMDIR)/README $(TOCPP) $(TOCPP) < $(VIMDIR)/README > $@ gedit_external.inc: $(GEDITDIR)/findent-gedit $(TOCPP) $(TOCPP) < $(GEDITDIR)/findent-gedit > $@ gedit_plugin.inc: $(GEDITDIR)/findent.plugin $(TOCPP) $(TOCPP) < $(GEDITDIR)/findent.plugin > $@ gedit_plugin_py.inc: $(GEDITDIR)/findent.py $(TOCPP) $(TOCPP) < $(GEDITDIR)/findent.py > $@ gedit_help.inc: $(GEDITDIR)/README $(TOCPP) $(TOCPP) < $(GEDITDIR)/README > $@ emacs_findent.inc: $(EMACSDIR)/findent.el $(TOCPP) $(TOCPP) < $(EMACSDIR)/findent.el > $@ emacs_help.inc: $(EMACSDIR)/README $(TOCPP) $(TOCPP) < $(EMACSDIR)/README > $@ readme.inc: $(READMEDIR)/README $(TOCPP) $(TOCPP) < $(READMEDIR)/README > $@ makefdeps.inc: $(DEPSDIR)/makefdeps $(TOCPP) $(TOCPP) < $(DEPSDIR)/makefdeps > $@ INCS = vim_fortran.inc vim_findent.inc vim_help.inc gedit_external.inc gedit_plugin.inc \ gedit_plugin_py.inc gedit_help.inc emacs_findent.inc emacs_help.inc readme.inc makefdeps.inc includes: $(INCS) bin_PROGRAMS = findent findent_SOURCES = \ debug.cpp debug.h \ docs.cpp docs.h \ findent.cpp findent.h \ findent_types.h \ findentclass.cpp findentclass.h \ findentrun.cpp findentrun.h \ fixed.cpp fixed.h \ flags.cpp flags.h \ fortran.cpp fortran.h \ fortranline.cpp fortranline.h \ free.cpp free.h \ functions.cpp functions.h \ globals.cpp globals.h \ lexer.h \ line_prep.cpp line_prep.h \ mylexer.cpp \ myparser.cpp \ parser.h \ pre_analyzer.cpp pre_analyzer.h \ prop.cpp prop.h \ simpleostream.h simpleostream.cpp \ version.h BUILT_SOURCES = parser.cpp parser.h lexer.cpp EXTRA_DIST = lexer.l parser.y tocpp.sh builtparser.cpp \ builtparser.h builtlexer.cpp $(INCS) findent-3.1.1/src/simpleostream.h0000644000175000017500000000125513340740405013713 00000000000000#ifndef SIMPLEOSTREAM_H #define SIMPLEOSTREAM_H #include #include class Simpleostream { private: std::stringstream line; bool output; public: Simpleostream(void) { output = 1; } void reset(void) { line.str(""); } template< typename T > Simpleostream& operator<<( T val ) { if (output) std::cout << val; else line << val; return *this; } void setoutput(const bool b) { output = b; } bool getoutput(void) { return output; } template< typename T> void set( T s ) { reset(); line << s; } std::string get(void) { return line.str(); } }; #endif findent-3.1.1/src/version.h0000644000175000017500000000010513474735477012532 00000000000000#ifndef VERSION_H #define VERSION_H #define VERSION "3.1.1" #endif findent-3.1.1/src/gedit_external.inc0000644000175000017500000001176413444171515014362 00000000000000 std::cout << "#!/bin/bash" << std::endl; std::cout << "# to be used in gedit to indent fortran source" << std::endl; std::cout << "# in gedit:" << std::endl; std::cout << "# Edit -> preferences -> enable \"External Tools\"" << std::endl; std::cout << "# Tools -> Manage External Tools -> Add" << std::endl; std::cout << "# - rename \"New Tool\" into findent" << std::endl; std::cout << "# - put this file in the tool, or place a command" << std::endl; std::cout << "# in the tool that starts this script" << std::endl; std::cout << "# Shortcut Key: F1 (or something more to your liking)" << std::endl; std::cout << "# Save: Nothing" << std::endl; std::cout << "# Input: Current document" << std::endl; std::cout << "# Output: Replace current document" << std::endl; std::cout << "# Applicability: All documents Fortran 95" << std::endl; std::cout << "# " << std::endl; std::cout << "flags=\"-Ia -i3\" # flags for findent" << std::endl; std::cout << "fin=`mktemp`" << std::endl; std::cout << "fout=`mktemp`" << std::endl; std::cout << "trap \"rm $fin $fout\" 0 # remove temps on exit" << std::endl; std::cout << "restore()" << std::endl; std::cout << "{" << std::endl; std::cout << " cat $fin" << std::endl; std::cout << " if [ \"$lineadded\" = \"yes\" ] ; then" << std::endl; std::cout << " echo \"empty line added\" >&2" << std::endl; std::cout << " else" << std::endl; std::cout << " echo \"nothing changed\" >&2" << std::endl; std::cout << " fi" << std::endl; std::cout << " exit" << std::endl; std::cout << "}" << std::endl; std::cout << "cat > $fin # copy input to $fin" << std::endl; std::cout << "# gedit version 2 has some troubles keeping stdout and " << std::endl; std::cout << "# stderr separate when stdout does not end with newline." << std::endl; std::cout << "# add newline if input file does not end with newline:" << std::endl; std::cout << "lastchar=\"$(tail -c1 $fin | od -a -An | tr -d ' ')\"" << std::endl; std::cout << "if [ \"$lastchar\" != \"nl\" ] ; then" << std::endl; std::cout << " echo >> $fin" << std::endl; std::cout << " lineadded=yes" << std::endl; std::cout << "else" << std::endl; std::cout << " lineadded=no" << std::endl; std::cout << "fi" << std::endl; std::cout << "if [ \"$GEDIT_CURRENT_DOCUMENT_TYPE\" != \"text/x-fortran\" ]; then" << std::endl; std::cout << " echo \"not a fortran file\" >&2" << std::endl; std::cout << " restore" << std::endl; std::cout << "fi" << std::endl; std::cout << "FINDENT=`which /bin/ls 2>/dev/null`" << std::endl; std::cout << "FINDENT=`which findent 2>/dev/null`" << std::endl; std::cout << "if [ -z \"$FINDENT\" ] ; then" << std::endl; std::cout << " echo \"cannot find findent\" 1>&2" << std::endl; std::cout << " restore" << std::endl; std::cout << "fi" << std::endl; std::cout << "fname=\"$GEDIT_CURRENT_DOCUMENT_NAME\" # get the file name" << std::endl; std::cout << "# get suffix in lowercase:" << std::endl; std::cout << "suffix=`echo \"${fname##*.}\" | tr '[:upper:]' '[:lower:]'` " << std::endl; std::cout << "# determine input type (fflag) from suffix:" << std::endl; std::cout << "case \"$suffix\" in" << std::endl; std::cout << " f|for|fpp|ftn|fortran|f77)" << std::endl; std::cout << " fflag=\"-ifixed\"" << std::endl; std::cout << " ;;" << std::endl; std::cout << " f90|f95|f03|f08)" << std::endl; std::cout << " fflag=\"-ifree\"" << std::endl; std::cout << " ;;" << std::endl; std::cout << " *)" << std::endl; std::cout << " # let findent find out:" << std::endl; std::cout << " fflag=\"\"" << std::endl; std::cout << " ;;" << std::endl; std::cout << "esac" << std::endl; std::cout << "findentflags=\"$flags $fflag\"" << std::endl; std::cout << "# run findent:" << std::endl; std::cout << "$FINDENT $findentflags < $fin > $fout 2>/dev/null" << std::endl; std::cout << "if [ $? -ne 0 ] ; then" << std::endl; std::cout << " echo \"findent reports error\" >&2" << std::endl; std::cout << " echo \"using \\\"$FINDENT $findentflags\\\"\" >&2" << std::endl; std::cout << " restore" << std::endl; std::cout << "fi" << std::endl; std::cout << "# check if output has same number of lines as input:" << std::endl; std::cout << "win=`wc -l < $fin`" << std::endl; std::cout << "wout=`wc -l < $fout`" << std::endl; std::cout << "if [ \"$win\" != \"$wout\" ] ; then" << std::endl; std::cout << " echo \"findent does not function properly\" >&2" << std::endl; std::cout << " restore" << std::endl; std::cout << "fi" << std::endl; std::cout << "# produce the result" << std::endl; std::cout << "echo $wout lines indented 1>&2" << std::endl; std::cout << "if [ \"$lineadded\" = \"yes\" ] ; then" << std::endl; std::cout << " echo \"empty line added\" >&2" << std::endl; std::cout << "fi" << std::endl; std::cout << "cat $fout" << std::endl; findent-3.1.1/src/functions.cpp0000644000175000017500000001157713341012125013372 00000000000000#include #include #include #include "functions.h" std::string stoupper(const std::string &s) { std::string sl = s; int l = sl.size(); for (int i=0; i='0' && c <='9')) continue; return 0; } return 1; } bool isalnumplus(const char c) // // returns true if c is alfanum or in " \t_" // { if (std::isalnum(c)) return 1; else switch (c) { case ' ': case '\t': case '_': return 1; } return 0; } bool isfixedcmtp(const std::string &s) { // // returns 1 if this is a fixed empty line or fixed comment line or preprocessor line // or debug line ('d' or 'D' in column 1) // if (s == "" || trim(s) == "") return 1; char c = firstchar(s); char cts = firstchar(trim(s)); return (cts == 0 || c == 'C' || c == 'c' || cts == '!' || c == '*' \ || cts == '#' || c == 'd' || c == 'D' || firstchars(trim(s),2) == "??"); } int num_leading_spaces(const std::string &s) { size_t p = s.find_first_not_of(' '); if (p == std::string::npos) return s.size(); return p; } char fixedmissingquote(const std::string &s) { // // investigate if this line terminates a string // returns ' ' if there is no unterminated string // returns '"' if this is an unterminated string, a '"' is missing // returns '\'' if this is an unterminated string, a '\'' is missing // bool instring = 0; char q = ' '; for(unsigned int i=0; i1 // is a continuation statement, if the continuation character is 1-9 // If the character is not within 1-9, it is assumed that // this character is the first of a statement, so in this case // this is counted as 6 spaces // const std::string d1_9 = "123456789"; const std::string db0_9 = " 0123456789"; size_t p = s.substr(0,6).find_first_of('\t'); if (p == std::string::npos) return rtrim(s); // no tab in first 6 columns if (s.find_first_not_of(db0_9) == p) // all space or numeric before tab? { if (s.length() == p+1) // ' 100 T' ->' 100', ' T'-> '' return rtrim(s.substr(0,p)); if (d1_9.find(s[p+1]) == std::string::npos) // ' 10 Tx' -> ' 10 x' return rtrim(s.substr(0,p)+blanks(6-p)+s.substr(p+1)); return rtrim(s.substr(0,p)+blanks(5-p)+s.substr(p+1));// ' 10 T1x' -> ' 10 1x' } else return rtrim(s); } std::string remove_trailing_comment(const std::string &s,const char prevquote) { // // removes trailing comment, but only if not part of an // unterminated string. // e.g: // 'print *, " Hi! and goodbye' // becomes: // 'print *, " Hi! and goodbye' // but // 'print *, " Hi! and goodbye" ! say goodbye' // becomes // 'print *, " Hi! and goodbye" ' // std::string so = s; bool instring = prevquote != ' '; char q = prevquote; for (unsigned int i=0; i #include #include #include #include "debug.h" #include "flags.h" #include "parser.h" #define optargcheck if (!optarg || strlen(optarg)==0) break; void Flags::set_defaults(void) { include_left_default = 0; default_indent = 3; all_indent = default_indent; apply_indent = 1; auto_firstindent = 0; conchar = ' '; deps = 0; honour_omp = 1; include_left = include_left_default; input_format = UNKNOWN; input_format_gnu = 0; input_line_length = 0; label_left = 1; last_indent_only = 0; last_usable_only = 0; max_indent = 100; only_fix_free = 0; output_format = 0; refactor_routines = 0; return_format = 0; start_indent = 0; upcase_routine_type = 0; set_default_indents(); } void Flags::set_default_indents() { associate_indent = all_indent; // -a block_indent = all_indent; // -b case_indent = all_indent-all_indent/2; // -c changeteam_indent = all_indent; cont_indent = all_indent; // -k contains_indent = all_indent; // -C critical_indent = all_indent; // -x do_indent = all_indent; // -d entry_indent = all_indent-all_indent/2; // -e enum_indent = all_indent; // -E forall_indent = all_indent; // -F if_indent = all_indent; // -f indent_cont = 1; // !-k- indent_contain = 1; // !-C- interface_indent = all_indent; // -j module_indent = all_indent; // -m routine_indent = all_indent; // -r #ifdef USEESOPE segment_indent = all_indent; #endif select_indent = all_indent; // -s type_indent = all_indent; // -w where_indent = all_indent; // -w } int Flags::get_flags(int argc, char *argv[]) { char *envopts = getenv("FINDENT_FLAGS"); char **allflags; char *envflags = strdup(""); int nflags = 1; if (envopts != 0) { // // collect flags from environment: // envflags = strdup(envopts); // // malloc enough space for all flags: // allflags = (char**) malloc(sizeof(char*)*(strlen(envflags)+argc)); allflags[0] = argv[0]; char *a = strtok(envflags," \t:"); while (a != 0) { allflags[nflags++] = a; a = strtok(0," \t:"); } } else { allflags = (char**) malloc(sizeof(char*)*argc); allflags[0] = argv[0]; } for (int i = 1; i/?"; while((c=getopt_long(nflags,allflags, "a:b:c:C:d:e:E:f:F:hHi:I:j:k:l:L:m:M:o:qQr:R:s:t:vw:x:", longopts, &option_index))!=-1) { switch(c) { case 'a' : // --indent_associate=nn optargcheck; associate_indent = atoi(optarg); break; case 'b' : optargcheck; block_indent = atoi(optarg); // --indent_block=nn break; case 'c' : optargcheck; case_indent = atoi(optarg); // --indent_case=nn break; case 'C' : // --indent_contains=nn/none optargcheck; if(strlen(optarg)>0 && optarg[0] == '-') indent_contain = 0; else contains_indent = atoi(optarg); break; case 'd' : // --indent_do=nn optargcheck; do_indent = atoi(optarg); break; case 'e' : optargcheck; entry_indent = atoi(optarg); // --indent_entry=nn break; case 'E' : optargcheck; enum_indent = atoi(optarg); // --indent_enum=nn break; case 'f' : optargcheck; if_indent = atoi(optarg); // --indent_if=nn break; case 'F' : optargcheck; forall_indent = atoi(optarg); // --indent_forall=nn break; case 'h' : // --help //usage(0); retval = DO_USAGE; break; case 'H': // --manpage //usage(1); retval = DO_MANPAGE; break; case 'i' : // --input_format=fixed/free/auto optargcheck; if (std::string(optarg) == "fixed") input_format = FIXED; else if (std::string(optarg) == "free") input_format = FREE; else if (std::string(optarg) == "auto") input_format = UNKNOWN; else if (strlen(optarg)>0 && optarg[0] == '-') // --indent=no/nn apply_indent = 0; else { all_indent = atoi(optarg); set_default_indents(); } break; case 'I' : // --start_indent=nn/auto optargcheck; if (strlen(optarg)>0 && optarg[0] == 'a') auto_firstindent = 1; else { start_indent = atoi(optarg); auto_firstindent = 0; } break; case 'j' : optargcheck; interface_indent = atoi(optarg); // --indent_interface=nn break; case 'k' : // --indent_continuation=nn/no optargcheck; if (strlen(optarg)>0 && (optarg[0] == '-' || !strcmp(optarg,"none"))) indent_cont = 0; else cont_indent = atoi(optarg); break; case 'l' : optargcheck; if(std::string(optarg) == "astindent") // --last_indent last_indent_only = 1; else if(std::string(optarg) == "astusable") // --last_usable last_usable_only = 1; else label_left = (atoi(optarg) != 0); // --label_left=0/1 break; case 'L' : optargcheck; if (strlen(optarg)>0) { input_line_length = atoi(optarg); // --input_line_length=nn input_format_gnu = (optarg[strlen(optarg)-1] == 'g'); } break; case 'm' : optargcheck; module_indent = atoi(optarg); // --indent_module=nn break; case 'M' : optargcheck; max_indent = atoi(optarg); // --max-indent=nn break; case 'o' : optargcheck; if(std::string(optarg) == "free") // --output_format=free { output_format = FREE; break; } if(std::string(optarg) == "fixed") // --output_format=fixed { output_format = FIXED; break; } if(std::string(optarg) == "same") // --output_format=same { output_format = 0; break; } break; case 'q' : // --query_fix_free only_fix_free = 1; break; case 'Q': // // return 2 if free, 4 if fixed // not documented, maybe useful in the future // return_format = 1; break; case 'r' : // --indent_procedure optargcheck; routine_indent = atoi(optarg); break; case 'R': // --refactor_procedures[=upcase] optargcheck; switch(optarg[0]) { case 'R' : upcase_routine_type = 1; case 'r' : refactor_routines = 1; break; } break; case 's' : // --indent_select=nn optargcheck; select_indent = atoi(optarg); break; case 't' : optargcheck; type_indent = atoi(optarg); // --indent_type=nn break; case 'v' : retval = DO_VERSION; break; case 'w' : optargcheck; where_indent = atoi(optarg); // --indent_where=nn break; case 'x' : optargcheck; critical_indent = atoi(optarg); // --indent_critical=nn break; case DO_CHANGETEAM: optargcheck; changeteam_indent = atoi(optarg); // --indent_changeteam=nn break; case DO_CONCHAR: optargcheck; if (strlen(optarg) > 0) conchar=optarg[0]; if (allowed_conchars.find(conchar) == std::string::npos) conchar = '&'; break; case DO_DEPS: deps = 1; break; case DO_INCLUDE_LEFT: optargcheck; include_left = (atoi(optarg) != 0); // --include_left=0/1 break; case DO_INDENT_CONTAINS: optargcheck; if (!strcmp(optarg,"restart")) indent_contain = 0; else contains_indent = atoi(optarg); break; case DO_INPUT_FORMAT: optargcheck; if (!strcmp(optarg,"fixed")) input_format = FIXED; else if (!strcmp(optarg,"free")) input_format = FREE; else if (!strcmp(optarg,"auto")) input_format = UNKNOWN; break; case DO_INDENT: optargcheck; if (!strcmp(optarg,"none")) apply_indent = 0; else { all_indent = atoi(optarg); set_default_indents(); } break; case DO_LAST_INDENT: last_indent_only = 1; break; case DO_LAST_USABLE: last_usable_only = 1; break; case DO_LABEL_LEFT: optargcheck; label_left = (atoi(optarg) != 0); // --label_left=0/1 break; case DO_REFACTOR_PROCEDURE: refactor_routines = 1; upcase_routine_type = 0; if (optarg != 0 && strlen(optarg) > 0) { if (!strcmp(optarg,"upcase")) upcase_routine_type = 1; } break; #ifdef USEESOPE case DO_SEGMENT: optargcheck; segment_indent = atoi(optarg); // --indent_segment=nn break; #endif case DO_OMP: optargcheck; if (atoi(optarg) == 0) honour_omp = 0; else honour_omp = 1; break; case DO_EMACS_FINDENT: case DO_EMACS_HELP: case DO_GEDIT_EXTERNAL: case DO_GEDIT_HELP: case DO_GEDIT_PLUGIN: case DO_GEDIT_PLUGIN_PY: case DO_MAKEFDEPS: case DO_README: case DO_VIM_FINDENT: case DO_VIM_FORTRAN: case DO_VIM_HELP: retval = c; break; } if (retval != DO_NOTHING) break; } free(allflags); free(envflags); return retval; } findent-3.1.1/src/pre_analyzer.h0000644000175000017500000000044413340740232013517 00000000000000#ifndef PRE_ANALYZER_H #define PRE_ANALYZER_H #include class Pre_analyzer { std::stack ifelse_stack; // to note if there is an #else after #if public: int analyze(const std::string s, const int pretype); enum {NONE=1, IF, ELIF, ELSE, ENDIF, ENDIFE}; }; #endif findent-3.1.1/src/simpleostream.cpp0000644000175000017500000000006613341012405014236 00000000000000#include "simpleostream.h" Simpleostream mycout; findent-3.1.1/src/lexer.h0000644000175000017500000000102513364355645012157 00000000000000#ifndef LEXER_H #define LEXER_H #include "line_prep.h" void yyerror(const char *c); extern "C" int yylex(); void lexer_enable(const int k); void lexer_set(Line_prep p, const int state); void lexer_set(const std::string &s, const int state); std::string lexer_getname(void); std::string lexer_getstlabel(void); std::string lexer_geti_number(void); std::string lexer_getinclude(void); std::string lexer_getrest(void); std::string lexer_getstring(void); std::string lexer_getlr(void); void extract_include(void); #endif findent-3.1.1/src/mylexer.cpp0000644000175000017500000000021113343756536013055 00000000000000#include "lexer.cpp" // // to generate dependencies: // #include "parser.h" #include "debug.h" #include "lexer.h" #include "line_prep.h" findent-3.1.1/src/gedit_plugin.inc0000644000175000017500000000077313402501024014016 00000000000000 std::cout << "[Plugin]" << std::endl; std::cout << "Loader=python3" << std::endl; std::cout << "Module=findent" << std::endl; std::cout << "IAge=3" << std::endl; std::cout << "Name=findent" << std::endl; std::cout << "Description=Indent Fortran source" << std::endl; std::cout << "Authors=Willem Vermin" << std::endl; std::cout << "Copyright=Copyright @ 2017 Willem Vermin" << std::endl; std::cout << "Website=http://www.gedit.org" << std::endl; std::cout << "Version=0.1" << std::endl; findent-3.1.1/src/findentrun.h0000644000175000017500000000006213336237667013216 00000000000000#ifndef FINDENTRUN_H #define FINDENTRUN_H #endif findent-3.1.1/src/free.h0000644000175000017500000000144213342525277011760 00000000000000#ifndef FREE_H #define FREE_H #include "fortran.h" #include "debug.h" class Free : public Fortran { public: Free(Findent *f) : Fortran(f) { } void build_statement(Fortranline &line, bool &f_more, bool &pushback); void output(lines_t &lines, lines_t *freelines = 0); void output_converted(lines_t &lines); private: std::string rm_last_amp(const std::string &s); std::string insert_omp(const std::string s, std::string somp) { if(is_omp) { std::string sl = s; int l = somp.length() - (sl+"x").find_first_not_of(' '); sl = blanks(l) + sl; return sl.replace(0,somp.length(),somp); } else return s; } bool is_omp; std::string ompstr; std::string cmpstr; }; #endif findent-3.1.1/src/findent.h0000644000175000017500000000005413340735363012461 00000000000000#ifndef FINDENT_H #define FINDENT_H #endif findent-3.1.1/src/myparser.cpp0000644000175000017500000000021013343756536013231 00000000000000#include "parser.cpp" // // to generate dependencies: // #include "debug.h" #include "lexer.h" #include "line_prep.h" #include "prop.h" findent-3.1.1/src/docs.cpp0000644000175000017500000004316413474727633012337 00000000000000#include #include "docs.h" #include "flags.h" #include "version.h" #include "functions.h" bool Docs::print(int todo) { switch(todo) { case Flags::DO_EMACS_FINDENT: emacs_findent(); return 1; case Flags::DO_EMACS_HELP: emacs_help(); return 1; case Flags::DO_GEDIT_EXTERNAL: gedit_external(); return 1; case Flags::DO_GEDIT_HELP: gedit_help(); return 1; case Flags::DO_GEDIT_PLUGIN: gedit_plugin(); return 1; case Flags::DO_GEDIT_PLUGIN_PY: gedit_plugin_py(); return 1; case Flags::DO_MAKEFDEPS: makefdeps(); return 1; case Flags::DO_MANPAGE: usage(1); return 1; case Flags::DO_README: readme(); return 1; case Flags::DO_USAGE: usage(0); return 1; case Flags::DO_VERSION: std::cout << "findent version "<" << std::endl; std::cout << " where is for example DO, END, WHERE() etcetera." << std::endl; std::cout << "Findent will adjust the indentation according to ." << std::endl; std::cout << " Errors in OPTIONS are silently ignored." << std::endl; std::cout << ".PP" << std::endl << ".SS \"General options:" << std::endl; } else { doman = 0; std::cout << "findent [options]" << std::endl; std::cout << " Format fortran source." << std::endl; std::cout << " Findent reads from STDIN, writes to STDOUT." << std::endl; std::cout << " Findent uses various kinds of indentations, see OPTIONS." << std::endl; std::cout << " Findent can convert from fixed form to free form and vice versa and" << std::endl; std::cout << " can supplement END statements, see 'Refactor' below." << std::endl; std::cout << " Comment lines with '!' in column one are not indented." << std::endl; std::cout << " You can correct findent related indenting errors by" << std::endl; std::cout << " inserting comment lines: " << std::endl; std::cout << " ! findentfix: " << std::endl; std::cout << " where is for example DO, END, WHERE() etcetera." << std::endl; std::cout << " Findent will adjust the indentation according to ." << std::endl; std::cout << "OPTIONS (errors are silently ignored):" << std::endl; std::cout << std::endl; std::cout << " General options:" << std::endl; std::cout << std::endl; } manout(" ","Below: denotes an unsigned decimal number."); manout(" "," denotes a character."); manout(" "," "); manout(" ","In the long options, you can replace '_' with '-'."); if (!doman) std::cout << std::endl; manout("-h, --help" ,"print this text"); manout("-H, --manpage" ,"print man page"); manout("--readme" ,"print some background information"); manout("-v, --version" ,"prints findent version"); manout("-q, --query_fix_free" ,"guess free or fixed, prints 'fixed' or 'free' and exits"); //manout("-Q","returncode=2 for free, 4 for fixed"); //manout(" "," (for usage with vim)"); manout("--continuation=" ," ' ': (default) do not change continuation characters"); manout(" "," '0': create numbered continuation characters"); manout(" "," other: use that continuation character"); manout(" "," default for conversion from free to fixed is '&'"); manout("--include_left=" ,"(0/1) 1: indent include statements to starting indent (default:0)"); manout("-l, --label_left=" ,"(0/1) 1: move statement labels to start of line (default:1)"); manout(" "," (only for free format)"); manout("-lastindent, --last_indent" ,"prints computed indentation of last line"); manout(" "," (for usage with vim)"); manout("-lastusable, --last_usable" ,"prints line number of last line usable"); manout(" "," as start for indenting(for usage with vim)"); manout("-iauto, --input_format=auto" ,"determine automatically input format (free or fixed)"); manout("-ifixed, --input_format=fixed" ,"force input format fixed"); manout(" ","(default: auto)"); manout("-ifree, --input_format=free" ,"force input format free"); manout(" ","(default: auto)"); manout("-i-, --indent=none" ,"do not change indent (useful in combination with -R)"); manout("-L, --input_line_length=" ,"use only first characters of each line"); manout(" ","default=0: take whole lines"); manout("-Lg, --input_line_length=g" ,"same as above, but use gfortran convention"); manout(" ","for counting the characters with tabbed lines"); manout(" "," example: --input_line_length=72g"); manout("-M, --max_indent=" ,"maximum output indent, default 100, 0: no limit"); manout("-ofixed, --output_format=fixed" ,"force fixed format output"); manout("-ofree, --output_format=free" ,"force free format output"); manout("-osame, --output_format=same" ,"output format same is input format"); manout("--openmp=" ," 0: do not indent openmp conditionals"); manout(" "," 1: indent openmp conditionals (default)"); manout(" "," NOTE: for free format, the omp sentinel must be '!$ '"); manout("-Rr, --refactor_procedures" ,"refactor procedures and modules: the END line"); manout(" "," of a subroutine, program etc. is, if possible, replaced by"); manout(" "," 'end subroutine ' or"); manout(" "," 'end function ' or"); manout(" "," 'end procedure ' or"); manout(" "," 'end program ' or"); manout(" "," 'end block data ' or"); manout(" "," 'end module ' or"); manout(" "," 'end submodule '"); manout(" "," where is the name of the appropriate procedure, subroutine etc."); manout(" "," NOTE1: if the END line contains a continuation the results are undefined"); manout(" "," NOTE2: a line like 'end function fun' will be replaced by"); manout(" "," 'end subroutine sub' if the END line ends 'subroutine sub'"); manout("-RR, --refactor_procedures=upcase","same as -Rr, but 'END SUBROUTINE '"); manout(" ","in stead of 'end subroutine ' etc."); if(doman) { std::cout << ".PP" << std::endl << ".SS \"Indenting options:" << std::endl; } else { std::cout << std::endl; std::cout << " Indenting options:" << std::endl; std::cout << std::endl; } manout("-I, --start_indent=" ,"starting indent (default:0)"); manout("-Ia, --start_indent=a" ,"determine starting indent from first line"); Flags f; manout("-i, --indent=" ,"all indents except I,c,C,e (default: "+number2string(f.default_indent)+")"); manout("-a, --indent_associate=" ,"ASSOCIATE indent"); manout("-b, --indent_block=" ,"BLOCK indent"); manout("-d, --indent_do=" ,"DO indent"); manout("-f, --indent_if=" ,"IF indent"); manout("-E, --indent_enum=" ,"ENUM indent"); manout("-F, --indent_forall=" ,"FORALL indent"); manout("-j, --indent_interface=" ,"INTERFACE indent"); manout("-m, --indent_module=" ,"MODULE indent"); manout("-r, --indent_procedure=" ,"FUNCTION,"); manout(" ", " SUBROUTINE and PROGRAM indent"); #ifdef USEESOPE manout("--indent_segment=" ,"SEGMENT indent"); #endif manout("-s, --indent_select=" ,"SELECT indent"); manout("-t, --indent_type=" ,"TYPE indent"); manout("-w, --indent_where=" ,"WHERE indent"); manout("-x, --indent_critical=" ,"CRITICAL indent"); manout("--indent_changeteam= " ,"CHANGE TEAM indent"); manout("-C-, --indent_contains=restart, ","restart indent after CONTAINS"); manout("-k, --indent_continuation=","continuation indent except " ); manout(" "," for lines starting with '&'"); manout(" "," free to free only"); manout("-k-, --indent_continuation=none" ,"continuation lines not preceded"); manout(" "," by '&' are untouched"); manout(" "," free to free only"); manout(" ","next defaults are: all - all/2"); manout("-c, --indent_case=" ,"CASE negative indent"); manout("-C, --indent_contains=" ,"CONTAINS negative indent"); manout("-e, --indent_entry=" ,"ENTRY negative indent"); manout(" "," "); if(doman) { std::cout << ".PP" << std::endl << ".SS" << std::endl; } std::cout << "Dependencies:" << std::endl; manout("--deps","output dependency information only, other flags are ignored."); manout(" ","This can be used to generate a dependencies file for usage with make(1)."); manout(" "," The format of this information:"); manout(" "," Fortran source -> findent output"); manout(" "," include \"file1\" -> inc file1"); manout(" "," #include \"file2\" -> cpp file2"); manout(" "," #include -> std file3"); manout(" "," ??inclue 'file4' -> coc file4"); manout(" "," use module1 -> use module1"); manout(" "," submodule(m) subm -> use m"); manout(" "," mod m:subm"); manout(" "," module module2 -> mod module2"); manout("--makefdeps","outputs a bash(1) script that serves as a an example"); manout(" "," to generate dependencies for use in make(1)."); manout(" "," "); if(doman) { std::cout << ".PP" << std::endl << ".SS \"Usage with vim:" << std::endl; } else { std::cout << "Usage with vim:" << std::endl; } manout("--vim_help" ,"outputs directions to use findent in (g)vim"); manout("--vim_fortran" ,"outputs file 'fortran.vim', see --vim_help"); manout("--vim_findent" ,"outputs file 'findent.vim', see --vim_help"); manout(" "," "); if(doman) { std::cout << ".PP" << std::endl << ".SS \"Usage with gedit:" << std::endl; } else { std::cout << "Usage with gedit:" << std::endl; } manout("--gedit_help" ,"outputs directions to use findent in gedit"); manout("--gedit_external" ,"outputs script 'findent-gedit', see --gedit_help"); manout("--gedit_plugin" ,"outputs file 'findent.plugin', see --gedit_help"); manout("--gedit_plugin_py" ,"outputs file 'python.py', see --gedit_help"); manout(" "," "); if(doman) { std::cout << ".PP" << std::endl << ".SS \"Usage with emacs:" << std::endl; } else { std::cout << " Usage with emacs:" << std::endl; } manout("--emacs_help" ,"outputs directions to use findent in emacs"); manout("--emacs_findent" ,"outputs script 'findent.el', see --emacs_help"); manout(" "," "); if(doman) { std::cout << ".PP" << std::endl << ".SS" << std::endl; } std::cout << "Examples:" << std::endl; manout(" ","indent: findent < in.f > out.f"); manout(" "," findent -i2 -r0 < in.f > out.f"); manout(" ",""); manout(" ","convert fixed to free form: findent -ofree < prog.f > prog.f90"); manout(" ",""); manout(" ","convert free to fixed form: findent -ofixed < prog.f90 > prog.f"); manout(" ",""); manout(" ","refactor 'end': findent -Rr < in.f90 > out.f90"); manout(" "," "); if(doman) { std::cout << ".PP" << std::endl << ".SS" << std::endl; } std::cout << "BUGS:" << std::endl; manout("*","Also for free-format, findent is space-insensitive, while"); manout(" ","the standard states that space must be used as general separator."); manout(" ",""); manout("*","There are some issues with labels in a continuation"); manout(" ","when converting from free to fixed format."); manout(" ","For example:"); manout(" ",""); manout(" ","\n123&\n 4 continue"); manout(" ",""); manout(" ","The problems arise because it is not possible to define a"); manout(" ","statement label in a continuation in fixed format."); manout(" ",""); manout("*","When converting from fixed format to free format, findent"); manout(" ","discards white space in a string if the string contains a"); manout(" ","continuation, e.g:"); manout(" "," print *,\"a"); manout(" "," +b\""); manout(" ",""); manout(" ","is converted to:"); manout(" "," print *,\"a&"); manout(" "," &b\""); if(doman) { std::cout << ".SH COPYRIGHT" << std::endl; std::cout << ".br" << std::endl; } else { std::cout << "COPYRIGHT" << std::endl; } std::cout << "This is free software; see the source for copying conditions. There is NO" < 0) if(mantxt[0] == '\n') mantxt = mantxt.substr(1); replaceAll(mantxt,"\n","\n\t "); if (flag == " ") std::cout << flag << "\t" << " " << mantxt.substr(start) << std::endl; else std::cout << flag << "\t" << ": " << mantxt.substr(start) << std::endl; } } void Docs::vim_help() { #include "vim_help.inc" } void Docs::vim_findent() { #include "vim_findent.inc" } void Docs::vim_fortran() { #include "vim_fortran.inc" } void Docs::gedit_help() { #include "gedit_help.inc" } void Docs::gedit_external() { #include "gedit_external.inc" } void Docs::gedit_plugin() { #include "gedit_plugin.inc" } void Docs::gedit_plugin_py() { #include "gedit_plugin_py.inc" } void Docs::emacs_help() { #include "emacs_help.inc" } void Docs::emacs_findent() { #include "emacs_findent.inc" } void Docs::readme() { #include "readme.inc" } void Docs::makefdeps() { #include "makefdeps.inc" } findent-3.1.1/src/Makefile.in0000644000175000017500000007276213476205425012746 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : @USEESOPE_TRUE@am__append_1 = -DUSEESOPE bin_PROGRAMS = findent$(EXEEXT) subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_bison.m4 \ $(top_srcdir)/m4/ax_prog_flex.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_findent_OBJECTS = debug.$(OBJEXT) docs.$(OBJEXT) findent.$(OBJEXT) \ findentclass.$(OBJEXT) findentrun.$(OBJEXT) fixed.$(OBJEXT) \ flags.$(OBJEXT) fortran.$(OBJEXT) fortranline.$(OBJEXT) \ free.$(OBJEXT) functions.$(OBJEXT) globals.$(OBJEXT) \ line_prep.$(OBJEXT) mylexer.$(OBJEXT) myparser.$(OBJEXT) \ pre_analyzer.$(OBJEXT) prop.$(OBJEXT) simpleostream.$(OBJEXT) findent_OBJECTS = $(am_findent_OBJECTS) findent_LDADD = $(LDADD) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/debug.Po ./$(DEPDIR)/docs.Po \ ./$(DEPDIR)/findent.Po ./$(DEPDIR)/findentclass.Po \ ./$(DEPDIR)/findentrun.Po ./$(DEPDIR)/fixed.Po \ ./$(DEPDIR)/flags.Po ./$(DEPDIR)/fortran.Po \ ./$(DEPDIR)/fortranline.Po ./$(DEPDIR)/free.Po \ ./$(DEPDIR)/functions.Po ./$(DEPDIR)/globals.Po \ ./$(DEPDIR)/line_prep.Po ./$(DEPDIR)/mylexer.Po \ ./$(DEPDIR)/myparser.Po ./$(DEPDIR)/pre_analyzer.Po \ ./$(DEPDIR)/prop.Po ./$(DEPDIR)/simpleostream.Po am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(findent_SOURCES) DIST_SOURCES = $(findent_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man1_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC = @FC@ FCFLAGS = @FCFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MINGW32 = @MINGW32@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_FC = @ac_ct_FC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ make_include = @make_include@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_LDFLAGS = @MAKEWIN_FALSE@AM_CXXFLAGS = -fPIC $(am__append_1) @MAKEWIN_TRUE@AM_CXXFLAGS = -static $(am__append_1) MOSTLYCLEANFILES = CLEANFILES = findent findent.exe findent.1 \ parser.cpp.h parser.hpp parser_report.txt \ parser.cpp parser.h lexer.cpp MAINTAINERCLEANFILES = builtparser.cpp builtparser.h builtlexer.cpp @MAKEMAN_TRUE@man1_MANS = findent.1 DEPSDIR = $(top_srcdir)/deps EMACSDIR = $(top_srcdir)/emacs GEDITDIR = $(top_srcdir)/gedit READMEDIR = $(top_srcdir)/doc TOCPP = $(top_srcdir)/src/tocpp.sh VIMDIR = $(top_srcdir)/vim INCS = vim_fortran.inc vim_findent.inc vim_help.inc gedit_external.inc gedit_plugin.inc \ gedit_plugin_py.inc gedit_help.inc emacs_findent.inc emacs_help.inc readme.inc makefdeps.inc findent_SOURCES = \ debug.cpp debug.h \ docs.cpp docs.h \ findent.cpp findent.h \ findent_types.h \ findentclass.cpp findentclass.h \ findentrun.cpp findentrun.h \ fixed.cpp fixed.h \ flags.cpp flags.h \ fortran.cpp fortran.h \ fortranline.cpp fortranline.h \ free.cpp free.h \ functions.cpp functions.h \ globals.cpp globals.h \ lexer.h \ line_prep.cpp line_prep.h \ mylexer.cpp \ myparser.cpp \ parser.h \ pre_analyzer.cpp pre_analyzer.h \ prop.cpp prop.h \ simpleostream.h simpleostream.cpp \ version.h BUILT_SOURCES = parser.cpp parser.h lexer.cpp EXTRA_DIST = lexer.l parser.y tocpp.sh builtparser.cpp \ builtparser.h builtlexer.cpp $(INCS) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) findent$(EXEEXT): $(findent_OBJECTS) $(findent_DEPENDENCIES) $(EXTRA_findent_DEPENDENCIES) @rm -f findent$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(findent_OBJECTS) $(findent_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/docs.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/findent.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/findentclass.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/findentrun.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fixed.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flags.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fortran.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fortranline.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/free.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/functions.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globals.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line_prep.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mylexer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/myparser.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_analyzer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prop.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleostream.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` install-man1: $(man1_MANS) @$(NORMAL_INSTALL) @list1='$(man1_MANS)'; \ list2=''; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/debug.Po -rm -f ./$(DEPDIR)/docs.Po -rm -f ./$(DEPDIR)/findent.Po -rm -f ./$(DEPDIR)/findentclass.Po -rm -f ./$(DEPDIR)/findentrun.Po -rm -f ./$(DEPDIR)/fixed.Po -rm -f ./$(DEPDIR)/flags.Po -rm -f ./$(DEPDIR)/fortran.Po -rm -f ./$(DEPDIR)/fortranline.Po -rm -f ./$(DEPDIR)/free.Po -rm -f ./$(DEPDIR)/functions.Po -rm -f ./$(DEPDIR)/globals.Po -rm -f ./$(DEPDIR)/line_prep.Po -rm -f ./$(DEPDIR)/mylexer.Po -rm -f ./$(DEPDIR)/myparser.Po -rm -f ./$(DEPDIR)/pre_analyzer.Po -rm -f ./$(DEPDIR)/prop.Po -rm -f ./$(DEPDIR)/simpleostream.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/debug.Po -rm -f ./$(DEPDIR)/docs.Po -rm -f ./$(DEPDIR)/findent.Po -rm -f ./$(DEPDIR)/findentclass.Po -rm -f ./$(DEPDIR)/findentrun.Po -rm -f ./$(DEPDIR)/fixed.Po -rm -f ./$(DEPDIR)/flags.Po -rm -f ./$(DEPDIR)/fortran.Po -rm -f ./$(DEPDIR)/fortranline.Po -rm -f ./$(DEPDIR)/free.Po -rm -f ./$(DEPDIR)/functions.Po -rm -f ./$(DEPDIR)/globals.Po -rm -f ./$(DEPDIR)/line_prep.Po -rm -f ./$(DEPDIR)/mylexer.Po -rm -f ./$(DEPDIR)/myparser.Po -rm -f ./$(DEPDIR)/pre_analyzer.Po -rm -f ./$(DEPDIR)/prop.Po -rm -f ./$(DEPDIR)/simpleostream.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-binPROGRAMS install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man1 .PRECIOUS: Makefile @USEBISON_TRUE@parser.cpp: parser.y @USEBISON_TRUE@ $(YACC) -o parser.cpp -d $< @USEBISON_TRUE@ if test -f parser.cpp.h ; then mv parser.cpp.h parser.h ; fi @USEBISON_TRUE@ if test -f parser.hpp ; then mv parser.hpp parser.h ; fi @USEBISON_TRUE@parser.h: parser.cpp @USEBISON_TRUE@builtparser: parser.cpp @USEBISON_TRUE@ mv parser.cpp builtparser.cpp @USEBISON_TRUE@ mv parser.h builtparser.h @USEBISON_FALSE@parser.cpp: builtparser.cpp @USEBISON_FALSE@ @echo "" @USEBISON_FALSE@ @echo "********************************************************" @USEBISON_FALSE@ @echo "*** At configuration time, bison (or yacc) was not ***" @USEBISON_FALSE@ @echo "*** available, or it was specified not to use bison. ***" @USEBISON_FALSE@ @echo "*** I will use the pre-built parser. ***" @USEBISON_FALSE@ @echo "********************************************************" @USEBISON_FALSE@ cp $< $@ @USEBISON_FALSE@parser.h: builtparser.h @USEBISON_FALSE@ cp $< $@ @USEFLEX_TRUE@lexer.cpp: lexer.l @USEFLEX_TRUE@ $(LEX) -i -o lexer.cpp $< @USEFLEX_TRUE@builtlexer: lexer.cpp @USEFLEX_TRUE@ mv $< builtlexer.cpp @USEFLEX_FALSE@lexer.cpp: builtlexer.cpp @USEFLEX_FALSE@ @echo "" @USEFLEX_FALSE@ @echo "*******************************************************" @USEFLEX_FALSE@ @echo "*** At configuration time, flex (or lex) was not ***" @USEFLEX_FALSE@ @echo "*** available, or it was specified not to use flex. ***" @USEFLEX_FALSE@ @echo "*** I will use the pre-built lexer. ***" @USEFLEX_FALSE@ @echo "*******************************************************" @USEFLEX_FALSE@ cp $< $@ @MAKEMAN_TRUE@findent.1: findent @MAKEMAN_TRUE@ : | ./findent -H > $@ findent.o: parser.h vim_plugin.o: vim_fortran.inc vim_findent.inc vim_help.inc gedit_plugin.o: gedit_external.inc gedit_plugin.inc gedit_plugin_py.inc \ gedit_help.inc emacs_plugin.o: emacs_findent.inc emacs_help.inc readme_plugin.o: readme.inc docs.o: vim_fortran.inc vim_findent.inc vim_help.inc \ gedit_external.inc gedit_plugin.inc gedit_plugin_py.inc gedit_help.inc \ emacs_findent.inc emacs_help.inc \ readme.inc makefdeps.inc vim_fortran.inc: $(VIMDIR)/fortran.vim $(TOCPP) $(TOCPP) < $(VIMDIR)/fortran.vim > $@ vim_findent.inc: $(VIMDIR)/findent.vim $(TOCPP) $(TOCPP) < $(VIMDIR)/findent.vim > $@ vim_help.inc: $(VIMDIR)/README $(TOCPP) $(TOCPP) < $(VIMDIR)/README > $@ gedit_external.inc: $(GEDITDIR)/findent-gedit $(TOCPP) $(TOCPP) < $(GEDITDIR)/findent-gedit > $@ gedit_plugin.inc: $(GEDITDIR)/findent.plugin $(TOCPP) $(TOCPP) < $(GEDITDIR)/findent.plugin > $@ gedit_plugin_py.inc: $(GEDITDIR)/findent.py $(TOCPP) $(TOCPP) < $(GEDITDIR)/findent.py > $@ gedit_help.inc: $(GEDITDIR)/README $(TOCPP) $(TOCPP) < $(GEDITDIR)/README > $@ emacs_findent.inc: $(EMACSDIR)/findent.el $(TOCPP) $(TOCPP) < $(EMACSDIR)/findent.el > $@ emacs_help.inc: $(EMACSDIR)/README $(TOCPP) $(TOCPP) < $(EMACSDIR)/README > $@ readme.inc: $(READMEDIR)/README $(TOCPP) $(TOCPP) < $(READMEDIR)/README > $@ makefdeps.inc: $(DEPSDIR)/makefdeps $(TOCPP) $(TOCPP) < $(DEPSDIR)/makefdeps > $@ includes: $(INCS) # 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: findent-3.1.1/src/pre_analyzer.cpp0000644000175000017500000000326313364103515014057 00000000000000#include #include "pre_analyzer.h" #include "functions.h" #include "parser.h" // // if start of s == // #\s*if // or // #\s*elif // or // #\s*else // or // #\s*endif // // then the function returns // IF: an #if is found // ELIF: an #elif is found // ELSE: an #else is found // ENDIF: an #endif is found, without preceding #else // ENDIFE: an #endif is found, with preceding #else // // if start of s == // ??\s*if // or // ??\s*else if // or // ??\s*else // or // ??\s*endif // // (all case and space independent) // // then the function returns // IF: '??if' found // ELIF: '??else if' found // ELSE: '??else' found // ENDIF: '??endif' found, without preceding '#else' or '??else' // ENDIFE: '??endif' found, with preceding '#else' or '??else' // // The funcion returns NONE if none of above is found. // int Pre_analyzer::analyze(const std::string s, const int pretype) { switch(pretype) { case CPP_IF: case CPP_ENDIF: case CPP_ELSE: case CPP_ELIF: case COCO_IF: case COCO_ENDIF: case COCO_ELSE: case COCO_ELIF: case INCLUDE_CPP: case INCLUDE_COCO: break; default: return this->NONE; } int r; switch(pretype) { case CPP_IF: case COCO_IF: this->ifelse_stack.push(0); return this->IF; case CPP_ELIF: case COCO_ELIF: return this->ELIF; case CPP_ELSE: case COCO_ELSE: if (!this->ifelse_stack.empty()) { ifelse_stack.pop(); ifelse_stack.push(1); } return this->ELSE; case CPP_ENDIF: case COCO_ENDIF: r = this->ENDIF; if (!ifelse_stack.empty()) { if (ifelse_stack.top()) r = this->ENDIFE; ifelse_stack.pop(); } return r; default: return this->NONE; } } findent-3.1.1/src/vim_fortran.inc0000644000175000017500000003747413402501024013702 00000000000000 std::cout << "\" Vim indent file" << std::endl; std::cout << "\" Installation: Place this script in the $HOME/.vim/after/indent/ directory" << std::endl; std::cout << "\" as fortran.vim and use it with Vim > 7.1 and findent:" << std::endl; std::cout << "\" findent.sourceforge.net" << std::endl; std::cout << "\" Author: Willem Vermin wvermin@gmail.com" << std::endl; std::cout << "\" Licence: fair" << std::endl; std::cout << "" << std::endl; std::cout << "\" use findent for indenting, unless use_findent == 0" << std::endl; std::cout << "if !exists(\"g:use_findent\")" << std::endl; std::cout << " let b:use_findent = 1" << std::endl; std::cout << "else" << std::endl; std::cout << " let b:use_findent = g:use_findent" << std::endl; std::cout << "endif" << std::endl; std::cout << "" << std::endl; std::cout << "\" use findent for indenting using indentexpr (see :help indentexpr)" << std::endl; std::cout << "\" unless use_findent_indentexpr == 0" << std::endl; std::cout << "if !exists(\"g:use_findent_indentexpr\")" << std::endl; std::cout << " let b:use_findent_indentexpr = 1" << std::endl; std::cout << "else" << std::endl; std::cout << " let b:use_findent_indentexpr = g:use_findent_indentexpr" << std::endl; std::cout << "endif" << std::endl; std::cout << "" << std::endl; std::cout << "\" The location of findent:" << std::endl; std::cout << "if !exists(\"g:findent\")" << std::endl; std::cout << " let g:findent = \"findent\"" << std::endl; std::cout << "endif" << std::endl; std::cout << "" << std::endl; std::cout << "if !exists(\"b:use_findent\")" << std::endl; std::cout << " finish" << std::endl; std::cout << "endif" << std::endl; std::cout << "if !b:use_findent" << std::endl; std::cout << " finish" << std::endl; std::cout << "endif" << std::endl; std::cout << "" << std::endl; std::cout << "if !exists(\"b:use_findent_indentexpr\")" << std::endl; std::cout << " let b:use_findent_indentexpr = 1" << std::endl; std::cout << "endif" << std::endl; std::cout << "" << std::endl; std::cout << "autocmd BufEnter * unlet! g:fortran_free_source g:fortran_fixed_source" << std::endl; std::cout << "autocmd BufEnter * unlet! b:fortran_free_source b:fortran_fixed_source" << std::endl; std::cout << "" << std::endl; std::cout << "\" g:findent is probably set in .vimrc" << std::endl; std::cout << "\" if not: skip all" << std::endl; std::cout << "if !exists(\"g:findent\")" << std::endl; std::cout << " finish" << std::endl; std::cout << "endif" << std::endl; std::cout << "" << std::endl; std::cout << "\" get fortran format from extension ext" << std::endl; std::cout << "\" return \"free\", \"fixed\" or \"unknown\"" << std::endl; std::cout << "function! Get_format_from_extension(ext)" << std::endl; std::cout << " if a:ext =~? '^f$\\|^for$\\|^fpp$\\|^ftn$\\|^fortran$\\|^f77$'" << std::endl; std::cout << " let format = \"fixed\"" << std::endl; std::cout << " elseif a:ext =~? '^f90$\\|^f95$\\|^f03$\\|^f08$'" << std::endl; std::cout << " let format = \"free\"" << std::endl; std::cout << " else" << std::endl; std::cout << " let format = \"unknown\"" << std::endl; std::cout << " endif" << std::endl; std::cout << " return format" << std::endl; std::cout << "endfunction" << std::endl; std::cout << "" << std::endl; std::cout << "\" return string that represents external command to determine" << std::endl; std::cout << "\" if input is free or fixed format." << std::endl; std::cout << "\" If no suitable command is found, return \"\"" << std::endl; std::cout << "\" The output of this external command must be \"free\" or \"fixed\"" << std::endl; std::cout << "function! Findent_get_freefixed()" << std::endl; std::cout << " let indentparmsq = ' -q'" << std::endl; std::cout << " let f = g:findent.indentparmsq.' 2>/dev/null'" << std::endl; std::cout << " if strpart(system(f,\" continue\"),0,4) != \"free\"" << std::endl; std::cout << " let f = \"\"" << std::endl; std::cout << " endif" << std::endl; std::cout << " return f" << std::endl; std::cout << "endfunction" << std::endl; std::cout << "" << std::endl; std::cout << "\" Return external command to get the indent of the last line of the input" << std::endl; std::cout << "\" Return \"\" if no such command can be found" << std::endl; std::cout << "\" side effect: s:findent_getindent is the command tried" << std::endl; std::cout << "function! Findent_get_getindent()" << std::endl; std::cout << " let getindent=g:findent.' -Ia -lastindent -i'.b:fortran_format.' '.b:findent_flags.' 2>/dev/null'" << std::endl; std::cout << " let s:findent_getindent = getindent" << std::endl; std::cout << " if system(getindent,' continue') == 4" << std::endl; std::cout << " return getindent" << std::endl; std::cout << " else" << std::endl; std::cout << " return \"\"" << std::endl; std::cout << " endif" << std::endl; std::cout << "endfunction" << std::endl; std::cout << "" << std::endl; std::cout << "\" Return external command that indents the input" << std::endl; std::cout << "\" Return \"\" if no such command can be found" << std::endl; std::cout << "\" side effect: s:fortran_indentprog is the command tried" << std::endl; std::cout << "function! Findent_get_indentprog()" << std::endl; std::cout << " \" first a test:" << std::endl; std::cout << " let indentparms = ' -Ia -i'.b:fortran_format.' '.b:findent_flags" << std::endl; std::cout << " let indentprog = g:findent.indentparms.' 2>/dev/null'" << std::endl; std::cout << " let s:fortran_indentprog = indentprog" << std::endl; std::cout << " if strpart(system(indentprog,\"continue\"),0,8) == \"continue\"" << std::endl; std::cout << " return indentprog" << std::endl; std::cout << " else" << std::endl; std::cout << " return \"\"" << std::endl; std::cout << " endif" << std::endl; std::cout << "endfunction" << std::endl; std::cout << "" << std::endl; std::cout << "\" Returns the indentation of the current line" << std::endl; std::cout << "function! Findent_getindent()" << std::endl; std::cout << " if b:findent_use_whole_buffer" << std::endl; std::cout << " \" use whole buffer up to current line to determine indent" << std::endl; std::cout << " let startline = 1" << std::endl; std::cout << " else" << std::endl; std::cout << " let maxlines = 10*&lines" << std::endl; std::cout << " \" use at most 'maxlines' previous lines to determine indent" << std::endl; std::cout << " let s = max([v:lnum-maxlines,1])" << std::endl; std::cout << " \"let startline = system(g:findent.\" -lastusable -i\".b:fortran_format,join(getline(1,v:lnum-1),\"\\n\"))" << std::endl; std::cout << " let startline = s - 1 + system(g:findent.\" -lastusable -i\".b:fortran_format,join(getline(s,v:lnum-1),\"\\n\"))" << std::endl; std::cout << " endif" << std::endl; std::cout << " let startline = max([1,startline])" << std::endl; std::cout << " let getindent = Findent_get_getindent()" << std::endl; std::cout << " let lnum = prevnonblank(v:lnum)" << std::endl; std::cout << " let ind = system(getindent, join(getline(startline,lnum),\"\\n\"))" << std::endl; std::cout << " return ind" << std::endl; std::cout << "endfunction" << std::endl; std::cout << "" << std::endl; std::cout << "function! Findent_set_flags()" << std::endl; std::cout << " if !b:have_findent && !b:have_findent_getindent" << std::endl; std::cout << " return" << std::endl; std::cout << " endif" << std::endl; std::cout << " let old = b:findent_flags" << std::endl; std::cout << " let b:findent_flags = input(\"findent flags:\",b:findent_flags)" << std::endl; std::cout << " if b:have_findent" << std::endl; std::cout << " if Findent_get_indentprog() != \"\"" << std::endl; std::cout << " call Findent_set_indentprog()" << std::endl; std::cout << " else" << std::endl; std::cout << " let x = input( \"Cannot use flags '\".b:findent_flags.\"' Will use '\".old.\"'\")" << std::endl; std::cout << " let b:findent_flags = old" << std::endl; std::cout << " return" << std::endl; std::cout << " endif" << std::endl; std::cout << " endif" << std::endl; std::cout << " if b:have_findent_getindent" << std::endl; std::cout << " if Findent_get_getindent() != \"\"" << std::endl; std::cout << " call Findent_set_getindent() " << std::endl; std::cout << " else" << std::endl; std::cout << " let x = input( \"Cannot use flags '\".b:findent_flags.\"' Will use '\".old.\"'\")" << std::endl; std::cout << " let b:findent_flags = old" << std::endl; std::cout << " return" << std::endl; std::cout << " endif" << std::endl; std::cout << " endif" << std::endl; std::cout << "endfunction" << std::endl; std::cout << "" << std::endl; std::cout << "function! Findent_set_indentprog()" << std::endl; std::cout << " let p = Findent_get_indentprog()" << std::endl; std::cout << " if p == \"\"" << std::endl; std::cout << " echomsg \"Warning '\".s:fortran_indentprog.\"' not usable as equalprg\"" << std::endl; std::cout << " echomsg \"Using default for equalprg\"" << std::endl; std::cout << " setlocal equalprg=" << std::endl; std::cout << " let b:have_findent = 0" << std::endl; std::cout << " else" << std::endl; std::cout << " execute 'setlocal equalprg='.substitute(p,' ','\\\\ ','g')" << std::endl; std::cout << " let b:have_findent = 1" << std::endl; std::cout << " endif" << std::endl; std::cout << "endfunction" << std::endl; std::cout << "" << std::endl; std::cout << "function! Findent_set_getindent()" << std::endl; std::cout << " if Findent_get_getindent() == \"\"" << std::endl; std::cout << " echomsg \"Warning '\".s:findent_getindent.\"' not usable as indentexpr\"" << std::endl; std::cout << " echomsg \"Using default for indentexpr\"" << std::endl; std::cout << " setlocal indentexpr=" << std::endl; std::cout << " let b:have_findent_getindent = 0" << std::endl; std::cout << " else" << std::endl; std::cout << " setlocal indentexpr=Findent_getindent()" << std::endl; std::cout << " setlocal indentkeys=*,*,*,*,!^F,o,O,0#" << std::endl; std::cout << " \" fixed format: if first character is tab, indent the line" << std::endl; std::cout << " if b:fortran_format == \"fixed\"" << std::endl; std::cout << " setlocal indentkeys+=!0" << std::endl; std::cout << " endif" << std::endl; std::cout << " let b:have_findent_getindent = 1" << std::endl; std::cout << " endif" << std::endl; std::cout << "endfunction" << std::endl; std::cout << "" << std::endl; std::cout << "function! Findent_use_wb_toggle()" << std::endl; std::cout << " if b:use_findent_indentexpr" << std::endl; std::cout << " let b:findent_use_whole_buffer = !b:findent_use_whole_buffer" << std::endl; std::cout << " if b:findent_use_whole_buffer " << std::endl; std::cout << " let p = \"ON\"" << std::endl; std::cout << " else" << std::endl; std::cout << " let p = \"OFF\"" << std::endl; std::cout << " endif" << std::endl; std::cout << " echomsg \"use whole buffer = \".p" << std::endl; std::cout << " else" << std::endl; std::cout << " echomsg \"not using findent for indentexpr\"" << std::endl; std::cout << " endif" << std::endl; std::cout << "endfunction" << std::endl; std::cout << "" << std::endl; std::cout << "function! Get_free_or_fixed_default()" << std::endl; std::cout << " if exists(\"b:fortran_fixed_source\")" << std::endl; std::cout << " if b:fortran_fixed_source" << std::endl; std::cout << " return \"fixed\"" << std::endl; std::cout << " endif" << std::endl; std::cout << " endif" << std::endl; std::cout << " if exists(\"b:fortran_free_source\")" << std::endl; std::cout << " if b:fortran_free_source" << std::endl; std::cout << " return \"free\"" << std::endl; std::cout << " endif" << std::endl; std::cout << " endif" << std::endl; std::cout << " return \"fixed\"" << std::endl; std::cout << "endfunction" << std::endl; std::cout << "" << std::endl; std::cout << "\"=========================================================================" << std::endl; std::cout << "" << std::endl; std::cout << "if exists(\"g:findent_flags\")" << std::endl; std::cout << " let b:findent_flags = g:findent_flags" << std::endl; std::cout << "endif" << std::endl; std::cout << "" << std::endl; std::cout << "if !exists(\"b:findent_flags\")" << std::endl; std::cout << " let b:findent_flags = \"-i\".&shiftwidth" << std::endl; std::cout << "endif" << std::endl; std::cout << "" << std::endl; std::cout << "if !exists(\"b:findent_use_whole_buffer\")" << std::endl; std::cout << " let b:findent_use_whole_buffer = 0" << std::endl; std::cout << "endif" << std::endl; std::cout << "" << std::endl; std::cout << "if !exists(\"g:findent\")" << std::endl; std::cout << " let g:findent = \"/usr/bin/findent\"" << std::endl; std::cout << "endif" << std::endl; std::cout << "" << std::endl; std::cout << "\" determine fixed or free or unknown based on suffix" << std::endl; std::cout << "" << std::endl; std::cout << "let b:fortran_format = Get_format_from_extension(expand('%:e'))" << std::endl; std::cout << "" << std::endl; std::cout << "\" if format is unknown, try to get it from the source" << std::endl; std::cout << "if b:fortran_format == \"unknown\"" << std::endl; std::cout << " \" determine command to determine free or fixed" << std::endl; std::cout << " let b:findent_freefixed = Findent_get_freefixed()" << std::endl; std::cout << " if b:findent_freefixed == \"\"" << std::endl; std::cout << " let b:fortran_format = Get_free_or_fixed_default()" << std::endl; std::cout << " echomsg \"Cannot determine format using findent, will use\" b:fortran_format" << std::endl; std::cout << " else" << std::endl; std::cout << " let r=system(b:findent_freefixed,join(getline(1,10000),\"\\n\"))" << std::endl; std::cout << " if r =~ \"free\"" << std::endl; std::cout << " let b:fortran_format = \"free\"" << std::endl; std::cout << " else" << std::endl; std::cout << " let b:fortran_format = \"fixed\"" << std::endl; std::cout << " endif" << std::endl; std::cout << " endif" << std::endl; std::cout << "endif" << std::endl; std::cout << "" << std::endl; std::cout << "if b:fortran_format == \"free\"" << std::endl; std::cout << " let g:fortran_free_source = 1" << std::endl; std::cout << " let b:fortran_free_source = 1" << std::endl; std::cout << " let b:fortran_fixed_source = 0" << std::endl; std::cout << " setlocal colorcolumn=133" << std::endl; std::cout << " if exists(\"g:findent_setcolumns\")" << std::endl; std::cout << " if(g:findent_setcolumns)" << std::endl; std::cout << " setlocal numberwidth=6" << std::endl; std::cout << " if &columns < 132+&numberwidth" << std::endl; std::cout << " let &columns=132+&numberwidth" << std::endl; std::cout << " endif" << std::endl; std::cout << " endif" << std::endl; std::cout << " endif" << std::endl; std::cout << "else" << std::endl; std::cout << " let g:fortran_fixed_source = 1" << std::endl; std::cout << " let b:fortran_fixed_source = 1" << std::endl; std::cout << " let b:fortran_free_source = 0" << std::endl; std::cout << " setlocal colorcolumn=6,73" << std::endl; std::cout << "endif" << std::endl; std::cout << "" << std::endl; std::cout << "call Findent_set_indentprog()" << std::endl; std::cout << "" << std::endl; std::cout << "if b:use_findent_indentexpr" << std::endl; std::cout << " call Findent_set_getindent()" << std::endl; std::cout << "endif" << std::endl; std::cout << "" << std::endl; findent-3.1.1/src/findentclass.cpp0000644000175000017500000001671113474700437014053 00000000000000#include #include #include "findentclass.h" #include "fortranline.h" #include "debug.h" int Findent::determine_fix_or_free() { int rc; int n = 0; const int nmax = 4000; Fortranline line(gl); std::string s; bool eof; bool p_more = 0; bool skip = 0; while ( n < nmax) { n++; line = mygetline(eof,1); if (eof) { // // to avoid to have to type twice a dot to // end input from terminal: // break; } handle_pre_light(line,p_more); if(p_more) { skip = 1; continue; } if(skip) { skip = 0; continue; } rc = guess_fixedfree(line); switch(rc) { case UNSURE : break; case PROBFREE : break; case FREE : return FREE; case FIXED : return FIXED; } } return FIXED; } // end of determine_fix_or_free void Findent::handle_pre_light(Fortranline &line, bool &p_more) { // // handles preprocessor lines and their continuations: // // line (input): line to handle // p_more (inout): input: if true, line is a continuation // output: if continuation is expected, p=true if (!p_more) // this is the first line of a preprocessor sequence pregentype = line.getpregentype(); if(pregentype == COCO) p_more = (line.lastchar() == '&'); else p_more = (line.lastchar() == '\\'); } // end of handle_pre_light int Findent::guess_fixedfree(Fortranline &line) { // // sometimes, program sources contain carriage control characters // such as ^L // I cannot get the lexer to respond to [:cntrl:] // so I handle that here: // std::string s = line.str(); if (firstchar(s) != '\t') if(firstchar(s) < 32) return UNSURE; lexer_set(ltab2sp(s),FINDFORMAT); int rc = yylex(); return rc; } // end of guess_fixedfree void Findent::handle_reading_from_tty() { reading_from_tty = isatty(fileno(stdin)); if (reading_from_tty) { std::cerr << "! Warning: reading from terminal" << std::endl; std::cerr << "! End this session by typing a single dot ('.')" << std::endl; std::cerr << "! on a new line" << std::endl; std::cerr << "! " << std::endl; std::cerr << "! Examples of typical usage:" << std::endl; std::cerr << "! help: findent -h" << std::endl; std::cerr << "! indent: findent < in.f > out.f" << std::endl; std::cerr << "! convert: findent -ofree < prog.f > prog.f90" << std::endl; } } // end of handle_reading_from_tty int Findent::what_to_return() { if (flags.return_format) switch(input_format) { case FREE: return 2; break; case FIXED: return 4; break; } return 0; } // end of what_to_return void Findent::init_indent() { // // fills the indent-stack until indent 0 // if flags.all_indent <= 0: build indent_stack with a number of start_indent's // while(!indent.empty()) indent.pop_back(); int l=0; if(flags.all_indent > 0) { for (l = start_indent%flags.all_indent; l >:: iterator it; for (it = includes.begin(); it != includes.end(); ++it) { // eliminate use if corresponding (sub)module is made if (it->first == USE) { if (includes.find(make_pair(MODULE,it->second)) != includes.end()) continue; if (includes.find(make_pair(SUBMODULE,it->second)) != includes.end()) continue; } std::cout << type2str(it->first) << " " << it->second << std::endl; } } findent-3.1.1/src/vim_help.inc0000644000175000017500000001074313402501024013145 00000000000000 std::cout << "To enable findent for vim:" << std::endl; std::cout << " find out in which directory the configuration files for vim are situated, " << std::endl; std::cout << " here we assume it is in $HOME/.vim . Enter the following commands:" << std::endl; std::cout << "" << std::endl; std::cout << "##############################################" << std::endl; std::cout << "vimroot=$HOME/.vim" << std::endl; std::cout << "mkdir -p $vimroot/plugin" << std::endl; std::cout << "findent --vim_findent > $vimroot/plugin/findent.vim" << std::endl; std::cout << "mkdir -p $vimroot/after/indent" << std::endl; std::cout << "findent --vim_fortran > $vimroot/after/indent/fortran.vim" << std::endl; std::cout << "##############################################" << std::endl; std::cout << "" << std::endl; std::cout << "In ~/.vimrc include the following lines:" << std::endl; std::cout << "" << std::endl; std::cout << "\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"" << std::endl; std::cout << "filetype plugin indent on" << std::endl; std::cout << "syntax on" << std::endl; std::cout << "\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"" << std::endl; std::cout << "" << std::endl; std::cout << "If you do not want syntax highlighting, you can switch it" << std::endl; std::cout << "off again with:" << std::endl; std::cout << "syntax off" << std::endl; std::cout << "" << std::endl; std::cout << "In ~/.vimrc you can specify:" << std::endl; std::cout << "" << std::endl; std::cout << " let use_findent = 1 \" use findent (default)" << std::endl; std::cout << " let use_findent = 0 \" do not use findent" << std::endl; std::cout << "" << std::endl; std::cout << " let findent = \"location-of-findent\" \" default: 'findent'" << std::endl; std::cout << "" << std::endl; std::cout << " let use_findent_indentexpr = 1 \" use findent for indentexpr" << std::endl; std::cout << " let use_findent_indentexpr = 0 \" do not use findent for indentexpr" << std::endl; std::cout << " \" see :help indentexpr" << std::endl; std::cout << "" << std::endl; std::cout << " let findent_flags = \"\" \" specify flags for findent, e.g.:" << std::endl; std::cout << " let findent_flags = \"-i4\" " << std::endl; std::cout << " default is \"-i\".&shiftwidth" << std::endl; std::cout << "" << std::endl; std::cout << " let findent_setcolumns = 1 \" for free format, width of window will" << std::endl; std::cout << " \" be forced to 132 columns" << std::endl; std::cout << " let findent_setcolumns = 0 \" no forcing of window width" << std::endl; std::cout << " default is 0" << std::endl; std::cout << "" << std::endl; std::cout << "In findent.vim, the following mappings are defined" << std::endl; std::cout << " (assuming your LocalLeader = \\):" << std::endl; std::cout << "" << std::endl; std::cout << " \\w toggle: to determine the indent of the line being edited:" << std::endl; std::cout << " use whole buffer (status line: wb)" << std::endl; std::cout << " or use the last usable line" << std::endl; std::cout << " \\f set/change flags for findent" << std::endl; std::cout << " \\c comment current line" << std::endl; std::cout << " \\= indent whole buffer" << std::endl; std::cout << "" << std::endl; std::cout << " Furthermore, command '==' is redefined, such that is does what" << std::endl; std::cout << " one would expect." << std::endl; std::cout << "" << std::endl; std::cout << "In findent.vim the statusline is redefined. It shows the fortran format" << std::endl; std::cout << "(free or fixed) and wb (see \\w above)" << std::endl; std::cout << "" << std::endl; std::cout << "In fortran.vim the format (free or fixed) of the edited file is" << std::endl; std::cout << "determined from the extension:" << std::endl; std::cout << "" << std::endl; std::cout << " fixed: .f .for .fpp .ftn .fortran .f77 " << std::endl; std::cout << " free: .f90 .f95 .f03 .f08" << std::endl; std::cout << "" << std::endl; std::cout << " If another extension is used (and filetype is fortran, of course)," << std::endl; std::cout << " the format is deducted by findent: if in the first 4000 lines" << std::endl; std::cout << " a proof is found for free format, the format is assumed to be" << std::endl; std::cout << " free, else the format is assumed to be fixed." << std::endl; std::cout << "" << std::endl; findent-3.1.1/src/line_prep.cpp0000644000175000017500000002356513450351243013347 00000000000000#include "line_prep.h" #include "debug.h" #define DECIMAL_DIGITS \ '0': case '1': case '2': case '3': case '4': \ case '5': case '6': case '7': case '8': case '9' #define HANDLE_END_STLABEL \ { \ sv += place_holder; \ vstruct.type = is_stlabel; \ vstruct.value = v; \ wv.push_back(vstruct); \ } Line_prep::Line_prep(const std::string s) { enum states { maybe_stlabel, in_stlabel, in_code, in_qstring, pre_hollerith, in_hollerith, in_dotop}; struct whats vstruct,nonestruct; nonestruct.type = is_none; nonestruct.value = ""; nonestruct.stringtype = ' '; set_place_holder(' '); // // parsing stops at end of string s or at ';' or at '\n' // sl will contain s, space removed, except in strings and holleriths and label // sv will contain s, space removed, strings and hollertihs replaced // by place_holder, which can be any character except probably \n or ; // wv will contain for each element of sv an element of type 'whats' // rest will contain the not-parsed part of the line // // examples: (place_holder = ' ') // s: 123 format(5habcde ,i5 ,'foo' 'bar') // sl: 123 format(5habcde,i5,'foo''bar') // sv: format( ,i5, ) // 012345678901234 // wv[0]: type = type_stlabel, value = "123" // wv[8]: type = type_string, value = "abcde", stringtype = 'h' // wv[13]: type = type_string, value = "foo'bar", stringtype = '\'' // The other elements of wv: type = type_none // // sl is available via method string get_line_spaces_removed() // sv is available via method string get_line_compressed() // rest is available via method string get_line_rest() // // Elements of wv[i] are available via // int get_type(int i) // string get_value(int i) // char get_stringtype(int i) // string get_type_as_string(int i) // // The types are defined as member constants: // // is_invalid // is_none // is_string // is_stlabel // is_dotop // line = s; sl = ""; sv = ""; sl.reserve(line.size()); sv.reserve(line.size()); wv.reserve(line.size()); states state = maybe_stlabel; std::string v; char c, prevc, prevstringtype = ' ', quotechar = ' '; int prevtype; int nhol = 0; int index = -1; bool getnextc = 1; D(O("in Line_prep:");O(s);); while(1) { if (getnextc) index++; else getnextc = 1; if (index >= (int)line.size()) break; c = line[index]; if (c == '\n') break; // // also end, when encountering a ';' which is not part of a string: // if (c == ';' && state != in_qstring && state != in_hollerith) break; vstruct = nonestruct; switch(state) { case maybe_stlabel: D(O("maybe_stlabel:");O(c);); if(isblank(c)) break; switch(c) { case DECIMAL_DIGITS: sl += c; v = c; state = in_stlabel; break; default: getnextc = 0; state = in_code; break; } break; case in_stlabel: D(O("in_stlabel:");O(c);); if( c >= '0' && c <= '9') { sl += c; v += c; break; } if (isblank(c)) { // // a sneak preview, to see if the first non-blank // is a digit. In this case the label is not ended here // bool digitfound = 0; for (unsigned int j=index+1; j 0) { v = ""; state = in_hollerith; } else { // // after all, this was an hollerith with length 0, adapt sv and wv // sv += v + c; D(O(v);O(sv);); for (unsigned int i=0; i0) nhol --; if (nhol == 0) { sv += place_holder; vstruct.type = is_string; vstruct.value = v; vstruct.stringtype = 'h'; state = in_code; wv.push_back(vstruct); } break; case in_qstring: D(O("in_q:");O(c);); if(c == quotechar) { sl += c; sv += place_holder; vstruct.type = is_string; vstruct.value = v; vstruct.stringtype = c; state = in_code; wv.push_back(vstruct); break; } sl += c; v += c; break; case in_dotop: D(O("in_dotop:");O(c);); if(isblank(c)) { break; } // // a dot operator can be [a-zA-z][a-zA-Z0-9_]* // check if first char is [a-zA-Z] // if (v.size() == 0) { if(isalpha(c)) { v += c; sl += c; D(O("in_dotop:");O(c);O(v);); break; } else { // // this was no dotop // getnextc = 0; // re-examine this c sv += '.'; wv.push_back(nonestruct); D(O("leaving in_dotop:");O(c);O(v);); state = in_code; break; } } if (c == '.') // end of this dotop { sv += place_holder; sl += c; vstruct.type = is_dotop; vstruct.value = v; state = in_code; wv.push_back(vstruct); break; } if (isalnum(c) || c == '_') { v += c; sl += c; break; } // // this is no dotop, but we already collected some // characters for it. Correct this: // sv += '.' + v; for (unsigned int i = 0; i < v.size()+1; i++) wv.push_back(nonestruct); getnextc = 0; // re-examine this c state = in_code; break; } } // // depending on the state we are in at the end, we take appropriate action: // switch(state) { case maybe_stlabel: break; case in_stlabel: HANDLE_END_STLABEL; break; case in_code: break; case in_qstring: sv += quotechar + v; for (unsigned int i = 0; i < v.size()+1; i++) wv.push_back(nonestruct); break; case pre_hollerith: sv += v; for (unsigned int i=0; i < v.size(); i++) wv.push_back(nonestruct); break; case in_hollerith: if (nhol > 0) { sl += std::string(nhol,' '); v += std::string(nhol,' '); sv += place_holder; vstruct.type = is_string; vstruct.value = v; vstruct.stringtype = 'h'; wv.push_back(vstruct); } break; case in_dotop: sv += '.' + v; for (unsigned int i = 0; i < v.size()+1; i++) wv.push_back(nonestruct); break; } sc = ""; for (unsigned int i=0; i #include #include #include "debug.h" #include "findent_types.h" #include "fixed.h" #include "free.h" #include "simpleostream.h" void Free::build_statement(Fortranline &line, bool &f_more, bool &pushback) { // // adds line to curlines // adds line (stripped from comments, preprocessor stuff and // continuation stuff) to full_statement // f_more 1: more lines are to expected // 0: this line is complete // pushback = 0; if (!line.blank_or_comment()) { // // sl becomes the first input_line_length characters of line // and then trimmed left and right: // std::string sl = line.trimmed_line(); if(line.firstchar() == '&') sl.erase(0,1); full_statement = full_statement + sl; // // remove trailing comment and trailing white space // full_statement = rtrim(remove_trailing_comment(full_statement)); // // If the last character = '&', a continuation is expected. // f_more = ( lastchar(full_statement) == '&'); if (f_more) // chop off '&' from full_statement : full_statement.erase(full_statement.length()-1); } curlines.push_back(line); } // end of build_statement void Free::output(lines_t &lines, lines_t *fixedlines) { // // output lines input: free format, output: free format // std::ostringstream os; std::string endline = fi->endline; bool to_mycout = (fixedlines == 0); bool isfirst = 1; const char conchar = '&'; bool expect_continuation = 0; bool prev_expect_continuation; while (!lines.empty()) { mycout.reset(); is_omp = lines.front().omp(); if(is_omp) { ompstr = "!$ "; // omp sentinel for free format cmpstr = "!$"; // omp sentinel for fixed format } else { ompstr = ""; cmpstr = ""; } if(output_pre(lines,fixedlines)) continue; if (lines.empty()) return; if (lines.front().blank()) { // // a completely blank line, that is simple: // if(to_mycout) mycout << ompstr << endline; else { if (lines.front().omp()) fixedlines->push_back(F(cmpstr)); else fixedlines->push_back(F("")); os.str(""); } lines.pop_front(); continue; } // // handle comment lines: // if (lines.front().comment()) { if (lines.front()[0] != '!' || lines.front().omp()) { // // take care of the situation that cur_indent == 0 // but the comment does not start in column 1 // if(to_mycout) mycout << insert_omp(blanks(M(std::max(fi->cur_indent,1))),ompstr); else os << cmpstr << blanks(std::max(fi->cur_indent,1)); } if(to_mycout) { mycout << lines.front().trim() << endline; } else { os << lines.front().trim(); fixedlines->push_back(F(rtrim(os.str()))); os.str(""); } lines.pop_front(); continue; } // // this is a line with (part of) a fortran statement // possibly a continuation line // // // If the line ends with a '&', the next line with fortran code // is a real continuation line. // If this line does not end with '&', the next line with fortran code // is not a real continuation line: possibly this line is garbage. // // Important because of indenting real continuation lines. // prev_expect_continuation = expect_continuation; // // TODO: not bulletproof with regard to unfinished strings // expect_continuation = (lastchar(lines.front().remove_trailing_comment()) == '&'); if(isfirst) { // // found the first statement line // if label: handle it // isfirst = 0; if (fi->flags.label_left && fi->labellength > 0) { // // put label at start of line // std::string firstline = lines.front().trim(); // it is possible, that the statement label is split across more lines. // as in: 123& // : &4 continue // or the label is directly followed by an &: // as in: 123& // : & continue // In that case the actual value of labellength is not usable here, we // will handle it separately. // if (fi->labellength > (int)firstline.size() && lastchar(firstline) == '&') { if(to_mycout) mycout << firstline << endline; else { os << rm_last_amp(firstline) << blanks(6); // this is likely to create havoc fixedlines->push_back(F(os.str())); os.str(""); } } else { std::string label = firstline.substr(0,fi->labellength); firstline = trim(firstline.substr(fi->labellength)); int l = M(std::max(fi->cur_indent - fi->labellength,1)); // put at least one space after label if(to_mycout) { if (lines.front().omp()) l = M(std::max((int)(l-ompstr.length()),1)); mycout << ompstr << label << blanks(l) << firstline << endline; } else { os << insert_omp(label,cmpstr) << blanks(6) << rm_last_amp(firstline); fixedlines->push_back(F(os.str())); os.str(""); } } lines.pop_front(); continue; } // // this is the first code line without label. Always indent // (even if it starts with '&') // if(to_mycout) { mycout << insert_omp(blanks(M(std::max(fi->cur_indent,0))),ompstr) << lines.front().trim() << endline; } else { os << insert_omp(blanks(5),cmpstr); if(lines.front().firstchar() == '&') os << conchar << rm_last_amp(ltrim(lines.front().trim().substr(1))); else os << ' ' << rm_last_amp(lines.front().rtrim()); fixedlines->push_back(F(os.str())); os.str(""); } lines.pop_front(); continue; } // // handle next lines, these should be continuation lines // // // if continuation starts with '&', use current indentation // else use current indentation + flags.cont_indent // if (lines.front().firstchar() == '&') // continuation line starting with '&' { if(to_mycout) mycout << insert_omp(blanks(M(std::max(fi->cur_indent,0))),ompstr) << lines.front().trim() << endline; else { os << insert_omp(blanks(5),cmpstr) << conchar << rm_last_amp(lines.front().trim().substr(1)); fixedlines->push_back(F(os.str())); os.str(""); } lines.pop_front(); continue; } // // continutation not starting with '&' // if (fi->flags.indent_cont) // indentation of continuation lines is requested { int l; if (prev_expect_continuation) l = M(std::max(fi->cur_indent+fi->flags.cont_indent,0)); else l = M(std::max(fi->cur_indent,0)); if(to_mycout) mycout << insert_omp(blanks(l),ompstr) << lines.front().trim() << endline; else { os << insert_omp(blanks(5),cmpstr) << conchar << rm_last_amp(lines.front().rtrim()); fixedlines->push_back(F(os.str())); os.str(""); } lines.pop_front(); continue; } // // this line is a continuation line, without preceding '&' // and it has been requested that no indentation is done for // continuation lines // if(to_mycout) mycout << insert_omp(lines.front().rtrim(),ompstr) << endline; else { os << insert_omp(blanks(5),cmpstr) << conchar << rm_last_amp(lines.front().rtrim()); fixedlines->push_back(F(os.str())); os.str(""); } lines.pop_front(); } } // end of output void Free::output_converted(lines_t &lines) { lines_t fixedlines; output(lines, &fixedlines); Globals oldgl = *gl; gl->global_format = FIXED; gl->global_line_length = 0; Fixed f(fi); lines_t::iterator it = fixedlines.begin(); // // clean all fixedlines: // while(it != fixedlines.end()) { it->clean(1); it++; } f.output(fixedlines); (*gl) = oldgl; } // end of output_converted std::string Free::rm_last_amp(const std::string &s) { // // removes trailing &, also as in // x = 10 & ! comment // also removes trailing space in result // std::string slt = rtrim(remove_trailing_comment(s)); std::string so = rtrim(slt); if (*so.rbegin() == '&') return rtrim(so.erase(so.length() -1)+s.substr(slt.length())); else return rtrim(s); } // end of rm_last_amp findent-3.1.1/src/tocpp.sh0000744000175000017500000000012313207541642012335 00000000000000#!/bin/bash sed 's/\\/\\\\/g;s/"/\\"/g;s/^/ std::cout << "/;s/$/" << std::endl;/' findent-3.1.1/src/prop.h0000644000175000017500000000104213361121052011773 00000000000000#ifndef PROP_H #define PROP_H #include #include #include "line_prep.h" struct propstruct { int kind; std::string dolabel; std::string label; std::string name; std::string stringvalue; std::string lrvalue; } ; const struct propstruct empty_rprop={0,"","",""}; propstruct parseline(Line_prep p); std::string whatrprop(struct propstruct p); typedef std::deque rprops_t; typedef std::deque rprops_store_t; typedef struct propstruct prop_t; #endif findent-3.1.1/src/prop.cpp0000644000175000017500000000107613341012370012335 00000000000000#include "prop.h" #include "parser.h" std::string whatrprop(struct propstruct p) { switch(p.kind) { case SUBROUTINE: case MODULESUBROUTINE: return("subroutine"); case PROGRAM: return("program"); case BLOCKDATA: return("block data"); case FUNCTION: case MODULEFUNCTION: return("function"); case MODULE: return("module"); case SUBMODULE: return("submodule"); case PROCEDURE: return("procedure"); default: return(""); } } // end of whatrprop findent-3.1.1/src/fixed.h0000644000175000017500000000141713342700212012120 00000000000000#ifndef FIXED_H #define FIXED_H #include "fortran.h" class Fixed : public Fortran { public: Fixed(Findent *f) : Fortran(f) {} void build_statement(Fortranline &line, bool &f_more, bool &pushback); void output(lines_t &lines,lines_t *freelines = 0); void output_converted(lines_t &lines); private: bool wizard(); bool wizard(lines_t lines); std::string add_amp(const std::string s,const char prevquote); std::string insert_omp(const std::string s) { if(is_omp) { std::string sl = s; sl = sl + blanks(ompstr.length() - sl.length()); return sl.replace(0,ompstr.length(),ompstr); } else return s; } bool is_omp; std::string ompstr; std::string cmpstr; }; #endif findent-3.1.1/src/globals.cpp0000644000175000017500000000002513337227740013007 00000000000000#include "globals.h" findent-3.1.1/src/fortranline.h0000644000175000017500000001517213364574052013366 00000000000000#ifndef FORTRANLINE_H #define FORTRANLINE_H #include #include "functions.h" #include "lexer.h" #include "parser.h" #include "globals.h" #include "debug.h" class Fortranline { // // NOTE: // some functions assume that clean() is called // std::string orig_line; std::string orig_without_omp; // // Some functions are used repeatedly, the results are // cached here // char firstchar_cache; bool firstchar_cached; std::string ltrim_cache; bool ltrim_cached; bool omp_cache; bool omp_cached; int scanfixpre_cache; bool scanfixpre_cached; std::string trim_cache; bool trim_cached; std::string incfile_cache; bool is_clean; Globals* gl; int local_format; bool local_gnu_format; void init() { local_format = gl->global_format; local_gnu_format = gl->global_gnu_format; is_clean = 0; firstchar_cached = 0; ltrim_cached = 0; omp_cached = 0; scanfixpre_cached = 0; trim_cached = 0; } void init(Globals* g) { gl = g; init(); } void do_clean(); bool do_omp(); public: void print(); void clean() { if (is_clean) return; else do_clean(); } void clean(bool force) { if (force) do_clean(); else clean(); } Fortranline(Globals* g) { init(g); } Fortranline(Globals*g, const std::string &s) { init(g); orig_line = s; } std::string g_format2txt() { switch(g_format()) { case UNKNOWN: return "unknown"; case FIXED: return "fixed"; case FREE: return "free"; default: return ""; } } void g_format(const int what) { gl->global_format = what; } int g_format() { return gl->global_format; } void line_length(const int what) { gl->global_line_length=what; } int line_length() { return gl->global_line_length; } void gnu_format(bool what) { gl->global_gnu_format=what; } bool gnu_format() { return gl->global_gnu_format; } std::string str() { return orig_line; } std::string strnomp() { clean(); return orig_without_omp; } friend std::ostream& operator <<(std::ostream &os,Fortranline &obj); void str(const std::string &s) { orig_line = s; init(); } int format() const { if (local_format == UNKNOWN) return gl->global_format; return local_format; } std::string trimmed_line() { // // result is different for FIXED or FREE, see below: // switch(format()) { case FIXED: return ::rtrim(orig_line); break; case FREE: default: if (omp()) return ::trim(orig_without_omp); else return ::trim(orig_line); break; } } std::string rtrim() { if (omp()) return ::rtrim(orig_without_omp); else return ::rtrim(orig_line); } std::string ltrim() { if (!ltrim_cached) { if (omp()) ltrim_cache = ::ltrim(orig_without_omp); else ltrim_cache = ::ltrim(orig_line); ltrim_cached = 1; } return ltrim_cache; } std::string trim() { if (!trim_cached) { if (omp()) trim_cache = ::trim(orig_without_omp); else trim_cache = ::trim(orig_line); trim_cached = 1; } return trim_cache; } char firstchar() { // returns first char of ltrim(), 0 if length()=0 if (!firstchar_cached) { if (ltrim().length()>0) firstchar_cache = ltrim()[0]; else firstchar_cache = 0; firstchar_cached = 1; } return firstchar_cache; } char operator [] (int i) const { //returns character in column k of the original line if(orig_line.length() > (unsigned) i) return orig_line[i]; else return 0; } char lastchar() const { if (orig_line.length() > 0) return *orig_line.rbegin(); else return 0; } std::string first2chars() { return ltrim().substr(0,2); } int scanfixpre() { if(!scanfixpre_cached) { lexer_set(trim(),SCANFIXPRE); scanfixpre_cache = yylex(); incfile_cache = lexer_getinclude(); if (format() == FIXED) if(scanfixpre_cache == FIXFINDENTFIX) scanfixpre_cache = FINDENTFIX; scanfixpre_cached = 1; } return scanfixpre_cache; } std::string getinclude() { if(scanfixpre_cache) return incfile_cache; else return ""; } bool omp() { if (!omp_cached) { omp_cache = do_omp(); omp_cached = 1; } return omp_cache; } std::string rest() { if(scanfixpre()==FINDENTFIX) return lexer_getrest(); else return ""; } bool blank() { return (trim().length() == 0); } bool comment() { switch (format()) { case FIXED: if (omp()) { return firstchar() == '!'; } switch(::firstchar(orig_line)) { case 'd': case 'D': case 'c': case 'C': case '!': case '*': return 1; } return firstchar() == '!'; break; case FREE: return firstchar() == '!'; break; } return 0; } bool blank_or_comment() { return blank() || comment(); } int getpregentype() { int pretype = scanfixpre(); switch(pretype) { case CPP_IF: case CPP_ENDIF: case CPP_ELSE: case CPP_ELIF: case CPP: return CPP; break; case COCO_IF: case COCO_ENDIF: case COCO_ELSE: case COCO_ELIF: case COCO: return COCO; break; case INCLUDE_CPP: case INCLUDE_CPP_STD: case INCLUDE_COCO: return pretype; break; default: return 0; } } bool precpp() { return firstchar() == '#'; } bool precoco() { return first2chars() == "??"; } bool pre() { return precpp() || precoco(); } bool blank_or_comment_or_pre() { return blank_or_comment() || pre(); } bool fortran() { return !blank_or_comment_or_pre(); } bool fixedcontinuation() const { // // returns 1 if the line, interpreted as a fixed format line, // contains a character other than 0 or ' ' in column 5 // const std::string c = " 0"; return c.find((*this)[5]) == std::string::npos; } std::string remove_trailing_comment(const char prevquote = ' ') { return ::rtrim(::remove_trailing_comment(orig_without_omp,prevquote)); } }; std::ostream& operator <<(std::ostream &os,Fortranline &obj); typedef std::deque lines_t; typedef std::deque linebuffer_t; #endif findent-3.1.1/src/makefdeps.inc0000644000175000017500000000573213402501024013303 00000000000000 std::cout << "#!/bin/bash" << std::endl; std::cout << "# - makefdeps -" << std::endl; std::cout << "# Creates make-dependencies for fortran sources, based on" << std::endl; std::cout << "# analysis by findent of (sub)modules that are needed or created and" << std::endl; std::cout << "# include files. Include files are not further analyzed." << std::endl; std::cout << "# Dependencies will be like:" << std::endl; std::cout << "# prog.o: sub1.o sub2.o" << std::endl; std::cout << "# prog.o: file1.inc file2.inc" << std::endl; std::cout << "# Example:" << std::endl; std::cout << "# makefdeps *.f90 > deps" << std::endl; std::cout << "usage()" << std::endl; std::cout << "{" << std::endl; std::cout << " echo \"usage:\"" << std::endl; std::cout << " echo \"$0 [-s objectsuffix] fortansources ...\"" << std::endl; std::cout << " echo \"objectsuffix: default '.o'\"" << std::endl; std::cout << " echo \"depending on your make system, '.lo' can be the correct one\"" << std::endl; std::cout << " exit 1" << std::endl; std::cout << "}" << std::endl; std::cout << "FINDENTPROG=${FINDENT:-findent}" << std::endl; std::cout << "p=$( getopt -o s: -- \"$@\" ) || usage" << std::endl; std::cout << "eval set -- \"$p\"" << std::endl; std::cout << "" << std::endl; std::cout << "O='.o'" << std::endl; std::cout << "while [ \"$1\" != \"--\" ]; do" << std::endl; std::cout << " case \"$1\" in" << std::endl; std::cout << " '-s') shift; O=\"$1\" ;;" << std::endl; std::cout << " esac" << std::endl; std::cout << " shift" << std::endl; std::cout << "done" << std::endl; std::cout << "shift" << std::endl; std::cout << "" << std::endl; std::cout << "declare -A module use include" << std::endl; std::cout << "for i in $@ ; do" << std::endl; std::cout << " j=${i%.*}$O" << std::endl; std::cout << " while read a b ; do" << std::endl; std::cout << " case $a in" << std::endl; std::cout << " use)" << std::endl; std::cout << " use[$j]=\"${use[$j]} $b\" ;;" << std::endl; std::cout << " mod|sub)" << std::endl; std::cout << " [ \"$b\" ] && module[$b]=$j ;;" << std::endl; std::cout << " inc|cpp|coc|std)" << std::endl; std::cout << " include[$j]=\"${include[$j]} $b\" ;;" << std::endl; std::cout << " esac" << std::endl; std::cout << " done < <( $FINDENTPROG --deps < $i )" << std::endl; std::cout << "done" << std::endl; std::cout << "for k in ${!use[@]}; do" << std::endl; std::cout << " m=\"\"" << std::endl; std::cout << " for l in ${use[$k]}; do" << std::endl; std::cout << " m=\"$m ${module[$l]}\"" << std::endl; std::cout << " done" << std::endl; std::cout << " if [ -n \"${m// }\" ] ; then" << std::endl; std::cout << " echo $k: $m" << std::endl; std::cout << " fi" << std::endl; std::cout << "done" << std::endl; std::cout << "for k in ${!include[@]}; do" << std::endl; std::cout << " echo $k: ${include[$k]}" << std::endl; std::cout << "done" << std::endl; findent-3.1.1/debian.stretch/0000755000175000017500000000000013476205423013047 500000000000000findent-3.1.1/debian.stretch/compat0000644000175000017500000000000213475131504014162 000000000000009 findent-3.1.1/debian.stretch/control0000644000175000017500000000122213475131556014373 00000000000000Source: findent Section: devel Priority: optional Maintainer: Willem Vermin Build-Depends: debhelper (>= 9), flex, bison Standards-Version: 3.9.8 Homepage: https://sourceforge.net/projects/findent/ Package: findent Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: indents/converts Fortran sources Indents Fortran sources: free or fixed format. Optionally converts from fixed format to free format. Supports Fortran2008. Indentation is controlled by a number of flags. Easy integration with (g)vim, gedit, emacs. . wfindent is a wrapper for findent and facilitates in-place indenting of Fortran sources. findent-3.1.1/debian.stretch/changelog0000644000175000017500000000065513476205423014647 00000000000000findent (3.1.1-1) unstable; urgency=low * New upstream release -- Willem Vermin Thu, 06 Jun 2019 14:46:11 +0200 findent (2.8.2-1) unstable; urgency=low * New upstream release -- Willem Vermin Wed, 13 Jun 2018 05:09:12 +0200 findent (2.7.3-1) unstable; urgency=low * Initial release (Closes: #842166) -- Willem Vermin Tue, 20 Dec 2016 12:22:24 +0100 findent-3.1.1/LICENCE0000644000175000017500000000002513334307040011043 00000000000000See the file COPYING findent-3.1.1/NEWS0000644000175000017500000000000012556410373010557 00000000000000findent-3.1.1/config.h.in0000644000175000017500000000416613476205425012126 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_ALGORITHM /* Define to 1 if you have the header file. */ #undef HAVE_CSTDIO /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_IOSTREAM /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_QUEUE /* Define to 1 if you have the header file. */ #undef HAVE_SSTREAM /* Define to 1 if you have the header file. */ #undef HAVE_STACK /* 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 header file. */ #undef HAVE_STRING /* 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_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 header file. */ #undef HAVE_VECTOR /* 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 home page for this package. */ #undef PACKAGE_URL /* 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 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER findent-3.1.1/depcomp0000755000175000017500000005602013476205425011454 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 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, see . # 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 . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} 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 # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # 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 cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc 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. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## 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). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - 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 -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # 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. ## 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. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -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 -ne 0; then 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 ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # 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 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, 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. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; 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. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # 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 ;; #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 preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--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 test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | 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 $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | 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 preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--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 -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [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 preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # 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 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: findent-3.1.1/COPYING0000644000175000017500000000301713246533334011126 00000000000000Copyright: 2015,2016,2017,2018 Willem Vermin wvermin@gmail.com License: BSD-3-Clause 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. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. . THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 HOLDERS OR CONTRIBUTORS 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. findent-3.1.1/configure.ac0000644000175000017500000001153113476205423012361 00000000000000# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_INIT(findent, 3.1.1, wvermin@gmail.com) AM_INIT_AUTOMAKE AM_MAINTAINER_MODE AC_CONFIG_SRCDIR([src/findent.cpp]) AC_CONFIG_HEADERS([config.h]) AC_SUBST([make_include], ["include"]) AC_ARG_WITH(windows, [AS_HELP_STRING([--with-windows],[Build findent.exe @<:@default=no@:>@])],[],[with_windows=no]) mingw32="i686-w64-mingw32-g++" AS_IF( [test "x$with_windows" = xyes],[AC_CHECK_PROG([MINGW32],[$mingw32],[$mingw32],[none])]) AS_IF( [test "x$MINGW32" = xnone], [AC_MSG_ERROR([Not found: $mingw32, set MINGW32 to a working mingw C++ compiler])]) AS_IF( [test "x$with_windows" = xyes], [CXX=$MINGW32 AC_MSG_NOTICE([mingw c++ compiler: $MINGW32]) AC_MSG_NOTICE([Will create WINDOWS executable findent.exe]) AC_SUBST([EXEEXT],[.exe])]) AM_CONDITIONAL([MAKEMAN],[test "x$with_windows" != "xyes"]) AM_CONDITIONAL([MAKEWIN],[test "x$with_windows" = "xyes"]) AC_ARG_WITH(esope, [AS_HELP_STRING([--with-esope],[Build with esope support @<:@default=no@:>@])],[],[with_esope=no]) AM_CONDITIONAL([USEESOPE],[test "x$with_esope" = "xyes"]) # test if bison available etc... AC_ARG_WITH(bison, [AS_HELP_STRING([--with-bison],[Use bison to create parser @<:@default=use-bison-if-available@:>@])],[],[with_bison=use-bison-if-available]) usebison="$with_bison" AS_IF( [test "x$with_bison" != "xno"], [ m4_include([m4/ax_prog_bison.m4]) ] ) AS_IF( [test "x$with_bison" = "xyes"], [AX_PROG_BISON([],[AC_MSG_ERROR([No valid bison found. Try --without-bison])])]) AS_IF( [test "x$with_bison" = "xuse-bison-if-available"], [AX_PROG_BISON(AC_MSG_NOTICE([Will use bison if necessary to create parser.]) [usebison="yes"], AC_MSG_NOTICE([No bison found. Will use pre-built parser.]) [usebison="no"])]) AM_CONDITIONAL([USEBISON],[test "x$usebison" = "xyes"]) # test if flex available etc... AC_ARG_VAR([LEX],[The 'Fast lexical analyser generator' to use]) AC_ARG_WITH(flex, [AS_HELP_STRING([--with-flex],[Use flex to create lexer @<:@default=use-flex-if-available@:>@])],[],[with_flex=use-flex-if-available]) useflex="$with_flex" AS_IF( [test "x$with_flex" != "xno"], [ m4_include([m4/ax_prog_flex.m4]) ] ) AS_IF( [test "x$with_flex" = "xyes"], [AX_PROG_FLEX([],[AC_MSG_ERROR([No valid flex found. Try --without-flex])])]) AS_IF( [test "x$with_flex" = "xuse-flex-if-available"], [AX_PROG_FLEX(AC_MSG_NOTICE([Will use flex if necessary to create lexer.]) [useflex="yes"], AC_MSG_NOTICE([No flex found. Will use pre-built lexer.]) [useflex="no"])]) AM_CONDITIONAL([USEFLEX],[test "x$useflex" = "xyes"]) # test for working gfortran (only used in make check): AC_PROG_FC([gfortran]) AS_IF( [test "x$FC" = "xgfortran"], [AC_MSG_NOTICE([gfortran will be used to compile test sources in 'make check'])], [AC_MSG_NOTICE([No gfortran compiler found. 'make check' will not try to compile test sources])]) AC_CONFIG_FILES([test/prelude]) AC_CONFIG_FILES([test/postlude]) AC_CONFIG_FILES([test/test-compile.sh],[chmod +x test/test-compile.sh]) AC_CONFIG_FILES([test/doit],[chmod +x test/doit]) AC_CONFIG_FILES([test/init.sh],[chmod +x test/init.sh]) AC_CONFIG_FILES([test/progfixed-dos.f.try.f.ref]) AC_CONFIG_FILES([test/progfixed-dos.f]) AC_CONFIG_FILES([test/progfixed.f.try.f.ref]) AC_CONFIG_FILES([test/progfixed.f]) AC_CONFIG_FILES([test/progfixed1.f.try.f.ref]) AC_CONFIG_FILES([test/progfixed1.f]) AC_CONFIG_FILES([test/progfixedfree-dos.f.try.f.ref]) AC_CONFIG_FILES([test/progfixedfree-dos.f]) AC_CONFIG_FILES([test/progfixedfree.f.try.f.ref]) AC_CONFIG_FILES([test/progfixedfree.f]) AC_CONFIG_FILES([test/progfree-dos.f.try.f.ref]) AC_CONFIG_FILES([test/progfree-dos.f]) AC_CONFIG_FILES([test/progfree.f.try.f.ref]) AC_CONFIG_FILES([test/progfree.f]) AC_CONFIG_FILES([test/progfree1.f.try.f.ref]) AC_CONFIG_FILES([test/progfree1.f]) AC_CONFIG_FILES([test/progfreefixed.f.try.f.ref]) AC_CONFIG_FILES([test/progfreefixed.f]) AC_CONFIG_FILES([test/esope.f.try.f.ref]) AC_CONFIG_FILES([test/esope.f]) AC_CONFIG_FILES([test/emacs_findent.ref]) AC_CONFIG_FILES([test/emacs_help.ref]) AC_CONFIG_FILES([test/gedit_external.ref]) AC_CONFIG_FILES([test/gedit_help.ref]) AC_CONFIG_FILES([test/gedit_plugin.ref]) AC_CONFIG_FILES([test/gedit_plugin_py.ref]) AC_CONFIG_FILES([test/help.ref]) AC_CONFIG_FILES([test/makefdeps.ref]) AC_CONFIG_FILES([test/manpage.ref]) AC_CONFIG_FILES([test/readme.ref]) AC_CONFIG_FILES([test/vim_findent.ref]) AC_CONFIG_FILES([test/vim_fortran.ref]) AC_CONFIG_FILES([test/vim_help.ref]) AC_PROG_CXX AC_PROG_AWK AC_PROG_SED AC_LANG([C++]) AC_HEADER_STDC AC_CHECK_HEADERS([iostream string stack vector cstdio queue algorithm sstream],[],AC_MSG_ERROR([Exiting])) AC_OUTPUT(Makefile src/Makefile scripts/Makefile test/Makefile vim/Makefile gedit/Makefile emacs/Makefile doc/Makefile deps/Makefile) findent-3.1.1/scripts/0000755000175000017500000000000013476205436011645 500000000000000findent-3.1.1/scripts/wfindent.10000644000175000017500000000117213246771353013467 00000000000000.TH WFINDENT "1" "2015" "wfindent" "User Commands" .SH NAME wfindent \- Indents and optionally converts Fortran program sources .SH SYNOPSIS .B wfindent [\fIOPTION\fR]... [\fIFILE\fR]... .PP See 'man 1 findent' for the options. .SH DESCRIPTION Wfindent is a wrapper for findent(1), calling findent for each of the files. The files are overwritten by the indented version. A sanity check is made before oerwriting a input file. .PP .SS Example: wfindent \-i4 *.f90 .SH COPYRIGHT .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. findent-3.1.1/scripts/wfindent.bat0000644000175000017500000000555113334307073014072 00000000000000@echo off setlocal EnableDelayedExpansion EnableExtensions if -%1-==-- ( echo wfindent is a wrapper for findent echo usage: wfindent [ findent-args ] filenames echo example: echo wfindent -ifree -i4 *.f90 echo for a complete list of findent-args, type echo wfindent -h echo NOTE: flags that influence the indenting: use echo only the short varieties preceded with echo a single '-', like -i5 -Rr goto :EOF ) set fargs= :astart if -%1-==-- goto :EOF set aa=%1 if "%aa%" == "-v" goto :SPECIALRUN if "%aa%" == "--version" goto :SPECIALRUN if "%aa%" == "-h" goto :SPECIALRUN if "%aa%" == "--help" goto :SPECIALRUN if "%aa%" == "-H" goto :SPECIALRUN if "%aa%" == "--manpage" goto :SPECIALRUN if "%aa%" == "--vim_help" goto :SPECIALRUN if "%aa%" == "--vim-help" goto :SPECIALRUN if "%aa%" == "--vim_fortran" goto :SPECIALRUN if "%aa%" == "--vim-fortran" goto :SPECIALRUN if "%aa%" == "--vim_findent" goto :SPECIALRUN if "%aa%" == "--vim-findent" goto :SPECIALRUN if "%aa%" == "--gedit_help" goto :SPECIALRUN if "%aa%" == "--gedit-help" goto :SPECIALRUN if "%aa%" == "--gedit_external" goto :SPECIALRUN if "%aa%" == "--gedit-external" goto :SPECIALRUN if "%aa%" == "--gedit_plugin" goto :SPECIALRUN if "%aa%" == "--gedit-plugin" goto :SPECIALRUN if "%aa%" == "--gedit_plugin_py" goto :SPECIALRUN if "%aa%" == "--gedit-plugin-py" goto :SPECIALRUN if "%aa%" == "--emacs_help" goto :SPECIALRUN if "%aa%" == "--emacs-help" goto :SPECIALRUN if "%aa%" == "--emacs_findent" goto :SPECIALRUN if "%aa%" == "--emacs-findent" goto :SPECIALRUN if "%aa%" == "-q" ( echo wfindent: flag -q ignored echo use "findent -q < filename" shift goto :astart ) if %aa:~0,2%==-- ( echo Error: found flag: %aa% echo Use only short indenting flags like -i5 -Rr ... exit /b ) if %aa:~0,1%==- ( set fargs=%fargs% %aa% shift goto astart ) :bstart if -%1-==-- goto :EOF if exist %1 goto one echo file %1 does not exist goto :EOF :one call :GETTEMPNAME set tmpf1="%TEMP%.\%FILENAME%_f" set tmpc1="%TEMP%.\%FILENAME%_c1" set tmpc2="%TEMP%.\%FILENAME%_c2" for %%a in (%1) do ( echo indenting %fargs% %%a findent %fargs% < %%a > %tmpf1% find /v /c "" < %%a > %tmpc1% find /v /c "" < %tmpf1% > %tmpc2% set /p counter1=<%tmpc1% set /p counter2=<%tmpc2% if !counter1! neq !counter2! ( echo something wrong, file unmodified ) else ( copy /Y %tmpf1% %%a >nul ) if exist %tmpf1% del %tmpf1% if exist %tmpc1% del %tmpc1% if exist %tmpc2% del %tmpc2% ) shift goto bstart :GETTEMPNAME for /f "delims=:. tokens=1-4" %%t in ("%TIME: =0%") do ( set FILENAME=wf-%%t%%u%%v%%w ) exit /b :SPECIALRUN findent %aa% exit /b findent-3.1.1/scripts/Makefile.am0000644000175000017500000000033513246746760013627 00000000000000bin_SCRIPTS = wfindent man1_MANS = wfindent.1 CLEANFILES = wfindent wfindent: wfindent.tmpl $(SED) 's|findent-location|"$(bindir)/findent"|' $< > $@ chmod a+rx $@ EXTRA_DIST = wfindent.tmpl wfindent.1 wfindent.bat findent-3.1.1/scripts/wfindent.tmpl0000744000175000017500000001163013444173131014272 00000000000000#!/bin/sh # vim: filetype=sh # # in-place indenting of fortran sources using findent # example: # wfindent -i4 *.f90 # # A check is made if the output file has the same number of lines # as the input file. # If this check succeeds, the file is overwritten, # otherwize an error message is printed. # # the location of findent, replace with correct location: FINDENT=${FINDENT:-findent-location} if ! "$FINDENT" -v >/dev/null 2>&1 ; then FINDENT="findent" # try if findent is in PATH if ! "$FINDENT" -v >/dev/null 2>&1 ; then echo "$0: findent not found, exiting" exit 1 fi fi echo "$0 using: "`"$FINDENT" -v` # left-outs are: -q, -lastindent, -lastusable, --deps parms=$( getopt -o a:b:c:C:d:e:E:f:F:hHi:I:j:k:l:L:m:M:o:r:R:s:t:vw:x: \ -l help \ -l manpage \ -l readme \ -l version \ -l makefdeps \ -l vim_help -l vim-help \ -l vim_fortran -l vim-fortran \ -l vim_findent -l vim-findent \ -l gedit_help -l gedit-help \ -l gedit_external -l gedit-external \ -l gedit_plugin -l gedit-plugin \ -l gedit_plugin_py -l gedit-plugin-py \ -l emacs_help -l emacs-help \ -l emacs_findent -l emacs-findent \ -l continuation: \ -l include_left: -l include-left: \ -l label_left: -l label-left: \ -l input_format: -l input-format: \ -l indent: \ -l input_line_length: -l input-line-length: \ -l max_indent: -l max-indent: \ -l output_format: -l output-format: \ -l openmp: \ -l refactor_procedures:: -l refactor-procedures:: \ -l start_indent: -l start-indent: \ -l indent_associate: -l indent-associate: \ -l indent_block: -l indent-block: \ -l indent_do: -l indent-do: \ -l indent_if: -l indent-if: \ -l indent_enum: -l indent-enum: \ -l indent_forall: -l indent-forall: \ -l indent_interface: -l indent-interface: \ -l indent_module: -l indent-module: \ -l indent_procedure: -l indent-procedure: \ -l indent_select: -l indent-select: \ -l indent_type: -l indent-type: \ -l indent_where: -l indent-where: \ -l indent_critical: -l indent-critical: \ -l indent_changeteam: -l indent-changeteam: \ -l indent_contains: -l indent-contains: \ -l indent_continuation: -l indent-continuation: \ -l indent_case: -l indent-case: \ -l indent_entry: -l indent-entry: \ -- "$@" ) if [ $? -ne 0 ] ; then exit 1 fi eval set -- "$parms" fparms="" while [ "$1" ] ; do case "$1" in --) shift break ;; "-v"|"--version") echo "wfindent using $FINDENT" "$FINDENT" -v exit $? ;; "-h"|"-H"|"--help"|"--manpage") echo "wfindent - Indents and optionally converts Fortran program sources" echo echo "wfindent [OPTION]... [FILE]..." echo "examples:" echo "$ wfindent -i4 -Rr *.f90" echo "$ wfindent -i3 prog.f90 sub.f" echo echo "see below for possible options" echo "Note: these options can only be used with findent (not wfindent):" echo " -q, --query_fix_free, -lastindent, --last_indent" echo " -lastusable, --last_usable, --deps" echo "$FINDENT" "$1" exit $? ;; --readme|--makefdeps|--vim*|--gedit*|--emacs*) "$FINDENT" "$1" exit $? ;; --refactor*) # special: optional argument must be preceded with '=' fparms="$fparms $1" shift if [ "$1" ] ; then fparms="$fparms=$1" fi shift ;; *) fparms="$fparms $1" shift ;; esac done tmp=`mktemp` n=0 while [ "$1" ] ; do if [ -e "$1" ] ; then norig=`wc -l < "$1"` # Check if file ends with newline. If not: correct number of lines lastchar="$(tail -c1 "$1" | od -a -An | tr -d ' ')" if [ "$lastchar" != "nl" ] ; then norig=`expr $norig + 1` fi cat "$1" | "$FINDENT" $fparms > $tmp nnew=`wc -l < $tmp` if [ $norig -eq $nnew ] ; then cp $tmp "$1" n=`expr $n + 1` else echo "***** wfindent: error while converting $1, conversion abandoned" fi fi shift done echo "wfindent: indented files: $n" rm $tmp findent-3.1.1/scripts/Makefile.in0000644000175000017500000004003613476205425013633 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = scripts ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_bison.m4 \ $(top_srcdir)/m4/ax_prog_flex.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" SCRIPTS = $(bin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man1_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC = @FC@ FCFLAGS = @FCFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MINGW32 = @MINGW32@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_FC = @ac_ct_FC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ make_include = @make_include@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ bin_SCRIPTS = wfindent man1_MANS = wfindent.1 CLEANFILES = wfindent EXTRA_DIST = wfindent.tmpl wfindent.1 wfindent.bat all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu scripts/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-man1: $(man1_MANS) @$(NORMAL_INSTALL) @list1='$(man1_MANS)'; \ list2=''; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(SCRIPTS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-binSCRIPTS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-binSCRIPTS uninstall-man uninstall-man1 .PRECIOUS: Makefile wfindent: wfindent.tmpl $(SED) 's|findent-location|"$(bindir)/findent"|' $< > $@ chmod a+rx $@ # 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: findent-3.1.1/makezip0000744000175000017500000000272513357370725011472 00000000000000#!/bin/sh dir=`pwd` ./bootstrap || exit 1 unset CXXFLAGS ./configure --with-windows || exit 1 make clean || exit 1 rm -rf bin make || exit 1 make check || exit 1 strip src/findent.exe || exit 1 version=`./getversion` || exit 1 echo "version = $version" cd .. || exit 1 mkdir -p versions || exit 1 cp $dir/README.windows versions/README.txt || exit 1 cp $dir/src/findent.exe versions || exit 1 cp $dir/scripts/wfindent.bat versions || exit 1 cp $dir/COPYING versions/COPYING.txt cd versions || exit 1 unix2dos README.txt COPYING.txt || exit 1 rm -f "findent-$version.zip" zip "findent-$version.zip" findent.exe README.txt \ COPYING.txt wfindent.bat || exit 1 rm -f findent.exe README.txt wfindent.bat COPYING.txt cd "$dir" || exit 1 make distclean echo "$0 done" findent-3.1.1/Makefile.am0000644000175000017500000000105213475170427012130 00000000000000AUTOMAKE_OPTIONS = gnu SUBDIRS = src scripts test vim gedit emacs doc deps MAINTAINERCLEANFILES = config.h.in~ EXTRA_DIST = bootstrap getversion LICENCE README.1st README.windows \ maketar makezip makedeb makesid README.2nd debian \ makeupload pbuilderscript \ debian.disco debian.wheezy debian.sid debian.stretch \ simplemake.sh maintainer-clean-local: rm -rf bin share autom4te.cache if MAKEWIN all-local: test -f src/findent && mv src/findent src/findent.exe ; exit 0 endif builtparser builtlexer: cd src; $(MAKE) $@ findent-3.1.1/compile0000755000175000017500000001632713476205425011463 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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, see . # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: findent-3.1.1/makedeb0000744000175000017500000000407613475554175011427 00000000000000#!/bin/bash # parameter all: produce debs for i386-stretch, amd64=stretch, amd64-sid curdir=$PWD unset CXXFLAGS version=`./getversion` echo "version = $version" tar=$PWD/../versions/findent-$version.tar.gz dir=findent-$version dsc=findent_$version-1.dsc debdir=$PWD/../debian/findent-$version-deb #for d in debian debian.disco debian.stretch debian.sid ; do # if [ -e $d/changelog ] ; then # sed -i "1s/(.*)/($version-1)/" $d/changelog || exit 1 # fi #done ./maketar || exit 1 rm -rf $debdir mkdir -p $debdir || exit 1 cd $debdir || exit 1 cp $tar . || exit 1 tar xf $tar || exit cd $dir || exit codename=`lsb_release -sc` echo compat before $codename: `cat debian/compat` `grep Standards-Version debian/control` cp debian.$codename/* debian || exit echo compat after $codename: `cat debian/compat` `grep Standards-Version debian/control` #dh_make --yes -s -f $tar dh_make --yes -s --createorig cd .. dpkg-source -b $dir || exit 1 cd - #debuild -us -uc --lintian-opts --profile debian || exit dpkg-buildpackage -us -uc --check-command=lintian --check-option='--profile' --check-option=debian if test "x$1" != xall ; then cd .. rm -r $dir || exit 1 echo $0 done exit 0 fi cd .. #for dist in amd64-sid ; do #for dist in amd64-stretch ; do for dist in i386-stretch amd64-stretch amd64-sid ; do debdirbuild=$curdir/../debian/findent-$version-deb-build.$dist rm -rf $debdirbuild mkdir -p $debdirbuild || exit 1 workdir=`mktemp -d --tmpdir findent-pbuilder-$dist.XXXXXXX` echo building for $dist in $workdir ... cd $workdir || exit 1 mkdir w || exit 1 cd w || exit 1 tar xf $tar || exit 1 cd $dir || exit 1 case $dist in *stretch*) cp debian.stretch/* debian || exit 1 ;; *sid*) cp debian.sid/* debian || exit 1 ;; esac dh_make --yes -s --createorig cd .. dpkg-source -b $dir || exit 1 sudo pbuilder --build --configfile /root/pbuilderrc.$dist --buildresult $debdirbuild $workdir/w/*dsc sudo chown -h $USER.$USER $debdirbuild/* || exit 1 debsign $debdirbuild/*.changes || exit 1 done rm -r $dir || exit 1 echo $0 done findent-3.1.1/ChangeLog0000644000175000017500000004072213475070505011651 00000000000000findent-3.1.1: added support for ESOPE (SEGMENT, ENDSEGMENT) as configuration parameter free-format: statement label can now contain an & bug fix: fortran.cp: preprocessor line with continuations where not handled properly configure.ac: changed testing for gfortran make check: start wineserver in first test to speed up checks. before ubuntu19.04 this was not necessary findent-3.1.0: added simplemake.sh: compiles findent without configure; make updated wfindent findent-3.0.1: doc/README: add something about dependencies findent-3.0.0: add generation of dependencies (flags --deps and --makefdeps) corrected a few minor bugs findent-2.9.2: fortran.cpp, findentclass.cpp: fixed error in -ifixed -lastusable by taking in account the wizardbuffer findent-2.9.1: lexer.l: allow space after '#' in cpp preprocessor directive findent-2.9.0: add 2018 features: CRITICAL [(...)] CHANGE TEAM (...) END TEAM [(...)] fortran.cpp: add CHANGETEAM for detection of moduleprocedure add CLASSIS etc to not usables for flag -lastusable test/Makefile.am test/test-compile.sh.in configure.ac: test for working gfortran: yes: 'make check' will compile sources no: 'make check' will not compile sources findent-2.8.6: fix bug: wrong lastindent when last line is ENDIF,END etc. this bug was introduced in version 2.8.3 adapt documentation for systems without sudo findent-2.8.5: implemented openmp awareness findent-2.8.4: major restructuring of the code. findent-2.8.3: parser.y, lexer.l: changed detection of do-constructs DO , DO , 100 are now NOT classified as a do-construct explicit detection of DOWHILE and DOCONCURRENT Made detection of PROGRAM and FUNCTION more precise: for PROGRAM only allowed: PROGRAM IDENTIFIER some old dialects permit this PROGRAM i.e: program without a name for FUNCTION: parameter list is now required makedeb: some enhancements. debian.wheezy, debian.xenial: directories with deviations from sid findent.cpp, some tests: more generic refactoring of end statements. Now for example: 'end subroutine' will be refactored to 'end subroutine mysub'. Moreover: 'end subroutine mysub' will be changed into 'end function myfun' if appropriate. test/Makefile: clean up bootstrap: copies most files from test to debian/tests test: adapted test scripts to run in test and in sadt findent.cpp, lexer.l: let the lexer find the string findentfix: in stead of a function in findent.cpp findent.cpp, lexer.l, parser.y: minor change in defintion of lexer_set() test/test-compile.sh.in: improved output when test fails findent.cpp, lexer.l: add support for coco preprocessor functions.cpp, functions.h: moved some general usable stringfunctions to functions.cpp test: added test18.sh for testing coco and cpp lexer.l, parser.y, findent.cpp: use lexer to scan preprocessor lines TODO: correct handling of continuation lines of preprocessor lines, especially coco continuations : clean up code, findent.cpp is too messy ~pre3 streamlined .h files, added prop.h usage.cpp usage.h added flags.cpp flags.h lexer.h re-arrange code, to make it better readable. use list in stead of deque for (cur)lines added free2fixed ~pre4 implemented a finite state machine in get_full_statement() change list and stack into deque implemented user-choosable continuation character cleaned up code made some optimizations adapted documentation findent-2.8.2: debianizing ... findent-2.8.1: adapt wfindent and wfindent.bat to long options parser.y: get rid of shift-reduce conflict src/Makefile.am: some minors to ensure proper regeneration of lexer.cpp if necessary findent-2.8.0: implement ! findentfix: clean up code, enhance documentation parallel make, also for make check, seems to work now findent-2.7.4: src/Makefile.am, configure.ac: if flex/bison is not to be used, but lexer.l or parser.y has been changed, produce a warning message. maketar: remove creating executable Readme.1st: adapted to previous line Change build process: no bison or flex needed when building from tarball. Update debian directory. bootstrap: fix bug wich prevented 'make dist' to run src/Makefile.am, Makefile.am, scripts/Makefile.am: fixes to facilitate 'make distcheck' src/findent.cpp, add option -i- to disable indenting test: add test7.sh and test8.sh to test flag -i- README: add method to get indented comments when converting from fixed to free parser.y, lexer.y: recognize PROCEDURE(not only MODULEPROCEDURE) as PROCEDURE makedeb: add i386-wheezy Makefile.am, configure.ac: introduce variable MAKEWIN to mv findent to findent.exe when compiling for windows. Somehow, now the mingw compiler does not generate foo.exe when requested to produce foo. findent.cpp: add comment for names of long flags add -osame option findent.cpp tocpp.sh vim_plugin.cpp vim_plugin.h gedit_plugin.cpp gedit_plugin.h let findent output configuration files for usage with vim and gedit. Flags: --vim_help --gedit_help --vim_findent --vim_fortran --gedit_external --gedit_plugin --gedit_plugin_py test: use only one or two lines for testing flags -h, -H add tests (test16.sh) for vim and gedit related flags. make use of MAKEWIN (see configure.ac) to determine if we made an windows executable. parser.y: bugfix take care that "dom(1)%t" is recognized as an lvalue so that "dom(1)%t = 0" is not classified as the start of a do-loop, but as an assignement by adding: lvalue: lvalue '%' lvalue test, findent.cpp, emacs add ability to generate emacs config file. add aliases for flags containing '_': '-' can be used instead findent-2.7.3: findent-2.7.2: copyright: BSD-3 debial/rules: add export DEB_BUILD_MAINT_OPTIONS=hardening=+all debian/, makedeb, maketar: some slight modifications for debian packaging findent.cpp: changed output of pure comment lines while converting from fixed to free: - comment starts with [cC*!] in column one: the first character is replaced by '!' and the comment is ouput un-indented - comment starting with '!', not in column 1, is indented - comment with [dD] in column one: is output as-is, prepended with '!', starting in column one fixed format: if garbage is detected in label field, output that line as-is findent-2.7.1: maketar: adapt version in debian/changelog vim somewhat better findent.vim and fortran.vim pre_analyzer.cpp: bugfix findent-2.7.0: findent.cpp: - add option -lastindent to output only the indentation level of the last line - recognise '# if' etc - fixed minor bug: code starting with preprocessor directive in combination with -Ia did not function properly - add flag -Q. returncode =2 for free, 4 for fixed for usage in vim - removed documentation for -Q, it is not needed now - add stack for dolabels to obtain correct indenting in cases like this: do 1 i=1,2 #if x 1 continue #else 1 continue #endif - make fixed ! comment output as in free - better initialization of indents if startindent>0 - -Innn now sets auto_firstindent = 0 - better #if ... handling wfindent: - add code to look for findent in default PATH if the given location (FINDENT=) does not work - exit if no findent is found all: - omit 'using namespace std' - update documentation README, README.1st - move test folder out of src folder - separate tests, new tests for -lastindent and -lastonly vim: - add a folder vim and two files: findent.vim and fortran.vim findent-2.6.0: findent.cpp: - -Ia now also works correct if source starts with 'end', 'endif' etc. - bootstrap now fills in findent version in configure.ac on the 'AC_INIT(' line - configure.ac add AC_CONFIG_FILES statements to copy test cases to build directory findent-2.5.1: findent.cpp: - corrected help output for the -rR flag by replacing leading '\' by space - some improvements in help output findent-2.5.0: findent.cpp: - lines starting originally with '!' are not indented - pure comment lines, not starting with '!' get an indent of at least 1 - added -C- flag: resets indent with 'contains' - continuation lines not starting with '&' are extra intented flag: -kn - flag -k-: continuation lines are untouched - findent.cpp: somewhat better layout of man page README: - add remark about not wanting irreversible changes to sources wfindent: - use installation path of findent in stead of 'findent' - recognize -v, -h and -H flags: run findent using only this flag - ignore -q flag wfindent.bat: - recognize -v, -h and -H flags: run findent using only this flag - ignore -q flag test: - adapted progfree.f.try.f.ref and progfree-dos.f.try.f.ref findent-2.4.1: fixed typo in help text. findent-2.4: release 2.4 findent-2.3.1: findent.cpp: correct explanation of -l flag in usage() maketar: fix a few nearly-bugs src/parser.y, src/Makefile.am: take care that older versions of bison work findent-2.3: jfindent: is now in a separate folder: ../jfindent with it's on autoconf setup Makefile.am: added $(DESTDIR) for the man page adapted to new jfindent location findent.cpp: fix bug in coverting fixed to free when dealing with a preprocessor continuation configure.ac: explicitly include macros in m4, do not use AC_CONFIG_MACRO_DIR, this seems not to work in Debian wheezy repaired make check. Send log file to stdout. maketar, makezip: removed making jfindent.jar configure.ac: use standard AC_PROG_YACC jfindent 1.1: jfindent now writes config file after reading (succesfull or not) and after clicking 'Quit' added 'recent folders' menu item under 'File' some trivial changes added menuitem 'File->Save configuration' version 2.2: convert to autoconf findent-2.2: Makefile: add support for creating 32 bit executable findent.cpp: -H options produces man page findent.cpp: better support for preprocessor lines with continuation line src/Makefile.am configure.ac: take care that no manpage is made when compiling for windows findent-2.1: wfindent.bat: added wfindent: change from bash syntax to sh syntax Jfindent.java: added added Oracle copyright text finished ... added file menu added about menu somewhat better menubar and better texts for buttons and mor intuitive behaviour with 'show all options' removed 'show all options' button, extend help with this information some trivia when previewing a file, the scroll position remains the same when trying different options Make menu textArea's non-editable CHANGELOG added subversion Id to all files Makefile: add support for jfindent fix minor bug: make -j works now README: add text for jfindent revised the text README.1st: add text for jfindent revised the text INSTALL: revised the text lexer.l: allow $ as non-first character in identifier findent-2.0: Complete new code Better parser Space insensitive Fortran 2008 compliant findent-1.6.5: Makefile: removed -g flag created 'zip' and 'tar' targets findent.y: added code and help text for the -L flag wfindent: added -L flag README: replaced NOTE 1, it covers now tab input. Added scripts 'makezip' and 'maketar' Added README.1st findent-1.6.4: findent.y: determine if input comes from terminal, warn user and accept a single dot ('.') as end-of file Extended usage() with examples findent-1.6.3: findent.l, findent.y, findent.h: implement refactor routines findent.y: bug fixes for fixed form continuation lines findent-1.6.2: regcognise tabbed source: [1-9] is recognised as a continuation line fixed bug when tab follows label: ltab2sp now takes in acccount a statement label findent-1.6.1: findent.l: get rid of flex message: "warning, dangerous trailing context" by slight redefinition of statement-label simplified else, elseif, elsewhere recognition findent.y: recognize debug lines in fixed format ('d' or 'D' in colimn 1), treating them as comment lines. Special treatment with -ofree: debug line as: 'd print *,"debug",i' will be output after conversion to free format as: '!d print *,"debug",i' findent-1.6.0: Makefile: slight change in rule to make .o from .cpp wfindent: added findent.l: fixed recognition of elseif by better definition of {nc} README: describe wfindent INSTALL: install wfindent findent-1.5.9: findent.l: recognize 'label :' ('label:' was already recognized) recognize false type as in 'typecode = 10' better discrimination between fixed and free findent.y: recognize '123 enddo', do not double-de-indent findent-1.5.8: findent.y: fill indent-stack from 0 to start_indent with the default indent findent.l: support for construct name in 'do' 'if' 'select' 'block' recognize some forms of false end recognize 'abstract type' and 'abstract interface' findent-1.5.7 findent.l: recognize strings in 'rest' state more precise definition of function recognize 'endprogram' do not confuse 'do (i) =' witha do statement findent.y: fixed form: put an ' ' as possible separator between label and code findent-1.5.6 Makefile: added support for cross compiling to windows: make clean make MINGW=1 creates a windows 32 bit findent.exe findent.l: ticket 1: more precise recognition of function statement findent-1.5.5 findent.y: added support for conditional preprocessor statements. Example: #ifdef USEMPI subroutine mysub(a,b) real a,b #else subroutine mysub(a) real a #endif end subroutine mysub indents correctly now. findent-1.5.4 findent.y: recognize ' x = 3 & ! comment' as a line needing a continuation preprocessor statements are handled on ad-hoc basis findent.l: preprocessor statements are not recognized any more findent-1.5.3 findent.y: add fixed-to-free: add check if this is a preprocessor line fixed-to-free: fixed fortran can have a trailing comment, starting with !, and have a continuation line. This is fixed. fixed-to-free: fixed bad handling of otherwise empty continuation lines findent.l: better recognition of fixed and free recognize 'integer(kind=8) function func1(a,b)' as a function Thanks to Dusan Jovic removed 'select' from definition of explicitly not-handled keywords findent-1.5.2 findent.l: let lexer recognise 'type, public :: mytype' Thanks to Dusan Jovic findent-1.5.1 findent.l: added some patterns to distinguish between fixed and fixed format findent.y: fix for files that do not end with \n fix for correct indenting continuation line while converting findent-1.5 README: add recipe to use equalprg in vim findent.y: add ';' in to rules to quiet bison-2.5 fix placement of preprocessor lines if they are in a continuation suite enlarge number of lines to be considered when determining fixed or free from 10 to 1000 findent.l: fix definition of {neol} findent-1.4 findent.y: make sure that string(n,' ') is always called with n >= 0 findent-1.3 version.h: set version to 1.3 findent.h: add definition for lexer_set() findent.l: add lexer_set() in lexer_init(): change lexer_push() to lexer_set() findent.y: replace lexer_pop()...lexer_push() sequences by lexer_set() minor code cleaning. Makefile: 'test' dependent of 'all' 'clean' also cleans test directory test/progfixed_dos.f: add -ifixed in first line test/progfree_dos.f: add -ifree in first line README: minor adaptations CHANGELOG added findent-1.2 findent.l: fix error in lexer_push findent-1.1 findent.l: fix error in lexer_pop findent-1.0 initial release findent-3.1.1/test/0000755000175000017500000000000013476205436011135 500000000000000findent-3.1.1/test/test9.sh0000744000175000017500000000022713324246005012450 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfixed1.f rc=$? . ../postlude exit $rc findent-3.1.1/test/progfree-dos.f.in0000644000175000017500000000514213211022102014175 00000000000000! -I2 -i5 -a1 -b2 -d3 -f4 -m5 -ifree module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum type, public :: mytypea integer i end type mytypea contains function f(x) print *,'abc & def' print *,"abcd& & efgh" return end function #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module program progfree type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm(10) #endif integer x(100) type(mytype) xyz continue do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou& &tine five continue return end findent-3.1.1/test/gedit_help.ref.in0000644000175000017500000000003313210207577014252 00000000000000Usage of findent in gedit findent-3.1.1/test/progfree1.f.try.f.ref.in0000644000175000017500000000010613076534300015323 00000000000000! -i- -I8 -ifree -Rr program programma continue end program programma findent-3.1.1/test/gedit_plugin.ref.in0000644000175000017500000000003013210210002014566 00000000000000[Plugin] Loader=python3 findent-3.1.1/test/postlude.in0000644000175000017500000000000213324141415013220 00000000000000: findent-3.1.1/test/progfixed-dos.f.try.f.ref.in0000644000175000017500000000620513331135626016213 00000000000000! -I0 -i5 -a1 -b2 -d3 -f4 -m5 -ifixed module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum #ifdef foo garbage #endif contains function f(x) print *,'abc 9 def' print *,"abcd 8 efgh" return end function #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module program progfixed type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm(10) #endif integer x(100) type(mytype) xyz continue do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou xtine five continue return end findent-3.1.1/test/progfixedfree.f.try.f.ref.in0000644000175000017500000001224113360372341016266 00000000000000! -Ia -i5 -a1 -b2 -d3 -f4 -m5 -ofree -ifixed module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum contains function f(x) print *,'abc& & def' print *,"abcd& #ifdef foo garbage #endif & efgh" return end function # ifdef usempi function f1(x,m) real x,m # elif defined(useopenmp) function f1(x,m,n) real x,m,n # else function f1(x) real x # endif continue end function f1 end module program progfixed type mytype ! mytype integer i ! a comment ! a floating comment real x end type mytype #ifdef abcde real klm@@@(10) #endif real do(100) integer x(100) type(mytype) xyz character*1000 astring continue a_ap: do i=1,20 continue enddo a_ap end = 10 if ( e .eq. n .and.& &e .eq. m )then npar = npar + 1 endif do i=1,& ! a comment ! a comment &1& ! a comment &0 continue enddo do 123 i=1,2 continue 123 continue print *,'; function ',indx," function " continue 99880 FORMAT (' function ') 99870 FORMAT(1X,'Invalid species name',2X,A8) do i=1,10 do (i) = 5 continue do(i) = 5 continue enddo x = y ! function values continue astring = " ! this& & is& & no comment!" print *,a,b,& &c,d& &,e,f continue print *,a,b,& &c,d& &,e,f loop: do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo loop bbb: block continue end block bbb sc: select case(ja) case(1) continue case(2) continue end select sc continue do i=1,20 block continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical wv: if ( a.eq.b) then continue endif wv if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue !d print *,'debug i=',i ! !D print *,'debug j=',j x = 4 +& ! next line starts with &5 +& ! next line starts with &5+& ! next line starts with &5+& ! next line starts with &5+& ! next line starts with &5+& ! next line starts with &5 return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou& &tine five continue return end subroutine seven a = 1& &+ 2& ! comment 1 &+ 3& ! comment 2 &+ 4& &+ 5& &+ 6 a = 1& &+ 2& ! comment 1 &+ 3& ! comment 2 #ifdef klm &+ 4 syntax error& &+ 5 syntax error& #endif &+ 6 end subroutine multiline_preproc #ifdef one\ two\ three do i=1,10 #elif \ defined(q) do i=1,5 #else do i=1,7 #endif x=x+4 enddo end subroutine omp integer i,j,k !$ integer m,n,& !$ & & !$ & &!comment !$ & & !$ &o,p print *,i,j,k !$ print*, m,n,o,p !$ do 100 i=1,20 !$ do 100 j=1,i !$ continue !$ 100 continue end findent-3.1.1/test/progfixed1.f.try.f.ref.in0000644000175000017500000000013613076426441015512 00000000000000! -i- -I8 -ifixed program programma continue end findent-3.1.1/test/progfreefixed.f.in0000644000175000017500000001204713342770362014463 00000000000000! -Ia -i5 -a1 -b2 -d3 -f4 -m5 -ifree -ofixed module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum contains function f(x) print *,'abc& & def' print *,"abcd& #ifdef foo garbage & #endif & efgh" return end function #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module program progfixed type mytype ! mytype integer i ! a comment ! a floating comment real x end type mytype #ifdef abcde real klm@@@(10) #endif real do(100) integer x(100) type(mytype) xyz character*1000 astring continue a_ap: do i=1,20 continue enddo a_ap end = 10 if ( e .eq. n .and.& & e .eq. m )then npar = npar + 1 endif do i=1,& ! a comment ! a comment &1& ! a comment &0 continue enddo do 123 i=1,2 continue 123 continue print *,'; function ',indx," function " continue 99880 FORMAT (' function ') 99870 FORMAT(1X,'Invalid species name',2X,A8) do i=1,10 do (i) = 5 continue do(i) = 5 continue enddo x = y ! function values continue astring = " ! this& & is& & no comment!" print *,a,b,& & c,d& & ,e,f continue print *,a,b,& & c,d& & ,e,f loop: do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo loop bbb: block continue end block bbb sc: select case(ja) case(1) continue case(2) continue end select sc continue do i=1,20 block continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical wv: if ( a.eq.b) then continue endif wv if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue !d print *,'debug i=',i ! !D print *,'debug j=',j x = 4 +& ! next line starts with &5 +& ! next line starts with &5+& ! next line starts with &5+& ! next line starts with &5+& ! next line starts with &5+& ! next line starts with &5 return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou& &tine five continue return end subroutine seven a = 1& &+ 2 &! comment 1 &+ 3 &! comment 2 &+ 4& &+ 5& &+ 6 a = 1& &+ 2 &! comment 1 &+ 3 &! comment 2 #ifdef klm &+ 4 syntax error& &+ 5 syntax error& #endif &+ 6 end subroutine multiline_preproc #ifdef one\ two\ three do i=1,10 #elif \ defined(q) do i=1,5 #else do i=1,7 #endif x=x+4 enddo end subroutine omp integer i,j,k !$ integer m,n, & !$ o,p print *,i,j,k !$ print*, m,n,o,p !$ do 100 i=1,20 !$ do 100 j=1,i continue !$ 100 enddo end findent-3.1.1/test/test-compile.sh.in0000744000175000017500000000365713357361200014425 00000000000000#!/bin/sh export FINDENT_FLAGS="$TEST_FINDENT_FLAGS" prog="$1" echo "$0: $prog" if test "x$FC" = x ; then gfortran=: echo "will not try to compile fortran sources" else gfortran="$FC" echo "will try to compile fortran sources using $gfortran" fi rc=0 exe=${FINDENT:-../src/findent} $exe -v bprog="`basename $prog`" rm -f "bprog.try.f" echo -n "$bprog: " case "$bprog" in *progfixed*) format="-ffixed-form -ffixed-line-length-none -fd-lines-as-comments" ;; *) format="-ffree-form -ffree-line-length-none" ;; esac $gfortran -fcoarray=single -cpp -fopenmp $format -o prog $prog >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo -n " original program does not compile using: -fcoarray=single -cpp -fopenmp $format -o prog $prog " rc=1 fi parms=`head -n1 < $prog | tr '!' ' '|tr '\r' ' '` $exe $parms < $prog > $bprog.try.f 2>/dev/null if [ -f $prog.try.f.ref ]; then if [ "$WINDOWS" = yes ] ; then case $prog in *dos*) : ;; *) sed -i 's/\r//' $bprog.try.f ;; esac fi cmp -s $bprog.try.f $prog.try.f.ref >/dev/null 2>&1 if [ "$?" -eq 0 ]; then echo -n "OK" else echo -n "WRONG" rc=1 fi echo else echo "cannot compare" rc=1 fi case "$bprog" in *free.f | *free1.f | *free-dos.f) format="-ffree-form -ffree-line-length-none" ;; *) format="-ffixed-form -ffixed-line-length-none -fd-lines-as-comments" ;; esac $gfortran -fcoarray=single -cpp -fopenmp $format -o prog $bprog.try.f >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo " converted program does not compile using: -fcoarray=single -cpp -fopenmp $format -o prog $bprog.try.f " rc=1 fi echo "END TESTING FINDENT rc=$rc" if [ $rc -ne 0 ] ; then echo "If you are sure $PWD/$bprog.try.f is correct:" echo "copy $PWD/$bprog.try.f" echo "to the corresponding .in file in the test directory" echo " and configure again." fi rm -f prog exit $rc findent-3.1.1/test/test1.sh0000744000175000017500000000023213324141415012433 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfixed-dos.f rc=$? . ../postlude exit $rc findent-3.1.1/test/progfixedfree-dos.f.try.f.ref.in0000644000175000017500000000561113333307155017055 00000000000000! -Ia -i5 -a1 -b2 -d3 -f4 -m5 -ofree module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum contains function f(x) print *,'abc& & def' print *,"abcd& & efgh" return end function end module program progfixed type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm@@@(10) #endif integer x(100) type(mytype) xyz character*1000 astring do i=1,& ! a comment ! a comment &1& ! a comment ! a floating comment &0 continue enddo continue astring = " ! this& & is& & no comment!" print *,a,b,& &c,d& &,e,f do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou& &tine five continue return end findent-3.1.1/test/manpage.ref.in0000644000175000017500000000007313246770755013576 00000000000000.\" DO NOT MODIFY THIS FILE! It was created by findent \-H findent-3.1.1/test/progfixedfree.f.in0000644000175000017500000001346313360372173014464 00000000000000! -Ia -i5 -a1 -b2 -d3 -f4 -m5 -ofree -ifixed module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum contains function f(x) print *,'abc 9 def' print *,"abcd #ifdef foo garbage #endif 8 efgh" return end function # ifdef usempi function f1(x,m) real x,m # elif defined(useopenmp) function f1(x,m,n) real x,m,n # else function f1(x) real x # endif continue end function f1 end module program progfixed type mytype ! mytype integer i c a comment ! a floating comment real x end type mytype #ifdef abcde real klm@@@(10) #endif real do(100) integer x(100) type(mytype) xyz character*1000 astring continue a_ap: do i=1,20 continue enddo a_ap end = 10 if ( e .eq. n .and. * e .eq. m )then npar = npar + 1 endif do i=1, c a comment c a comment x 1 c a comment x 0 continue enddo do 123 i=1,2 continue 123 continue print *,'; function ',indx," function " continue 99880 FORMAT (' function ') 99870 FORMAT(1X,'Invalid species name',2X,A8) do i=1,10 do (i) = 5 continue do(i) = 5 continue enddo x = y ! function values continue astring = " ! this x is x no comment!" print *,a,b, x c,d x ,e,f continue print *,a,b, x c,d x ,e,f loop: do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo loop bbb: block continue end block bbb sc: select case(ja) case(1) continue case(2) continue end select sc continue do i=1,20 block continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical wv: if ( a.eq.b) then continue endif wv if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue d print *,'debug i=',i c D print *,'debug j=',j x = 4 + c next line starts with 1 5 + c next line starts with 2 5+ c next line starts with 3 5+ c next line starts with 4 5+ c next line starts with 5 5+ c next line starts with 6 5 return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou xtine five continue return end subroutine seven a = 1 x + 2 ! comment 1 y + 3 ! comment 2 y + 4 y + 5 y + 6 a = 1 x + 2 ! comment 1 y + 3 ! comment 2 #ifdef klm y + 4 syntax error y + 5 syntax error #endif y + 6 end subroutine multiline_preproc #ifdef one\ two\ three do i=1,10 #elif \ defined(q) do i=1,5 #else do i=1,7 #endif x=x+4 enddo end subroutine omp integer i,j,k C$ integer m,n, c$ c$ !comment c$ *$ 1 o,p print *,i,j,k !$ print*, m,n,o,p !$ do 100 i=1,20 !$ do 100 j=1,i c$ continue c$100 continue end findent-3.1.1/test/emacs_findent.ref.in0000644000175000017500000000017513226367012014752 00000000000000;;;; this file contains an interface to use findent within emacs. ;;;; the C-M-q command ("indent function") is redefined to findent-3.1.1/test/progfixedfree-dos.f.in0000644000175000017500000000646713211022103015231 00000000000000! -Ia -i5 -a1 -b2 -d3 -f4 -m5 -ofree module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum contains function f(x) print *,'abc 9 def' print *,"abcd 8 efgh" return end function end module program progfixed type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm@@@(10) #endif integer x(100) type(mytype) xyz character*1000 astring do i=1, c a comment c a comment x 1 c a comment ! a floating comment x 0 continue enddo continue astring = " ! this x is x no comment!" print *,a,b, x c,d x ,e,f do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou xtine five continue return end findent-3.1.1/test/vim_findent.ref.in0000644000175000017500000000012213210207743014442 00000000000000" to enable the findent Fortran indent program: " include this file in ~/.vimrc findent-3.1.1/test/help.ref.in0000644000175000017500000000002213210205014013054 00000000000000findent [options] findent-3.1.1/test/test12.sh0000744000175000017500000000352113365333102012522 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 cat << eof > prog program prog continue ! comment eof cat << eof > expect 3 eof ../doit "-lastusable --last_usable" "-ifree -Ia" "" rc=`expr $rc + $?` ../doit "-lastusable --last_usable" "-ifixed -Ia" "" rc=`expr $rc + $?` cat << eof > prog program prog include "a.inc" include 'b.inc' ?? include 'c.inc' ??include "d.inc" #include "e.inc" # include end eof cat << eof > expect inc a.inc inc b.inc cpp e.inc std f.inc coc c.inc coc d.inc eof ../doit "--deps" "-ifree" "" rc=`expr $rc + $?` cat << eof > prog program prog include "a.inc" include 'b.inc' ?? include 'c.inc' ??include "d.inc" #include "e.inc" # include end eof cat << eof > expect inc a.inc inc b.inc cpp e.inc std f.inc coc c.inc coc d.inc eof ../doit "--deps" "-ifixed" "" rc=`expr $rc + $?` cat << eof > main.f90 module mm integer i end program main use mymod use mm include "file.inc" #include "one.inc" continue end eof cat << eof > sub.f90 module mymod integer x contains subroutine sub continue end subroutine end module module mymod1 interface real module function f(a) real a end function end interface end module eof cat << eof > sub1.f90 submodule (mymod1) mymod2 contains module procedure f f = 10.0 end procedure end submodule eof cat << eof |sort > expect sub1.lo: sub.lo main.lo: sub.lo main.lo: file.inc one.inc eof touch file.inc one.inc # remove '\r' to facilitate dos executable $FINDENT --makefdeps | tr -d '\r' > makefdeps.sh chmod +x makefdeps.sh ./makefdeps.sh -s .lo main.f90 sub.f90 sub1.f90 | tr -d '\r' | sort > result if cmp -s expect result ; then echo "--makefdeps : OK" else echo "--makefdeps : NOT OK" echo "expected:" cat expect echo "got:" cat result rc=`expr $rc + 1` fi . ../postlude exit $rc findent-3.1.1/test/progfree.f.try.f.ref.in0000644000175000017500000002303713474502164015257 00000000000000! -I2 -i5 -a1 -b2 -d3 -f4 -m5 -Rr ! ticket 1 block data pblockdata common /xcomm/ p end block data pblockdata block data qblockdata common /qcomm/ p end block data qblockdata block data rblockdata common /rcomm/ p end block data rblockdata ! submodule and 'module subroutine' not recognized by gfortran 4.8.2 #if 0 MODULE ancestor INTEGER :: i INTERFACE MODULE SUBROUTINE sub1(arg1) INTEGER :: arg1 end subroutine sub1 MODULE SUBROUTINE sub2(arg2) INTEGER :: arg2 end subroutine sub2 END INTERFACE end module ancestor SUBMODULE (ancestor) descendant INTEGER :: j CONTAINS MODULE SUBROUTINE sub1(arg1) INTEGER :: arg1 arg1 = 1 i = 2 j = 3 end subroutine sub1 module function fun1(arg1) integer :: arg1 fun1 = 10 end function fun1 MODULE PROCEDURE sub2 arg2 = 1 end procedure sub2 end submodule descendant #endif module some_module type :: onetype integer i end type onetype type name character(22) :: n end type complex ccc interface myinterface subroutine tx(a,b) real a,b end subroutine tx end interface interface anotherinterface module procedure funccc ! ! trata module procedure funcccc end interface abstract interface character*8 recursive function func(x) real :: x end function func end interface contains character*(8) impure function funcc(x) real :: x funcc = 'a' end function funcc integer(kind=4) pure function funccc(x) real, intent(in) :: x funccc = 2 end function funccc type(onetype) function funcccc(x) type(onetype) :: x funcccc = x end function funcccc integer elemental function funcx(x) integer, intent(in) :: x funcx = x end function funcx #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) /* Test for GCC >= 4.8.0 */ #if GCC_VERSION >= 40800 subroutine handleP(p) class(*), intent(in) :: p select type(p) type is (character(len=*)) write(*,*) len(p), ': ', p class is (name) write(*,*) len(p%n), ': ', p%n class default write(*,*) 'Unknown type' end select end subroutine handleP #endif double complex function compx(x) double complex x compx = x end function compx complex recursive function compxx(x) complex x compxx = x end function compxx real function alpha_integral_function(x) implicit none real:: x alpha_integral_function = 0 end function alpha_integral_function end module some_module ! end of this module ! /ticket 1 module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum type, public :: mytypea integer i end type mytypea integer, parameter, public :: i8=selected_int_kind(16) contains function f(x) print *,'abc & def' print *,"abcd& & efgh" return end function f integer(kind=i8) function func1(a, b) integer(kind=i8), intent(in) :: a, b func1 = a + b end function func1 integer(kind=i8)function funcx(a, b) integer(kind=i8), intent(in) :: a, b funcx = a + b end function funcx #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module m1 subroutine ticket7 integer :: int real :: float logical :: bool #define COND \ if (float > 1.) then; \ if (bool) write(*, *) 'nope'; \ end if COND if (.true.) then int = int + 1 end if end subroutine ticket7 program progfree type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm(10) #endif integer x(100) type(mytype) xyz real do(1000) continue loop: do i=1,20 continue enddo loop loop1 : do , i=1,20 continue enddo loop1 end = 10 do while(i.eq.0) continue enddo do , while(i.eq.0) continue enddo do concurrent(i=1:10) x(i) = 0 enddo do , concurrent(i=1:10) x(i) = 0 enddo if ( a.eq.b .and. & c.eq.r) then n=n+1 endif iff: if (a.eq.b) then continue endif iff lsele: select case(i) case(10) continue case(11) continue case default continue end select lsele lblock: block continue end block lblock x = 3.0*a + 4*b + & & 2 *c + y assign 90 to i do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo do i=1,10; do j=3,5; continue; enddo; enddo do i=1,7; do j=2,2 continue enddo continue enddo do ; enddo critical x=y do(3) = 123 endcritical critical x=y endcritical critical x=y end critical if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall hop:forall(i=1:4) ! forall x(i)=6 end forall hop where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program progfree subroutine one(a) continue entry myentry continue return end subroutine one subroutine two(a) continue a = 3 + &! comment1 4 + & ! comment 2 5 a = 3 + & ! test preprocessor within continuation 4 + & #ifdef abc this would cause a compilation error & #endif 5 return end subroutine two subroutine three(a) do 10 i=1,4 do 5 j=1,2 continue 5 enddo 10 enddo typecode = 9 continue return end subroutine three subroutine four(a) continue return end subroutine four subrou& &tine five continue return end subroutine five subroutine seven a = 1& &+ 2 &! comment 1 &+ 3 &! comment 2 &+ 4& &+ 5& &+ 6 a = 1& &+ 2 &! comment 1 &+ 3 &! comment 2 #ifdef klm &+ 4 syntax error& &+ 5 syntax error& #endif &+ 6 end subroutine seven subroutine multiline_preproc #ifdef one\ two\ three do i=1,10 #elif \ defined(q) do i=1,5 #else do i=1,7 #endif x=x+4 enddo end subroutine multiline_preproc subroutine nok implicit none type domain_data real, dimension(:, :), allocatable :: temperature integer:: ibound, icopy, todomain end type type(domain_data), dimension(2), target :: dom allocate(dom(1) % temperature(20, 20)) dom(1) % temperature = 0. dom(1) % temperature(:, 1) = 1. end subroutine nok ! testing with findentfix: subroutine testfix implicit none integer i,j,k do i=1,10 ! comment continue do j=1,6 continue ! findentfix: do do k=1,7 continue enddo ! FINDENTFIX: enddo enddo continue enddo end subroutine testfix subroutine omp integer i,j,k !$ integer m,n, & !$ o,p print *,i,j,k !$ print*, m,n,o,p !$ do i=1,20 continue !$ enddo end subroutine omp subroutine label_excercise do 010& &0 i=1,10 continue 01& &00 continue continue 120 do i=1,10 continue enddo end subroutine label_excercise findent-3.1.1/test/Makefile.am0000644000175000017500000000077713475167131013122 00000000000000TESTS = \ test1.sh test2.sh test3.sh test4.sh test5.sh test6.sh \ test7.sh test8.sh test9.sh test10.sh test11.sh test12.sh \ test13.sh test14.sh test15.sh test16.sh test17.sh test18.sh \ test19.sh test20.sh test21.sh AM_TESTS_ENVIRONMENT = ./init.sh ; EXTRA_DIST = $(TESTS) export SRCDIR = $(top_srcdir) export FC if MAKEWIN export WINDOWS = yes else export WINDOWS = no endif if USEESOPE export ESOPE = yes else export ESOPE = no endif clean-local: rm -rf *.tmpdir findent-3.1.1/test/makefdeps.ref.in0000644000175000017500000000003413363350376014113 00000000000000#!/bin/bash # - makefdeps - findent-3.1.1/test/test20.sh0000744000175000017500000007202613373524142012534 00000000000000#!/bin/sh # vim: indentexpr=none # tests according to "Modern Fortran explaned" ISBN 978-0-19-881188-6 if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 cat << eof > prog ! if statement and if construct. pp 55-57 program p_if logical a,b if(a) continue if(a) then continue endif if (a) then continue else continue endif if (a) then continue elseif (b) then continue else continue endif l1: if(a) then continue endif l1 l2: if (a) then continue else l2 continue endif l2 l3: if (a) then continue else if (b) then l3 continue else l3 continue endif l3 continue end eof cat << eof > expect ! if statement and if construct. pp 55-57 program p_if logical a,b if(a) continue if(a) then continue endif if (a) then continue else continue endif if (a) then continue elseif (b) then continue else continue endif l1: if(a) then continue endif l1 l2: if (a) then continue else l2 continue endif l2 l3: if (a) then continue else if (b) then l3 continue else l3 continue endif l3 continue end eof ../doit "-f5 --indent-if=5 --indent_if=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! case construct pp 57-59 program p_case integer i select case (i) case (3) continue case (4) continue case default continue end select l1: select case (i) case (3) l1 continue case (4) l1 continue case default l1 continue end select l1 end eof cat << eof > expect ! case construct pp 57-59 program p_case integer i select case (i) case (3) continue case (4) continue case default continue end select l1: select case (i) case (3) l1 continue case (4) l1 continue case default l1 continue end select l1 end eof ../doit "-s5 --indent-select=5 --indent_select=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! do construct pp 59-63 program p_do do i=1,10 continue enddo l1: do i=1,10,2 continue enddo l1 do , i=1,10 continue end do l2: do, i=1,10,2 continue end do l2 continue end eof cat << eof > expect ! do construct pp 59-63 program p_do do i=1,10 continue enddo l1: do i=1,10,2 continue enddo l1 do , i=1,10 continue end do l2: do, i=1,10,2 continue end do l2 continue end eof ../doit "-d5 --indent-do=5 --indent_do=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Main program pp 70-71 program p_main continue end program main program p_main1 continue end program program p_main2 continue contains subroutine mysub continue end end eof cat << eof > expect ! Main program pp 70-71 program p_main continue end program main program p_main1 continue end program program p_main2 continue contains subroutine mysub continue end end eof ../doit "-r5 --indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! External subprograms pp 72-73 subroutine p_sub1 continue contains subroutine mysub continue end end subroutine p_sub1 real function myfunc() continue contains subroutine asub(x) continue end subroutine asub end function myfunc eof cat << eof > expect ! External subprograms pp 72-73 subroutine p_sub1 continue contains subroutine mysub continue end end subroutine p_sub1 real function myfunc() continue contains subroutine asub(x) continue end subroutine asub end function myfunc eof ../doit "-r5 --indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Modules pp 73-75 module p_module integer i contains subroutine mysub continue end subroutine mysub end module p_module1 integer j contains real function myfunc(x) continue myfunc=x end function end module p_module1 module p_module2 integer k contains real function afunc(x) continue myfunc=x*k end function end module eof cat << eof > expect ! Modules pp 73-75 module p_module integer i contains subroutine mysub continue end subroutine mysub end module p_module1 integer j contains real function myfunc(x) continue myfunc=x end function end module p_module1 module p_module2 integer k contains real function afunc(x) continue myfunc=x*k end function end module eof ../doit "-m5 --indent-module=5 --indent_module=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Arguments of procedures pp 76-83 subroutine s_arguments(x,y) integer, intent(inout) :: x,y continue end integer function f_arguments(x,y,z) integer x,y,z f_arguments = x+y+z end eof cat << eof > expect ! Arguments of procedures pp 76-83 subroutine s_arguments(x,y) integer, intent(inout) :: x,y continue end integer function f_arguments(x,y,z) integer x,y,z f_arguments = x+y+z end eof ../doit "-r5 --indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Explicit and implicit interfaces pp 83-84 program p_interface interface inter subroutine s(x) real x end end interface inter interface subroutine y(x) real x end end interface end program eof cat << eof > expect ! Explicit and implicit interfaces pp 83-84 program p_interface interface inter subroutine s(x) real x end end interface inter interface subroutine y(x) real x end end interface end program eof ../doit "-j5 --indent-interface=5 --indent_interface=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Direct recursion pp 92-93 recursive function f_recur(n) result(i) integer i,n i = n end function eof cat << eof > expect ! Direct recursion pp 92-93 recursive function f_recur(n) result(i) integer i,n i = n end function eof ../doit "-r5 --indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Overloading and generic interfaces pp 94-99 program p_overload interface doit real function doit1(x) real x end function doit1 real function doit2(x,y) real x,y end function doit2 end interface doit interface operator(*) logical function myand(a,b) logical, intent(in) :: a,b end function myand end interface operator(*) end eof cat << eof > expect ! Overloading and generic interfaces pp 94-99 program p_overload interface doit real function doit1(x) real x end function doit1 real function doit2(x,y) real x,y end function doit2 end interface doit interface operator(*) logical function myand(a,b) logical, intent(in) :: a,b end function myand end interface operator(*) end eof ../doit "-j5 --indent-interface=5 --indent_interface=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The subroutine and function statements pp 99-101 program p_subroutine end integer(4), pure elemental function myfunc(x) integer, intent(in) :: x myfunc = x end function pure function pfunc(x) result(y) real*8, intent(in) :: x real*8 y y=x end elemental subroutine mysub(i) integer, intent(inout) :: i i = 2*i continue end subroutine mysub pure subroutine psub(x,y) real, intent(inout) :: x real, intent(in) :: y x = x*y continue end eof cat << eof > expect ! The subroutine and function statements pp 99-101 program p_subroutine end integer(4), pure elemental function myfunc(x) integer, intent(in) :: x myfunc = x end function pure function pfunc(x) result(y) real*8, intent(in) :: x real*8 y y=x end elemental subroutine mysub(i) integer, intent(inout) :: i i = 2*i continue end subroutine mysub pure subroutine psub(x,y) real, intent(inout) :: x real, intent(in) :: y x = x*y continue end eof ../doit "-r5 --indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The where statement and construct pp 123-126 program p_where real a(10) where(a /= 0) a=1/a where (a /= 0) a=1/a end where where (a /= 0) a=1/a elsewhere a=9 end where where (a == 0) a = 1 elsewhere (a > -1) a=0.5 elsewhere (a > 4) a=3 end where l1: where (a /= 0) a=1/a end where l1 l2: where (a == 0) a = 1 elsewhere (a /= 24 )l2 a=0.5 elsewhere (a > 4) l2 a=3 end where l2 l3:where (a /= 0) a=1/a elsewhere l3 a=9 end where l3 end eof cat << eof > expect ! The where statement and construct pp 123-126 program p_where real a(10) where(a /= 0) a=1/a where (a /= 0) a=1/a end where where (a /= 0) a=1/a elsewhere a=9 end where where (a == 0) a = 1 elsewhere (a > -1) a=0.5 elsewhere (a > 4) a=3 end where l1: where (a /= 0) a=1/a end where l1 l2: where (a == 0) a = 1 elsewhere (a /= 24 )l2 a=0.5 elsewhere (a > 4) l2 a=3 end where l2 l3:where (a /= 0) a=1/a elsewhere l3 a=9 end where l3 end eof ../doit "-w5 --indent-where=5 --indent_where=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Impure elemental procedures pp 128-129 program p_impure contains impure elemental integer function myfunc(x) integer, intent(in) :: x myfunc = x+1 end function end program eof cat << eof > expect ! Impure elemental procedures pp 128-129 program p_impure contains impure elemental integer function myfunc(x) integer, intent(in) :: x myfunc = x+1 end function end program eof ../doit "-r5 --indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The do concurrent construct program p_doconcurrent real:: a(10) do concurrent(i=1:10) a(i) = 8 enddo l1: do concurrent(i=1:10) a(i) = 8 enddo l1 do, concurrent(i=1:10) a(i) = 8 enddo l2: do, concurrent(i=1:10) a(i) = 8 enddo l2 end eof cat << eof > expect ! The do concurrent construct program p_doconcurrent real:: a(10) do concurrent(i=1:10) a(i) = 8 enddo l1: do concurrent(i=1:10) a(i) = 8 enddo l1 do, concurrent(i=1:10) a(i) = 8 enddo l2: do, concurrent(i=1:10) a(i) = 8 enddo l2 end eof ../doit "-d5 --indent-do=5 --indent_do=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The block construct pp 168-170 program p_block block continue end block l1:block continue end block l1 end eof cat << eof > expect ! The block construct pp 168-170 program p_block block continue end block l1:block continue end block l1 end eof ../doit "-b5 --indent-block=5 --indent_block=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Derived-type definitions pp 173-177 module p_type type,public :: mytype integer a(10) end type mytype type :: atype integer a(10) end type type :: btype integer a(10) end type btype type anothertype integer x(10) end type end eof cat << eof > expect ! Derived-type definitions pp 173-177 module p_type type,public :: mytype integer a(10) end type mytype type :: atype integer a(10) end type type :: btype integer a(10) end type btype type anothertype integer x(10) end type end eof ../doit "-t5 --indent-type=5 --indent_type=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Advanced type parameter features program p_advancedtype type mytype(k,l) integer, kind :: k integer, len :: l real(k) :: a(l) end type mytype type(mytype(selected_real_kind(6),10)) :: x x%a(2) = 9 end eof cat << eof > expect ! Advanced type parameter features program p_advancedtype type mytype(k,l) integer, kind :: k integer, len :: l real(k) :: a(l) end type mytype type(mytype(selected_real_kind(6),10)) :: x x%a(2) = 9 end eof ../doit "-t5 --indent-type=5 --indent_type=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Abstract interfaces pp 285-287 program p_abstractinterfaces abstract interface integer function f(x,y) integer x,y end function end interface end eof cat << eof > expect ! Abstract interfaces pp 285-287 program p_abstractinterfaces abstract interface integer function f(x,y) integer x,y end function end interface end eof ../doit "-j5 --indent-interface=5 --indent_interface=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Type extension pp 291-293 program p_typeextension type x integer a end type x type, extends(x) :: y integer b end type y end eof cat << eof > expect ! Type extension pp 291-293 program p_typeextension type x integer a end type x type, extends(x) :: y integer b end type y end eof ../doit "-t5 --indent-type=5 --indent_type=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The associate construct pp 300-301 program p_associate implicit none type atype real x end type atype type(atype) :: a associate(x => a%x) x=10 end associate l1: associate(x => a%x) x=10 end associate l1 end eof cat << eof > expect ! The associate construct pp 300-301 program p_associate implicit none type atype real x end type atype type(atype) :: a associate(x => a%x) x=10 end associate l1: associate(x => a%x) x=10 end associate l1 end eof ../doit "-a5 --indent-associate=5 --indent_associate=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The select type construct module mymod implicit none type t real x end type type u integer i end type type, extends(u) :: w integer j end type end module mymod program p_selecttype use mymod implicit none type(t), target :: a type(u), target :: b type(w), target :: c class(*), pointer :: h a%x = 11 b%i = -10 c%i = 120 h => a call doit(h) h => b call doit(h) h => c call doit(h) contains subroutine doit(h) class(*), pointer :: h select type(h) type is (t) print *,h%x type is(u) print *,h%i class is (w) print *,h%i class default print *,'ai!' end select l1: select type(h) type is (t) l1 print *,h%x type is(u) l1 print *,h%i class is (w) l1 print *,h%i class default l1 print *,'ai!' end select l1 end end eof cat << eof > expect ! The select type construct module mymod implicit none type t real x end type type u integer i end type type, extends(u) :: w integer j end type end module mymod program p_selecttype use mymod implicit none type(t), target :: a type(u), target :: b type(w), target :: c class(*), pointer :: h a%x = 11 b%i = -10 c%i = 120 h => a call doit(h) h => b call doit(h) h => c call doit(h) contains subroutine doit(h) class(*), pointer :: h select type(h) type is (t) print *,h%x type is(u) print *,h%i class is (w) print *,h%i class default print *,'ai!' end select l1: select type(h) type is (t) l1 print *,h%x type is(u) l1 print *,h%i class is (w) l1 print *,h%i class default l1 print *,'ai!' end select l1 end end eof ../doit "-s5 --indent-select=5 --indent_select=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Type and contains p 316 module mymod type mytype integer i contains procedure sub end type mytype contains subroutine sub(this) class(mytype) :: this continue end end module mymod program p_typecontains use mymod type(mytype) t end eof cat << eof > expect ! Type and contains p 316 module mymod type mytype integer i contains procedure sub end type mytype contains subroutine sub(this) class(mytype) :: this continue end end module mymod program p_typecontains use mymod type(mytype) t end eof ../doit "-t5 --indent-type=5 --indent_type=5 " "-C4 -ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Deferred bindings and abstract types pp 312-313 module mymod integer i type, abstract :: mytype contains procedure (sub), deferred, pass :: x end type mytype abstract interface subroutine sub(p) import mytype class(mytype) :: p end end interface type, abstract :: mt contains procedure(op), deferred :: plus generic :: operator(+) => plus end type mt abstract interface function op(a,b) result(r) import mt class(mt), intent(in) :: a,b class (mt), allocatable :: r end function end interface end module eof cat << eof > expect ! Deferred bindings and abstract types pp 312-313 module mymod integer i type, abstract :: mytype contains procedure (sub), deferred, pass :: x end type mytype abstract interface subroutine sub(p) import mytype class(mytype) :: p end end interface type, abstract :: mt contains procedure(op), deferred :: plus generic :: operator(+) => plus end type mt abstract interface function op(a,b) result(r) import mt class(mt), intent(in) :: a,b class (mt), allocatable :: r end function end interface end module eof ../doit "-t5 --indent-type=5 --indent_type=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Finalization pp 313-314 module mymod type mytype integer i contains final :: doit end type mytype contains subroutine doit(x) type(mytype) :: x end subroutine doit end module eof cat << eof > expect ! Finalization pp 313-314 module mymod type mytype integer i contains final :: doit end type mytype contains subroutine doit(x) type(mytype) :: x end subroutine doit end module eof ../doit "-t5 --indent-type=5 --indent_type=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Submodules pp 322-324 module base integer i interface integer module function square(i) integer i end function square end interface end module base submodule (base) deriv contains module procedure square square = i*i end procedure square end submodule deriv eof cat << eof > expect ! Submodules pp 322-324 module base integer i interface integer module function square(i) integer i end function square end interface end module base submodule (base) deriv contains module procedure square square = i*i end procedure square end submodule deriv eof ../doit "-m5 --indent-module=5 --indent_module=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Critical sections pp 340-341 program p_critical critical continue end critical l1: critical continue end critical l1 end eof cat << eof > expect ! Critical sections pp 340-341 program p_critical critical continue end critical l1: critical continue end critical l1 end eof ../doit "-x5 --indent-critical=5 --indent_critical=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Interoperability with C pp 367-381 module mymod type, bind(c) :: mytype integer i end type enum, bind(c) enumerator a=1, b=2 enumerator c end enum contains function f() bind(c) continue end function f su broutine sub bind(c) continue end subroutine sub1() bind(c) continue end end module eof cat << eof > expect ! Interoperability with C pp 367-381 module mymod type, bind(c) :: mytype integer i end type enum, bind(c) enumerator a=1, b=2 enumerator c end enum contains function f() bind(c) continue end function f su broutine sub bind(c) continue end subroutine sub1() bind(c) continue end end module eof ../doit "-m5 --indent-module=5 --indent_module=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Change team construct pp 385-388 ! not compiled program p_team use iso_fortran_env type(team_type) myteam change team(myteam) continue end team l1: change team(myteam) continue end team (stat=i)l1 critical continue end critical critical (stat=i) continue end critical l2:critical (stat=i) continue end critical l2 end eof cat << eof > expect ! Change team construct pp 385-388 ! not compiled program p_team use iso_fortran_env type(team_type) myteam change team(myteam) continue end team l1: change team(myteam) continue end team (stat=i)l1 critical continue end critical critical (stat=i) continue end critical l2:critical (stat=i) continue end critical l2 end eof ../doit "-r5--indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The include line p 447 program p_include do i=1,10 include 'file.inc' include "file2.inc" continue enddo end eof cat << eof > expect ! The include line p 447 program p_include do i=1,10 include 'file.inc' include "file2.inc" continue enddo end eof ../doit "-ifree" "-ifree -Ia" rc=`expr $rc + $?` ../doit "--include_left=0 --include-left=0" "-ifree -Ia" rc=`expr $rc + $?` cat << eof > expect ! The include line p 447 program p_include do i=1,10 include 'file.inc' include "file2.inc" continue enddo end eof ../doit "--include_left=1 --include-left=1" "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The include line p 447 program p_include do i=1,10 include 'file.inc' include "file2.inc" continue enddo end eof cat << eof > expect ! The include line p 447 program p_include do i=1,10 include 'file.inc' include "file2.inc" continue enddo end eof ../doit "-ifixed" "-ifixed -Ia" rc=`expr $rc + $?` ../doit "--include_left=0 --include-left=0" "-ifixed -Ia" rc=`expr $rc + $?` cat << eof > expect ! The include line p 447 program p_include do i=1,10 include 'file.inc' include "file2.inc" continue enddo end eof ../doit "--include_left=1 --include-left=1" "-ifixed -Ia" rc=`expr $rc + $?` cat << eof > prog ! The do while statement pp 447-448 program p_dowhile logical l do while (l) continue end do l1: do while(l) continue enddo l1 do 10 while(l) continue 10 continue do 20, while(l) continue 20 continue end eof cat << eof > expect ! The do while statement pp 447-448 program p_dowhile logical l do while (l) continue end do l1: do while(l) continue enddo l1 do 10 while(l) continue 10 continue do 20, while(l) continue 20 continue end eof ../doit "-r5--indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Character length specification with * p 458 character*10 function f() continue f='abc' end eof cat << eof > expect ! Character length specification with * p 458 character*10 function f() continue f='abc' end eof ../doit "-r5--indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Entry statement pp 462-463 subroutine sub integer i continue entry sub1 continue end eof cat << eof > expect ! Entry statement pp 462-463 subroutine sub integer i continue entry sub1 continue end eof ../doit "-e5 --indent-entry=5 --indent_entry=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Forall statement and construct pp 463-466 program p_forall integer a(20) forall(i=1:20) a(i) = 3*i ! statement forall(i=1:20) ! construct a(i) = 4*i end forall end eof cat << eof > expect ! Forall statement and construct pp 463-466 program p_forall integer a(20) forall(i=1:20) a(i) = 3*i ! statement forall(i=1:20) ! construct a(i) = 4*i end forall end eof ../doit "-F5 --indent-forall=5 --indent_forall=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The block data program unit block data common // i data i /1/ end block data eof cat << eof > expect ! The block data program unit block data common // i data i /1/ end block data eof ../doit "-r5 --indent-procedure=5 --indent_procedure=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! The labelled do construct program p_dolabel do 10 i=1,5 continue 10 enddo do 20 i=1,5 continue do 15 j=1,5 continue 15 continue 20 continue do 50 i=1,5 do 50 j=1,5 continue 50 continue end eof cat << eof > expect ! The labelled do construct program p_dolabel do 10 i=1,5 continue 10 enddo do 20 i=1,5 continue do 15 j=1,5 continue 15 continue 20 continue do 50 i=1,5 do 50 j=1,5 continue 50 continue end eof ../doit "-d5 --indent-do=5 --indent_do=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Arithmetic if statement program p_aritif i = 2 if(i) 10,20,30 10 continue 20 continue 30 continue end eof cat << eof > expect ! Arithmetic if statement program p_aritif i = 2 if(i) 10,20,30 10 continue 20 continue 30 continue end eof ../doit "-d5 --indent-do=5 --indent_do=5 " "-ifree -Ia" rc=`expr $rc + $?` cat << eof > prog ! Shared do-loop termination program p_shdolote do 20, i=1,8 do 20 ,j=1,6 continue 20 print *,i*j do 30, i=1,8 do 30, j=1,6 continue 30 continue end eof cat << eof > expect ! Shared do-loop termination program p_shdolote do 20, i=1,8 do 20 ,j=1,6 continue 20 print *,i*j do 30, i=1,8 do 30, j=1,6 continue 30 continue end eof ../doit "-d5 --indent-do=5 --indent_do=5 " "-ifree -Ia" rc=`expr $rc + $?` . ../postlude exit $rc findent-3.1.1/test/vim_help.ref.in0000644000175000017500000000015013210211124013730 00000000000000To enable findent for vim: find out in which directory the configuration files for vim are situated, findent-3.1.1/test/esope.f.in0000644000175000017500000000104213474764320012741 00000000000000! program esope ! 'normal' fortran compilers do not understand esope syntax #if 0 segment, test continue integer t endsegment SEGMENT, test continue integer t ENDSEGMENT 10 segment test1 30 continue endsegment segment continue segment = 10 continue segment tra = 10 continue segini,val segini ,val segsup , val #endif end findent-3.1.1/test/prelude.in0000644000175000017500000000040513246747157013052 00000000000000rp() { # poor man's realpath cd "$1" pwd } export FINDENT=`rp ../src`/findent export WFINDENT=`rp ../scripts`/wfindent if [ "$WINDOWS" = yes ]; then FINDENT=$FINDENT.exe fi dir=`basename $0`.tmpdir rm -rf $dir mkdir $dir cd $dir # vim: filetype=sh findent-3.1.1/test/test21.sh0000744000175000017500000000031013474765611012532 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi if test xyes = "x$ESOPE" ; then ../test-compile.sh ../esope.f rc=$? else rc=0 fi . ../postlude exit $rc findent-3.1.1/test/test18.sh0000744000175000017500000000144513343220412012526 00000000000000#!/bin/sh # test wfindent if test -e prelude ; then . ./prelude else unset FINDENT . ./debian/tests/prelude fi cat < prog1.f || exit 1 program prog1 continue end program prog1 eof cat << eof > prog2.f || exit 1 module modprog2 integer i end module program prog2 use modprog2 continue end program prog2 eof cat << eof > prog1.f.ref || exit 1 program prog1 continue end program prog1 eof cat << eof > prog2.f.ref || exit 1 module modprog2 integer i end module program prog2 use modprog2 continue end program prog2 eof $WFINDENT -i5 prog1.f prog2.f sed -i 's/\r//' prog1.f sed -i 's/\r//' prog2.f for i in 1 2 ; do cmp -s prog$i.f prog$i.f.ref if [ $? -ne 0 ] ; then echo "prog$i.f and prog$i.f.ref are not equal" exit 1 fi done . ../postlude exit 0 findent-3.1.1/test/init.sh.in0000755000175000017500000000031013475073120012746 00000000000000#!/bin/bash # if checking windows executables, we start the wineserver here # and make it persistent for some seconds to speed things up if test xyes = "x$WINDOWS" ; then wineserver -p10 fi exit 0 findent-3.1.1/test/test2.sh0000744000175000017500000000022613324141415012437 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfixed.f rc=$? . ../postlude exit $rc findent-3.1.1/test/test6.sh0000744000175000017500000000023113324246005012440 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfree-dos.f rc=$? . ../postlude exit $rc findent-3.1.1/test/doit.in0000744000175000017500000000063013230124003012316 00000000000000#!/bin/sh rc=0 flags=$1 eflags=$2 comment=$3 exe=$FINDENT for flag in $flags ; do cat prog | $exe $eflags $flag | tr -d '\r' > result if cmp -s expect result ; then echo "$flag : OK $comment" else echo "$flag : NOT OK $comment" echo "expected:" cat expect echo "got:" cat result echo "program is:" cat prog rc=`expr $rc + 1` fi done exit $rc findent-3.1.1/test/test19.sh0000744000175000017500000000434113324246005012532 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 doit=../doit cat << eof > prog program main #define foo \\ bar \\ a contains #ifdef foo \\ bar \\ a subroutine sub() #elif bar==1 subroutine sub(a) #else subroutine sub(a,b) #endif continue end subroutine end program eof cat << eof > expect program main #define foo \\ bar \\ a contains #ifdef foo \\ bar \\ a subroutine sub() #elif bar==1 subroutine sub(a) #else subroutine sub(a,b) #endif continue end subroutine end program eof $doit "-ifixed --input_format=fixed" "-I0 -i3" "for fixed input" rc=`expr $rc + $?` cat << eof > expect program main #define foo \\ bar \\ a contains #ifdef foo \\ bar \\ a subroutine sub() #elif bar==1 subroutine sub(a) #else subroutine sub(a,b) #endif continue end subroutine end program eof $doit "-ifree --input_format=free" "-I0 -i3" "for free input" rc=`expr $rc + $?` cat << eof > prog program main ??logical::foo = .true. & ?? .or. & ?? .or. .false. contains ??if(foo) & ?? then subroutine sub() ??else if(bar) then subroutine sub(a) ??else subroutine sub(a,b) ??endif continue end subroutine ?? logical a= & ?? .true. end program eof cat << eof > expect program main ??logical::foo = .true. & ?? .or. & ?? .or. .false. contains ??if(foo) & ?? then subroutine sub() ??else if(bar) then subroutine sub(a) ??else subroutine sub(a,b) ??endif continue end subroutine ?? logical a= & ?? .true. end program eof $doit "-ifixed --input_format=fixed" "-I0 -i3" "for fixed input" rc=`expr $rc + $?` cat << eof > expect program main ??logical::foo = .true. & ?? .or. & ?? .or. .false. contains ??if(foo) & ?? then subroutine sub() ??else if(bar) then subroutine sub(a) ??else subroutine sub(a,b) ??endif continue end subroutine ?? logical a= & ?? .true. end program eof $doit "-ifree --input_format=free" "-I0 -i3" "for free input" rc=`expr $rc + $?` . ../postlude exit $rc findent-3.1.1/test/test17.sh0000744000175000017500000000106513363346074012542 00000000000000#!/bin/sh #test output of help-texts if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi exe=$FINDENT rc=0 for f in vim_help gedit_help vim_fortran vim_findent \ gedit_external gedit_plugin gedit_plugin_py \ emacs_help emacs_findent readme makefdeps; do flag="--$f" $exe $flag | head -n 2 | tr -d '\r' > $f.try cmp -s ../$f.ref $f.try r=$? if [ $r -eq 0 ] ; then echo "$flag : works OK" else echo "$flag : works NOT OK, compare $f.try and $f.ref" fi rc=`expr $rc + $r` done . ../postlude exit $rc findent-3.1.1/test/test5.sh0000744000175000017500000000023213324246005012440 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfixedfree.f rc=$? . ../postlude exit $rc findent-3.1.1/test/emacs_help.ref.in0000644000175000017500000000003313226367257014257 00000000000000Usage of findent in emacs findent-3.1.1/test/gedit_plugin_py.ref.in0000644000175000017500000000005213210210024015306 00000000000000# -*- coding: utf-8 -*- # Findent plugin findent-3.1.1/test/Makefile.in0000644000175000017500000011303613476205425013124 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_bison.m4 \ $(top_srcdir)/m4/ax_prog_flex.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = prelude postlude test-compile.sh doit init.sh \ progfixed-dos.f.try.f.ref progfixed-dos.f \ progfixed.f.try.f.ref progfixed.f progfixed1.f.try.f.ref \ progfixed1.f progfixedfree-dos.f.try.f.ref progfixedfree-dos.f \ progfixedfree.f.try.f.ref progfixedfree.f \ progfree-dos.f.try.f.ref progfree-dos.f progfree.f.try.f.ref \ progfree.f progfree1.f.try.f.ref progfree1.f \ progfreefixed.f.try.f.ref progfreefixed.f esope.f.try.f.ref \ esope.f emacs_findent.ref emacs_help.ref gedit_external.ref \ gedit_help.ref gedit_plugin.ref gedit_plugin_py.ref help.ref \ makefdeps.ref manpage.ref readme.ref vim_findent.ref \ vim_fortran.ref vim_help.ref CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/doit.in \ $(srcdir)/emacs_findent.ref.in $(srcdir)/emacs_help.ref.in \ $(srcdir)/esope.f.in $(srcdir)/esope.f.try.f.ref.in \ $(srcdir)/gedit_external.ref.in $(srcdir)/gedit_help.ref.in \ $(srcdir)/gedit_plugin.ref.in $(srcdir)/gedit_plugin_py.ref.in \ $(srcdir)/help.ref.in $(srcdir)/init.sh.in \ $(srcdir)/makefdeps.ref.in $(srcdir)/manpage.ref.in \ $(srcdir)/postlude.in $(srcdir)/prelude.in \ $(srcdir)/progfixed-dos.f.in \ $(srcdir)/progfixed-dos.f.try.f.ref.in \ $(srcdir)/progfixed.f.in $(srcdir)/progfixed.f.try.f.ref.in \ $(srcdir)/progfixed1.f.in $(srcdir)/progfixed1.f.try.f.ref.in \ $(srcdir)/progfixedfree-dos.f.in \ $(srcdir)/progfixedfree-dos.f.try.f.ref.in \ $(srcdir)/progfixedfree.f.in \ $(srcdir)/progfixedfree.f.try.f.ref.in \ $(srcdir)/progfree-dos.f.in \ $(srcdir)/progfree-dos.f.try.f.ref.in $(srcdir)/progfree.f.in \ $(srcdir)/progfree.f.try.f.ref.in $(srcdir)/progfree1.f.in \ $(srcdir)/progfree1.f.try.f.ref.in \ $(srcdir)/progfreefixed.f.in \ $(srcdir)/progfreefixed.f.try.f.ref.in $(srcdir)/readme.ref.in \ $(srcdir)/test-compile.sh.in $(srcdir)/vim_findent.ref.in \ $(srcdir)/vim_fortran.ref.in $(srcdir)/vim_help.ref.in \ $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC = @FC@ FCFLAGS = @FCFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MINGW32 = @MINGW32@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_FC = @ac_ct_FC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ make_include = @make_include@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ TESTS = \ test1.sh test2.sh test3.sh test4.sh test5.sh test6.sh \ test7.sh test8.sh test9.sh test10.sh test11.sh test12.sh \ test13.sh test14.sh test15.sh test16.sh test17.sh test18.sh \ test19.sh test20.sh test21.sh AM_TESTS_ENVIRONMENT = ./init.sh ; EXTRA_DIST = $(TESTS) all: all-am .SUFFIXES: .SUFFIXES: .log .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): prelude: $(top_builddir)/config.status $(srcdir)/prelude.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ postlude: $(top_builddir)/config.status $(srcdir)/postlude.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ test-compile.sh: $(top_builddir)/config.status $(srcdir)/test-compile.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ doit: $(top_builddir)/config.status $(srcdir)/doit.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ init.sh: $(top_builddir)/config.status $(srcdir)/init.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfixed-dos.f.try.f.ref: $(top_builddir)/config.status $(srcdir)/progfixed-dos.f.try.f.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfixed-dos.f: $(top_builddir)/config.status $(srcdir)/progfixed-dos.f.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfixed.f.try.f.ref: $(top_builddir)/config.status $(srcdir)/progfixed.f.try.f.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfixed.f: $(top_builddir)/config.status $(srcdir)/progfixed.f.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfixed1.f.try.f.ref: $(top_builddir)/config.status $(srcdir)/progfixed1.f.try.f.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfixed1.f: $(top_builddir)/config.status $(srcdir)/progfixed1.f.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfixedfree-dos.f.try.f.ref: $(top_builddir)/config.status $(srcdir)/progfixedfree-dos.f.try.f.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfixedfree-dos.f: $(top_builddir)/config.status $(srcdir)/progfixedfree-dos.f.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfixedfree.f.try.f.ref: $(top_builddir)/config.status $(srcdir)/progfixedfree.f.try.f.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfixedfree.f: $(top_builddir)/config.status $(srcdir)/progfixedfree.f.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfree-dos.f.try.f.ref: $(top_builddir)/config.status $(srcdir)/progfree-dos.f.try.f.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfree-dos.f: $(top_builddir)/config.status $(srcdir)/progfree-dos.f.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfree.f.try.f.ref: $(top_builddir)/config.status $(srcdir)/progfree.f.try.f.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfree.f: $(top_builddir)/config.status $(srcdir)/progfree.f.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfree1.f.try.f.ref: $(top_builddir)/config.status $(srcdir)/progfree1.f.try.f.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfree1.f: $(top_builddir)/config.status $(srcdir)/progfree1.f.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfreefixed.f.try.f.ref: $(top_builddir)/config.status $(srcdir)/progfreefixed.f.try.f.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ progfreefixed.f: $(top_builddir)/config.status $(srcdir)/progfreefixed.f.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ esope.f.try.f.ref: $(top_builddir)/config.status $(srcdir)/esope.f.try.f.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ esope.f: $(top_builddir)/config.status $(srcdir)/esope.f.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ emacs_findent.ref: $(top_builddir)/config.status $(srcdir)/emacs_findent.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ emacs_help.ref: $(top_builddir)/config.status $(srcdir)/emacs_help.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ gedit_external.ref: $(top_builddir)/config.status $(srcdir)/gedit_external.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ gedit_help.ref: $(top_builddir)/config.status $(srcdir)/gedit_help.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ gedit_plugin.ref: $(top_builddir)/config.status $(srcdir)/gedit_plugin.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ gedit_plugin_py.ref: $(top_builddir)/config.status $(srcdir)/gedit_plugin_py.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ help.ref: $(top_builddir)/config.status $(srcdir)/help.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ makefdeps.ref: $(top_builddir)/config.status $(srcdir)/makefdeps.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ manpage.ref: $(top_builddir)/config.status $(srcdir)/manpage.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ readme.ref: $(top_builddir)/config.status $(srcdir)/readme.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ vim_findent.ref: $(top_builddir)/config.status $(srcdir)/vim_findent.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ vim_fortran.ref: $(top_builddir)/config.status $(srcdir)/vim_fortran.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ vim_help.ref: $(top_builddir)/config.status $(srcdir)/vim_help.ref.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ tags TAGS: ctags CTAGS: cscope cscopelist: # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test1.sh.log: test1.sh @p='test1.sh'; \ b='test1.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test2.sh.log: test2.sh @p='test2.sh'; \ b='test2.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test3.sh.log: test3.sh @p='test3.sh'; \ b='test3.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test4.sh.log: test4.sh @p='test4.sh'; \ b='test4.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test5.sh.log: test5.sh @p='test5.sh'; \ b='test5.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test6.sh.log: test6.sh @p='test6.sh'; \ b='test6.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test7.sh.log: test7.sh @p='test7.sh'; \ b='test7.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test8.sh.log: test8.sh @p='test8.sh'; \ b='test8.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test9.sh.log: test9.sh @p='test9.sh'; \ b='test9.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test10.sh.log: test10.sh @p='test10.sh'; \ b='test10.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test11.sh.log: test11.sh @p='test11.sh'; \ b='test11.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test12.sh.log: test12.sh @p='test12.sh'; \ b='test12.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test13.sh.log: test13.sh @p='test13.sh'; \ b='test13.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test14.sh.log: test14.sh @p='test14.sh'; \ b='test14.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test15.sh.log: test15.sh @p='test15.sh'; \ b='test15.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test16.sh.log: test16.sh @p='test16.sh'; \ b='test16.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test17.sh.log: test17.sh @p='test17.sh'; \ b='test17.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test18.sh.log: test18.sh @p='test18.sh'; \ b='test18.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test19.sh.log: test19.sh @p='test19.sh'; \ b='test19.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test20.sh.log: test20.sh @p='test20.sh'; \ b='test20.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test21.sh.log: test21.sh @p='test21.sh'; \ b='test21.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: all all-am check check-TESTS check-am clean clean-generic \ clean-local cscopelist-am ctags-am distclean distclean-generic \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am recheck tags-am \ uninstall uninstall-am .PRECIOUS: Makefile export SRCDIR = $(top_srcdir) export FC @MAKEWIN_TRUE@ export WINDOWS = yes @MAKEWIN_FALSE@ export WINDOWS = no @USEESOPE_TRUE@ export ESOPE = yes @USEESOPE_FALSE@ export ESOPE = no clean-local: rm -rf *.tmpdir # 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: findent-3.1.1/test/progfreefixed.f.try.f.ref.in0000644000175000017500000001443113342770451016275 00000000000000! -Ia -i5 -a1 -b2 -d3 -f4 -m5 -ifree -ofixed module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum contains function f(x) print *,'abc & def' print *,"abcd #ifdef foo & garbage #endif & efgh" return end function #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module program progfixed type mytype ! mytype integer i ! a comment ! a floating comment real x end type mytype #ifdef abcde real klm@@@(10) #endif real do(100) integer x(100) type(mytype) xyz character*1000 astring continue a_ap: do i=1,20 continue enddo a_ap end = 10 if ( e .eq. n .and. & e .eq. m )then npar = npar + 1 endif do i=1, ! a comment ! a comment & 1 ! a comment & 0 continue enddo do 123 i=1,2 continue 123 continue print *,'; function ',indx," function " continue 99880 FORMAT (' function ') 99870 FORMAT(1X,'Invalid species name',2X,A8) do i=1,10 do (i) = 5 continue do(i) = 5 continue enddo x = y ! function values continue astring = " ! this & is & no comment!" print *,a,b, & c,d & ,e,f continue print *,a,b, & c,d & ,e,f loop: do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo loop bbb: block continue end block bbb sc: select case(ja) case(1) continue case(2) continue end select sc continue do i=1,20 block continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical wv: if ( a.eq.b) then continue endif wv if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue !d print *,'debug i=',i ! !D print *,'debug j=',j x = 4 + ! next line starts with & 5 + ! next line starts with & 5+ ! next line starts with & 5+ ! next line starts with & 5+ ! next line starts with & 5+ ! next line starts with & 5 return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou & tine five continue return end subroutine seven a = 1 & + 2 ! comment 1 & + 3 ! comment 2 & + 4 & + 5 & + 6 a = 1 & + 2 ! comment 1 & + 3 ! comment 2 #ifdef klm & + 4 syntax error & + 5 syntax error #endif & + 6 end subroutine multiline_preproc #ifdef one\ two\ three do i=1,10 #elif \ defined(q) do i=1,5 #else do i=1,7 #endif x=x+4 enddo end subroutine omp integer i,j,k !$ integer m,n, !$ & o,p print *,i,j,k !$ print*, m,n,o,p !$ do 100 i=1,20 !$ do 100 j=1,i continue !$100 enddo end findent-3.1.1/test/progfree-dos.f.try.f.ref.in0000644000175000017500000000544313012076375016041 00000000000000! -I2 -i5 -a1 -b2 -d3 -f4 -m5 -ifree module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum type, public :: mytypea integer i end type mytypea contains function f(x) print *,'abc & def' print *,"abcd& & efgh" return end function #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module program progfree type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm(10) #endif integer x(100) type(mytype) xyz continue do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou& &tine five continue return end findent-3.1.1/test/test10.sh0000744000175000017500000000173113324246005012521 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 prog=" program main 10 continue end " expect="program main 10 continue end" exe=$FINDENT for flag in -l0 --label_left=0 ; do a=`echo "$prog" | $exe "$flag" -I0 -i6 | tr -d '\r'` if [ "$a" = "$expect" ]; then echo "$flag works OK" else echo "$flag works NOT OK:" echo "expected:" echo "$expect" echo "got :" echo "$a" echo "program is:" echo "$prog" rc=`expr $rc + 1` fi done expect="program main 10 continue end" for flag in -l1 --label_left=1 ; do a=`echo "$prog" | $exe "$flag" -I0 -i6 | tr -d '\r'` if [ "$a" = "$expect" ]; then echo "$flag works OK" else echo "$flag works NOT OK:" echo "expected:" echo "$expect" echo "got :" echo "$a" echo "program is:" echo "$prog" rc=`expr $rc + 1` fi done . ../postlude exit $rc findent-3.1.1/test/test11.sh0000744000175000017500000000255513356316452012540 00000000000000#!/bin/sh # vim: indentexpr=none if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 cat << eof > prog program prog continue eof cat << eof > expect 5 eof ../doit "-lastindent --last_indent" "-ifree -Ia -i3" rc=`expr $rc + $?` cat << eof > prog endif eof cat << eof > expect 5 eof ../doit "-lastindent --last_indent" "-ifree -Ia -i3" rc=`expr $rc + $?` # test 2018 critical(stat = istat) cat << eof > prog program pcritical critical(stat=istat) continue end critical end eof cat << eof > expect program pcritical critical(stat=istat) continue end critical end eof ../doit "--indent-critical=4 -x4" "-ifree" rc=`expr $rc + $?` # test 2018 change team(), end team [()] cat << eof > prog program pchangeteam change team(newteam) continue end team continue change team(newteam) continue end team (stat=istat) l: change team(newteam) continue end team (stat=istat) l k: change team(newteam) continue end team k end eof cat << eof > expect program pchangeteam change team(newteam) continue end team continue change team(newteam) continue end team (stat=istat) l: change team(newteam) continue end team (stat=istat) l k: change team(newteam) continue end team k end eof ../doit "--indent-changeteam=4 --indent_changeteam=4" "-ifree" rc=`expr $rc + $?` . ../postlude exit $rc findent-3.1.1/test/test3.sh0000744000175000017500000000023213325561733012447 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfreefixed.f rc=$? . ../postlude exit $rc findent-3.1.1/test/progfixed.f.in0000644000175000017500000001641113474502400013610 00000000000000! -I0 -i5 -a1 -b2 -d3 -f4 -m5 -Rr module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum contains function f(x) print *,'abc 9 def' print *,"abcd 8 efgh" return end #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end subroutine ticket7 integer :: int real :: float logical :: bool #define COND \ if (float > 1.) then; \ continue ; \ end if COND if (.true.) then int = int + 1 end if end program progfixed type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm@@@(10) #endif real do(100) integer x(100) type(mytype) xyz character*1000 astring continue a_ap: do i=1,20 continue enddo a_ap end = 10 if ( e .eq. n .and. * e .eq. m )then npar = npar + 1 endif do i=1, c a comment c a comment x 1 c a comment x 0 continue enddo do 123 i=1,2 continue 123 continue print *,'; function ',indx," function " continue 99880 FORMAT (' function ') 99870 FORMAT(1X,'Invalid species name',2X,A8) do i=1,10 do (i) = 5 continue do(i) = 5 continue enddo x = y ! function values continue astring = " ! this x is x no comment!" print *,a,b, x c,d x ,e,f continue print *,a,b, x c,d x ,e,f loop: do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo loop bbb: block continue end block bbb sc: select case(ja) case(1) continue case(2) continue end select sc continue do i=1,20 block continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical wv: if ( a.eq.b) then continue endif wv if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue d print *,'debug i=',i D print *,'debug j=',j x = 4 + c next line starts with 1 5 + c next line starts with 2 5+ c next line starts with 3 5+ c next line starts with 4 5+ c next line starts with 5 5+ c next line starts with 6 5 return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou xtine five continue return end subroutine seven a = 1 x + 2 ! comment 1 y + 3 ! comment 2 y + 4 y + 5 y + 6 a = 1 x + 2 ! comment 1 y + 3 ! comment 2 #ifdef klm y + 4 syntax error y + 5 syntax error #endif y + 6 end subroutine multiline_preproc #ifdef one\ two\ three do i=1,10 #elif \ defined(q) do i=1,5 #else do i=1,7 #endif x=x+4 enddo end subroutine nok implicit none type domain_data real, dimension(:, :), allocatable :: temperature integer:: ibound, icopy, todomain end type type(domain_data), dimension(2), target :: dom allocate(dom(1) % temperature(20, 20)) dom(1) % temperature = 0. dom(1) % temperature(:, 1) = 1. end subroutine nok ! testing with findentfix: subroutine testfix implicit none integer i,j,k do i=1,10 c comment continue do j=1,6 continue ! findentfix: do do k=1,7 continue enddo C FINDENTFIX: enddo enddo * findentFIX: do;do continue * findentfix: enddo;enddo continue enddo end subroutine testfix subroutine testpointer integer, pointer :: subroutinesub integer, target :: i subroutinesub=>i ! must not be recognized as subroutine statement end subroutine omp integer i,j,k C$ integer m,n, c$ ! comment in omp sentinel ! normal comment *$ *$ 1 o,p print *,i,j,k !$ print*, m,n,o,p !$ do 100 i=1,20 !$ do 100 j=1,i c$ continue c$100 continue c$omp parallel c$omp do do i=1,20 continue enddo c$omp end parallel end subroutine label_excercise do 10 x 0 i=1,10 continue 01 00 continue do 02 0 i=1,10 continue 20 continue end findent-3.1.1/test/progfixed1.f.in0000644000175000017500000000013613211022102013647 00000000000000! -i- -I8 -ifixed program programma continue end findent-3.1.1/test/progfixed-dos.f.in0000644000175000017500000000626613211022103014364 00000000000000! -I0 -i5 -a1 -b2 -d3 -f4 -m5 -ifixed module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum #ifdef foo garbage #endif contains function f(x) print *,'abc 9 def' print *,"abcd 8 efgh" return end function #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module program progfixed type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm(10) #endif integer x(100) type(mytype) xyz continue do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine subroutine two(a) continue return endsubroutine subroutine three(a) continue return end subroutine four(a) continue return endsubroutine four subrou xtine five continue return end findent-3.1.1/test/test8.sh0000744000175000017500000000022613324246005012446 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfree1.f rc=$? . ../postlude exit $rc findent-3.1.1/test/gedit_external.ref.in0000644000175000017500000000007313210210275015135 00000000000000#!/bin/bash # to be used in gedit to indent fortran source findent-3.1.1/test/esope.f.try.f.ref.in0000644000175000017500000000105313474763263014564 00000000000000! program esope ! 'normal' fortran compilers do not understand esope syntax #if 0 segment, test continue integer t endsegment SEGMENT, test continue integer t ENDSEGMENT 10 segment test1 30 continue endsegment segment continue segment = 10 continue segment tra = 10 continue segini,val segini ,val segsup , val #endif end findent-3.1.1/test/test16.sh0000744000175000017500000001562013343227527012542 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 doit=../doit cat << eof > prog program main01 continue end eof cat << eof > expect program main01 continue end eof $doit "-I5 --start_indent=5" -i3 "for fixed input" rc=`expr $rc + $?` cat << eof > prog program main02 continue end eof cat << eof > expect program main02 continue end eof $doit "-I5 --start_indent=5" -i3 "for free input" rc=`expr $rc + $?` cat << eof > prog program main03 continue end eof cat << eof > expect program main03 continue end eof $doit "-Ia --start_indent=a" "-I0 -i3" "" rc=`expr $rc + $?` cat << eof > prog program main04 continue do i=1,10 do j=1,20 continue enddo enddo end eof cat << eof > expect program main04 continue do i=1,10 do j=1,20 continue enddo enddo end eof $doit "-i5 --indent=5" "-I0" "" rc=`expr $rc + $?` cat << eof > prog program main06 associate( z => sin(theta)) print *,z end associate end eof cat << eof > expect program main06 associate( z => sin(theta)) print *,z end associate end eof $doit "-a5 --indent_associate=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main07 block continue end block end eof cat << eof > expect program main07 block continue end block end eof $doit "-b5 --indent_block=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main08 do i=1,10 do j=1,5 print *,i,j enddo enddo end eof cat << eof > expect program main08 do i=1,10 do j=1,5 print *,i,j enddo enddo end eof $doit "-d5 --indent_do=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main09 if (i .eq. 7) then print *,'foo' continue endif continue end eof cat << eof > expect program main09 if (i .eq. 7) then print *,'foo' continue endif continue end eof $doit "-f5 --indent_if=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main10 enum, bind(c) enumerator :: red = 1, blue black = 5 enumerator yellow end enum end eof cat << eof > expect program main10 enum, bind(c) enumerator :: red = 1, blue black = 5 enumerator yellow end enum end eof $doit "-E5 --indent_enum=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main11 forall(k=1:1000) x(k) = 23 y(k) = 67 end forall end eof cat << eof > expect program main11 forall(k=1:1000) x(k) = 23 y(k) = 67 end forall end eof $doit "-F5 --indent_forall=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main12 interface myinterface subroutine mysub(x) real x end subroutine end interface end eof cat << eof > expect program main12 interface myinterface subroutine mysub(x) real x end subroutine end interface end eof $doit "-j5 --indent_interface=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog module mymodule01 integer x contains subroutine mysub continue end subroutine end module eof cat << eof > expect module mymodule01 integer x contains subroutine mysub continue end subroutine end module eof $doit "-m5 --indent_module=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog subroutine mysub01 continue end subroutine function myfun(x) real x end function eof cat << eof > expect subroutine mysub01 continue end subroutine function myfun(x) real x end function eof $doit "-r5 --indent_procedure=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main13 continue select case(i) case(1) x=2 case(3) x=4 end select continue end program eof cat << eof > expect program main13 continue select case(i) case(1) x=2 case(3) x=4 end select continue end program eof $doit "-s5 --indent_select=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main14 type mytype integer :: i real x,y end type mytype end program eof cat << eof > expect program main14 type mytype integer :: i real x,y end type mytype end program eof $doit "-t5 --indent_type=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main15 where(x>21) y=10 z=11 end where end program eof cat << eof > expect program main15 where(x>21) y=10 z=11 end where end program eof $doit "-w5 --indent_where=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main16 continue critical x=10 y=11 end critical end program eof cat << eof > expect program main16 continue critical x=10 y=11 end critical end program eof $doit "-x5 --indent_critical=5" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main17 continue contains subroutine mysub continue end subroutine mysub end program eof cat << eof > expect program main17 continue contains subroutine mysub continue end subroutine mysub end program eof $doit "-C- --indent_contains=restart" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main18 continue x = x + & & 10 y = y + & 5 end program eof cat << eof > expect program main18 continue x = x + & & 10 y = y + & 5 end program eof $doit "-k- --indent_continuation=none" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main19 continue select case(i) case(3) x=8 case(5) y=2 end select continue end program eof cat << eof > expect program main19 continue select case(i) case(3) x=8 case(5) y=2 end select continue end program eof $doit "-c4 --indent_case=4" "-i6 -I0" "" rc=`expr $rc + $?` cat << eof > prog program main20 continue contains function foo(bar) real bar continue end function end program eof cat << eof > expect program main20 continue contains function foo(bar) real bar continue end function end program eof $doit "-C4 --indent_contains=4" "-i6 -I0" "" rc=`expr $rc + $?` cat << eof > prog subroutine mysub02 continue entry myentry continue end subroutine eof cat << eof > expect subroutine mysub02 continue entry myentry continue end subroutine eof $doit "-e4 --indent_entry=4" "-i6 -I0" "" rc=`expr $rc + $?` cat << eof > prog subroutine mysub03 do i=1,20 continue !$ continue enddo end subroutine eof cat << eof > expect subroutine mysub03 do i=1,20 continue !$ continue enddo end subroutine eof $doit "--openmp=0" "-i3 -I0" "" rc=`expr $rc + $?` cat << eof > prog subroutine mysub04 do i=1,20 continue !$ continue enddo end subroutine eof cat << eof > expect subroutine mysub04 do i=1,20 continue !$ continue enddo end subroutine eof $doit "--openmp=0" "-i3 -I0" "" rc=`expr $rc + $?` . ../postlude exit $rc findent-3.1.1/test/vim_fortran.ref.in0000644000175000017500000000013613210207755014476 00000000000000" Vim indent file " Installation: Place this script in the $HOME/.vim/after/indent/ directory findent-3.1.1/test/test4.sh0000744000175000017500000000023613324246005012443 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfixedfree-dos.f rc=$? . ../postlude exit $rc findent-3.1.1/test/test7.sh0000744000175000017500000000022513324246005012444 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi ../test-compile.sh ../progfree.f rc=$? . ../postlude exit $rc findent-3.1.1/test/test14.sh0000744000175000017500000000470413351114202012521 00000000000000#!/bin/sh # vim: indentexpr=none if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 doit=../doit cat << eof > prog program fixed001 continue # if xyz || \ abc x=1 # endif end eof cat << eof > expect fixed eof $doit "-q --query_fix_free" "" "for fixed input" rc=`expr $rc + $?` cat << eof > prog program free001 continue end eof cat << eof > expect free eof $doit "-q --query_fix_free" "" "for free input" rc=`expr $rc + $?` cat << eof > prog program p001 do i=1,10 continue enddo end eof cat << eof > expect program p001 do i=1,10 continue enddo end eof $doit "-M2 --max_indent=2" "-ifree -i8" "for free input" rc=`expr $rc + $?` cat << eof > expect program p001 do i=1,10 continue enddo end eof $doit "-M2 --max_indent=2" "-ifixed -i8" "for fixed input" rc=`expr $rc + $?` cat << eof > prog program p002 x=x+ & 10+ & & 20+ & 30 end eof cat << eof > expect program p002 x=x+ 1 10+ 2 20+ 3 30 end eof $doit "--continuation=0" "-ofixed" "--continuation=0 for free input" rc=`expr $rc + $?` cat << eof > expect program p002 x=x+ & 10+ & 20+ & 30 end eof $doit "--continuation= " "-ofixed" "--continuation=' ' for free input" rc=`expr $rc + $?` cat << eof > expect program p002 x=x+ + 10+ + 20+ + 30 end eof $doit "--continuation=+" "-ofixed" "--continuation=+ for free input" rc=`expr $rc + $?` cat << eof > prog program p003 x=9+ + 20 + ! abc ! abc ! abc + 30 end eof cat << eof > expect program p003 x=9+ + 20 + ! abc ! abc ! abc + 30 end eof $doit "--continuation= " "" "--continuation=' ' for fixed input" rc=`expr $rc + $?` cat << eof > expect program p003 x=9+ 9 20 + ! abc ! abc ! abc 9 30 end eof $doit "--continuation=9" "" "--continuation=9 for fixed input" cat << eof > prog #define W \ program program p004 continue end eof cat << eof > expect #define W \ program program p004 continue end eof $doit "-Ia --start-indent=a" "-ifree" "for free input" $doit "-Ia --start-indent=a" "-ifixed" "for fixed input" rc=`expr $rc + $?` . ../postlude exit $rc findent-3.1.1/test/progfree.f.in0000644000175000017500000002054613474501517013446 00000000000000! -I2 -i5 -a1 -b2 -d3 -f4 -m5 -Rr ! ticket 1 block data pblockdata common /xcomm/ p end block data qblockdata common /qcomm/ p end block data qblockdata block data rblockdata common /rcomm/ p end block data ! submodule and 'module subroutine' not recognized by gfortran 4.8.2 #if 0 MODULE ancestor INTEGER :: i INTERFACE MODULE SUBROUTINE sub1(arg1) INTEGER :: arg1 END SUBROUTINE MODULE SUBROUTINE sub2(arg2) INTEGER :: arg2 END SUBROUTINE END INTERFACE END MODULE SUBMODULE (ancestor) descendant INTEGER :: j CONTAINS MODULE SUBROUTINE sub1(arg1) INTEGER :: arg1 arg1 = 1 i = 2 j = 3 END SUBROUTINE module function fun1(arg1) integer :: arg1 fun1 = 10 end MODULE PROCEDURE sub2 arg2 = 1 END END #endif module some_module type :: onetype integer i end type onetype type name character(22) :: n end type complex ccc interface myinterface subroutine tx(a,b) real a,b end end interface interface anotherinterface module procedure funccc ! ! trata module procedure funcccc end interface abstract interface character*8 recursive function func(x) real :: x end function func end interface contains character*(8) impure function funcc(x) real :: x funcc = 'a' end function funcc integer(kind=4) pure function funccc(x) real, intent(in) :: x funccc = 2 end function type(onetype) function funcccc(x) type(onetype) :: x funcccc = x end function integer elemental function funcx(x) integer, intent(in) :: x funcx = x end function #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) /* Test for GCC >= 4.8.0 */ #if GCC_VERSION >= 40800 subroutine handleP(p) class(*), intent(in) :: p select type(p) type is (character(len=*)) write(*,*) len(p), ': ', p class is (name) write(*,*) len(p%n), ': ', p%n class default write(*,*) 'Unknown type' end select end subroutine #endif double complex function compx(x) double complex x compx = x end function complex recursive function compxx(x) complex x compxx = x end function real function alpha_integral_function(x) implicit none real:: x alpha_integral_function = 0 end end ! end of this module ! /ticket 1 module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum type, public :: mytypea integer i end type mytypea integer, parameter, public :: i8=selected_int_kind(16) contains function f(x) print *,'abc & def' print *,"abcd& & efgh" return end function integer(kind=i8) function func1(a, b) integer(kind=i8), intent(in) :: a, b func1 = a + b end function func1 integer(kind=i8)function funcx(a, b) integer(kind=i8), intent(in) :: a, b funcx = a + b end function funcx #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module subroutine ticket7 integer :: int real :: float logical :: bool #define COND \ if (float > 1.) then; \ if (bool) write(*, *) 'nope'; \ end if COND if (.true.) then int = int + 1 end if end subroutine program progfree type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm(10) #endif integer x(100) type(mytype) xyz real do(1000) continue loop: do i=1,20 continue enddo loop loop1 : do , i=1,20 continue enddo loop1 end = 10 do while(i.eq.0) continue enddo do , while(i.eq.0) continue enddo do concurrent(i=1:10) x(i) = 0 enddo do , concurrent(i=1:10) x(i) = 0 enddo if ( a.eq.b .and. & c.eq.r) then n=n+1 endif iff: if (a.eq.b) then continue endif iff lsele: select case(i) case(10) continue case(11) continue case default continue end select lsele lblock: block continue end block lblock x = 3.0*a + 4*b + & & 2 *c + y assign 90 to i do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo do i=1,10; do j=3,5; continue; enddo; enddo do i=1,7; do j=2,2 continue enddo continue enddo do ; enddo critical x=y do(3) = 123 endcritical critical x=y endcritical critical x=y end critical if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall hop:forall(i=1:4) ! forall x(i)=6 end forall hop where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program subroutine one(a) continue entry myentry continue return end subroutine two(a) continue a = 3 + &! comment1 4 + & ! comment 2 5 a = 3 + & ! test preprocessor within continuation 4 + & #ifdef abc this would cause a compilation error & #endif 5 return endsubroutine subroutine three(a) do 10 i=1,4 do 5 j=1,2 continue 5 enddo 10 enddo typecode = 9 continue return end subroutine four(a) continue return endsubroutine four subrou& &tine five continue return end subroutine seven a = 1& &+ 2 &! comment 1 &+ 3 &! comment 2 &+ 4& &+ 5& &+ 6 a = 1& &+ 2 &! comment 1 &+ 3 &! comment 2 #ifdef klm &+ 4 syntax error& &+ 5 syntax error& #endif &+ 6 end subroutine multiline_preproc #ifdef one\ two\ three do i=1,10 #elif \ defined(q) do i=1,5 #else do i=1,7 #endif x=x+4 enddo end subroutine nok implicit none type domain_data real, dimension(:, :), allocatable :: temperature integer:: ibound, icopy, todomain end type type(domain_data), dimension(2), target :: dom allocate(dom(1) % temperature(20, 20)) dom(1) % temperature = 0. dom(1) % temperature(:, 1) = 1. end subroutine nok ! testing with findentfix: subroutine testfix implicit none integer i,j,k do i=1,10 ! comment continue do j=1,6 continue ! findentfix: do do k=1,7 continue enddo ! FINDENTFIX: enddo enddo continue enddo end subroutine testfix subroutine omp integer i,j,k !$ integer m,n, & !$ o,p print *,i,j,k !$ print*, m,n,o,p !$ do i=1,20 continue !$ enddo end subroutine label_excercise do 010& &0 i=1,10 continue 01& &00 continue continue 120 do i=1,10 continue enddo end findent-3.1.1/test/test15.sh0000744000175000017500000000561113324357570012541 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 doit=../doit cat << eof > prog program main continue end eof cat << eof > expect program main continue end eof $doit "-iauto --input_format=auto -ifixed --input_format=fixed" "-I0 -i3" "for fixed input" rc=`expr $rc + $?` cat << eof > expect program main continue end eof $doit "-ifree --input_format=free" "-I0 -i3" "for fixed input" rc=`expr $rc + $?` cat << eof > prog program main continue end eof cat << eof > expect program main continue end eof $doit "-iauto --input_format=auto -ifree --input_format=free" "-I0 -i3" "for free input" rc=`expr $rc + $?` cat << eof > prog program main continue end eof cp prog expect $doit "-i- --indent=none" "" "" rc=`expr $rc + $?` cat << eof > prog program main x = 10 + 6 end eof cat << eof > expect program main x = 10 end eof $doit "-L42 --input_line_length=42" "-I0 -i3" "" rc=`expr $rc + $?` cat << eof > prog program main continue end eof cat << eof > expect program main continue end eof $doit "-ofree --output_format=free" "-I0 -i3" "" rc=`expr $rc + $?` cat << eof > prog program main continue end eof cat << eof > expect program main continue end eof $doit "-osame --output_format=same" "-I0 -i3" "for free input" rc=`expr $rc + $?` cat << eof > prog program main continue end eof cat << eof > expect program main continue end eof $doit "-osame --output_format=same" "-I0 -i3" "for fixed input" rc=`expr $rc + $?` cat << eof > prog program main continue contains subroutine mysub continue end end eof cat << eof > expect program main continue contains subroutine mysub continue end subroutine mysub end program main eof $doit "-Rr --refactor_procedures" "-I0 -i3" "for free input" rc=`expr $rc + $?` cat << eof > expect program main continue contains subroutine mysub continue END SUBROUTINE mysub END PROGRAM main eof $doit "-RR --refactor_procedures=upcase" "-I0 -i3" "for free input" rc=`expr $rc + $?` cat << eof > prog program main continue contains subroutine mysub continue end end eof cat << eof > expect program main continue contains subroutine mysub continue end subroutine mysub end program main eof $doit "-Rr --refactor_procedures" "-I0 -i3" "for fixed input" rc=`expr $rc + $?` cat << eof > expect program main continue contains subroutine mysub continue END SUBROUTINE mysub END PROGRAM main eof $doit "-RR --refactor_procedures=upcase" "-I0 -i3" "for fixed input" rc=`expr $rc + $?` . ../postlude exit $rc findent-3.1.1/test/readme.ref.in0000644000175000017500000000010513226414360013400 00000000000000For installation instructions and usage, see README.1st and INSTALL findent-3.1.1/test/test13.sh0000744000175000017500000000171413324246005012525 00000000000000#!/bin/sh if test -e prelude ; then . ./prelude else . ./debian/tests/prelude fi rc=0 exe=$FINDENT for flag in -h --help ; do $exe "$flag" | head -n 1 | tr -d '\r' > help.try cmp -s ../help.ref help.try r=$? if [ $r -eq 0 ] ; then echo "$flag : works OK" else echo "$flag : works NOT OK, compare help.try and help.ref" fi rc=`expr $rc + $r` done for flag in -H --manpage ; do $exe "$flag" | head -n 1 | tr -d '\r' > manpage.try cmp -s ../manpage.ref manpage.try r=$? if [ $r -eq 0 ] ; then echo "$flag : OK" else echo "$flag : NOT OK, compare manpage.try and manpage.ref" fi rc=`expr $rc + $r` done for flag in -v --version ; do $exe $flag > result if grep -q "^findent version" result ; then echo "$flag: OK" else echo "$flag : NOT OK" echo "expected : findent version ..." echo "got:" cat result rc=`expr $rc + 1` fi done . ../postlude exit $rc findent-3.1.1/test/progfixed.f.try.f.ref.in0000644000175000017500000001707713474502613015443 00000000000000! -I0 -i5 -a1 -b2 -d3 -f4 -m5 -Rr module m1 integer k enum, bind(c) enumerator :: red =1, blue, black =5 enumerator yellow enumerator gold, silver, bronze enumerator :: purple enumerator :: pink, lavender endenum contains function f(x) print *,'abc 9 def' print *,"abcd 8 efgh" return end function f #ifdef usempi function f1(x,m) real x,m #elif defined(useopenmp) function f1(x,m,n) real x,m,n #else function f1(x) real x #endif continue end function f1 end module m1 subroutine ticket7 integer :: int real :: float logical :: bool #define COND \ if (float > 1.) then; \ continue ; \ end if COND if (.true.) then int = int + 1 end if end subroutine ticket7 program progfixed type mytype ! mytype integer i real x end type mytype #ifdef abcde real klm@@@(10) #endif real do(100) integer x(100) type(mytype) xyz character*1000 astring continue a_ap: do i=1,20 continue enddo a_ap end = 10 if ( e .eq. n .and. * e .eq. m )then npar = npar + 1 endif do i=1, c a comment c a comment x 1 c a comment x 0 continue enddo do 123 i=1,2 continue 123 continue print *,'; function ',indx," function " continue 99880 FORMAT (' function ') 99870 FORMAT(1X,'Invalid species name',2X,A8) do i=1,10 do (i) = 5 continue do(i) = 5 continue enddo x = y ! function values continue astring = " ! this x is x no comment!" print *,a,b, x c,d x ,e,f continue print *,a,b, x c,d x ,e,f loop: do i=1,20 block do 90 k=1,90 do 90 k1=1,4 call one(a) do 7 j=1,20 call two(a) 7 x=x+j continue 90 continue continue end block enddo loop bbb: block continue end block bbb sc: select case(ja) case(1) continue case(2) continue end select sc continue do i=1,20 block continue end block enddo critical x=y endcritical critical x=y endcritical critical x=y end critical wv: if ( a.eq.b) then continue endif wv if (.false.) goto 88 if (.false.) goto 99999 88 if ('x' .eq. "abc''d") l=1 99999 continue if ('x' .eq. "abc''d") l=1 continue if ('x' .eq. "abc''d")then continue endif ASSOCIATE ( Z => EXP(-(a**2+Y**2)) * COS(THETA)) PRINT *, A+Z, A-Z END ASSOCIATE forall(i=1:4) x(i)=5 continue forall(i=1:4) ! forall x(i)=6 end forall where(x.eq.0) x=5 ! where continue where(x.eq.0) x=10 endwhere continue where(x.eq.0) x=10 elsewhere x=11 endwhere select case(ia) case(1) print *,3 do i=1,9 continue enddo case(2) print*,6 case default print *,0 endselect end program progfixed subroutine one(a) continue entry myentry continue return end subroutine one subroutine two(a) continue d print *,'debug i=',i D print *,'debug j=',j x = 4 + c next line starts with 1 5 + c next line starts with 2 5+ c next line starts with 3 5+ c next line starts with 4 5+ c next line starts with 5 5+ c next line starts with 6 5 return end subroutine two subroutine three(a) continue return end subroutine three subroutine four(a) continue return end subroutine four subrou xtine five continue return end subroutine five subroutine seven a = 1 x + 2 ! comment 1 y + 3 ! comment 2 y + 4 y + 5 y + 6 a = 1 x + 2 ! comment 1 y + 3 ! comment 2 #ifdef klm y + 4 syntax error y + 5 syntax error #endif y + 6 end subroutine seven subroutine multiline_preproc #ifdef one\ two\ three do i=1,10 #elif \ defined(q) do i=1,5 #else do i=1,7 #endif x=x+4 enddo end subroutine multiline_preproc subroutine nok implicit none type domain_data real, dimension(:, :), allocatable :: temperature integer:: ibound, icopy, todomain end type type(domain_data), dimension(2), target :: dom allocate(dom(1) % temperature(20, 20)) dom(1) % temperature = 0. dom(1) % temperature(:, 1) = 1. end subroutine nok ! testing with findentfix: subroutine testfix implicit none integer i,j,k do i=1,10 c comment continue do j=1,6 continue ! findentfix: do do k=1,7 continue enddo C FINDENTFIX: enddo enddo * findentFIX: do;do continue * findentfix: enddo;enddo continue enddo end subroutine testfix subroutine testpointer integer, pointer :: subroutinesub integer, target :: i subroutinesub=>i ! must not be recognized as subroutine statement end subroutine testpointer subroutine omp integer i,j,k C$ integer m,n, c$ ! comment in omp sentinel ! normal comment *$ *$ 1 o,p print *,i,j,k !$ print*, m,n,o,p !$ do 100 i=1,20 !$ do 100 j=1,i c$ continue c$100 continue c$omp parallel c$omp do do i=1,20 continue enddo c$omp end parallel end subroutine omp subroutine label_excercise do 10 x 0 i=1,10 continue 01 00 continue do 02 0 i=1,10 continue 20 continue end subroutine label_excercise findent-3.1.1/test/progfree1.f.in0000644000175000017500000000006413211022102013471 00000000000000! -i- -I8 -ifree -Rr program programma continue end findent-3.1.1/deps/0000755000175000017500000000000013476205436011111 500000000000000findent-3.1.1/deps/Makefile.am0000644000175000017500000000002713363352037013057 00000000000000EXTRA_DIST = makefdeps findent-3.1.1/deps/Makefile.in0000644000175000017500000002641613476205425013105 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = deps ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_bison.m4 \ $(top_srcdir)/m4/ax_prog_flex.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC = @FC@ FCFLAGS = @FCFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MINGW32 = @MINGW32@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_FC = @ac_ct_FC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ make_include = @make_include@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = makefdeps all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu deps/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu deps/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: findent-3.1.1/deps/makefdeps0000744000175000017500000000232313365322611012704 00000000000000#!/bin/bash # - makefdeps - # Creates make-dependencies for fortran sources, based on # analysis by findent of (sub)modules that are needed or created and # include files. Include files are not further analyzed. # Dependencies will be like: # prog.o: sub1.o sub2.o # prog.o: file1.inc file2.inc # Example: # makefdeps *.f90 > deps usage() { echo "usage:" echo "$0 [-s objectsuffix] fortansources ..." echo "objectsuffix: default '.o'" echo "depending on your make system, '.lo' can be the correct one" exit 1 } FINDENTPROG=${FINDENT:-findent} p=$( getopt -o s: -- "$@" ) || usage eval set -- "$p" O='.o' while [ "$1" != "--" ]; do case "$1" in '-s') shift; O="$1" ;; esac shift done shift declare -A module use include for i in $@ ; do j=${i%.*}$O while read a b ; do case $a in use) use[$j]="${use[$j]} $b" ;; mod|sub) [ "$b" ] && module[$b]=$j ;; inc|cpp|coc|std) include[$j]="${include[$j]} $b" ;; esac done < <( $FINDENTPROG --deps < $i ) done for k in ${!use[@]}; do m="" for l in ${use[$k]}; do m="$m ${module[$l]}" done if [ -n "${m// }" ] ; then echo $k: $m fi done for k in ${!include[@]}; do echo $k: ${include[$k]} done findent-3.1.1/debian.sid/0000755000175000017500000000000013476205423012152 500000000000000findent-3.1.1/debian.sid/compat0000644000175000017500000000000313334526266013275 0000000000000011 findent-3.1.1/debian.sid/control0000644000175000017500000000122313475553627013506 00000000000000Source: findent Section: devel Priority: optional Maintainer: Willem Vermin Build-Depends: debhelper (>= 11), flex, bison Standards-Version: 4.3.0 Homepage: https://sourceforge.net/projects/findent/ Package: findent Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: indents/converts Fortran sources Indents Fortran sources: free or fixed format. Optionally converts from fixed format to free format. Supports Fortran2008. Indentation is controlled by a number of flags. Easy integration with (g)vim, gedit, emacs. . wfindent is a wrapper for findent and facilitates in-place indenting of Fortran sources. findent-3.1.1/debian.sid/changelog0000644000175000017500000000104313476205423013742 00000000000000findent (3.1.1-1) unstable; urgency=low * New upstream release * Changed Standards-Version: 4.3.0 -- Willem Vermin Thu, 06 Jun 2019 14:46:11 +0200 findent (2.8.2-1) unstable; urgency=low * New upstream release * Changed Standards-Version: 4.1.4 * Changed Build-Depends: debhelper (>=11) -- Willem Vermin Wed, 13 Jun 2018 05:09:12 +0200 findent (2.7.3-1) unstable; urgency=low * Initial release (Closes: #842166) -- Willem Vermin Tue, 20 Dec 2016 12:22:24 +0100 findent-3.1.1/gedit/0000755000175000017500000000000013476205436011252 500000000000000findent-3.1.1/gedit/README0000644000175000017500000000431113246252015012037 00000000000000Usage of findent in gedit 1) as an external tool: Enter the following commands: ################################################# mkdir -p $HOME/bin findent --gedit_external > $HOME/bin/findent-gedit chmod +x $HOME/bin/findent-gedit ################################################# Make sure the $HOME/bin is in the PATH environment variable. Open gedit: ----------------------- (Edit ->) Preferences -> plugins : enable "External Tools" Close gedit and start it again. Tools -> Manage External Tools -> Add - rename "New Tool" into findent - put findent-gedit in the tool Shortcut Key: F11 (or something more to your liking) Save: Nothing Input: Current document Output: Replace current document Applicability: All documents Fortran 95 ----------------------- Alternatively, if all is well, it would be sufficient to place the command findent -Ia -i3 in the tool, but the script findent-gedit does some sanity checks to prevent "oops" experiences. 2) as plugin: Find the location of the directory where gedit expects the configuration files, we assume here $HOME/.local/share/gedit/plugins Enter the following commands: ################################################## geditroot=$HOME/.local/share/gedit/plugins mkdir -p $geditroot findent --gedit_plugin > $geditroot/findent.plugin findent --gedit_plugin_py > $geditroot/findent.py ################################################## in gedit: (Edit ->) Preferences -> plugins -> check: findent findent is available in popup menu (right-click) and shortcut f . You can change that in findent.py, look for the definition of 'shortcut'. Advantage of plugin over external tool: gedit scrolls back to point where you called findent. Flags for findent: both the external command as the plugin pass the environment variable GEDIT_FINDENT_FLAGS to findent. Example: if you want general indentation set to 2 but indentation of do-loops set to 4, specify: export GEDIT_FINDENT_FLAGS="-i2 -d4" Use findent -h for a list of flags. findent-3.1.1/gedit/findent.py0000644000175000017500000001720613344675504013202 00000000000000# -*- coding: utf-8 -*- # Findent plugin # This file is part of gedit # # Copyright (C) 2017 Willem Vermin # # 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., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. from gi.repository import GObject, Gio, Gtk, Gedit import gettext import os.path from subprocess import Popen,PIPE try: gettext.bindtextdomain(GETTEXT_PACKAGE, GP_LOCALEDIR) _ = lambda s: gettext.dgettext(GETTEXT_PACKAGE, s) except: _ = lambda s: s class FindentAppActivatable(GObject.Object, Gedit.AppActivatable): app = GObject.Property(type=Gedit.App) def __init__(self): GObject.Object.__init__(self) global shortcut shortcut = "f" def do_activate(self): self.app.add_accelerator(shortcut, "win.findent", None) def do_deactivate(self): self.app.remove_accelerator("win.findent", None) class FindentWindowActivatable(GObject.Object, Gedit.WindowActivatable): window = GObject.Property(type=Gedit.Window) def __init__(self): GObject.Object.__init__(self) self.bottom_bar = Gtk.Box() def do_activate(self): action = Gio.SimpleAction(name="findent") action.connect('activate', lambda a, p: self.do_findent()) self.window.add_action(action) self._insert_bottom_panel() def do_deactivate(self): self.window.remove_action("findent") self._remove_bottom_panel() def do_update_state(self): view = self.window.get_active_view() enable = view is not None and view.get_editable() self.window.lookup_action("findent").set_enabled(enable) return def do_findent(self): view = self.window.get_active_view() if view and hasattr(view, "findent_view_activatable"): view.findent_view_activatable.do_findent() def _insert_bottom_panel(self): # Add elements to panel. self.findent_label = Gtk.Label() self.findent_textbuffer = Gtk.TextBuffer() global mesg mesg = self.findent_textbuffer self.findent_textview = Gtk.TextView() self.findent_textview.set_buffer(self.findent_textbuffer) self.bottom_bar.add(self.findent_textview) # Get bottom bar (A Gtk.Stack) and add our bar. panel = self.window.get_bottom_panel() panel.add_titled(self.bottom_bar, 'findent_panel', "Findent output") # Make sure everything shows up. panel.show() self.bottom_bar.show_all() panel.set_visible_child(self.bottom_bar) def _remove_bottom_panel(self): panel = self.window.get_bottom_panel() panel.remove(self.bottom_bar) def settext(self,text): self.findent_textbuffer.set_text(text) class FindentViewActivatable(GObject.Object, Gedit.ViewActivatable): view = GObject.Property(type=Gedit.View) def __init__(self): GObject.Object.__init__(self) self.default_flags = "-Ia -i3" self.executable = "findent" self.userflags = os.getenv("GEDIT_FINDENT_FLAGS") if self.userflags == None: self.userflags = "" def do_activate(self): self.view.findent_view_activatable = self self.view.connect('populate-popup', self.populate_popup) mesg.set_text("Findent ready for use."+ \ " Shortcut: "+shortcut+ \ " and in popup menu." + \ " Default flags: '" + self.default_flags + "'" + \ "\nflags from environment variable GEDIT_FINDENT_FLAGS: '" + self.userflags+"'") def do_deactivate(self): delattr(self.view, "findent_view_activatable") def populate_popup(self, view, popup): if not isinstance(popup, Gtk.MenuShell): return item = Gtk.SeparatorMenuItem() item.show() popup.append(item) item = Gtk.MenuItem.new_with_mnemonic(_('_Findent')) item.set_sensitive(self.view.get_editable()) item.show() item.connect('activate', lambda i: self.do_findent()) popup.append(item) def do_findent(self): doc = self.view.get_buffer() if doc is None: return ctype = doc.get_content_type() if ctype != "text/x-fortran": mesg.set_text("Content type is '"+ctype+"'" + \ ". Findent handles only 'text/x-fortran'") return # run a simple test to see if findent is doing what we expect srcin = "program test\ncontinue\nend program test" expected = "program test\n continue\nend program test\n" try: with Popen([self.executable,"-i3"], stdout=PIPE, stdin=PIPE) as proc: srcout = proc.communicate(str.encode(srcin))[0].decode() except OSError: mesg.set_text("Cannot find findent." + \ "\nTake care that the location of findent is in PATH" +\ "\nUsing '"+self.executable+"'") return if srcout != expected: mesg.set_text("Findent is not functioning as expected." +\ "\nTake care that the location of findent is in PATH" +\ "\nUsing '"+self.executable+"'") return xy = self.view.window_to_buffer_coords(Gtk.TextWindowType.TEXT,0,0) z = self.view.get_line_at_y(xy[1])[0] line = z.get_line() cline = doc.get_iter_at_mark(doc.get_insert()).get_line() srcin = doc.get_text(doc.get_start_iter(),doc.get_end_iter(),True) uri = doc.get_location().get_uri() suffix = os.path.splitext(uri)[1].lower() if suffix in {".f",".for",".fpp",".ftn",".fortran",".f77"}: ff = "-ifixed" elif suffix in {".f90",".f95",".f03",".f08"}: ff = "-ifree" else: ff = "-iauto" flags = self.default_flags.split() + [ff] + self.userflags.split() try: with Popen([self.executable]+flags, stdout=PIPE, stdin=PIPE) as proc: srcout = proc.communicate(str.encode(srcin))[0].decode() except OSError: mesg.set_text("Cannot find findent." + \ "\nTake care that the location of findent is in PATH" +\ "\nUsing '"+self.executable+"'") return orig_lines = doc.get_line_count() doc.set_text(srcout) while Gtk.events_pending(): Gtk.main_iteration_do(False) hop = doc.get_iter_at_line(line) self.view.scroll_to_iter(hop,0,True,0,0) doc.goto_line(cline) lines = doc.get_line_count() s = "" for i in flags: s = s+" "+i mesg.set_text("flags used: "+s+" \n"+ \ str(lines)+" lines indented") if lines == orig_lines+1: mesg.insert_at_cursor(", empty line added") if lines != orig_lines and lines != orig_lines+1: mesg.insert_at_cursor("\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") mesg.insert_at_cursor("\nXX MALFUNCTION DETECTED, UNDO TWICE! XX") mesg.insert_at_cursor("\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") # ex:ts=4:et: findent-3.1.1/gedit/findent-gedit0000744000175000017500000000451013444171471013633 00000000000000#!/bin/bash # to be used in gedit to indent fortran source # in gedit: # Edit -> preferences -> enable "External Tools" # Tools -> Manage External Tools -> Add # - rename "New Tool" into findent # - put this file in the tool, or place a command # in the tool that starts this script # Shortcut Key: F1 (or something more to your liking) # Save: Nothing # Input: Current document # Output: Replace current document # Applicability: All documents Fortran 95 # flags="-Ia -i3" # flags for findent fin=`mktemp` fout=`mktemp` trap "rm $fin $fout" 0 # remove temps on exit restore() { cat $fin if [ "$lineadded" = "yes" ] ; then echo "empty line added" >&2 else echo "nothing changed" >&2 fi exit } cat > $fin # copy input to $fin # gedit version 2 has some troubles keeping stdout and # stderr separate when stdout does not end with newline. # add newline if input file does not end with newline: lastchar="$(tail -c1 $fin | od -a -An | tr -d ' ')" if [ "$lastchar" != "nl" ] ; then echo >> $fin lineadded=yes else lineadded=no fi if [ "$GEDIT_CURRENT_DOCUMENT_TYPE" != "text/x-fortran" ]; then echo "not a fortran file" >&2 restore fi FINDENT=`which /bin/ls 2>/dev/null` FINDENT=`which findent 2>/dev/null` if [ -z "$FINDENT" ] ; then echo "cannot find findent" 1>&2 restore fi fname="$GEDIT_CURRENT_DOCUMENT_NAME" # get the file name # get suffix in lowercase: suffix=`echo "${fname##*.}" | tr '[:upper:]' '[:lower:]'` # determine input type (fflag) from suffix: case "$suffix" in f|for|fpp|ftn|fortran|f77) fflag="-ifixed" ;; f90|f95|f03|f08) fflag="-ifree" ;; *) # let findent find out: fflag="" ;; esac findentflags="$flags $fflag" # run findent: $FINDENT $findentflags < $fin > $fout 2>/dev/null if [ $? -ne 0 ] ; then echo "findent reports error" >&2 echo "using \"$FINDENT $findentflags\"" >&2 restore fi # check if output has same number of lines as input: win=`wc -l < $fin` wout=`wc -l < $fout` if [ "$win" != "$wout" ] ; then echo "findent does not function properly" >&2 restore fi # produce the result echo $wout lines indented 1>&2 if [ "$lineadded" = "yes" ] ; then echo "empty line added" >&2 fi cat $fout findent-3.1.1/gedit/Makefile.am0000644000175000017500000000007413210254422013210 00000000000000EXTRA_DIST = findent-gedit findent.plugin findent.py README findent-3.1.1/gedit/findent.plugin0000644000175000017500000000030513344675504014040 00000000000000[Plugin] Loader=python3 Module=findent IAge=3 Name=findent Description=Indent Fortran source Authors=Willem Vermin Copyright=Copyright @ 2017 Willem Vermin Website=http://www.gedit.org Version=0.1 findent-3.1.1/gedit/Makefile.in0000644000175000017500000002647513476205425013253 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = gedit ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_bison.m4 \ $(top_srcdir)/m4/ax_prog_flex.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC = @FC@ FCFLAGS = @FCFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MINGW32 = @MINGW32@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_FC = @ac_ct_FC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ make_include = @make_include@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = findent-gedit findent.plugin findent.py README all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gedit/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu gedit/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: findent-3.1.1/Makefile.in0000644000175000017500000006172213476205425012151 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_bison.m4 \ $(top_srcdir)/m4/ax_prog_flex.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \ COPYING ChangeLog INSTALL NEWS README compile depcomp \ install-sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC = @FC@ FCFLAGS = @FCFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MINGW32 = @MINGW32@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_FC = @ac_ct_FC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ make_include = @make_include@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = gnu SUBDIRS = src scripts test vim gedit emacs doc deps MAINTAINERCLEANFILES = config.h.in~ EXTRA_DIST = bootstrap getversion LICENCE README.1st README.windows \ maketar makezip makedeb makesid README.2nd debian \ makeupload pbuilderscript \ debian.disco debian.wheezy debian.sid debian.stretch \ simplemake.sh all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ 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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -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 $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_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 case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 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 in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive @MAKEWIN_FALSE@all-local: all-am: Makefile config.h all-local installdirs: installdirs-recursive installdirs-am: 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \ am--refresh check check-am clean clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic \ maintainer-clean-local mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile maintainer-clean-local: rm -rf bin share autom4te.cache @MAKEWIN_TRUE@all-local: @MAKEWIN_TRUE@ test -f src/findent && mv src/findent src/findent.exe ; exit 0 builtparser builtlexer: cd src; $(MAKE) $@ # 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: findent-3.1.1/AUTHORS0000644000175000017500000000004413022025550011124 00000000000000Willem Vermin wvermin@gmail.com findent-3.1.1/getversion0000744000175000017500000000011112562110006012157 00000000000000#!/bin/bash grep -w VERSION src/version.h | awk '{print $3}' | tr -d '"' findent-3.1.1/emacs/0000755000175000017500000000000013476205436011246 500000000000000findent-3.1.1/emacs/findent.el0000644000175000017500000000460513344675504013145 00000000000000;;;; this file contains an interface to use findent within emacs. ;;;; the C-M-q command ("indent function") is redefined to ;;;; indent the whole buffer. ; how to call findent for a fixed format Fortran source: (defvar fortran-findent-command "findent -ifixed -Ia" "findent command for fixed format fortran source") ; ; how to call findent for a free format Fortran source: (defvar f90-findent-command "findent -ifree -Ia" "findent command for free format fortran source") ; ;;;; define function findent-indent-buffer: it calls the program ;;;; findent with the whole buffer as input and output (defun findent-indent-buffer() " Function that uses findent to indent the whole buffer. The call to findent must be provided in the string findent-command, for example (setq findent-command \"findent -ifixed -Ia\") Findent supports Fortran-2008, free and fixed format; indents correctly DO statements that share a common label; is in general not confused by #if, #ifdef or #else preprocessor statements. " (interactive) (let ( (lines (count-lines (point-min) (point-max))) (lpos (line-number-at-pos)) (first-window-line) (offset) (linelength) (pos (point)) ) ; this function tries to restore cursor and window ; position after indenting, hence the extra code. ; If somebody knows something better ... (beginning-of-line) (end-of-line) (skip-chars-backward "[:blank:]") (setq offset (- (point) pos)) (if (< offset 0) (setq offset 0)) (move-to-window-line 0) (setq first-window-line (line-number-at-pos)) (message "indenting buffer ..." ) (shell-command-on-region (point-min) (point-max) findent-command 1 1 ) (goto-line lpos) (redisplay) (move-to-window-line 0) (scroll-down (- (line-number-at-pos) first-window-line)) (goto-line lpos) (setq pos (point)) (end-of-line) (setq linelength (- (point) pos)) (if (< offset linelength) (backward-char offset) (beginning-of-line)) (message "indenting buffer ... %d lines indented" lines) ) ) ; (add-hook 'fortran-mode-hook (lambda() (setq findent-command fortran-findent-command))) (add-hook 'f90-mode-hook (lambda() (setq findent-command f90-findent-command))) (add-hook 'fortran-mode-hook (lambda() (local-set-key "\C-\M-q" 'findent-indent-buffer))) (add-hook 'f90-mode-hook (lambda() (local-set-key "\C-\M-q" 'findent-indent-buffer))) findent-3.1.1/emacs/README0000644000175000017500000000135713343471415012047 00000000000000Usage of findent in emacs After following one of these two methods, the buffer is indented with Ctrl-Alt-q Method 1: - Put the output of findent --emacs_findent to the directory where you store your emacs scripts, for example: mkdir -p ~/.emacs.d/lisp && findent --emacs_findent > ~/.emacs.d/lisp/findent.el - Edit .emacs or .emacs.el or .emacs.d/init.el : - If not already done, add the following two lines to extend load-path : (add-to-list 'load-path (concat user-emacs-directory (convert-standard-filename "lisp/"))) - Add a command to load findent.el : (load "findent") Method 2: - Add the output of findent --emacs_findent to ~/.emacs ~/.emacs.el or ~/.emacs.d/init.el findent-3.1.1/emacs/Makefile.am0000644000175000017500000000003713226362515013215 00000000000000EXTRA_DIST = findent.el README findent-3.1.1/emacs/Makefile.in0000644000175000017500000002644013476205425013237 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = emacs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_bison.m4 \ $(top_srcdir)/m4/ax_prog_flex.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC = @FC@ FCFLAGS = @FCFLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MINGW32 = @MINGW32@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_FC = @ac_ct_FC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ make_include = @make_include@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = findent.el README all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu emacs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu emacs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: findent-3.1.1/install-sh0000755000175000017500000003601013476205425012100 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # 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. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # Note that $RANDOM variable is not portable (e.g. dash); Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p' feature. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # 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 $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: findent-3.1.1/maketar0000744000175000017500000000105413334307231011433 00000000000000#!/bin/bash curdir=`pwd` || exit 1 version=`./getversion` || exit 1 echo "version = $version" ./bootstrap || exit 1 ./configure || exit 1 make -j4 distcheck || exit 1 mkdir -p ../versions || exit 1 mv findent*.tar.gz ../versions || exit 1 unix2dos -n README.1st ../versions/README || exit 1 make distclean echo "$0 done" findent-3.1.1/aclocal.m40000644000175000017500000012612113476205425011737 00000000000000# generated automatically by aclocal 1.16.1 -*- Autoconf -*- # Copyright (C) 1996-2018 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. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2018 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. # 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. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2018 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. # 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. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2018 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. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl 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])]) # Copyright (C) 1999-2018 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. # 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", "OBJC", "OBJCXX", "UPC", or "GJC". # 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 m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$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". rm -rf conftest.dir 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 # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub 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 am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # 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. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # 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. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi 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_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2018 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. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _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. # This creates each '.Po' and '.Plo' makefile fragment that we'll 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" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2018 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 macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # 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_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])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]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # 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. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2018 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2018 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. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998-2018 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. # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ([2.50])dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2018 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. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2018 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. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2018 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. # 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 is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2018 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. # _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], [m4_foreach_w([_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])]) # Copyright (C) 1999-2018 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. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2018 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. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2018 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. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # 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 ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file 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 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 if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done 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]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2018 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. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2018 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. # AM_PROG_INSTALL_STRIP # --------------------- # 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="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2018 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. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2018 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. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR findent-3.1.1/makesid0000744000175000017500000000313313334541270011427 00000000000000#!/bin/bash echo "do not use, use './makedeb all'" exit 1 # This script assumes that root has created a pbuilder environment # for sid (and for wheezy and i386-wheezy). # The configfiles are resp. ~/root/pbuilderrc.sid , # ~/root/pbuilderrc.wheezy and ~/root/pbuilderrc.i386-wheezy. # This script does not run update. # # debian distributions are created in ../debian/ # curdir=$PWD version=`./getversion` echo "version = $version" tar=$curdir/../versions/findent-$version.tar.gz dir=findent-$version if [ x$1 = xall ] ; then dists="sid wheezy i386-wheezy" else dists=sid fi ./maketar || exit 1 for dist in $dists; do debdir=$curdir/../debian/findent-$version-deb.$dist debdirbuild=$curdir/../debian/findent-$version-deb-build.$dist rm -rf $debdir $debdirbuild mkdir -p $debdir $debdirbuild || exit 1 cd $debdir || exit 1 cp $tar . || exit 1 tar xf $tar || exit 1 cp $tar findent_$version.orig.tar.gz || exit 1 cd $dir || exit 1 echo building for $dist ... case $dist in *i386*) arch=i386 ;; *) arch=amd64 ;; esac cp debian.xenial/* debian || exit 1 #pdebuild --architecture $arch --debbuildopts "-us -uc" -- --configfile ~root/pbuilderrc.$dist \ # --hookdir ~/pbuilderhooks || exit 1 dpkg-buildpackage -us -uc --check-command=lintian --check-option='--profile' --check-option=debian debsign $debdir/*.changes cp debian.sid/* debian || exit 1 echo creating .deb for $dist ... sudo pbuilder --build --configfile /root/pbuilderrc.$dist --buildresult $debdirbuild $debdir/*dsc sudo chown -h $USER.$USER $debdirbuild/* done echo $0 done findent-3.1.1/README.windows0000644000175000017500000000230013334307227012434 00000000000000findent: indents/beautifies/converts Fortran sources - findent supports Fortran-2008 - findent can convert from fixed form to free form - binaries for Unix and Windows (findent and findent.exe respectively) - wrapper for processing one or more files in one call available for Unix and Windows (wfindent and wfindent.bat respectively) - (g)vim users: findent can act as a plug-in to format your edit file with the '=' command - gui frontent available as a separate package: jfindent Windows users: download findent-x.y.zip $ unzip findent-x.y.zip $ copy findent.exe C:\WINDOWS (*) $ copy wfindent.bat C:\WINDOWS (*) (*) or another location where you store your executables Usage: $ findent -h Examples: $ findent < in.f90 > out.f90 $ findent -i4 -Rr < in.f > out.f90 $ wfindent -i4 -Rr *.f (g)vim users: Install findent, and add the following to your .vimrc: augroup fortfiletype autocmd! autocmd Filetype fortran :execute ":setl sw=3" autocmd Filetype fortran :execute ":setl equalprg=findent\\ -Ia\\ -i3" autocmd Filetype fortran :execute ":setl expandtab" augroup END Read :help = in vim or gvim. findent-3.1.1/debian.wheezy/0000755000175000017500000000000013476205423012706 500000000000000findent-3.1.1/debian.wheezy/compat0000644000175000017500000000000213311203444014011 000000000000009 findent-3.1.1/debian.wheezy/control0000644000175000017500000000122213444175737014237 00000000000000Source: findent Section: devel Priority: optional Maintainer: Willem Vermin Build-Depends: debhelper (>= 9), flex, bison Standards-Version: 3.9.4 Homepage: https://sourceforge.net/projects/findent/ Package: findent Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: indents/converts Fortran sources Indents Fortran sources: free or fixed format. Optionally converts from fixed format to free format. Supports Fortran2008. Indentation is controlled by a number of flags. Easy integration with (g)vim, gedit, emacs. . wfindent is a wrapper for findent and facilitates in-place indenting of Fortran sources. findent-3.1.1/debian.wheezy/changelog0000644000175000017500000000065513476205423014506 00000000000000findent (3.1.1-1) unstable; urgency=low * New upstream release -- Willem Vermin Thu, 06 Jun 2019 14:46:11 +0200 findent (2.8.2-1) unstable; urgency=low * New upstream release -- Willem Vermin Wed, 13 Jun 2018 05:09:12 +0200 findent (2.7.3-1) unstable; urgency=low * Initial release (Closes: #842166) -- Willem Vermin Tue, 20 Dec 2016 12:22:24 +0100 findent-3.1.1/pbuilderscript0000744000175000017500000000215613306501506013046 00000000000000#!/bin/bash # script for pbuilder to create upload directory workdir=$1 oldversion=$2 newversion=$3 if [ -z "$3" ] ; then echo usage: pbuilderscript workdir oldversion newversion exit 1 fi cd "$workdir" || exit 1 echo "working in `pwd`" export DEBEMAIL=wvermin@gmail.com export DEBFULLNAME="Willem Vermin" sed -i 's/^#//' /etc/apt/sources.list # oncomment 2de regel apt update apt -y install apt-utils || exit 1 apt -y install quilt devscripts debhelper autotools-dev equivs || exit 1 apt source findent || exit 1 cd findent-$oldversion || exit 1 uupdate -v $newversion ../findent-$newversion.tar.gz || exit 1 cd ../findent-$newversion if [ -d debian.upstream ] ; then rm -r debian mv debian.upstream debian || exit 1 fi #apt -y install vim #echo dpkg-source ... #dpkg-source --commit echo quilt ... while quilt push; do quilt refresh; done #dch echo | mk-build-deps -i -r debian/control || exit 1 #dpkg-source --commit #while quilt push; do quilt refresh; done dpkg-buildpackage -us -uc cd .. echo "running lintian ..." lintian -i -I --show-overrides findent_$newversion-1_amd64.changes echo "end lintian" echo $0 done