GithubHelp home page GithubHelp logo

qdrk / papa-carlo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eliah-lakhin/papa-carlo

0.0 2.0 0.0 2.47 MB

Constructor of incremental parsers in Scala

Home Page: http://lakhin.com/projects/papa-carlo/

License: Apache License 2.0

papa-carlo's Introduction

What is "incremental parser"?

Papa Carlo is the first Scala parsing library utilises incremental parsing approach.

An incremental parser is one that can recompile only those portions of a program that have been modified. Ordinary parsers must process entire source code file.

Therefore, when the end user makes small and frequent changes in the source code, an incremental parser indexes them immediately, without any significant time delays. Even if the program consists of thousands lines of code.

This property is very important in development of programming language analysis tools such as Integrated Development Environments that managing codebase in real time.

See the Demo Webapp of the incremental JSON parser based on Papa Carlo.

Incremental parser workflow illustration

Typical use cases of incremental parser

  • Language support plugins for code editors. For example full-featured Java IDE based on Sublime Text or VIM.
  • Realtime code analysis tools. Imaging smart semantic Diff!
  • Incremental compilers.
  • Client-server compilation environment.

Papa Carlo features

  • Syntax definition directly in the Scala code using library's API.
  • Resulting parser builds and incrementally updates Abstract Syntax Tree.
  • Error-recovery mechanism. The parser can build Parse Tree even if the source code contains syntax errors.
  • Recursive descent parsing based on PEG grammars.
  • Expressions parsing with Pratt algorithm and prepared primitives.

Documentation

There is detailed tutorial on the project's website: http://lakhin.com/projects/papa-carlo/.

The tutorial is generated based mostly on materials from the wiki. The wiki is open for read/write access to everyone. And contribution is very welcome!

Users support forum: https://groups.google.com/forum/#!forum/papa-carlo.

Example parsers
Another links

If you have a project, or an article, or link to discussion related to the topic, please bring me a line to: eliah.lakhin [at] gmail.com. Or start a topic on the Forum. I will be glad to include it on the list.

Development status

Current version of the library is 0.7.0. The project is in Beta stage. All planned features are done and ready to use. Source code is covered by a number of functional tests.

I use Semantic Version policy v. 2.0 in naming project's versions. So the first stable release version will be "1.0.0".

Please see change log for details: CHANGES

JAR artifacts

Build from sources
  1. Install SBT. Version 0.13.0 is preferable.
  2. Run sbt jvm/test to compile and run tests.
  3. Run sbt jvm/packageBin to build JAR package. The JAR package can be found in the ./jvm/target/ directory.
  4. Run sbt js-demo/optimizeJS to build JavaScript demo using Scala-JS compiler. To start demo run static http web server with ./js/demo/ as a root.

License

Please read LICENSE for licensing details.

Author

Ilya Lakhin (Илья Александрович Лахин), eliah.lakhin [at] gmail.com

papa-carlo's People

Contributors

eliah-lakhin avatar alexander-myltsev avatar

Watchers

fpvsim avatar  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.