More work on grammar, starting parboiled implementation.
This commit is contained in:
19
src/com/jdblabs/jlp/JLPPegParser.groovy
Normal file
19
src/com/jdblabs/jlp/JLPPegParser.groovy
Normal 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("%% "
|
||||
}
|
Reference in New Issue
Block a user