Concurrent parsing

2 views
Skip to first unread message

Sean Cribbs

unread,
Dec 4, 2009, 1:04:07 PM12/4/09
to neoto...@googlegroups.com
Thanks to prodding from Vsevolod Balashov, I've refactored the
memoization slightly and now you can use a generated parser from
multiple processes simultaneously. The memoization table name is based
on ?MODULE and self() and there's a new function memo_table_name/0 that
you can use to access it, for things such as building a symbol
table/etc. All of the examples in the repo are updated as well.

Things pending before I tag another release:

* Helper functions or macros for current line/column numbers
* Ability to define macros, records, and other module attributes inside
the parser (extra code at top of file)

Cheers,

Sean

Sean Cribbs

unread,
Dec 5, 2009, 8:26:22 PM12/5/09
to neoto...@googlegroups.com
Generating a table name from the Pid was a bad idea (atoms are not
GC'ed). I've basically reverted back to using the process dictionary to
keep track of the memo table ID. This will allow you to parse
concurrently without issue. I also tackled the two items below -- you
have line/1 and column/1 available to the parser, and the code block at
the bottom of your grammar will be put at the top of the parser.
Perhaps in the future there could be a separate "definitions" section
from the "extra code" section, but this will work in the meantime. I'll
tag another release tonight.

Sean
Reply all
Reply to author
Forward
0 new messages