distributed config && float library
This commit is contained in:
1716
packages/gecode/dev/extractor/Doxyfile.in
Normal file
1716
packages/gecode/dev/extractor/Doxyfile.in
Normal file
File diff suppressed because it is too large
Load Diff
36
packages/gecode/dev/extractor/Makefile
Normal file
36
packages/gecode/dev/extractor/Makefile
Normal file
@@ -0,0 +1,36 @@
|
||||
GECODEDIR := $(shell g++ $(CPPFLAGS) $(CXXFLAGS) -H -E gecodedir.hh 2>&1 >/dev/null | grep gecode/kernel.hh | awk '{print $$2}' | sed 's|/kernel.hh||')
|
||||
GECODECONFIG := $(GECODEDIR)/support/config.hpp
|
||||
GECODEVERSION := $(shell cat $(GECODECONFIG) | egrep '\<GECODE_VERSION\>' | awk '{print $$3}' | sed 's/"//g')
|
||||
PROTOTYPES = ../gecode-prototypes-$(GECODEVERSION).hh
|
||||
ENUMS = ../gecode-enums-$(GECODEVERSION).py
|
||||
|
||||
all: $(PROTOTYPES) $(ENUMS)
|
||||
|
||||
$(PROTOTYPES): % : xml/namespaceGecode.xml extract-prototypes.xsl
|
||||
cat notice.hh > $@ || { rm -f $@; exit 1; }
|
||||
xsltproc extract-prototypes.xsl $< \
|
||||
| grep EXPORT \
|
||||
| grep -v Symmetry \
|
||||
| sed 's/Gecode:://g' \
|
||||
| sed 's/< /</g' \
|
||||
| sed 's/ >/>/g' \
|
||||
| sed 's/ \&/\&/g' \
|
||||
| sed 's/, /,/g' \
|
||||
| sed 's/forceinline //g' \
|
||||
| sed 's/GECODE_INT_EXPORT //g' \
|
||||
| sed 's/GECODE_FLOAT_EXPORT //g' \
|
||||
| sed 's/GECODE_SET_EXPORT //g' \
|
||||
| grep -v '*' | sort >> $@ || { rm -f $@; exit 1; }
|
||||
|
||||
$(ENUMS): % : xml/namespaceGecode.xml extract-enums.xsl
|
||||
cat notice.py > $@ || { rm -f $@; exit 1; }
|
||||
xsltproc extract-enums.xsl $< >> $@ || { rm -f $@; exit 1; }
|
||||
|
||||
xml/namespaceGecode.xml: Doxyfile
|
||||
doxygen Doxyfile
|
||||
|
||||
Doxyfile: Doxyfile.in
|
||||
cat $< | sed "s#@GECODEDIR@#$(GECODEDIR)#" > $@ || { rm -f $@; exit 1; }
|
||||
|
||||
clean:
|
||||
-rm -rf *~ gecode-prototypes-*.hh gecode-enums-*.py Doxyfile xml
|
2
packages/gecode/dev/extractor/README
Normal file
2
packages/gecode/dev/extractor/README
Normal file
@@ -0,0 +1,2 @@
|
||||
This directory contains support code for automatically extracting
|
||||
prototypes from the local Gecode installation.
|
31
packages/gecode/dev/extractor/extract-enums.xsl
Normal file
31
packages/gecode/dev/extractor/extract-enums.xsl
Normal file
@@ -0,0 +1,31 @@
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
<xsl:output method="text" version="1.0"/>
|
||||
<xsl:template match="/">
|
||||
<xsl:text>ENUM_CLASSES = []
|
||||
|
||||
</xsl:text>
|
||||
<xsl:for-each select="/doxygen/compounddef/sectiondef[@kind='enum']/memberdef">
|
||||
<xsl:text>class </xsl:text>
|
||||
<xsl:value-of select="name"/>
|
||||
<xsl:text>(object):
|
||||
</xsl:text>
|
||||
<xsl:text> TYPE = '</xsl:text>
|
||||
<xsl:value-of select="name"/>
|
||||
<xsl:text>'
|
||||
ENUM = [</xsl:text>
|
||||
<xsl:for-each select="enumvalue">
|
||||
<xsl:if test="position()!=1"><xsl:text>,</xsl:text></xsl:if>
|
||||
<xsl:text>'</xsl:text>
|
||||
<xsl:value-of select="name"/>
|
||||
<xsl:text>'</xsl:text>
|
||||
</xsl:for-each>
|
||||
<xsl:text>]
|
||||
|
||||
ENUM_CLASSES.append(</xsl:text>
|
||||
<xsl:value-of select="name"/>
|
||||
<xsl:text>)
|
||||
|
||||
</xsl:text>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
21
packages/gecode/dev/extractor/extract-prototypes.xsl
Normal file
21
packages/gecode/dev/extractor/extract-prototypes.xsl
Normal file
@@ -0,0 +1,21 @@
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
<xsl:output method="text" version="1.0"/>
|
||||
<xsl:template match="/">
|
||||
<xsl:for-each select="/doxygen/compounddef/sectiondef[@kind='func']/memberdef[starts-with(@id,'group__TaskModel') and not(starts-with(name,'operator')) and name!='tiebreak' and name!='wait' and not(starts-with(@id,'group__TaskModelMiniModel'))]">
|
||||
<xsl:value-of select="type"/>
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="name"/>
|
||||
<xsl:for-each select="param">
|
||||
<xsl:if test="position()=1"><xsl:text>(</xsl:text></xsl:if>
|
||||
<xsl:if test="position()!=1"><xsl:text>,</xsl:text></xsl:if>
|
||||
<xsl:value-of select="type"/>
|
||||
<xsl:for-each select="defval">
|
||||
<xsl:text>=</xsl:text>
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:for-each>
|
||||
</xsl:for-each>
|
||||
<xsl:text>);
|
||||
</xsl:text>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
1
packages/gecode/dev/extractor/gecodedir.hh
Normal file
1
packages/gecode/dev/extractor/gecodedir.hh
Normal file
@@ -0,0 +1 @@
|
||||
#include "gecode/kernel.hh"
|
3
packages/gecode/dev/extractor/notice.hh
Normal file
3
packages/gecode/dev/extractor/notice.hh
Normal file
@@ -0,0 +1,3 @@
|
||||
// This file was automatically extracted from Gecode source files.
|
||||
// It is subject to the same Copyright as the source files from which
|
||||
// it is derived, and is distributed under the same Licensing conditions.
|
3
packages/gecode/dev/extractor/notice.py
Normal file
3
packages/gecode/dev/extractor/notice.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# This file was automatically extracted from Gecode source files.
|
||||
# It is subject to the same Copyright as the source files from which
|
||||
# it is derived, and is distributed under the same Licensing conditions.
|
Reference in New Issue
Block a user