diff --git a/CMakeLists.txt b/CMakeLists.txt index 28a6a13..a840a76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,30 +1,9 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2) -# Default compiler gfortran, otherwise cmake Fortran package will set it to f95 -# You can override the compiler with cmake -DFEQPARSE_COMPILER= -set(FEQPARSE_COMPILER "/usr/bin/gfortran" CACHE STRING "Fortran Compiler to build feqparse") -set(FEQPARSE_AR "/usr/bin/gcc-ar" CACHE STRING "Static archive command") -set(FEQPARSE_RANLIB "/usr/bin/gcc-ranlib" CACHE STRING "ranlib used to create Static archive") -set(FEQPARSE_COMPILER_FLAGS "-std=f2003 -ffree-form -ffree-line-length-none -cpp" CACHE STRING "Compiler flags to build feqparse") -set(FEQPARSE_INSTALL_DIR "/opt/feqparse" CACHE STRING "Install directory for feqparse") -message("-- FEQPARSE ------------- cmake START -------------------") -message("-- FEQPARSE_COMPILER: ${FEQPARSE_COMPILER}") -message("-- FEQPARSE_AR: ${FEQPARSE_AR}") -message("-- FEQPARSE_RANLIB: ${FEQPARSE_RANLIB}") -message("-- FEQPARSE_COMPILER_FLAGS: ${FEQPARSE_COMPILER_FLAGS}") -message("-- FEQPARSE_INSTALL_DIR: ${FEQPARSE_INSTALL_DIR}") -message("-- FEQPARSE ----------------------------------------------") -set(CMAKE_Fortran_COMPILER_INIT ${FEQPARSE_COMPILER}) set(CMAKE_VERBOSE_MAKEFILE ON) - PROJECT(feqparse Fortran C) -SET(CMAKE_BUILD_TYPE ${FEQPARSE_BUILD_TYPE}) SET(VERSION 0.0.0) -SET(CMAKE_AR ${FEQPARSE_AR}) -SET(CMAKE_RANLIB ${FEQPARSE_RANLIB}) -SET(CMAKE_INSTALL_PREFIX ${FEQPARSE_INSTALL_DIR}) -message("-- CMAKE_INSTALL_PREFIX:${CMAKE_INSTALL_PREFIX}") INCLUDE(FortranCInterface) FortranCInterface_VERIFY() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1aab261..b704684 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,3 @@ -set(CMAKE_Fortran_FLAGS "${FEQPARSE_COMPILER_FLAGS} ${CMAKE_Fortran_FLAGS}") set(CMAKE_VERBOSE_MAKEFILE ON) file(GLOB FEQPARSE_SRC "${CMAKE_CURRENT_SOURCE_DIR}/*.F*") diff --git a/src/FEQParse.F90 b/src/FEQParse.F90 index 6dd3d15..723001b 100644 --- a/src/FEQParse.F90 +++ b/src/FEQParse.F90 @@ -370,13 +370,15 @@ SUBROUTINE Tokenize( parser, tokenized, errorMsg ) IF( parser % inFix % tokens(1) % tokenType == Operator_Token )THEN - IF( TRIM( parser % inFix % tokens(1) % tokenString ) == "+" .OR. TRIM( parser % inFix % tokens(1) % tokenString ) == "-" ) THEN + IF( TRIM( parser % inFix % tokens(1) % tokenString ) == "+" .OR. & + TRIM( parser % inFix % tokens(1) % tokenString ) == "-" ) THEN parser % inFix % tokens(1) % tokenType = Monadic_Token END IF END IF DO i = 2, parser % inFix % top_index - IF( parser % inFix % tokens(i) % tokenType == Operator_Token .AND. parser % inFix % tokens(i-1) % tokenType == OpeningParentheses_Token ) THEN + IF( parser % inFix % tokens(i) % tokenType == Operator_Token .AND. & + parser % inFix % tokens(i-1) % tokenType == OpeningParentheses_Token ) THEN parser % inFix % tokens(i) % tokenType = Monadic_Token END IF END DO @@ -413,7 +415,8 @@ SUBROUTINE ConvertToPostFix( parser ) CALL operator_stack % push( parser % inFix % tokens(i) ) - ELSEIF( parser % inFix % tokens(i) % tokenType == Operator_Token .OR. parser % inFix % tokens(i) % tokenType == Monadic_Token )THEN + ELSEIF( parser % inFix % tokens(i) % tokenType == Operator_Token & + .OR. parser % inFix % tokens(i) % tokenType == Monadic_Token )THEN IF( .NOT. operator_stack % IsEmpty( ) )THEN @@ -421,7 +424,8 @@ SUBROUTINE ConvertToPostFix( parser ) tok = operator_stack % TopToken( ) DO WHILE( TRIM(tok % tokenString) /= "(" .AND. & - Priority( TRIM(tok % tokenString) ) > Priority( TRIM(parser % inFix % tokens(i) % tokenString) ) ) + Priority( TRIM(tok % tokenString) ) > & + Priority( TRIM(parser % inFix % tokens(i) % tokenString) ) ) CALL parser % postFix % push( tok ) CALL operator_stack % pop( tok )