This repository contains the source code files of a simple PDML parser written in Java.
The parser supports Core PDML, and the following PDML extensions:
There are no dependencies.
This parser reads input from a standard Java character input stream (file, string, STDIN, Java Reader
, etc.) and produces a PDML AST.
The AST can then be explored, modified, or transformed in your application.
List the node names in a PDML document:
PdmlParser parser = new PdmlParser();
RootNode rootNode = parser.parseString ( """
[doc
text
[child1 text child 1]
[child2 text child 2]
]""" );
NodeUtils.forEachNodeInTree ( rootNode, node -> {
if ( node instanceof RootOrBranchNode branchNode ) {
System.out.println ( branchNode.getName() );
}
});
Output:
doc
child1
child2
- API Javadoc
- PDML website.
- Full PDML implementation (supports all PDML extensions)