Added benchmark skeleton, and at least stubs for all of the necessary functions

This commit is contained in:
Dan Hirsch 2012-11-02 17:16:53 -04:00
parent 8eececcac8
commit d0d9a94fd0
10 changed files with 239 additions and 13 deletions

View file

@ -109,6 +109,12 @@ struct HParseState_ {
HHashTable *recursion_heads;
};
typedef struct HParserBackendVTable_ {
int (*compile)(HAllocator *mm__, HParser* parser, const void* params);
HParseResult* (*parse)(HAllocator *mm__, HParser* parser, HParseState* parse_state);
} HParserBackendVTable;
/* The (location, parser) tuple used to key the cache.
*/
@ -173,6 +179,10 @@ typedef struct HParserCacheValue_t {
};
} HParserCacheValue;
// Backends {{{
extern HParserBackendVTable h__packrat_backend_vtable;
// }}}
// TODO(thequux): Set symbol visibility for these functions so that they aren't exported.
long long h_read_bits(HInputStream* state, int count, char signed_p);