Commit 197c4480 authored by mtabriz's avatar mtabriz

cleanup the build, update docs

parent a37b6e2a
Pipeline #67962 passed with stage
in 39 seconds
This is a lean fork of the findent located at:
https://sourceforge.net/projects/findent/
The original project offers additional features e.g. GUI frontent, internal lexer and parser, and windows binaries.
findent: Indents/beautifies/converts Fortran sources.
Prints dependencies based on:
- definitions and uses of modules and submodules
......@@ -11,32 +16,21 @@ findent: Indents/beautifies/converts Fortran sources.
- 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 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).
Installation:
prerequisites: make, C++ compiler, lexical analyzer, language parser
compilation:
$ cd findent/bin
edit Makefile to edit the prerequisites (if necessary):
C++ compiler, default: g++
lexical analyzer, default: flex
language parser, default: bison
$ make
All systems:
Usage: $ findent -h
Examples: $ findent < in.f90 > out.f90
......
......@@ -3,7 +3,7 @@ CPP=g++
CPPFLAGS=-O2 -I$(SRC)
LEX=flex
YACC=bison
EXE=findentm
EXE=findent
DEP=$(SRC)parser.cpp $(SRC)lexer.cpp
......@@ -20,6 +20,7 @@ $(OBJ_FILE): %.o:$(SRC)%.cpp
$(EXE):
$(CPP) $(OBJ_FILE) -o $(EXE) $(LDFLAGS)
rm -f $(OBJ_FILE) $(DEP) $(SRC)parser.hpp
$(SRC)parser.cpp:
$(YACC) -o $(SRC)parser.cpp -d $(SRC)parser.y
......@@ -29,5 +30,5 @@ $(SRC)lexer.cpp:
.PHONY: clean
clean:
rm -f $(OBJ_FILE) $(DEP) $(EXE)
rm -f $(OBJ_FILE) $(DEP) $(EXE) $(SRC)parser.hpp
......@@ -39,7 +39,7 @@ bool Docs::print(int todo)
usage(0);
return 1;
case Flags::DO_VERSION:
std::cout << "findent mini version "<<VERSION<<std::endl;
std::cout << "findent version "<<VERSION<<std::endl;
return 1;
case Flags::DO_VIM_FINDENT:
vim_findent();
......
/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015 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 <http://www.gnu.org/licenses/>. */
/* 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. */
#ifndef YY_YY_SRC_PARSER_HPP_INCLUDED
# define YY_YY_SRC_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,
NON_RECURSIVE = 357,
SUBROUTINE = 358,
FUNCTION = 359,
PROGRAM = 360,
EOL = 361,
NAMED_LABEL = 362,
STLABEL = 363,
TYPE = 364,
ENDTYPE = 365,
CLASS = 366,
BASICTYPE = 367,
TYPEC = 368,
QSTRING = 369,
HSTRING = 370,
LR = 371,
LRB = 372,
DOTOPERATOR = 373,
I_NUMBER = 374,
UNCLASSIFIED = 375,
ERROR = 376,
OMP = 377,
SCANOMPFIXED = 378,
SCANOMPFREE = 379,
LAST_TOKEN = 380
};
#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_SRC_PARSER_HPP_INCLUDED */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment