com-lihaoyi / fastparse

Writing Fast Parsers Fast in Scala
https://com-lihaoyi.github.io/fastparse
MIT License
1.09k stars 164 forks source link

FastParse Build Status Join the chat at https://gitter.im/lihaoyi/Ammonite

This is where the code for the FastParse parsing library lives! If you want to use Fastparse, you probably will want to check out the documentation:

If you use FastParse and like it, you will probably enjoy the following book by the Author:

Hands-on Scala has uses FastParse extensively throughout the book, with the entirety of Chapter 19: Parsing Structured Text dedicated to the library and Chapter 20: Implementing a Programming Language making heavy use of it. Hands-on Scala is a great way to level up your skills in Scala in general and FastParse in particular.

For a good hands-on tutorial working through the basics of how to use this library, check out the following blog post:

The following post gives a good overview of the design of FastParse:

This readme contains some developer docs, if you intend on working on the fastparse repo, not just using it as a library.

Developer Docs

The core of FastParse lives in the fastparse/ folder. It is cross-built ScalaJVM/Scala.js codebase, with almost everything shared between the two platforms in the fastparse/src/ and minor differences in fastparse/src-js/ and fastparse/src-jvm/.

The three subprojects scalaparse/, pythonparse/ and cssparse/ are FastParse parsers for those respective languages. These are both usable as standalone libraries, and also serve as extensive test-suites and use-cases for FastParse itself. Each of those projects clones & parses large quantities of code from Github as part of their own test suites.

perftests/ constains performance tests for main projects in the library including ScalaParse, PythonParse, CssParse, readme/ contains the documentation site, which contains several live demos of FastParse parsers compiled to Scala.js. These all live in demo/.

Common Commands

Note: you should use mill 0.11 or later.

Contribution Guidelines

License

The MIT License (MIT)

Copyright (c) 2014 Li Haoyi (haoyi.sg@gmail.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.