update cargo.toml files, readme

This commit is contained in:
Niko Matsakis 2015-07-26 07:49:45 -04:00
parent 9818f17a76
commit d8a47a7345
6 changed files with 58 additions and 13 deletions

View File

@ -22,7 +22,45 @@ LALRPop has a number of nifty features:
time. time.
4. Type inference so you can often omit the types of nonterminals etc. 4. Type inference so you can often omit the types of nonterminals etc.
To be clear, LALRPop is barely functional. It's kind of spare time To be clear, LALRPop is still early days. It's kind of spare time
project. But it's coming along pretty quickly, now that a lot of the project. But it's coming along pretty quickly, now that a lot of the
tricky stuff is out of the way. I'll update this README more with tricky stuff is out of the way. I'll update this README more with
better instructions soon. better instructions soon.
## Instructions for use
LALRPOP integrates with cargo to preprocess files with the extension
`lalrpop`. It will convert `foo.lalrpop` into `foo.rs` before your
project builds. This will be a valid Rust module with one `parse_XXX`
function per public symbol. For now, the documentation is spare; the
best models to use are the test files in `lalrpop-test`.
To enable LALRPOP, add the following lines to your `Cargo.toml`:
```
[package]
...
build = "build.rs" # LALRPOP preprocessing
# Add a dependency on the LALRPOP runtime library:
[dependencies.lalrpop-util]
version = "0.1"
[build-dependencies.lalrpop]
version = "0.1"
```
And create a `build.rs` file that looks like:
```rust
extern crate lalrpop;
fn main() {
lalrpop::process_root().unwrap();
}
```
(If you already have a `build.rs` file, you should be able to just
call `process_root` in addition to whatever else that file is doing.)
That's it!

View File

@ -1,6 +1,9 @@
[package] [package]
name = "lalrpop-snap" name = "lalrpop-snap"
version = "0.1.0" version = "0.1.0" # LALRPOP
description = "snapshot of LALRPOP for use in bootstrapping"
repository = "https://github.com/nikomatsakis/lalrpop"
license = "Unlicense"
authors = ["Niko Matsakis <niko@alum.mit.edu>"] authors = ["Niko Matsakis <niko@alum.mit.edu>"]
# build = "build.rs" # build = "build.rs"
@ -11,9 +14,8 @@ rand = "0.3"
itertools = "0.3" itertools = "0.3"
term = "0.2" term = "0.2"
unicode-xid = "0.0.2" unicode-xid = "0.0.2"
rusty-peg = "0.3"
[dependencies.rusty-peg]
git = "https://github.com/nikomatsakis/rusty-peg.git"
[dependencies.lalrpop-util] [dependencies.lalrpop-util]
path = "../lalrpop-util" path = "../lalrpop-util"
version = "0.1.0" # LALRPOP

View File

@ -1,6 +1,6 @@
[package] [package]
name = "lalrpop-test" name = "lalrpop-test"
version = "0.1.0" version = "0.1.0" # LALRPOP
authors = ["Niko Matsakis <niko@alum.mit.edu>"] authors = ["Niko Matsakis <niko@alum.mit.edu>"]
build = "build.rs" build = "build.rs"

View File

@ -1,4 +1,7 @@
[package] [package]
name = "lalrpop-util" name = "lalrpop-util"
version = "0.1.0" description = "Runtime library for parsers generated by LALRPOP"
repository = "https://github.com/nikomatsakis/lalrpop"
license = "Unlicense"
version = "0.1.0" # LALRPOP
authors = ["Niko Matsakis <niko@alum.mit.edu>"] authors = ["Niko Matsakis <niko@alum.mit.edu>"]

View File

@ -1,6 +1,11 @@
[package] [package]
name = "lalrpop" name = "lalrpop"
version = "0.1.0" version = "0.1.0" # LALRPOP
description = "convenient LR(1) parser generator"
repository = "https://github.com/nikomatsakis/lalrpop"
readme = "../README.md"
keywords = ["parser", "generator", "LR", "yacc", "grammar"]
license = "Unlicense"
authors = ["Niko Matsakis <niko@alum.mit.edu>"] authors = ["Niko Matsakis <niko@alum.mit.edu>"]
build = "build.rs" build = "build.rs"
@ -12,11 +17,10 @@ itertools = "0.3"
term = "0.2" term = "0.2"
unicode-xid = "0.0.2" unicode-xid = "0.0.2"
[dependencies.rusty-peg]
git = "https://github.com/nikomatsakis/rusty-peg.git"
[dependencies.lalrpop-util] [dependencies.lalrpop-util]
path = "../lalrpop-util" path = "../lalrpop-util"
version = "0.1.0" # LALRPOP
[build-dependencies.lalrpop-snap] [build-dependencies.lalrpop-snap]
path = "../lalrpop-snap" path = "../lalrpop-snap"
version = "0.1.0" # LALRPOP

View File

@ -8,8 +8,6 @@
// too darn annoying to try and make them do so. // too darn annoying to try and make them do so.
#![cfg_attr(test, allow(dead_code))] #![cfg_attr(test, allow(dead_code))]
#[macro_use]
extern crate rusty_peg;
extern crate diff; extern crate diff;
extern crate lalrpop_util; extern crate lalrpop_util;
extern crate rand; extern crate rand;