aurelia-svn Mailing List for Aurelia (Page 3)
Status: Alpha
Brought to you by:
valentindavid
You can subscribe to this list here.
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(8) |
Jul
(30) |
Aug
(5) |
Sep
(6) |
Oct
(13) |
Nov
(2) |
Dec
(5) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2011 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
|
From: <val...@us...> - 2010-07-29 22:36:54
|
Revision: 111
http://aurelia.svn.sourceforge.net/aurelia/?rev=111&view=rev
Author: valentindavid
Date: 2010-07-29 22:36:46 +0000 (Thu, 29 Jul 2010)
Log Message:
-----------
2010-07-29 Valentin David <val...@ii...>
Use pooled memory allocators.
* src/terms/shared_object.hh: Use pooled memory allocator.
Force a pointer to NULL on unlink.
* src/llstack/frame.hh: Use pooled memory allocator.
Share frames.
* src/llstack/queue.hh,
* src/llstack/node.hh,
* src/llstack/node.hpp:
Use pooled memory allocator.
* src/parser_generator/Makefile.am:
Fix a build rule to fail on error.
* src/memory/pool_allocator.hh:
Fix initialization in case the pool is used in globals'
initialization.
* src/threads/specific.hh: New.
* src/threads/Makefile.am: Update.
* configure.ac: Put -lpthread to LIBS.
* aurelia.pc.in: Add LIBS in Libs.
* src/memory/tests/Makefile.am: Remove useless AM_LDFLAGS.
* demos/Makefile.am: Remove useless AM_LDFLAGS.
Disable client-side valgrind use.
* src/sig/tests/Makefile.am:
Fix a rule exit.
Modified Paths:
--------------
trunk/ChangeLog
trunk/aurelia.pc.in
trunk/configure.ac
trunk/demos/Makefile.am
trunk/src/llstack/frame.hh
trunk/src/llstack/node.hh
trunk/src/llstack/node.hpp
trunk/src/llstack/queue.hh
trunk/src/memory/pool_allocator.hh
trunk/src/memory/tests/Makefile.am
trunk/src/parser_generator/Makefile.am
trunk/src/sig/tests/Makefile.am
trunk/src/terms/shared_object.hh
trunk/src/threads/Makefile.am
Added Paths:
-----------
trunk/src/threads/specific.hh
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-29 22:20:23 UTC (rev 110)
+++ trunk/ChangeLog 2010-07-29 22:36:46 UTC (rev 111)
@@ -1,5 +1,41 @@
2010-07-29 Valentin David <val...@ii...>
+ Use pooled memory allocators.
+
+ * src/terms/shared_object.hh: Use pooled memory allocator.
+ Force a pointer to NULL on unlink.
+
+ * src/llstack/frame.hh: Use pooled memory allocator.
+ Share frames.
+
+ * src/llstack/queue.hh,
+ * src/llstack/node.hh,
+ * src/llstack/node.hpp:
+ Use pooled memory allocator.
+
+ * src/parser_generator/Makefile.am:
+ Fix a build rule to fail on error.
+
+ * src/memory/pool_allocator.hh:
+ Fix initialization in case the pool is used in globals'
+ initialization.
+
+ * src/threads/specific.hh: New.
+ * src/threads/Makefile.am: Update.
+
+ * configure.ac: Put -lpthread to LIBS.
+ * aurelia.pc.in: Add LIBS in Libs.
+
+ * src/memory/tests/Makefile.am: Remove useless AM_LDFLAGS.
+
+ * demos/Makefile.am: Remove useless AM_LDFLAGS.
+ Disable client-side valgrind use.
+
+ * src/sig/tests/Makefile.am:
+ Fix a rule exit.
+
+2010-07-29 Valentin David <val...@ii...>
+
* src/strategies/traversals/one.hh:
Fix. Was completely wrong.
Modified: trunk/aurelia.pc.in
===================================================================
--- trunk/aurelia.pc.in 2010-07-29 22:20:23 UTC (rev 110)
+++ trunk/aurelia.pc.in 2010-07-29 22:36:46 UTC (rev 111)
@@ -6,3 +6,4 @@
Version: 0.1
Description: Aurelia - Program transformation environment
Cflags: -I${aureliadir} @EXTRACPPFLAGS@
+Libs: @LIBS@
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2010-07-29 22:20:23 UTC (rev 110)
+++ trunk/configure.ac 2010-07-29 22:36:46 UTC (rev 111)
@@ -115,15 +115,13 @@
AM_CONDITIONAL([BOOTSTRAP], [ test x"$BOOTSTRAP" = xtrue ])
-oldLIBS="$LIBS"
AC_CHECK_HEADERS([pthread.h], [dnl
- AC_CHECK_LIB([pthread], [pthread_create], [dnl
+ AC_SEARCH_LIBS([pthread_create], [pthread], [dnl
true
], [dnl
AC_MSG_ERROR([Found pthread.h, but not -lpthread.])
])
])
-LIBS="$oldLIBS"
AC_CHECK_HEADERS([valgrind/valgrind.h])
Modified: trunk/demos/Makefile.am
===================================================================
--- trunk/demos/Makefile.am 2010-07-29 22:20:23 UTC (rev 110)
+++ trunk/demos/Makefile.am 2010-07-29 22:36:46 UTC (rev 111)
@@ -17,7 +17,7 @@
AM_CPPFLAGS=$(EXTRACPPFLAGS) -I$(top_srcdir)/src \
-I$(top_builddir)/src \
- -DNDEBUG -DSRCDIR="\"$(srcdir)\""
+ -DSRCDIR="\"$(srcdir)\"" -DNVALGRIND
check_PROGRAMS= \
01-terms \
@@ -56,10 +56,5 @@
if HAVE_VALGRIND
TESTS=$(check_PROGRAMS)
-TESTS_ENVIRONMENT=ulimit -s 8192; $(VALGRIND) --leak-check=full --error-exitcode=1 >/dev/null --
+TESTS_ENVIRONMENT=ulimit -s 8192; $(VALGRIND) --leak-check=full --show-reachable=yes --error-exitcode=1 >/dev/null --
endif
-
-if HAVE_PTHREAD_H
-03_threads_LDFLAGS=-lpthread
-04_pools_LDFLAGS=-lpthread
-endif
Modified: trunk/src/llstack/frame.hh
===================================================================
--- trunk/src/llstack/frame.hh 2010-07-29 22:20:23 UTC (rev 110)
+++ trunk/src/llstack/frame.hh 2010-07-29 22:36:46 UTC (rev 111)
@@ -32,9 +32,19 @@
template <typename T>
struct real_frame_helper: public real_frame {
+ void* operator new(size_t t) {
+ assert(t == sizeof(T));
+ return ChunkAlloc<T>::alloc();
+ }
+
+ void operator delete(void *p) {
+ ChunkAlloc<T>::del((T*) p);
+ }
+
virtual real_frame* clone() const {
return new T(*static_cast<const T*>(this));
}
+
virtual bool operator==(const real_frame& other) const {
const T* rother = dynamic_cast<const T*>(&other);
if (rother == NULL)
@@ -57,7 +67,7 @@
struct frame {
private:
- real_frame* rf;
+ std::shared_ptr<real_frame> rf;
unsigned _hash;
public:
@@ -66,15 +76,10 @@
}
frame(const real_frame& rf): rf(rf.clone()), _hash(rf.hash()) {}
- frame(const frame& other): rf(other.rf->clone()), _hash(other._hash) {}
+ frame(const frame& other): rf(other.rf), _hash(other._hash) {}
frame(frame&& other): rf(other.rf), _hash(other._hash) {
- other.rf = NULL;
}
- ~frame() {
- delete rf;
- }
-
frame& operator=(const frame& other) {
return *this = std::move(other);
}
@@ -102,13 +107,15 @@
}
bool operator==(const frame& other) const {
+ if (&*rf == &*other.rf)
+ return true;
return *rf == *(other.rf);
}
struct BadFrame {};
template <typename T>
const T& as() const {
- const T* ret = dynamic_cast<const T*>(rf);
+ const T* ret = dynamic_cast<const T*>(&*rf);
if (ret != NULL)
return *ret;
throw BadFrame();
Modified: trunk/src/llstack/node.hh
===================================================================
--- trunk/src/llstack/node.hh 2010-07-29 22:20:23 UTC (rev 110)
+++ trunk/src/llstack/node.hh 2010-07-29 22:36:46 UTC (rev 111)
@@ -25,6 +25,7 @@
# include <forward_list>
# include "../terms/shared_object.hh"
# include "../streams/buf_stream.hh"
+# include "../memory/pool_allocator.hh"
# include "label.hh"
# include "frame.hh"
# ifndef NDEBUG
@@ -57,8 +58,9 @@
struct node_core {
public:
- typedef std::unordered_set<node> node_set_t;
- typedef std::map<stream, std::forward_list<frame> > p_t;
+ typedef std::forward_list<frame, pool_allocator<frame> > frame_list_t;
+ typedef std::unordered_set<node, std::hash<node>, std::equal_to<node>, pool_allocator<node> > node_set_t;
+ typedef std::map<stream, frame_list_t, std::less<stream>, pool_allocator<std::pair<stream, frame_list_t> > > p_t;
private:
label L;
frame f;
@@ -200,8 +202,8 @@
}
}
- void mark(std::unordered_set<node>& marks) const {
- std::pair<std::unordered_set<node>::iterator, bool> j =
+ void mark(std::unordered_set<node, std::hash<node>, std::equal_to<node>, pool_allocator<node> >& marks) const {
+ std::pair<std::unordered_set<node, std::hash<node>, std::equal_to<node>, pool_allocator<node> >::iterator, bool> j =
marks.insert(*this);
if (j.second) {
for (node_core::node_set_t::const_iterator i =
@@ -248,8 +250,8 @@
}
# endif
- static void clear(std::unordered_set<node> marks
- = std::unordered_set<node>()) {
+ static void clear(std::unordered_set<node, std::hash<node>, std::equal_to<node>, pool_allocator<node> > marks
+ = std::unordered_set<node, std::hash<node>, std::equal_to<node>, pool_allocator<node> >()) {
super::o_map_it i = super::objects().begin();
while (i != super::objects().end()) {
if (marks.find(node(const_cast<super::RealObject*>(&*i)))
Modified: trunk/src/llstack/node.hpp
===================================================================
--- trunk/src/llstack/node.hpp 2010-07-29 22:20:23 UTC (rev 110)
+++ trunk/src/llstack/node.hpp 2010-07-29 22:36:46 UTC (rev 111)
@@ -52,7 +52,7 @@
for (node_core::p_t::iterator k =
ret.P().begin();
k != ret.P().end(); ++k) {
- for (std::forward_list<frame>::iterator l = (*k).second.begin();
+ for (node_core::frame_list_t::iterator l = (*k).second.begin();
l != (*k).second.end(); ++l) {
R.add(ret.get_label(), *l, u, (*k).first);
}
Modified: trunk/src/llstack/queue.hh
===================================================================
--- trunk/src/llstack/queue.hh 2010-07-29 22:20:23 UTC (rev 110)
+++ trunk/src/llstack/queue.hh 2010-07-29 22:36:46 UTC (rev 111)
@@ -20,6 +20,7 @@
# include "node.hh"
# include "label.hh"
# include "frame.hh"
+# include "../memory/pool_allocator.hh"
# include <unordered_map>
namespace aurelia {
@@ -69,8 +70,8 @@
}
};
- typedef std::unordered_set<frame, frame::hash_op, frame::eq> frame_set_t;
- typedef std::unordered_map<ln, frame_set_t, hash, eq> set_t;
+ typedef std::unordered_set<frame, frame::hash_op, frame::eq, pool_allocator<frame> > frame_set_t;
+ typedef std::unordered_map<ln, frame_set_t, hash, eq, pool_allocator<std::pair<ln, frame_set_t> > > set_t;
set_t done;
set_t pending;
};
@@ -90,7 +91,7 @@
struct R_t {
struct Eof {};
- typedef std::map<stream, Rj_t> map_t;
+ typedef std::map<stream, Rj_t, std::less<stream>, pool_allocator<std::pair<stream, Rj_t> > > map_t;
map_t m;
descriptor pop() {
@@ -118,7 +119,7 @@
}
void collect_nodes() const {
- std::unordered_set<node> marks;
+ std::unordered_set<node, std::hash<node>, std::equal_to<node>, pool_allocator<node> > marks;
for (map_t::const_iterator i = m.begin();
i != m.end(); ++i) {
for (Rj_t::set_t::const_iterator j = (*i).second.pending.begin();
Modified: trunk/src/memory/pool_allocator.hh
===================================================================
--- trunk/src/memory/pool_allocator.hh 2010-07-29 22:20:23 UTC (rev 110)
+++ trunk/src/memory/pool_allocator.hh 2010-07-29 22:36:46 UTC (rev 111)
@@ -22,8 +22,11 @@
#ifdef HAVE_PTHREAD_H
# include <pthread.h>
+# include "../threads/specific.hh"
#endif
+# include "../threads/lock.hh"
+
#ifdef HAVE_VALGRIND_VALGRIND_H
# include <valgrind/valgrind.h>
# include <valgrind/memcheck.h>
@@ -41,88 +44,36 @@
#include <forward_list>
#include <cassert>
+#include <iostream>
+
namespace aurelia {
- template <typename For, typename ThreadSafe>
- struct FreePointer {
- private:
- static void* p;
- public:
- enum { key_init = true };
-
- static void* free() {
- return p;
- }
-
- static void set_free(void* other) {
- p=other;
- }
- };
-
-#if defined(HAVE_PTHREAD_H)
- template <typename For>
- struct FreePointer<For, std::true_type> {
- private:
- static pthread_key_t key;
-
- public:
- static bool key_init;
-
- static bool init_key() {
- pthread_key_create(&key, NULL);
- return true;
- }
-
- static void* free() {
- return pthread_getspecific(key);
- }
-
- static void set_free(void* p) {
- pthread_setspecific(key, p);
- }
- };
-#endif
-
- template <typename For, typename ThreadSafe>
- void* FreePointer<For, ThreadSafe>::p;
-
-#if defined(HAVE_PTHREAD_H)
- template <typename For>
- pthread_key_t FreePointer<For, std::true_type>::key;
- template <typename For>
- bool FreePointer<For, std::true_type>::key_init =
- FreePointer<For, std::true_type>::init_key();
-#endif
-
template <int SIZE>
struct BlockList {
private:
std::forward_list<void*> blocks;
- int used;
+#ifdef HAVE_PTHREAD_H
+ Lock _lock;
+#else
+ NoLock _lock;
+#endif
public:
- BlockList(): used(0) {}
+ BlockList() {}
void* new_block() {
void *p = malloc(SIZE);
if (p == NULL)
throw std::bad_alloc();
+ _lock.lock();
blocks.push_front(p);
+ _lock.unlock();
return p;
}
- void operator++() {
- used++;
- }
-
- void operator--() {
- used--;
- }
-
~BlockList() {
- if (used == 0)
- for (std::forward_list<void*>::iterator i = blocks.begin();
- i != blocks.end(); ++i)
- free(*i);
+ for (std::forward_list<void*>::iterator i = blocks.begin();
+ i != blocks.end(); ++i)
+ free(*i);
}
};
@@ -146,25 +97,33 @@
Block *next;
};
- static BlockList<sizeof(Block)*POOL_SIZE> blocks;
-
- static Block* free() {
- return (Block*)FreePointer<ChunkAlloc, ThreadSafe>::free();
+#if defined(HAVE_PTHREAD_H)
+ static Block*& free() {
+ static ThreadSpecific<Block*> _free = NULL;
+ return *_free;
}
- static void set_free(Block* p) {
- FreePointer<ChunkAlloc, ThreadSafe>::set_free((void*)p);
+ static BlockList<sizeof(Block)*POOL_SIZE>& blocks() {
+ static ThreadSpecific<BlockList<sizeof(Block)*POOL_SIZE>, std::true_type> _blocks;
+ return *_blocks;
}
+#else
+ static Block*& free() {
+ static Block* _free = NULL;
+ return *free;
+ }
- static bool init() {
- return (FreePointer<ChunkAlloc, ThreadSafe>::key_init);
+ static BlockList<sizeof(Block)*POOL_SIZE>& blocks() {
+ static BlockList<sizeof(Block)*POOL_SIZE> _blocks;
+ return _blocks;
}
+#endif
static Block* ensure_blocks() {
Block* f = free();
- if ((f == NULL) && init()) {
- f = (Block*)blocks.new_block();
- set_free(f);
+ if (f == NULL) {
+ f = (Block*)blocks().new_block();
+ free() = f;
for (int i = 0; i < (POOL_SIZE - 1); ++i) {
f[i].next = f + i + 1;
}
@@ -179,9 +138,8 @@
Block* n = ensure_blocks();
VALGRIND_MEMPOOL_ALLOC(mempool(), n, sizeof(Block));
VALGRIND_MAKE_MEM_DEFINED(&(n->next), sizeof(Block*));
- set_free(n->next);
+ free() = n->next;
VALGRIND_MAKE_MEM_UNDEFINED(&(n->next), sizeof(Block*));
- ++blocks;
return (void*)&(n->obj);
}
@@ -194,18 +152,11 @@
Block *n = (Block*)(((char*)p) - offset());
n->next = free();
VALGRIND_MEMPOOL_FREE(mempool(), n);
- set_free(n);
- --blocks;
+ free() = n;
}
};
-
template <typename T,
- typename ThreadSafe,
- int POOL_SIZE>
- BlockList<sizeof(typename ChunkAlloc<T, ThreadSafe, POOL_SIZE>::Block)*POOL_SIZE> ChunkAlloc<T, ThreadSafe, POOL_SIZE>::blocks;
-
- template <typename T,
typename ThreadSafe = std::true_type,
int POOL_SIZE = 4096,
typename RealAlloc = ChunkAlloc<T, ThreadSafe, POOL_SIZE> >
Modified: trunk/src/memory/tests/Makefile.am
===================================================================
--- trunk/src/memory/tests/Makefile.am 2010-07-29 22:20:23 UTC (rev 110)
+++ trunk/src/memory/tests/Makefile.am 2010-07-29 22:36:46 UTC (rev 111)
@@ -31,9 +31,5 @@
TESTS=$(check_PROGRAMS)
if HAVE_VALGRIND
-TESTS_ENVIRONMENT=ulimit -s 8192; $(VALGRIND) --leak-check=full --error-exitcode=1 >/dev/null --
+TESTS_ENVIRONMENT=ulimit -s 8192; $(VALGRIND) --leak-check=full --show-reachable=yes --error-exitcode=1 >/dev/null --
endif
-
-if HAVE_PTHREAD_H
-AM_LDFLAGS=-lpthread
-endif
Modified: trunk/src/parser_generator/Makefile.am
===================================================================
--- trunk/src/parser_generator/Makefile.am 2010-07-29 22:20:23 UTC (rev 110)
+++ trunk/src/parser_generator/Makefile.am 2010-07-29 22:36:46 UTC (rev 111)
@@ -55,6 +55,11 @@
mv -f syntax.hh.tmp syntax.hh; \
else \
rm -f syntax.hh.tmp; \
+ exit 1; \
fi
SUBDIRS=tests
+
+if HAVE_PTHREAD_H
+AM_LDFLAGS=-lpthread
+endif
Modified: trunk/src/sig/tests/Makefile.am
===================================================================
--- trunk/src/sig/tests/Makefile.am 2010-07-29 22:20:23 UTC (rev 110)
+++ trunk/src/sig/tests/Makefile.am 2010-07-29 22:36:46 UTC (rev 111)
@@ -35,6 +35,7 @@
mv -f stratego.hh.tmp stratego.hh; \
else \
rm -f stratego.hh.tmp; \
+ exit 1; \
fi
TESTS=test
Modified: trunk/src/terms/shared_object.hh
===================================================================
--- trunk/src/terms/shared_object.hh 2010-07-29 22:20:23 UTC (rev 110)
+++ trunk/src/terms/shared_object.hh 2010-07-29 22:36:46 UTC (rev 111)
@@ -22,6 +22,7 @@
*/
# include "../threads/lock.hh"
+# include "../memory/pool_allocator.hh"
# include <unordered_set>
namespace aurelia {
@@ -98,6 +99,7 @@
return ;
}
o->ref_lock.unlock();
+ o = NULL;
}
public:
@@ -141,7 +143,7 @@
};
protected:
- typedef std::unordered_set<RealObject, ROhash, ROeq> o_map;
+ typedef std::unordered_set<RealObject, ROhash, ROeq, pool_allocator<RealObject> > o_map;
typedef typename o_map::iterator o_map_it;
static Lock& map_lock() {
Modified: trunk/src/threads/Makefile.am
===================================================================
--- trunk/src/threads/Makefile.am 2010-07-29 22:20:23 UTC (rev 110)
+++ trunk/src/threads/Makefile.am 2010-07-29 22:36:46 UTC (rev 111)
@@ -18,4 +18,5 @@
threadsdir=$(aureliadir)/threads
threads_HEADERS= \
lock.hh \
- thread.hh
+ thread.hh \
+ specific.hh
Added: trunk/src/threads/specific.hh
===================================================================
--- trunk/src/threads/specific.hh (rev 0)
+++ trunk/src/threads/specific.hh 2010-07-29 22:36:46 UTC (rev 111)
@@ -0,0 +1,102 @@
+// This file is a part of Aurelia.
+// Copyright (C) 2010 Valentin David
+// Copyright (C) 2010 University of Bergen
+//
+// 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/>.
+#ifndef __SPECIFIC_HH
+# define __SPECIFIC_HH
+
+# include <forward_list>
+# include "lock.hh"
+
+namespace aurelia {
+
+ template <typename T, typename AtLast>
+ struct Destructor {
+ void add(void *) const {
+ }
+ static void d(void *p) {
+ delete (T*)p;
+ }
+ };
+
+ template <typename T>
+ struct Destructor<T, std::true_type> {
+ private:
+ Lock lock;
+ std::forward_list<T*> todestroy;
+
+ public:
+ void add(void *p) {
+ lock.lock();
+ todestroy.push_front((T*)p);
+ lock.unlock();
+ }
+ ~Destructor() {
+ for (typename std::forward_list<T*>::iterator i = todestroy.begin();
+ i != todestroy.end(); ++i)
+ delete *i;
+ }
+ static void d(void *) {
+ }
+ };
+
+ template <typename T, typename DestroyAtLast = std::false_type>
+ struct ThreadSpecific {
+ private:
+ T value;
+ pthread_key_t key;
+ Destructor<T, DestroyAtLast> dest;
+
+ T& get() const {
+ void *p = pthread_getspecific(key);
+ if (p == NULL) {
+ p = new T(value);
+ pthread_setspecific(key, p);
+ (const_cast<Destructor<T, DestroyAtLast>*>(&dest))->add(p);
+ }
+ return *(T*)p;
+ }
+
+ static void destructor(void *p) {
+ Destructor<T, DestroyAtLast>::d(p);
+ }
+
+ public:
+ ThreadSpecific(): value() {
+ pthread_key_create(&key, destructor);
+ }
+
+ ThreadSpecific(const T& value): value(value) {
+ pthread_key_create(&key, destructor);
+ }
+
+ ~ThreadSpecific() {
+ void *last_bit = pthread_getspecific(key);
+ pthread_key_delete(key);
+ destructor(last_bit);
+ }
+
+ T& operator*() {
+ return get();
+ }
+
+ const T& operator*() const {
+ return get();
+ }
+ };
+
+}
+
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-29 22:20:29
|
Revision: 110
http://aurelia.svn.sourceforge.net/aurelia/?rev=110&view=rev
Author: valentindavid
Date: 2010-07-29 22:20:23 +0000 (Thu, 29 Jul 2010)
Log Message:
-----------
2010-07-29 Valentin David <val...@ii...>
* src/strategies/traversals/one.hh:
Fix. Was completely wrong.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/strategies/traversals/one.hh
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-29 17:53:53 UTC (rev 109)
+++ trunk/ChangeLog 2010-07-29 22:20:23 UTC (rev 110)
@@ -1,5 +1,10 @@
2010-07-29 Valentin David <val...@ii...>
+ * src/strategies/traversals/one.hh:
+ Fix. Was completely wrong.
+
+2010-07-29 Valentin David <val...@ii...>
+
Add no-lock thread-safe generic pool allocator to be used later
for efficiency.
Modified: trunk/src/strategies/traversals/one.hh
===================================================================
--- trunk/src/strategies/traversals/one.hh 2010-07-29 17:53:53 UTC (rev 109)
+++ trunk/src/strategies/traversals/one.hh 2010-07-29 22:20:23 UTC (rev 110)
@@ -34,50 +34,32 @@
template <typename T>
T operator()(const T& term) const {
- if (term.constructor().arity()) {
- unsigned i = 0;
- T *list = NULL;
- try {
- list = (T*)malloc(term.constructor().arity()
- *sizeof(T));
- if (list == NULL)
- throw Failure();
- for (;
- i < term.constructor().arity();
- ++i) {
- try {
- T success = s(term[i]);
- new (list+i) T(success);
- break ;
- } catch (Failure) {
- new (list+i) T(term[i]);
- if (diff_no_conv(list[i], term[i])) {
- free(list);
- return term;
- }
+ unsigned arity = term.constructor().arity();
+ if (arity > 0) {
+ for (unsigned i = 0;
+ i < arity;
+ ++i) {
+ try {
+ T success = s(term[i]);
+ if (diff_no_conv(success, term[i])) {
+ return term;
}
+ T *list = (T*)malloc(arity
+ *sizeof(T));
+ for (unsigned j = 0; j < arity; ++j) {
+ if (j == i)
+ new (list+j) T(success);
+ else
+ new (list+j) T(term[j]);
+ }
+ return T(term.constructor(), list);
+ } catch (Failure) {
}
- if (i == term.constructor().arity())
- throw Failure();
- for (;
- i < term.constructor().arity();
- ++i) {
- new (list+i) T(term[i]);
- }
+ throw Failure();
}
- catch (...) {
- if (list == NULL)
- throw ;
- for (unsigned j = 0; j < i; ++j) {
- (list+j)->~T();
- }
- free(list);
- throw ;
- }
- return T(term.constructor(), list);
}
- else
- throw Failure();
+ else
+ throw Failure();
}
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-29 17:53:59
|
Revision: 109
http://aurelia.svn.sourceforge.net/aurelia/?rev=109&view=rev
Author: valentindavid
Date: 2010-07-29 17:53:53 +0000 (Thu, 29 Jul 2010)
Log Message:
-----------
2010-07-29 Valentin David <val...@ii...>
Add no-lock thread-safe generic pool allocator to be used later
for efficiency.
* configure.ac: Update AC_OUTPUT. Check for valgrind.h.
* src/aurelia-config.hh.in: Define HAVE_VALGRIND_VALGRIND_H
* src/memory/tests/Makefile.am,
* src/memory/tests/test_pool.cc,
* src/memory/Makefile.am,
* src/memory/pool_allocator.hh:
New.
* src/Makefile.am (SUBDIRS): Update.
Modified Paths:
--------------
trunk/ChangeLog
trunk/configure.ac
trunk/src/Makefile.am
trunk/src/aurelia-config.hh.in
Added Paths:
-----------
trunk/src/memory/
trunk/src/memory/Makefile.am
trunk/src/memory/pool_allocator.hh
trunk/src/memory/tests/
trunk/src/memory/tests/Makefile.am
trunk/src/memory/tests/test_pool.cc
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-28 15:54:01 UTC (rev 108)
+++ trunk/ChangeLog 2010-07-29 17:53:53 UTC (rev 109)
@@ -1,3 +1,19 @@
+2010-07-29 Valentin David <val...@ii...>
+
+ Add no-lock thread-safe generic pool allocator to be used later
+ for efficiency.
+
+ * configure.ac: Update AC_OUTPUT. Check for valgrind.h.
+ * src/aurelia-config.hh.in: Define HAVE_VALGRIND_VALGRIND_H
+
+ * src/memory/tests/Makefile.am,
+ * src/memory/tests/test_pool.cc,
+ * src/memory/Makefile.am,
+ * src/memory/pool_allocator.hh:
+ New.
+
+ * src/Makefile.am (SUBDIRS): Update.
+
2010-07-28 Valentin David <val...@ii...>
* src/parser_generator/syntax.csf: Build tree.
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2010-07-28 15:54:01 UTC (rev 108)
+++ trunk/configure.ac 2010-07-29 17:53:53 UTC (rev 109)
@@ -125,6 +125,8 @@
])
LIBS="$oldLIBS"
+AC_CHECK_HEADERS([valgrind/valgrind.h])
+
AC_ARG_VAR([VALGRIND], [set valgrind path for testing])
AC_CHECK_PROGS([VALGRIND], [valgrind])
@@ -158,6 +160,8 @@
demos-from-rascal/Makefile
demos-from-stratego/Makefile
demos/Makefile
+ src/memory/Makefile
+ src/memory/tests/Makefile
src/type_traits/Makefile
src/terms/Makefile
src/strategies/Makefile
Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am 2010-07-28 15:54:01 UTC (rev 108)
+++ trunk/src/Makefile.am 2010-07-29 17:53:53 UTC (rev 109)
@@ -16,6 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
SUBDIRS= \
+ memory \
type_traits \
llstack \
patterns \
Modified: trunk/src/aurelia-config.hh.in
===================================================================
--- trunk/src/aurelia-config.hh.in 2010-07-28 15:54:01 UTC (rev 108)
+++ trunk/src/aurelia-config.hh.in 2010-07-29 17:53:53 UTC (rev 109)
@@ -48,6 +48,9 @@
/* Define to 1 if you have the <cxxabi.h> header file. */
#undef HAVE_CXXABI_H
+/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
+#undef HAVE_VALGRIND_VALGRIND_H
+
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
Property changes on: trunk/src/memory
___________________________________________________________________
Added: svn:ignore
+ Makefile.in
Makefile
Added: trunk/src/memory/Makefile.am
===================================================================
--- trunk/src/memory/Makefile.am (rev 0)
+++ trunk/src/memory/Makefile.am 2010-07-29 17:53:53 UTC (rev 109)
@@ -0,0 +1,22 @@
+# This file is a part of Aurelia.
+# Copyright (C) 2010 Valentin David
+# Copyright (C) 2010 University of Bergen
+#
+# 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/>.
+
+SUBDIRS=tests
+
+memorydir=$(aureliadir)/memory
+memory_HEADERS= \
+ pool_allocator.hh
Added: trunk/src/memory/pool_allocator.hh
===================================================================
--- trunk/src/memory/pool_allocator.hh (rev 0)
+++ trunk/src/memory/pool_allocator.hh 2010-07-29 17:53:53 UTC (rev 109)
@@ -0,0 +1,254 @@
+// This file is a part of Aurelia.
+// Copyright (C) 2010 Valentin David
+// Copyright (C) 2010 University of Bergen
+//
+// 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/>.
+
+#ifndef __POOL_ALLOCATOR_HH
+# define __POOL_ALLOCATOR_HH
+
+#include <aurelia-config.hh>
+
+#ifdef HAVE_PTHREAD_H
+# include <pthread.h>
+#endif
+
+#ifdef HAVE_VALGRIND_VALGRIND_H
+# include <valgrind/valgrind.h>
+# include <valgrind/memcheck.h>
+#else
+# define VALGRIND_CREATE_MEMPOOL(X, Y, Z)
+# define VALGRIND_MAKE_MEM_NOACCESS(X, Y)
+# define VALGRIND_MEMPOOL_ALLOC(X, Y, Z)
+# define VALGRIND_MEMPOOL_FREE(X, Y)
+# define VALGRIND_MAKE_MEM_DEFINED(X, Y)
+# define VALGRIND_MAKE_MEM_UNDEFINED(X, Y)
+#endif
+
+#include <cstdlib>
+#include <memory>
+#include <forward_list>
+#include <cassert>
+
+namespace aurelia {
+
+ template <typename For, typename ThreadSafe>
+ struct FreePointer {
+ private:
+ static void* p;
+ public:
+ enum { key_init = true };
+
+ static void* free() {
+ return p;
+ }
+
+ static void set_free(void* other) {
+ p=other;
+ }
+ };
+
+#if defined(HAVE_PTHREAD_H)
+ template <typename For>
+ struct FreePointer<For, std::true_type> {
+ private:
+ static pthread_key_t key;
+
+ public:
+ static bool key_init;
+
+ static bool init_key() {
+ pthread_key_create(&key, NULL);
+ return true;
+ }
+
+ static void* free() {
+ return pthread_getspecific(key);
+ }
+
+ static void set_free(void* p) {
+ pthread_setspecific(key, p);
+ }
+ };
+#endif
+
+ template <typename For, typename ThreadSafe>
+ void* FreePointer<For, ThreadSafe>::p;
+
+#if defined(HAVE_PTHREAD_H)
+ template <typename For>
+ pthread_key_t FreePointer<For, std::true_type>::key;
+ template <typename For>
+ bool FreePointer<For, std::true_type>::key_init =
+ FreePointer<For, std::true_type>::init_key();
+#endif
+
+ template <int SIZE>
+ struct BlockList {
+ private:
+ std::forward_list<void*> blocks;
+ int used;
+ public:
+ BlockList(): used(0) {}
+
+ void* new_block() {
+ void *p = malloc(SIZE);
+ if (p == NULL)
+ throw std::bad_alloc();
+ blocks.push_front(p);
+ return p;
+ }
+
+ void operator++() {
+ used++;
+ }
+
+ void operator--() {
+ used--;
+ }
+
+ ~BlockList() {
+ if (used == 0)
+ for (std::forward_list<void*>::iterator i = blocks.begin();
+ i != blocks.end(); ++i)
+ free(*i);
+ }
+ };
+
+ template <typename T,
+ typename ThreadSafe = std::true_type,
+ int POOL_SIZE = 4096>
+ struct ChunkAlloc {
+ private:
+ static const void* mempool() {
+ static bool init = false;
+ if (!init) {
+ init = true;
+ VALGRIND_CREATE_MEMPOOL(&typeid(ChunkAlloc), 0, false);
+ }
+ return &typeid(ChunkAlloc);
+ }
+
+ union Block {
+ char obj[sizeof(T)]
+ __attribute__ ((aligned (__alignof__(T))));
+ Block *next;
+ };
+
+ static BlockList<sizeof(Block)*POOL_SIZE> blocks;
+
+ static Block* free() {
+ return (Block*)FreePointer<ChunkAlloc, ThreadSafe>::free();
+ }
+
+ static void set_free(Block* p) {
+ FreePointer<ChunkAlloc, ThreadSafe>::set_free((void*)p);
+ }
+
+ static bool init() {
+ return (FreePointer<ChunkAlloc, ThreadSafe>::key_init);
+ }
+
+ static Block* ensure_blocks() {
+ Block* f = free();
+ if ((f == NULL) && init()) {
+ f = (Block*)blocks.new_block();
+ set_free(f);
+ for (int i = 0; i < (POOL_SIZE - 1); ++i) {
+ f[i].next = f + i + 1;
+ }
+ f[POOL_SIZE-1].next = NULL;
+ VALGRIND_MAKE_MEM_NOACCESS(f, sizeof(Block)*POOL_SIZE);
+ }
+ return f;
+ }
+
+ public:
+ static void *alloc() {
+ Block* n = ensure_blocks();
+ VALGRIND_MEMPOOL_ALLOC(mempool(), n, sizeof(Block));
+ VALGRIND_MAKE_MEM_DEFINED(&(n->next), sizeof(Block*));
+ set_free(n->next);
+ VALGRIND_MAKE_MEM_UNDEFINED(&(n->next), sizeof(Block*));
+ ++blocks;
+ return (void*)&(n->obj);
+ }
+
+ static size_t offset() {
+ Block n;
+ return (n.obj - (char*)&n);
+ }
+
+ static void del(void *p) {
+ Block *n = (Block*)(((char*)p) - offset());
+ n->next = free();
+ VALGRIND_MEMPOOL_FREE(mempool(), n);
+ set_free(n);
+ --blocks;
+ }
+ };
+
+
+ template <typename T,
+ typename ThreadSafe,
+ int POOL_SIZE>
+ BlockList<sizeof(typename ChunkAlloc<T, ThreadSafe, POOL_SIZE>::Block)*POOL_SIZE> ChunkAlloc<T, ThreadSafe, POOL_SIZE>::blocks;
+
+ template <typename T,
+ typename ThreadSafe = std::true_type,
+ int POOL_SIZE = 4096,
+ typename RealAlloc = ChunkAlloc<T, ThreadSafe, POOL_SIZE> >
+ struct pool_allocator {
+ typedef size_t size_type;
+ typedef T* pointer;
+ typedef T& reference;
+ typedef const T* const_pointer;
+ typedef const T& const_reference;
+ typedef T value_type;
+
+ template <typename U>
+ struct rebind {
+ typedef pool_allocator<U, ThreadSafe, POOL_SIZE> other;
+ };
+
+ template <typename U>
+ pool_allocator(const pool_allocator<U>&) {}
+ pool_allocator() {}
+
+ pointer allocate(size_type n) {
+ if (n == 1)
+ return (pointer)RealAlloc::alloc();
+ std::allocator<T> a;
+ return a.allocate(n);
+ }
+
+ void deallocate(pointer p, size_type n) {
+ if (n == 1)
+ return RealAlloc::del(p);
+ std::allocator<T> a;
+ a.deallocate(p, n);
+ }
+
+ void destroy(pointer p) {
+ p->~T();
+ }
+
+ void construct(pointer p, const T& t) {
+ new (p) T(t);
+ }
+ };
+
+}
+
+#endif
Property changes on: trunk/src/memory/tests
___________________________________________________________________
Added: svn:ignore
+ Makefile.in
test_pool
.deps
test_pool_no_valgrind
test_pool_no_thread
Makefile
Added: trunk/src/memory/tests/Makefile.am
===================================================================
--- trunk/src/memory/tests/Makefile.am (rev 0)
+++ trunk/src/memory/tests/Makefile.am 2010-07-29 17:53:53 UTC (rev 109)
@@ -0,0 +1,39 @@
+# This file is a part of Aurelia.
+# Copyright (C) 2010 Valentin David
+# Copyright (C) 2010 University of Bergen
+#
+# 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/>.
+
+AM_CPPFLAGS= \
+ -I$(top_srcdir)/src \
+ -I$(top_builddir)/src \
+ $(EXTRACPPFLAGS)
+
+check_PROGRAMS=test_pool test_pool_no_valgrind test_pool_no_thread
+
+test_pool_SOURCES=test_pool.cc
+test_pool_no_valgrind_SOURCES=test_pool.cc
+test_pool_no_valgrind_CPPFLAGS=-DNVALGRIND $(AM_CPPFLAGS)
+test_pool_no_thread_SOURCES=test_pool.cc
+test_pool_no_thread_CPPFLAGS=-DTS=std::false_type $(AM_CPPFLAGS)
+
+TESTS=$(check_PROGRAMS)
+
+if HAVE_VALGRIND
+TESTS_ENVIRONMENT=ulimit -s 8192; $(VALGRIND) --leak-check=full --error-exitcode=1 >/dev/null --
+endif
+
+if HAVE_PTHREAD_H
+AM_LDFLAGS=-lpthread
+endif
Added: trunk/src/memory/tests/test_pool.cc
===================================================================
--- trunk/src/memory/tests/test_pool.cc (rev 0)
+++ trunk/src/memory/tests/test_pool.cc 2010-07-29 17:53:53 UTC (rev 109)
@@ -0,0 +1,79 @@
+// This file is a part of Aurelia.
+// Copyright (C) 2010 Valentin David
+// Copyright (C) 2010 University of Bergen
+//
+// 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/>.
+
+#include <memory/pool_allocator.hh>
+#include <cassert>
+#include <list>
+
+#ifndef TS
+# define TS std::true_type
+#endif
+#define A 10
+#define B 256
+#define SIZE 128
+
+using namespace aurelia;
+
+struct Foo {
+
+#ifndef REF
+ void *operator new(size_t s) {
+ assert(sizeof(Foo) == s);
+ return ChunkAlloc<Foo, TS, SIZE>::alloc();
+ }
+
+ void operator delete(void* p) {
+ return ChunkAlloc<Foo, TS, SIZE>::del(p);
+ }
+#endif
+
+ int a;
+ int b;
+};
+
+int main() {
+#ifndef REF
+# define ALLOCATOR , pool_allocator<Foo*, TS, SIZE>
+#else
+# define ALLOCATOR
+#endif
+ std::list<Foo* ALLOCATOR> l;
+ std::list<Foo* ALLOCATOR> l2;
+
+ for (int i = 0; i < B; ++i) {
+ l2.push_front(new Foo());
+ }
+
+ for (int j = 0; j < A; ++j) {
+ for (int i = 0; i < B; ++i) {
+ l.push_front(new Foo());
+ }
+
+ for (std::list<Foo*>::iterator i = l.begin();
+ i != l.end(); ++i) {
+ delete (*i);
+ }
+ l.clear();
+ }
+
+ for (std::list<Foo*>::iterator i = l2.begin();
+ i != l2.end(); ++i) {
+ delete (*i);
+ }
+
+ return 0;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-28 15:54:07
|
Revision: 108
http://aurelia.svn.sourceforge.net/aurelia/?rev=108&view=rev
Author: valentindavid
Date: 2010-07-28 15:54:01 +0000 (Wed, 28 Jul 2010)
Log Message:
-----------
2010-07-28 Valentin David <val...@ii...>
* src/parser_generator/syntax.csf: Build tree.
* src/parser_generator/parser_gen.cc: Insert label code.
* src/parser_generator/syntax.cc:
Add necessary environment for the labels' execution.
* src/llstack/queue.hh:
Fix memory bug.
* src/llstack/node.hh:
Remove an unused variable.
* src/llstack/frame.hh:
Add rvalue reference constructor and assignment.
* src/streams/buf_stream.hh:
Hash. Add printing function. Add string building from range.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/llstack/frame.hh
trunk/src/llstack/node.hh
trunk/src/llstack/queue.hh
trunk/src/parser_generator/parser_gen.cc
trunk/src/parser_generator/syntax.cc
trunk/src/parser_generator/syntax.csf
trunk/src/streams/buf_stream.hh
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-26 17:17:32 UTC (rev 107)
+++ trunk/ChangeLog 2010-07-28 15:54:01 UTC (rev 108)
@@ -1,3 +1,23 @@
+2010-07-28 Valentin David <val...@ii...>
+
+ * src/parser_generator/syntax.csf: Build tree.
+ * src/parser_generator/parser_gen.cc: Insert label code.
+
+ * src/parser_generator/syntax.cc:
+ Add necessary environment for the labels' execution.
+
+ * src/llstack/queue.hh:
+ Fix memory bug.
+
+ * src/llstack/node.hh:
+ Remove an unused variable.
+
+ * src/llstack/frame.hh:
+ Add rvalue reference constructor and assignment.
+
+ * src/streams/buf_stream.hh:
+ Hash. Add printing function. Add string building from range.
+
2010-07-26 Valentin David <val...@ii...>
* src/parser_generator/syntax.csf:
Modified: trunk/src/llstack/frame.hh
===================================================================
--- trunk/src/llstack/frame.hh 2010-07-26 17:17:32 UTC (rev 107)
+++ trunk/src/llstack/frame.hh 2010-07-28 15:54:01 UTC (rev 108)
@@ -67,18 +67,21 @@
frame(const real_frame& rf): rf(rf.clone()), _hash(rf.hash()) {}
frame(const frame& other): rf(other.rf->clone()), _hash(other._hash) {}
+ frame(frame&& other): rf(other.rf), _hash(other._hash) {
+ other.rf = NULL;
+ }
+
~frame() {
delete rf;
}
- void swap(frame* other) {
- real_frame* t = other->rf;
- other->rf = this->rf;
- this->rf = t;
+ frame& operator=(const frame& other) {
+ return *this = std::move(other);
}
- frame& operator=(frame other) {
- other.swap(this);
+ frame& operator=(frame&& other) {
+ std::swap(rf, other.rf);
+ std::swap(_hash, other._hash);
return *this;
}
Modified: trunk/src/llstack/node.hh
===================================================================
--- trunk/src/llstack/node.hh 2010-07-26 17:17:32 UTC (rev 107)
+++ trunk/src/llstack/node.hh 2010-07-28 15:54:01 UTC (rev 108)
@@ -218,7 +218,7 @@
# ifndef NDEBUG
static void printnodes(std::ostream& o) {
- int status;
+ //int status;
super::o_map_it i = super::objects().begin();
o << "digraph g {" << std::endl;
while (i != super::objects().end()) {
Modified: trunk/src/llstack/queue.hh
===================================================================
--- trunk/src/llstack/queue.hh 2010-07-26 17:17:32 UTC (rev 107)
+++ trunk/src/llstack/queue.hh 2010-07-28 15:54:01 UTC (rev 108)
@@ -96,8 +96,9 @@
descriptor pop() {
map_t::iterator i = m.begin();
while ((*i).second.pending.empty()) {
+ stream s = (*i).first;
m.erase(i);
- node::drop((*i).first);
+ node::drop(s);
collect_nodes();
i = m.begin();
if (i == m.end())
Modified: trunk/src/parser_generator/parser_gen.cc
===================================================================
--- trunk/src/parser_generator/parser_gen.cc 2010-07-26 17:17:32 UTC (rev 107)
+++ trunk/src/parser_generator/parser_gen.cc 2010-07-28 15:54:01 UTC (rev 108)
@@ -241,27 +241,51 @@
V sym, attr;
AttrChainElt[attr, Symbol[sym, NoArg]] = t;
std::string toparse = to_cxx_id(*sym);
+
std::cout << "template <>" << std::endl;
std::cout << "struct branch<" << nt_name
<< "," << index << "," << index_l << "> {" << std::endl;
- std::cout << " typedef ";
- if (index_l > 0)
- std::cout << "drop_ret<";
- std::cout << "parse_symbol<" << toparse
- << ", " << nt_name << "_" << index
- << "_" << index_l << ", branch<" << nt_name
- << "," << index << "," << index_l+1 << "> > ";
- if (index_l > 0)
- std::cout << "> ";
- std::cout << "res;"
- << std::endl;
+ try {
+ V attrcode;
+ V params;
+ static C Some("Some", 1);
+ static C AttrRule("AttrRule", 2);
+
+ Some[AttrRule[params, attrcode]] = *attr;
+ std::cout << " struct res {" << std::endl;
+ std::cout << " void operator()(R_t& R, const frame& f, stream& s, const node& cu) const {" << std::endl;
+ std::cout << ((get_cons_name < undouble_quote)(*attrcode)) << std::endl;
+ std::cout << " parse_symbol<" << toparse
+ << ", " << nt_name << "_" << index
+ << "_" << index_l << ", branch<" << nt_name
+ << "," << index << "," << index_l+1 << "> > next;"
+ << std::endl;
+ std::cout << " next(R, next_frame, s, cu);" << std::endl;
+ std::cout << " }" << std::endl;
+ std::cout << " unsigned hash() const {" << std::endl;
+ std::cout << " return (unsigned)&typeid(res);" << std::endl;
+ std::cout << " }" << std::endl;
+ std::cout << " };" << std::endl;
+ } catch (Failure) {
+ std::cout << " typedef ";
+ if (index_l > 0)
+ std::cout << "drop_ret<";
+ std::cout << "parse_symbol<" << toparse
+ << ", " << nt_name << "_" << index
+ << "_" << index_l << ", branch<" << nt_name
+ << "," << index << "," << index_l+1 << "> > ";
+ if (index_l > 0)
+ std::cout << "> ";
+ std::cout << "res;"
+ << std::endl;
+ }
std::cout << "};" <<std::endl;
-
} catch (Failure) {
try {
V s, attr;
AttrChainElt[attr, String[s]] = t;
int i = fresh();
+
std::cout << "struct str_"<<i<<" {" <<std::endl;
std::cout << " static const char* str;" << std::endl;
std::cout << "};" << std::endl;
@@ -275,17 +299,39 @@
<< "," << index
<< "," << index_l << "> {" << std::endl;
- std::cout << " typedef ";
- if (index_l > 0)
- std::cout << "drop_ret<";
- std::cout << "parse_string<str_"
- << i << ", branch<" << nt_name
- << "," << index << "," << index_l + 1
- << "> > ";
- if (index_l > 0)
- std::cout << "> ";
- std::cout << "res;" << std::endl;
+ try {
+ V attrcode;
+ V params;
+ static C Some("Some", 1);
+ static C AttrRule("AttrRule", 2);
+ Some[AttrRule[params, attrcode]] = *attr;
+ std::cout << " struct res {" << std::endl;
+ std::cout << " void operator()(R_t& R, const frame& f, stream& s, const node& cu) const {" << std::endl;
+ std::cout << ((get_cons_name < undouble_quote)(*attrcode)) << std::endl;
+ std::cout << " parse_string<str_"
+ << i << ", branch<" << nt_name
+ << "," << index << "," << index_l + 1
+ << "> > next;" << std::endl;
+ std::cout << " next(R, next_frame, s, cu);" << std::endl;
+ std::cout << " }" << std::endl;
+ std::cout << " unsigned hash() const {" << std::endl;
+ std::cout << " return (unsigned)&typeid(res);" << std::endl;
+ std::cout << " }" << std::endl;
+ std::cout << " };" << std::endl;
+ } catch (Failure) {
+ std::cout << " typedef ";
+ if (index_l > 0)
+ std::cout << "drop_ret<";
+ std::cout << "parse_string<str_"
+ << i << ", branch<" << nt_name
+ << "," << index << "," << index_l + 1
+ << "> > ";
+ if (index_l > 0)
+ std::cout << "> ";
+ std::cout << "res;" << std::endl;
+ }
+
std::cout << "};" << std::endl;
} catch (Failure) {
V s, attr;
@@ -344,9 +390,7 @@
std::cout << " struct res {" << std::endl;
std::cout << " void operator()(R_t& R, const frame& f, stream& s, const node& cu) const {" << std::endl;
std::cout << ((get_cons_name < undouble_quote)(*attrcode)) << std::endl;
- std::cout << " pop<branch<" << nt_name << ","
- << index << "," << s << "> > next;" << std::endl;
- std::cout << " next(R, f, s, cu);" << std::endl;
+ std::cout << " cu.pop(R, ret, s);" << std::endl;
std::cout << " }" << std::endl;
std::cout << " unsigned hash() const {" << std::endl;
std::cout << " return (unsigned)&typeid(res);" << std::endl;
@@ -418,10 +462,10 @@
T operator()(const T& in) {
static C Rule("Rule", 4);
static V NoParam = T(C("NoParam"));
- static V Void = T(C("Void"));
- V l, nt;
+ //static V Void = T(C("Void"));
+ V l, nt, return_type;
- Rule[nt, NoParam, Void, l] = in;
+ Rule[nt, NoParam, return_type, l] = in;
if (set[*nt])
throw Failure();
try {
@@ -533,12 +577,12 @@
T operator()(const T& in) {
static C Rule("Rule", 4);
static V NoParam = T(C("NoParam"));
- static V Void = T(C("Void"));
+ //static V Void = T(C("Void"));
static C Chain("Chain", 2);
- V l, nt, attr, chain;
+ V l, nt, attr, chain, return_type;
- Rule[nt, NoParam, Void, l] = in;
+ Rule[nt, NoParam, return_type, l] = in;
char_set_t c;
map(try_(scope(attr,
scope(chain,
@@ -658,11 +702,11 @@
T operator()(const T& in) {
static C Rule("Rule", 4);
static V NoParam = T(C("NoParam"));
- static V Void = T(C("Void"));
+ //static V Void = T(C("Void"));
- V l, nt;
+ V l, nt, return_type;
- Rule[nt, NoParam, Void, l] = in;
+ Rule[nt, NoParam, return_type, l] = in;
char_set_t c;
std::cerr << "rule: " << in << std::endl;
@@ -797,11 +841,11 @@
static C Chain("Chain", 2);
static C Rule("Rule", 4);
static V NoParam = T(C("NoParam"));
- static V Void = T(C("Void"));
+ //static V Void = T(C("Void"));
- V l, nt;
+ V l, nt, return_type;
- Rule[nt, NoParam, Void, l] = in;
+ Rule[nt, NoParam, return_type, l] = in;
std::string nt_name = to_cxx_id(*nt);
map_index(gen_branch(nt_name))(*l);
std::cout << "struct " << nt_name << " {" << std::endl;
@@ -1003,10 +1047,10 @@
static C Rule("Rule", 4);
static C Chain("Chain", 2);
static V NoParam = T(C("NoParam"));
- static V Void = T(C("Void"));
- V l, nt, chain, attr;
+ //static V Void = T(C("Void"));
+ V l, nt, chain, attr, return_type;
- Rule[nt, NoParam, Void, l] = t;
+ Rule[nt, NoParam, return_type, l] = t;
std::cout << "/*" << *nt << "*/" << std::endl;
int i = 0;
@@ -1095,11 +1139,11 @@
static C Rule("Rule", 4);
static C Chain("Chain", 2);
static V NoParam = T(C("NoParam"));
- static V Void = T(C("Void"));
+ //static V Void = T(C("Void"));
- V l, nt, chain, attr;
+ V l, nt, chain, attr, return_type;
- Rule[nt, NoParam, Void, l] = t;
+ Rule[nt, NoParam, return_type, l] = t;
map(scope(chain, scope(attr, ~Chain[chain, attr] < !chain <
get_bin_empty_r(build_empty, &data))))(*l);
@@ -1123,10 +1167,10 @@
static C Rule("Rule", 4);
static C Chain("Chain", 2);
static V NoParam = T(C("NoParam"));
- static V Void = T(C("Void"));
- V l, nt;
+ //static V Void = T(C("Void"));
+ V l, nt, return_type;
- Rule[nt, NoParam, Void, l] = t;
+ Rule[nt, NoParam, return_type, l] = t;
int rule = 0;
for (T rt = *l; rt.constructor() == C::AS_LIST; rt = rt[1], ++rule) {
@@ -1163,13 +1207,13 @@
static C Rule("Rule", 4);
static V NoParam = T(C("NoParam"));
- static V Void = T(C("Void"));
+ //static V Void = T(C("Void"));
- V l, nt;
+ V l, nt, return_type;
std::cout << "enum nonterm {" << std::endl;
map(scope(nt, scope(l,
- ~Rule[nt, NoParam, Void, l]
+ ~Rule[nt, NoParam, return_type, l]
< !nt
< [](const T& t) {
std::cout << " NT_" << to_cxx_id(t)
@@ -1215,7 +1259,7 @@
std::cout << "const unsigned char follow[NUM_NT][32] = {" << std::endl;
map(scope(nt,
scope(l,
- ~Rule[nt, NoParam, Void, l]
+ ~Rule[nt, NoParam, return_type, l]
< !nt
< [&build_follow](const T& t) {
std::cout << " /*" << t << "*/ {";
@@ -1229,7 +1273,7 @@
map(scope(nt,
scope(l,
- ~Rule[nt, NoParam, Void, l]
+ ~Rule[nt, NoParam, return_type, l]
< !l
< [&nt](const T& t) {
std::cout << "struct " << to_cxx_id(*nt)
Modified: trunk/src/parser_generator/syntax.cc
===================================================================
--- trunk/src/parser_generator/syntax.cc 2010-07-26 17:17:32 UTC (rev 107)
+++ trunk/src/parser_generator/syntax.cc 2010-07-28 15:54:01 UTC (rev 108)
@@ -23,9 +23,18 @@
#include "streams/buf_stream.hh"
#include "llstack/label.hh"
#include "llstack/node.hpp"
+#include "terms/term.hh"
using namespace aurelia;
using namespace llstack;
+struct Main {};
+typedef Term<Main> T;
+typedef Constructor<Main> C;
+
+frame pop_void(const frame& f) {
+ return f.as<ret_frame<VoidReturn> >().parent;
+}
+
#include "syntax.hh"
bool found;
Modified: trunk/src/parser_generator/syntax.csf
===================================================================
--- trunk/src/parser_generator/syntax.csf 2010-07-26 17:17:32 UTC (rev 107)
+++ trunk/src/parser_generator/syntax.csf 2010-07-28 15:54:01 UTC (rev 108)
@@ -17,6 +17,7 @@
}
}
}
+ VoidReturn ret;
$ |
$ if (!s.eof()) {
switch (*s) {
@@ -33,9 +34,10 @@
if (*next == '/')
return ;
}
- }
+ }
}
}
+ VoidReturn ret;
$
LAYOUT+ ::= LAYOUT LAYOUT?
@@ -49,13 +51,22 @@
Range ::= Char "-" Char
RangesOrChars ::= Range RangesOrChars? | Char RangesOrChars?
RangesOrChars? ::= RangesOrChars |
- ClassChar ::= "[" RangesOrChars "]"
- | "[" "^" RangesOrChars "]"
+ ClassChar ::= $ ret_frame<stream> next_frame(f, s); $ "[" $ frame next_frame(f); $ RangesOrChars $ frame next_frame(pop_void(f)); $ "]"
+ $
+ ret_frame<stream> rf0 = f.as<ret_frame<stream> >();
+ T ret(C("\"" + stream_range_to_string(rf0.t, s) + "\"", 0));
+ $
+ | $ ret_frame<stream> next_frame(f, s); $ "[" $ frame next_frame(f); $ "^" $ frame next_frame(f); $ RangesOrChars $ frame next_frame(pop_void(f)); $ "]"
+ $
+ ret_frame<stream> rf0 = f.as<ret_frame<stream> >();
+ T ret(C("\"" + stream_range_to_string(rf0.t, s) + "\"", 0));
+ $
+
SymbolChar ::= [A-Z] | [a-z] | "*" | "?" | "+" | "-" | "_"
SymbolChar+ ::= SymbolChar SymbolChar*
SymbolChar* ::= SymbolChar+ |
- Symbol ::= SymbolChar+ $
+ Symbol ::= $ ret_frame<stream> next_frame(f, s); $ SymbolChar+ $
if (!s.eof()) {
switch (*s) {
case '*':
@@ -70,48 +81,153 @@
if (((*s) >= 'a') && (*s) <= 'z')
return ;
}
+ ret_frame<VoidReturn> rf0 = f.as<ret_frame<VoidReturn> >();
+ ret_frame<stream> rf1 = rf0.parent.as<ret_frame<stream> >();
+ T ret(C("\"" + stream_range_to_string(rf1.t, s) + "\"", 0));
$
StringChar ::= [^\"\\] | "\\" SpecialChar
StringChar+ ::= StringChar StringChar*
StringChar* ::= StringChar+ |
- String ::= "\"" StringChar* "\""
+ String ::= $ ret_frame<stream> next_frame(f, s); $ "\""
+ $ frame next_frame(f); $ StringChar* $ frame next_frame(pop_void(f)); $ "\""
+ $
+ ret_frame<stream> rf0 = f.as<ret_frame<stream> >();
+ T ret(C("\"" + stream_range_to_string(rf0.t, s) + "\"", 0));
+ $
Rule ::=
- Symbol LAYOUT? ParameterList LAYOUT? RetType LAYOUT? "::=" LAYOUT? ListOfChains
+ Symbol $ frame next_frame(f); $ //rf7
+ LAYOUT? $ frame next_frame(f); $ //rf6
+ ParameterList $ frame next_frame(f); $ //rf5
+ LAYOUT? $ frame next_frame(f); $ //rf4
+ RetType $ frame next_frame(f); $ //rf3
+ LAYOUT? $ frame next_frame(f); $ //rf2
+ "::=" $ frame next_frame(f); $
+ LAYOUT? $ frame next_frame(f); $ //rf1
+ ListOfChains //rf0
+ $
+ ret_frame<T> rf0 = f.as<ret_frame<T> >();
+ ret_frame<VoidReturn> rf1 = rf0.parent.as<ret_frame<VoidReturn> >();
+ ret_frame<VoidReturn> rf2 = rf1.parent.as<ret_frame<VoidReturn> >();
+ ret_frame<T> rf3 = rf2.parent.as<ret_frame<T> >();
+ ret_frame<VoidReturn> rf4 = rf3.parent.as<ret_frame<VoidReturn> >();
+ ret_frame<T> rf5 = rf4.parent.as<ret_frame<T> >();
+ ret_frame<VoidReturn> rf6 = rf5.parent.as<ret_frame<VoidReturn> >();
+ ret_frame<T> rf7 = rf6.parent.as<ret_frame<T> >();
+ T ret(C("Rule", 4), (rf7.t, rf5.t, rf3.t, rf0.t));
+ $
- S ::= LAYOUT? SS LAYOUT?
- SS ::= Rule LAYOUT? SSS
- SSS ::= SS |
+ S ::= LAYOUT? SS LAYOUT? $
+ ret_frame<VoidReturn> rf0 = f.as<ret_frame<VoidReturn> >();
+ ret_frame<T> rf1 = rf0.parent.as<ret_frame<T> >();
+ std::cerr << rf1.t << std::endl;
+ VoidReturn ret;
+ $
+ SS ::= Rule $ frame next_frame(f); $ LAYOUT? $ frame next_frame(f); $ SSS
+ $
+ ret_frame<T> rf0 = f.as<ret_frame<T> >();
+ ret_frame<VoidReturn> rf1 = rf0.parent.as<ret_frame<VoidReturn> >();
+ ret_frame<T> rf2 = rf1.parent.as<ret_frame<T> >();
+ T ret(C::AS_LIST, (rf2.t, rf0.t));
+ $
+ SSS ::= SS $
+ ret_frame<T> rf0 = f.as<ret_frame<T> >();
+ T ret(rf0.t);
+ $
+ | $ T ret(C::AS_EMPTY_LIST); $
- ParameterList ::= "(" LAYOUT? Parameters LAYOUT? ")" |
- LocalParameters ::= "{" LAYOUT? Parameters LAYOUT? "}" |
+ ParameterList ::=
+ "(" LAYOUT? Parameters $ frame next_frame(f); $ LAYOUT? $ frame next_frame(f); $ ")"
+ $ T ret = f.as<ret_frame<VoidReturn> >().parent.as<ret_frame<T> >().t; $
+ | $ T ret(C("NoParam")); $
- ListOfChains ::= Chain LAYOUT? AttrRule? LAYOUT? ListOfChainsTail
- ListOfChainsTail ::= "|" LAYOUT? ListOfChains |
+ LocalParameters ::= "{" LAYOUT? Parameters $ frame next_frame(f); $ LAYOUT? $ frame next_frame(f); $ "}"
+ $ T ret(C("Some", 1), f.as<ret_frame<VoidReturn> >().parent.as<ret_frame<T> >().t); $
+ | $ T ret(C("None")); $
- RetType ::= ":" LAYOUT? CxxType |
+ ListOfChains ::= Chain $ frame next_frame(f); $ LAYOUT? $ frame next_frame(pop_void(f)); $ AttrRule? $ frame next_frame(f); $ LAYOUT? $ frame next_frame(pop_void(f)); $ ListOfChainsTail
+ $
+ ret_frame<T> rf0 = f.as<ret_frame<T> >();
+ ret_frame<T> rf1 = rf0.parent.as<ret_frame<T> >();
+ ret_frame<T> rf2 = rf1.parent.as<ret_frame<T> >();
+ T ret(C::AS_LIST, (T(C("Chain", 2), (rf2.t, rf1.t)), rf0.t));
+ $
+ ListOfChainsTail ::= "|" LAYOUT? ListOfChains $
+ ret_frame<T> rf0 = f.as<ret_frame<T> >();
+ T ret(rf0.t);
+ $
+ | $ T ret(C::AS_EMPTY_LIST); $
+
+ RetType ::= ":" LAYOUT? CxxType
+ $ ret_frame<T> rf0 = f.as<ret_frame<T> >();
+ T ret = rf0.t;
+ $
+ | $ T ret(C("Void")); $
+
Chain ::=
- NonEmptyChain |
+ NonEmptyChain $
+ ret_frame<T> rf0 = f.as<ret_frame<T> >();
+ T ret(rf0.t);
+ $
+ | $ T ret(C::AS_EMPTY_LIST); $
NonEmptyChain ::=
- AttrRule? LAYOUT? ChainElt LAYOUT? Chain
+ AttrRule? $ frame next_frame(f); $ LAYOUT? $ frame next_frame(pop_void(f)); $ ChainElt $ frame next_frame(f); $ LAYOUT? $ frame next_frame(pop_void(f)); $ Chain
+ $
+ ret_frame<T> rf0 = f.as<ret_frame<T> >();
+ ret_frame<T> rf1 = rf0.parent.as<ret_frame<T> >();
+ ret_frame<T> rf2 = rf1.parent.as<ret_frame<T> >();
+ T ret(C::AS_LIST, (T(C("AttrChainElt", 2), (rf2.t, rf1.t)), rf0.t));
+ $
AttrRule ::=
- LocalParameters LAYOUT? "$" CxxCode "$"
+ LocalParameters $ frame next_frame(f); $ LAYOUT? $ frame next_frame(f); $ "$" $ ret_frame<stream> next_frame(f, s); $ CxxCode $ ret_frame<stream> next_frame(f, s); $ "$"
+ $
+ ret_frame<stream> rf0 = f.as<ret_frame<stream> >();
+ ret_frame<VoidReturn> rf1 = rf0.parent.as<ret_frame<VoidReturn> >();
+ ret_frame<stream> rf2 = rf1.parent.as<ret_frame<stream> >();
+ ret_frame<VoidReturn> rf3 = rf2.parent.as<ret_frame<VoidReturn> >();
+ ret_frame<T> rf4 = rf3.parent.as<ret_frame<T> >();
+ T ret(C("AttrRule", 2), (rf4.t,
+ T(C("\"" + stream_range_to_string(rf2.t, rf0.t) + "\"", 0))));
+ $
ChainElt ::=
- String | ClassChar
+ String
+ $ T ret(C("String", 1), f.as<ret_frame<T> >().t); $
+ | ClassChar
+ $ T ret(C("Class", 1), f.as<ret_frame<T> >().t); $
| Symbol LAYOUT? ArgumentList
+ $ ret_frame<T> rf0 = f.as<ret_frame<T> >();
+ ret_frame<T> rf1 = rf0.parent.as<ret_frame<T> >();
+ T ret(C("Symbol", 2), (rf1.t, rf0.t)); $
- ArgumentList ::= "(" LAYOUT? Arguments LAYOUT? ")" |
+ ArgumentList ::= "(" LAYOUT? Arguments $ frame next_frame(f); $ LAYOUT? $ frame next_frame(pop_void(f)); $ ")" $
+ ret_frame<T> rf0 = f.as<ret_frame<T> >();
+ T ret(C("Args", 1), rf0.t);
+ $
+ | $ T ret(C("NoArg")); $
- OtherArguments ::= "," LAYOUT? Arguments |
+ OtherArguments ::= "," LAYOUT? Arguments $
+ ret_frame<T> rf0 = f.as<ret_frame<T> >();
+ T ret(rf0.t);
+ $
+ | $ T ret(C::AS_EMPTY_LIST); $
- Arguments ::= Argument LAYOUT? OtherArguments
+ Arguments ::= Argument $ frame next_frame(f); $ LAYOUT? $ frame next_frame(pop_void(f)); $ OtherArguments
+ $
+ ret_frame<T> rf0 = f.as<ret_frame<T> >();
+ ret_frame<T> rf1 = rf0.parent.as<ret_frame<T> >();
+ T ret(C::AS_LIST, (rf1.t, rf0.t));
+ $
- Argument ::= CxxExpression
+ Argument ::= $ ret_frame<stream> next_frame(f, s); $ CxxExpression $
+ ret_frame<VoidReturn> rf0 = f.as<ret_frame<VoidReturn> >();
+ ret_frame<stream> rf1 = rf0.parent.as<ret_frame<stream> >();
+ T ret(C("\"" + stream_range_to_string(rf1.t, s) + "\"", 0));
+ $
CxxExpression ::= CxxIdentifier
| CxxExpression LAYOUT? "." LAYOUT? CxxIdentifier
@@ -120,19 +236,54 @@
CxxCode? ::= CxxCode |
CxxChar ::= [^$]
- Parameter ::= CxxType LAYOUT CxxIdentifier
+ Parameter ::= CxxType $ frame next_frame(f); $ LAYOUT $ frame next_frame(f); $ CxxIdentifier
+ $
+ ret_frame<T> rf0 = f.as<ret_frame<T> >();
+ ret_frame<VoidReturn> rf1 = rf0.parent.as<ret_frame<VoidReturn> >();
+ ret_frame<T> rf2 = rf1.parent.as<ret_frame<T> >();
+ T ret(C("Parameter", 2), (rf2.t, rf0.t));
+ $
- CxxType ::= CxxIdentifier LAYOUT? TemplateArguments LAYOUT? ContCxxType
+ CxxType ::= $ ret_frame<stream> next_frame(f, s); $ CxxIdentifier $ frame next_frame(f); $ LAYOUT? $ frame next_frame(f); $ TemplateArguments $ frame next_frame(f); $ LAYOUT? $ frame next_frame(f); $ ContCxxType
+ $
+ ret_frame<VoidReturn> rf0 = f.as<ret_frame<VoidReturn> >();
+ ret_frame<VoidReturn> rf1 = rf0.parent.as<ret_frame<VoidReturn> >();
+ ret_frame<VoidReturn> rf2 = rf1.parent.as<ret_frame<VoidReturn> >();
+ ret_frame<VoidReturn> rf3 = rf2.parent.as<ret_frame<VoidReturn> >();
+ ret_frame<VoidReturn> rf4 = rf3.parent.as<ret_frame<VoidReturn> >();
+ ret_frame<stream> rf5 = rf4.parent.as<ret_frame<stream> >();
+ T ret(C("\"" + stream_range_to_string(rf5.t, s) + "\"", 0));
+ $
ContCxxType ::= "::" LAYOUT? CxxType |
TemplateArguments ::= "<" LAYOUT? CxxTypes LAYOUT? ">" |
CxxTypes ::= CxxType LAYOUT CCT
CCT ::= "," LAYOUT? CxxType |
- AttrRule? ::= AttrRule |
+ AttrRule? ::= AttrRule
+ $ T ret(T(C("Some", 1), f.as<ret_frame<T> >().t)); $
+ |
+ $ T ret(T(C("None"))); $
- Parameters ::= Parameter LAYOUT? CParameters
- CParameters ::= "," LAYOUT? Parameters |
+ Parameters ::= Parameter $ frame next_frame(f); $ LAYOUT? $ frame next_frame(f); $ CParameters
+ $
+ ret_frame<T> rf0 = f.as<ret_frame<T> >();
+ ret_frame<VoidReturn> rf1 = rf0.parent.as<ret_frame<VoidReturn> >();
+ ret_frame<T> rf2 = rf1.parent.as<ret_frame<T> >();
+ T ret(C::AS_LIST, (rf2.t, rf0.t));
+ $
- CxxIdentifier ::= [A-Za-z_] CIS
+ CParameters ::= "," LAYOUT? Parameters $
+ ret_frame<T> rf0 = f.as<ret_frame<T> >();
+ T ret(rf0.t);
+ $
+ | $ T ret(C::AS_EMPTY_LIST); $
+
+ CxxIdentifier ::= $ ret_frame<stream> next_frame(f, s); $ [A-Za-z_] $ frame next_frame(f); $ CIS
+ $
+ ret_frame<VoidReturn> rf0 = f.as<ret_frame<VoidReturn> >();
+ ret_frame<VoidReturn> rf1 = rf0.parent.as<ret_frame<VoidReturn> >();
+ ret_frame<stream> rf2 = rf1.parent.as<ret_frame<stream> >();
+ T ret(C("\"" + stream_range_to_string(rf2.t, s) + "\"", 0));
+ $
CIS ::= [A-Za-z_0-9] CIS |
Modified: trunk/src/streams/buf_stream.hh
===================================================================
--- trunk/src/streams/buf_stream.hh 2010-07-26 17:17:32 UTC (rev 107)
+++ trunk/src/streams/buf_stream.hh 2010-07-28 15:54:01 UTC (rev 108)
@@ -20,6 +20,7 @@
# include <forward_list>
# include <istream>
+# include <sstream>
namespace aurelia {
@@ -39,12 +40,18 @@
int pos;
public:
+ unsigned hash() const;
+
int get_pos() const {
return pos;
}
bool operator==(const buf_stream_iterator& other) const;
+ bool operator!=(const buf_stream_iterator& other) const {
+ return !(*this == other);
+ }
+
bool operator<(const buf_stream_iterator& other) const {
return pos < other.pos;
}
@@ -93,6 +100,7 @@
std::istream* real_stream;
std::forward_list<rc_char> buf;
int start;
+ unsigned _hash;
#ifndef NDEBUG
int size;
#endif
@@ -121,8 +129,14 @@
#ifndef NDEBUG
, size(0)
#endif
- {}
+ {
+ _hash = (unsigned)&s;
+ }
+ unsigned hash() const {
+ return _hash;
+ }
+
buf_stream& operator=(buf_stream other) {
this->swap(other);
return *this;
@@ -235,6 +249,13 @@
std::swap(i, other.i);
}
+unsigned buf_stream_iterator::hash() const {
+ //!FIXME: -1 should have the same hash as EOF
+ unsigned hash = (unsigned)pos;
+ hash = (hash << 11) | (hash >> 21);
+ hash ^= s->hash();
+}
+
bool buf_stream_iterator::operator==(const buf_stream_iterator& other) const {
if (pos == -1) {
return s->is_end(other.i);
@@ -247,6 +268,20 @@
typedef buf_stream_iterator stream;
+ std::string stream_range_to_string(stream begin, const stream& end) {
+ std::stringstream ret;
+ while (begin != end) {
+ ret << *begin;
+ ++begin;
+ }
+ return ret.str();
+ }
+
+ template <typename Stream>
+ Stream& operator<<(Stream& s, const stream& i) {
+ s << "(stream:" << i.get_pos() << ")";
+ return s;
+ }
}
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-26 17:17:38
|
Revision: 107
http://aurelia.svn.sourceforge.net/aurelia/?rev=107&view=rev
Author: valentindavid
Date: 2010-07-26 17:17:32 +0000 (Mon, 26 Jul 2010)
Log Message:
-----------
2010-07-26 Valentin David <val...@ii...>
* src/parser_generator/syntax.csf:
Filter symbol names. Fix layout lexical filtering code.
* src/parser_generator/parser_gen.cc:
Inject code from last labels.
* src/llstack/node.hh:
Fix graph dump.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/llstack/node.hh
trunk/src/parser_generator/parser_gen.cc
trunk/src/parser_generator/syntax.csf
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-26 16:20:16 UTC (rev 106)
+++ trunk/ChangeLog 2010-07-26 17:17:32 UTC (rev 107)
@@ -1,5 +1,16 @@
2010-07-26 Valentin David <val...@ii...>
+ * src/parser_generator/syntax.csf:
+ Filter symbol names. Fix layout lexical filtering code.
+
+ * src/parser_generator/parser_gen.cc:
+ Inject code from last labels.
+
+ * src/llstack/node.hh:
+ Fix graph dump.
+
+2010-07-26 Valentin David <val...@ii...>
+
* src/parser_generator/tests/gamma_2.cc,
* src/parser_generator/tests/Makefile.am,
* src/parser_generator/tests/gamma_2.csf,
Modified: trunk/src/llstack/node.hh
===================================================================
--- trunk/src/llstack/node.hh 2010-07-26 16:20:16 UTC (rev 106)
+++ trunk/src/llstack/node.hh 2010-07-26 17:17:32 UTC (rev 107)
@@ -224,9 +224,9 @@
while (i != super::objects().end()) {
super::RealObject* ro = const_cast<super::RealObject*>(&*i);
- o << "n_" << typeid((ro->data()->get_label())).name()
+ o << "n_" << ro->data()->get_label().hash()
<< "_" << ro->data()->get_pos() << " [label=\""
- << DEMANGLE(typeid((ro->data()->get_label())).name())
+ << ro->data()->get_label().hash()
<< ", " << ro->data()->get_pos() << "\"];" << std::endl;
++i;
@@ -237,9 +237,9 @@
for (node_core::node_set_t::const_iterator j =
ro->data()->get_parents().begin();
j != ro->data()->get_parents().end(); ++j) {
- o << "n_" <<typeid((ro->data()->get_label())).name()
+ o << "n_" << (ro->data()->get_label().hash())
<< "_" << ro->data()->get_pos() << " -> " << "n_"
- << typeid(((*j).get_label())).name() << "_"
+ << ((*j).get_label()).hash() << "_"
<< (*j).pos() << ";" << std::endl;
}
i++;
Modified: trunk/src/parser_generator/parser_gen.cc
===================================================================
--- trunk/src/parser_generator/parser_gen.cc 2010-07-26 16:20:16 UTC (rev 106)
+++ trunk/src/parser_generator/parser_gen.cc 2010-07-26 17:17:32 UTC (rev 107)
@@ -334,8 +334,28 @@
std::cout << "template <>" << std::endl;
std::cout << "struct branch<" << nt_name << ","
<< index << "," << s << "> {" << std::endl;
- std::cout << " typedef pop<branch<" << nt_name << ","
- << index << "," << s << "> > res;" << std::endl;
+ try {
+ V attrcode;
+ V params;
+ static C Some("Some", 1);
+ static C AttrRule("AttrRule", 2);
+
+ Some[AttrRule[params, attrcode]] = *attr;
+ std::cout << " struct res {" << std::endl;
+ std::cout << " void operator()(R_t& R, const frame& f, stream& s, const node& cu) const {" << std::endl;
+ std::cout << ((get_cons_name < undouble_quote)(*attrcode)) << std::endl;
+ std::cout << " pop<branch<" << nt_name << ","
+ << index << "," << s << "> > next;" << std::endl;
+ std::cout << " next(R, f, s, cu);" << std::endl;
+ std::cout << " }" << std::endl;
+ std::cout << " unsigned hash() const {" << std::endl;
+ std::cout << " return (unsigned)&typeid(res);" << std::endl;
+ std::cout << " }" << std::endl;
+ std::cout << " };" << std::endl;
+ } catch (Failure) {
+ std::cout << " typedef pop<branch<" << nt_name << ","
+ << index << "," << s << "> > res;" << std::endl;
+ }
std::cout << "};" << std::endl;
return t;
}
@@ -786,7 +806,7 @@
map_index(gen_branch(nt_name))(*l);
std::cout << "struct " << nt_name << " {" << std::endl;
std::cout << " enum { NT = NT_" << nt_name << " };" << std::endl;
- std::cout << " virtual void operator()(R_t& R, "
+ std::cout << " void operator()(R_t& R, "
<< "const frame& f, stream& s, const node& cu) const {"
<< std::endl;
int i = 0;
Modified: trunk/src/parser_generator/syntax.csf
===================================================================
--- trunk/src/parser_generator/syntax.csf 2010-07-26 16:20:16 UTC (rev 106)
+++ trunk/src/parser_generator/syntax.csf 2010-07-26 17:17:32 UTC (rev 107)
@@ -6,14 +6,15 @@
case '\n':
case '\t':
return ;
- case '/';
+ case '/':
+ {
buf_stream_iterator next = s;
++next;
if (!next.eof()) {
if (*next == '/')
return ;
}
- default:
+ }
}
}
$ |
@@ -24,14 +25,15 @@
case '\n':
case '\t':
return ;
- case '/';
+ case '/':
+ {
buf_stream_iterator next = s;
++next;
if (!next.eof()) {
if (*next == '/')
return ;
}
- default:
+ }
}
}
$
@@ -53,7 +55,22 @@
SymbolChar ::= [A-Z] | [a-z] | "*" | "?" | "+" | "-" | "_"
SymbolChar+ ::= SymbolChar SymbolChar*
SymbolChar* ::= SymbolChar+ |
- Symbol ::= SymbolChar+
+ Symbol ::= SymbolChar+ $
+ if (!s.eof()) {
+ switch (*s) {
+ case '*':
+ case '?':
+ case '+':
+ case '-':
+ case '_':
+ return ;
+ }
+ if (((*s) >= 'A') && (*s) <= 'Z')
+ return ;
+ if (((*s) >= 'a') && (*s) <= 'z')
+ return ;
+ }
+ $
StringChar ::= [^\"\\] | "\\" SpecialChar
StringChar+ ::= StringChar StringChar*
@@ -64,7 +81,7 @@
Symbol LAYOUT? ParameterList LAYOUT? RetType LAYOUT? "::=" LAYOUT? ListOfChains
S ::= LAYOUT? SS LAYOUT?
- SS ::= Rule SSS
+ SS ::= Rule LAYOUT? SSS
SSS ::= SS |
ParameterList ::= "(" LAYOUT? Parameters LAYOUT? ")" |
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-26 16:20:22
|
Revision: 106
http://aurelia.svn.sourceforge.net/aurelia/?rev=106&view=rev
Author: valentindavid
Date: 2010-07-26 16:20:16 +0000 (Mon, 26 Jul 2010)
Log Message:
-----------
2010-07-26 Valentin David <val...@ii...>
* src/parser_generator/tests/gamma_2.cc,
* src/parser_generator/tests/Makefile.am,
* src/parser_generator/tests/gamma_2.csf,
* src/parser_generator/tests/input.txt,
* src/parser_generator/tests/force-deps.mk:
New.
* src/parser_generator/Makefile.am, configure.ac:
Update.
* src/terms/constructor.hh, src/terms/term.hh:
Use larger shift for hashing.
* src/llstack/label.hh:
Wrap std::function instead of using virtual for manipulating labels.
* src/llstack/queue.hh, src/llstack/node.hh,
* src/llstack/node.hpp, src/llstack/utils.hh:
Use
* src/parser_generator/syntax.cc, src/llstack/tests/example.hh,
* src/parser_generator/parser_gen.cc:
Refactor label definitions.
* src/llstack/frame.hh:
Cache hash value of the frame.
Modified Paths:
--------------
trunk/ChangeLog
trunk/configure.ac
trunk/src/llstack/frame.hh
trunk/src/llstack/label.hh
trunk/src/llstack/node.hh
trunk/src/llstack/node.hpp
trunk/src/llstack/queue.hh
trunk/src/llstack/tests/example.hh
trunk/src/llstack/utils.hh
trunk/src/parser_generator/Makefile.am
trunk/src/parser_generator/parser_gen.cc
trunk/src/parser_generator/syntax.cc
trunk/src/terms/constructor.hh
trunk/src/terms/term.hh
Added Paths:
-----------
trunk/src/parser_generator/tests/
trunk/src/parser_generator/tests/Makefile.am
trunk/src/parser_generator/tests/force-deps.mk
trunk/src/parser_generator/tests/gamma_2.cc
trunk/src/parser_generator/tests/gamma_2.csf
trunk/src/parser_generator/tests/input.txt
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-19 13:04:45 UTC (rev 105)
+++ trunk/ChangeLog 2010-07-26 16:20:16 UTC (rev 106)
@@ -1,3 +1,32 @@
+2010-07-26 Valentin David <val...@ii...>
+
+ * src/parser_generator/tests/gamma_2.cc,
+ * src/parser_generator/tests/Makefile.am,
+ * src/parser_generator/tests/gamma_2.csf,
+ * src/parser_generator/tests/input.txt,
+ * src/parser_generator/tests/force-deps.mk:
+ New.
+
+ * src/parser_generator/Makefile.am, configure.ac:
+ Update.
+
+ * src/terms/constructor.hh, src/terms/term.hh:
+ Use larger shift for hashing.
+
+ * src/llstack/label.hh:
+ Wrap std::function instead of using virtual for manipulating labels.
+
+ * src/llstack/queue.hh, src/llstack/node.hh,
+ * src/llstack/node.hpp, src/llstack/utils.hh:
+ Use
+
+ * src/parser_generator/syntax.cc, src/llstack/tests/example.hh,
+ * src/parser_generator/parser_gen.cc:
+ Refactor label definitions.
+
+ * src/llstack/frame.hh:
+ Cache hash value of the frame.
+
2010-07-19 Valentin David <val...@ii...>
* src/aurelia-config.hh.in:
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2010-07-19 13:04:45 UTC (rev 105)
+++ trunk/configure.ac 2010-07-26 16:20:16 UTC (rev 106)
@@ -170,6 +170,7 @@
src/Makefile
src/relations/Makefile
src/parser_generator/Makefile
+ src/parser_generator/tests/Makefile
src/streams/Makefile
src/streams/tests/Makefile
src/box/Makefile
Modified: trunk/src/llstack/frame.hh
===================================================================
--- trunk/src/llstack/frame.hh 2010-07-19 13:04:45 UTC (rev 105)
+++ trunk/src/llstack/frame.hh 2010-07-26 16:20:16 UTC (rev 106)
@@ -58,14 +58,15 @@
struct frame {
private:
real_frame* rf;
+ unsigned _hash;
public:
std::string toString() const {
return rf->toString();
}
- frame(const real_frame& rf): rf(rf.clone()) {}
- frame(const frame& other): rf(other.rf->clone()) {}
+ frame(const real_frame& rf): rf(rf.clone()), _hash(rf.hash()) {}
+ frame(const frame& other): rf(other.rf->clone()), _hash(other._hash) {}
~frame() {
delete rf;
}
@@ -83,7 +84,7 @@
struct hash_op {
unsigned operator()(const frame& a) const {
- return a.rf->hash();
+ return a._hash;
}
};
@@ -94,7 +95,7 @@
};
unsigned hash() const {
- return rf->hash();
+ return _hash;
}
bool operator==(const frame& other) const {
Modified: trunk/src/llstack/label.hh
===================================================================
--- trunk/src/llstack/label.hh 2010-07-19 13:04:45 UTC (rev 105)
+++ trunk/src/llstack/label.hh 2010-07-26 16:20:16 UTC (rev 106)
@@ -28,49 +28,33 @@
struct R_t;
struct label {
- virtual void call(R_t& R, const frame& f, stream& s, const node& n) const = 0;
- virtual label* clone() const = 0;
- virtual unsigned hash() const = 0;
- virtual ~label() {}
- virtual bool operator==(const label& other) const = 0;
- virtual void set_return_value(void *) = 0;
-};
+private:
+ std::function<void(R_t&, const frame&, stream&, const node&)> fun;
+ unsigned type;
-template <typename T>
-struct label_helper: public label {
public:
- virtual label* clone() const {
- return new T(*static_cast<const T*>(this));
+ template <typename T>
+ label(const T& in): fun(in), type((unsigned)&typeid(T)) {}
+
+ label(const label& other): fun(other.fun), type(other.type) {
}
- virtual unsigned hash() const {
- return (unsigned)&typeid(T);
+
+ void call(R_t& R, const frame& f, stream& s, const node& n) const {
+ fun(R, f, s, n);
}
- virtual bool operator==(const label& other) const {
- return dynamic_cast<const label_helper<T>*>(&other) != NULL;
+ unsigned hash() const {
+ return type;
}
- virtual void set_return_value(void *) {
- assert(false);
+ void swap(label& other) {
+ std::swap(fun, other.fun);
+ std::swap(type, other.type);
}
-};
-template <typename T, typename Ret>
-struct return_label_helper: label_helper<T> {
-protected:
- Ret* return_value;
-
-public:
- return_label_helper(): return_value(NULL) {}
- virtual ~return_label_helper() {
- if (return_value != NULL)
- delete return_value;
+ bool operator==(const label& other) const {
+ return (type == other.type);
}
- virtual void set_return_value(void *value) {
- if (return_value != NULL)
- delete return_value;
- return_value = new T(*static_cast<const Ret*>(value));
- }
};
}
Modified: trunk/src/llstack/node.hh
===================================================================
--- trunk/src/llstack/node.hh 2010-07-19 13:04:45 UTC (rev 105)
+++ trunk/src/llstack/node.hh 2010-07-26 16:20:16 UTC (rev 106)
@@ -60,7 +60,7 @@
typedef std::unordered_set<node> node_set_t;
typedef std::map<stream, std::forward_list<frame> > p_t;
private:
- label* L;
+ label L;
frame f;
int pos;
p_t P;
@@ -68,15 +68,12 @@
unsigned _hash;
public:
- ~node_core();
void update_hash();
- node_core(label* L, const frame& f, int pos): L(L->clone()), f(f), pos(pos) {
+ node_core(const label& L, const frame& f, int pos): L(L), f(f), pos(pos) {
update_hash();
}
- node_core(const node_core& other): f(other.f), pos(other.pos) {
- L = other.L;
- const_cast<node_core*>(&other)->L = NULL;
+ node_core(const node_core& other): L(other.L), f(other.f), pos(other.pos) {
_hash = other._hash;
}
@@ -106,7 +103,7 @@
return pos;
}
- label* get_label() const {
+ const label& get_label() const {
return L;
}
@@ -143,8 +140,8 @@
this->o->inc();
}
- node(const label* l, const frame& f, int s): super(NoBuild()) {
- node_core tmp(const_cast<label*>(l), f, s);
+ node(const label& l, const frame& f, int s): super(NoBuild()) {
+ node_core tmp(l, f, s);
new (static_cast<super*>(this)) super(tmp);
}
public:
@@ -179,7 +176,7 @@
return this->get().hash();
}
- label* get_label() const {
+ const label& get_label() const {
return this->get().get_label();
}
@@ -227,9 +224,9 @@
while (i != super::objects().end()) {
super::RealObject* ro = const_cast<super::RealObject*>(&*i);
- o << "n_" << typeid(*(ro->data()->get_label())).name()
+ o << "n_" << typeid((ro->data()->get_label())).name()
<< "_" << ro->data()->get_pos() << " [label=\""
- << DEMANGLE(typeid(*(ro->data()->get_label())).name())
+ << DEMANGLE(typeid((ro->data()->get_label())).name())
<< ", " << ro->data()->get_pos() << "\"];" << std::endl;
++i;
@@ -240,9 +237,9 @@
for (node_core::node_set_t::const_iterator j =
ro->data()->get_parents().begin();
j != ro->data()->get_parents().end(); ++j) {
- o << "n_" <<typeid(*(ro->data()->get_label())).name()
+ o << "n_" <<typeid((ro->data()->get_label())).name()
<< "_" << ro->data()->get_pos() << " -> " << "n_"
- << typeid(*((*j).get_label())).name() << "_"
+ << typeid(((*j).get_label())).name() << "_"
<< (*j).pos() << ";" << std::endl;
}
i++;
Modified: trunk/src/llstack/node.hpp
===================================================================
--- trunk/src/llstack/node.hpp 2010-07-19 13:04:45 UTC (rev 105)
+++ trunk/src/llstack/node.hpp 2010-07-26 16:20:16 UTC (rev 106)
@@ -29,29 +29,23 @@
namespace aurelia {
namespace llstack {
-node_core::~node_core() {
- if (L != NULL) {
- delete L;
- }
-}
-
void node_core::update_hash() {
- _hash = L->hash();
- _hash = (_hash << 1) | (_hash >> 31);
- _hash = f.hash();
- _hash = (_hash << 1) | (_hash >> 31);
+ _hash = L.hash();
+ _hash = (_hash << 11) | (_hash >> 21);
+ _hash ^= f.hash();
+ _hash = (_hash << 11) | (_hash >> 21);
_hash ^= pos;
}
bool node_core::operator==(const node_core& other) const {
- return (pos == other.pos) && (*L == *(other.L)) && (f == other.f);
+ return (pos == other.pos) && (L == (other.L)) && (f == other.f);
}
node node::create(R_t& R, const label& l, const frame& f, const node& u,
const stream& j) {
- node ret(&l, f, j.get_pos());
+ node ret(l, f, j.get_pos());
std::pair<node_core::node_set_t::iterator, bool> i =
ret.parents().insert(u);
if (i.second) {
@@ -60,7 +54,7 @@
k != ret.P().end(); ++k) {
for (std::forward_list<frame>::iterator l = (*k).second.begin();
l != (*k).second.end(); ++l) {
- R.add(*(ret.get_label()), *l, u, (*k).first);
+ R.add(ret.get_label(), *l, u, (*k).first);
}
}
}
@@ -68,7 +62,7 @@
}
node node::boundary(const label& l, const stream& s) {
- return node(&l, empty_frame(), s.get_pos());
+ return node(l, empty_frame(), s.get_pos());
}
template <typename Ret>
@@ -77,7 +71,7 @@
this->P()[j].push_front(ret);
for (node_core::node_set_t::iterator i = this->parents().begin();
i != this->parents().end(); ++i) {
- queue.add(*(this->get_label()), ret, *i, j);
+ queue.add(this->get_label(), ret, *i, j);
}
}
Modified: trunk/src/llstack/queue.hh
===================================================================
--- trunk/src/llstack/queue.hh 2010-07-19 13:04:45 UTC (rev 105)
+++ trunk/src/llstack/queue.hh 2010-07-26 16:20:16 UTC (rev 106)
@@ -26,16 +26,24 @@
namespace llstack {
struct Rj_t {
- struct ln: public std::pair<label*, node> {
- typedef std::pair<label*, node> super;
- ln(const label& l, const node& n): super(l.clone(), n) {
+ struct ln: public std::pair<label, node> {
+ private:
+ unsigned _hash;
+ public:
+ typedef std::pair<label, node> super;
+ ln(const label& l, const node& n): super(l, n) {
+ _hash = this->first.hash();
+ _hash = (_hash << 11) | (_hash >> 21);
+ _hash ^= this->second.hash();
}
- ln(const ln& other): super(other.first->clone(), other.second) {
+ unsigned hash() const {
+ return _hash;
+ }
+ ln(const ln& other): super(other.first, other.second),
+ _hash(other._hash) {
+
}
- ~ln() {
- delete this->first;
- }
ln& operator=(ln other) {
this->swap(&other);
@@ -43,24 +51,21 @@
}
void swap(ln* other) {
- label* l = other->first;
- other->first = this->first;
- this->first = l;
+ this->first.swap(other->first);
this->second.swap(other->second);
+ std::swap(_hash, other->_hash);
}
};
+
struct hash {
unsigned operator()(const ln& a) const {
- unsigned _hash = a.first->hash();
- _hash = (_hash << 1) | (_hash >> 31);
- _hash ^= a.second.hash();
- return _hash;
+ return a.hash();
}
};
struct eq {
unsigned operator()(const ln& a, const ln& b) const {
- return (*(a.first) == *(b.first)) && (a.second == b.second);
+ return ((a.first) == (b.first)) && (a.second == b.second);
}
};
@@ -71,20 +76,16 @@
};
struct descriptor {
- label *L;
+ label L;
frame f;
node n;
stream s;
descriptor(const label& L, const frame& f, const node& n, const stream& s):
- L(L.clone()), f(f), n(n), s(s) {}
- descriptor(const descriptor& other): L(other.L->clone()),
+ L(L), f(f), n(n), s(s) {}
+ descriptor(const descriptor& other): L(other.L),
f(other.f), n(other.n), s(other.s) {
}
-
- ~descriptor() {
- delete L;
- }
};
struct R_t {
@@ -112,7 +113,7 @@
if ((*j).second.empty()) {
(*i).second.pending.erase(j);
}
- return descriptor(*(p.first), fr, p.second, (*i).first);
+ return descriptor(p.first, fr, p.second, (*i).first);
}
void collect_nodes() const {
Modified: trunk/src/llstack/tests/example.hh
===================================================================
--- trunk/src/llstack/tests/example.hh 2010-07-19 13:04:45 UTC (rev 105)
+++ trunk/src/llstack/tests/example.hh 2010-07-26 16:20:16 UTC (rev 106)
@@ -182,9 +182,9 @@
typedef parse_string<f_str, branch<S, 0, 2> > res;
};
-struct S: public symbol<S> {
+struct S {
enum { NT = NT_S };
- virtual void call(R_t& R, const frame& f, stream& s, const node& cu) const {
+ void operator()(R_t& R, const frame& f, stream& s, const node& cu) const {
if (test(s, NT_S, C_S_0_0)) {
R.add(branch<S, 0, 0>::res(), f, cu, s);
}
@@ -195,8 +195,8 @@
template <>
struct branch<S, 0, 2> {
- struct res: public label_helper<res> {
- void call(R_t& R, const frame& f, stream& s, const node& cu) const {
+ struct res {
+ void operator()(R_t& R, const frame& f, stream& s, const node& cu) const {
ret_frame<T> rf0 = f.as<ret_frame<T> >();
std::cerr << "Found: " << rf0.t << std::endl;
found = true;
@@ -227,8 +227,8 @@
template <>
struct branch<N, 0, 3> {
- struct res: public label_helper<res> {
- void call(R_t& R, const frame& f, stream& s, const node& cu) const {
+ struct res {
+ void operator()(R_t& R, const frame& f, stream& s, const node& cu) const {
ret_frame<T> rf0 = f.as<ret_frame<T> >();
ret_frame<T> rf1 = rf0.parent.as<ret_frame<T> >();
T ret(Plus, (rf1.t, rf0.t));
@@ -249,8 +249,8 @@
template <>
struct branch<N, 1, 1> {
- struct res: public label_helper<res> {
- void call(R_t& R, const frame&, stream& s, const node& cu) const {
+ struct res {
+ void operator()(R_t& R, const frame&, stream& s, const node& cu) const {
cu.pop(R, T(Zero), s);
}
};
@@ -268,16 +268,16 @@
template <>
struct branch<N, 2, 1> {
- struct res: public label_helper<res> {
- void call(R_t& R, const frame&, stream& s, const node& cu) const {
+ struct res {
+ void operator()(R_t& R, const frame&, stream& s, const node& cu) const {
cu.pop(R, T(One), s);
}
};
};
-struct N: public symbol<N> {
+struct N {
enum { NT = NT_N };
- virtual void call(R_t& R, const frame& f, stream& s, const node& cu) const {
+ void operator()(R_t& R, const frame& f, stream& s, const node& cu) const {
if (test(s, NT_N, C_N_0_0)) {
R.add(branch<N, 0, 0>::res(), f, cu, s);
}
@@ -290,16 +290,15 @@
}
};
-
-struct Start: public label_helper<Start> {
- virtual void call(R_t&, const frame&, stream& s, const node&) const {
+struct Start {
+ void operator()(R_t&, const frame&, stream& s, const node&) const {
if (s.eof())
std::cerr << s.get_pos() << " " << "Found!" << std::endl;
}
};
-struct End: public label_helper<End> {
- virtual void call(R_t&, const frame&, stream&, const node&) const {
+struct End {
+ void operator()(R_t&, const frame&, stream&, const node&) const {
}
};
@@ -317,13 +316,13 @@
node u0 = node::boundary(End(), end);
u1.parents().insert(u0);
S start;
- start.call(R, empty_frame(), s, u1);
+ start(R, empty_frame(), s, u1);
try {
while (true) {
descriptor d = R.pop();
//std::cerr << s.get_pos() << " " << typeid(*(d.L)).name() << ":" << d.s.get_pos() << std::endl;
s = d.s;
- d.L->call(R, d.f, d.s, d.n);
+ d.L.call(R, d.f, d.s, d.n);
}
} catch (R_t::Eof) {
}
Modified: trunk/src/llstack/utils.hh
===================================================================
--- trunk/src/llstack/utils.hh 2010-07-19 13:04:45 UTC (rev 105)
+++ trunk/src/llstack/utils.hh 2010-07-26 16:20:16 UTC (rev 106)
@@ -53,79 +53,91 @@
throw Error();
}
-template <typename S>
-struct symbol: public label_helper<S> {
-};
-
template <typename T, int branch_num, int label_num>
struct branch {
};
template <typename Label, typename Ret = VoidReturn>
-struct drop_ret: public label_helper<drop_ret<Label, Ret> > {
- virtual void call(R_t& R, const frame& f, stream& s, const node& cu) const {
+struct drop_ret {
+public:
+ void operator()(R_t& R, const frame& f, stream& s, const node& cu) const {
try {
ret_frame<Ret> t = f.as<ret_frame<Ret> >();
Label l;
- l.call(R, t.parent, s, cu);
+ l(R, t.parent, s, cu);
} catch (frame::BadFrame) {
Label l;
- l.call(R, f, s, cu);
+ l(R, f, s, cu);
}
}
+
+ unsigned hash() const {
+ Label l;
+ unsigned ret = (0x8934931a ^ l.hash());
+ ret = (ret << 11) | (ret >> 21);
+ return ret;
+ }
};
template <typename S, state C, typename Next>
-struct parse_symbol: public label_helper<parse_symbol<S, C, Next> > {
- virtual void call(R_t& R, const frame& f, stream& s, const node& cu) const {
+struct parse_symbol {
+ void operator()(R_t& R, const frame& f, stream& s, const node& cu) const {
//std::cerr << "Calling: " << C << ":" << s.get_pos() << " " << typeid(S).name() << "(" << f.toString() << ")" << std::endl;
if (test(s, (nonterm)S::NT, C)) {
node ncu = node::create(R, typename Next::res(), f, cu, s);
S sym;
- sym.call(R, f, s, ncu);
+ sym(R, f, s, ncu);
}
}
-};
-template <typename S, state C, typename Next>
-struct parse_symbol_nr: public drop_ret<parse_symbol<S, C, Next> > {
+ unsigned hash() const {
+ return (unsigned)&typeid(parse_symbol);
+ }
};
template <typename string, typename Next>
-struct parse_string: public label_helper<parse_string<string, Next> > {
- virtual void call(R_t& R, const frame& f, stream& s, const node& cu) const {
+struct parse_string {
+ void operator()(R_t& R, const frame& f, stream& s, const node& cu) const {
//std::cerr << "Eating: " << C << ":" << s.get_pos() << " " << string::str << std::endl;
if (s.eat(string::str)) {
//std::cerr << "Success: " << s.get_pos() << std::endl;
typename Next::res n;
- n.call(R, f, s, cu);
+ n(R, f, s, cu);
}
}
-};
-template <typename S, typename Next>
-struct parse_string_nr: public drop_ret<parse_string<S, Next> > {
+ unsigned hash() const {
+ return (unsigned)&typeid(parse_string);
+ }
};
template <typename S>
-struct pop: public label_helper<pop<S> > {
- void call(R_t& R, const frame&, stream& s, const node& cu) const {
+struct pop {
+ void operator()(R_t& R, const frame&, stream& s, const node& cu) const {
//std::cout << "Pop: " << s.get_pos() << std::endl;
cu.pop(R, VoidReturn(), s);
}
+
+ unsigned hash() const {
+ return (unsigned)&typeid(pop);
+ }
};
template <typename S, typename Next>
-struct parse_set: public label_helper<parse_set<S, Next> > {
- virtual void call(R_t& R, const frame& f, stream& s, const node& cu) const {
+struct parse_set {
+ void operator()(R_t& R, const frame& f, stream& s, const node& cu) const {
if (!s.eof()) {
if (S::set[((unsigned char)*s)/8]&(1<<(((unsigned char)*s)%8))) {
++s;
typename Next::res r;
- r.call(R, f, s, cu);
+ r(R, f, s, cu);
}
}
- };
+ }
+
+ unsigned hash() const {
+ return (unsigned)&typeid(parse_set);
+ }
};
#endif
Modified: trunk/src/parser_generator/Makefile.am
===================================================================
--- trunk/src/parser_generator/Makefile.am 2010-07-19 13:04:45 UTC (rev 105)
+++ trunk/src/parser_generator/Makefile.am 2010-07-26 16:20:16 UTC (rev 106)
@@ -25,7 +25,7 @@
syntax_SOURCES=syntax.cc
-EXTRA_DIST=syntax.tree Syntax.def syntax.hh syntax.csf
+EXTRA_DIST=syntax.tree Syntax.def syntax.hh syntax.csf force-deps.mk
CLEANFILES=
if BOOTSTRAP
@@ -42,7 +42,7 @@
nodist_syntax_SOURCES=syntax.hh
--include force-deps.mk
+-include $(srcdir)/force-deps.mk
else
@@ -56,3 +56,5 @@
else \
rm -f syntax.hh.tmp; \
fi
+
+SUBDIRS=tests
Modified: trunk/src/parser_generator/parser_gen.cc
===================================================================
--- trunk/src/parser_generator/parser_gen.cc 2010-07-19 13:04:45 UTC (rev 105)
+++ trunk/src/parser_generator/parser_gen.cc 2010-07-26 16:20:16 UTC (rev 106)
@@ -784,10 +784,9 @@
Rule[nt, NoParam, Void, l] = in;
std::string nt_name = to_cxx_id(*nt);
map_index(gen_branch(nt_name))(*l);
- std::cout << "struct " << nt_name << ": public label_helper<"
- << nt_name << "> {" << std::endl;
+ std::cout << "struct " << nt_name << " {" << std::endl;
std::cout << " enum { NT = NT_" << nt_name << " };" << std::endl;
- std::cout << " virtual void call(R_t& R, "
+ std::cout << " virtual void operator()(R_t& R, "
<< "const frame& f, stream& s, const node& cu) const {"
<< std::endl;
int i = 0;
@@ -870,7 +869,7 @@
<<"_"<<i<<"_0)) {" << std::endl;
std::cout << " branch<"<<nt_name<<", "<<i<<", 0>::res n;"
<< std::endl;
- std::cout << " return n.call(R, f, s, cu);" << std::endl;
+ std::cout << " return n(R, f, s, cu);" << std::endl;
std::cout << " }" << std::endl;
++i;
return t;
Modified: trunk/src/parser_generator/syntax.cc
===================================================================
--- trunk/src/parser_generator/syntax.cc 2010-07-19 13:04:45 UTC (rev 105)
+++ trunk/src/parser_generator/syntax.cc 2010-07-26 16:20:16 UTC (rev 106)
@@ -30,8 +30,8 @@
bool found;
-struct Start: public label_helper<Start> {
- virtual void call(R_t&, const frame&, stream& s, const node&) const {
+struct Start {
+ void operator()(R_t&, const frame&, stream& s, const node&) const {
if (s.eof()) {
std::cerr << s.get_pos() << " " << "Found!" << std::endl;
found = true;
@@ -39,8 +39,8 @@
}
};
-struct End: public label_helper<End> {
- virtual void call(R_t&, const frame&, stream&, const node&) const {
+struct End {
+ void operator()(R_t&, const frame&, stream&, const node&) const {
}
};
@@ -58,7 +58,7 @@
node u0 = node::boundary(End(), end);
u1.parents().insert(u0);
S start;
- start.call(R, empty_frame(), s, u1);
+ start(R, empty_frame(), s, u1);
int lastpos = -1;
try {
while (true) {
@@ -72,7 +72,7 @@
std::cerr << lastpos << std::endl;
//node::printnodes(out);
}
- d.L->call(R, d.f, d.s, d.n);
+ d.L.call(R, d.f, d.s, d.n);
}
} catch (R_t::Eof) {
}
Property changes on: trunk/src/parser_generator/tests
___________________________________________________________________
Added: svn:ignore
+ Makefile
Makefile.in
gamma_2.tree
gamma_2
gamma_2.hh
.deps
Added: trunk/src/parser_generator/tests/Makefile.am
===================================================================
--- trunk/src/parser_generator/tests/Makefile.am (rev 0)
+++ trunk/src/parser_generator/tests/Makefile.am 2010-07-26 16:20:16 UTC (rev 106)
@@ -0,0 +1,46 @@
+ # This file is a part of Aurelia.
+# Copyright (C) 2010 Valentin David
+# Copyright (C) 2010 University of Bergen
+#
+# 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/>.
+
+gamma_2_CPPFLAGS=-I. -I$(srcdir)/../.. $(EXTRACPPFLAGS) -DSRCDIR=\"$(srcdir)\"
+
+check_PROGRAMS=gamma_2
+TESTS=gamma_2
+
+gamma_2_SOURCES=gamma_2.cc
+nodist_gamma_2_SOURCES=gamma_2.hh
+
+EXTRA_DIST=gamma_2.csf gamma_2.tree force-deps.mk input.txt
+CLEANFILES=gamma_2.hh
+SUFFIXES=
+
+if BOOTSTRAP
+SUFFIXES+= .csf
+.csf.tree:
+ $(SGLR) -2 -fi -p ../Syntax.tbl -i $< | \
+ $(IMPLODEASFIX) -b -o $@
+endif
+
+-include $(srcdir)/force-deps.mk
+
+SUFFIXES+=.tree
+
+.tree.hh:
+ if ../parser_gen <$< >$@.tmp; then \
+ mv -f $@.tmp $@; \
+ else \
+ rm -f $@.tmp; \
+ fi
Added: trunk/src/parser_generator/tests/force-deps.mk
===================================================================
--- trunk/src/parser_generator/tests/force-deps.mk (rev 0)
+++ trunk/src/parser_generator/tests/force-deps.mk 2010-07-26 16:20:16 UTC (rev 106)
@@ -0,0 +1,18 @@
+# This file is a part of Aurelia.
+# Copyright (C) 2010 Valentin David
+# Copyright (C) 2010 University of Bergen
+#
+# 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/>.
+
+gamma_2-gamma_2.o: gamma_2.hh
Added: trunk/src/parser_generator/tests/gamma_2.cc
===================================================================
--- trunk/src/parser_generator/tests/gamma_2.cc (rev 0)
+++ trunk/src/parser_generator/tests/gamma_2.cc 2010-07-26 16:20:16 UTC (rev 106)
@@ -0,0 +1,89 @@
+// This file is a part of Aurelia.
+// Copyright (C) 2010 Valentin David
+// Copyright (C) 2010 University of Bergen
+//
+// 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/>.
+
+#include <sstream>
+#include <iostream>
+#include <fstream>
+#include "llstack/queue.hh"
+#include "llstack/node.hh"
+#include "streams/buf_stream.hh"
+#include "llstack/label.hh"
+#include "llstack/node.hpp"
+
+using namespace aurelia;
+using namespace llstack;
+#include "gamma_2.hh"
+
+bool found;
+
+struct Start {
+ void operator()(R_t&, const frame&, stream& s, const node&) const {
+ if (s.eof()) {
+ std::cerr << s.get_pos() << " " << "Found!" << std::endl;
+ found = true;
+ }
+ }
+};
+
+struct End {
+ void operator()(R_t&, const frame&, stream&, const node&) const {
+ }
+};
+
+bool main_loop(stream& s, const stream& end) {
+ found = false;
+ R_t R;
+ if (s.eof()) {
+ if (!is_empty_first(S_0_0))
+ { error(); }
+ }
+ else if (!is_first(s, S_0_0)) {
+ { error(); }
+ }
+ node u1 = node::boundary(Start(), end);
+ node u0 = node::boundary(End(), end);
+ u1.parents().insert(u0);
+ S start;
+ start(R, empty_frame(), s, u1);
+ int lastpos = -1;
+ try {
+ while (true) {
+ descriptor d = R.pop();
+ s = d.s;
+ if (lastpos < s.get_pos()) {
+ lastpos = s.get_pos();
+ /* std::stringstream ss;
+ ss << "graph." << s.get_pos();
+ std::ofstream out(ss.str());*/
+ std::cerr << lastpos << std::endl;
+ //node::printnodes(out);
+ }
+ d.L.call(R, d.f, d.s, d.n);
+ }
+ } catch (R_t::Eof) {
+ }
+
+ node::clear();
+ return found;
+}
+
+int main() {
+ std::ifstream in(SRCDIR"/input.txt");
+ buf_stream bs(in);
+ stream s = bs.begin();
+ return !main_loop(s, bs.end());
+}
Added: trunk/src/parser_generator/tests/gamma_2.csf
===================================================================
--- trunk/src/parser_generator/tests/gamma_2.csf (rev 0)
+++ trunk/src/parser_generator/tests/gamma_2.csf 2010-07-26 16:20:16 UTC (rev 106)
@@ -0,0 +1 @@
+S ::= S S S | S S | "a"
Added: trunk/src/parser_generator/tests/input.txt
===================================================================
--- trunk/src/parser_generator/tests/input.txt (rev 0)
+++ trunk/src/parser_generator/tests/input.txt 2010-07-26 16:20:16 UTC (rev 106)
@@ -0,0 +1 @@
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
\ No newline at end of file
Modified: trunk/src/terms/constructor.hh
===================================================================
--- trunk/src/terms/constructor.hh 2010-07-19 13:04:45 UTC (rev 105)
+++ trunk/src/terms/constructor.hh 2010-07-26 16:20:16 UTC (rev 106)
@@ -53,7 +53,7 @@
i != n.end();
++i) {
_hash ^= (unsigned char)*i;
- _hash = (_hash << 1) | (_hash >> 31);
+ _hash = (_hash << 11) | (_hash >> 21);
}
}
Modified: trunk/src/terms/term.hh
===================================================================
--- trunk/src/terms/term.hh 2010-07-19 13:04:45 UTC (rev 105)
+++ trunk/src/terms/term.hh 2010-07-26 16:20:16 UTC (rev 106)
@@ -104,7 +104,7 @@
ch.copy(children);
for (unsigned i = 0; i < c.arity(); ++i) {
_hash ^= children[i].hash();
- _hash = (_hash << 1) | (_hash >> 31);
+ _hash = (_hash << 11) | (_hash >> 21);
}
}
@@ -119,7 +119,7 @@
new (children) ChType(ch);
for (unsigned i = 0; i < c.arity(); ++i) {
_hash ^= children[i].hash();
- _hash = (_hash << 1) | (_hash >> 31);
+ _hash = (_hash << 11) | (_hash >> 21);
}
}
@@ -132,7 +132,7 @@
children = NULL;
for (unsigned i = 0; i < c.arity(); ++i) {
_hash ^= children[i].hash();
- _hash = (_hash << 1) | (_hash >> 31);
+ _hash = (_hash << 11) | (_hash >> 21);
}
}
@@ -155,7 +155,7 @@
for (unsigned i = 0; i < _constructor.arity(); ++i) {
new (children+i) ChType(other[i]);
_hash ^= children[i].hash();
- _hash = (_hash << 1) | (_hash >> 31);
+ _hash = (_hash << 11) | (_hash >> 21);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-19 13:04:52
|
Revision: 105
http://aurelia.svn.sourceforge.net/aurelia/?rev=105&view=rev
Author: valentindavid
Date: 2010-07-19 13:04:45 +0000 (Mon, 19 Jul 2010)
Log Message:
-----------
2010-07-19 Valentin David <val...@ii...>
* src/aurelia-config.hh.in:
Add HAVE_CXXABI_H.
* config/cxx.m4: AC_DEFINE headers.
* configure.ac:
AC_DEFINE cxxabi.h presence.
Modified Paths:
--------------
trunk/ChangeLog
trunk/config/cxx.m4
trunk/configure.ac
trunk/src/aurelia-config.hh.in
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-16 16:04:46 UTC (rev 104)
+++ trunk/ChangeLog 2010-07-19 13:04:45 UTC (rev 105)
@@ -1,3 +1,13 @@
+2010-07-19 Valentin David <val...@ii...>
+
+ * src/aurelia-config.hh.in:
+ Add HAVE_CXXABI_H.
+
+ * config/cxx.m4: AC_DEFINE headers.
+
+ * configure.ac:
+ AC_DEFINE cxxabi.h presence.
+
2010-07-15 Valentin David <val...@ii...>
* README, HACKING, NEWS,
Modified: trunk/config/cxx.m4
===================================================================
--- trunk/config/cxx.m4 2010-07-16 16:04:46 UTC (rev 104)
+++ trunk/config/cxx.m4 2010-07-19 13:04:45 UTC (rev 105)
@@ -40,10 +40,12 @@
])
AC_DEFUN([CHECK_CXX0X_HEADERS], [
+ AH_CHECK_HEADERS([$1])
m4_map_args_w([$1],[CHECK_CXX0X_HEADER(],[)])
])
AC_DEFUN([CHECK_CXX03_HEADERS], [
+ AH_CHECK_HEADERS([$1])
m4_map_args_w([$1],[CHECK_CXX03_HEADER(],[)])
])
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2010-07-16 16:04:46 UTC (rev 104)
+++ trunk/configure.ac 2010-07-19 13:04:45 UTC (rev 105)
@@ -64,7 +64,7 @@
CXX0X_AUTO
CXX0X_DECLTYPE
-AC_CHECK_HEADER([cxxabi.h])
+AC_CHECK_HEADERS([cxxabi.h])
AC_SUBST([EXTRACPPFLAGS])
Modified: trunk/src/aurelia-config.hh.in
===================================================================
--- trunk/src/aurelia-config.hh.in 2010-07-16 16:04:46 UTC (rev 104)
+++ trunk/src/aurelia-config.hh.in 2010-07-19 13:04:45 UTC (rev 105)
@@ -45,6 +45,9 @@
/* Define to 1 if you have the <pthread.h> header file. */
#undef HAVE_PTHREAD_H
+/* Define to 1 if you have the <cxxabi.h> header file. */
+#undef HAVE_CXXABI_H
+
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-16 16:04:53
|
Revision: 104
http://aurelia.svn.sourceforge.net/aurelia/?rev=104&view=rev
Author: valentindavid
Date: 2010-07-16 16:04:46 +0000 (Fri, 16 Jul 2010)
Log Message:
-----------
2010-07-15 Valentin David <val...@ii...>
* README, HACKING, NEWS,
* doc/pages/concept_howto.doc,
* doc/pages/support.doc,
* doc/pages/manual.doc:
Fix sectionning.
Modified Paths:
--------------
trunk/ChangeLog
trunk/HACKING
trunk/NEWS
trunk/README
trunk/doc/pages/concept_howto.doc
trunk/doc/pages/manual.doc
trunk/doc/pages/support.doc
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-15 18:42:07 UTC (rev 103)
+++ trunk/ChangeLog 2010-07-16 16:04:46 UTC (rev 104)
@@ -1,5 +1,13 @@
2010-07-15 Valentin David <val...@ii...>
+ * README, HACKING, NEWS,
+ * doc/pages/concept_howto.doc,
+ * doc/pages/support.doc,
+ * doc/pages/manual.doc:
+ Fix sectionning.
+
+2010-07-15 Valentin David <val...@ii...>
+
* src/type_traits/is_callable_with.hh,
* src/type_traits/overloading_priority.hh,
* src/type_traits/Makefile.am: New.
Modified: trunk/HACKING
===================================================================
--- trunk/HACKING 2010-07-15 18:42:07 UTC (rev 103)
+++ trunk/HACKING 2010-07-16 16:04:46 UTC (rev 104)
@@ -3,7 +3,7 @@
Follow the GNU coding standards: <http://www.gnu.org/prep/standards/>
Except when the present document contradicts it.
-<h2>Coding style</h2>
+\section coding_style Coding style
\li Only C++0x include files can be used. C include files are to be avoided.
@@ -12,7 +12,7 @@
\li A space after all keywords.
\li Lines should be not more than 80 columns.
-<h2>Committing on the repository</h2>
+\section svn Committing on the repository
Post your ChangeLog entry as. If your commit does not have a ChangeLog
entry (e.g. svn propedit), you are free to use a simple sentence to
@@ -25,7 +25,7 @@
Avoid multi-purpose commits.
-<h2>autoconf, automake</h2>
+\section autotools autoconf, automake
Use ./bootstrap to generate the auto* files.
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2010-07-15 18:42:07 UTC (rev 103)
+++ trunk/NEWS 2010-07-16 16:04:46 UTC (rev 104)
@@ -1,6 +1,6 @@
/*! \page NEWS NEWS
-<h2>0.1 [Currently in dev.]</h2>
+\section 0_1 0.1 [Currently in dev.]
This version provides:
Modified: trunk/README
===================================================================
--- trunk/README 2010-07-15 18:42:07 UTC (rev 103)
+++ trunk/README 2010-07-16 16:04:46 UTC (rev 104)
@@ -1,6 +1,6 @@
/*! \page README README
-<h1>Aurelia</h1>
+\section main Aurelia
Aurelia is a framework for program transformation based on a C++0x
development environment. It provides libraries and tools for term
@@ -14,12 +14,12 @@
The documentation is not ready yet. Directory "demos" provides a good
idea of what the library can provide.
-<h2>Requirements</h2>
+\section requirements Requirements
\li A C++0x compiler with a C++0x standard library. The requirements
will be checked by the configure script.
-<h2>Build and install</h2>
+\section install Build and install
The installation uses the standard GNU procedure. For more
information, please refer to \ref INSTALL.
@@ -32,7 +32,7 @@
./configure CXX=icpc CPPFLAGS=-I/usr/include/stlport
\endcode
-<h2>License</h2>
+\section License
A copy of the GNU General Public License version 3 is in the file
COPYING.
Modified: trunk/doc/pages/concept_howto.doc
===================================================================
--- trunk/doc/pages/concept_howto.doc 2010-07-15 18:42:07 UTC (rev 103)
+++ trunk/doc/pages/concept_howto.doc 2010-07-16 16:04:46 UTC (rev 104)
@@ -1,6 +1,6 @@
/*! \page concept_howto Concept HOWTO
-\section Defining a concept
+\section concept Defining a concept
\code
template <typename Model>
@@ -27,7 +27,7 @@
};
\endcode
-\section Defining models
+\section models Defining models
\code
struct A {
@@ -45,7 +45,7 @@
};
\endcode
-\section Requiring a model
+\section requirement Requiring a model
\code
template <typename T,
@@ -69,7 +69,7 @@
};
\endcode
-\section Making automatic models
+\section auto Making automatic models
In case it is possible to know automatically a model, then we can do as follow.
@@ -92,7 +92,7 @@
};
\endcode
-\section Writing an archetype
+\section archetype Writing an archetype
TODO
Modified: trunk/doc/pages/manual.doc
===================================================================
--- trunk/doc/pages/manual.doc 2010-07-15 18:42:07 UTC (rev 103)
+++ trunk/doc/pages/manual.doc 2010-07-16 16:04:46 UTC (rev 104)
@@ -1,23 +1,23 @@
/*! \page manual User manual
-\section API documentation
+\section api API documentation
\li <a href="group__Concepts.html">Concepts</a>
-\li \ref strategies
+\li \subpage strategies
\li <a href="namespaces.html">Namespaces</a>
\li <a href="classes.html">Classes</a>
-\section Hacking
+\section hacking Hacking
-\li \ref concept_howto
+\li \subpage concept_howto
-\section Package documentation
+\section package Package documentation
-\li \ref README
-\li \ref INSTALL
-\li \ref HACKING
-\li \ref NEWS
-\li \ref COPYING
-\li \ref AUTHORS
+\li \subpage README
+\li \subpage INSTALL
+\li \subpage HACKING
+\li \subpage NEWS
+\li \subpage COPYING
+\li \subpage AUTHORS
*/
Modified: trunk/doc/pages/support.doc
===================================================================
--- trunk/doc/pages/support.doc 2010-07-15 18:42:07 UTC (rev 103)
+++ trunk/doc/pages/support.doc 2010-07-16 16:04:46 UTC (rev 104)
@@ -1,6 +1,6 @@
/*! \page support Support
-<h2>Mailing-list</h2>
+\section mailing-lists Mailing-lists
To subscribe to any of those mailing lists, just send
@@ -9,7 +9,7 @@
\li <a href="https://lists.sourceforge.net/lists/listinfo/aurelia-svn">aur...@li...</a>
\li <a href="https://lists.sourceforge.net/lists/listinfo/aurelia-users">aur...@li...</a>
-<h2>Bug tracker</h2>
+\section tracker Bug tracker
Please send bug reports on the sourceforge page (<a href="http://sourceforge.net/tracker/?func=add&group_id=330861&atid=1387810">quick link</a>).
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-15 18:42:17
|
Revision: 103
http://aurelia.svn.sourceforge.net/aurelia/?rev=103&view=rev
Author: valentindavid
Date: 2010-07-15 18:42:07 +0000 (Thu, 15 Jul 2010)
Log Message:
-----------
2010-07-15 Valentin David <val...@ii...>
* src/type_traits/is_callable_with.hh,
* src/type_traits/overloading_priority.hh,
* src/type_traits/Makefile.am: New.
* configure.ac, src/Makefile.am: Update.
* src/strategies/strategies.hh:
Make a real automatic concept for strategies.
* src/strategies/patterns/scope.hh,
* src/strategies/traversals/alltd.hh,
* src/strategies/generic/seq.hh,
* src/strategies/generic/choice.hh,
* demos/10-int.cc:
Fix strategy models.
* doc/pages/concept_howto.doc: New.
* doc/pages/manual.doc: Update.
Modified Paths:
--------------
trunk/ChangeLog
trunk/configure.ac
trunk/demos/10-int.cc
trunk/doc/pages/manual.doc
trunk/src/Makefile.am
trunk/src/strategies/generic/choice.hh
trunk/src/strategies/generic/seq.hh
trunk/src/strategies/patterns/scope.hh
trunk/src/strategies/strategies.hh
trunk/src/strategies/traversals/alltd.hh
Added Paths:
-----------
trunk/doc/pages/concept_howto.doc
trunk/src/type_traits/
trunk/src/type_traits/Makefile.am
trunk/src/type_traits/is_callable_with.hh
trunk/src/type_traits/overloading_priority.hh
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-07 17:33:25 UTC (rev 102)
+++ trunk/ChangeLog 2010-07-15 18:42:07 UTC (rev 103)
@@ -1,3 +1,24 @@
+2010-07-15 Valentin David <val...@ii...>
+
+ * src/type_traits/is_callable_with.hh,
+ * src/type_traits/overloading_priority.hh,
+ * src/type_traits/Makefile.am: New.
+
+ * configure.ac, src/Makefile.am: Update.
+
+ * src/strategies/strategies.hh:
+ Make a real automatic concept for strategies.
+
+ * src/strategies/patterns/scope.hh,
+ * src/strategies/traversals/alltd.hh,
+ * src/strategies/generic/seq.hh,
+ * src/strategies/generic/choice.hh,
+ * demos/10-int.cc:
+ Fix strategy models.
+
+ * doc/pages/concept_howto.doc: New.
+ * doc/pages/manual.doc: Update.
+
2010-07-07 Valentin David <val...@ii...>
* src/box/box.hh:
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2010-07-07 17:33:25 UTC (rev 102)
+++ trunk/configure.ac 2010-07-15 18:42:07 UTC (rev 103)
@@ -158,6 +158,7 @@
demos-from-rascal/Makefile
demos-from-stratego/Makefile
demos/Makefile
+ src/type_traits/Makefile
src/terms/Makefile
src/strategies/Makefile
src/patterns/Makefile
Modified: trunk/demos/10-int.cc
===================================================================
--- trunk/demos/10-int.cc 2010-07-07 17:33:25 UTC (rev 102)
+++ trunk/demos/10-int.cc 2010-07-15 18:42:07 UTC (rev 103)
@@ -66,20 +66,23 @@
struct Max;
namespace aurelia {
-template <typename Pool>
-struct StrategyModel<Max, Int<Pool> > {
- typedef Max Strat;
- typedef Int<Pool> Input;
- typedef Int<Pool> Ouput;
-};
+ template <typename Pool>
+ struct StrategyModel<Max, Int<Pool>, false> {
+ struct Model {
+ typedef Max Strat;
+ typedef Int<Pool> Input;
+ typedef Int<Pool> Ouput;
+ };
+ };
-template <typename Pool>
-struct StrategyModel<Max, Term<Pool> > {
- typedef Max Strat;
- typedef Term<Pool> Input;
- typedef Int<Pool> Ouput;
-};
-
+ template <typename Pool>
+ struct StrategyModel<Max, Term<Pool>, false> {
+ struct Model {
+ typedef Max Strat;
+ typedef Term<Pool> Input;
+ typedef Int<Pool> Ouput;
+ };
+ };
}
struct Max {
@@ -93,8 +96,8 @@
~Max() { if (master) delete i; }
template <typename T>
- typename StrategyModel<Max,T>::Output operator()(const T& t) const {
- typename StrategyModel<Max,T>::Output ret(t);
+ typename StrategyModel<Max,T>::Model::Output operator()(const T& t) const {
+ typename StrategyModel<Max,T>::Model::Output ret(t);
if (*i < (int)ret)
*i = (int)ret;
return ret;
Added: trunk/doc/pages/concept_howto.doc
===================================================================
--- trunk/doc/pages/concept_howto.doc (rev 0)
+++ trunk/doc/pages/concept_howto.doc 2010-07-15 18:42:07 UTC (rev 103)
@@ -0,0 +1,99 @@
+/*! \page concept_howto Concept HOWTO
+
+\section Defining a concept
+
+\code
+template <typename Model>
+struct MyConcept {
+ // We declare a type.
+ typedef typename Model::SomeType SomeType;
+ typedef typename Model::ReturnType ReturnType;
+
+#ifdef GEN_DOC
+ //We declare the needed functions
+ ReturnType operator()(SomeType&, int);
+#else
+ typedef void static_check;
+
+ static_assert(std::is_same<ReturnType,
+ std::declval<SomeType&>()(0)>::value,
+ "operator()(SomeType&, int) does not return ReturnType");
+#endif
+};
+
+template <typename T>
+struct MyModel {
+ typedef void NoModel;
+};
+\endcode
+
+\section Defining models
+
+\code
+struct A {
+ int operator()(int) {
+ return 0;
+ }
+};
+
+template <>
+struct MyModel<A> {
+ struct Model {
+ typedef A SomeType;
+ typedef int RetType;
+ };
+};
+\endcode
+
+\section Requiring a model
+
+\code
+template <typename T,
+ typename Model = MyModel<T>::Model>
+void foo(T) {
+ //We have a model, but we need to require this model to check.
+ typedef typename Model::static_check require;
+
+ //...
+}
+\endcode
+
+Or for a class:
+
+\code
+template <typename T>
+struct Foo {
+ typedef typename MyModel<T>::Model::static_check require;
+
+ //...
+};
+\endcode
+
+\section Making automatic models
+
+In case it is possible to know automatically a model, then we can do as follow.
+
+\code
+template <typename T,
+ bool = is_callable_with<T&, int>::value>
+struct MyModel;
+
+template <typename T>
+struct MyModel<T, false> {
+ typedef void NoModel;
+};
+
+template <typename T>
+struct MyModel<T, true> {
+ struct Model {
+ typedef A SomeType;
+ typedef decltype(std::declval<T&>()(std::declval<int>())) RetType;
+ };
+};
+\endcode
+
+\section Writing an archetype
+
+TODO
+
+*/
Modified: trunk/doc/pages/manual.doc
===================================================================
--- trunk/doc/pages/manual.doc 2010-07-07 17:33:25 UTC (rev 102)
+++ trunk/doc/pages/manual.doc 2010-07-15 18:42:07 UTC (rev 103)
@@ -1,14 +1,18 @@
/*! \page manual User manual
-<h2>API documentation</h2>
+\section API documentation
\li <a href="group__Concepts.html">Concepts</a>
\li \ref strategies
\li <a href="namespaces.html">Namespaces</a>
\li <a href="classes.html">Classes</a>
-<h2>Package documentation</h2>
+\section Hacking
+\li \ref concept_howto
+
+\section Package documentation
+
\li \ref README
\li \ref INSTALL
\li \ref HACKING
Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am 2010-07-07 17:33:25 UTC (rev 102)
+++ trunk/src/Makefile.am 2010-07-15 18:42:07 UTC (rev 103)
@@ -16,6 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
SUBDIRS= \
+ type_traits \
llstack \
patterns \
relations \
Modified: trunk/src/strategies/generic/choice.hh
===================================================================
--- trunk/src/strategies/generic/choice.hh 2010-07-07 17:33:25 UTC (rev 102)
+++ trunk/src/strategies/generic/choice.hh 2010-07-15 18:42:07 UTC (rev 103)
@@ -34,17 +34,21 @@
* \ingroup Models
*/
template <typename Strat1, typename Strat2, typename T>
- struct StrategyModel<Choice<Strat1, Strat2>, T> {
- typedef StrategyConcept<StrategyModel<Strat1, T> > require1;
- typedef StrategyConcept<StrategyModel<Strat2, T> > require2;
- typedef Choice<Strat1, Strat2> Strat;
- typedef T Input;
- typedef
- decltype(common_convertible(std::declval<typename StrategyModel<Strat1, T>
- ::Output>(),
- std::declval<typename StrategyModel<Strat2, T>
- ::Output>()))
- Output;
+ struct StrategyModel<Choice<Strat1, Strat2>, T, false> {
+ struct Model {
+ typedef typename StrategyModel<Strat1, T>::Model Model1;
+ typedef typename StrategyModel<Strat2, T>::Model Model2;
+
+ typedef typename StrategyConcept<Model1>:: static_check require1;
+ typedef typename StrategyConcept<Model2>:: static_check require2;
+
+ typedef Choice<Strat1, Strat2> Strat;
+ typedef T Input;
+ typedef
+ decltype(common_convertible(std::declval<typename Model1::Output>(),
+ std::declval<typename Model2::Output>()))
+ Output;
+ };
};
/*! \ingroup Strategies
@@ -59,7 +63,7 @@
}
template <typename T>
- typename StrategyModel<Choice, T>::Output
+ typename StrategyModel<Choice, T>::Model::Output
operator()(const T& term) const {
try {
return s1(term);
Modified: trunk/src/strategies/generic/seq.hh
===================================================================
--- trunk/src/strategies/generic/seq.hh 2010-07-07 17:33:25 UTC (rev 102)
+++ trunk/src/strategies/generic/seq.hh 2010-07-15 18:42:07 UTC (rev 103)
@@ -28,16 +28,19 @@
* \ingroup Models
*/
template <typename Strat1, typename Strat2, typename T>
- struct StrategyModel<Seq<Strat1, Strat2>, T> {
- typedef StrategyConcept<StrategyModel<Strat1, T> > require1;
- typedef StrategyConcept<StrategyModel<Strat2,
- typename StrategyModel<Strat1, T>
- ::Output> > require2;
- typedef Seq<Strat1, Strat2> Strat;
- typedef T Input;
- typedef typename StrategyModel<Strat2,
- typename StrategyModel<Strat1, T>::Output>
- ::Output Output;
+ struct StrategyModel<Seq<Strat1, Strat2>, T, false> {
+ struct Model {
+ typedef typename StrategyModel<Strat1, T>::Model Model1;
+ typedef typename StrategyModel<Strat2, typename Model1::Output>::Model
+ Model2;
+
+ typedef typename StrategyConcept<Model1>:: static_check require1;
+ typedef typename StrategyConcept<Model2>:: static_check require2;
+
+ typedef Seq<Strat1, Strat2> Strat;
+ typedef T Input;
+ typedef typename Model2::Output Output;
+ };
};
/*! \ingroup Strategies
@@ -52,9 +55,7 @@
}
template <typename T>
- typename StrategyModel<Strat2,
- typename StrategyModel<Strat1, T>::Output>
- ::Output
+ typename StrategyModel<Seq<Strat1, Strat2>, T>::Model::Output
operator()(const T& term) const {
return s2(s1(term));
}
Modified: trunk/src/strategies/patterns/scope.hh
===================================================================
--- trunk/src/strategies/patterns/scope.hh 2010-07-07 17:33:25 UTC (rev 102)
+++ trunk/src/strategies/patterns/scope.hh 2010-07-15 18:42:07 UTC (rev 103)
@@ -26,19 +26,22 @@
struct Scope {
private:
Strat s;
- Variable<T> v;
+ T v;
public:
- Scope(const Strat& s, const Variable<T>& v): s(s), v(v) {}
+ Scope(const Strat& s, const T& v): s(s), v(v) {}
Scope(const Scope& other): s(other.s), v(other.v) {}
template <typename U>
- typename StrategyModel<Strat, U>::Output
+ typename StrategyModel<Strat, U>::Model::Output
operator()(const U& t) const {
- typedef StrategyConcept<StrategyModel<Strat, U> > require;
+ typedef typename StrategyConcept
+ <typename StrategyModel<Strat, U>::Model>::static_check
+ require;
+
try {
v.push();
- typename StrategyModel<Strat, U>::Output ret = s(t);
+ typename StrategyModel<Strat, U>::Model::Output ret = s(t);
v.pop();
return ret;
} catch (...) {
@@ -48,10 +51,62 @@
}
};
+ template <typename H, typename T>
+ struct VariableListCons {
+ private:
+ H h;
+ T t;
+ public:
+ VariableListCons(const H& h, const T& t):
+ h(h), t(t) {}
+
+ void push() {
+ h.push();
+ t.push();
+ }
+ void pop() {
+ h.pop();
+ t.pop();
+ }
+ };
+
+ struct VariableListEnd {
+ public:
+ void push() const {}
+ void pop() const {}
+ };
+
+ template <typename V, typename U>
+ VariableListCons<Variable<V>,
+ VariableListCons<
+ Variable<U>,
+ VariableListEnd>
+ >
+ operator,(const Variable<V>& v, const Variable<U>& u) {
+ return
+ VariableListCons<Variable<V>, VariableListCons<Variable<U>,
+ VariableListEnd> >
+ (v, VariableListCons<Variable<U>, VariableListEnd>(u, VariableListEnd()));
+ }
+
+ template <typename H, typename L, typename U>
+ VariableListCons<Variable<U>, VariableListCons<H, L> >
+ operator,(const VariableListCons<H, L>& v, const Variable<U>& u) {
+ return
+ VariableListCons<Variable<U>, VariableListCons<H, L> >
+ (u, v);
+ }
+
template <typename Strat, typename T>
- Scope<Strat, T> scope(const Variable<T>& v, const Strat& s) {
- return Scope<Strat, T>(s, v);
+ Scope<Strat, Variable<T> > scope(const Variable<T>& v, const Strat& s) {
+ return Scope<Strat, Variable<T> >(s, v);
}
+
+ template <typename Strat, typename T, typename U>
+ Scope<Strat, VariableListCons<T, U> >
+ scope(const VariableListCons<T, U>& v, const Strat& s) {
+ return Scope<Strat, VariableListCons<T, U> >(s, v);
+ }
}
#endif
Modified: trunk/src/strategies/strategies.hh
===================================================================
--- trunk/src/strategies/strategies.hh 2010-07-07 17:33:25 UTC (rev 102)
+++ trunk/src/strategies/strategies.hh 2010-07-15 18:42:07 UTC (rev 103)
@@ -18,6 +18,7 @@
# define __STRATEGIES_HH
# include "../terms/term.hh"
+# include <type_traits/is_callable_with.hh>
# include <functional>
namespace aurelia {
@@ -28,7 +29,7 @@
/*! \brief Strategy Concept
*/
template <typename Model>
- struct StrategyConcept {
+ struct StrategyConcept: public Model {
public:
typedef typename Model::Strat Strat;
typedef typename Model::Input Input;
@@ -37,6 +38,7 @@
//! \throws Failure
Output operator()(Strat, Input);
#else
+ typedef void static_check;
private:
static_assert(std::is_same<decltype(std::declval<Strat>()
(std::declval<Input>())),
@@ -50,20 +52,46 @@
* @{
*/
template <typename S, typename I>
- struct StrategyModel {
+ struct DefaultStrategyModel {
typedef S Strat;
typedef I Input;
typedef decltype(std::declval<Strat>()(std::declval<Input>())) Output;
};
+ template <typename S, typename I>
+ struct AutoStrategyModel: public std::false_type {
+ };
+
+ template <typename Ret, typename I>
+ struct AutoStrategyModel<Ret(I),I>: public std::true_type {
+ };
+
+ template <typename S, typename I,
+ bool = type_traits::is_callable_with<S, I>::value>
+ struct StrategyModel;
+
+ template <typename S, typename I>
+ struct StrategyModel<S, I, false> {
+ typedef void NoModel;
+ };
+
+ /*! Strategy model for functions
+ */
+ template <typename S, typename I>
+ struct StrategyModel<S, I, true> {
+ typedef DefaultStrategyModel<S, I> Model;
+ };
+
/*! Strategy Model for std::function
*/
template <typename R, typename ArgType>
- struct StrategyModel<std::function<R(ArgType)>, ArgType> {
- typedef StrategyConcept<StrategyModel<std::function<R(ArgType)>, ArgType> > require;
- typedef std::function<R(ArgType)> Strat;
- typedef ArgType Input;
- typedef R Output;
+ struct StrategyModel<std::function<R(ArgType)>, ArgType, false> {
+ struct Model {
+ typedef StrategyConcept<StrategyModel<std::function<R(ArgType)>, ArgType> > require;
+ typedef std::function<R(ArgType)> Strat;
+ typedef ArgType Input;
+ typedef R Output;
+ };
};
/*! @} */
Modified: trunk/src/strategies/traversals/alltd.hh
===================================================================
--- trunk/src/strategies/traversals/alltd.hh 2010-07-07 17:33:25 UTC (rev 102)
+++ trunk/src/strategies/traversals/alltd.hh 2010-07-15 18:42:07 UTC (rev 103)
@@ -30,7 +30,7 @@
public: Alltd(const S& s): s(s) {}
template <typename T>
T operator()(const T& term) const {
- typedef StrategyConcept<StrategyModel<S, T> > require;
+ typedef StrategyConcept<typename StrategyModel<S, T>::Model> require;
return (s + all(*this))(term);
}
Property changes on: trunk/src/type_traits
___________________________________________________________________
Added: svn:ignore
+ Makefile.in
Makefile
Added: trunk/src/type_traits/Makefile.am
===================================================================
--- trunk/src/type_traits/Makefile.am (rev 0)
+++ trunk/src/type_traits/Makefile.am 2010-07-15 18:42:07 UTC (rev 103)
@@ -0,0 +1,22 @@
+# This file is a part of Aurelia.
+# Copyright (C) 2010 Valentin David
+# Copyright (C) 2010 University of Bergen
+#
+# 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/>.
+
+type_traits_HEADERS= \
+ is_callable_with.hh \
+ overloading_priority.hh
+
+type_traitsdir=$(includedir)/type_traits
Added: trunk/src/type_traits/is_callable_with.hh
===================================================================
--- trunk/src/type_traits/is_callable_with.hh (rev 0)
+++ trunk/src/type_traits/is_callable_with.hh 2010-07-15 18:42:07 UTC (rev 103)
@@ -0,0 +1,60 @@
+// This file is a part of Aurelia.
+// Copyright (C) 2010 Valentin David
+// Copyright (C) 2010 University of Bergen
+//
+// 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/>.
+#ifndef __IS_CALLABLE_WITH_HH
+# define __IS_CALLABLE_WITH_HH
+
+# include <type_traits>
+# include "overloading_priority.hh"
+
+namespace aurelia {
+ namespace type_traits {
+
+ template <typename T, typename U>
+ std::false_type is_callable_helper(try_second, T, U) {
+ return 0;
+ }
+
+ template <typename T, typename U,
+ typename =
+ decltype(std::declval<T&>()(std::declval<U>()))>
+ std::true_type is_callable_helper(try_first, T&, U&&) {
+ return 0;
+ }
+
+ template <typename T, typename U,
+ typename =
+ decltype(std::declval<const T&>()(std::declval<U>()))>
+ std::true_type is_callable_helper(try_first, const T&, U&&) {
+ return 0;
+ }
+
+ template <typename T>
+ struct itself {
+ typedef T type;
+ };
+
+ template <typename T, typename U>
+ struct is_callable_with:
+ public itself<decltype(is_callable_helper(try_first(),
+ std::declval<T>(),
+ std::declval<U>()))>::type {
+ };
+
+ }
+}
+
+#endif
Added: trunk/src/type_traits/overloading_priority.hh
===================================================================
--- trunk/src/type_traits/overloading_priority.hh (rev 0)
+++ trunk/src/type_traits/overloading_priority.hh 2010-07-15 18:42:07 UTC (rev 103)
@@ -0,0 +1,32 @@
+// This file is a part of Aurelia.
+// Copyright (C) 2010 Valentin David
+// Copyright (C) 2010 University of Bergen
+//
+// 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/>.
+#ifndef __OVERLOADING_PRIORITY_HH
+# define __OVERLOADING_PRIORITY_HH
+
+namespace aurelia {
+ namespace type_traits {
+
+ struct try_first {};
+
+ struct try_second {
+ try_second(const try_first&) {}
+ };
+
+ }
+}
+
+#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-07 17:33:34
|
Revision: 102
http://aurelia.svn.sourceforge.net/aurelia/?rev=102&view=rev
Author: valentindavid
Date: 2010-07-07 17:33:25 +0000 (Wed, 07 Jul 2010)
Log Message:
-----------
2010-07-07 Valentin David <val...@ii...>
* src/box/box.hh:
Add support of dynamic boxes and box lists.
* src/box/tests/box_test.cc:
Update.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/box/box.hh
trunk/src/box/tests/box_test.cc
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-07 17:30:20 UTC (rev 101)
+++ trunk/ChangeLog 2010-07-07 17:33:25 UTC (rev 102)
@@ -1,5 +1,13 @@
2010-07-07 Valentin David <val...@ii...>
+ * src/box/box.hh:
+ Add support of dynamic boxes and box lists.
+
+ * src/box/tests/box_test.cc:
+ Update.
+
+2010-07-07 Valentin David <val...@ii...>
+
Add automatic dependencies for documenation generation.
* doc/gendeps.sh.in:
Modified: trunk/src/box/box.hh
===================================================================
--- trunk/src/box/box.hh 2010-07-07 17:30:20 UTC (rev 101)
+++ trunk/src/box/box.hh 2010-07-07 17:33:25 UTC (rev 102)
@@ -20,6 +20,7 @@
# include <iostream>
# include <string>
+# include <memory>
/*! \file
* \brief Provides pretty-printing box operations
@@ -27,10 +28,26 @@
namespace aurelia {
+ /*! \brief Abstract virtual class for box elements
+ */
+ struct VirtualBox {
+ /*! \brief Virtual destructor
+ */
+ virtual ~VirtualBox() {}
+
+ /*! \brief Prints out the box
+ *
+ * \param s A stream
+ * \param pos The current horizontal position
+ * \returns The horizontal position achieved
+ */
+ virtual unsigned to_text(std::ostream& s, unsigned pos) const = 0;
+ };
+
/*! \brief Abstract static class for box elements
*/
template <typename ExactType>
- struct Box {
+ struct Box: public VirtualBox {
//! \brief Downcast operator
operator ExactType&() {
return *static_cast<ExactType*>(this);
@@ -49,27 +66,76 @@
std::string s;
public:
+ /*! \brief Constructor
+ */
StringBox(const std::string& s): s(s) {}
+ /*! \brief Copy constructor
+ */
+ StringBox(const StringBox& other): s(other.s) {}
+
+ /*! \brief String accessor
+ */
operator std::string() const {
return s;
}
+
+ /*! \brief Assignement
+ */
+ StringBox& operator=(StringBox other) {
+ this->swap(other);
+ return *this;
+ }
+
+ /*! \brief Exception-free swap
+ */
+ void swap(StringBox& other) {
+ std::swap(this->s, other.s);
+ }
+
+ /*! \brief Prints out the string
+ */
+ virtual unsigned to_text(std::ostream& s, unsigned pos) const;
};
//! \brief Alias for building string boxes.
typedef StringBox S;
+ /*! \brief Directions as run-time values
+ */
+ enum Dir : unsigned {
+ HDir, VDir, HVDir
+ };
+
//! \brief Horizontal direction tag
- struct HBox {};
+ struct HBox {
+ enum { dir = HDir };
+ };
//! \brief Vertical direction tag
- struct VBox {};
+ struct VBox {
+ enum { dir = VDir };
+ };
//! \brief Horizontal or vertical direction tag
- struct HVBox {};
+ struct HVBox {
+ enum { dir = HVDir };
+ };
+ struct VirtualBoxList {
+ /*! \brief Virtual Destructor
+ */
+ virtual ~VirtualBoxList() {}
+
+ /*! \brief Prints out the box
+ */
+ virtual unsigned to_text(std::ostream& s, unsigned pos,
+ unsigned VS, unsigned HS, unsigned IS,
+ Dir direction, bool first) const = 0;
+ };
+
/*! \brief Static abstract class for lists of pretty printing boxes.
*/
template <typename ExactType>
- struct BoxList {
+ struct BoxList: public VirtualBoxList {
//! \brief Downcast operator
operator ExactType&() {
return *static_cast<ExactType*>(this);
@@ -81,10 +147,17 @@
}
};
+
/*! \brief Represents and empty list of boxes
*/
struct BoxListEnd:
- public BoxList<BoxListEnd> {};
+ public BoxList<BoxListEnd> {
+ virtual unsigned to_text(std::ostream&, unsigned pos,
+ unsigned, unsigned, unsigned,
+ Dir, bool) const {
+ return pos;
+ }
+ };
/*! \brief List of boxes
*/
@@ -111,8 +184,75 @@
const Tail& tail() const {
return _tail;
}
+
+ /*! \brief Prints out the box
+ */
+ virtual unsigned to_text(std::ostream& s, unsigned pos,
+ unsigned HS, unsigned VS, unsigned IS,
+ Dir direction, bool first)
+ const {
+ if (direction == HDir) {
+ pos = box_to_text(s, pos, head());
+ for (unsigned i = 0; i < HS; ++i)
+ s << " ";
+ pos += HS;
+ return tail().to_text(s, pos, HS, VS, IS, direction, false);
+ } else if (direction == VDir) {
+ if (!first) {
+ for (unsigned i = 0; i <= VS; ++i)
+ s << "\n";
+ for (unsigned i = 0; i < pos; ++i)
+ s << " ";
+ }
+ box_to_text(s, pos, head());
+ if (first)
+ pos += IS;
+ return tail().to_text(s, pos, HS, VS, IS, direction, false);
+ }
+
+ return pos;
+ }
};
+
+ /*! \brief Box list wrapping a virtual box list.
+ */
+ struct AnyBoxList: public BoxList<AnyBoxList> {
+ private:
+ std::shared_ptr<VirtualBoxList> list;
+
+ public:
+ /*! \brief Constructor
+ */
+ template <typename ExactType>
+ AnyBoxList(const BoxList<ExactType>& l): list(new ExactType(l)) {}
+
+ /*! \brief Copy constructor
+ */
+ AnyBoxList(const AnyBoxList& other): list(other.list) {}
+
+ /*! \brief Assignment
+ */
+ AnyBoxList& operator=(AnyBoxList other) {
+ this->swap(other);
+ return *this;
+ }
+
+ /*! \brief Exception-free swap
+ */
+ void swap(AnyBoxList& other) {
+ std::swap(this->list, other.list);
+ }
+
+ /*! \brief Prints out the box
+ */
+ virtual unsigned to_text(std::ostream& s, unsigned pos,
+ unsigned VS, unsigned HS, unsigned IS,
+ Dir direction, bool first) const {
+ return list->to_text(s, pos, VS, HS, IS, direction, first);
+ }
+ };
+
/*! \brief A container box with directions.
*
* \tparam Direction One of VBox, HBox, HVBox
@@ -128,9 +268,12 @@
private:
List list;
public:
- //! \brief Default Constructor
+ //! \brief Constructor
ContainerBox(const List& list): list(list) {}
+ //! \brief Copy constructor
+ ContainerBox(const ContainerBox& other): list(other.list) {}
+
//! \brief Accessor to list methods
const List* operator->() const {
return &list;
@@ -140,8 +283,58 @@
const List& operator*() const {
return list;
}
+
+ //! \brief Assignment
+ ContainerBox& operator=(ContainerBox other) {
+ this->swap(other);
+ return *this;
+ }
+
+ //! \brief Exception-free swap
+ void swap(ContainerBox& other) {
+ this->list.swap(other.list);
+ }
+
+ //! \brief Prints out the box
+ virtual unsigned to_text(std::ostream& s, unsigned pos) const {
+ return box_to_text(s, pos, *this);
+ }
};
+ /*! \brief Box wrapping a virtual box.
+ */
+ struct AnyBox: public Box<AnyBox> {
+ private:
+ std::shared_ptr<VirtualBox> box;
+
+ public:
+ /*! \brief Constructor
+ */
+ template <typename RealType>
+ explicit AnyBox(const Box<RealType>& b): box(new RealType(b)) {}
+
+ /*! \brief Copy constructor
+ */
+ AnyBox(const AnyBox& other): box(other.box) {}
+
+ /*! \brief Assignement
+ */
+ AnyBox& operator=(AnyBox other) {
+ this->swap(other);
+ return (*this);
+ }
+
+ /*! \brief Exception-free swap
+ */
+ void swap(AnyBox& other) {
+ std::swap(this->box, other.box);
+ }
+
+ /*! \brief Prints out the box
+ */
+ virtual unsigned to_text(std::ostream&s, unsigned pos) const;
+ };
+
/*! \brief Appends a box at the end of a list
*/
template <typename ExactBox>
@@ -409,6 +602,18 @@
return pos + std::string(str).size();
}
+ /*! \brief Prints out an AnyBox
+ *
+ * \param s A stream
+ * \param pos The current horizontal position
+ * \param b The AnyBox to print out
+ * \returns The horizontal position achieved
+ */
+ template <typename Stream>
+ unsigned box_to_text(Stream& s, unsigned pos, const AnyBox& b) {
+ return b.to_text(s, pos);
+ }
+
/*! \brief Prints out a vertical box
*
* \param s A stream
@@ -457,6 +662,34 @@
return box_to_text(s, pos, HBox(), (Hs<HS>()), *b);
}
+ /*! \brief Prints out a horizontal box
+ *
+ * \param s A stream
+ * \param pos The current horizontal postion
+ * \param b The box to print out
+ * \returns The horizontal position achieved
+ */
+ template <typename Stream, unsigned VS, unsigned HS, unsigned IS>
+ unsigned box_to_text(Stream& s, unsigned pos,
+ const ContainerBox<HBox, VS, HS, IS,
+ AnyBoxList>& b) {
+ return b->to_text(s, pos, VS, HS, IS, HDir, true);
+ }
+
+ /*! \brief Prints out a vertical box
+ *
+ * \param s A stream
+ * \param pos The current horizontal postion
+ * \param b The box to print out
+ * \returns The horizontal position achieved
+ */
+ template <typename Stream, unsigned VS, unsigned HS, unsigned IS>
+ unsigned box_to_text(Stream& s, unsigned pos,
+ const ContainerBox<VBox, VS, HS, IS,
+ AnyBoxList>& b) {
+ return b->to_text(s, pos, VS, HS, IS, VDir, true);
+ }
+
/*! \brief Prints out an empty horizontal box
*
* \param s A stream
@@ -477,10 +710,17 @@
*/
template <typename Stream, typename ExactBox>
Stream& operator<<(Stream& s, const Box<ExactBox>& b) {
- box_to_text(s, 0U, ExactBox(b));
+ box_to_text(s, 0U, (const ExactBox&)(b));
return s;
}
+ unsigned StringBox::to_text(std::ostream& s, unsigned pos) const {
+ return box_to_text(s, pos, *this);
+ }
+
+ unsigned AnyBox::to_text(std::ostream& s, unsigned pos) const {
+ return this->box->to_text(s, pos);
+ }
}
#endif
Modified: trunk/src/box/tests/box_test.cc
===================================================================
--- trunk/src/box/tests/box_test.cc 2010-07-07 17:30:20 UTC (rev 101)
+++ trunk/src/box/tests/box_test.cc 2010-07-07 17:33:25 UTC (rev 102)
@@ -60,5 +60,15 @@
if (!test(7, H(Hs<0>())[S("a"), S("b")], "ab"))
error = 1;
+ AnyBox a(H(Hs<1>())[S("a"), S("b"), V()[S("c"), S("d")]]);
+ if (!test(8, V(Is<2>())[a, S("e")],
+ "a b c\n d\n e"))
+ error = 1;
+
+ AnyBoxList l = (H(Hs<1>())[S("a"), S("b"), V()[S("c"), S("d")]], S("e"));
+ if (!test(8, V(Is<2>())[l],
+ "a b c\n d\n e"))
+ error = 1;
+
return error;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-07 17:30:26
|
Revision: 101
http://aurelia.svn.sourceforge.net/aurelia/?rev=101&view=rev
Author: valentindavid
Date: 2010-07-07 17:30:20 +0000 (Wed, 07 Jul 2010)
Log Message:
-----------
2010-07-07 Valentin David <val...@ii...>
Add automatic dependencies for documenation generation.
* doc/gendeps.sh.in:
New.
* doc/Doxyfile.in:
Set gendeps.sh as filter.
* doc/Makefile.am:
Include dependencies for documentation. Install documentation
only on install-html target.
* configure.ac:
Add gendeps.sh in config files. Add config command to generate
dummy dependency file for documentation generation.
* doc/footer.html:
Add version number in footer.
Modified Paths:
--------------
trunk/ChangeLog
trunk/configure.ac
trunk/doc/Doxyfile.in
trunk/doc/Makefile.am
trunk/doc/footer.html
Added Paths:
-----------
trunk/doc/gendeps.sh.in
Property Changed:
----------------
trunk/doc/
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-06 13:40:52 UTC (rev 100)
+++ trunk/ChangeLog 2010-07-07 17:30:20 UTC (rev 101)
@@ -1,3 +1,24 @@
+2010-07-07 Valentin David <val...@ii...>
+
+ Add automatic dependencies for documenation generation.
+
+ * doc/gendeps.sh.in:
+ New.
+
+ * doc/Doxyfile.in:
+ Set gendeps.sh as filter.
+
+ * doc/Makefile.am:
+ Include dependencies for documentation. Install documentation
+ only on install-html target.
+
+ * configure.ac:
+ Add gendeps.sh in config files. Add config command to generate
+ dummy dependency file for documentation generation.
+
+ * doc/footer.html:
+ Add version number in footer.
+
2010-07-06 Valentin David <val...@ii...>
* src/sig/tests/Makefile.am: Fix "make check" dependencies.
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2010-07-06 13:40:52 UTC (rev 100)
+++ trunk/configure.ac 2010-07-07 17:30:20 UTC (rev 101)
@@ -148,6 +148,11 @@
PACKAGE_VERSION
VERSION])
+AC_CONFIG_COMMANDS([docdeps], [
+ AS_MKDIR_P([doc/$DEPDIR])
+ test -f doc/$DEPDIR/doc.deps || echo '# Dummy' >doc/$DEPDIR/doc.deps
+])
+
AC_CONFIG_FILES([
Makefile
demos-from-rascal/Makefile
@@ -173,4 +178,6 @@
doc/Doxyfile
])
+AC_CONFIG_FILES([doc/gendeps.sh], [chmod +x doc/gendeps.sh])
+
AC_OUTPUT
Property changes on: trunk/doc
___________________________________________________________________
Modified: svn:ignore
- html
html.stamp
Doxyfile
Makefile.in
Makefile
header-exp.html
+ html
html.stamp
Doxyfile
Makefile.in
Makefile
header-exp.html
.deps
gendeps.sh
Modified: trunk/doc/Doxyfile.in
===================================================================
--- trunk/doc/Doxyfile.in 2010-07-06 13:40:52 UTC (rev 100)
+++ trunk/doc/Doxyfile.in 2010-07-07 17:30:20 UTC (rev 101)
@@ -659,7 +659,7 @@
# If FILTER_PATTERNS is specified, this tag will be
# ignored.
-INPUT_FILTER =
+INPUT_FILTER = ./@srcdir@/gendeps.sh
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis.
Modified: trunk/doc/Makefile.am
===================================================================
--- trunk/doc/Makefile.am 2010-07-06 13:40:52 UTC (rev 100)
+++ trunk/doc/Makefile.am 2010-07-07 17:30:20 UTC (rev 101)
@@ -15,6 +15,16 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+@am__include@ $(DEPDIR)/doc.deps
+
+DOCFILES= \
+ header-exp.html \
+ footer.html \
+ Doxyfile \
+ bldl-mini.png \
+ doxygen.png \
+ stylesheet.css
+
if BOOTSTRAP
header-exp.html: header.html
@@ -27,21 +37,34 @@
html: html.stamp
-html.stamp: header-exp.html
+html.stamp: $(DOCFILES)
-rm -rf output.tmp
- $(MAKE) $(AM_MAKEFLAGS) Doxyfile
+ $(MAKE) $(AM_MAKEFLAGS) Doxyfile gendeps.sh
+ echo "html.stamp: \\" >$(DEPDIR)/doc.Tdeps
if $(DOXYGEN) Doxyfile; then \
- mv output.tmp/html . ; \
+ echo '' >>$(DEPDIR)/doc.Tdeps; \
+ mv -f $(DEPDIR)/doc.Tdeps $(DEPDIR)/doc.deps; \
+ rm -rf html; \
+ mv -f output.tmp/html . ; \
rm -rf output.tmp ; \
touch html.stamp ; \
else \
+ rm -f $(DEPDIR)/doc.Tdeps; \
rm -rf output.tmp; \
exit 1; \
fi
- cp bldl-mini.png html
- cp -f doxygen.png html
+ cp $(srcdir)/bldl-mini.png html
+ cp -f $(srcdir)/doxygen.png html
-install-data-local: html
+clean-local:
+ rm -rf html
+
+CLEANFILES=html.stamp header-exp.html
+else
+CLEANFILES=
+endif
+
+install-html-local: html
rm -rf $(DESTDIR)$(htmldir)/html
$(MKDIR_P) "$(DESTDIR)$(htmldir)/html"
if test -f html.stamp; then \
@@ -54,13 +77,11 @@
uninstall-local:
rm -rf $(DESTDIR)$(htmldir)/html
-clean-local:
- rm -rf html
+distclean-local:
+ -rm -rf ./$(DEPDIR)
-CLEANFILES=html.stamp header-exp.html
-else
-CLEANFILES=
-endif
+maintainer-clean-local:
+ -rm -rf ./$(DEPDIR)
EXTRA_DIST= \
html \
Modified: trunk/doc/footer.html
===================================================================
--- trunk/doc/footer.html 2010-07-06 13:40:52 UTC (rev 100)
+++ trunk/doc/footer.html 2010-07-07 17:30:20 UTC (rev 101)
@@ -1,6 +1,7 @@
</div>
<p class="footer">Copyright © 2010 Valentin David, University of Bergen</p>
-<p class="footer">Generated on $datetime by <a href="http://www.doxygen.org/index.html">doxygen</a> $doxygenversion</p>
+<p class="footer">Generated on $datetime by <a href="http://www.doxygen.org/index.html">doxygen</a> $doxygenversion for $projectname $projectnumber.</p>
+
</body>
</html>
Added: trunk/doc/gendeps.sh.in
===================================================================
--- trunk/doc/gendeps.sh.in (rev 0)
+++ trunk/doc/gendeps.sh.in 2010-07-07 17:30:20 UTC (rev 101)
@@ -0,0 +1,10 @@
+#! @SHELL@
+
+if test -f @DEPDIR@/doc.Tdeps
+then
+ echo " $1 \\" >>@DEPDIR@/doc.Tdeps
+else
+ echo "Cannot write to @DEPDIR@/doc.Tdeps" 1>&2
+fi
+
+exec cat "$1"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-06 13:40:59
|
Revision: 100
http://aurelia.svn.sourceforge.net/aurelia/?rev=100&view=rev
Author: valentindavid
Date: 2010-07-06 13:40:52 +0000 (Tue, 06 Jul 2010)
Log Message:
-----------
2010-07-06 Valentin David <val...@ii...>
* src/sig/tests/Makefile.am: Fix "make check" dependencies.
* configure.ac: Remove an error message from svn.
Modified Paths:
--------------
trunk/ChangeLog
trunk/configure.ac
trunk/src/sig/tests/Makefile.am
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-05 16:32:07 UTC (rev 99)
+++ trunk/ChangeLog 2010-07-06 13:40:52 UTC (rev 100)
@@ -1,3 +1,9 @@
+2010-07-06 Valentin David <val...@ii...>
+
+ * src/sig/tests/Makefile.am: Fix "make check" dependencies.
+
+ * configure.ac: Remove an error message from svn.
+
2010-07-05 Valentin David <val...@ii...>
Provide utilities for pretty printing similar to GPP syntax.
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2010-07-05 16:32:07 UTC (rev 99)
+++ trunk/configure.ac 2010-07-06 13:40:52 UTC (rev 100)
@@ -92,7 +92,7 @@
AC_CHECK_PROGS([DOXYGEN], [doxygen], [dnl
AC_MSG_ERROR([doxygen not found. Please set variable DOXYGEN.])])
BOOTSTRAP=true
- svnrev=`$SVN info | sed "/Revision: /{;s///;q;};d"`
+ svnrev=`$SVN info 2>/dev/null | sed "/Revision: /{;s///;q;};d"`
if test -z "$svnrev"
then
svnrev=`cat $srcdir/svnrev`
Modified: trunk/src/sig/tests/Makefile.am
===================================================================
--- trunk/src/sig/tests/Makefile.am 2010-07-05 16:32:07 UTC (rev 99)
+++ trunk/src/sig/tests/Makefile.am 2010-07-06 13:40:52 UTC (rev 100)
@@ -27,6 +27,9 @@
stratego.hh: ../sig
+../sig:
+ cd .. && $(MAKE) $(AM_MAKEFLAGS) sig
+
stratego.hh: stratego.rtree
if ../sig <$< >stratego.hh.tmp; then \
mv -f stratego.hh.tmp stratego.hh; \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-05 16:32:13
|
Revision: 99
http://aurelia.svn.sourceforge.net/aurelia/?rev=99&view=rev
Author: valentindavid
Date: 2010-07-05 16:32:07 +0000 (Mon, 05 Jul 2010)
Log Message:
-----------
2010-07-05 Valentin David <val...@ii...>
Provide utilities for pretty printing similar to GPP syntax.
* src/box/box.hh,
* src/box/Makefile.am:
New.
* src/box/tests/Makefile.am,
* src/box/tests/box_test.cc:
New.
* src/Makefile.am, configure.ac:
Update.
Modified Paths:
--------------
trunk/ChangeLog
trunk/configure.ac
trunk/src/Makefile.am
Added Paths:
-----------
trunk/src/box/
trunk/src/box/Makefile.am
trunk/src/box/box.hh
trunk/src/box/tests/
trunk/src/box/tests/Makefile.am
trunk/src/box/tests/box_test.cc
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-05 12:11:43 UTC (rev 98)
+++ trunk/ChangeLog 2010-07-05 16:32:07 UTC (rev 99)
@@ -1,5 +1,20 @@
2010-07-05 Valentin David <val...@ii...>
+ Provide utilities for pretty printing similar to GPP syntax.
+
+ * src/box/box.hh,
+ * src/box/Makefile.am:
+ New.
+
+ * src/box/tests/Makefile.am,
+ * src/box/tests/box_test.cc:
+ New.
+
+ * src/Makefile.am, configure.ac:
+ Update.
+
+2010-07-05 Valentin David <val...@ii...>
+
* src/parser_generator/Syntax.def:
Fix an ambiguity with layout.
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2010-07-05 12:11:43 UTC (rev 98)
+++ trunk/configure.ac 2010-07-05 16:32:07 UTC (rev 99)
@@ -166,6 +166,8 @@
src/parser_generator/Makefile
src/streams/Makefile
src/streams/tests/Makefile
+ src/box/Makefile
+ src/box/tests/Makefile
aurelia.pc
doc/Makefile
doc/Doxyfile
Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am 2010-07-05 12:11:43 UTC (rev 98)
+++ trunk/src/Makefile.am 2010-07-05 16:32:07 UTC (rev 99)
@@ -23,6 +23,7 @@
streams \
terms \
threads \
+ box \
sig \
parser_generator
Property changes on: trunk/src/box
___________________________________________________________________
Added: svn:ignore
+ Makefile.in
Makefile
Added: trunk/src/box/Makefile.am
===================================================================
--- trunk/src/box/Makefile.am (rev 0)
+++ trunk/src/box/Makefile.am 2010-07-05 16:32:07 UTC (rev 99)
@@ -0,0 +1,21 @@
+# This file is a part of Aurelia.
+# Copyright (C) 2010 Valentin David
+# Copyright (C) 2010 University of Bergen
+#
+# 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/>.
+
+boxdir=$(aureliadir)/box
+nobase_box_HEADERS=box.hh
+
+SUBDIRS=tests
Added: trunk/src/box/box.hh
===================================================================
--- trunk/src/box/box.hh (rev 0)
+++ trunk/src/box/box.hh 2010-07-05 16:32:07 UTC (rev 99)
@@ -0,0 +1,486 @@
+// This file is a part of Aurelia.
+// Copyright (C) 2010 Valentin David
+// Copyright (C) 2010 University of Bergen
+//
+// 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/>.
+
+#ifndef __BOX_HH
+# define __BOX_HH
+
+# include <iostream>
+# include <string>
+
+/*! \file
+ * \brief Provides pretty-printing box operations
+ */
+
+namespace aurelia {
+
+ /*! \brief Abstract static class for box elements
+ */
+ template <typename ExactType>
+ struct Box {
+ //! \brief Downcast operator
+ operator ExactType&() {
+ return *static_cast<ExactType*>(this);
+ }
+
+ //! \brief Downcast operator
+ operator const ExactType&() const {
+ return *static_cast<const ExactType*>(this);
+ }
+ };
+
+ /*! \brief Wrap a string as a pretty printing box.
+ */
+ struct StringBox: public Box<StringBox> {
+ private:
+ std::string s;
+
+ public:
+ StringBox(const std::string& s): s(s) {}
+
+ operator std::string() const {
+ return s;
+ }
+ };
+
+ //! \brief Alias for building string boxes.
+ typedef StringBox S;
+
+ //! \brief Horizontal direction tag
+ struct HBox {};
+ //! \brief Vertical direction tag
+ struct VBox {};
+ //! \brief Horizontal or vertical direction tag
+ struct HVBox {};
+
+ /*! \brief Static abstract class for lists of pretty printing boxes.
+ */
+ template <typename ExactType>
+ struct BoxList {
+ //! \brief Downcast operator
+ operator ExactType&() {
+ return *static_cast<ExactType*>(this);
+ }
+
+ //! \brief Downcast operator
+ operator const ExactType&() const {
+ return *static_cast<const ExactType*>(this);
+ }
+ };
+
+ /*! \brief Represents and empty list of boxes
+ */
+ struct BoxListEnd:
+ public BoxList<BoxListEnd> {};
+
+ /*! \brief List of boxes
+ */
+ template <typename Head, typename Tail>
+ struct BoxListCons: public BoxList<BoxListCons<Head, Tail> > {
+ private:
+ Head _head;
+ Tail _tail;
+
+ public:
+ /*! \brief Default constructor
+ */
+ BoxListCons(const Head& _head, const Tail& _tail):
+ _head(_head), _tail(_tail) {}
+
+ /*! \brief Head accessor
+ */
+ const Head& head() const {
+ return _head;
+ }
+
+ /*! \brief Tail accessor
+ */
+ const Tail& tail() const {
+ return _tail;
+ }
+ };
+
+ /*! \brief A container box with directions.
+ *
+ * \tparam Direction One of VBox, HBox, HVBox
+ * \tparam VS Vertical space
+ * \tparam HS Horizontal space
+ * \tparam IS Identation space
+ * \tparam List The list type of sub-boxes
+ */
+ template <typename Direction, unsigned VS, unsigned HS, unsigned IS,
+ typename List>
+ struct ContainerBox:
+ public Box<ContainerBox<Direction, VS, HS, IS, List> > {
+ private:
+ List list;
+ public:
+ //! \brief Default Constructor
+ ContainerBox(const List& list): list(list) {}
+
+ //! \brief Accessor to list methods
+ const List* operator->() const {
+ return &list;
+ }
+
+ //! \brief List accessor
+ const List& operator*() const {
+ return list;
+ }
+ };
+
+ /*! \brief Appends a box at the end of a list
+ */
+ template <typename ExactBox>
+ BoxListCons<ExactBox, BoxListEnd>
+ append(const BoxListEnd&, const Box<ExactBox>& b) {
+ return BoxListCons<ExactBox, BoxListEnd>(b, BoxListEnd());
+ }
+
+ /*! \brief Appends a box at the end of a list
+ */
+ template <typename B, typename Tail, typename ExactBox>
+ BoxListCons<B,decltype(append(std::declval<Tail>(),
+ std::declval<ExactBox>()))>
+ append(const BoxListCons<B, Tail>& l, const Box<ExactBox>& b) {
+ return BoxListCons<B,decltype(append(std::declval<Tail>(),
+ std::declval<ExactBox>()))>
+ (l.head(), append(l.tail(), b));
+ }
+
+ /*! \brief Builds a list from boxes.
+ */
+ template <typename ExactBox, typename ExactList>
+ decltype(append(std::declval<ExactList>(), std::declval<ExactBox>()))
+ operator,(const BoxList<ExactList>& l, const Box<ExactBox>& s) {
+ return append(ExactList(l), s);
+ }
+
+ /*! \brief Builds a list from boxes.
+ */
+ template <typename ExactBox, typename ExactBox2>
+ BoxListCons<ExactBox, BoxListCons<ExactBox2, BoxListEnd> >
+ operator,(const Box<ExactBox>& s, const Box<ExactBox2>& t) {
+ return BoxListCons<ExactBox, BoxListCons<ExactBox2, BoxListEnd> >
+ (s, BoxListCons<ExactBox2, BoxListEnd>(t, BoxListEnd()));
+ }
+
+ /*! \brief Tuple for space configuration
+ */
+ template <unsigned VS, unsigned HS, unsigned IS>
+ struct SpaceConf {};
+
+ //! \brief Creates a space configuration with vertical specification
+ template <unsigned VS>
+ SpaceConf<VS, 0, 0> Vs() {
+ return SpaceConf<VS, 0, 0>();
+ }
+
+ //! \brief Creates a space configuration with horizontal specification
+ template <unsigned HS>
+ SpaceConf<0, HS, 0> Hs() {
+ return SpaceConf<0, HS, 0>();
+ }
+
+ //! \brief Creates a space configuration with identation specification
+ template <unsigned IS>
+ SpaceConf<0, 0, IS> Is() {
+ return SpaceConf<0, 0, IS>();
+ }
+
+ //! \brief Gets a maximum value from two constants at compile-time
+ template <unsigned a, unsigned b>
+ struct Max {
+ enum : unsigned { ret = (a>b)?a:b };
+ };
+
+
+ //! \brief Merges two configurations
+ template <unsigned VS1, unsigned HS1, unsigned IS1,
+ unsigned VS2, unsigned HS2, unsigned IS2>
+ SpaceConf<Max<VS1, VS2>::ret,
+ Max<HS1, HS2>::ret,
+ Max<IS1, IS2>::ret>
+ operator,(const SpaceConf<VS1, HS1, IS1>&,
+ const SpaceConf<VS2, HS2, IS2>&) {
+ return SpaceConf<Max<VS1, VS2>::ret,
+ Max<HS1, HS2>::ret,
+ Max<IS1, IS2>::ret>();
+ }
+
+ //! \brief Provides building operation for boxes.
+ template <typename Direction, unsigned VS, unsigned HS, unsigned IS>
+ struct BoxArtifact {
+ //! \brief Builds a box container from a list of boxes
+ template <typename ExactList>
+ ContainerBox<Direction, VS, HS, IS, ExactList>
+ operator[](const BoxList<ExactList>& l) const {
+ return ContainerBox<Direction, VS, HS, IS, ExactList>(l);
+ }
+
+ //! \brief Builds a box container from a singleton of box
+ template <typename ExactBox>
+ ContainerBox<Direction, VS, HS, IS, BoxListCons<ExactBox, BoxListEnd> >
+ operator[](const Box<ExactBox>& l) const {
+ return
+ ContainerBox<Direction, VS, HS, IS, BoxListCons<ExactBox, BoxListEnd> >
+ (BoxListCons<ExactBox, BoxListEnd>(l, BoxListEnd()));
+ }
+ };
+
+ //! \brief Returns a builder for a horizontal box.
+ template <unsigned VS, unsigned HS, unsigned IS>
+ BoxArtifact<HBox, VS, HS, IS> H(const SpaceConf<VS, HS, IS>&) {
+ return BoxArtifact<HBox, VS, HS, IS>();
+ }
+
+ //! \brief Returns a builder for a horizontal box.
+ BoxArtifact<HBox, 0, 1, 0> H() {
+ return BoxArtifact<HBox, 0, 1, 0>();
+ }
+
+ //! \brief Returns a builder for a vertical box.
+ template <unsigned VS, unsigned HS, unsigned IS>
+ BoxArtifact<VBox, VS, HS, IS> V(const SpaceConf<VS, HS, IS>&) {
+ return BoxArtifact<VBox, VS, HS, IS>();
+ }
+
+ //! \brief Returns a builder for a vertical box.
+ BoxArtifact<VBox, 0, 0, 0> V() {
+ return BoxArtifact<VBox, 0, 0, 0>();
+ }
+
+ //! \brief Returns a builder for a horizontal/vertical box.
+ template <unsigned VS, unsigned HS, unsigned IS>
+ BoxArtifact<HVBox, VS, HS, IS> HV(const SpaceConf<VS, HS, IS>&) {
+ return BoxArtifact<HVBox, VS, HS, IS>();
+ }
+
+ //! \brief Returns a builder for a horizontal/vertical box.
+ BoxArtifact<HVBox, 0, 1, 0> HV() {
+ return BoxArtifact<HVBox, 0, 1, 0>();
+ }
+
+ /*! \brief Prints out vertically a list of boxes
+ *
+ * \param s A stream
+ * \param pos The current horizontal position
+ * \param bl The list to print out
+ * \returns The horizontal position achieved
+ */
+ template <typename Stream, unsigned VS, unsigned HS, unsigned IS,
+ typename Head, typename Head2, typename Tail>
+ unsigned box_to_text(Stream& s, unsigned pos, const VBox&,
+ const SpaceConf<VS, HS, IS>&,
+ const BoxListCons<Head,
+ BoxListCons<Head2, Tail> >& bl) {
+ box_to_text(s, pos, bl.head());
+ for (unsigned i = 0; i < (VS + 1); ++i)
+ s << std::endl;
+ for (unsigned i = 0; i < pos; ++i)
+ s << " ";
+ return box_to_text(s, pos, VBox(), SpaceConf<VS, HS, IS>(), bl.tail());
+ }
+
+ /*! \brief Prints out vertically a singleton of box
+ *
+ * \param s A stream
+ * \param pos The current horizontal position
+ * \param bl The list to print out
+ * \returns The horizontal position achieved
+ */
+ template <typename Stream, unsigned VS, unsigned HS, unsigned IS,
+ typename Head>
+ unsigned box_to_text(Stream& s, unsigned pos, const VBox&,
+ const SpaceConf<VS, HS, IS>&,
+ const BoxListCons<Head, BoxListEnd>& bl) {
+ return box_to_text(s, pos, bl.head());
+ }
+
+ /*! \brief Prints out vertically an empty list of boxes
+ *
+ * \param s A stream
+ * \param pos The current horizontal position
+ * \returns The horizontal position achieved
+ */
+ template <typename Stream, unsigned VS, unsigned HS, unsigned IS>
+ unsigned box_to_text(Stream&, unsigned pos, const VBox&,
+ const SpaceConf<VS, HS, IS>&,
+ const BoxListEnd&) {
+ return pos;
+ }
+
+ /*! \brief Utility to print out a non null constant of spaces
+ *
+ * This utility is here to avoid warnings of comparisons always true
+ * from the compiler.
+ */
+ template <unsigned HS>
+ struct print_space {
+ template <typename Stream>
+ static void doit(Stream& s) {
+ for (unsigned i = 0; i < HS; ++i)
+ s << " ";
+ }
+ };
+
+ /*! \brief Utility to print out a null number of spaces
+ *
+ * This utility is here to avoid warnings of comparisons always true
+ * from the compiler.
+ */
+ template <>
+ struct print_space<0U> {
+ template <typename Stream>
+ static void doit(Stream&) {}
+ };
+
+ /*! \brief Prints out horizontally a list of boxes
+ *
+ * \param s A stream
+ * \param pos The current horizontal position
+ * \param bl The list to print out
+ * \returns The horizontal position achieved
+ */
+ template <typename Stream, unsigned VS, unsigned HS, unsigned IS,
+ typename Head, typename Head2, typename Tail>
+ unsigned box_to_text(Stream& s, unsigned pos, const HBox&,
+ const SpaceConf<VS, HS, IS>&,
+ const BoxListCons<Head,
+ BoxListCons<Head2, Tail> >& bl) {
+ pos = box_to_text(s, pos, bl.head());
+ print_space<HS>::doit(s);
+ pos += HS;
+ return box_to_text(s, pos, HBox(), SpaceConf<VS, HS, IS>(), bl.tail());
+ }
+
+ /*! \brief Prints out horizontally a singleton of box
+ *
+ * \param s A stream
+ * \param pos The current horizontal position
+ * \param bl The list to print out
+ * \returns The horizontal position achieved
+ */
+ template <typename Stream, unsigned VS, unsigned HS, unsigned IS,
+ typename Head>
+ unsigned box_to_text(Stream& s, unsigned pos, const HBox&,
+ const SpaceConf<VS, HS, IS>&,
+ const BoxListCons<Head, BoxListEnd>& bl) {
+ return box_to_text(s, pos, bl.head());
+ }
+
+
+ /*! \brief Prints out horizontally an empty list of boxes
+ *
+ * \param s A stream
+ * \param pos The current horizontal position
+ * \returns The horizontal position achieved
+ */
+ template <typename Stream, unsigned VS, unsigned HS, unsigned IS>
+ unsigned box_to_text(Stream&, unsigned pos, const HBox&,
+ const SpaceConf<VS, HS, IS>&,
+ const BoxListEnd&) {
+ return pos;
+ }
+
+ /*! \brief Prints out a StringBox
+ *
+ * \param s A stream
+ * \param pos The current horizontal position
+ * \param str The StringBox to print out
+ * \returns The horizontal position achieved
+ */
+ template <typename Stream>
+ unsigned box_to_text(Stream& s, unsigned pos, const StringBox& str) {
+ s << std::string(str);
+ return pos + std::string(str).size();
+ }
+
+ /*! \brief Prints out a vertical box
+ *
+ * \param s A stream
+ * \param pos The current horizontal postion
+ * \param b The box to print out
+ * \returns The horizontal position achieved
+ */
+ template <typename Stream, unsigned VS, unsigned HS, unsigned IS,
+ typename Head, typename Tail>
+ unsigned box_to_text(Stream& s, unsigned pos,
+ const ContainerBox<VBox, VS, HS, IS,
+ BoxListCons<Head, Tail> >& b) {
+ box_to_text(s, pos, b->head());
+ for (unsigned i = 0; i < (VS + 1); ++i)
+ s << std::endl;
+ pos+=IS;
+ for (unsigned i = 0; i < pos; ++i)
+ s << " ";
+ return box_to_text(s, pos, VBox(), (Vs<VS>(), Is<IS>()), b->tail());
+ }
+
+ /*! \brief Prints out an empty vertical box
+ *
+ * \param s A stream
+ * \param pos The current horizontal position
+ * \returns The horizontal position achieved
+ */
+ template <typename Stream, unsigned VS, unsigned HS, unsigned IS>
+ unsigned box_to_text(Stream& s, unsigned pos,
+ const ContainerBox<VBox, VS, HS, IS, BoxListEnd>&) {
+ return pos;
+ }
+
+ /*! \brief Prints out a horizontal box
+ *
+ * \param s A stream
+ * \param pos The current horizontal postion
+ * \param b The box to print out
+ * \returns The horizontal position achieved
+ */
+ template <typename Stream, unsigned VS, unsigned HS, unsigned IS,
+ typename Head, typename Tail>
+ unsigned box_to_text(Stream& s, unsigned pos,
+ const ContainerBox<HBox, VS, HS, IS,
+ BoxListCons<Head, Tail> >& b) {
+ return box_to_text(s, pos, HBox(), (Hs<HS>()), *b);
+ }
+
+ /*! \brief Prints out an empty horizontal box
+ *
+ * \param s A stream
+ * \param pos The current horizontal postion
+ * \returns The horizontal position achieved
+ */
+ template <typename Stream, unsigned VS, unsigned HS, unsigned IS>
+ unsigned box_to_text(Stream& s, unsigned pos,
+ const ContainerBox<HBox, VS, HS, IS, BoxListEnd>&) {
+ return pos;
+ }
+
+ /*! \brief Prints out a pretty-print box
+ *
+ * \param s A stream
+ * \param b The box to print out
+ * \returns The stream
+ */
+ template <typename Stream, typename ExactBox>
+ Stream& operator<<(Stream& s, const Box<ExactBox>& b) {
+ box_to_text(s, 0U, ExactBox(b));
+ return s;
+ }
+
+}
+
+#endif
Property changes on: trunk/src/box/tests
___________________________________________________________________
Added: svn:ignore
+ Makefile
.deps
box_test
Makefile.in
Added: trunk/src/box/tests/Makefile.am
===================================================================
--- trunk/src/box/tests/Makefile.am (rev 0)
+++ trunk/src/box/tests/Makefile.am 2010-07-05 16:32:07 UTC (rev 99)
@@ -0,0 +1,27 @@
+# This file is a part of Aurelia.
+# Copyright (C) 2010 Valentin David
+# Copyright (C) 2010 University of Bergen
+#
+# 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/>.
+
+AM_CPPFLAGS= \
+ -I$(top_srcdir)/src \
+ -I$(top_builddir)/src \
+ $(EXTRACPPFLAGS)
+
+check_PROGRAMS=box_test
+
+box_test_SOURCES=box_test.cc
+
+TESTS=box_test
Added: trunk/src/box/tests/box_test.cc
===================================================================
--- trunk/src/box/tests/box_test.cc (rev 0)
+++ trunk/src/box/tests/box_test.cc 2010-07-05 16:32:07 UTC (rev 99)
@@ -0,0 +1,64 @@
+// This file is a part of Aurelia.
+// Copyright (C) 2010 Valentin David
+// Copyright (C) 2010 University of Bergen
+//
+// 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/>.
+
+#include <sstream>
+#include <box/box.hh>
+
+using namespace aurelia;
+
+template <typename A>
+bool test(unsigned num, const A& a, const std::string& b) {
+ std::stringstream ss;
+
+ ss << a;
+ if (ss.str() == b)
+ return true;
+ std::cerr << "Error on test " << num << std::endl;
+ std::cerr << "Expected: " << std::endl << b << std::endl;
+ std::cerr << "Got: " << std::endl << ss.str() << std::endl;
+ return false;
+}
+
+int main() {
+ int error = 0;
+
+ if (!test(1, H()[S("foo"), S("bar")], "foo bar"))
+ error = 1;
+
+ if (!test(2, H()[S("bar")], "bar"))
+ error = 1;
+
+ if (!test(3, H(Hs<2>())[S("foo"), S("bar")], "foo bar"))
+ error = 1;
+
+ if (!test(4, V((Vs<1>(), Is<2>()))[S("foo"), S("bar")], "foo\n\n bar"))
+ error = 1;
+
+ if (!test(5, V((Vs<1>(), Is<2>()))[S("foo"), S("bar"), S("boom"), S("baz")],
+ "foo\n\n bar\n\n boom\n\n baz"))
+ error = 1;
+
+ if (!test(6, V(Is<2>())[H(Hs<1>())[S("a"), S("b"), V()[S("c"), S("d")]],
+ S("e")],
+ "a b c\n d\n e"))
+ error = 1;
+
+ if (!test(7, H(Hs<0>())[S("a"), S("b")], "ab"))
+ error = 1;
+
+ return error;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-05 12:11:52
|
Revision: 98
http://aurelia.svn.sourceforge.net/aurelia/?rev=98&view=rev
Author: valentindavid
Date: 2010-07-05 12:11:43 +0000 (Mon, 05 Jul 2010)
Log Message:
-----------
2010-07-05 Valentin David <val...@ii...>
* src/parser_generator/Syntax.def:
Fix an ambiguity with layout.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/parser_generator/Syntax.def
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-05 11:59:47 UTC (rev 97)
+++ trunk/ChangeLog 2010-07-05 12:11:43 UTC (rev 98)
@@ -1,5 +1,10 @@
2010-07-05 Valentin David <val...@ii...>
+ * src/parser_generator/Syntax.def:
+ Fix an ambiguity with layout.
+
+2010-07-05 Valentin David <val...@ii...>
+
* src/parser_generator/parser_gen.cc:
Remove uses of reset.
Modified: trunk/src/parser_generator/Syntax.def
===================================================================
--- trunk/src/parser_generator/Syntax.def 2010-07-05 11:59:47 UTC (rev 97)
+++ trunk/src/parser_generator/Syntax.def 2010-07-05 12:11:43 UTC (rev 98)
@@ -66,8 +66,10 @@
AttrChainElt* AttrRule? -> Chain {cons("Chain")}
- LocalParameters? "$" CxxCode "$" -> AttrRule {cons("AttrRule")}
+syntax
+ <LocalParameters?-CF> <LAYOUT?-CF> "$" <CxxCode-LEX> "$" -> <AttrRule-CF> {cons("AttrRule")}
+context-free syntax
"{" Parameters "}" -> LocalParameters {cons("LocalParameters")}
AttrRule? ChainElt -> AttrChainElt {cons("AttrChainElt")}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-05 11:59:53
|
Revision: 97
http://aurelia.svn.sourceforge.net/aurelia/?rev=97&view=rev
Author: valentindavid
Date: 2010-07-05 11:59:47 +0000 (Mon, 05 Jul 2010)
Log Message:
-----------
2010-07-05 Valentin David <val...@ii...>
* src/parser_generator/parser_gen.cc:
Remove uses of reset.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/parser_generator/parser_gen.cc
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-01 18:06:34 UTC (rev 96)
+++ trunk/ChangeLog 2010-07-05 11:59:47 UTC (rev 97)
@@ -1,3 +1,8 @@
+2010-07-05 Valentin David <val...@ii...>
+
+ * src/parser_generator/parser_gen.cc:
+ Remove uses of reset.
+
2010-07-01 Valentin David <val...@ii...>
Merge from GLL branch.
Modified: trunk/src/parser_generator/parser_gen.cc
===================================================================
--- trunk/src/parser_generator/parser_gen.cc 2010-07-01 18:06:34 UTC (rev 96)
+++ trunk/src/parser_generator/parser_gen.cc 2010-07-05 11:59:47 UTC (rev 97)
@@ -29,7 +29,6 @@
#include "strategies/lists/map.hh"
#include "strategies/generic/where.hh"
#include "strategies/patterns/scope.hh"
-#include "strategies/patterns/reset.hh"
#include "strategies/generic/side_effect_strategy.hh"
#include "strategies/strings/undouble_quote.hh"
#include "strategies/lists/map_some.hh"
@@ -409,7 +408,11 @@
static C Chain("Chain", 2);
V chain, attr;
- map_one(reset(chain) < reset(attr) < ~Chain[chain, attr] < !chain < is_empty(&set))(*l);
+ map_one(scope(chain,
+ scope(attr,
+ ~Chain[chain, attr]
+ < !chain
+ < is_empty(&set))))(*l);
set[*nt] = true;
return in;
} catch (Failure) {
@@ -517,9 +520,11 @@
Rule[nt, NoParam, Void, l] = in;
char_set_t c;
- map(try_(reset(attr) < reset(chain)
- < ~Chain[chain, attr] <
- !chain < map_one(set_first(build_empty, &set, c))))(*l);
+ map(try_(scope(attr,
+ scope(chain,
+ ~Chain[chain, attr]
+ < !chain
+ < map_one(set_first(build_empty, &set, c))))))(*l);
if (c == set[*nt])
throw Failure();
@@ -581,7 +586,10 @@
V s, attr;
AttrChainElt[attr,String[s]] = t;
- cset[(get_cons_name < undouble_quote < undouble_quote < unescape)(*s)[0]] = true;
+ cset[(get_cons_name
+ < undouble_quote
+ < undouble_quote
+ < unescape)(*s)[0]] = true;
return t;
}
catch (Failure) {
@@ -703,7 +711,6 @@
< !next < firstof
< [this, &sym, &changed]
(std::bitset<256> t) {
- std::cerr << "First for " << *sym << " was " << set_to_class(t) << std::endl;
t |= set[*sym];
if (t != set[*sym]) {
changed = true;
@@ -723,7 +730,7 @@
static C Chain("Chain", 2);
V chain, attr;
- map(reset(chain) < reset(attr) < ~Chain[chain, attr] < !chain < f)(*l);
+ map(scope(chain, scope(attr, ~Chain[chain, attr] < !chain < f)))(*l);
if (changed)
return in;
@@ -835,12 +842,12 @@
V attr, chain;
- map(reset(attr) < reset(chain) < ~Chain[chain, attr] < !chain <
+ map(scope(attr, scope(chain, ~Chain[chain, attr] < !chain <
where(firstof < [&nonll, &hastestfor](const std::bitset<256>& bs) {
nonll |= hastestfor & bs;
hastestfor |= bs;
return bs;
- }))(*l);
+ }))))(*l);
std::cout << " static const unsigned char nonll[] = {";
print_bin(std::cout, nonll);
std::cout << "};" << std::endl;
@@ -913,7 +920,10 @@
std::bitset<256> p;
V s, attr;
AttrChainElt[attr,String[s]] = head;
- p[(get_cons_name < undouble_quote < undouble_quote < unescape)(*s)[0]] = true;
+ p[(get_cons_name
+ < undouble_quote
+ < undouble_quote
+ < unescape)(*s)[0]] = true;
last.push_back(p);
} catch (Failure) {
static C Class("Class", 1);
@@ -981,7 +991,21 @@
std::cout << "/*" << *nt << "*/" << std::endl;
int i = 0;
- map(reset(chain) < reset(attr) < ~Chain[chain, attr] < !chain < [&i](const T& t) { std::cout << "/*" << i++ << "*/" << std::endl; return t; } < print_first_r(build_first, build_empty) < [](const T& t){ std::cout << " {"; print_bin(std::cout, std::bitset<256>()); std::cout << "}," << std::endl; return t; })(*l);
+ map(scope(chain,
+ scope(attr,
+ ~Chain[chain, attr]
+ < !chain <
+ [&i](const T& t) {
+ std::cout << "/*" << i++ << "*/" << std::endl;
+ return t;
+ }
+ < print_first_r(build_first, build_empty)
+ < [](const T& t){
+ std::cout << " {";
+ print_bin(std::cout, std::bitset<256>());
+ std::cout << "}," << std::endl;
+ return t;
+ })))(*l);
return t;
}
};
@@ -1058,8 +1082,8 @@
Rule[nt, NoParam, Void, l] = t;
- map(reset(chain) < reset(attr) < ~Chain[chain, attr] < !chain <
- get_bin_empty_r(build_empty, &data))(*l);
+ map(scope(chain, scope(attr, ~Chain[chain, attr] < !chain <
+ get_bin_empty_r(build_empty, &data))))(*l);
return t;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-01 18:06:40
|
Revision: 96
http://aurelia.svn.sourceforge.net/aurelia/?rev=96&view=rev
Author: valentindavid
Date: 2010-07-01 18:06:34 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
2010-07-01 Valentin David <val...@ii...>
Merge from GLL branch.
* src/parser_generator/syntax.csf:
Add a lexical filter. Refactor the grammar to replace
the attribute code at the right place.
* src/parser_generator/Syntax.def: Sync with syntax.csf.
* src/parser_generator/parser_gen.cc:
Partially fix traversal to correspond with new grammar.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/parser_generator/Syntax.def
trunk/src/parser_generator/parser_gen.cc
trunk/src/parser_generator/syntax.csf
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-01 17:40:14 UTC (rev 95)
+++ trunk/ChangeLog 2010-07-01 18:06:34 UTC (rev 96)
@@ -1,5 +1,18 @@
2010-07-01 Valentin David <val...@ii...>
+ Merge from GLL branch.
+
+ * src/parser_generator/syntax.csf:
+ Add a lexical filter. Refactor the grammar to replace
+ the attribute code at the right place.
+
+ * src/parser_generator/Syntax.def: Sync with syntax.csf.
+
+ * src/parser_generator/parser_gen.cc:
+ Partially fix traversal to correspond with new grammar.
+
+2010-07-01 Valentin David <val...@ii...>
+
* doc/stylesheet.css: Set style as BLDL pages.
* doc/doxygen.png: New.
Modified: trunk/src/parser_generator/Syntax.def
===================================================================
--- trunk/src/parser_generator/Syntax.def 2010-07-01 17:40:14 UTC (rev 95)
+++ trunk/src/parser_generator/Syntax.def 2010-07-01 18:06:34 UTC (rev 96)
@@ -26,7 +26,7 @@
StringChar ListOfChains Rule Chain ChainElt AttrRule Range RangeOrChars
ClassChar SymbolChar Symbol String ParameterList RetType CxxCode
Arguments ArgumentList CxxExpression CxxIdentifier CxxChar Parameter
- TemplateArguments Parameters Syntax
+ TemplateArguments Parameters Syntax LocalParameters AttrChainElt
lexical syntax
[\ \n\r\t] -> LAYOUT
"//" Line -> LAYOUT
@@ -64,13 +64,16 @@
":" CxxType -> RetType {cons("RetType")}
-> RetType {cons("Void")}
- ChainElt* -> Chain
+ AttrChainElt* AttrRule? -> Chain {cons("Chain")}
- "{" Parameters "}" "$" CxxCode "$" -> AttrRule {cons("AttrRule")}
+ LocalParameters? "$" CxxCode "$" -> AttrRule {cons("AttrRule")}
+ "{" Parameters "}" -> LocalParameters {cons("LocalParameters")}
+
+ AttrRule? ChainElt -> AttrChainElt {cons("AttrChainElt")}
String -> ChainElt {cons("String")}
ClassChar -> ChainElt {cons("Class")}
- Symbol ArgumentList AttrRule? -> ChainElt {cons("Symbol")}
+ Symbol ArgumentList -> ChainElt {cons("Symbol")}
"(" Arguments ")" -> ArgumentList {cons("Args")}
-> ArgumentList {cons("NoArg")}
Modified: trunk/src/parser_generator/parser_gen.cc
===================================================================
--- trunk/src/parser_generator/parser_gen.cc 2010-07-01 17:40:14 UTC (rev 95)
+++ trunk/src/parser_generator/parser_gen.cc 2010-07-01 18:06:34 UTC (rev 96)
@@ -29,6 +29,7 @@
#include "strategies/lists/map.hh"
#include "strategies/generic/where.hh"
#include "strategies/patterns/scope.hh"
+#include "strategies/patterns/reset.hh"
#include "strategies/generic/side_effect_strategy.hh"
#include "strategies/strings/undouble_quote.hh"
#include "strategies/lists/map_some.hh"
@@ -231,15 +232,15 @@
std::string nt_name;
gen_label(int index, const std::string& n): index(index), nt_name(n) {}
T operator()(const T& t, int index_l) const {
- static C Symbol("Symbol", 3);
+ static C Symbol("Symbol", 2);
+ static C AttrChainElt("AttrChainElt", 2);
static C String("String", 1);
static C Class("Class", 1);
static V NoArg = T(C("NoArg"));
- static V None = T(C("None"));
try {
- V sym;
- Symbol[sym, NoArg, None] = t;
+ V sym, attr;
+ AttrChainElt[attr, Symbol[sym, NoArg]] = t;
std::string toparse = to_cxx_id(*sym);
std::cout << "template <>" << std::endl;
std::cout << "struct branch<" << nt_name
@@ -259,8 +260,8 @@
} catch (Failure) {
try {
- V s;
- String[s] = t;
+ V s, attr;
+ AttrChainElt[attr, String[s]] = t;
int i = fresh();
std::cout << "struct str_"<<i<<" {" <<std::endl;
std::cout << " static const char* str;" << std::endl;
@@ -288,8 +289,8 @@
std::cout << "};" << std::endl;
} catch (Failure) {
- V s;
- Class[s] = t;
+ V s, attr;
+ AttrChainElt[attr,Class[s]] = t;
int num = fresh();
std::string c = (get_cons_name < undouble_quote)(*s);
std::bitset<256> chars = class_to_set(c);
@@ -326,8 +327,11 @@
gen_branch(const std::string& n): nt_name(n) {}
T operator()(const T& t, int index) const {
- map_index(gen_label(index, nt_name))(t);
- int s = size(t);
+ static C Chain("Chain", 2);
+ V chain, attr;
+ Chain[chain, attr] = t;
+ map_index(gen_label(index, nt_name))(*chain);
+ int s = size(*chain);
std::cout << "template <>" << std::endl;
std::cout << "struct branch<" << nt_name << ","
<< index << "," << s << "> {" << std::endl;
@@ -344,12 +348,12 @@
empty_sym(const map_t *map): map(map) {}
empty_sym(const empty_sym& other): map(other.map) {}
T operator()(const T& in) const {
- static C Symbol("Symbol", 3);
+ static C Symbol("Symbol", 2);
static V NoArg = T(C("NoArg"));
- static V None = T(C("None"));
+ static C AttrChainElt("AttrChainElt", 2);
- V sym;
- Symbol[sym, NoArg, None] = in;
+ V sym, attr;
+ AttrChainElt[attr,Symbol[sym, NoArg]] = in;
map_t::const_iterator i = map->find(*sym);
if (i != map->end()) {
if ((*i).second)
@@ -402,7 +406,10 @@
if (set[*nt])
throw Failure();
try {
- map_one(is_empty(&set))(*l);
+ static C Chain("Chain", 2);
+ V chain, attr;
+
+ map_one(reset(chain) < reset(attr) < ~Chain[chain, attr] < !chain < is_empty(&set))(*l);
set[*nt] = true;
return in;
} catch (Failure) {
@@ -435,13 +442,13 @@
: set(set), cset(cset), build_empty(build_empty) {
}
T operator()(const T& t) const {
+ static C AttrChainElt("AttrChainElt", 2);
try {
- static C Symbol("Symbol", 3);
+ static C Symbol("Symbol", 2);
static V NoArg = T(C("NoArg"));
- static V None = T(C("None"));
- V sym;
- Symbol[sym, NoArg, None] = t;
+ V sym, attr;
+ AttrChainElt[attr, Symbol[sym, NoArg]] = t;
cset |= (*set)[*sym];
// if *sym is nullable, we have to look at the next symbol or literal
// in the rule.
@@ -453,8 +460,8 @@
try {
static C String("String", 1);
- V s;
- String[s] = t;
+ V s, attr;
+ AttrChainElt[attr,String[s]] = t;
cset[(unsigned char)(get_cons_name < undouble_quote < undouble_quote < unescape)(*s)[0]] = true;
std::cerr << "after set: " << (unsigned char)(get_cons_name < undouble_quote < undouble_quote < unescape)(*s)[0] << " " << cset << std::endl;
print_bin(std::cerr, cset);
@@ -464,8 +471,8 @@
}
static C Class("Class", 1);
- V s;
- Class[s] = t;
+ V s, attr;
+ AttrChainElt[attr,Class[s]] = t;
cset |= class_to_set((get_cons_name < undouble_quote)(*s));
return t;
@@ -504,12 +511,15 @@
static C Rule("Rule", 4);
static V NoParam = T(C("NoParam"));
static V Void = T(C("Void"));
+ static C Chain("Chain", 2);
- V l, nt;
+ V l, nt, attr, chain;
Rule[nt, NoParam, Void, l] = in;
char_set_t c;
- map(try_(map_one(set_first(build_empty, &set, c))))(*l);
+ map(try_(reset(attr) < reset(chain)
+ < ~Chain[chain, attr] <
+ !chain < map_one(set_first(build_empty, &set, c))))(*l);
if (c == set[*nt])
throw Failure();
@@ -551,13 +561,13 @@
build_first(build_first) {
}
T operator()(const T& t) const {
+ static C AttrChainElt("AttrChainElt", 2);
try {
- static C Symbol("Symbol", 3);
+ static C Symbol("Symbol", 2);
static V NoArg = T(C("NoArg"));
- static V None = T(C("None"));
- V sym;
- Symbol[sym, NoArg, None] = t;
+ V sym, attr;
+ AttrChainElt[attr, Symbol[sym, NoArg]] = t;
cset |= (*set)[*sym];
// if *sym is nullable, we have to look at the next symbol or literal
// in the rule.
@@ -569,8 +579,8 @@
try {
static C String("String", 1);
- V s;
- String[s] = t;
+ V s, attr;
+ AttrChainElt[attr,String[s]] = t;
cset[(get_cons_name < undouble_quote < undouble_quote < unescape)(*s)[0]] = true;
return t;
}
@@ -579,8 +589,8 @@
static C Class("Class", 1);
- V s;
- Class[s] = t;
+ V s, attr;
+ AttrChainElt[attr,Class[s]] = t;
cset |= class_to_set((get_cons_name < undouble_quote)(*s));
return t;
@@ -635,22 +645,21 @@
std::function<T(const T&)> f = [this, &f, &nt, &changed]
(const T& t) {
- V sym;
-
static V Tail = T(C::AS_EMPTY_LIST);
static V NoArg = T(C("NoArg"));
- static V None = T(C("None"));
- static C Symbol = C("Symbol", 3);
+ static C Symbol = C("Symbol", 2);
+ static C AttrChainElt("AttrChainElt", 2);
std::function<std::bitset<256>(const T&)> firstof =
[this, &firstof, &nt] (const T& in) {
- V sym, next, s;
+ V sym, next, s, attr;
static C Class("Class", 1);
static C String("String", 1);
+ static C AttrChainElt("AttrChainElt", 2);
return ( (~Tail
< [this, &nt](const T&) { return set[*nt]; })
- + (~Cons[Symbol[sym, NoArg, None], next]
+ + (~Cons[AttrChainElt[attr,Symbol[sym, NoArg]], next]
< !sym
< [this, &next, &firstof](const T& t) {
std::bitset<256> s;
@@ -663,14 +672,14 @@
<< std::endl;
return (*build_first)[t] | s;
})
- + (~Cons[Class[s], next]
+ + (~Cons[AttrChainElt[attr,Class[s]], next]
< !s
< get_cons_name
< undouble_quote
< [] (const std::string& in) {
return class_to_set(in);
})
- + (~Cons[String[s], next]
+ + (~Cons[AttrChainElt[attr,String[s]], next]
< !s
< get_cons_name
< undouble_quote
@@ -686,36 +695,36 @@
)(in);
};
- V next;
+ V sym, next, attr, h;
return (~Tail +
- (scope(sym,
- scope(next,
- (where(~Cons[Symbol[sym, NoArg, None], next]
- < !next < firstof
- < [this, &sym, &changed]
- (std::bitset<256> t) {
- t |= set[*sym];
- if (t != set[*sym]) {
- changed = true;
- set[*sym] = t;
- }
- std::cerr << "Setting: "
- << set_to_class(set[*sym])
- << " to " << *sym
- << std::endl;
- return t;
- })
- + ~Cons[sym, next])
- < !next < f
- )
- )
- )
+ ( (where(~Cons[AttrChainElt[attr,Symbol[sym, NoArg]],
+ next]
+ < !next < firstof
+ < [this, &sym, &changed]
+ (std::bitset<256> t) {
+ std::cerr << "First for " << *sym << " was " << set_to_class(t) << std::endl;
+ t |= set[*sym];
+ if (t != set[*sym]) {
+ changed = true;
+ set[*sym] = t;
+ std::cerr << "Setting: "
+ << set_to_class(set[*sym])
+ << " to " << *sym
+ << std::endl;
+ }
+ return t;
+ })
+ + ~Cons[h, next])
+ < !next < f)
)(t);
};
- map(f)(*l);
+ static C Chain("Chain", 2);
+ V chain, attr;
+ map(reset(chain) < reset(attr) < ~Chain[chain, attr] < !chain < f)(*l);
+
if (changed)
return in;
throw Failure();
@@ -758,6 +767,7 @@
{}
T operator()(const T& in) const {
+ static C Chain("Chain", 2);
static C Rule("Rule", 4);
static V NoParam = T(C("NoParam"));
static V Void = T(C("Void"));
@@ -777,18 +787,18 @@
std::function<std::bitset<256>(const T&)> firstof =
[this, &firstof] (const T& in) {
- V sym, next, s;
+ V sym, next, s, attr;
static V Tail = T(C::AS_EMPTY_LIST);
static C Cons = C::AS_LIST;
static C Class("Class", 1);
- static C Symbol("Symbol", 3);
+ static C Symbol("Symbol", 2);
static C String("String", 1);
static V NoArg = T(C("NoArg"));
- static V None = T(C("None"));
+ static C AttrChainElt("AttrChainElt", 2);
return ( (~Tail
< [this](const T&) { return std::bitset<256>(); })
- + (~Cons[Symbol[sym, NoArg, None], next]
+ + (~Cons[AttrChainElt[attr,Symbol[sym, NoArg]], next]
< !sym
< [this, &next, &firstof](const T& t) {
std::bitset<256> s;
@@ -797,14 +807,14 @@
}
return (*build_first)[t] | s;
})
- + (~Cons[Class[s], next]
+ + (~Cons[AttrChainElt[attr,Class[s]], next]
< !s
< get_cons_name
< undouble_quote
< [] (const std::string& in) {
return class_to_set(in);
})
- + (~Cons[String[s], next]
+ + (~Cons[AttrChainElt[attr,String[s]], next]
< !s
< get_cons_name
< undouble_quote
@@ -823,7 +833,10 @@
std::bitset<256> nonll = ((*build_first)[*nt]) & ((*build_follow)[*nt]);
std::bitset<256> hastestfor;
- map(where(firstof < [&nonll, &hastestfor](const std::bitset<256>& bs) {
+ V attr, chain;
+
+ map(reset(attr) < reset(chain) < ~Chain[chain, attr] < !chain <
+ where(firstof < [&nonll, &hastestfor](const std::bitset<256>& bs) {
nonll |= hastestfor & bs;
hastestfor |= bs;
return bs;
@@ -883,14 +896,14 @@
bool apply = true;
T head = list[0];
list = list[1];
+ static C AttrChainElt("AttrChainElt", 2);
try {
- static C Symbol("Symbol", 3);
+ static C Symbol("Symbol", 2);
static V NoArg = T(C("NoArg"));
- static V None = T(C("None"));
- V sym;
+ V sym, attr;
- Symbol[sym, NoArg, None] = head;
+ AttrChainElt[attr,Symbol[sym, NoArg]] = head;
apply = !((*build_empty)[*sym]);
last.push_back((*build_first)[*sym]);
} catch(Failure) {
@@ -898,15 +911,15 @@
static C String("String", 1);
std::bitset<256> p;
- V s;
- String[s] = head;
+ V s, attr;
+ AttrChainElt[attr,String[s]] = head;
p[(get_cons_name < undouble_quote < undouble_quote < unescape)(*s)[0]] = true;
last.push_back(p);
} catch (Failure) {
static C Class("Class", 1);
- V s;
- Class[s] = head;
+ V s, attr;
+ AttrChainElt[attr,Class[s]] = head;
last.push_back(class_to_set((get_cons_name < undouble_quote)(*s)));
}
}
@@ -959,15 +972,16 @@
T operator()(const T& t) const {
static C Rule("Rule", 4);
+ static C Chain("Chain", 2);
static V NoParam = T(C("NoParam"));
static V Void = T(C("Void"));
- V l, nt;
+ V l, nt, chain, attr;
Rule[nt, NoParam, Void, l] = t;
std::cout << "/*" << *nt << "*/" << std::endl;
- int i;
- map([&i](const T& t) { std::cout << "/*" << i++ << "*/" << std::endl; return t; } < print_first_r(build_first, build_empty) < [](const T& t){ std::cout << " {"; print_bin(std::cout, std::bitset<256>()); std::cout << "}," << std::endl; return t; })(*l);
+ int i = 0;
+ map(reset(chain) < reset(attr) < ~Chain[chain, attr] < !chain < [&i](const T& t) { std::cout << "/*" << i++ << "*/" << std::endl; return t; } < print_first_r(build_first, build_empty) < [](const T& t){ std::cout << " {"; print_bin(std::cout, std::bitset<256>()); std::cout << "}," << std::endl; return t; })(*l);
return t;
}
};
@@ -991,12 +1005,12 @@
T head = list[0];
list = list[1];
try {
- static C Symbol("Symbol", 3);
+ static C Symbol("Symbol", 2);
static V NoArg = T(C("NoArg"));
- static V None = T(C("None"));
+ static C AttrChainElt("AttrChainElt", 2);
- V sym;
- Symbol[sym, NoArg, None] = head;
+ V sym, attr;
+ AttrChainElt[attr, Symbol[sym, NoArg]] = head;
std::cerr << *sym << " empty? " << (*build_empty)[*sym] << std::endl;
last.push_back((*build_empty)[*sym]);
} catch(Failure) {
@@ -1036,14 +1050,16 @@
T operator()(const T& t) {
static C Rule("Rule", 4);
+ static C Chain("Chain", 2);
static V NoParam = T(C("NoParam"));
static V Void = T(C("Void"));
- V l, nt;
+ V l, nt, chain, attr;
Rule[nt, NoParam, Void, l] = t;
- map(get_bin_empty_r(build_empty, &data))(*l);
+ map(reset(chain) < reset(attr) < ~Chain[chain, attr] < !chain <
+ get_bin_empty_r(build_empty, &data))(*l);
return t;
}
@@ -1062,6 +1078,7 @@
T operator()(const T& t) {
static C Rule("Rule", 4);
+ static C Chain("Chain", 2);
static V NoParam = T(C("NoParam"));
static V Void = T(C("Void"));
V l, nt;
@@ -1071,7 +1088,9 @@
int rule = 0;
for (T rt = *l; rt.constructor() == C::AS_LIST; rt = rt[1], ++rule) {
int label = 0;
- for (T t = rt[0]; t.constructor() == C::AS_LIST; t = t[1], ++label) {
+ V chain, attr;
+ Chain[chain, attr] = rt[0];
+ for (T t = *chain; t.constructor() == C::AS_LIST; t = t[1], ++label) {
std::cout << " " << to_cxx_id(*nt) << "_" << rule
<< "_" << label << "," << std::endl;
++total;
Modified: trunk/src/parser_generator/syntax.csf
===================================================================
--- trunk/src/parser_generator/syntax.csf 2010-07-01 17:40:14 UTC (rev 95)
+++ trunk/src/parser_generator/syntax.csf 2010-07-01 18:06:34 UTC (rev 96)
@@ -1,4 +1,40 @@
- LAYOUT? ::= LAYOUT+ |
+ LAYOUT? ::= LAYOUT+
+ $ if (!s.eof()) {
+ switch (*s) {
+ case ' ':
+ case '\r':
+ case '\n':
+ case '\t':
+ return ;
+ case '/';
+ buf_stream_iterator next = s;
+ ++next;
+ if (!next.eof()) {
+ if (*next == '/')
+ return ;
+ }
+ default:
+ }
+ }
+ $ |
+ $ if (!s.eof()) {
+ switch (*s) {
+ case ' ':
+ case '\r':
+ case '\n':
+ case '\t':
+ return ;
+ case '/';
+ buf_stream_iterator next = s;
+ ++next;
+ if (!next.eof()) {
+ if (*next == '/')
+ return ;
+ }
+ default:
+ }
+ }
+ $
LAYOUT+ ::= LAYOUT LAYOUT?
LAYOUT ::=
@@ -32,8 +68,9 @@
SSS ::= SS |
ParameterList ::= "(" LAYOUT? Parameters LAYOUT? ")" |
+ LocalParameters ::= "{" LAYOUT? Parameters LAYOUT? "}" |
- ListOfChains ::= Chain LAYOUT? ListOfChainsTail
+ ListOfChains ::= Chain LAYOUT? AttrRule? LAYOUT? ListOfChainsTail
ListOfChainsTail ::= "|" LAYOUT? ListOfChains |
RetType ::= ":" LAYOUT? CxxType |
@@ -42,14 +79,14 @@
NonEmptyChain |
NonEmptyChain ::=
- ChainElt LAYOUT? Chain
+ AttrRule? LAYOUT? ChainElt LAYOUT? Chain
AttrRule ::=
- "{" LAYOUT? Parameters LAYOUT? "}" LAYOUT? "$" CxxCode "$"
+ LocalParameters LAYOUT? "$" CxxCode "$"
ChainElt ::=
String | ClassChar
- | Symbol LAYOUT? ArgumentList LAYOUT? AttrRule?
+ | Symbol LAYOUT? ArgumentList
ArgumentList ::= "(" LAYOUT? Arguments LAYOUT? ")" |
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-01 17:40:20
|
Revision: 95
http://aurelia.svn.sourceforge.net/aurelia/?rev=95&view=rev
Author: valentindavid
Date: 2010-07-01 17:40:14 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
2010-07-01 Valentin David <val...@ii...>
* src/parser_generator/parser_gen.cc:
Fix.
Modified Paths:
--------------
branches/gll/ChangeLog.branch
branches/gll/src/parser_generator/parser_gen.cc
Modified: branches/gll/ChangeLog.branch
===================================================================
--- branches/gll/ChangeLog.branch 2010-07-01 15:52:14 UTC (rev 94)
+++ branches/gll/ChangeLog.branch 2010-07-01 17:40:14 UTC (rev 95)
@@ -1,3 +1,8 @@
+2010-07-01 Valentin David <val...@ii...>
+
+ * src/parser_generator/parser_gen.cc:
+ Fix.
+
2010-06-24 Valentin David <val...@ii...>
* src/parser_generator/syntax.csf:
Modified: branches/gll/src/parser_generator/parser_gen.cc
===================================================================
--- branches/gll/src/parser_generator/parser_gen.cc 2010-07-01 15:52:14 UTC (rev 94)
+++ branches/gll/src/parser_generator/parser_gen.cc 2010-07-01 17:40:14 UTC (rev 95)
@@ -645,8 +645,6 @@
std::function<T(const T&)> f = [this, &f, &nt, &changed]
(const T& t) {
- V sym;
-
static V Tail = T(C::AS_EMPTY_LIST);
static V NoArg = T(C("NoArg"));
static C Symbol = C("Symbol", 2);
@@ -681,7 +679,7 @@
< [] (const std::string& in) {
return class_to_set(in);
})
- + (~Cons[String[s], next]
+ + (~Cons[AttrChainElt[attr,String[s]], next]
< !s
< get_cons_name
< undouble_quote
@@ -697,32 +695,28 @@
)(in);
};
- V next, attr;
+ V sym, next, attr, h;
return (~Tail +
- (scope(sym,
- scope(next,
- (where(~Cons[AttrChainElt[attr,Symbol[sym, NoArg]],
- next]
- < !next < firstof
- < [this, &sym, &changed]
- (std::bitset<256> t) {
- t |= set[*sym];
- if (t != set[*sym]) {
- changed = true;
- set[*sym] = t;
- }
- std::cerr << "Setting: "
- << set_to_class(set[*sym])
- << " to " << *sym
- << std::endl;
- return t;
- })
- + ~Cons[sym, next])
- < !next < f
- )
- )
- )
+ ( (where(~Cons[AttrChainElt[attr,Symbol[sym, NoArg]],
+ next]
+ < !next < firstof
+ < [this, &sym, &changed]
+ (std::bitset<256> t) {
+ std::cerr << "First for " << *sym << " was " << set_to_class(t) << std::endl;
+ t |= set[*sym];
+ if (t != set[*sym]) {
+ changed = true;
+ set[*sym] = t;
+ std::cerr << "Setting: "
+ << set_to_class(set[*sym])
+ << " to " << *sym
+ << std::endl;
+ }
+ return t;
+ })
+ + ~Cons[h, next])
+ < !next < f)
)(t);
};
@@ -1016,7 +1010,7 @@
static C AttrChainElt("AttrChainElt", 2);
V sym, attr;
- AttrChainElt[Symbol[sym, NoArg]] = head;
+ AttrChainElt[attr, Symbol[sym, NoArg]] = head;
std::cerr << *sym << " empty? " << (*build_empty)[*sym] << std::endl;
last.push_back((*build_empty)[*sym]);
} catch(Failure) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-01 15:52:21
|
Revision: 94
http://aurelia.svn.sourceforge.net/aurelia/?rev=94&view=rev
Author: valentindavid
Date: 2010-07-01 15:52:14 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
2010-07-01 Valentin David <val...@ii...>
* doc/stylesheet.css: Set style as BLDL pages.
* doc/doxygen.png: New.
* doc/footer.html, doc/header.html:
Set doxygen logo as 80x15 in buttons. Set SF.net logo optional.
Add copyright notice.
* doc/Makefile.am: Filter SF.net logo out. Update EXTRA_DIST.
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/Doxyfile.in
trunk/doc/Makefile.am
trunk/doc/footer.html
trunk/doc/header.html
trunk/doc/stylesheet.css
Added Paths:
-----------
trunk/doc/doxygen.png
Property Changed:
----------------
trunk/doc/
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-07-01 15:51:39 UTC (rev 93)
+++ trunk/ChangeLog 2010-07-01 15:52:14 UTC (rev 94)
@@ -1,5 +1,16 @@
2010-07-01 Valentin David <val...@ii...>
+ * doc/stylesheet.css: Set style as BLDL pages.
+
+ * doc/doxygen.png: New.
+ * doc/footer.html, doc/header.html:
+ Set doxygen logo as 80x15 in buttons. Set SF.net logo optional.
+ Add copyright notice.
+
+ * doc/Makefile.am: Filter SF.net logo out. Update EXTRA_DIST.
+
+2010-07-01 Valentin David <val...@ii...>
+
* doc/header.html: Add BLDL logo.
* doc/stylesheet.css: Change presentation of buttons.
Property changes on: trunk/doc
___________________________________________________________________
Modified: svn:ignore
- html
html.stamp
Doxyfile
Makefile.in
Makefile
+ html
html.stamp
Doxyfile
Makefile.in
Makefile
header-exp.html
Modified: trunk/doc/Doxyfile.in
===================================================================
--- trunk/doc/Doxyfile.in 2010-07-01 15:51:39 UTC (rev 93)
+++ trunk/doc/Doxyfile.in 2010-07-01 15:52:14 UTC (rev 94)
@@ -782,13 +782,13 @@
# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
-HTML_HEADER = header.html
+HTML_HEADER = header-exp.html
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
-HTML_FOOTER = footer.html
+HTML_FOOTER = @srcdir@/footer.html
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to
Modified: trunk/doc/Makefile.am
===================================================================
--- trunk/doc/Makefile.am 2010-07-01 15:51:39 UTC (rev 93)
+++ trunk/doc/Makefile.am 2010-07-01 15:52:14 UTC (rev 94)
@@ -17,9 +17,17 @@
if BOOTSTRAP
+header-exp.html: header.html
+ if test x"$(ONLINE)" = xyes; then \
+ cp header.html header-exp.html; \
+ else \
+ sed "/<!--online only begin-->/{;:l;/<!--online only end-->/d;N;bl;}" \
+ header.html >header-exp.html; \
+ fi
+
html: html.stamp
-html.stamp:
+html.stamp: header-exp.html
-rm -rf output.tmp
$(MAKE) $(AM_MAKEFLAGS) Doxyfile
if $(DOXYGEN) Doxyfile; then \
@@ -31,6 +39,7 @@
exit 1; \
fi
cp bldl-mini.png html
+ cp -f doxygen.png html
install-data-local: html
rm -rf $(DESTDIR)$(htmldir)/html
@@ -48,7 +57,7 @@
clean-local:
rm -rf html
-CLEANFILES=html.stamp
+CLEANFILES=html.stamp header-exp.html
else
CLEANFILES=
endif
@@ -67,6 +76,7 @@
pages/strategies.doc \
footer.html \
header.html \
+ header-exp.html \
stylesheet.css \
- bldl-mini.png
-
+ bldl-mini.png \
+ doxygen.png
Added: trunk/doc/doxygen.png
===================================================================
(Binary files differ)
Property changes on: trunk/doc/doxygen.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/doc/footer.html
===================================================================
--- trunk/doc/footer.html 2010-07-01 15:51:39 UTC (rev 93)
+++ trunk/doc/footer.html 2010-07-01 15:52:14 UTC (rev 94)
@@ -1,5 +1,6 @@
</div>
-<hr class="footer"/><address class="footer"><small>
-Generated on $datetime for $projectname by <a href="http://www.doxygen.org/index.html"><img class="footer" src="$relpath$doxygen.png" alt="doxygen"/></a> $doxygenversion</small></address>
+<p class="footer">Copyright © 2010 Valentin David, University of Bergen</p>
+
+<p class="footer">Generated on $datetime by <a href="http://www.doxygen.org/index.html">doxygen</a> $doxygenversion</p>
</body>
</html>
Modified: trunk/doc/header.html
===================================================================
--- trunk/doc/header.html 2010-07-01 15:51:39 UTC (rev 93)
+++ trunk/doc/header.html 2010-07-01 15:52:14 UTC (rev 94)
@@ -15,6 +15,7 @@
</ul>
<div class="buttons">
+<!--online only begin-->
<p>
<a href="http://sourceforge.net/projects/aurelia">
<img src="http://sflogo.sourceforge.net/sflogo.php?group_id=330861&type=8"
@@ -22,12 +23,18 @@
alt="Get Aurelia at SourceForge.net. Fast, secure and Free Open Source software downloads" />
</a>
</p>
+<!--online only end-->
<p>
<a href="http://bldl.ii.uib.no/">
<img src="bldl-mini.png" width="80" height="15"
alt="Bergen Language Design Laboratory" />
</a>
</p>
+<p>
+<a href="http://www.doxygen.org/index.html">
+<img width="80" height="15"
+ src="doxygen.png" alt="Generated by doxygen"/>
+</a>
</div>
</div>
<div class="cont">
Modified: trunk/doc/stylesheet.css
===================================================================
--- trunk/doc/stylesheet.css 2010-07-01 15:51:39 UTC (rev 93)
+++ trunk/doc/stylesheet.css 2010-07-01 15:52:14 UTC (rev 94)
@@ -23,8 +23,8 @@
margin-bottom: 30px;
list-style: none;
font-size: 120%;
- border: 1px solid #C4CFE5;
- background-color: #F9FAFC;
+ border: 1px solid #77af00;
+ background-color: #d9e8b7;
}
.cont {
@@ -35,6 +35,12 @@
margin-bottom: 30px;
}
+p.footer {
+ clear: both;
+ font-size: 70%;
+ text-align: center;
+}
+
/* The standard CSS for doxygen */
body, table, div, p, dl {
@@ -100,8 +106,8 @@
}
div.qindex, div.navtab{
- background-color: #EBEFF6;
- border: 1px solid #A3B4D7;
+ background-color: #d9e8b7;
+ border: 1px solid #77af00;
text-align: center;
margin: 2px;
padding: 2px;
@@ -119,13 +125,13 @@
/* @group Link Styling */
a {
- color: #3D578C;
+ color: #005473;
font-weight: normal;
text-decoration: none;
}
.contents a:visited {
- color: #4665A2;
+ color: #004463;
}
a:hover {
@@ -138,9 +144,9 @@
a.qindexHL {
font-weight: bold;
- background-color: #9CAFD4;
+ background-color: #d9e8b7;
color: #ffffff;
- border: 1px double #869DCA;
+ border: 1px double #77af00;
}
.contents a.qindexHL:visited {
@@ -148,18 +154,15 @@
}
a.el {
- font-weight: bold;
}
a.elRef {
}
a.code {
- color: #4665A2;
}
a.codeRef {
- color: #4665A2;
}
/* @end */
@@ -174,8 +177,8 @@
}
pre.fragment {
- border: 1px solid #C4CFE5;
- background-color: #FBFCFD;
+ border: 1px solid #77af00;
+ background-color: #d9e8b7;
padding: 4px 6px;
margin: 4px 8px 4px 2px;
overflow: auto;
@@ -226,22 +229,22 @@
}
td.indexkey {
- background-color: #EBEFF6;
+ background-color: #d9e8b7;
font-weight: bold;
- border: 1px solid #C4CFE5;
+ border: 1px solid #77af00;
margin: 2px 0px 2px 0;
padding: 2px 10px;
}
td.indexvalue {
- background-color: #EBEFF6;
- border: 1px solid #C4CFE5;
+ background-color: #d9e8b7;
+ border: 1px solid #77af00;
padding: 2px 10px;
margin: 2px 0px;
}
tr.memlist {
- background-color: #EEF1F7;
+ background-color: #d9e8b7;
}
p.formulaDsp {
@@ -249,7 +252,7 @@
}
img.formulaDsp {
-
+
}
img.formulaInl {
@@ -268,7 +271,6 @@
}
hr.footer {
- clear: both;
margin-top: 30px;
}
@@ -312,20 +314,20 @@
color: #008080
}
-span.vhdldigit {
- color: #ff00ff
+span.vhdldigit {
+ color: #ff00ff
}
-span.vhdlchar {
- color: #000000
+span.vhdlchar {
+ color: #000000
}
-span.vhdlkeyword {
- color: #700070
+span.vhdlkeyword {
+ color: #700070
}
-span.vhdllogic {
- color: #ff0000
+span.vhdllogic {
+ color: #ff0000
}
/* @end */
@@ -356,18 +358,18 @@
.dirtab {
padding: 4px;
border-collapse: collapse;
- border: 1px solid #A3B4D7;
+ border: 1px solid #77af00;
}
th.dirtab {
- background: #EBEFF6;
+ background: #d9e8b7;
font-weight: bold;
}
hr {
height: 0px;
border: none;
- border-top: 1px solid #4A6AAA;
+ border-top: 1px solid #77af00;
}
hr.footer {
@@ -384,7 +386,7 @@
.mdescLeft, .mdescRight,
.memItemLeft, .memItemRight,
.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
- background-color: #F9FAFC;
+ background-color: #d9e8b7;
border: none;
margin: 4px;
padding: 1px 0 0 8px;
@@ -396,7 +398,7 @@
}
.memItemLeft, .memItemRight, .memTemplParams {
- border-top: 1px solid #C4CFE5;
+ border-top: 1px solid #77af00;
}
.memItemLeft, .memTemplItemLeft {
@@ -422,8 +424,8 @@
}
.memnav {
- background-color: #EBEFF6;
- border: 1px solid #A3B4D7;
+ background-color: #d9e8b7;
+ border: 1px solid #77af00;
text-align: center;
margin: 2px;
margin-right: 15px;
@@ -442,9 +444,9 @@
}
.memproto {
- border-top: 1px solid #A8B8D9;
- border-left: 1px solid #A8B8D9;
- border-right: 1px solid #A8B8D9;
+ border-top: 1px solid #77af00;
+ border-left: 1px solid #77af00;
+ border-right: 1px solid #77af00;
padding: 6px 0px 6px 0px;
color: #253555;
font-weight: bold;
@@ -457,18 +459,18 @@
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
-webkit-border-top-right-radius: 8px;
-webkit-border-top-left-radius: 8px;
- background-image:url('nav_f.png');
- background-repeat:repeat-x;
- background-color: #E2E8F2;
+ /*background-image:url('nav_f.png');
+ background-repeat:repeat-x;*/
+ background-color: #d9e8b7;
}
.memdoc {
- border-bottom: 1px solid #A8B8D9;
- border-left: 1px solid #A8B8D9;
- border-right: 1px solid #A8B8D9;
+ border-bottom: 1px solid #77af00;
+ border-left: 1px solid #77af00;
+ border-right: 1px solid #77af00;
padding: 2px 5px;
- background-color: #FBFCFD;
+ background-color: #d9e8b7;
border-top-width: 0;
/* firefox specific markup */
-moz-border-radius-bottomleft: 8px;
@@ -596,22 +598,17 @@
margin-top: 8px;
}
-address {
- font-style: normal;
- color: #2A3D61;
-}
-
table.doxtable {
border-collapse:collapse;
}
table.doxtable td, table.doxtable th {
- border: 1px solid #2D4068;
+ border: 1px solid #77af00;
padding: 3px 7px 2px;
}
table.doxtable th {
- background-color: #374F7F;
+ background-color: #d9e8b7;
color: #FFFFFF;
font-size: 110%;
padding-bottom: 4px;
@@ -623,7 +620,7 @@
top: 0px;
left: 10px;
height: 36px;
- background-image: url('tab_b.png');
+ /*background-image: url('tab_b.png');*/
z-index: 101;
overflow: hidden;
font-size: 13px;
@@ -632,12 +629,12 @@
.navpath ul
{
font-size: 11px;
- background-image:url('tab_b.png');
- background-repeat:repeat-x;
+ /*background-image:url('tab_b.png');
+ background-repeat:repeat-x;*/
height:30px;
line-height:30px;
color:#8AA0CC;
- border:solid 1px #C2CDE4;
+ border:solid 1px #77af00;
overflow:hidden;
margin:0px;
padding:0px;
@@ -649,7 +646,7 @@
float:left;
padding-left:10px;
padding-right: 15px;
- background-image:url('bc_s.png');
+ /*background-image:url('bc_s.png');*/
background-repeat:no-repeat;
background-position:right;
color:#364D7C;
@@ -684,15 +681,14 @@
div.header
{
- background-image:url('nav_h.png');
- background-repeat:repeat-x;
- background-color: #F9FAFC;
- margin: 0px;
- border-bottom: 1px solid #C4CFE5;
+ /*background-image:url('nav_h.png');
+ background-repeat:repeat-x;*/
+ background-color: #d9e8b7;
+ margin: 0px;
+ border-bottom: 1px solid #77af00;
}
div.headertitle
{
padding: 5px 5px 5px 10px;
}
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-01 15:51:47
|
Revision: 93
http://aurelia.svn.sourceforge.net/aurelia/?rev=93&view=rev
Author: valentindavid
Date: 2010-07-01 15:51:39 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
Merge last version of trunk to gll branch.
Modified Paths:
--------------
branches/gll/AUTHORS
branches/gll/COPYING
branches/gll/ChangeLog
branches/gll/HACKING
branches/gll/INSTALL
branches/gll/NEWS
branches/gll/README
branches/gll/configure.ac
branches/gll/demos/10-int.cc
branches/gll/demos-from-rascal/03-java.cc
branches/gll/demos-from-rascal/06-reaching-defs.cc
branches/gll/demos-from-stratego/01-constant-folding-rules.cc
branches/gll/doc/Doxyfile.in
branches/gll/doc/Makefile.am
branches/gll/src/aurelia.hh
branches/gll/src/parser_generator/parser_gen.cc
branches/gll/src/patterns/Makefile.am
branches/gll/src/patterns/delayed_constr.hh
branches/gll/src/patterns/pair.hh
branches/gll/src/patterns/pattern.hh
branches/gll/src/sig/sig.cc
branches/gll/src/strategies/Makefile.am
branches/gll/src/strategies/failure.hh
branches/gll/src/strategies/generic/choice.hh
branches/gll/src/strategies/generic/debug.hh
branches/gll/src/strategies/generic/fail.hh
branches/gll/src/strategies/generic/id.hh
branches/gll/src/strategies/generic/not.hh
branches/gll/src/strategies/generic/repeat.hh
branches/gll/src/strategies/generic/seq.hh
branches/gll/src/strategies/generic/side_effect_strategy.hh
branches/gll/src/strategies/generic/try.hh
branches/gll/src/strategies/generic/where.hh
branches/gll/src/strategies/lists/const_map.hh
branches/gll/src/strategies/lists/map.hh
branches/gll/src/strategies/lists/map_index.hh
branches/gll/src/strategies/lists/map_join.hh
branches/gll/src/strategies/lists/map_one.hh
branches/gll/src/strategies/lists/map_some.hh
branches/gll/src/strategies/lists/size.hh
branches/gll/src/strategies/patterns/build.hh
branches/gll/src/strategies/patterns/match.hh
branches/gll/src/strategies/patterns/pair.hh
branches/gll/src/strategies/patterns/reset.hh
branches/gll/src/strategies/strategies.hh
branches/gll/src/strategies/strings/undouble_quote.hh
branches/gll/src/strategies/terms/get_cons_name.hh
branches/gll/src/strategies/traversals/all.hh
branches/gll/src/strategies/traversals/alltd.hh
branches/gll/src/strategies/traversals/bottomup.hh
branches/gll/src/strategies/traversals/innermost.hh
branches/gll/src/strategies/traversals/one.hh
branches/gll/src/strategies/traversals/topdown.hh
branches/gll/src/terms/constructor.hh
Added Paths:
-----------
branches/gll/doc/bldl-mini.png
branches/gll/doc/footer.html
branches/gll/doc/header.html
branches/gll/doc/pages/
branches/gll/doc/pages/401.doc
branches/gll/doc/pages/403.doc
branches/gll/doc/pages/404.doc
branches/gll/doc/pages/500.doc
branches/gll/doc/pages/download.doc
branches/gll/doc/pages/mainpage.doc
branches/gll/doc/pages/manual.doc
branches/gll/doc/pages/strategies.doc
branches/gll/doc/pages/support.doc
branches/gll/doc/stylesheet.css
branches/gll/src/patterns/term_pattern.hh
branches/gll/src/patterns/variable.hh
branches/gll/src/strategies/patterns/scope.hh
branches/gll/src/strategies/strings/double_quote.hh
Removed Paths:
-------------
branches/gll/doc/pages/401.doc
branches/gll/doc/pages/403.doc
branches/gll/doc/pages/404.doc
branches/gll/doc/pages/500.doc
branches/gll/doc/pages/download.doc
branches/gll/doc/pages/mainpage.doc
branches/gll/doc/pages/manual.doc
branches/gll/doc/pages/strategies.doc
branches/gll/doc/pages/support.doc
Property Changed:
----------------
branches/gll/
Property changes on: branches/gll
___________________________________________________________________
Added: svn:mergeinfo
+ /trunk:82-92
Modified: branches/gll/AUTHORS
===================================================================
--- branches/gll/AUTHORS 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/AUTHORS 2010-07-01 15:51:39 UTC (rev 93)
@@ -1 +1,5 @@
-Valentin David <val...@ii...>
+/*! \page AUTHORS AUTHORS
+
+\li Valentin David <val...@ii...>
+
+*/
Modified: branches/gll/COPYING
===================================================================
--- branches/gll/COPYING 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/COPYING 2010-07-01 15:51:39 UTC (rev 93)
@@ -1,3 +1,5 @@
+/*! \page COPYING COPYING
+\verbatim
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
@@ -672,3 +674,6 @@
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+
+\endverbatim
+*/
Modified: branches/gll/ChangeLog
===================================================================
--- branches/gll/ChangeLog 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/ChangeLog 2010-07-01 15:51:39 UTC (rev 93)
@@ -1,3 +1,133 @@
+2010-07-01 Valentin David <val...@ii...>
+
+ * doc/header.html: Add BLDL logo.
+
+ * doc/stylesheet.css: Change presentation of buttons.
+
+ * doc/bldl-mini.png: New.
+ * doc/Makefile.am: Update.
+
+2010-06-30 Valentin David <val...@ii...>
+
+ * src/patterns/variable.hh: Add scope ability.
+
+ * src/strategies/patterns/scope.hh: New.
+ * src/strategies/Makefile.am: Updae.
+
+ * src/parser_generator/parser_gen.cc, src/sig/sig.cc,
+ * demos-from-rascal/03-java.cc,
+ * demos-from-rascal/06-reaching-defs.cc:
+ Use "scope" instead of "reset".
+
+ * doc/stylesheet.css, doc/header.html:
+ Add SF.net logo.
+
+2010-06-30 Valentin David <val...@ii...>
+
+ * src/patterns/variable.hh,
+ * src/patterns/delayed_constr.hh,
+ * src/sig/sig.cc,
+ * src/strategies/generic/side_effect_strategy.hh:
+ Use shared_ptr from library.
+
+2010-06-30 Valentin David <val...@ii...>
+
+ * src/patterns/pair.hh,
+ * src/patterns/pattern.hh,
+ * src/strategies/patterns/reset.hh,
+ * src/strategies/patterns/pair.hh,
+ * src/strategies/patterns/match.hh,
+ * src/strategies/patterns/build.hh,
+ * src/strategies/failure.hh,
+ * src/strategies/traversals/one.hh,
+ * src/strategies/traversals/all.hh,
+ * src/strategies/traversals/bottomup.hh,
+ * src/strategies/traversals/topdown.hh,
+ * src/strategies/traversals/innermost.hh,
+ * src/strategies/traversals/alltd.hh,
+ * src/strategies/strategies.hh,
+ * src/strategies/strings/double_quote.hh,
+ * src/strategies/terms/get_cons_name.hh,
+ * src/strategies/generic/side_effect_strategy.hh,
+ * src/strategies/generic/debug.hh,
+ * src/strategies/generic/seq.hh,
+ * src/strategies/generic/choice.hh,
+ * src/strategies/generic/where.hh,
+ * src/strategies/generic/fail.hh,
+ * src/strategies/generic/id.hh,
+ * src/strategies/generic/try.hh,
+ * src/strategies/generic/not.hh,
+ * src/strategies/generic/repeat.hh,
+ * src/strategies/lists/const_map.hh,
+ * src/strategies/lists/map_index.hh,
+ * src/strategies/lists/size.hh,
+ * src/strategies/lists/map_join.hh,
+ * src/strategies/lists/map.hh,
+ * src/strategies/lists/map_one.hh,
+ * src/strategies/lists/map_some.hh:
+ Add documentation and concepts.
+
+ * src/terms/constructor.hh: Update operator[].
+
+ * doc/Doxyfile.in: Activate use of Graphviz.
+
+ * doc/pages/strategies.doc: New.
+ * doc/Makefile.am (EXTRA_DIST): Update.
+
+ * doc/pages/manual.doc: Add link to strategies.
+
+ * src/strategies/strings/undouble_quote.hh,
+ * src/patterns/term_pattern.hh, src/patterns/variable.hh:
+ New. Extract from other files.
+
+ * src/patterns/Makefile.am, src/strategies/Makefile.am:
+ Update.
+
+ * demos-from-stratego/01-constant-folding-rules.cc:
+ Update includes.
+
+2010-06-28 Valentin David <val...@ii...>
+
+ Make webpage of the project as part of the documentation.
+
+ * doc/pages/support.doc, doc/pages/manual.doc, doc/pages/500.doc,
+ * doc/pages/401.doc, doc/pages/403.doc, doc/pages/404.doc,
+ * doc/pages/download.doc:
+ New.
+
+ * doc/pages/mainpage.doc: Update.
+
+ * doc/stylesheet.css, doc/header.html, doc/footer.html: New.
+ * doc/Doxyfile.in: Disable index. Use custom html/css files.
+ Add COPYING. Fix project name.
+
+ * COPYING: Add in documentation.
+
+2010-06-28 Valentin David <val...@ii...>
+
+ * AUTHORS, README, HACKING, INSTALL, NEWS:
+ Format for Doxygen.
+
+ * src/aurelia.hh: Remove main page documentation.
+
+ * src/strategies/strategies.hh,
+ * src/strategies/generic/side_effect_strategy.hh:
+ Change traits into concepts/models with Doxygen support.
+
+ * src/strategies/generic/seq.hh, src/strategies/generic/choice.hh:
+ Update.
+
+ * configure.ac: Update addresses.
+
+ * doc/pages/mainpage.doc: Put main page doc here.
+
+ * doc/Doxyfile.in: Add extra inputs. Add an extra -D for
+ parsing concepts.
+
+ * doc/Makefile.am (EXTRA_DIST): Update.
+
+ * demos/10-int.cc: Update.
+
2010-06-24 Valentin David <val...@ii...>
* configure.ac: Update bug report email address.
Modified: branches/gll/HACKING
===================================================================
--- branches/gll/HACKING 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/HACKING 2010-07-01 15:51:39 UTC (rev 93)
@@ -1,18 +1,19 @@
+/*! \page HACKING HACKING
+
Follow the GNU coding standards: <http://www.gnu.org/prep/standards/>
Except when the present document contradicts it.
-Coding style
-------------
+<h2>Coding style</h2>
- * Only C++0x include files can be used. C include files are to be avoided.
- In the case needed, use header <c...>. Avoid using C functions.
- * No space when applying operator(), or when declaring or defining functions.
- * A space after all keywords.
- * Lines should be not more than 80 columns.
-Committing on the repository
-----------------------------
+\li Only C++0x include files can be used. C include files are to be avoided.
+ In the case needed, use header <c...>. Avoid using C functions.
+\li No space when applying operator(), or when declaring or defining functions.
+\li A space after all keywords.
+\li Lines should be not more than 80 columns.
+<h2>Committing on the repository</h2>
+
Post your ChangeLog entry as. If your commit does not have a ChangeLog
entry (e.g. svn propedit), you are free to use a simple sentence to
describe your commit.
@@ -24,8 +25,7 @@
Avoid multi-purpose commits.
-autoconf, automake
-------------------
+<h2>autoconf, automake</h2>
Use ./bootstrap to generate the auto* files.
@@ -33,3 +33,5 @@
Never downgrade the requirements on the versions of automake and autoconf.
Maintenairs needs to have a distribution of the current era or die.
+
+*/
Modified: branches/gll/INSTALL
===================================================================
--- branches/gll/INSTALL 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/INSTALL 2010-07-01 15:51:39 UTC (rev 93)
@@ -1,3 +1,6 @@
+/*! \page INSTALL INSTALL
+
+\verbatim
Installation Instructions
*************************
@@ -363,3 +366,5 @@
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
+\endverbatim
+*/
Modified: branches/gll/NEWS
===================================================================
--- branches/gll/NEWS 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/NEWS 2010-07-01 15:51:39 UTC (rev 93)
@@ -1,14 +1,19 @@
-0.1 [Currently in dev.]
+/*! \page NEWS NEWS
+<h2>0.1 [Currently in dev.]</h2>
+
This version provides:
Library:
- * Reusable template for maximally shared with reference counting data
- structures, optionally thread safe.
- * Standard terms similar to CWI' ATerm library, including a BAF importer.
- * Reusable strategies and strategy operators. Including
- * A Generalized LL stack.
+ \li Reusable template for maximally shared with reference counting data
+ structures, optionally thread safe.
+ \li Standard terms similar to CWI' ATerm library, including a BAF importer.
+ \li Reusable strategies and strategy operators. Including
+ \li A Generalized LL stack.
+
Tools:
- * Typed term generator from StrategoXT signature.
- * A GLL Parser generator.
+ \li Typed term generator from StrategoXT signature.
+ \li A GLL Parser generator.
+
+*/
Modified: branches/gll/README
===================================================================
--- branches/gll/README 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/README 2010-07-01 15:51:39 UTC (rev 93)
@@ -1,7 +1,7 @@
- +---------+
- | Aurelia |
- +---------+
+/*! \page README README
+<h1>Aurelia</h1>
+
Aurelia is a framework for program transformation based on a C++0x
development environment. It provides libraries and tools for term
rewriting, strategic programming, AST type generation, parsing. It is
@@ -14,26 +14,25 @@
The documentation is not ready yet. Directory "demos" provides a good
idea of what the library can provide.
-Requirements
-------------
+<h2>Requirements</h2>
-* A C++0x compiler with a C++0x standard library. The requirements
- will be checked by the configure script.
+\li A C++0x compiler with a C++0x standard library. The requirements
+ will be checked by the configure script.
-Build and install
------------------
+<h2>Build and install</h2>
The installation uses the standard GNU procedure. For more
-information, please refer to INSTALL.
+information, please refer to \ref INSTALL.
You can overide CXX to choose the compiler. You can also set CPPFLAGS
to choose an alternative standard library.
For example:
+\code
./configure CXX=icpc CPPFLAGS=-I/usr/include/stlport
+\endcode
-License
--------
+<h2>License</h2>
A copy of the GNU General Public License version 3 is in the file
COPYING.
@@ -53,3 +52,4 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
Modified: branches/gll/configure.ac
===================================================================
--- branches/gll/configure.ac 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/configure.ac 2010-07-01 15:51:39 UTC (rev 93)
@@ -18,9 +18,9 @@
AC_PREREQ([2.65])
AC_INIT([aurelia], [0.1],dnl
-[aur...@li...],dnl
+[aur...@li...],dnl
[aurelia],dnl
-[http://aurelia-cxx.sourceforge.net/]dnl
+[http://aurelia.cx/]dnl
)
RELEASE=no
Modified: branches/gll/demos/10-int.cc
===================================================================
--- branches/gll/demos/10-int.cc 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/demos/10-int.cc 2010-07-01 15:51:39 UTC (rev 93)
@@ -67,14 +67,19 @@
namespace aurelia {
template <typename Pool>
-struct Return<Max, Int<Pool> > {
- typedef Int<Pool> out;
+struct StrategyModel<Max, Int<Pool> > {
+ typedef Max Strat;
+ typedef Int<Pool> Input;
+ typedef Int<Pool> Ouput;
};
template <typename Pool>
-struct Return<Max, Term<Pool> > {
- typedef Int<Pool> out;
+struct StrategyModel<Max, Term<Pool> > {
+ typedef Max Strat;
+ typedef Term<Pool> Input;
+ typedef Int<Pool> Ouput;
};
+
}
struct Max {
@@ -88,8 +93,8 @@
~Max() { if (master) delete i; }
template <typename T>
- typename Return<Max,T>::out operator()(const T& t) const {
- typename Return<Max,T>::out ret(t);
+ typename StrategyModel<Max,T>::Output operator()(const T& t) const {
+ typename StrategyModel<Max,T>::Output ret(t);
if (*i < (int)ret)
*i = (int)ret;
return ret;
Modified: branches/gll/demos-from-rascal/03-java.cc
===================================================================
--- branches/gll/demos-from-rascal/03-java.cc 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/demos-from-rascal/03-java.cc 2010-07-01 15:51:39 UTC (rev 93)
@@ -1,7 +1,7 @@
#include <relations/relations.hh>
#include <strategies/lists/const_map.hh>
#include <strategies/lists/filter.hh>
-#include <strategies/patterns/reset.hh>
+#include <strategies/patterns/scope.hh>
#include <strategies/patterns/pair.hh>
using namespace aurelia;
@@ -25,7 +25,7 @@
set<Class> ClassesInCycle =
filter(set<Class>(),
- reset(a) < ~p(a, a) < !a)
+ scope(a, ~p(a, a) < !a))
(*USE);
std::cout << ClassesInCycle << std::endl;
Modified: branches/gll/demos-from-rascal/06-reaching-defs.cc
===================================================================
--- branches/gll/demos-from-rascal/06-reaching-defs.cc 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/demos-from-rascal/06-reaching-defs.cc 2010-07-01 15:51:39 UTC (rev 93)
@@ -2,7 +2,7 @@
#include <strategies/lists/const_map.hh>
#include <strategies/lists/map_join.hh>
#include <strategies/lists/filter.hh>
-#include <strategies/patterns/reset.hh>
+#include <strategies/patterns/scope.hh>
#include <strategies/patterns/pair.hh>
using namespace aurelia;
@@ -16,13 +16,20 @@
return (~D <
map_join(out(),
- reset(S1) < reset (V) <
- ~p(S1, V) < !D <
- filter(out(),
- reset(S2) <
- ~p(S2, V) <
- not_(~p(S1, V)) <
- !p(S1, p(S2, V)))))
+ scope(S1,
+ scope(V,
+ ~p(S1, V) < !D <
+ filter(out(),
+ scope(S2,
+ ~p(S2, V) <
+ not_(~p(S1, V)) <
+ !p(S1, p(S2, V))
+ )
+ )
+ )
+ )
+ )
+ )
(DEFS);
}
@@ -33,7 +40,7 @@
Variable<var> V;
return filter(out(),
- reset(S) < reset(V) < ~p(S, V) < !p(S, p(S, V))
+ scope(S, scope(V, ~p(S, V) < !p(S, p(S, V))))
)(DEFS);
}
@@ -44,7 +51,7 @@
Variable<var> V;
return filter(out(),
- reset(S) < reset(V) < ~p(S, V) < !p(S, p(S, V))
+ scope(S, scope(V, ~p(S, V) < !p(S, p(S, V))))
)(USES);
}
Modified: branches/gll/demos-from-stratego/01-constant-folding-rules.cc
===================================================================
--- branches/gll/demos-from-stratego/01-constant-folding-rules.cc 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/demos-from-stratego/01-constant-folding-rules.cc 2010-07-01 15:51:39 UTC (rev 93)
@@ -6,6 +6,7 @@
#include <strategies/terms/get_cons_name.hh>
#include <strategies/generic/debug.hh>
#include <strategies/strings/undouble_quote.hh>
+#include <strategies/strings/double_quote.hh>
#include <sstream>
#include <fstream>
#include <iostream>
Modified: branches/gll/doc/Doxyfile.in
===================================================================
--- branches/gll/doc/Doxyfile.in 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/doc/Doxyfile.in 2010-07-01 15:51:39 UTC (rev 93)
@@ -25,7 +25,7 @@
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
-PROJECT_NAME = "Aurelia API"
+PROJECT_NAME = "Aurelia"
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
@@ -502,7 +502,7 @@
# file name after the option, if omitted DoxygenLayout.xml will be used as the name
# of the layout file.
-LAYOUT_FILE =
+LAYOUT_FILE =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
@@ -564,7 +564,14 @@
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = @top_srcdir@/src
+INPUT = @top_srcdir@/src \
+ @top_srcdir@/README \
+ @top_srcdir@/INSTALL \
+ @top_srcdir@/HACKING \
+ @top_srcdir@/NEWS \
+ @top_srcdir@/AUTHORS \
+ @top_srcdir@/COPYING \
+ @srcdir@/pages
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@@ -581,7 +588,7 @@
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
-FILE_PATTERNS = *.hh
+FILE_PATTERNS = *.hh *.doc
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
@@ -775,13 +782,13 @@
# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
-HTML_HEADER =
+HTML_HEADER = header.html
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
-HTML_FOOTER =
+HTML_FOOTER = footer.html
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to
@@ -790,7 +797,7 @@
# the style sheet file to the HTML output directory, so don't put your own
# stylesheet in the HTML output directory as well, or it will be erased!
-HTML_STYLESHEET =
+HTML_STYLESHEET = stylesheet.css
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
@@ -929,7 +936,7 @@
# top of each HTML page. The value NO (the default) enables the index and
# the value YES disables it.
-DISABLE_INDEX = NO
+DISABLE_INDEX = YES
# This tag can be used to set the number of enum values (range [1..20])
# that doxygen will group on one line in the generated HTML documentation.
@@ -1244,7 +1251,7 @@
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
-PREDEFINED =
+PREDEFINED = DOC_GEN
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
@@ -1339,7 +1346,7 @@
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
-HAVE_DOT = NO
+HAVE_DOT = YES
# By default doxygen will write a font called FreeSans.ttf to the output
# directory and reference it in all dot files that doxygen generates. This
Modified: branches/gll/doc/Makefile.am
===================================================================
--- branches/gll/doc/Makefile.am 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/doc/Makefile.am 2010-07-01 15:51:39 UTC (rev 93)
@@ -30,6 +30,7 @@
rm -rf output.tmp; \
exit 1; \
fi
+ cp bldl-mini.png html
install-data-local: html
rm -rf $(DESTDIR)$(htmldir)/html
@@ -52,4 +53,20 @@
CLEANFILES=
endif
-EXTRA_DIST=html html.stamp
+EXTRA_DIST= \
+ html \
+ html.stamp \
+ pages/mainpage.doc \
+ pages/401.doc \
+ pages/403.doc \
+ pages/404.doc \
+ pages/500.doc \
+ pages/download.doc \
+ pages/manual.doc \
+ pages/support.doc \
+ pages/strategies.doc \
+ footer.html \
+ header.html \
+ stylesheet.css \
+ bldl-mini.png
+
Copied: branches/gll/doc/bldl-mini.png (from rev 92, trunk/doc/bldl-mini.png)
===================================================================
(Binary files differ)
Copied: branches/gll/doc/footer.html (from rev 92, trunk/doc/footer.html)
===================================================================
--- branches/gll/doc/footer.html (rev 0)
+++ branches/gll/doc/footer.html 2010-07-01 15:51:39 UTC (rev 93)
@@ -0,0 +1,5 @@
+</div>
+<hr class="footer"/><address class="footer"><small>
+Generated on $datetime for $projectname by <a href="http://www.doxygen.org/index.html"><img class="footer" src="$relpath$doxygen.png" alt="doxygen"/></a> $doxygenversion</small></address>
+</body>
+</html>
Copied: branches/gll/doc/header.html (from rev 92, trunk/doc/header.html)
===================================================================
--- branches/gll/doc/header.html (rev 0)
+++ branches/gll/doc/header.html 2010-07-01 15:51:39 UTC (rev 93)
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<title>$title</title>
+<link href="$relpath$stylesheet.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div class="navigation">
+<ul>
+<li><a href="index.html"><span>Main page</span></a></li>
+<li><a href="download.html"><span>Download</span></a></li>
+<li><a href="manual.html"><span>Manual</span></a></li>
+<li><a href="support.html"><span>Support</span></a></li>
+</ul>
+
+<div class="buttons">
+<p>
+<a href="http://sourceforge.net/projects/aurelia">
+<img src="http://sflogo.sourceforge.net/sflogo.php?group_id=330861&type=8"
+ width="80" height="15"
+ alt="Get Aurelia at SourceForge.net. Fast, secure and Free Open Source software downloads" />
+</a>
+</p>
+<p>
+<a href="http://bldl.ii.uib.no/">
+<img src="bldl-mini.png" width="80" height="15"
+ alt="Bergen Language Design Laboratory" />
+</a>
+</p>
+</div>
+</div>
+<div class="cont">
Deleted: branches/gll/doc/pages/401.doc
===================================================================
--- trunk/doc/pages/401.doc 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/doc/pages/401.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -1,5 +0,0 @@
-/*! \page 401 Error 401: Unauthorized
-
-Please contact me on val...@ii... .
-
-*/
Copied: branches/gll/doc/pages/401.doc (from rev 92, trunk/doc/pages/401.doc)
===================================================================
--- branches/gll/doc/pages/401.doc (rev 0)
+++ branches/gll/doc/pages/401.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -0,0 +1,5 @@
+/*! \page 401 Error 401: Unauthorized
+
+Please contact me on val...@ii... .
+
+*/
Deleted: branches/gll/doc/pages/403.doc
===================================================================
--- trunk/doc/pages/403.doc 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/doc/pages/403.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -1,5 +0,0 @@
-/*! \page 403 Error 403: Forbidden
-
-Please contact me on val...@ii... .
-
-*/
Copied: branches/gll/doc/pages/403.doc (from rev 92, trunk/doc/pages/403.doc)
===================================================================
--- branches/gll/doc/pages/403.doc (rev 0)
+++ branches/gll/doc/pages/403.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -0,0 +1,5 @@
+/*! \page 403 Error 403: Forbidden
+
+Please contact me on val...@ii... .
+
+*/
Deleted: branches/gll/doc/pages/404.doc
===================================================================
--- trunk/doc/pages/404.doc 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/doc/pages/404.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -1,5 +0,0 @@
-/*! \page 404 Error 404: Document not found.
-
-Please contact me on val...@ii... .
-
-*/
Copied: branches/gll/doc/pages/404.doc (from rev 92, trunk/doc/pages/404.doc)
===================================================================
--- branches/gll/doc/pages/404.doc (rev 0)
+++ branches/gll/doc/pages/404.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -0,0 +1,5 @@
+/*! \page 404 Error 404: Document not found.
+
+Please contact me on val...@ii... .
+
+*/
Deleted: branches/gll/doc/pages/500.doc
===================================================================
--- trunk/doc/pages/500.doc 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/doc/pages/500.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -1,5 +0,0 @@
-/*! \page 500 Error 500: Internal server error.
-
-Please contact me on val...@ii... .
-
-*/
Copied: branches/gll/doc/pages/500.doc (from rev 92, trunk/doc/pages/500.doc)
===================================================================
--- branches/gll/doc/pages/500.doc (rev 0)
+++ branches/gll/doc/pages/500.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -0,0 +1,5 @@
+/*! \page 500 Error 500: Internal server error.
+
+Please contact me on val...@ii... .
+
+*/
Deleted: branches/gll/doc/pages/download.doc
===================================================================
--- trunk/doc/pages/download.doc 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/doc/pages/download.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -1,14 +0,0 @@
-/*! \page download Download
-
-There is no release yet of Aurelia.
-
-However it can be downloaded as a source tarball from the
-<a href="http://aurelia.cx/nightly">nightly tarball repository</a>.
-
-The second option is to use the svn repository
-https://svn.aurelia.cx/svnroot/aurelia/trunk . You will need recent
-versions of GNU Autoconf, Automake, Stratego/XT, and Doxygen. Do not
-forget to pass "--enable-bootstrap". Those requirements are not needed
-for compiling a nightly tarball.
-
-*/
Copied: branches/gll/doc/pages/download.doc (from rev 92, trunk/doc/pages/download.doc)
===================================================================
--- branches/gll/doc/pages/download.doc (rev 0)
+++ branches/gll/doc/pages/download.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -0,0 +1,14 @@
+/*! \page download Download
+
+There is no release yet of Aurelia.
+
+However it can be downloaded as a source tarball from the
+<a href="http://aurelia.cx/nightly">nightly tarball repository</a>.
+
+The second option is to use the svn repository
+https://svn.aurelia.cx/svnroot/aurelia/trunk . You will need recent
+versions of GNU Autoconf, Automake, Stratego/XT, and Doxygen. Do not
+forget to pass "--enable-bootstrap". Those requirements are not needed
+for compiling a nightly tarball.
+
+*/
Deleted: branches/gll/doc/pages/mainpage.doc
===================================================================
--- trunk/doc/pages/mainpage.doc 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/doc/pages/mainpage.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -1,18 +0,0 @@
-/*! \page index Aurelia
-
-Aurelia is a framework for language-independant program transformation in C++.
-It provides:
-
-\li A maximally shared reference counted term library
-\li A generic strategic programming infrastructure, using expression templates
-\li A typed term hierachy generator from a signature definition
-\li A scannerless generalized LL parser generator
-
-Aurelia is developed <a href="http://bldl.ii.uib.no/">Bergen Language
-Design Laboratory</a>.
-
-The project is licensed in GPL-3 (see \ref COPYING). It is hosted <a
-href="http://sourceforge.net">sourceforge.net</a> (<a
-href="http://sf.net/projects/aurelia">visit the project page</a>).
-
-*/
Copied: branches/gll/doc/pages/mainpage.doc (from rev 92, trunk/doc/pages/mainpage.doc)
===================================================================
--- branches/gll/doc/pages/mainpage.doc (rev 0)
+++ branches/gll/doc/pages/mainpage.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -0,0 +1,18 @@
+/*! \page index Aurelia
+
+Aurelia is a framework for language-independant program transformation in C++.
+It provides:
+
+\li A maximally shared reference counted term library
+\li A generic strategic programming infrastructure, using expression templates
+\li A typed term hierachy generator from a signature definition
+\li A scannerless generalized LL parser generator
+
+Aurelia is developed <a href="http://bldl.ii.uib.no/">Bergen Language
+Design Laboratory</a>.
+
+The project is licensed in GPL-3 (see \ref COPYING). It is hosted <a
+href="http://sourceforge.net">sourceforge.net</a> (<a
+href="http://sf.net/projects/aurelia">visit the project page</a>).
+
+*/
Deleted: branches/gll/doc/pages/manual.doc
===================================================================
--- trunk/doc/pages/manual.doc 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/doc/pages/manual.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -1,19 +0,0 @@
-/*! \page manual User manual
-
-<h2>API documentation</h2>
-
-\li <a href="group__Concepts.html">Concepts</a>
-\li \ref strategies
-\li <a href="namespaces.html">Namespaces</a>
-\li <a href="classes.html">Classes</a>
-
-<h2>Package documentation</h2>
-
-\li \ref README
-\li \ref INSTALL
-\li \ref HACKING
-\li \ref NEWS
-\li \ref COPYING
-\li \ref AUTHORS
-
-*/
Copied: branches/gll/doc/pages/manual.doc (from rev 92, trunk/doc/pages/manual.doc)
===================================================================
--- branches/gll/doc/pages/manual.doc (rev 0)
+++ branches/gll/doc/pages/manual.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -0,0 +1,19 @@
+/*! \page manual User manual
+
+<h2>API documentation</h2>
+
+\li <a href="group__Concepts.html">Concepts</a>
+\li \ref strategies
+\li <a href="namespaces.html">Namespaces</a>
+\li <a href="classes.html">Classes</a>
+
+<h2>Package documentation</h2>
+
+\li \ref README
+\li \ref INSTALL
+\li \ref HACKING
+\li \ref NEWS
+\li \ref COPYING
+\li \ref AUTHORS
+
+*/
Deleted: branches/gll/doc/pages/strategies.doc
===================================================================
--- trunk/doc/pages/strategies.doc 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/doc/pages/strategies.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -1,11 +0,0 @@
-/*! \page strategies Strategies
-
-\li \ref Generic
-\li \ref Strings
-\li \ref Terms
-\li \ref Patterns
-\li \ref Lists
-\li \ref Traversals
-\li \ref Strings
-
-*/
Copied: branches/gll/doc/pages/strategies.doc (from rev 92, trunk/doc/pages/strategies.doc)
===================================================================
--- branches/gll/doc/pages/strategies.doc (rev 0)
+++ branches/gll/doc/pages/strategies.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -0,0 +1,11 @@
+/*! \page strategies Strategies
+
+\li \ref Generic
+\li \ref Strings
+\li \ref Terms
+\li \ref Patterns
+\li \ref Lists
+\li \ref Traversals
+\li \ref Strings
+
+*/
Deleted: branches/gll/doc/pages/support.doc
===================================================================
--- trunk/doc/pages/support.doc 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/doc/pages/support.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -1,17 +0,0 @@
-/*! \page support Support
-
-<h2>Mailing-list</h2>
-
-To subscribe to any of those mailing lists, just send
-
-\li <a href="https://lists.sourceforge.net/lists/listinfo/aurelia-announce">aur...@li...</a>
-\li <a href="https://lists.sourceforge.net/lists/listinfo/aurelia-bugs">aur...@li...</a>
-\li <a href="https://lists.sourceforge.net/lists/listinfo/aurelia-svn">aur...@li...</a>
-\li <a href="https://lists.sourceforge.net/lists/listinfo/aurelia-users">aur...@li...</a>
-
-<h2>Bug tracker</h2>
-
-Please send bug reports on the sourceforge page (<a href="http://sourceforge.net/tracker/?func=add&group_id=330861&atid=1387810">quick link</a>).
-
-
-*/
\ No newline at end of file
Copied: branches/gll/doc/pages/support.doc (from rev 92, trunk/doc/pages/support.doc)
===================================================================
--- branches/gll/doc/pages/support.doc (rev 0)
+++ branches/gll/doc/pages/support.doc 2010-07-01 15:51:39 UTC (rev 93)
@@ -0,0 +1,17 @@
+/*! \page support Support
+
+<h2>Mailing-list</h2>
+
+To subscribe to any of those mailing lists, just send
+
+\li <a href="https://lists.sourceforge.net/lists/listinfo/aurelia-announce">aur...@li...</a>
+\li <a href="https://lists.sourceforge.net/lists/listinfo/aurelia-bugs">aur...@li...</a>
+\li <a href="https://lists.sourceforge.net/lists/listinfo/aurelia-svn">aur...@li...</a>
+\li <a href="https://lists.sourceforge.net/lists/listinfo/aurelia-users">aur...@li...</a>
+
+<h2>Bug tracker</h2>
+
+Please send bug reports on the sourceforge page (<a href="http://sourceforge.net/tracker/?func=add&group_id=330861&atid=1387810">quick link</a>).
+
+
+*/
\ No newline at end of file
Copied: branches/gll/doc/stylesheet.css (from rev 92, trunk/doc/stylesheet.css)
===================================================================
--- branches/gll/doc/stylesheet.css (rev 0)
+++ branches/gll/doc/stylesheet.css 2010-07-01 15:51:39 UTC (rev 93)
@@ -0,0 +1,698 @@
+.navigation {
+ width: 15%;
+ float: left;
+}
+
+.navigation .buttons p {
+ margin-top: 2px;
+ margin-bottom: 2px;
+}
+
+.navigation .buttons {
+ width: 80px;
+ margin-bottom: 30px;
+ margin-top: 30px;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.navigation ul {
+ padding: 10px;
+ margin: 10px;
+ margin-top: 30px;
+ margin-bottom: 30px;
+ list-style: none;
+ font-size: 120%;
+ border: 1px solid #C4CFE5;
+ background-color: #F9FAFC;
+}
+
+.cont {
+ display: block;
+ margin-top: 0;
+ width: 85%;
+ float: right;
+ margin-bottom: 30px;
+}
+
+/* The standard CSS for doxygen */
+
+body, table, div, p, dl {
+ font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
+ font-size: 12px;
+}
+
+/* @group Heading Levels */
+
+h1 {
+ font-size: 150%;
+}
+
+h2 {
+ font-size: 120%;
+}
+
+h3 {
+ font-size: 100%;
+}
+
+dt {
+ font-weight: bold;
+}
+
+div.multicol {
+ -moz-column-gap: 1em;
+ -webkit-column-gap: 1em;
+ -moz-column-count: 3;
+ -webkit-column-count: 3;
+}
+
+p.startli, p.startdd, p.starttd {
+ margin-top: 2px;
+}
+
+p.endli {
+ margin-bottom: 0px;
+}
+
+p.enddd {
+ margin-bottom: 4px;
+}
+
+p.endtd {
+ margin-bottom: 2px;
+}
+
+/* @end */
+
+caption {
+ font-weight: bold;
+}
+
+span.legend {
+ font-size: 70%;
+ text-align: center;
+}
+
+h3.version {
+ font-size: 90%;
+ text-align: center;
+}
+
+div.qindex, div.navtab{
+ background-color: #EBEFF6;
+ border: 1px solid #A3B4D7;
+ text-align: center;
+ margin: 2px;
+ padding: 2px;
+}
+
+div.qindex, div.navpath {
+ width: 100%;
+ line-height: 140%;
+}
+
+div.navtab {
+ margin-right: 15px;
+}
+
+/* @group Link Styling */
+
+a {
+ color: #3D578C;
+ font-weight: normal;
+ text-decoration: none;
+}
+
+.contents a:visited {
+ color: #4665A2;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+a.qindex {
+ font-weight: bold;
+}
+
+a.qindexHL {
+ font-weight: bold;
+ background-color: #9CAFD4;
+ color: #ffffff;
+ border: 1px double #869DCA;
+}
+
+.contents a.qindexHL:visited {
+ color: #ffffff;
+}
+
+a.el {
+ font-weight: bold;
+}
+
+a.elRef {
+}
+
+a.code {
+ color: #4665A2;
+}
+
+a.codeRef {
+ color: #4665A2;
+}
+
+/* @end */
+
+dl.el {
+ margin-left: -1cm;
+}
+
+.fragment {
+ font-family: monospace, fixed;
+ font-size: 105%;
+}
+
+pre.fragment {
+ border: 1px solid #C4CFE5;
+ background-color: #FBFCFD;
+ padding: 4px 6px;
+ margin: 4px 8px 4px 2px;
+ overflow: auto;
+ word-wrap: break-word;
+ font-size: 9pt;
+ line-height: 125%;
+}
+
+div.ah {
+ background-color: black;
+ font-weight: bold;
+ color: #ffffff;
+ margin-bottom: 3px;
+ margin-top: 3px;
+ padding: 0.2em;
+ border: solid thin #333;
+ border-radius: 0.5em;
+ -webkit-border-radius: .5em;
+ -moz-border-radius: .5em;
+ -webkit-box-shadow: 2px 2px 3px #999;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
+ background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);
+}
+
+div.groupHeader {
+ margin-left: 16px;
+ margin-top: 12px;
+ margin-bottom: 6px;
+ font-weight: bold;
+}
+
+div.groupText {
+ margin-left: 16px;
+ font-style: italic;
+}
+
+body {
+ background: white;
+ color: black;
+ margin: 0;
+}
+
+div.contents {
+ margin-top: 10px;
+ margin-left: 10px;
+ margin-right: 10px;
+}
+
+td.indexkey {
+ background-color: #EBEFF6;
+ font-weight: bold;
+ border: 1px solid #C4CFE5;
+ margin: 2px 0px 2px 0;
+ padding: 2px 10px;
+}
+
+td.indexvalue {
+ background-color: #EBEFF6;
+ border: 1px solid #C4CFE5;
+ padding: 2px 10px;
+ margin: 2px 0px;
+}
+
+tr.memlist {
+ background-color: #EEF1F7;
+}
+
+p.formulaDsp {
+ text-align: center;
+}
+
+img.formulaDsp {
+
+}
+
+img.formulaInl {
+ vertical-align: middle;
+}
+
+div.center {
+ text-align: center;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ padding: 0px;
+}
+
+div.center img {
+ border: 0px;
+}
+
+hr.footer {
+ clear: both;
+ margin-top: 30px;
+}
+
+address.footer {
+ text-align: right;
+ padding-right: 12px;
+}
+
+img.footer {
+ border: 0px;
+ vertical-align: middle;
+}
+
+/* @group Code Colorization */
+
+span.keyword {
+ color: #008000
+}
+
+span.keywordtype {
+ color: #604020
+}
+
+span.keywordflow {
+ color: #e08000
+}
+
+span.comment {
+ color: #800000
+}
+
+span.preprocessor {
+ color: #806020
+}
+
+span.stringliteral {
+ color: #002080
+}
+
+span.charliteral {
+ color: #008080
+}
+
+span.vhdldigit {
+ color: #ff00ff
+}
+
+span.vhdlchar {
+ color: #000000
+}
+
+span.vhdlkeyword {
+ color: #700070
+}
+
+span.vhdllogic {
+ color: #ff0000
+}
+
+/* @end */
+
+/*
+.search {
+ color: #003399;
+ font-weight: bold;
+}
+
+form.search {
+ margin-bottom: 0px;
+ margin-top: 0px;
+}
+
+input.search {
+ font-size: 75%;
+ color: #000080;
+ font-weight: normal;
+ background-color: #e8eef2;
+}
+*/
+
+td.tiny {
+ font-size: 75%;
+}
+
+.dirtab {
+ padding: 4px;
+ border-collapse: collapse;
+ border: 1px solid #A3B4D7;
+}
+
+th.dirtab {
+ background: #EBEFF6;
+ font-weight: bold;
+}
+
+hr {
+ height: 0px;
+ border: none;
+ border-top: 1px solid #4A6AAA;
+}
+
+hr.footer {
+ height: 1px;
+}
+
+/* @group Member Descriptions */
+
+table.memberdecls {
+ border-spacing: 0px;
+ padding: 0px;
+}
+
+.mdescLeft, .mdescRight,
+.memItemLeft, .memItemRight,
+.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
+ background-color: #F9FAFC;
+ border: none;
+ margin: 4px;
+ padding: 1px 0 0 8px;
+}
+
+.mdescLeft, .mdescRight {
+ padding: 0px 8px 4px 8px;
+ color: #555;
+}
+
+.memItemLeft, .memItemRight, .memTemplParams {
+ border-top: 1px solid #C4CFE5;
+}
+
+.memItemLeft, .memTemplItemLeft {
+ white-space: nowrap;
+}
+
+.memTemplParams {
+ color: #4665A2;
+ white-space: nowrap;
+}
+
+/* @end */
+
+/* @group Member Details */
+
+/* Styles for detailed member documentation */
+
+.memtemplate {
+ font-size: 80%;
+ color: #4665A2;
+ font-weight: normal;
+ margin-left: 3px;
+}
+
+.memnav {
+ background-color: #EBEFF6;
+ border: 1px solid #A3B4D7;
+ text-align: center;
+ margin: 2px;
+ margin-right: 15px;
+ padding: 2px;
+}
+
+.memitem {
+ padding: 0;
+ margin-bottom: 10px;
+}
+
+.memname {
+ white-space: nowrap;
+ font-weight: bold;
+ margin-left: 6px;
+}
+
+.memproto {
+ border-top: 1px solid #A8B8D9;
+ border-left: 1px solid #A8B8D9;
+ border-right: 1px solid #A8B8D9;
+ padding: 6px 0px 6px 0px;
+ color: #253555;
+ font-weight: bold;
+ text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
+ /* firefox specific markup */
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+ -moz-border-radius-topright: 8px;
+ -moz-border-radius-topleft: 8px;
+ /* webkit specific markup */
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ -webkit-border-top-right-radius: 8px;
+ -webkit-border-top-left-radius: 8px;
+ background-image:url('nav_f.png');
+ background-repeat:repeat-x;
+ background-color: #E2E8F2;
+
+}
+
+.memdoc {
+ border-bottom: 1px solid #A8B8D9;
+ border-left: 1px solid #A8B8D9;
+ border-right: 1px solid #A8B8D9;
+ padding: 2px 5px;
+ background-color: #FBFCFD;
+ border-top-width: 0;
+ /* firefox specific markup */
+ -moz-border-radius-bottomleft: 8px;
+ -moz-border-radius-bottomright: 8px;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+ background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7);
+ /* webkit specific markup */
+ -webkit-border-bottom-left-radius: 8px;
+ -webkit-border-bottom-right-radius: 8px;
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7));
+}
+
+.paramkey {
+ text-align: right;
+}
+
+.paramtype {
+ white-space: nowrap;
+}
+
+.paramname {
+ color: #602020;
+ white-space: nowrap;
+}
+.paramname em {
+ font-style: normal;
+}
+
+/* @end */
+
+/* @group Directory (tree) */
+
+/* for the tree view */
+
+.ftvtree {
+ font-family: sans-serif;
+ margin: 0px;
+}
+
+/* these are for tree view when used as main index */
+
+.directory {
+ font-size: 9pt;
+ font-weight: bold;
+ margin: 5px;
+}
+
+.directory h3 {
+ margin: 0px;
+ margin-top: 1em;
+ font-size: 11pt;
+}
+
+/*
+The following two styles can be used to replace the root node title
+with an image of your choice. Simply uncomment the next two styles,
+specify the name of your image and be sure to set 'height' to the
+proper pixel height of your image.
+*/
+
+/*
+.directory h3.swap {
+ height: 61px;
+ background-repeat: no-repeat;
+ background-image: url("yourimage.gif");
+}
+.directory h3.swap span {
+ display: none;
+}
+*/
+
+.directory > h3 {
+ margin-top: 0;
+}
+
+.directory p {
+ margin: 0px;
+ white-space: nowrap;
+}
+
+.directory div {
+ display: none;
+ margin: 0px;
+}
+
+.directory img {
+ vertical-align: -30%;
+}
+
+/* these are for tree view when not used as main index */
+
+.directory-alt {
+ font-size: 100%;
+ font-weight: bold;
+}
+
+.directory-alt h3 {
+ margin: 0px;
+ margin-top: 1em;
+ font-size: 11pt;
+}
+
+.directory-alt > h3 {
+ margin-top: 0;
+}
+
+.directory-alt p {
+ margin: 0px;
+ white-space: nowrap;
+}
+
+.directory-alt div {
+ display: none;
+ margin: 0px;
+}
+
+.directory-alt img {
+ vertical-align: -30%;
+}
+
+/* @end */
+
+div.dynheader {
+ margin-top: 8px;
+}
+
+address {
+ font-style: normal;
+ color: #2A3D61;
+}
+
+table.doxtable {
+ border-collapse:collapse;
+}
+
+table.doxtable td, table.doxtable th {
+ border: 1px solid #2D4068;
+ padding: 3px 7px 2px;
+}
+
+table.doxtable th {
+ background-color: #374F7F;
+ color: #FFFFFF;
+ font-size: 110%;
+ padding-bottom: 4px;
+ padding-top: 5px;
+ text-align:left;
+}
+
+.tabsearch {
+ top: 0px;
+ left: 10px;
+ height: 36px;
+ background-image: url('tab_b.png');
+ z-index: 101;
+ overflow: hidden;
+ font-size: 13px;
+}
+
+.navpath ul
+{
+ font-size: 11px;
+ background-image:url('tab_b.png');
+ background-repeat:repeat-x;
+ height:30px;
+ line-height:30px;
+ color:#8AA0CC;
+ border:solid 1px #C2CDE4;
+ overflow:hidden;
+ margin:0px;
+ padding:0px;
+}
+
+.navpath li
+{
+ list-style-type:none;
+ float:left;
+ padding-left:10px;
+ padding-right: 15px;
+ background-image:url('bc_s.png');
+ background-repeat:no-repeat;
+ background-position:right;
+ color:#364D7C;
+}
+
+.navpath a
+{
+ height:32px;
+ display:block;
+ text-decoration: none;
+ outline: none;
+}
+
+.navpath a:hover
+{
+ color:#6884BD;
+}
+
+div.summary
+{
+ float: right;
+ font-size: 8pt;
+ padding-right: 5px;
+ width: 50%;
+ text-align: right;
+}
+
+div.summary a
+{
+ white-space: nowrap;
+}
+
+div.header
+{
+ background-image:url('nav_h.png');
+ background-repeat:repeat-x;
+ background-color: #F9FAFC;
+ margin: 0px;
+ border-bottom: 1px solid #C4CFE5;
+}
+
+div.headertitle
+{
+ padding: 5px 5px 5px 10px;
+}
+
Modified: branches/gll/src/aurelia.hh
===================================================================
--- branches/gll/src/aurelia.hh 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/src/aurelia.hh 2010-07-01 15:51:39 UTC (rev 93)
@@ -26,8 +26,4 @@
namespace aurelia {
}
-/*! \mainpage
- * This is the API documenation of Aurelia
- */
-
#endif
Modified: branches/gll/src/parser_generator/parser_gen.cc
===================================================================
--- branches/gll/src/parser_generator/parser_gen.cc 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/src/parser_generator/parser_gen.cc 2010-07-01 15:51:39 UTC (rev 93)
@@ -28,6 +28,7 @@
#include "strategies/traversals/alltd.hh"
#include "strategies/lists/map.hh"
#include "strategies/generic/where.hh"
+#include "strategies/patterns/scope.hh"
#include "strategies/patterns/reset.hh"
#include "strategies/generic/side_effect_strategy.hh"
#include "strategies/strings/undouble_quote.hh"
@@ -660,60 +661,69 @@
return ( (~Tail
< [this, &nt](const T&) { return set[*nt]; })
- + (reset(sym)
- < reset(next)
- < reset(attr)
- < ~Cons[AttrChainElt[attr, Symbol[sym, NoArg]], next]
- < !sym
- < [this, &next, &firstof](const T& t) {
- std::bitset<256> s;
- if ((*build_empty)[t]) {
- std::cerr << t << " can be empty" << std::endl;
- s = firstof(*next);
- }
- else std::cerr << t << " not empty" << std::endl;
- return (*build_first)[t] | s;
- })
- + (~Cons[AttrChainElt[attr,Class[s]], next]
- < !s
- < get_cons_name
- < undouble_quote
- < [] (const std::string& in) {
- return class_to_set(in);
- })
- + (~Cons[AttrChainElt[attr,String[s]], next]
- < !s
- < get_cons_name
- < undouble_quote
- < undouble_quote
- < unescape
- < [] (const std::string& in) {
- if (in.size() == 0)
- throw Failure();
- std::bitset<256> ret;
- ret[(unsigned char)in[0]] = true;
- return ret;
- })
- )(in);
+ + (~Cons[AttrChainElt[attr,Symbol[sym, NoArg]], next]
+ < !sym
+ < [this, &next, &firstof](const T& t) {
+ std::bitset<256> s;
+ if ((*build_empty)[t]) {
+ std::cerr << t << " can be empty"
+ << std::endl;
+ s = firstof(*next);
+ }
+ else std::cerr << t << " not empty"
+ << std::endl;
+ return (*build_first)[t] | s;
+ })
+ + (~Cons[AttrChainElt[attr,Class[s]], next]
+ < !s
+ < get_cons_name
+ < undouble_quote
+ < [] (const std::string& in) {
+ return class_to_set(in);
+ })
+ + (~Cons[String[s], next]
+ < !s
+ < get_cons_name
+ < undouble_quote
+ < undouble_quote
+ < unescape
+ < [] (const std::string& in) {
+ if (in.size() == 0)
+ throw Failure();
+ std::bitset<256> ret;
+ ret[(unsigned char)in[0]] = true;
+ return ret;
+ })
+ )(in);
};
V next, attr;
return (~Tail +
- (reset(sym) < reset(next) < reset(attr) <
- ( where(~Cons[AttrChainElt[attr,Symbol[sym, NoArg]], next]
- < !next < firstof
- < [this, &sym, &changed](std::bitset<256> t) {
- t |= set[*sym];
- if (t != set[*sym]) {
- changed = true;
- set[*sym] = t;
- }
- std::cerr << "Setting: " << set_to_class(set[*sym]) << " to " << *sym << std::endl;
- return t;
- })
- + ~Cons[sym, next])
- < !next < f))(t);
+ (scope(sym,
+ scope(next,
+ (where(~Cons[AttrChainElt[attr,Symbol[sym, NoArg]],
+ next]
+ < !next < firstof
+ < [this, &sym, &changed]
+ (std::bitset<256> t) {
+ t |= set[*sym];
+ if (t != set[*sym]) {
+ changed = true;
+ set[*sym] = t;
+ }
+ std::cerr << "Setting: "
+ << set_to_class(set[*sym])
+ << " to " << *sym
+ << std::endl;
+ return t;
+ })
+ + ~Cons[sym, next])
+ < !next < f
+ )
+ )
+ )
+ )(t);
};
static C Chain("Chain", 2);
@@ -793,40 +803,37 @@
static C AttrChainElt("AttrChainElt", 2);
return ( (~Tail
- < [this](const T&) { return std::bitset<256>(); })
- + (reset(sym)
- < reset(next)
- < reset(attr)
- < ~Cons[AttrChainElt[attr,Symbol[sym, NoArg]], next]
- < !sym
- < [this, &next, &firstof](const T& t) {
- std::bitset<256> s;
- if ((*build_empty)[t]) {
- s = firstof(*next);
- }
- return (*build_first)[t] | s;
- })
+ < [this](const T&) { return std::bitset<256>(); })
+ + (~Cons[AttrChainElt[attr,Symbol[sym, NoArg]], next]
+ < !sym
+ < [this, &next, &firstof](const T& t) {
+ std::bitset<256> s;
+ if ((*build_empty)[t]) {
+ s = firstof(*next);
+ }
+ return (*build_first)[t] | s;
+ })
+ (~Cons[AttrChainElt[attr,Class[s]], next]
- < !s
- < get_cons_name
- < undouble_quote
- < [] (const std::string& in) {
- return class_to_set(in);
- })
+ < !s
+ < get_cons_name
+ < undouble_quote
+ < [] (const std::string& in) {
+ return class_to_set(in);
+ })
+ (~Cons[AttrChainElt[attr,String[s]], next]
- < !s
- < get_cons_name
- < undouble_quote
- < undouble_quote
- < unescape
- < [] (const std::string& in) {
- if (in.size() == 0)
- throw Failure();
- std::bitset<256> ret;
- ret[(unsigned char)in[0]] = true;
+ < !s
+ < get_cons_name
+ < undouble_quote
+ < undouble_quote
+ < unescape
+ < [] (const std::string& in) {
+ if (in.size() == 0)
+ throw Failure();
+ std::bitset<256> ret;
+ ret[(unsigned char)in[0]] = true;
return ret;
- })
- )(in);
+ })
+ )(in);
};
std::bitset<256> nonll = ((*build_first)[*nt]) & ((*build_follow)[*nt]);
@@ -1124,14 +1131,16 @@
V l, nt;
std::cout << "enum nonterm {" << std::endl;
- map(reset(nt)
- < reset(l)
- < ~Rule[nt, NoParam, Void, l]
- < !nt
- < [](const T& t) {
- std::cout << " NT_" << to_cxx_id(t) << "," << std::endl;
- return t;
- })(input);
+ map(scope(nt, scope(l,
+ ~Rule[nt, NoParam, Void, l]
+ < !nt
+ < [](const T& t) {
+ std::cout << " NT_" << to_cxx_id(t)
+ << "," << std::endl;
+ return t;
+ })
+ )
+ )(input);
std::cout << "};" << std::endl;
std::cout << "enum state {" << std::endl;
@@ -1167,26 +1176,31 @@
repeat(map_one(build_follow))(input);
std::cout << "const unsigned char follow[NUM_NT][32] = {" << std::endl;
- map(reset(nt)
- < reset(l)
- < ~Rule[nt, NoParam, Void, l]
- < !nt
- < [&build_follow](const T& t) {
- std::cout << " /*" << t << "*/ {";
- print_bin(std::cout, build_follow[t]);
- std::cout << "}," << std::endl;
- return t;
- })(input);
+ map(scope(nt,
+ scope(l,
+ ~Rule[nt, NoParam, Void, l]
+ < !nt
+ < [&build_follow](const T& t) {
+ std::cout << " /*" << t << "*/ {";
+ print_bin(std::cout, build_follow[t]);
+ std::cout << "}," << std::endl;
+ return t;
+ })
+ )
+ )(input);
std::cout << "};" << std::endl;
- map(reset(nt)
- < reset(l)
- < ~Rule[nt, NoParam, Void, l]
- < !l
- < [&nt](const T& t) {
- std::cout << "struct " << to_cxx_id(*nt) << ";" << std::endl;
- return t;
- })(input);
+ map(scope(nt,
+ scope(l,
+ ~Rule[nt, NoParam, Void, l]
+ < !l
+ < [&nt](const T& t) {
+ std::cout << "struct " << to_cxx_id(*nt)
+ << ";" << std::endl;
+ return t;
+ })
+ )
+ )(input);
map(print_rule(&build_first, &build_empty, &build_follow))(input);
} catch (Failure) {
Modified: branches/gll/src/patterns/Makefile.am
===================================================================
--- branches/gll/src/patterns/Makefile.am 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/src/patterns/Makefile.am 2010-07-01 15:51:39 UTC (rev 93)
@@ -19,4 +19,6 @@
patterns_HEADERS= \
delayed_constr.hh \
pattern.hh \
- pair.hh
+ pair.hh \
+ term_pattern.hh \
+ variable.hh
Modified: branches/gll/src/patterns/delayed_constr.hh
===================================================================
--- branches/gll/src/patterns/delayed_constr.hh 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/src/patterns/delayed_constr.hh 2010-07-01 15:51:39 UTC (rev 93)
@@ -44,6 +44,11 @@
return init;
}
+ void reset () {
+ this->~DelayedConstr();
+ new (this) DelayedConstr();
+ }
+
void build(const T& o) {
if (init)
((T*)data)->~T();
Modified: branches/gll/src/patterns/pair.hh
===================================================================
--- branches/gll/src/patterns/pair.hh 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/src/patterns/pair.hh 2010-07-01 15:51:39 UTC (rev 93)
@@ -21,31 +21,47 @@
namespace aurelia {
-template <typename A, typename B>
-struct P {
-private:
- A a;
- B b;
-public:
- typedef std::pair<decltype(*a),decltype(*b)> build_type;
- P(const A& a, const B& b): a(a), b(b) {}
+ template <typename A, typename B>
+ struct P {
+ typedef PatternConcept<PatternModel<A> > require1;
+ typedef PatternConcept<PatternModel<B> > require2;
- build_type operator*() const {
- return build_type(*a, *b);
+ private:
+ A a;
+ B b;
+ public:
+ typedef std::pair<typename PatternModel<A>::BuildType,
+ typename PatternModel<B>::BuildType> BuildType;
+ P(const A& a, const B& b): a(a), b(b) {}
+
+ BuildType operator*() const {
+ return BuildType(*a, *b);
+ }
+ void operator=(const BuildType& i) const {
+ A ta(a);
+ B tb(b);
+ ta = i.first;
+ tb = i.second;
+ }
+ };
+
+
+ /*! \ingroup Models
+ */
+ template <typename A, typename B>
+ struct PatternModel<P<A, B> > {
+ typedef PatternConcept<PatternModel<A> > require1;
+ typedef PatternConcept<PatternModel<B> > require2;
+
+ typedef P<A, B> Type;
+ typedef typename P<A, B>::BuildType BuildType;
+ };
+
+ template <typename A, typename B>
+ P<A,B> p(const A& a, const B& b) {
+ return P<A,B>(a, b);
}
- void operator=(const build_type& i) const {
- A ta(a);
- B tb(b);
- ta = i.first;
- tb = i.second;
- }
-};
-template <typename A, typename B>
-P<A,B> p(const A& a, const B& b) {
- return P<A,B>(a, b);
}
-}
-
#endif
Modified: branches/gll/src/patterns/pattern.hh
===================================================================
--- branches/gll/src/patterns/pattern.hh 2010-07-01 13:08:44 UTC (rev 92)
+++ branches/gll/src/patterns/pattern.hh 2010-07-01 15:51:39 UTC (rev 93)
@@ -25,227 +25,49 @@
namespace aurelia {
-template <typename Pat>
-struct Match;
-
-template <typename Pat>
-struct Build;
-
-template <typename Pool>
-struct Top {
- enum : unsigned { N = 0 };
-
- void assign(const Term<Pool>&, unsigned n) {
- if (n != 0)
- throw Failure();
- }
-
- TermList<Pool, 0> operator*() const {
- return TermList<Pool, 0>();
- }
-};
-
-template <typename Pool, typename Head, typename Tail>
-struct PatternList {
-private:
- Head h;
- Tail t;
-
-public:
- enum : unsigned { N = (unsigned)Head::N + 1 };
-
- PatternList(const Head& h, const Tail& t): h(h), t(t) {
- }
-
- void assign(const Term<Pool>& term, unsigned n) {
- h.assign(term, n-1);
- t = term[n-1];
- }
-
- TermList<Pool, N> operator*() const {
- return TermList<Pool, N>(*h, *t);
- }
-};
-
-template <typename Pool, typename Constr, typename List>
-struct Pattern {
-private:
- Constr c;
- List l;
-public:
- Pattern(const Constr& c, const List& l): c(c), l(l) {
- }
-
- const Term<Pool>& operator=(const Term<Pool>& t) {
- if (c != t.constructor())
- throw Failure();
- l.assign(t, t.constructor().arity());
- return t;
- }
-
- Term<Pool> operator*() const {
- return Term<Pool>(c, *l);
- }
-};
-
-template <typename T>
-struct Variable {
-private:
- DelayedConstr<T>* value;
- bool master;
-
-public:
- ~Variable() {
- if (master)
- delete value;
- }
- Variable(): master(true) {
- value = new DelayedConstr<T>();
- }
- /* Variable(const T& c): master(true) {
- value = new DelayedConstr<T>();
- value->build(c);
- }*/
- Variable(const Variable& v): master(false) {
- value = v.value;
- }
-
- Variable(const T& v): master(true) {
- value = new DelayedConstr<T>();
- value->build(v);
- }
-
- bool has_value() const {
- return value->has_value();
- }
- const T& operator*() const {
- if (!value->has_value())
- throw Failure();
- return value->o();
- }
- const T& operator=(const T& c) {
- if (value->has_value()) {
- if (c != value->o())
- throw Failure();
- return value->o();
+ /*! \ingroup Conc...
[truncated message content] |
|
From: <val...@us...> - 2010-07-01 13:08:50
|
Revision: 92
http://aurelia.svn.sourceforge.net/aurelia/?rev=92&view=rev
Author: valentindavid
Date: 2010-07-01 13:08:44 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
Put better BLDL logo. No ChangeLog.
Modified Paths:
--------------
trunk/doc/bldl-mini.png
Modified: trunk/doc/bldl-mini.png
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-07-01 11:11:01
|
Revision: 91
http://aurelia.svn.sourceforge.net/aurelia/?rev=91&view=rev
Author: valentindavid
Date: 2010-07-01 11:10:54 +0000 (Thu, 01 Jul 2010)
Log Message:
-----------
2010-07-01 Valentin David <val...@ii...>
* doc/header.html: Add BLDL logo.
* doc/stylesheet.css: Change presentation of buttons.
* doc/bldl-mini.png: New.
* doc/Makefile.am: Update.
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/Makefile.am
trunk/doc/header.html
trunk/doc/stylesheet.css
Added Paths:
-----------
trunk/doc/bldl-mini.png
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-06-30 17:31:00 UTC (rev 90)
+++ trunk/ChangeLog 2010-07-01 11:10:54 UTC (rev 91)
@@ -1,3 +1,12 @@
+2010-07-01 Valentin David <val...@ii...>
+
+ * doc/header.html: Add BLDL logo.
+
+ * doc/stylesheet.css: Change presentation of buttons.
+
+ * doc/bldl-mini.png: New.
+ * doc/Makefile.am: Update.
+
2010-06-30 Valentin David <val...@ii...>
* src/patterns/variable.hh: Add scope ability.
Modified: trunk/doc/Makefile.am
===================================================================
--- trunk/doc/Makefile.am 2010-06-30 17:31:00 UTC (rev 90)
+++ trunk/doc/Makefile.am 2010-07-01 11:10:54 UTC (rev 91)
@@ -30,6 +30,7 @@
rm -rf output.tmp; \
exit 1; \
fi
+ cp bldl-mini.png html
install-data-local: html
rm -rf $(DESTDIR)$(htmldir)/html
@@ -66,5 +67,6 @@
pages/strategies.doc \
footer.html \
header.html \
- stylesheet.css
+ stylesheet.css \
+ bldl-mini.png
Added: trunk/doc/bldl-mini.png
===================================================================
(Binary files differ)
Property changes on: trunk/doc/bldl-mini.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/doc/header.html
===================================================================
--- trunk/doc/header.html 2010-06-30 17:31:00 UTC (rev 90)
+++ trunk/doc/header.html 2010-07-01 11:10:54 UTC (rev 91)
@@ -14,12 +14,20 @@
<li><a href="support.html"><span>Support</span></a></li>
</ul>
-<p>Hosted by:<br/>
+<div class="buttons">
+<p>
<a href="http://sourceforge.net/projects/aurelia">
-<img src="http://sflogo.sourceforge.net/sflogo.php?group_id=330861&type=10"
+<img src="http://sflogo.sourceforge.net/sflogo.php?group_id=330861&type=8"
width="80" height="15"
alt="Get Aurelia at SourceForge.net. Fast, secure and Free Open Source software downloads" />
</a>
</p>
+<p>
+<a href="http://bldl.ii.uib.no/">
+<img src="bldl-mini.png" width="80" height="15"
+ alt="Bergen Language Design Laboratory" />
+</a>
+</p>
</div>
+</div>
<div class="cont">
Modified: trunk/doc/stylesheet.css
===================================================================
--- trunk/doc/stylesheet.css 2010-06-30 17:31:00 UTC (rev 90)
+++ trunk/doc/stylesheet.css 2010-07-01 11:10:54 UTC (rev 91)
@@ -3,15 +3,24 @@
float: left;
}
-.navigation p {
- margin: 10px;
+.navigation .buttons p {
+ margin-top: 2px;
+ margin-bottom: 2px;
+}
+
+.navigation .buttons {
+ width: 80px;
margin-bottom: 30px;
+ margin-top: 30px;
+ margin-left: auto;
+ margin-right: auto;
}
.navigation ul {
padding: 10px;
margin: 10px;
margin-top: 30px;
+ margin-bottom: 30px;
list-style: none;
font-size: 120%;
border: 1px solid #C4CFE5;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-06-24 17:12:30
|
Revision: 83
http://aurelia-cxx.svn.sourceforge.net/aurelia-cxx/?rev=83&view=rev
Author: valentindavid
Date: 2010-06-24 17:12:24 +0000 (Thu, 24 Jun 2010)
Log Message:
-----------
2010-06-24 Valentin David <val...@ii...>
* src/parser_generator/syntax.csf:
Add a lexical filter. Refactor the grammar to replace
the attribute code at the right place.
* src/parser_generator/Syntax.def: Sync with syntax.csf.
* src/parser_generator/parser_gen.cc:
Partially fix traversal to correspond with new grammar.
* src/parser_generator/input.txt: New.
* src/parser_generator/syntax.cc: Parse input.txt.
Modified Paths:
--------------
branches/gll/src/parser_generator/Syntax.def
branches/gll/src/parser_generator/parser_gen.cc
branches/gll/src/parser_generator/syntax.cc
branches/gll/src/parser_generator/syntax.csf
Added Paths:
-----------
branches/gll/ChangeLog.branch
branches/gll/src/parser_generator/input.txt
Added: branches/gll/ChangeLog.branch
===================================================================
--- branches/gll/ChangeLog.branch (rev 0)
+++ branches/gll/ChangeLog.branch 2010-06-24 17:12:24 UTC (rev 83)
@@ -0,0 +1,13 @@
+2010-06-24 Valentin David <val...@ii...>
+
+ * src/parser_generator/syntax.csf:
+ Add a lexical filter. Refactor the grammar to replace
+ the attribute code at the right place.
+
+ * src/parser_generator/Syntax.def: Sync with syntax.csf.
+
+ * src/parser_generator/parser_gen.cc:
+ Partially fix traversal to correspond with new grammar.
+
+ * src/parser_generator/input.txt: New.
+ * src/parser_generator/syntax.cc: Parse input.txt.
Modified: branches/gll/src/parser_generator/Syntax.def
===================================================================
--- branches/gll/src/parser_generator/Syntax.def 2010-06-24 16:47:07 UTC (rev 82)
+++ branches/gll/src/parser_generator/Syntax.def 2010-06-24 17:12:24 UTC (rev 83)
@@ -26,7 +26,7 @@
StringChar ListOfChains Rule Chain ChainElt AttrRule Range RangeOrChars
ClassChar SymbolChar Symbol String ParameterList RetType CxxCode
Arguments ArgumentList CxxExpression CxxIdentifier CxxChar Parameter
- TemplateArguments Parameters Syntax
+ TemplateArguments Parameters Syntax LocalParameters AttrChainElt
lexical syntax
[\ \n\r\t] -> LAYOUT
"//" Line -> LAYOUT
@@ -64,13 +64,16 @@
":" CxxType -> RetType {cons("RetType")}
-> RetType {cons("Void")}
- ChainElt* -> Chain
+ AttrChainElt* AttrRule? -> Chain {cons("Chain")}
- "{" Parameters "}" "$" CxxCode "$" -> AttrRule {cons("AttrRule")}
+ LocalParameters? "$" CxxCode "$" -> AttrRule {cons("AttrRule")}
+ "{" Parameters "}" -> LocalParameters {cons("LocalParameters")}
+
+ AttrRule? ChainElt -> AttrChainElt {cons("AttrChainElt")}
String -> ChainElt {cons("String")}
ClassChar -> ChainElt {cons("Class")}
- Symbol ArgumentList AttrRule? -> ChainElt {cons("Symbol")}
+ Symbol ArgumentList -> ChainElt {cons("Symbol")}
"(" Arguments ")" -> ArgumentList {cons("Args")}
-> ArgumentList {cons("NoArg")}
Added: branches/gll/src/parser_generator/input.txt
===================================================================
--- branches/gll/src/parser_generator/input.txt (rev 0)
+++ branches/gll/src/parser_generator/input.txt 2010-06-24 17:12:24 UTC (rev 83)
@@ -0,0 +1 @@
+A::=A
Modified: branches/gll/src/parser_generator/parser_gen.cc
===================================================================
--- branches/gll/src/parser_generator/parser_gen.cc 2010-06-24 16:47:07 UTC (rev 82)
+++ branches/gll/src/parser_generator/parser_gen.cc 2010-06-24 17:12:24 UTC (rev 83)
@@ -231,15 +231,15 @@
std::string nt_name;
gen_label(int index, const std::string& n): index(index), nt_name(n) {}
T operator()(const T& t, int index_l) const {
- static C Symbol("Symbol", 3);
+ static C Symbol("Symbol", 2);
+ static C AttrChainElt("AttrChainElt", 2);
static C String("String", 1);
static C Class("Class", 1);
static V NoArg = T(C("NoArg"));
- static V None = T(C("None"));
try {
- V sym;
- Symbol[sym, NoArg, None] = t;
+ V sym, attr;
+ AttrChainElt[attr, Symbol[sym, NoArg]] = t;
std::string toparse = to_cxx_id(*sym);
std::cout << "template <>" << std::endl;
std::cout << "struct branch<" << nt_name
@@ -259,8 +259,8 @@
} catch (Failure) {
try {
- V s;
- String[s] = t;
+ V s, attr;
+ AttrChainElt[attr, String[s]] = t;
int i = fresh();
std::cout << "struct str_"<<i<<" {" <<std::endl;
std::cout << " static const char* str;" << std::endl;
@@ -288,8 +288,8 @@
std::cout << "};" << std::endl;
} catch (Failure) {
- V s;
- Class[s] = t;
+ V s, attr;
+ AttrChainElt[attr,Class[s]] = t;
int num = fresh();
std::string c = (get_cons_name < undouble_quote)(*s);
std::bitset<256> chars = class_to_set(c);
@@ -326,8 +326,11 @@
gen_branch(const std::string& n): nt_name(n) {}
T operator()(const T& t, int index) const {
- map_index(gen_label(index, nt_name))(t);
- int s = size(t);
+ static C Chain("Chain", 2);
+ V chain, attr;
+ Chain[chain, attr] = t;
+ map_index(gen_label(index, nt_name))(*chain);
+ int s = size(*chain);
std::cout << "template <>" << std::endl;
std::cout << "struct branch<" << nt_name << ","
<< index << "," << s << "> {" << std::endl;
@@ -344,12 +347,12 @@
empty_sym(const map_t *map): map(map) {}
empty_sym(const empty_sym& other): map(other.map) {}
T operator()(const T& in) const {
- static C Symbol("Symbol", 3);
+ static C Symbol("Symbol", 2);
static V NoArg = T(C("NoArg"));
- static V None = T(C("None"));
+ static C AttrChainElt("AttrChainElt", 2);
- V sym;
- Symbol[sym, NoArg, None] = in;
+ V sym, attr;
+ AttrChainElt[attr,Symbol[sym, NoArg]] = in;
map_t::const_iterator i = map->find(*sym);
if (i != map->end()) {
if ((*i).second)
@@ -402,7 +405,10 @@
if (set[*nt])
throw Failure();
try {
- map_one(is_empty(&set))(*l);
+ static C Chain("Chain", 2);
+ V chain, attr;
+
+ map_one(reset(chain) < reset(attr) < ~Chain[chain, attr] < !chain < is_empty(&set))(*l);
set[*nt] = true;
return in;
} catch (Failure) {
@@ -435,13 +441,13 @@
: set(set), cset(cset), build_empty(build_empty) {
}
T operator()(const T& t) const {
+ static C AttrChainElt("AttrChainElt", 2);
try {
- static C Symbol("Symbol", 3);
+ static C Symbol("Symbol", 2);
static V NoArg = T(C("NoArg"));
- static V None = T(C("None"));
- V sym;
- Symbol[sym, NoArg, None] = t;
+ V sym, attr;
+ AttrChainElt[attr, Symbol[sym, NoArg]] = t;
cset |= (*set)[*sym];
// if *sym is nullable, we have to look at the next symbol or literal
// in the rule.
@@ -453,8 +459,8 @@
try {
static C String("String", 1);
- V s;
- String[s] = t;
+ V s, attr;
+ AttrChainElt[attr,String[s]] = t;
cset[(unsigned char)(get_cons_name < undouble_quote < undouble_quote < unescape)(*s)[0]] = true;
std::cerr << "after set: " << (unsigned char)(get_cons_name < undouble_quote < undouble_quote < unescape)(*s)[0] << " " << cset << std::endl;
print_bin(std::cerr, cset);
@@ -464,8 +470,8 @@
}
static C Class("Class", 1);
- V s;
- Class[s] = t;
+ V s, attr;
+ AttrChainElt[attr,Class[s]] = t;
cset |= class_to_set((get_cons_name < undouble_quote)(*s));
return t;
@@ -504,12 +510,15 @@
static C Rule("Rule", 4);
static V NoParam = T(C("NoParam"));
static V Void = T(C("Void"));
+ static C Chain("Chain", 2);
- V l, nt;
+ V l, nt, attr, chain;
Rule[nt, NoParam, Void, l] = in;
char_set_t c;
- map(try_(map_one(set_first(build_empty, &set, c))))(*l);
+ map(try_(reset(attr) < reset(chain)
+ < ~Chain[chain, attr] <
+ !chain < map_one(set_first(build_empty, &set, c))))(*l);
if (c == set[*nt])
throw Failure();
@@ -551,13 +560,13 @@
build_first(build_first) {
}
T operator()(const T& t) const {
+ static C AttrChainElt("AttrChainElt", 2);
try {
- static C Symbol("Symbol", 3);
+ static C Symbol("Symbol", 2);
static V NoArg = T(C("NoArg"));
- static V None = T(C("None"));
- V sym;
- Symbol[sym, NoArg, None] = t;
+ V sym, attr;
+ AttrChainElt[attr, Symbol[sym, NoArg]] = t;
cset |= (*set)[*sym];
// if *sym is nullable, we have to look at the next symbol or literal
// in the rule.
@@ -569,8 +578,8 @@
try {
static C String("String", 1);
- V s;
- String[s] = t;
+ V s, attr;
+ AttrChainElt[attr,String[s]] = t;
cset[(get_cons_name < undouble_quote < undouble_quote < unescape)(*s)[0]] = true;
return t;
}
@@ -579,8 +588,8 @@
static C Class("Class", 1);
- V s;
- Class[s] = t;
+ V s, attr;
+ AttrChainElt[attr,Class[s]] = t;
cset |= class_to_set((get_cons_name < undouble_quote)(*s));
return t;
@@ -639,20 +648,22 @@
static V Tail = T(C::AS_EMPTY_LIST);
static V NoArg = T(C("NoArg"));
- static V None = T(C("None"));
- static C Symbol = C("Symbol", 3);
+ static C Symbol = C("Symbol", 2);
+ static C AttrChainElt("AttrChainElt", 2);
std::function<std::bitset<256>(const T&)> firstof =
[this, &firstof, &nt] (const T& in) {
- V sym, next, s;
+ V sym, next, s, attr;
static C Class("Class", 1);
static C String("String", 1);
+ static C AttrChainElt("AttrChainElt", 2);
return ( (~Tail
< [this, &nt](const T&) { return set[*nt]; })
+ (reset(sym)
< reset(next)
- < ~Cons[Symbol[sym, NoArg, None], next]
+ < reset(attr)
+ < ~Cons[AttrChainElt[attr, Symbol[sym, NoArg]], next]
< !sym
< [this, &next, &firstof](const T& t) {
std::bitset<256> s;
@@ -663,14 +674,14 @@
else std::cerr << t << " not empty" << std::endl;
return (*build_first)[t] | s;
})
- + (~Cons[Class[s], next]
+ + (~Cons[AttrChainElt[attr,Class[s]], next]
< !s
< get_cons_name
< undouble_quote
< [] (const std::string& in) {
return class_to_set(in);
})
- + (~Cons[String[s], next]
+ + (~Cons[AttrChainElt[attr,String[s]], next]
< !s
< get_cons_name
< undouble_quote
@@ -686,11 +697,11 @@
)(in);
};
- V next;
+ V next, attr;
return (~Tail +
- (reset(sym) < reset(next) <
- ( where(~Cons[Symbol[sym, NoArg, None], next]
+ (reset(sym) < reset(next) < reset(attr) <
+ ( where(~Cons[AttrChainElt[attr,Symbol[sym, NoArg]], next]
< !next < firstof
< [this, &sym, &changed](std::bitset<256> t) {
t |= set[*sym];
@@ -705,8 +716,11 @@
< !next < f))(t);
};
- map(f)(*l);
+ static C Chain("Chain", 2);
+ V chain, attr;
+ map(reset(chain) < reset(attr) < ~Chain[chain, attr] < !chain < f)(*l);
+
if (changed)
return in;
throw Failure();
@@ -749,6 +763,7 @@
{}
T operator()(const T& in) const {
+ static C Chain("Chain", 2);
static C Rule("Rule", 4);
static V NoParam = T(C("NoParam"));
static V Void = T(C("Void"));
@@ -768,20 +783,21 @@
std::function<std::bitset<256>(const T&)> firstof =
[this, &firstof] (const T& in) {
- V sym, next, s;
+ V sym, next, s, attr;
static V Tail = T(C::AS_EMPTY_LIST);
static C Cons = C::AS_LIST;
static C Class("Class", 1);
- static C Symbol("Symbol", 3);
+ static C Symbol("Symbol", 2);
static C String("String", 1);
static V NoArg = T(C("NoArg"));
- static V None = T(C("None"));
+ static C AttrChainElt("AttrChainElt", 2);
return ( (~Tail
< [this](const T&) { return std::bitset<256>(); })
+ (reset(sym)
< reset(next)
- < ~Cons[Symbol[sym, NoArg, None], next]
+ < reset(attr)
+ < ~Cons[AttrChainElt[attr,Symbol[sym, NoArg]], next]
< !sym
< [this, &next, &firstof](const T& t) {
std::bitset<256> s;
@@ -790,14 +806,14 @@
}
return (*build_first)[t] | s;
})
- + (~Cons[Class[s], next]
+ + (~Cons[AttrChainElt[attr,Class[s]], next]
< !s
< get_cons_name
< undouble_quote
< [] (const std::string& in) {
return class_to_set(in);
})
- + (~Cons[String[s], next]
+ + (~Cons[AttrChainElt[attr,String[s]], next]
< !s
< get_cons_name
< undouble_quote
@@ -816,7 +832,10 @@
std::bitset<256> nonll = ((*build_first)[*nt]) & ((*build_follow)[*nt]);
std::bitset<256> hastestfor;
- map(where(firstof < [&nonll, &hastestfor](const std::bitset<256>& bs) {
+ V attr, chain;
+
+ map(reset(attr) < reset(chain) < ~Chain[chain, attr] < !chain <
+ where(firstof < [&nonll, &hastestfor](const std::bitset<256>& bs) {
nonll |= hastestfor & bs;
hastestfor |= bs;
return bs;
@@ -876,14 +895,14 @@
bool apply = true;
T head = list[0];
list = list[1];
+ static C AttrChainElt("AttrChainElt", 2);
try {
- static C Symbol("Symbol", 3);
+ static C Symbol("Symbol", 2);
static V NoArg = T(C("NoArg"));
- static V None = T(C("None"));
- V sym;
+ V sym, attr;
- Symbol[sym, NoArg, None] = head;
+ AttrChainElt[attr,Symbol[sym, NoArg]] = head;
apply = !((*build_empty)[*sym]);
last.push_back((*build_first)[*sym]);
} catch(Failure) {
@@ -891,15 +910,15 @@
static C String("String", 1);
std::bitset<256> p;
- V s;
- String[s] = head;
+ V s, attr;
+ AttrChainElt[attr,String[s]] = head;
p[(get_cons_name < undouble_quote < undouble_quote < unescape)(*s)[0]] = true;
last.push_back(p);
} catch (Failure) {
static C Class("Class", 1);
- V s;
- Class[s] = head;
+ V s, attr;
+ AttrChainElt[attr,Class[s]] = head;
last.push_back(class_to_set((get_cons_name < undouble_quote)(*s)));
}
}
@@ -952,15 +971,16 @@
T operator()(const T& t) const {
static C Rule("Rule", 4);
+ static C Chain("Chain", 2);
static V NoParam = T(C("NoParam"));
static V Void = T(C("Void"));
- V l, nt;
+ V l, nt, chain, attr;
Rule[nt, NoParam, Void, l] = t;
std::cout << "/*" << *nt << "*/" << std::endl;
- int i;
- map([&i](const T& t) { std::cout << "/*" << i++ << "*/" << std::endl; return t; } < print_first_r(build_first, build_empty) < [](const T& t){ std::cout << " {"; print_bin(std::cout, std::bitset<256>()); std::cout << "}," << std::endl; return t; })(*l);
+ int i = 0;
+ map(reset(chain) < reset(attr) < ~Chain[chain, attr] < !chain < [&i](const T& t) { std::cout << "/*" << i++ << "*/" << std::endl; return t; } < print_first_r(build_first, build_empty) < [](const T& t){ std::cout << " {"; print_bin(std::cout, std::bitset<256>()); std::cout << "}," << std::endl; return t; })(*l);
return t;
}
};
@@ -984,12 +1004,12 @@
T head = list[0];
list = list[1];
try {
- static C Symbol("Symbol", 3);
+ static C Symbol("Symbol", 2);
static V NoArg = T(C("NoArg"));
- static V None = T(C("None"));
+ static C AttrChainElt("AttrChainElt", 2);
- V sym;
- Symbol[sym, NoArg, None] = head;
+ V sym, attr;
+ AttrChainElt[Symbol[sym, NoArg]] = head;
std::cerr << *sym << " empty? " << (*build_empty)[*sym] << std::endl;
last.push_back((*build_empty)[*sym]);
} catch(Failure) {
@@ -1029,14 +1049,16 @@
T operator()(const T& t) {
static C Rule("Rule", 4);
+ static C Chain("Chain", 2);
static V NoParam = T(C("NoParam"));
static V Void = T(C("Void"));
- V l, nt;
+ V l, nt, chain, attr;
Rule[nt, NoParam, Void, l] = t;
- map(get_bin_empty_r(build_empty, &data))(*l);
+ map(reset(chain) < reset(attr) < ~Chain[chain, attr] < !chain <
+ get_bin_empty_r(build_empty, &data))(*l);
return t;
}
@@ -1055,6 +1077,7 @@
T operator()(const T& t) {
static C Rule("Rule", 4);
+ static C Chain("Chain", 2);
static V NoParam = T(C("NoParam"));
static V Void = T(C("Void"));
V l, nt;
@@ -1064,7 +1087,9 @@
int rule = 0;
for (T rt = *l; rt.constructor() == C::AS_LIST; rt = rt[1], ++rule) {
int label = 0;
- for (T t = rt[0]; t.constructor() == C::AS_LIST; t = t[1], ++label) {
+ V chain, attr;
+ Chain[chain, attr] = rt[0];
+ for (T t = *chain; t.constructor() == C::AS_LIST; t = t[1], ++label) {
std::cout << " " << to_cxx_id(*nt) << "_" << rule
<< "_" << label << "," << std::endl;
++total;
Modified: branches/gll/src/parser_generator/syntax.cc
===================================================================
--- branches/gll/src/parser_generator/syntax.cc 2010-06-24 16:47:07 UTC (rev 82)
+++ branches/gll/src/parser_generator/syntax.cc 2010-06-24 17:12:24 UTC (rev 83)
@@ -63,6 +63,7 @@
try {
while (true) {
descriptor d = R.pop();
+ std::cerr << s.get_pos() << " " << typeid(*(d.L)).name() << ":" << d.s.get_pos() << std::endl;
s = d.s;
if (lastpos < s.get_pos()) {
lastpos = s.get_pos();
@@ -82,7 +83,7 @@
}
int main() {
- std::ifstream in(SRCDIR"/syntax.csf");
+ std::ifstream in(SRCDIR"/input.txt");
buf_stream bs(in);
stream s = bs.begin();
return !main_loop(s, bs.end());
Modified: branches/gll/src/parser_generator/syntax.csf
===================================================================
--- branches/gll/src/parser_generator/syntax.csf 2010-06-24 16:47:07 UTC (rev 82)
+++ branches/gll/src/parser_generator/syntax.csf 2010-06-24 17:12:24 UTC (rev 83)
@@ -1,4 +1,40 @@
- LAYOUT? ::= LAYOUT+ |
+ LAYOUT? ::= LAYOUT+
+ $ if (!s.eof()) {
+ switch (*s) {
+ case ' ':
+ case '\r':
+ case '\n':
+ case '\t':
+ return ;
+ case '/';
+ buf_stream_iterator next = s;
+ ++next;
+ if (!next.eof()) {
+ if (*next == '/')
+ return ;
+ }
+ default:
+ }
+ }
+ $ |
+ $ if (!s.eof()) {
+ switch (*s) {
+ case ' ':
+ case '\r':
+ case '\n':
+ case '\t':
+ return ;
+ case '/';
+ buf_stream_iterator next = s;
+ ++next;
+ if (!next.eof()) {
+ if (*next == '/')
+ return ;
+ }
+ default:
+ }
+ }
+ $
LAYOUT+ ::= LAYOUT LAYOUT?
LAYOUT ::=
@@ -32,8 +68,9 @@
SSS ::= SS |
ParameterList ::= "(" LAYOUT? Parameters LAYOUT? ")" |
+ LocalParameters ::= "{" LAYOUT? Parameters LAYOUT? "}" |
- ListOfChains ::= Chain LAYOUT? ListOfChainsTail
+ ListOfChains ::= Chain LAYOUT? AttrRule? LAYOUT? ListOfChainsTail
ListOfChainsTail ::= "|" LAYOUT? ListOfChains |
RetType ::= ":" LAYOUT? CxxType |
@@ -42,14 +79,14 @@
NonEmptyChain |
NonEmptyChain ::=
- ChainElt LAYOUT? Chain
+ AttrRule? LAYOUT? ChainElt LAYOUT? Chain
AttrRule ::=
- "{" LAYOUT? Parameters LAYOUT? "}" LAYOUT? "$" CxxCode "$"
+ LocalParameters LAYOUT? "$" CxxCode "$"
ChainElt ::=
String | ClassChar
- | Symbol LAYOUT? ArgumentList LAYOUT? AttrRule?
+ | Symbol LAYOUT? ArgumentList
ArgumentList ::= "(" LAYOUT? Arguments LAYOUT? ")" |
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-06-24 16:47:13
|
Revision: 82
http://aurelia-cxx.svn.sourceforge.net/aurelia-cxx/?rev=82&view=rev
Author: valentindavid
Date: 2010-06-24 16:47:07 +0000 (Thu, 24 Jun 2010)
Log Message:
-----------
cp trunk branches/gll
Added Paths:
-----------
branches/gll/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-06-24 16:46:13
|
Revision: 81
http://aurelia-cxx.svn.sourceforge.net/aurelia-cxx/?rev=81&view=rev
Author: valentindavid
Date: 2010-06-24 16:46:07 +0000 (Thu, 24 Jun 2010)
Log Message:
-----------
mkdir branches
Added Paths:
-----------
branches/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <val...@us...> - 2010-06-24 16:32:50
|
Revision: 80
http://aurelia-cxx.svn.sourceforge.net/aurelia-cxx/?rev=80&view=rev
Author: valentindavid
Date: 2010-06-24 16:32:44 +0000 (Thu, 24 Jun 2010)
Log Message:
-----------
use php
Modified Paths:
--------------
web/htdocs/main.css
web/update.sh
Added Paths:
-----------
web/htdocs/.htaccess
web/htdocs/401.php
web/htdocs/403.php
web/htdocs/404.php
web/htdocs/500.php
web/htdocs/bottom.php
web/htdocs/credits.php
web/htdocs/doc/
web/htdocs/doc/.htaccess
web/htdocs/head.php
web/htdocs/index.php
web/htdocs/nightly/
web/htdocs/nightly/.htaccess
web/htdocs/title.php
Removed Paths:
-------------
web/htdocs/index.html
Added: web/htdocs/.htaccess
===================================================================
--- web/htdocs/.htaccess (rev 0)
+++ web/htdocs/.htaccess 2010-06-24 16:32:44 UTC (rev 80)
@@ -0,0 +1,6 @@
+AddCharset UTF-8 .html
+AddCharset UTF-8 .txt
+ErrorDocument 404 /404.php
+ErrorDocument 401 /401.php
+ErrorDocument 403 /403.php
+ErrorDocument 500 /500.php
Added: web/htdocs/401.php
===================================================================
--- web/htdocs/401.php (rev 0)
+++ web/htdocs/401.php 2010-06-24 16:32:44 UTC (rev 80)
@@ -0,0 +1,13 @@
+<?php
+ require("head.php");
+ require("title.php");
+?>
+<h2>Error 401: Unauthorized.</h2>
+
+<p>
+Please contact me on <code>valentin at ii dot uib dot no</code>.
+</p>
+<?php
+ require("credits.php");
+ require("bottom.php");
+?>
Added: web/htdocs/403.php
===================================================================
--- web/htdocs/403.php (rev 0)
+++ web/htdocs/403.php 2010-06-24 16:32:44 UTC (rev 80)
@@ -0,0 +1,13 @@
+<?php
+ require("head.php");
+ require("title.php");
+?>
+<h2>Error 403: Forbidden.</h2>
+
+<p>
+Please contact me on <code>valentin at ii dot uib dot no</code>.
+</p>
+<?php
+ require("credits.php");
+ require("bottom.php");
+?>
Added: web/htdocs/404.php
===================================================================
--- web/htdocs/404.php (rev 0)
+++ web/htdocs/404.php 2010-06-24 16:32:44 UTC (rev 80)
@@ -0,0 +1,13 @@
+<?php
+ require("head.php");
+ require("title.php");
+?>
+<h2>Error 404: Document not found.</h2>
+
+<p>
+Please contact me on <code>valentin at ii dot uib dot no</code>.
+</p>
+<?php
+ require("credits.php");
+ require("bottom.php");
+?>
Added: web/htdocs/500.php
===================================================================
--- web/htdocs/500.php (rev 0)
+++ web/htdocs/500.php 2010-06-24 16:32:44 UTC (rev 80)
@@ -0,0 +1,13 @@
+<?php
+ require("head.php");
+ require("title.php");
+?>
+<h2>Error 500: Internal server error.</h2>
+
+<p>
+Please contact me on <code>valentin at ii dot uib dot no</code>.
+</p>
+<?php
+ require("credits.php");
+ require("bottom.php");
+?>
Added: web/htdocs/bottom.php
===================================================================
--- web/htdocs/bottom.php (rev 0)
+++ web/htdocs/bottom.php 2010-06-24 16:32:44 UTC (rev 80)
@@ -0,0 +1,2 @@
+</body>
+</html>
Added: web/htdocs/credits.php
===================================================================
--- web/htdocs/credits.php (rev 0)
+++ web/htdocs/credits.php 2010-06-24 16:32:44 UTC (rev 80)
@@ -0,0 +1,18 @@
+<div class="credits">
+<p>
+ Copyright © 2010 Valentin David
+</p>
+<p>
+ Copyright © 2010 University of Bergen
+</p>
+<p>
+ <a href="http://validator.w3.org/check?uri=referer"><img
+ src="http://www.w3.org/Icons/valid-xhtml10"
+ alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>
+ <a href="http://jigsaw.w3.org/css-validator/">
+ <img style="border:0;width:88px;height:31px"
+ src="http://jigsaw.w3.org/css-validator/images/vcss"
+ alt="Valid CSS!" />
+ </a>
+</p>
+</div>
Added: web/htdocs/doc/.htaccess
===================================================================
--- web/htdocs/doc/.htaccess (rev 0)
+++ web/htdocs/doc/.htaccess 2010-06-24 16:32:44 UTC (rev 80)
@@ -0,0 +1 @@
+Options +Indexes
Added: web/htdocs/head.php
===================================================================
--- web/htdocs/head.php (rev 0)
+++ web/htdocs/head.php 2010-06-24 16:32:44 UTC (rev 80)
@@ -0,0 +1,12 @@
+<?php
+header("Content-Type: text/html; charset=UTF-8");
+echo '<?xml version="1.0" encoding="UTF-8" ?>'."\n";
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+ <title>Aurelia</title>
+ <link rel="stylesheet" href="/main.css" type="text/css" media="screen, print"/>
+</head>
+<body>
Deleted: web/htdocs/index.html
===================================================================
--- web/htdocs/index.html 2010-06-24 15:47:20 UTC (rev 79)
+++ web/htdocs/index.html 2010-06-24 16:32:44 UTC (rev 80)
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-<head>
- <title>Aurelia</title>
- <link rel="stylesheet" href="/main.css" type="text/css" media="screen, print"/>
-</head>
-<body>
-
-
-<h1>Aurelia</h1>
-
-
- <p>
-Aurelia is a framework for program transformation based on a C++0x
-development environment. It provides libraries and tools for term
-rewriting, strategic programming, AST type generation, parsing. It is
-planned to provide in the future, generic pretty-printing tools, and
-attribute grammar evaluation, and concrete syntax.
-</p>
-
-<p>
-It is based on the C++0x standard library and does not depend on
-any other libraries.
-</p>
-
-<p>
-The documentation is not ready yet. Directory "demos" provides a good
-idea of what the library can provide.
-</p>
-
-<h2>Requirements</h2>
-
-<ul>
-<li>A C++0x compiler with a C++0x standard library. The requirements
- will be checked by the configure script.</l>
-</ul>
-
-<h2>Build and install</h2>
-
-<p>
-The installation uses the standard GNU procedure. For more
-information, please refer to INSTALL.
-</p>
-<p>
-You can overide CXX to choose the compiler. You can also set CPPFLAGS
-to choose an alternative standard library.
-</p>
-
-<p>For example:<br/>
-<code>./configure CXX=icpc CPPFLAGS=-I/usr/include/stlport</code></p>
-
-<h2>Downloads</h2>
-
-<ul>
-<li><a href="doc">Documentation</a></li>
-<li><a href="nightly">Unstable tarballs</a></li>
-<li><a href="https://aurelia-cxx.svn.sourceforge.net/svnroot/aurelia-cxx/trunk/">SVN repository</a></li>
-</ul>
-
-<h2>Contact</h2>
-
-<p><code>valentin at ii dot uib dot no</code></p>
-
-<h2>License</h2>
-
-<p>
-Copyright (C) 2010 Valentin David<br/>
-Copyright (C) 2010 University of Bergen
-</p>
-
-<p>
- 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.
-</p>
-<p>
- 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.
-</p>
-<p>
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <a href="http://www.gnu.org/licenses/"><code>http://www.gnu.org/licenses/</code></a>
-</p>
-
-<div class="credits">
-<p>
- Copyright © 2010 Valentin David
-</p>
-<p>
- Copyright © 2010 University of Bergen
-</p>
-<p>
- <a href="http://validator.w3.org/check?uri=referer"><img
- src="http://www.w3.org/Icons/valid-xhtml10"
- alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>
- <a href="http://jigsaw.w3.org/css-validator/">
- <img style="border:0;width:88px;height:31px"
- src="http://jigsaw.w3.org/css-validator/images/vcss"
- alt="Valid CSS!" />
- </a>
-</p>
-</div>
-
-</body>
-</html>
-
Copied: web/htdocs/index.php (from rev 79, web/htdocs/index.html)
===================================================================
--- web/htdocs/index.php (rev 0)
+++ web/htdocs/index.php 2010-06-24 16:32:44 UTC (rev 80)
@@ -0,0 +1,89 @@
+<?php
+ require "head.php";
+ require "title.php";
+?>
+<p>
+Aurelia is a framework for program transformation based on a C++0x
+development environment. It provides libraries and tools for term
+rewriting, strategic programming, AST type generation, parsing. It is
+planned to provide in the future, generic pretty-printing tools, and
+attribute grammar evaluation, and concrete syntax.
+</p>
+
+<p>
+It is based on the C++0x standard library and does not depend on
+any other libraries.
+</p>
+
+<p>
+The documentation is not ready yet. Directory "demos" provides a good
+idea of what the library can provide.
+</p>
+
+<p>The development Aurelia is developed by the <a href="http://bldl.ii.uib.no/">Bergen Language Design Laboratory</a>.
+</p>
+
+<h2>Requirements</h2>
+
+<ul>
+<li>A C++0x compiler with a C++0x standard library. The requirements
+ will be checked by the configure script.</li>
+</ul>
+
+<h2>Build and install</h2>
+
+<p>
+The installation uses the standard GNU procedure. For more
+information, please refer to INSTALL.
+</p>
+<p>
+You can overide CXX to choose the compiler. You can also set CPPFLAGS
+to choose an alternative standard library.
+</p>
+
+<p>For example:<br/>
+<code>./configure CXX=icpc CPPFLAGS=-I/usr/include/stlport</code></p>
+
+<h2>Downloads</h2>
+
+<ul>
+<li><a href="doc">Documentation</a></li>
+<li><a href="nightly">Unstable tarballs</a></li>
+<li><a href="https://aurelia-cxx.svn.sourceforge.net/svnroot/aurelia-cxx/trunk/">SVN repository</a></li>
+</ul>
+
+<h2>Support</h2>
+
+<p>For accessing the mailing-lists or filing bug reports, please follow the <a href="https://sourceforge.net/projects/aurelia-cxx/support">support page</a>.</p>
+
+<h2>Contact</h2>
+
+<p><code>valentin at ii dot uib dot no</code></p>
+
+<h2>License</h2>
+
+<p>
+Copyright (C) 2010 Valentin David<br/>
+Copyright (C) 2010 University of Bergen
+</p>
+
+<p>
+ 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.
+</p>
+<p>
+ 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.
+</p>
+<p>
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <a href="http://www.gnu.org/licenses/"><code>http://www.gnu.org/licenses/</code></a>
+</p>
+<?php
+ require "credits.php";
+ require "bottom.php";
+?>
Modified: web/htdocs/main.css
===================================================================
--- web/htdocs/main.css 2010-06-24 15:47:20 UTC (rev 79)
+++ web/htdocs/main.css 2010-06-24 16:32:44 UTC (rev 80)
@@ -3,6 +3,8 @@
@media screen {
body {
text-align: justify;
+ background-color: white;
+ color: black;
}
}
Added: web/htdocs/nightly/.htaccess
===================================================================
--- web/htdocs/nightly/.htaccess (rev 0)
+++ web/htdocs/nightly/.htaccess 2010-06-24 16:32:44 UTC (rev 80)
@@ -0,0 +1 @@
+Options +Indexes
Added: web/htdocs/title.php
===================================================================
--- web/htdocs/title.php (rev 0)
+++ web/htdocs/title.php 2010-06-24 16:32:44 UTC (rev 80)
@@ -0,0 +1 @@
+<h1>Aurelia</h1>
Modified: web/update.sh
===================================================================
--- web/update.sh 2010-06-24 15:47:20 UTC (rev 79)
+++ web/update.sh 2010-06-24 16:32:44 UTC (rev 80)
@@ -1,3 +1,4 @@
#! /bin/bash
+find htdocs -name "*~" -exec rm -f {} ";"
rsync -azl htdocs aurelia-cxx-www:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|