Administrator
|
On Thu, Apr 2, 2015 at 11:35 AM, sdaschner [via Asciidoctor :: Discussion] <[hidden email]> wrote: So a "native"-Java solution would be the best IMO. Absolutely. Though, the original goal is getting from not having a formal grammar (esp for inline parsing) to having a formal grammar. Once we get that ironed out, I imagine it will spawn many efforts to parse that grammar in different environments (including a replacement of the inline parsing in Asciidoctor Ruby). By no means does this choice for the prototype lock us in to a particular runtime. In addition to ANTLR, I like the idea of something in Groovy. Perhaps we can even use ANTLR from Groovy in the prototype. Groovy is a much easier language to use for prototyping than Java. At the very least, the tests should be in Groovy (perhaps using Spock). If we decide to use a library based on Scala, we may still be able to use it from another JVM language like Groovy. Or, we'll learn Scala if necessary. I'd say we should probably move forward with at least a project that has ANTLR setup and maybe we'll add other libraries as we go along. I can setup the project this weekend or next week. If someone wants to do it before them, please feel free to jump in. I'd like to have something that uses a Gradle build, ANTLR (to start) and a test suite with Spock. Sound like a plan? |
It does! So when will the asciidoctor-grammar Github project roughly be online? |
Administrator
|
On Thu, Apr 2, 2015 at 12:29 PM, sdaschner [via Asciidoctor :: Discussion] <[hidden email]> wrote: So when will the asciidoctor-grammar Github project roughly be online? I'll go ahead and setup the blank project today. Let's call it asciidoctor-grammar-prototype for now to reflect that its state. Voila! The next step will be for someone to send a pull request with the base project. If no one gets to it before the weekend, I'll try to get it done (in time for Devoxx France especially). We should probably start with a README that explains what this effort is about and our goals. Cheers, |
Administrator
|
In reply to this post by sdaschner
FYI, there is now a lexer underway in the IntelliJ plugin that includes a grammar. -Dan On Thu, Apr 2, 2015 at 4:42 AM, Dan Allen <[hidden email]> wrote:
Dan Allen | http://google.com/profiles/dan.j.allen |
In reply to this post by sdaschner
+1
|
What do you think is the best approach to move this forward?
As the Asciidoctor Grammar Github project has been setup, shouldn't this be the leading role for grammar definitions? Also a small test example (with the Groovy / Spock-Framework) would be a good thing IMO; I started hacking on the Grammar project, but had issues testing the resulted ANTLR class :-( |
I too started hacking this a month ago but I was overwhelmed by the complexity of the grammar and antlr itself. Right now I'm reading "The definitive Antlr4 reference" and it helps a lot.
If you want some examples, I "polished" the project and create a POC grammar, a helper class for testing and a simple spock test in my repo: https://github.com/abelsromero/asciidoc-grammar-prototype/tree/master/src/test Hope it helps, and feel free to copy any code you like. |
Wow Abel, this is a really awesome effort to make this grammar a reality. Maybe we could move this to official repo as standard point.
|
Cool, your AntlrParser util is exactly what I've been looking for :-)
Thanks Abel! |
Glad it helps.
Also there's a task in the gradle.build to download README AsciiDoc files form GitHub for testing, check 'downloadMultipleFiles '. |
Administrator
|
Please feel free to move forward with this work by moving it into the upstream (via a PR). Since there's nothing there yet, there's no concern of clashing with an existing effort. What's important is that we start making incremental progress on this so that we can start to get into the conversations about what makes AsciiDoc more parsable. I'll be happy to jump in and lend a hand and review. Cheers, -Dan On Thu, Jul 30, 2015 at 3:39 AM, abelsromero [via Asciidoctor :: Discussion] <[hidden email]> wrote: Glad it helps. Dan Allen | http://google.com/profiles/dan.j.allen |
The PR is in place https://github.com/asciidoctor/asciidoc-grammar-prototype/pull/4.
Who has permissions to merge on this repo? |
Administrator
|
Thanks Abel! I've given you and Jakub admin access, so merge at will. Cheers, -Dan On Mon, Aug 3, 2015 at 1:08 AM, abelsromero [via Asciidoctor :: Discussion] <[hidden email]> wrote: The PR is in place https://github.com/asciidoctor/asciidoc-grammar-prototype/pull/4. Dan Allen | http://google.com/profiles/dan.j.allen |
In reply to this post by mojavelinux
Is an Antlr parser still under consideration?
Here's a take on a parser that uses multiple lexer modes to break down the complexity (just does title/author/attributes, no preamble, section 1 /title paragraphs --- a proof of concept). https://github.com/venkatperi/asciidoc-antlr Clone the project and run:
$ git clone https://github.com/venkatperi/asciidoc-antlr
|
Free forum by Nabble | Edit this page |