Commit graph

892 commits

Author SHA1 Message Date
Meredith L. Patterson
c6ca2aea8d how to install (eg) python bindings 2013-11-28 22:41:02 -08:00
TQ Hirsch
22a4d39d2f Merge pull request #67 from abiggerhammer/master
Install target for Python
2013-11-28 21:38:41 -08:00
Meredith L. Patterson
add92d09ce remove non-working CFFI bindings 2013-11-28 21:07:35 -08:00
Meredith L. Patterson
5a1b5de9b3 Merge pull request #16 from abiggerhammer/python-bindings
Now with a proper install target!
2013-11-26 20:03:39 -08:00
Meredith L. Patterson
f58ec8ecb7 tidying and a README about this part of the build 2013-11-26 20:00:55 -08:00
Meredith L. Patterson
79f498cdab python bindings install target works. libhammer.so must be on LD_LIBRARY_PATH. 2013-11-26 19:54:09 -08:00
Meredith L. Patterson
20bf8c4b79 distutils and working tests! 2013-11-26 19:25:41 -08:00
Meredith L. Patterson
53bc886e2f distutils being invoked from scons; ld is failing with 'libhammer.a: archive has no index, run ranlib to add one' 2013-11-26 19:09:27 -08:00
Meredith L. Patterson
1e0f3744f8 my god, it's a distutils script 2013-11-26 18:12:28 -08:00
Meredith L. Patterson
022a9f30c6 Update README.md 2013-11-26 16:29:30 -08:00
Meredith L. Patterson
63e984d643 Update README.md 2013-11-26 16:27:28 -08:00
TQ Hirsch
bf67809ab9 Merge pull request #66 from abiggerhammer/master
Python bindings
2013-11-26 16:21:08 -08:00
Meredith L. Patterson
55316e2f03 Merge pull request #15 from abiggerhammer/python-bindings
Python bindings
2013-11-26 16:10:04 -08:00
Meredith L. Patterson
f611a49ab2 cpp stuff doesn't belong on python-bindings branch 2013-11-26 16:04:13 -08:00
Meredith L. Patterson
75255d2e47 SCons doesn't support Python 3! So 2.7 only it is. Oh well. 2013-11-26 15:55:23 -08:00
Meredith L. Patterson
bd16038129 Python 2.6 is unsupported because the PyCapsule API was backported from Python 3 to 2.7. Trying Python 3.3 and 3.2 just for grins. 2013-11-26 15:53:30 -08:00
Meredith L. Patterson
5dea57c4d4 build matrix for python 2013-11-26 15:45:34 -08:00
Meredith L. Patterson
1e7553d3df build//src/bindings/python/hammer_tests.py still hangs around but everything else is cleaned up. 2013-11-26 15:40:15 -08:00
Meredith L. Patterson
f21954eecd everything's working for new-build except Clean() 2013-11-26 15:29:28 -08:00
Meredith L. Patterson
ef235136d9 Merge branch 'python-bindings' of https://github.com/abiggerhammer/hammer into python-bindings
Conflicts:
	src/bindings/python/SConscript
	src/bindings/python/hammer_tests.py
	src/bindings/swig/hammer.i
	src/hammer.h
	src/parsers/choice.c
	src/parsers/sequence.c
2013-11-26 11:35:55 -08:00
Meredith L. Patterson
2ee82f3ac7 Merge branch 'python-bindings' of https://github.com/thequux/hammer into python-bindings
Conflicts:
	src/bindings/python/SConscript
	src/bindings/python/hammer_tests.py
	src/bindings/swig/hammer.i
	src/hammer.h
2013-11-26 11:25:22 -08:00
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
0aac5f4622 travis needs python-nose to run nosetests 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
dc9124724a fix travis config here too 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
Meredith L. Patterson
a17d189d9d Merge pull request #62 from thequux/add-callback-userdata
Add void* userdata to callbacks
2013-11-23 11:14:41 -08:00