Commit c3259ca6 authored by Dave Demarle's avatar Dave Demarle
Browse files

ENH: remove xdmf1 not that we have switched to xdmf2

parent fcb58895
.git* export-ignore
CreateConverters.tcl crlf=input
JavaWrap.tcl crlf=input
SwigIt crlf=input
@CMAKE_EMPTY_INPUT_FILE_CONTENT@
#-----------------------------------------------------------------------------
# Does Xdmf require support for 64 bit file systems
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CheckCXXSourceRuns.cmake)
FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/vtkRequireLargeFilesSupport.cxx"
XDMF_REQUIRE_LARGE_FILE_SUPPORT_FILE)
CHECK_CXX_SOURCE_RUNS("${XDMF_REQUIRE_LARGE_FILE_SUPPORT_FILE}"
XDMF_REQUIRE_LARGE_FILE_SUPPORT "Xdmf support for 64 bit file systems")
SET( XdmfFormatSource
XdmfArray
XdmfCharArray
XdmfDOM
XdmfDataDesc
XdmfExpression
XdmfFormat
XdmfFormatMulti
XdmfFormatHDF
XdmfFormatXML
XdmfHeavyData
XdmfHDF
XdmfHDFSupport
XdmfLightData
XdmfObject
XdmfParameter
XdmfXNode
XdmfTransform
XdmfXMLParser
)
SET( XdmfExtraSource
XdmfTree
XdmfLlist
XdmfExprLex
XdmfExprYacc
)
SET( XdmfModelSource
XdmfAttribute
XdmfGeometry
XdmfGrid
XdmfTopology
XdmfNDGM
XdmfRuntime
)
SET( XdmfNdgmSource
H5FDndgm
)
SET( XdmfPythonSource
XdmfPython
)
SET( XdmfTclSource
XdmfTcl
)
OPTION(XDMF_REGENERATE_WRAPPERS
"Regenerate XdmfPython.cxx XdmfTcl.cxx and XdmfJava.cxx" OFF)
MARK_AS_ADVANCED(XDMF_REGENERATE_WRAPPERS)
IF(XDMF_REGENERATE_WRAPPERS)
FIND_PROGRAM(SWIG_EXECUTABLE
NAMES swig-1.3 swig
PATHS /usr/bin
DOC "Swig executable for generating wrapped files")
MARK_AS_ADVANCED(SWIG_EXECUTABLE)
IF(SWIG_EXECUTABLE)
SET(XDMF_SWIG_INCLUDES
-I${Xdmf_SOURCE_DIR}
-I${Xdmf_SOURCE_DIR}/libsrc
-I${Xdmf_BINARY_DIR}/libsrc
-I${Xdmf_SOURCE_DIR}/Ice/libsrc
-I${Xdmf_BINARY_DIR}/Ice/libsrc
)
GET_FILENAME_COMPONENT(SWIG_EXE_PATH ${SWIG_EXECUTABLE}
PATH)
SET(SWIG_LIB_PATH "${SWIG_EXE_PATH}/Lib")
MESSAGE("SWIG_LIB_PATH ${SWIG_LIB_PATH}")
IF(EXISTS "${SWIG_LIB_PATH}")
SET(XDMF_SWIG_INCLUDES
${XDMF_SWIG_INCLUDES}
-I${SWIG_LIB_PATH}
-I${SWIG_LIB_PATH}/tcl
-I${SWIG_LIB_PATH}/python
)
ENDIF(EXISTS "${SWIG_LIB_PATH}")
FOREACH(LANGUAGE Tcl Python Java)
STRING(TOLOWER ${LANGUAGE} lang)
SET(swigtarget ${Xdmf_BINARY_DIR}/libsrc/Xdmf${LANGUAGE}.cxx)
IF(LANGUAGE MATCHES "Tcl")
SET(swig_extra_args -prefix Xdmf -namespace)
ENDIF(LANGUAGE MATCHES "Tcl")
ADD_CUSTOM_COMMAND(
OUTPUT ${swigtarget}
DEPENDS ${Xdmf_SOURCE_DIR}/libsrc/Xdmf.i
COMMAND ${SWIG_EXECUTABLE}
ARGS -v -c++ -make_default -includeall "-${lang}" ${swig_extra_args} ${XDMF_SWIG_INCLUDES} -o "${swigtarget}" Xdmf.i)
ENDFOREACH(LANGUAGE)
ADD_CUSTOM_TARGET(RerunSwig DEPENDS
${Xdmf_BINARY_DIR}/libsrc/XdmfTcl.cxx
${Xdmf_BINARY_DIR}/libsrc/XdmfPython.cxx
${Xdmf_BINARY_DIR}/libsrc/XdmfJava.cxx
)
ENDIF(SWIG_EXECUTABLE)
ENDIF(XDMF_REGENERATE_WRAPPERS)
OPTION(XDMF_REGENERATE_YACCLEX
"Regenerate XdmfExprYacc.cxx and XdmfExprLex.cxx" OFF)
MARK_AS_ADVANCED(XDMF_REGENERATE_YACCLEX)
IF(XDMF_REGENERATE_YACCLEX)
FIND_PROGRAM(YACC_EXECUTABLE
NAMES yacc bison
PATHS /usr/bin
DOC "Yacc or Bison executable")
FIND_PROGRAM(FLEX_EXECUTABLE
NAMES flex
PATHS /usr/bin
DOC "Flex executable")
MARK_AS_ADVANCED(YACC_EXECUTABLE FLEX_EXECUTABLE)
IF(YACC_EXECUTABLE)
SET(BISON_FLAGS)
IF(YACC_EXECUTABLE MATCHES "bison")
SET(BISON_FLAGS "-y")
ENDIF(YACC_EXECUTABLE MATCHES "bison")
ADD_CUSTOM_COMMAND(
OUTPUT ${Xdmf_BINARY_DIR}/libsrc/XdmfExprYacc.tab.c
DEPENDS ${Xdmf_SOURCE_DIR}/libsrc/XdmfExpr.y
COMMAND ${YACC_EXECUTABLE}
ARGS ${BISON_FLAGS} -d -b ${Xdmf_BINARY_DIR}/libsrc/XdmfExprYacc
-p dice_yy
${Xdmf_SOURCE_DIR}/libsrc/XdmfExpr.y
)
ADD_CUSTOM_COMMAND(
OUTPUT ${Xdmf_BINARY_DIR}/libsrc/XdmfExprYacc.tab.h
DEPENDS ${Xdmf_SOURCE_DIR}/libsrc/XdmfExpr.y
COMMAND ${YACC_EXECUTABLE}
ARGS ${BISON_FLAGS} -d -b ${Xdmf_BINARY_DIR}/libsrc/XdmfExprYacc
-p dice_yy
${Xdmf_SOURCE_DIR}/libsrc/XdmfExpr.y
)
ADD_CUSTOM_COMMAND(
OUTPUT ${Xdmf_BINARY_DIR}/libsrc/XdmfExprYacc.cxx
DEPENDS ${Xdmf_BINARY_DIR}/libsrc/XdmfExprYacc.tab.c
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${Xdmf_BINARY_DIR}/libsrc/XdmfExprYacc.tab.c
${Xdmf_BINARY_DIR}/libsrc/XdmfExprYacc.cxx
)
ADD_CUSTOM_TARGET(RerunYacc DEPENDS
${Xdmf_BINARY_DIR}/libsrc/XdmfExprYacc.cxx)
ENDIF(YACC_EXECUTABLE)
IF(FLEX_EXECUTABLE)
ADD_CUSTOM_COMMAND(
OUTPUT ${Xdmf_BINARY_DIR}/libsrc/XdmfExprLex.cxx
DEPENDS ${Xdmf_SOURCE_DIR}/libsrc/XdmfExpr.l
COMMAND ${FLEX_EXECUTABLE}
ARGS -Pdice_yy -o${Xdmf_BINARY_DIR}/libsrc/XdmfExprLex.cxx
${Xdmf_SOURCE_DIR}/libsrc/XdmfExpr.l)
ADD_CUSTOM_TARGET(RerunLex DEPENDS
${Xdmf_BINARY_DIR}/libsrc/XdmfExprLex.cxx)
ENDIF(FLEX_EXECUTABLE)
ENDIF(XDMF_REGENERATE_YACCLEX)
IF(VTK_USE_MPI)
ADD_DEFINITIONS("-DMPICH_IGNORE_CXX_SEEK")
ENDIF (VTK_USE_MPI)
INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
IF(WIN32)
CHECK_TYPE_SIZE(__int64 SIZEOF___INT64)
ENDIF(WIN32)
CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
CHECK_INCLUDE_FILE(malloc.h XDMF_HAVE_MALLOC_H)
CONFIGURE_FILE(${Xdmf_SOURCE_DIR}/libsrc/XdmfConfig.h.in
${Xdmf_BINARY_DIR}/libsrc/XdmfConfig.h)
IF(NOT XDMF_EXPAT_HEADER)
IF(XDMF_BUILD_VTK)
SET(XDMF_EXPAT_HEADER "vtk_expat.h")
ELSE(XDMF_BUILD_VTK)
SET(XDMF_EXPAT_HEADER "expat.h")
ENDIF(XDMF_BUILD_VTK)
ENDIF(NOT XDMF_EXPAT_HEADER)
CONFIGURE_FILE(${Xdmf_SOURCE_DIR}/libsrc/xdmf_expat.h.in
${Xdmf_BINARY_DIR}/libsrc/xdmf_expat.h)
IF(NOT WIN32)
ADD_DEFINITIONS(-D_HPUX_SOURCE)
ENDIF(NOT WIN32)
SET(XdmfSources ${XdmfFormatSource} ${XdmfExtraSource} ${XdmfModelSource})
IF(XDMF_HAS_NDGM)
SET(XdmfSources ${XdmfSources} ${XdmfNdgmSource})
ENDIF(XDMF_HAS_NDGM)
IF(BUILD_SHARED_LIBS)
ADD_LIBRARY(Xdmf SHARED ${XdmfSources})
ELSE(BUILD_SHARED_LIBS)
ADD_LIBRARY(Xdmf STATIC ${XdmfSources})
ENDIF(BUILD_SHARED_LIBS)
IF(XDMF_HAS_NDGM)
TARGET_LINK_LIBRARIES(Xdmf ${NDGM_LIBRARY} ${NDGM_SERVER_LIBRARY} ${HDF5_LIBRARY} ${XDMF_MPI_LIBRARIES} ${XDMF_EXPAT_LIBRARIES} ${XDMF_ZLIB_LIBRARIES})
ELSE(XDMF_HAS_NDGM)
TARGET_LINK_LIBRARIES(Xdmf ${HDF5_LIBRARY} ${XDMF_MPI_LIBRARIES} ${XDMF_EXPAT_LIBRARIES} ${XDMF_ZLIB_LIBRARIES})
ENDIF(XDMF_HAS_NDGM)
OPTION(XDMF_WRAP_PYTHON "Build a Python wrapping interface" OFF)
IF(XDMF_WRAP_PYTHON OR VTK_WRAP_PYTHON)
FIND_PACKAGE(PythonExecutable)
FIND_PACKAGE(PythonLibs)
ENDIF(XDMF_WRAP_PYTHON OR VTK_WRAP_PYTHON)
IF(XDMF_WRAP_PYTHON)
IF(NOT BUILD_SHARED_LIBS)
MESSAGE("Python wrapping only works on shared libraries")
ENDIF(NOT BUILD_SHARED_LIBS)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
ADD_LIBRARY(_Xdmf SHARED ${XdmfPythonSource})
IF(XDMF_HAS_NDGM)
TARGET_LINK_LIBRARIES(_Xdmf ${NDGM_LIBRARY} ${NDGM_SERVER_LIBRARY})
ENDIF(XDMF_HAS_NDGM)
TARGET_LINK_LIBRARIES(_Xdmf Xdmf ${HDF5_LIBRARY} ${EXPAT_LIBRARY} ${XDMF_ZLIB_LIBRARIES})
IF(WIN32)
TARGET_LINK_LIBRARIES(_Xdmf ${PYTHON_LIBRARY})
ENDIF(WIN32)
SET_TARGET_PROPERTIES(_Xdmf PROPERTIES PREFIX "")
ADD_DEPENDENCIES(_Xdmf Xdmf)
ENDIF(XDMF_WRAP_PYTHON)
OPTION(XDMF_WRAP_TCL "Build a TCL wrapping interface" OF)
IF(XDMF_WRAP_TCL)
IF(NOT BUILD_SHARED_LIBS)
MESSAGE("Tcl wrapping only works on shared libraries")
ENDIF(NOT BUILD_SHARED_LIBS)
INCLUDE_DIRECTORIES(${TCL_INCLUDE_PATH})
INCLUDE (${CMAKE_ROOT}/Modules/FindTCL.cmake)
ADD_LIBRARY(XdmfTCL SHARED ${XdmfTclSource})
IF(XDMF_HAS_NDGM)
TARGET_LINK_LIBRARIES(XdmfTCL ${NDGM_LIBRARY} ${NDGM_SERVER_LIBRARY})
ENDIF(XDMF_HAS_NDGM)
TARGET_LINK_LIBRARIES(XdmfTCL Xdmf ${TCL_LIBRARY} ${HDF5_LIBRARY} ${EXPAT_LIBRARY} ${XDMF_ZLIB_LIBRARIES})
ADD_EXECUTABLE(DummyTCL dummy.cxx)
TARGET_LINK_LIBRARIES(DummyTCL XdmfTCL)
ADD_DEPENDENCIES(XdmfTCL Xdmf)
ENDIF(XDMF_WRAP_TCL)
IF(XDMF_BUILD_TESTING)
SUBDIRS(Testing)
ENDIF(XDMF_BUILD_TESTING)
IF(NOT XDMF_INSTALL_NO_DEVELOPMENT)
INSTALL_FILES(${XDMF_INSTALL_INCLUDE_DIR} .h
XdmfConfig
Xdmf
XdmfArrayCopyMacro
XdmfDice
XdmfExport
xdmf_expat
XdmfExpr
${XdmfFormatSource}
${XdmfModelSource})
IF(XDMF_HAS_NDGM)
INSTALL_FILES(${XDMF_INSTALL_INCLUDE_DIR} .h
${XdmfNdgmSource})
ENDIF(XDMF_HAS_NDGM)
ENDIF(NOT XDMF_INSTALL_NO_DEVELOPMENT)
IF(NOT XDMF_INSTALL_NO_LIBRARIES)
IF(PV_INSTALL_HAS_CMAKE_24)
INSTALL(TARGETS Xdmf
RUNTIME DESTINATION ${PV_INSTALL_BIN_DIR_CM24} COMPONENT Runtime
LIBRARY DESTINATION ${PV_INSTALL_LIB_DIR_CM24} COMPONENT Runtime
ARCHIVE DESTINATION ${PV_INSTALL_LIB_DIR_CM24} COMPONENT Development)
ELSE(PV_INSTALL_HAS_CMAKE_24)
INSTALL_TARGETS(${XDMF_INSTALL_LIB_DIR} Xdmf)
ENDIF(PV_INSTALL_HAS_CMAKE_24)
IF(XDMF_WRAP_PYTHON)
INSTALL_TARGETS(${XDMF_INSTALL_LIB_DIR} _Xdmf)
ENDIF(XDMF_WRAP_PYTHON)
IF(XDMF_WRAP_TCL)
INSTALL_TARGETS(${XDMF_INSTALL_LIB_DIR} XdmfTCL)
ENDIF(XDMF_WRAP_TCL)
ENDIF(NOT XDMF_INSTALL_NO_LIBRARIES)
# - Check if the source code provided in the SOURCE argument compiles.
# CHECK_CXX_SOURCE_COMPILES(SOURCE VAR)
# - macro which checks if the source code compiles\
# SOURCE - source code to try to compile
# VAR - variable to store size if the type exists.
#
# The following variables may be set before calling this macro to
# modify the way the check is run:
#
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR COMMENT)
IF("HAVE_${VAR}" MATCHES "^HAVE_${VAR}$")
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES)
IF(CMAKE_REQUIRED_INCLUDES)
SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
ELSE(CMAKE_REQUIRED_INCLUDES)
SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
ENDIF(CMAKE_REQUIRED_INCLUDES)
SET(CMAKE_EMPTY_INPUT_FILE_CONTENT "${SOURCE}")
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/CMakeEmptyInputFile.in"
"${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src.cxx")
MESSAGE(STATUS "Performing Test ${COMMENT}")
TRY_RUN(${VAR} HAVE_${VAR}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src.cxx
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
"${CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES}"
"${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
IF(HAVE_${VAR})
SET(${VAR} 1 CACHE INTERNAL "Test ${COMMENT}")
MESSAGE(STATUS "Performing Test ${COMMENT} - Success")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
"Performing C++ SOURCE FILE Test ${COMMENT} succeded with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n")
ELSE(HAVE_${VAR})
MESSAGE(STATUS "Performing Test ${COMMENT} - Failed")
SET(${VAR} "" CACHE INTERNAL "Test ${COMMENT}")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
"Performing C++ SOURCE FILE Test ${COMMENT} failed with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n")
ENDIF(HAVE_${VAR})
ENDIF("HAVE_${VAR}" MATCHES "^HAVE_${VAR}$")
ENDMACRO(CHECK_CXX_SOURCE_RUNS)
#!/bin/sh
# \
grep "static void \*SwigXdmf" XdmfJava.cxx | sed -e "1,$ s/static//g" | sed -e "1,$ s/void \*//g" | sed -e "1,$ s/{//g" > PointerConverters
# \
exec tclsh8.4 $0 $@
set Code {
if ( strcmp( Request, "SWIGSTRING" ) == 0 ){
NewPtr = SWIGSUBROUTINE;
*( void **)&ReturnValue = NewPtr;
}
}
# set ofd stdout
set ofd [ open XdmfJava.cxx a+ ]
set fd [ open PointerConverters r ]
puts $ofd {extern "C"}
puts $ofd "JNIEXPORT jlong Java_Xdmf_XdmfCastPointer(JNIEnv *jenv, jclass jcls, jlong jarg0, jstring jarg1) {"
puts $ofd { void *NewPtr, *ptr = *( void **)&jarg0;}
puts $ofd { XdmfString Request;}
puts $ofd { jlong ReturnValue = 0;}
puts $ofd {}
puts $ofd { Request = (jarg1) ? (char *)jenv->GetStringUTFChars(jarg1, 0) : NULL;}
while { [ eof $fd ] == 0 } {
set SwigRoutine [ string trim [ gets $fd ] ]
if { [ eof $fd ] == 0 } {
set SwigString $SwigRoutine
regsub -all Swig $SwigString {} SwigString
regsub -all {\(ptr\)} $SwigString {} SwigString
# puts $SwigString
regsub -all SWIGSTRING $Code $SwigString CodeOut
regsub -all SWIGSUBROUTINE $CodeOut $SwigRoutine CodeOut
puts $ofd $CodeOut
}
}
puts $ofd { if(Request) jenv->ReleaseStringUTFChars(jarg1, Request); }
puts $ofd { return( ReturnValue );}
puts $ofd "}"
close $ofd
set ifd [ open Xdmf.java r ]
set txt [ read $ifd ]
close $ifd
regsub "}" $txt "public final static native long XdmfCastPointer( long jarg0, String jarg1);
}" otxt
set ofd [ open Xdmf.java w ]
puts $ofd $otxt
close $ofd
<hr>
<img SRC="dice.gif" height=50 width=82 align=CENTER>
<font color="#000099">e</font><font color="#CC0000">X</font><font color="#000099">tensible </font><font color="#CC0000">D</font><font color="#000099">ata </font><font color="#CC0000">M</font><font color="#000099">odel and </font><font color="#CC0000">F</font><font color="#000099">ormat</font>
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.7 [en] (X11; U; IRIX64 6.5 IP28) [Netscape]">
</head>
<body>
<img SRC="dice.gif" height=50 width=82 align=CENTER>
<font color="#000099">e</font><font color="#CC0000">X</font><font color="#000099">tensible </font><font color="#CC0000">D</font><font color="#000099">ata </font><font color="#CC0000">M</font><font color="#000099">odel and </font><font color="#CC0000">F</font><font color="#000099">ormat</font>
This diff is collapsed.
/*******************************************************************/
/* XDMF */
/* eXtensible Data Model and Format */
/* */
/* Id : Id */
/* Date : $Date$ */
/* Version : $Revision$ */
/* */
/* Author: */
/* Jerry A. Clarke */
/* clarke@arl.army.mil */
/* US Army Research Laboratory */
/* Aberdeen Proving Ground, MD */
/* */
/* Copyright @ 2002 US Army Research Laboratory */
/* All Rights Reserved */
/* See Copyright.txt or http://www.arl.hpc.mil/ice for details */
/* */
/* This software is distributed WITHOUT ANY WARRANTY; without */
/* even the implied warranty of MERCHANTABILITY or FITNESS */
/* FOR A PARTICULAR PURPOSE. See the above copyright notice */
/* for more information. */
/* */
/*******************************************************************/
#ifndef H5FDndgm_H
#define H5FDndgm_H
#include "H5Ipublic.h"
#include "H5pubconf.h"
#include "XdmfExport.h"
#define H5FD_NDGM (H5FD_ndgm_init())
XDMF_EXPORT hid_t H5FD_ndgm_init(void);
XDMF_EXPORT herr_t H5Pset_fapl_ndgm(hid_t fapl_id, size_t increment, const char* host);
XDMF_EXPORT herr_t H5Pget_fapl_ndgm(hid_t fapl_id, size_t *increment/*out*/, char **host);
#endif
#!/bin/sh
# \
exec tclsh8.4 $0 $@
proc FixLine { Line } {
regsub -all \{ $Line " __BRACKETBEGIN__ " Line
regsub -all \} $Line " __BRACKETEND__ " Line
regsub -all {\(} $Line " __PARENBEGIN__ " Line
regsub -all {\)} $Line " __PARENEND__ " Line
regsub -all , $Line " __COMMA__ " Line
regsub -all {"} $Line " __QUOTE__ " Line
regsub -all {\<} $Line {} Line
regsub -all {\>} $Line {} Line
regsub -all {&} $Line {} Line
return $Line
}
proc GetNextWord { fd } {
global CurrentIndex
global CurrentLine
# puts "Looking at $CurrentLine"
set StillLooking 1
while { $StillLooking } {
set StillLooking 0
if { $CurrentIndex >= [ llength $CurrentLine ] } {
# puts "Getting New Line"
set CurrentIndex 0
set CurrentLine [ FixLine [ gets $fd ] ]
}
set Word [ lindex $CurrentLine $CurrentIndex ]
incr CurrentIndex
if { ( [ string first "//" $Word ] >= 0 ) } {
# puts "Swallow Comment"
set CurrentIndex [ llength $CurrentLine ]
set StillLooking 1
}
if { ( [ string first "/*" $Word ] >= 0 ) } {
# puts "Begin Comment"
while { [ string first "*/" $Word ] < 0 } {
set Word [ GetNextWord $fd ]
}
# puts "End Comment"
set StillLooking 1
}
}
return $Word
}
proc NewMethod { Method } {
global JavaClass
global CurrentMethod
regsub {\*} $Method {} Method
set Methods {}
if { [ info exists JavaClass(Methods) ] } {
set Methods $JavaClass(Methods)
}
if { [ lsearch $Methods $Method ] != -1 } {
puts "$Method already Exists"
set JavaClass(Arguments,$Method) {}
} else {
set JavaClass(Methods) "$Methods $Method"
set JavaClass(Arguments,$Method) {}
}
set CurrentMethod $Method
}
proc ProcessWord { Word BracketLevel fd } {
global LastWord
global Class
global JavaClass
global ParenLevel
global CurrentMethod
# puts "Process $Word $BracketLevel"
switch $BracketLevel {
0 {
puts "Derived From $Word"
if { [ info exists JavaClass(Extends) ] == 0 } {
set JavaClass(Extends) $Word
} else {
set Implements {}
if { [ info exists JavaClass(Implements) ] } {
set Implements [ array get JavaClass Implements ]
}
set JavaClass(Implements) "$Implements $Word"
}
}
1 {
switch $Word {
XdmfGetValueMacro {
# puts "Begin Macro"
set Paren [ GetNextWord $fd ]
# incr ParenLevel
set What [ GetNextWord $fd ]
set Comma [ GetNextWord $fd ]
set Macro [ format "%s_Get%s" $Class $What ]
# puts "Macro = $Macro"
puts "Method = $Macro"
NewMethod Get$What
set ParamType [ GetNextWord $fd ]
while { $ParamType != "__PARENEND__" } {
# lappend JavaClass(Arguments,$CurrentMethod) $ParamType
set ParamType [ GetNextWord $fd ]
}
set Word $Macro
}
XdmfGetIndexValueMacro {
# puts "Begin Macro"
set Paren [ GetNextWord $fd ]
# incr ParenLevel
set What [ GetNextWord $fd ]
set Comma [ GetNextWord $fd ]
set Macro [ format "%s_Get%s" $Class $What ]
# puts "Macro = $Macro"
puts "Method = $Macro"
NewMethod Get$What
lappend JavaClass(Arguments,$CurrentMethod) long
lappend JavaClass(Arguments,$CurrentMethod) Index
set ParamType [ GetNextWord $fd ]
while { $ParamType != "__PARENEND__" } {
# lappend JavaClass(Arguments,$CurrentMethod) $ParamType
set ParamType [ GetNextWord $fd ]
}
set Word $Macro
}
XdmfSetIndexValueMacro {
puts "Begin Macro"
set Paren [ GetNextWord $fd ]
# incr ParenLevel
set What [ GetNextWord $fd ]
set Comma [ GetNextWord $fd ]
set Macro [ format "%s_Set%s" $Class $What ]
puts "Macro = $Macro"
puts "Method = $Macro"
NewMethod Set$What
lappend JavaClass(Arguments,$CurrentMethod) long
lappend JavaClass(Arguments,$CurrentMethod) Index
lappend JavaClass(Arguments,$CurrentMethod) __COMMA__
set ParamType [ GetNextWord $fd ]
while { $ParamType != "__PARENEND__" } {
lappend JavaClass(Arguments,$CurrentMethod) $ParamType
set ParamType [ GetNextWord $fd ]
}
lappend JavaClass(Arguments,$CurrentMethod) $What
set Word $Macro
}
XdmfSetValueMacro {
puts "Begin Macro"