Commit graph

134 commits

Author SHA1 Message Date
Sven M. Hallberg
1ce0ef9b8a pass a temporary arena allocator to the continuation in h_bind 2015-02-23 14:10:29 +01:00
Sven M. Hallberg
7ba5931095 Merge branch 'master' of git://github.com/UpstandingHackers/hammer into h_bind 2015-01-30 20:48:49 +01:00
Sven M. Hallberg
78266af453 allow h_bind's function argument to return NULL as a shortcut for h_nothing_p() 2015-01-23 22:06:43 +01:00
Sven M. Hallberg
42d51ed479 add monadic bind combinator h_bind 2015-01-23 22:00:59 +01:00
TQ Hirsch
af73181cf4 Fix #118
NEWS:
* Switching endianness mid-byte no longer potentially re-reads bytes.
* bit_offset now consistently refers to the number of bits already
  read.
* HParsedTokens now have a bit_length field; this is a size_t.  This
  may be removed for memory reasons.

The bit writer has not yet been updated to match; the result of
switching bit writer endianness in the middle of a byte remains
undefined.
2015-01-04 04:08:01 +01:00
Steven Dee
f2434d5b12 Move backend names into src/benchmark.c
It's causing unreferenced-variable warnings, and isn't referenced
anywhere aside from benchmark.c. If client code is likely to reference
it, perhaps move it into another header, so people who include hammer.h
don't have to refer to it to have warning-free code.
2014-12-07 00:12:11 -05:00
Sven M. Hallberg
41dca83631 add h_permutation 2014-06-18 21:54:52 +02:00
Meredith L. Patterson
eb6c74cf89 h_put_value and h_get_value done. 2014-05-12 09:52:35 +02:00
Sven M. Hallberg
5f920b29f8 add h_with_endianness() 2014-05-07 19:24:26 +02:00
Meredith L. Patterson
1d12f9ffac regex_compile should return -1 if not a regular grammar; give backends names 2014-04-20 17:23:25 +02:00
Dan Hirsch
ebb7b677ba Added handwritten test for h_action to C# 2014-01-04 23:13:35 +01:00
Meredith L. Patterson
9da2636978 decrufting 2013-12-06 09:41:08 +01:00
Meredith L. Patterson
80b597cfbf move stdbool.h to top level 2013-12-06 06:11:48 +01:00
Meredith L. Patterson
85000da581 put stdbool.h in hammer.h to try and fix perl bindings on travis 2013-12-06 04:52:30 +01:00
Meredith L. Patterson
f53f474de2 try to resolve missing bool/true/false problems with perl bindings 2013-12-06 04:27:44 +01:00
Meredith L. Patterson
b794dbf72d SWIGPERL check around bool typedef 2013-12-06 04:03:55 +01: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
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
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
Dan Hirsch
de6f6115a8 We declared some functions that were never implemented. Implement them. 2013-11-23 13:33:23 -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
Dan Hirsch
4811f58374 Added token type registry. Closes #45 2013-11-19 21:14:39 -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
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
Dan Hirsch
87581e09cb We declared some functions that were never implemented. Implement them. 2013-11-19 19:11:30 -06:00
Meredith L. Patterson
ccacccb750 Rewrote test_leftrec to mirror test_rightrec. It fails differently for packrat now! 2013-11-19 03:31:59 -06:00
Dan Hirsch
cfc633422c Add internal conditional to not use stdarg.h for SWIG use 2013-11-15 21:55:57 -06:00
Peter Johnson
c8fc061ea6 Ditch longs and long longs in favor of stdint.h types, which has cascading
effects throughout, including use of inttypes.h/PRI[ud]64 because printf() is
still stuck in a long world, conversion of %lu to %zu for printing values of
type size_t, and changing/renaming the g_check_cmp* family of functions.
2013-11-15 00:12:57 -05:00
Dan Hirsch
ce0829de33 Made test-suite work on its own 2013-11-01 12:39:01 -04:00
Meredith L. Patterson
2408106191 C++ bindings getting underway. 2013-08-09 18:45:26 +02:00
Sven M. Hallberg
55c9a3d9c5 add stub GLR backend with h_glr_parse() a copy of h_lr_parse() 2013-06-19 17:20:53 +02:00
Sven M. Hallberg
976205f9da hook up LALR backend stub 2013-06-04 22:14:06 +02:00
Dan Hirsch
d71215d494 All tests pass; lots of stuff is no longer const 2013-05-24 15:07:47 +02:00
Dan Hirsch
b9a33f2c98 More testcases work 2013-05-24 12:22:15 +02:00
Meredith L. Patterson
1c7e9947a4 merging in aegis' JNI bindings 2013-05-23 00:58:27 -07:00
Sven M. Hallberg
29cee318f9 move the h_act_* functions to src/actions.c 2013-05-20 14:58:20 +02:00
Sven M. Hallberg
286458f58a parser->data got renamed to backend_data, also h_llk_free 2013-05-11 22:02:59 +02:00
Sven M. Hallberg
c64a4e435e Merge remote-tracking branch 'tq/master' into LL such that it compiles
Conflicts:
	src/Makefile
	src/backends/packrat.c
	src/compile.c
	src/hammer.h
	src/internal.h
	src/parsers/action.c
	src/parsers/and.c
	src/parsers/attr_bool.c
	src/parsers/bits.c
	src/parsers/butnot.c
	src/parsers/ch.c
	src/parsers/charset.c
	src/parsers/choice.c
	src/parsers/difference.c
	src/parsers/end.c
	src/parsers/epsilon.c
	src/parsers/ignore.c
	src/parsers/ignoreseq.c
	src/parsers/indirect.c
	src/parsers/int_range.c
	src/parsers/many.c
	src/parsers/not.c
	src/parsers/nothing.c
	src/parsers/optional.c
	src/parsers/sequence.c
	src/parsers/token.c
	src/parsers/unimplemented.c
	src/parsers/whitespace.c
	src/parsers/xor.c
2013-05-11 19:09:22 +02:00
Sven M. Hallberg
369dbcd21f actually, just cast off the const inside h_compile 2013-05-11 15:10:31 +02:00
aegis
106b8bb6a7 JNI ready for testing. -fPIC enabled for objects in src and jni. 2013-05-10 12:05:20 +02:00
Sven M. Hallberg
65ee3593bd compile function can't take a const parser 2013-05-08 18:01:55 +02:00
Dan Hirsch
13088c9d7a Finshed up the regex backend 2013-04-26 20:36:54 -07:00
aegis
f817211446 Merge remote branch 'upstream/master'
Conflicts:
	src/hammer.h
2013-04-23 16:31:03 +02:00
Sven M. Hallberg
1325ebcdd1 add LL backend stub 2013-04-17 15:10:33 +02:00
Dan Hirsch
f5245eaa23 Whoops. Meant to compile that first 2013-03-17 22:01:54 -07:00
Dan Hirsch
17b03dbf4d Added implementations of framework functions 2013-03-17 20:17:55 -07:00
Dan Hirsch
c19d7bb66e Regex VM finished but untested. 2013-03-09 21:42:49 -08:00