Commit graph

68 commits

Author SHA1 Message Date
Dan Hirsch
3afe324aaa Implemented a bunch more combinators 2012-05-13 01:01:26 +01:00
Dan Hirsch
0e9bcb31ca Added optional parser 2012-05-12 23:24:39 +01:00
Dan Hirsch
0954feba89 Added ignore parser 2012-05-12 23:13:52 +01:00
Dan Hirsch
97f9c472e1 Merge remote-tracking branch 'bunter/master' 2012-05-12 23:05:09 +01:00
Dan Hirsch
3504bde301 Log memory usage diagnostics, fix test_not, add ability to compile in debug mode 2012-05-12 23:04:54 +01:00
Meredith L. Patterson
0164ddc98d Merge branch 'master' of 10.24.0.1:Projects/hammer. Also, licenses for everything!
Conflicts:
	src/hammer.c
2012-05-12 22:26:59 +01:00
Dan Hirsch
b6cb84df15 Added 'unimplemented' parser 2012-05-12 21:53:54 +01:00
Dan Hirsch
18c2d1f2ca Included arena allocator in return value 2012-05-12 21:53:03 +01:00
Meredith L. Patterson
7de4b51e92 dummy helpers added for ignore and optional 2012-05-12 21:41:28 +01:00
Meredith L. Patterson
0e69b8e2dd fixed merge conflict 2012-05-12 21:27:10 +01:00
Meredith L. Patterson
e748b9c4cb Starting work on Scala-style left-recursion caching. 2012-05-12 21:26:15 +01:00
Dan Hirsch
79f9e21da7 Bolted on arena allocator 2012-05-12 21:20:38 +01:00
Meredith L. Patterson
60fd846b2f Removed chain and chainl, as all people will really need is list. 2012-05-12 16:04:20 +01:00
Meredith L. Patterson
650a25a6b5 All unit tests written except chain and chainl. Removed left_factor_action, we'll handle left-recursion with our caching strategy. 2012-05-12 15:49:46 +01:00
Meredith L. Patterson
b80d764418 Rewrote tests to use tq's nicer macros. repeat0's test fails cos it's not implemented yet :) 2012-05-12 11:22:51 +01:00
Meredith L. Patterson
c03de603f6 Merge branch 'master' of http://github.com/thequux/hammer 2012-05-12 10:49:41 +01:00
Dan Hirsch
57e1e20db0 Fixed test functions and pretty printer. Also fixed bug in parse_sequence. Wrote whitespace parser 2012-05-12 01:28:52 +01:00
Dan Hirsch
4b31f327cd Now build tags file 2012-05-12 01:28:16 +01:00
Dan Hirsch
d5358a724b Made sequence and choice variadic, and added test suite helper functions 2012-05-12 00:40:54 +01:00
Meredith L. Patterson
2c5911c0aa wrote some more tests, waiting for tq to finish revising harness 2012-05-12 00:24:56 +01:00
Dan Hirsch
d13fbbf9c4 Added pretty print functions. They may need to be moved. 2012-05-11 23:46:29 +01:00
Meredith L. Patterson
19bbfb0f07 Merge branch 'master' of http://github.com/thequux/hammer 2012-05-11 23:43:03 +01:00
Meredith L. Patterson
6fe42d9e27 helps when I don't break the build 2012-05-11 23:42:56 +01:00
Meredith L. Patterson
7469d09a68 merging 2012-05-11 23:42:21 +01:00
Dan Hirsch
c7beb60546 Actually added pretty printer this time 2012-05-11 23:42:17 +01:00
Meredith L. Patterson
7cf1df005f Test generation continues; need to pull in tq's work 2012-05-11 23:38:45 +01:00
Dan Hirsch
99804b2abf Added pretty printer 2012-05-11 23:35:21 +01:00
Meredith L. Patterson
6e087ac758 Test harness macros extended. Need to implement bodies of primitive parsers. 2012-05-11 21:05:49 +01:00
Meredith L. Patterson
990a19e18d Wrote tests for token, chars, signed integers. Need new macros for long int output :P 2012-05-11 18:37:53 +01:00
Meredith L. Patterson
8bf9f7ae62 registered parser tests in test suite 2012-05-11 15:26:04 +01:00
Meredith L. Patterson
7080d732c1 Fixed inconsistent signature of charset parser, registered (still stubbed) unit tests so the build doesn't break :) 2012-05-11 15:24:22 +01:00
Meredith L. Patterson
602ea6d510 Added stubs for unit tests and declarations for primitive parsers (intN, uintN, floatN) 2012-05-11 15:14:30 +01:00
Dan Hirsch
dc0a7572f7 Added overrun protection 2012-05-10 14:32:11 +01:00
Dan Hirsch
d6c0eaf3de Merge remote-tracking branch 'upstream/master'
Conflicts:
	NOTES
2012-05-04 21:27:09 +01:00
Dan Hirsch
b4aca3c992 Fixed declaration of negate -> notin 2012-05-04 21:25:26 +01:00
Dan Hirsch
2af69dd8f9 Sped up charset parsing; fixed choice operator 2012-05-04 21:23:56 +01:00
Meredith L. Patterson
709884faf5 difference and xor combinators done. 2012-05-03 02:31:22 +01:00
Meredith L. Patterson
3016fd2460 Got rid of old comments about how jsparse caches, since we've settled on a cache layout 2012-05-03 02:09:00 +01:00
Dan Hirsch
a076c4d12c Merge remote-tracking branch 'upstream/master' 2012-05-03 01:59:03 +01:00
Dan Hirsch
491c2ec2fa Added do_parse function, and filled in parse driver 2012-05-03 01:58:35 +01:00
Meredith L. Patterson
19e36e1cfe Fixed build (completed butnot combinator). Also, fixed bug where sequence wasn't bailing out if one parser failed. 2012-05-03 01:40:23 +01:00
Meredith L. Patterson
7fa1111d84 Started working on butnot/difference/xor, but not gonna finish those tonight. 2012-05-01 03:59:49 +01:00
Meredith L. Patterson
37ff85eae8 Fixed signedness errors in two loops, got rid of unused variable in parse_choice 2012-05-01 03:57:37 +01:00
Meredith L. Patterson
530eed8df3 Merge pull request #4 from thequux/master
All sorts of makefile hacks, plus a new fastpath for the bitreader
2012-04-30 19:40:39 -07:00
Meredith L. Patterson
f7e7f92408 Parsers for sequence and choice are done. Got rid of join_action, we didn't need it. parse_result_t now contains a single parsed_token_t (and whatever we decide to jam into it later), so that sequence makes sense. 2012-05-01 03:21:14 +01:00
Dan Hirsch
5f26455924 Cleaned up makefiles a bit, fixed all the warnings in hammer.c 2012-05-01 02:05:58 +01:00
Dan Hirsch
a125975737 Quieter build 2012-05-01 01:47:14 +01:00
Dan Hirsch
ddcfa5b1b2 Added fast path for bitreader 2012-05-01 01:45:45 +01:00
Meredith L. Patterson
f4d116d411 See previous commit message. Saved hammer.h later than I should've. Sorry. 2012-05-01 00:45:46 +01:00
Meredith L. Patterson
318b594bed Parser combinators are well underway. Ones that are now finished are:
* token: matches a sequence of bytes (with length)
 * ch: matches a single byte
 * range: matches any byte within the range [lower, upper] (inclusive)
 * join_action: joins the results of another parser with a separator
 * negate: matches the opposite of any single-character parser
 * end_p: succeeds if there's no input left to parse
 * nothing_p: always fails

One other big change: the AST is now a GSequence of parsed_token_t's. WARNING: This is not actually enforced, because C.

Also tweaked the makefile a little (which will get clobbered in TQ's next commit) and added some documentary comments to hammer.h.
2012-05-01 00:33:47 +01:00