Commit graph

612 commits

Author SHA1 Message Date
Dan Hirsch
cdc7ea8381 Finished Python bindings 2013-11-25 02:49:02 -06:00
Dan Hirsch
43357bbcda AttrBool working 2013-11-24 18:43:14 -06:00
Dan Hirsch
294bca3fce Cleaned up python bindings interface a bit; now returns strings rather than character codes if appropriate 2013-11-23 19:53:58 -06:00
Dan Hirsch
26c358accf Got rid of accessors in Python; made h_action work 2013-11-23 16:40:57 -06:00
Dan Hirsch
954b6e32d3 Changed typemap for strings to also parse lengths 2013-11-23 13:36:54 -06:00
Meredith L. Patterson
8b6d6084c5 fixed the segfault! hand-initialized HParser needed PB_MIN set. 2013-11-23 13:36:54 -06:00
Meredith L. Patterson
12bb5cac36 more verbose tests; should run w/o hammer installed system-wide 2013-11-23 13:33:24 -06:00
Meredith L. Patterson
96760f1daf kindasorta working. all tests (except h_action and h_attr_bool, need typemaps) have passed at one time or another, but some segfault at not-quite-random; h_and, h_epsilon_p, h_end_p, h_ignore, h_not, maybe h_choice seem culprity. 2013-11-23 13:33:24 -06:00
Meredith L. Patterson
3228a86b90 h_sequence, h_choice and HCountedSequence are all having weird issues, but tests are in a workable format now 2013-11-23 13:33:24 -06:00
Meredith L. Patterson
f685f9ea4e there's the uint8_t problem (mostly) sorted 2013-11-23 13:33:24 -06:00
Meredith L. Patterson
073d6d8a27 python tests baked into scons; h_ch needs the first char of its input string as its input 2013-11-23 13:33:24 -06:00
Meredith L. Patterson
eba8ecc6c3 typemap to fix conversion from python strings to uint8_t* 2013-11-23 13:33:24 -06:00
Meredith L. Patterson
4bd2fc9e72 sync with php-bindings SConscript 2013-11-23 13:33:24 -06:00
Meredith L. Patterson
27f94dbe61 helps to link against the library... 2013-11-23 13:33:24 -06:00
Meredith L. Patterson
77d48e2b7c SWIG python bindings, has same typemap problem as PHP 2013-11-23 13:33:24 -06:00
Meredith L. Patterson
ada7bf89ee There's a typemap problem between const uint8_t* and target-language strings, but I can create parsers in python and php. 2013-11-23 13:33:23 -06:00
Meredith L. Patterson
73eabc7bf9 SWIG bindings build, compile, and appear to work for python. Will port over tests next. 2013-11-23 13:33:23 -06:00
Meredith L. Patterson
0e4253d0ef invoke swig with relative path instead, -I../../ 2013-11-23 13:33:23 -06:00
Meredith L. Patterson
8f427b5a6d fixed nested unions 2013-11-23 13:33:23 -06:00
Meredith L. Patterson
49f22e2aff Import combinator and allocator APIs into SWIG. Next is glue. Need to fix unions in HParsedToken and HCaseResult. 2013-11-23 13:33:23 -06:00
Meredith L. Patterson
75453d8b2f Finished writing unit tests. Fixed a few small bugs in hammer.py. Further issues:
* "in_" and "not_in" should coerce their results to strings (i.e., chr(result))
 * TestLeftrec: success case 2 fails
 * TestChRange: success case segfaults
 * TestWhitespaceEnd: success case segfaults
 * TestAction: success case segfaults with "corrupted double-linked list"
 * TestButNotRange: segfaults, probably because of whatever's wrong with ch_range
 * TestXor: segfaults; failure case craps out with "malloc(): smallbin double linked list corrupted"
2013-11-23 13:33:23 -06:00
Dan Hirsch
1841c9d77e Added a few tests 2013-11-23 13:33:23 -06:00
Dan Hirsch
a31f2d31a4 Added auto-construction, tidied h_ch a bit 2013-11-23 13:33:23 -06:00
Dan Hirsch
9d43244c2e Working python bindings 2013-11-23 13:33:23 -06:00
Dan Hirsch
28bee303f9 Add CFFI python bindings 2013-11-23 13:33:23 -06:00
Dan Hirsch
de6f6115a8 We declared some functions that were never implemented. Implement them. 2013-11-23 13:33:23 -06:00
Dan Hirsch
890c6383a7 Added documentation for H_{A,V,VA,AV}DRULE 2013-11-23 13:09:39 -06:00
Dan Hirsch
69e84bcbb0 Added a void* user_data pointer to HPredicate 2013-11-23 13:01:55 -06:00
Dan Hirsch
e487d5435c Added a void* user_data pointer to HAction 2013-11-23 12:53:11 -06:00
Joe Rozner
bb02aa18e7 Add warning message
Specify warning for internal only headers that are now installed for use
by extensions.
2013-11-21 22:09:25 -08:00
Joe Rozner
76034ae4d7 Install internal headers for Go bindings
Go, and likely other language bindings will, need access to create
new combinators. This functionality is currently located
src/parsers/parser_internal.h. Install this header to the system with
dependent headers until a better solution can be found.
2013-11-21 12:02:18 -08:00
Joe Rozner
f220524b5a Generate pkg-config for Hammer
Create a pkg-config file and install it to $prefix/lib/pkgconfig
2013-11-20 13:04:07 -08:00
Meredith L. Patterson
76b445ddb1 Merge pull request #52 from thequux/token-registry
Added token type registry. Closes #45; see also #54
2013-11-19 20:29:12 -08:00
Meredith L. Patterson
b4e28ac021 Fixed a potential segfault; hand-initialized HParsers in h_choice and
h_sequence need PB_MIN set.

Conflicts:
	src/bindings/python/SConscript
	src/bindings/python/hammer_tests.py
2013-11-19 21:58:24 -06:00
Dan Hirsch
4811f58374 Added token type registry. Closes #45 2013-11-19 21:14:39 -06:00
Meredith L. Patterson
31f283e720 Fixed TestRightrec 2013-11-19 19:15:14 -06:00
Meredith L. Patterson
6e456e3daa more verbose tests; should run w/o hammer installed system-wide 2013-11-19 19:15:14 -06:00
Meredith L. Patterson
2e0c56f403 kindasorta working. all tests (except h_action and h_attr_bool, need typemaps) have passed at one time or another, but some segfault at not-quite-random; h_and, h_epsilon_p, h_end_p, h_ignore, h_not, maybe h_choice seem culprity. 2013-11-19 19:15:14 -06:00
Meredith L. Patterson
5ced9fe9d5 h_sequence, h_choice and HCountedSequence are all having weird issues, but tests are in a workable format now 2013-11-19 19:15:13 -06:00
Meredith L. Patterson
2d459282d4 there's the uint8_t problem (mostly) sorted 2013-11-19 19:15:13 -06:00
Meredith L. Patterson
b979f66c21 python tests baked into scons; h_ch needs the first char of its input string as its input 2013-11-19 19:15:13 -06:00
Meredith L. Patterson
6746df20db typemap to fix conversion from python strings to uint8_t* 2013-11-19 19:15:13 -06:00
Meredith L. Patterson
8fcad1e72a sync with php-bindings SConscript 2013-11-19 19:15:13 -06:00
Meredith L. Patterson
150e91537b helps to link against the library... 2013-11-19 19:15:13 -06:00
Meredith L. Patterson
c58a722aef SWIG python bindings, has same typemap problem as PHP 2013-11-19 19:15:13 -06:00
Meredith L. Patterson
551645e980 There's a typemap problem between const uint8_t* and target-language strings, but I can create parsers in python and php. 2013-11-19 19:15:13 -06:00
Meredith L. Patterson
902ca46b4d SWIG bindings build, compile, and appear to work for python. Will port over tests next. 2013-11-19 19:15:13 -06:00
Meredith L. Patterson
21f16ebefd invoke swig with relative path instead, -I../../ 2013-11-19 19:15:13 -06:00
Meredith L. Patterson
eb04069817 fixed nested unions 2013-11-19 19:15:13 -06:00
Meredith L. Patterson
34062d50a2 Import combinator and allocator APIs into SWIG. Next is glue. Need to fix unions in HParsedToken and HCaseResult. 2013-11-19 19:15:13 -06:00