Package org.pegdown.ast

Examples of org.pegdown.ast.Node


      return Sequence(
          '/',
          OneOrMore(TestNot('/'),
                TestNot(AnyOf(stop)),
                ANY),
          peek(0).addChild(new Node(match()))
      );
    }
View Full Code Here


      );
    }
   
    Rule Path(String stop) {
      return Sequence(
          push(new Node()),
          OneOrMore(PathSegment(stop))
      );
    }
View Full Code Here

    }

    Rule EmphOrStrong(String chars) {
        return Sequence(
                EmphOrStrongOpen(chars),
                push(new Node()),
                OneOrMore(
                        TestNot(EmphOrStrongClose(chars)), TestNot(Newline()),
                        Inline(), peek(1).addChild(pop())
                ),
                EmphOrStrongClose(chars)
View Full Code Here

    }

    Rule Label() {
        return Sequence(
                '[',
                push(new Node()),
                OneOrMore(TestNot(']'), Inline(), peek(1).addChild(pop())),
                ']'
        );
    }
View Full Code Here

    Rule Line() {
        StringVar line = new StringVar();
        return Sequence(
                ZeroOrMore(TestNot('\r'), TestNot('\n'), ANY), line.set(match() + '\n'),
                Newline(),
                push(new Node(line.get()))
        );
    }
View Full Code Here

        );
    }

    Rule AbbreviationText(Var<AbbreviationNode> node) {
        return Sequence(
                node.get().setExpansion(new Node()),
                ZeroOrMore(TestNot(Newline()), Inline(), node.get().getExpansion().addChild(pop()))
        );
    }
View Full Code Here

    public Printer printChildren(Node node) {
        StringBuilder localSB = new StringBuilder();
        List<Node> children = node.getChildren();
        for (int i = 0, childrenSize = children.size(); i < childrenSize; i++) {
            Node child = children.get(i);
            if (child instanceof TextNode) {
                localSB.append(child.getText());
            } else {
                if (localSB.length() > 0) {
                    printWithAbbreviations(localSB.toString());
                    localSB.setLength(0);
                }
                child.print(this);
            }
        }
        if (localSB.length() > 0) printWithAbbreviations(localSB.toString());
        return this;
    }
View Full Code Here

            RootNode rootNode = PEGDOWN_PROCESSOR.parseMarkdown( text.toCharArray() );
            if ( !haveTitle && rootNode.getChildren().size() > 0 )
            {
                // use the first (non-comment) node only if it is a heading
                int i = 0;
                Node firstNode = null;
                while ( i < rootNode.getChildren().size() && isHtmlComment(
                    ( firstNode = rootNode.getChildren().get( i ) ) ) )
                {
                    i++;
                }
View Full Code Here

TOP

Related Classes of org.pegdown.ast.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.