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.
- 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.
- 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.
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.
- Introduction blog post.
- Discussion on Reddit.
- Introduction article on Habrahabr in Russian.
- Approach brief description on Lambda the Ultimate.
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.
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
- Release artifacts on Maven Central: http://central.maven.org/maven2/name/lakhin/eliah/projects/papacarlo/
- Snapshot and release artifacts on Sonatype: http://oss.sonatype.org/content/groups/public/name/lakhin/eliah/projects/papacarlo/
- Install SBT. Version 0.13.0 is preferable.
- Run
sbt jvm/test
to compile and run tests. - Run
sbt jvm/packageBin
to build JAR package. The JAR package can be found in the./jvm/target/
directory. - 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.
Please read LICENSE for licensing details.
Ilya Lakhin (Илья Александрович Лахин), eliah.lakhin [at] gmail.com