Plain Markdown support. Directory support.
* Upgraded build common to version 1.9. * Updated the release target in build.xml to take advantage of the new features of common build 1.9. The release target now copies over the libs and release resources. * JLPMain now recognises directories in it's input list. It will add all the files in a given directory to the input list (including files in abitrarily nested subdirectories). * Abstracted the parser behavior further. Processor no longer needs to know about Parboiled ParseRunners and can use non-Parboiled parsers. * Created the JLPParser interface to support the new parser abstraction. * JLPPegParser implements the new interface trivially by creating it's own parse runner and calling it with the input given. * Added MarkdownParser, which does not actually parse the file, just creates the bare-bones SourceFile object needed for the generator to emit the Markdown contents.
This commit is contained in:
@ -8,9 +8,10 @@ import org.parboiled.BaseParser;
|
||||
import org.parboiled.Context;
|
||||
import org.parboiled.Rule;
|
||||
import org.parboiled.annotations.*;
|
||||
import org.parboiled.parserunners.ReportingParseRunner;
|
||||
|
||||
@BuildParseTree
|
||||
public class JLPPegParser extends BaseParser<Object> {
|
||||
public class JLPPegParser extends BaseParser<Object> implements JLPParser {
|
||||
|
||||
int curLineNum = 1;
|
||||
|
||||
@ -31,6 +32,10 @@ public class JLPPegParser extends BaseParser<Object> {
|
||||
public JLPPegParser() {
|
||||
this("/**", "*/", "!#$%^&*()_-=+|;:'\",<>?~`", "///"); }
|
||||
|
||||
public SourceFile parse(String input) {
|
||||
ReportingParseRunner rpr = new ReportingParseRunner(this.SourceFile());
|
||||
return (SourceFile) rpr.run(input).resultValue; }
|
||||
|
||||
/**
|
||||
* Parses the rule:
|
||||
* SourceFile = (Block / DocBlock / CodeBlock)+
|
||||
|
Reference in New Issue
Block a user