added support for gecode library
This commit is contained in:
1716
library/gecode/extractor/Doxyfile.in
Normal file
1716
library/gecode/extractor/Doxyfile.in
Normal file
File diff suppressed because it is too large
Load Diff
33
library/gecode/extractor/Makefile
Normal file
33
library/gecode/extractor/Makefile
Normal file
@@ -0,0 +1,33 @@
|
||||
GECODEDIR := $(shell g++ -q $(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 > $@
|
||||
xsltproc extract-prototypes.xsl $< \
|
||||
| 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_SET_EXPORT //g' \
|
||||
| grep -v '*' | sort >> $@
|
||||
|
||||
$(ENUMS): % : xml/namespaceGecode.xml extract-enums.xsl
|
||||
cat notice.py > $@
|
||||
xsltproc extract-enums.xsl $< >> $@
|
||||
|
||||
xml/namespaceGecode.xml: Doxyfile
|
||||
doxygen Doxyfile
|
||||
|
||||
Doxyfile: Doxyfile.in
|
||||
cat $< | sed "s#@GECODEDIR@#$(GECODEDIR)#" > $@
|
||||
|
||||
clean:
|
||||
-rm -rf *~ gecode-prototypes-*.hh gecode-enums-*.py Doxyfile xml
|
2
library/gecode/extractor/README
Normal file
2
library/gecode/extractor/README
Normal file
@@ -0,0 +1,2 @@
|
||||
This directory contains support code for automatically extracting
|
||||
prototypes from the local Gecode installation.
|
31
library/gecode/extractor/extract-enums.xsl
Normal file
31
library/gecode/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
library/gecode/extractor/extract-prototypes.xsl
Normal file
21
library/gecode/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
library/gecode/extractor/gecodedir.hh
Normal file
1
library/gecode/extractor/gecodedir.hh
Normal file
@@ -0,0 +1 @@
|
||||
#include "gecode/kernel.hh"
|
3
library/gecode/extractor/notice.hh
Normal file
3
library/gecode/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
library/gecode/extractor/notice.py
Normal file
3
library/gecode/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