org.pegdown
Class Parser

java.lang.Object
  extended by org.parboiled.BaseActions<V>
      extended by org.parboiled.BaseParser<java.lang.Object>
          extended by org.pegdown.Parser
All Implemented Interfaces:
org.parboiled.ContextAware<java.lang.Object>, Extensions

public class Parser
extends org.parboiled.BaseParser<java.lang.Object>
implements Extensions

Parboiled parser for the standard and extended markdown syntax. Builds an Abstract Syntax Tree (AST) of Node objects.


Nested Class Summary
static interface Parser.ParseRunnerProvider
           
protected static interface Parser.SuperNodeCreator
           
 
Field Summary
protected static char CROSSED_OUT
           
protected static java.lang.String[] HTML_TAGS
           
protected  int options
           
protected  Parser.ParseRunnerProvider parseRunnerProvider
           
 
Fields inherited from class org.parboiled.BaseParser
ANY, DEDENT, EMPTY, EOI, INDENT, NOTHING
 
Fields inherited from interface org.pegdown.Extensions
ABBREVIATIONS, ALL, AUTOLINKS, DEFINITIONS, FENCED_CODE_BLOCKS, HARDWRAPS, NONE, QUOTES, SMARTS, SMARTYPANTS, SUPPRESS_ALL_HTML, SUPPRESS_HTML_BLOCKS, SUPPRESS_INLINE_HTML, TABLES, WIKILINKS
 
Constructor Summary
Parser(java.lang.Integer options)
           
Parser(java.lang.Integer options, Parser.ParseRunnerProvider parseRunnerProvider)
           
 
Method Summary
 org.parboiled.Rule Abbreviation()
           
 org.parboiled.Rule AbbreviationText(org.parboiled.support.Var<AbbreviationNode> node)
           
 boolean addAsChild()
           
 org.parboiled.Rule Alphanumeric()
           
 org.parboiled.Rule AtxHeading()
           
 org.parboiled.Rule AtxInline()
           
 org.parboiled.Rule AtxStart()
           
 org.parboiled.Rule AutoLink()
           
 org.parboiled.Rule AutoLinkEmail()
           
 org.parboiled.Rule AutoLinkEnd()
           
 org.parboiled.Rule AutoLinkUrl()
           
 org.parboiled.Rule BlankLine()
           
 org.parboiled.Rule Block()
           
 org.parboiled.Rule BlockQuote()
           
 org.parboiled.Rule Bullet()
           
 org.parboiled.Rule BulletList()
           
 org.parboiled.Rule CharEntity()
           
 org.parboiled.Rule CharLine(char c)
           
 org.parboiled.Rule Code()
           
 org.parboiled.Rule Code(org.parboiled.Rule ticks)
           
 org.parboiled.Rule CodeFence(org.parboiled.support.Var<java.lang.Integer> markerLength)
           
 org.parboiled.Rule CrossedOut(org.parboiled.Rule rule, org.parboiled.support.StringBuilderVar block)
           
 org.parboiled.Rule DecEntity()
           
 org.parboiled.Rule DefinedHtmlTagName(org.parboiled.support.StringVar tagName)
           
 org.parboiled.Rule Definition()
           
 org.parboiled.Rule DefinitionList()
           
 org.parboiled.Rule DefListBullet()
           
 org.parboiled.Rule DefListTerm()
           
 org.parboiled.Rule DefTermInline()
           
 org.parboiled.Rule Digit()
           
 org.parboiled.Rule DoubleAngleQuoted()
           
 org.parboiled.Rule DoubleIndentedBlocks(org.parboiled.support.StringBuilderVar block)
           
 org.parboiled.Rule DoubleQuoted()
           
 org.parboiled.Rule Emph()
           
 org.parboiled.Rule EmphOrStrong(java.lang.String chars)
           
 org.parboiled.Rule EmphOrStrongClose(java.lang.String chars)
           
 org.parboiled.Rule EmphOrStrongOpen(java.lang.String chars)
           
 org.parboiled.Rule Endline()
           
 org.parboiled.Rule Entity()
           
 org.parboiled.Rule Enumerator()
           
 org.parboiled.Rule EscapedChar()
           
 org.parboiled.Rule ExplicitLink(boolean image)
           
 boolean ext(int extension)
           
 org.parboiled.Rule FencedCodeBlock()
           
protected  void fixIndices(Node node, int[] ixMap)
           
 org.parboiled.Rule Heading()
           
 org.parboiled.Rule HexEntity()
           
 org.parboiled.Rule HorizontalRule()
           
 org.parboiled.Rule HorizontalRule(char c)
           
 org.parboiled.Rule HtmlAttribute()
           
 org.parboiled.Rule HtmlBlock()
           
 org.parboiled.Rule HtmlBlockClose(org.parboiled.support.StringVar tagName)
           
 org.parboiled.Rule HtmlBlockInTags()
           
 org.parboiled.Rule HtmlBlockOpen(org.parboiled.support.StringVar tagName)
           
 org.parboiled.Rule HtmlBlockSelfClosing()
           
 org.parboiled.Rule HtmlComment()
           
 org.parboiled.Rule HtmlTag()
           
 org.parboiled.Rule HtmlTagBlock(org.parboiled.support.StringVar tagName)
           
 org.parboiled.Rule Image()
           
 org.parboiled.Rule Indent()
           
 org.parboiled.Rule IndentedBlock(org.parboiled.support.StringBuilderVar block)
           
 org.parboiled.Rule Inline()
           
 org.parboiled.Rule InlineHtml()
           
 org.parboiled.Rule InlineOrIntermediateEndline()
           
 org.parboiled.Rule Inlines()
           
 boolean isHtmlTag(java.lang.String string)
           
 org.parboiled.Rule Label()
           
 org.parboiled.Rule Letter()
           
 org.parboiled.Rule Line(org.parboiled.support.StringBuilderVar sb)
           
 org.parboiled.Rule LineBreak()
           
 org.parboiled.Rule Link()
           
 org.parboiled.Rule LinkSource()
           
 org.parboiled.Rule LinkTitle()
           
 org.parboiled.Rule LinkTitle(char delimiter)
           
 org.parboiled.Rule ListItem(org.parboiled.Rule itemStart, Parser.SuperNodeCreator itemNodeCreator)
           
 org.parboiled.Rule Newline()
           
 org.parboiled.Rule NodeSequence(java.lang.Object... nodeRules)
           
 org.parboiled.Rule NonAutoLink()
           
 org.parboiled.Rule NonAutoLinkInline()
           
 org.parboiled.Rule NonindentSpace()
           
 org.parboiled.Rule NonLinkInline()
           
 org.parboiled.Rule Nonspacechar()
           
 org.parboiled.Rule NormalChar()
           
 org.parboiled.Rule NormalEndline()
           
 org.parboiled.Rule NOrMore(char c, int n)
           
 org.parboiled.Rule NotItem()
           
 org.parboiled.Rule NotNewline()
           
 org.parboiled.Rule OrderedList()
           
 org.parboiled.Rule Para()
           
 RootNode parse(char[] source)
           
 RootNode parseInternal(char[] source)
           
 RootNode parseInternal(org.parboiled.support.StringBuilderVar block)
           
 Node popAsNode()
           
 java.lang.String popAsString()
           
 org.parboiled.Rule Quoted()
           
 org.parboiled.Rule Reference()
           
 org.parboiled.Rule ReferenceLink(boolean image)
           
 org.parboiled.Rule RefSrc(org.parboiled.support.Var<ReferenceNode> ref)
           
 org.parboiled.Rule RefSrcContent(org.parboiled.support.Var<ReferenceNode> ref)
           
 org.parboiled.Rule RefTitle(char open, char close, org.parboiled.support.Var<ReferenceNode> ref)
           
 org.parboiled.Rule RefTitle(org.parboiled.support.Var<ReferenceNode> ref)
           
 org.parboiled.Rule Root()
           
 org.parboiled.Rule SetextHeading()
           
 org.parboiled.Rule SetextHeading1()
           
 org.parboiled.Rule SetextHeading2()
           
 org.parboiled.Rule SetextInline()
           
 boolean setIndices()
           
 org.parboiled.Rule SingleQuoted()
           
 org.parboiled.Rule SingleQuoteEnd()
           
 org.parboiled.Rule Smarts()
           
 org.parboiled.Rule Sp()
           
 org.parboiled.Rule Space()
           
 org.parboiled.Rule Spacechar()
           
 org.parboiled.Rule SpecialChar()
           
 org.parboiled.Rule Spn1()
           
 org.parboiled.Rule Str()
           
 org.parboiled.Rule Strong()
           
 org.parboiled.Rule StrongOrEmph()
           
 org.parboiled.Rule Symbol()
           
 org.parboiled.Rule Table()
           
 org.parboiled.Rule TableCell()
           
 org.parboiled.Rule TableColumn(org.parboiled.support.Var<TableNode> tableNode, org.parboiled.support.Var<java.lang.Boolean> pipeSeen)
           
 org.parboiled.Rule TableDivider(org.parboiled.support.Var<TableNode> tableNode)
           
 org.parboiled.Rule TableRow()
           
 org.parboiled.Rule TerminalEndline()
           
 org.parboiled.Rule Ticks(int count)
           
 org.parboiled.Rule UlOrStarLine()
           
 org.parboiled.Rule Verbatim()
           
 org.parboiled.Rule WikiLink()
           
 
Methods inherited from class org.parboiled.BaseParser
ACTION, AnyOf, AnyOf, AnyOf, Ch, CharRange, FirstOf, FirstOf, fromCharArray, fromCharLiteral, fromStringLiteral, IgnoreCase, IgnoreCase, IgnoreCase, newInstance, NoneOf, NoneOf, OneOrMore, OneOrMore, Optional, Optional, Sequence, Sequence, String, String, Test, Test, TestNot, TestNot, toRule, toRules, ZeroOrMore, ZeroOrMore
 
Methods inherited from class org.parboiled.BaseActions
currentChar, currentIndex, drop, drop, dup, getContext, hasError, inPredicate, match, matchedChar, matchEnd, matchLength, matchOrDefault, matchRange, matchStart, nodeSuppressed, peek, peek, poke, poke, pop, pop, position, push, push, pushAll, setContext, swap, swap3, swap4, swap5, swap6
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CROSSED_OUT

protected static final char CROSSED_OUT
See Also:
Constant Field Values

options

protected final int options

parseRunnerProvider

protected final Parser.ParseRunnerProvider parseRunnerProvider

HTML_TAGS

protected static final java.lang.String[] HTML_TAGS
Constructor Detail

Parser

public Parser(java.lang.Integer options)

Parser

public Parser(java.lang.Integer options,
              Parser.ParseRunnerProvider parseRunnerProvider)
Method Detail

parse

public RootNode parse(char[] source)

Root

public org.parboiled.Rule Root()

Block

public org.parboiled.Rule Block()

Para

public org.parboiled.Rule Para()

BlockQuote

public org.parboiled.Rule BlockQuote()

Verbatim

public org.parboiled.Rule Verbatim()

FencedCodeBlock

public org.parboiled.Rule FencedCodeBlock()

CodeFence

public org.parboiled.Rule CodeFence(org.parboiled.support.Var<java.lang.Integer> markerLength)

HorizontalRule

public org.parboiled.Rule HorizontalRule()

HorizontalRule

public org.parboiled.Rule HorizontalRule(char c)

Heading

public org.parboiled.Rule Heading()

AtxHeading

public org.parboiled.Rule AtxHeading()

AtxStart

public org.parboiled.Rule AtxStart()

AtxInline

public org.parboiled.Rule AtxInline()

SetextHeading

public org.parboiled.Rule SetextHeading()

SetextHeading1

public org.parboiled.Rule SetextHeading1()

SetextHeading2

public org.parboiled.Rule SetextHeading2()

SetextInline

public org.parboiled.Rule SetextInline()

DefinitionList

public org.parboiled.Rule DefinitionList()

DefListTerm

public org.parboiled.Rule DefListTerm()

DefTermInline

public org.parboiled.Rule DefTermInline()

Definition

public org.parboiled.Rule Definition()

DefListBullet

public org.parboiled.Rule DefListBullet()

BulletList

public org.parboiled.Rule BulletList()

OrderedList

public org.parboiled.Rule OrderedList()

ListItem

public org.parboiled.Rule ListItem(org.parboiled.Rule itemStart,
                                   Parser.SuperNodeCreator itemNodeCreator)

CrossedOut

public org.parboiled.Rule CrossedOut(org.parboiled.Rule rule,
                                     org.parboiled.support.StringBuilderVar block)

DoubleIndentedBlocks

public org.parboiled.Rule DoubleIndentedBlocks(org.parboiled.support.StringBuilderVar block)

IndentedBlock

public org.parboiled.Rule IndentedBlock(org.parboiled.support.StringBuilderVar block)

NotItem

public org.parboiled.Rule NotItem()

Enumerator

public org.parboiled.Rule Enumerator()

Bullet

public org.parboiled.Rule Bullet()

HtmlBlock

public org.parboiled.Rule HtmlBlock()

HtmlBlockInTags

public org.parboiled.Rule HtmlBlockInTags()

HtmlTagBlock

public org.parboiled.Rule HtmlTagBlock(org.parboiled.support.StringVar tagName)

HtmlBlockSelfClosing

public org.parboiled.Rule HtmlBlockSelfClosing()

HtmlBlockOpen

public org.parboiled.Rule HtmlBlockOpen(org.parboiled.support.StringVar tagName)

HtmlBlockClose

public org.parboiled.Rule HtmlBlockClose(org.parboiled.support.StringVar tagName)

DefinedHtmlTagName

public org.parboiled.Rule DefinedHtmlTagName(org.parboiled.support.StringVar tagName)

isHtmlTag

public boolean isHtmlTag(java.lang.String string)

Inlines

public org.parboiled.Rule Inlines()

InlineOrIntermediateEndline

public org.parboiled.Rule InlineOrIntermediateEndline()

Inline

public org.parboiled.Rule Inline()

NonAutoLinkInline

public org.parboiled.Rule NonAutoLinkInline()

NonLinkInline

public org.parboiled.Rule NonLinkInline()

Endline

public org.parboiled.Rule Endline()

LineBreak

public org.parboiled.Rule LineBreak()

TerminalEndline

public org.parboiled.Rule TerminalEndline()

NormalEndline

public org.parboiled.Rule NormalEndline()

UlOrStarLine

public org.parboiled.Rule UlOrStarLine()

CharLine

public org.parboiled.Rule CharLine(char c)

StrongOrEmph

public org.parboiled.Rule StrongOrEmph()

Emph

public org.parboiled.Rule Emph()

Strong

public org.parboiled.Rule Strong()

EmphOrStrong

public org.parboiled.Rule EmphOrStrong(java.lang.String chars)

EmphOrStrongOpen

public org.parboiled.Rule EmphOrStrongOpen(java.lang.String chars)

EmphOrStrongClose

public org.parboiled.Rule EmphOrStrongClose(java.lang.String chars)

Image

public org.parboiled.Rule Image()

Link

public org.parboiled.Rule Link()

NonAutoLink

public org.parboiled.Rule NonAutoLink()

ExplicitLink

public org.parboiled.Rule ExplicitLink(boolean image)

ReferenceLink

public org.parboiled.Rule ReferenceLink(boolean image)

LinkSource

public org.parboiled.Rule LinkSource()

LinkTitle

public org.parboiled.Rule LinkTitle()

LinkTitle

public org.parboiled.Rule LinkTitle(char delimiter)

AutoLink

public org.parboiled.Rule AutoLink()

WikiLink

public org.parboiled.Rule WikiLink()

AutoLinkUrl

public org.parboiled.Rule AutoLinkUrl()

AutoLinkEmail

public org.parboiled.Rule AutoLinkEmail()

AutoLinkEnd

public org.parboiled.Rule AutoLinkEnd()

Label

public org.parboiled.Rule Label()

Reference

public org.parboiled.Rule Reference()

RefSrc

public org.parboiled.Rule RefSrc(org.parboiled.support.Var<ReferenceNode> ref)

RefSrcContent

public org.parboiled.Rule RefSrcContent(org.parboiled.support.Var<ReferenceNode> ref)

RefTitle

public org.parboiled.Rule RefTitle(org.parboiled.support.Var<ReferenceNode> ref)

RefTitle

public org.parboiled.Rule RefTitle(char open,
                                   char close,
                                   org.parboiled.support.Var<ReferenceNode> ref)

Code

public org.parboiled.Rule Code()

Code

public org.parboiled.Rule Code(org.parboiled.Rule ticks)

Ticks

public org.parboiled.Rule Ticks(int count)

InlineHtml

public org.parboiled.Rule InlineHtml()

HtmlComment

public org.parboiled.Rule HtmlComment()

HtmlTag

public org.parboiled.Rule HtmlTag()

HtmlAttribute

public org.parboiled.Rule HtmlAttribute()

Quoted

public org.parboiled.Rule Quoted()

BlankLine

public org.parboiled.Rule BlankLine()

Line

public org.parboiled.Rule Line(org.parboiled.support.StringBuilderVar sb)

Entity

public org.parboiled.Rule Entity()

HexEntity

public org.parboiled.Rule HexEntity()

DecEntity

public org.parboiled.Rule DecEntity()

CharEntity

public org.parboiled.Rule CharEntity()

Str

public org.parboiled.Rule Str()

Space

public org.parboiled.Rule Space()

Spn1

public org.parboiled.Rule Spn1()

Sp

public org.parboiled.Rule Sp()

Spacechar

public org.parboiled.Rule Spacechar()

Nonspacechar

public org.parboiled.Rule Nonspacechar()

NormalChar

public org.parboiled.Rule NormalChar()

EscapedChar

public org.parboiled.Rule EscapedChar()

Symbol

public org.parboiled.Rule Symbol()

SpecialChar

public org.parboiled.Rule SpecialChar()

NotNewline

public org.parboiled.Rule NotNewline()

Newline

public org.parboiled.Rule Newline()

NonindentSpace

public org.parboiled.Rule NonindentSpace()

Indent

public org.parboiled.Rule Indent()

Alphanumeric

public org.parboiled.Rule Alphanumeric()

Letter

public org.parboiled.Rule Letter()

Digit

public org.parboiled.Rule Digit()

Abbreviation

public org.parboiled.Rule Abbreviation()

AbbreviationText

public org.parboiled.Rule AbbreviationText(org.parboiled.support.Var<AbbreviationNode> node)

Table

public org.parboiled.Rule Table()

TableDivider

public org.parboiled.Rule TableDivider(org.parboiled.support.Var<TableNode> tableNode)

TableColumn

public org.parboiled.Rule TableColumn(org.parboiled.support.Var<TableNode> tableNode,
                                      org.parboiled.support.Var<java.lang.Boolean> pipeSeen)

TableRow

public org.parboiled.Rule TableRow()

TableCell

public org.parboiled.Rule TableCell()

Smarts

public org.parboiled.Rule Smarts()

SingleQuoted

public org.parboiled.Rule SingleQuoted()

SingleQuoteEnd

public org.parboiled.Rule SingleQuoteEnd()

DoubleQuoted

public org.parboiled.Rule DoubleQuoted()

DoubleAngleQuoted

public org.parboiled.Rule DoubleAngleQuoted()

NOrMore

public org.parboiled.Rule NOrMore(char c,
                                  int n)

NodeSequence

public org.parboiled.Rule NodeSequence(java.lang.Object... nodeRules)

setIndices

public boolean setIndices()

addAsChild

public boolean addAsChild()

popAsNode

public Node popAsNode()

popAsString

public java.lang.String popAsString()

ext

public boolean ext(int extension)

parseInternal

public RootNode parseInternal(org.parboiled.support.StringBuilderVar block)

fixIndices

protected void fixIndices(Node node,
                          int[] ixMap)

parseInternal

public RootNode parseInternal(char[] source)