More work on grammar, starting parboiled implementation.

This commit is contained in:
Jonathan Bernard
2011-08-25 07:47:01 -05:00
parent 48eee1ca43
commit 303f8839fd
2 changed files with 31 additions and 6 deletions

View File

@ -0,0 +1,19 @@
package com.jdblabs.jlp
@BuildParseTree
public class JLPPegParser extends BaseParser<Object> {
Rule CodePage() {
return ZeroOrMore(FirstOf(
DocBlock(),
CodeBlock())) }
Rule DocBlock() {
return OneOrMore(FirstOf(
DirectiveBlock(),
MarkdownBlock())) }
Rule DirectiveBlock() {
return FirstOf(
Sequence("%% "
}