[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lojban] NORATS, SPACE, and PUBLIC in PEG grammar
On Wed, Nov 24, 2010 at 12:17:33AM -0800, Robin Lee Powell wrote:
> On Tue, Nov 23, 2010 at 12:25:23PM -0700, .alyn.post. wrote:
> > The bootstrap compiler is compiling the morphology and morphology
> > header file, but I'm still working on the peg grammar itself.
>
> Damn. That's a lot of work; good luck!
>
Thank you! I'm compiling the grammar file now, minus the morphology
inteface section. It seems from here that writing the morphology
interface section will be more work than getting a PEG parser
bootstrapped, ha!
I'm also down to string-encoding issues in the comparison between my
hand-written bootstrap and the PEG parser it is compiling, which are
a class of problem that might be in either file, so I saved them for
the end.
> > Given that Lojban is used as an example of a complex PEG grammar:
> >
> > http://en.wikipedia.org/wiki/Parsing_expression_grammar#External_links
>
> Lojban is almost certainly the most complex fully regular (except
> ZOi) grammar in actual use in the world. The only time you might
> get something worse is regularized versions of natlang grammars.
> Lojban's grammar is something like 10x the size of most programming
> languages.
>
> > I'm not sure it's a bad idea to have a peg parser generator
> > written specifically to parse Lojban.
>
> It's certainly a great test-to-destruction choice. :) Throw the
> entirety of {la .alis.} at it in one pass, for example. :)
>
I'm actually using that as my litmus test for success. My goal,
starting the project, was to be able to parse all of {la .alis.} in
one go, even if it requires so much memory I have to use the 128GB RAM
Linux box here at my office to do it. I've been mindful about
memory usage and performance in writing the parser, as this project isn't
an academic exercise for me. I think we should be able to parse
book-sized inputs. That or get rid of ZOI. ;-p
I've got smaller milestones to pass first, of course, like the test
sentences you've got for camxes and smaller works like my own {lo do
ckiku ma zvati}. But {la .alis.} is certainly the big prize. :-D
> > I do wish there had been something available already, but I'm not
> > aware of Scheme code that parsers PEG files--they all seem to want
> > to write the grammar definition in Scheme itself.
>
> Well, you could always write a pre-processor to output Scheme from a
> common PEG format.
>
> Honestly, whatever we end up with in terms of the PEG grammar we
> declare as the formalized This ... Is ... Lojban!!! (assuming we do
> so), it's going to be "wrong" in the sense that you'll have to
> process it to get a working input file for whatever parser generator
> you're *actually* using. I don't really see any way to avoid that,
> although the NORATS and so on were intended to encode some
> meta-parser sorts of information about certain productions.
>
Do you think it is better for the LLG to publish a PEG file that requires
work to use at all, or to publish a reference inmplementation that
introduces more dependencies than a PEG specification but is closer
to something "working." (Or, as always, secret option #3, ignoring
my false dichotomy and giving an answer unconstrained by the
phrasing of my question.)
Do you think your opinion differs from what the LLG would decide?
Thank you for spending time answering my questions, it has really
accelerated my progress in writing this parser.
-Alan
--
.i ko djuno fi le do sevzi
--
You received this message because you are subscribed to the Google Groups "lojban" group.
To post to this group, send email to lojban@googlegroups.com.
To unsubscribe from this group, send email to lojban+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/lojban?hl=en.
- References:
- [lojban] NORATS, SPACE, and PUBLIC in PEG grammar
- From: ".alyn.post." <alyn.post@lodockikumazvati.org>
- Re: [lojban] NORATS, SPACE, and PUBLIC in PEG grammar
- From: Robin Lee Powell <rlpowell@digitalkingdom.org>
- Re: [lojban] NORATS, SPACE, and PUBLIC in PEG grammar
- From: Robin Lee Powell <rlpowell@digitalkingdom.org>
- Re: [lojban] NORATS, SPACE, and PUBLIC in PEG grammar
- From: ".alyn.post." <alyn.post@lodockikumazvati.org>
- Re: [lojban] NORATS, SPACE, and PUBLIC in PEG grammar
- From: Robin Lee Powell <rlpowell@digitalkingdom.org>
- Re: [lojban] NORATS, SPACE, and PUBLIC in PEG grammar
- From: ".alyn.post." <alyn.post@lodockikumazvati.org>
- Re: [lojban] NORATS, SPACE, and PUBLIC in PEG grammar
- From: Robin Lee Powell <rlpowell@digitalkingdom.org>
- Re: [lojban] NORATS, SPACE, and PUBLIC in PEG grammar
- From: ".alyn.post." <alyn.post@lodockikumazvati.org>
- Re: [lojban] NORATS, SPACE, and PUBLIC in PEG grammar
- From: Robin Lee Powell <rlpowell@digitalkingdom.org>