in reply to Re^10: Block-structured language parsing using a Perl module?
in thread Block-structured language parsing using a Perl module?

BrowserUk:

I've been meaning to follow up on this post for some time, but was recently strapped for 'round tuits'. I don't think you wrote it badly, more like I just disagreed. The followup I was going to post was a set of reasons that it's a good idea to split the lexer and parser into different sections. However, with the new additions to Marpa, I'm rather hard pressed to think of a good reason. ;^)

I don't know if you've been following Marpa::R2, but they've been going in the direction of putting tokenizer rules in the grammar, and it looks rather good. If I were to start over on my project, I think I'd do it that way. (In fact, I've been migrating toward the scanless grammar, I just haven't moved my tokenization in there yet. I'm currently working on getting some of the semantic actions worked out. (As you can tell from the time between posts, this is just a side project, and I've not been working terribly hard on it of late.)

So if you're still working on your project where you need a good parser engine--or are going to start another--I'd encourage you play with Marpa for a couple of hours to see if it works well for you.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

  • Comment on Re^11: Block-structured language parsing using a Perl module?

Replies are listed 'Best First'.
Re^12: Block-structured language parsing using a Perl module?
by BrowserUk (Patriarch) on Jul 20, 2013 at 21:12 UTC
    I don't know if you've been following Marpa::R2, but they've been going in the direction of putting tokenizer rules in the grammar, and it looks rather good.

    No, I haven't. From my brief interactions with the author I had no expectation that Marpa would ever change in any way that would cause me to reconsider it.

    From a cursory scan of the R2 docs it does seem that somewhere amongst the close to 2 dozen modules that make it up there might be something that starts to look like it might do the job. But, it is really hard to tell given that the two examples are:

    • an expression parser that uses about the same number of source lines as I did for my 6 function/3 precedence level expression parser -- on top of those 2 dozens modules -- to provide a 2 function/1 precedence level expression parser.
    • The other deals with one of those completely pointless, meaningless, "languages" that does absolutely nothing, that parser theorists are so enamored of.

    If I ever find a working example of a block-structured language done using Marpa, I might look again; but I won't hold my breath.

    Unfortunately, the documentation doesn't seem to have improved. It still spends an inordinate amount of time telling me haw clever the parser is; and almost none showing me how to use it to do something realistic and useful.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.