Giter Site home page Giter Site logo

simple-pdml-parser's Introduction

Simple PDML Parser Written in Java

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.

Overview

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.

Usage example

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

Useful links:

simple-pdml-parser's People

Contributors

pml-lang avatar

Stargazers

易文翰 avatar

Watchers

Christian Neumanns avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.