mirror of
https://github.com/fluencelabs/lalrpop
synced 2025-03-16 17:00:53 +00:00
Merge pull request #505 from HyeockJinKim/fix-link
Fix tutorial document link
This commit is contained in:
commit
de3360c0ee
@ -321,6 +321,6 @@ match {
|
||||
And now any reference in your grammar to `"BEGIN"` will actually match
|
||||
any capitalization.
|
||||
|
||||
[lexer tutorial]: lexer_tutorial/index.html
|
||||
[calculator2b]: calculator/src/calculator2b.lalrpop
|
||||
[calculator3]: calculator/src/calculator3.lalrpop
|
||||
[lexer tutorial]: index.md
|
||||
[calculator2b]: ../../calculator/src/calculator2b.lalrpop
|
||||
[calculator3]: ../../calculator/src/calculator3.lalrpop
|
||||
|
@ -1,5 +1,5 @@
|
||||
For getting started with LALRPOP, it's probably best if you read
|
||||
[the tutorial](tutorial/index.html), which will introduce you
|
||||
[the tutorial](tutorial/index.md), which will introduce you
|
||||
to the syntax of LALRPOP files and so forth.
|
||||
|
||||
But if you've done this before, or you're just the impatient sort,
|
||||
@ -41,7 +41,7 @@ call `process_root` in addition to whatever else that file is doing.)
|
||||
|
||||
That's it! Note that `process_root` simply uses the default settings.
|
||||
If you want to configure how LALRPOP executes, see the
|
||||
[advanced setup](advanced_setup.html) section.
|
||||
[advanced setup](advanced_setup.md) section.
|
||||
|
||||
#### Running manually
|
||||
|
||||
|
@ -17,10 +17,12 @@ To start, let's use `cargo new` to make a new project. We'll call it
|
||||
> cargo new --bin calculator
|
||||
```
|
||||
|
||||
We now have to edit the generated [`calculator/Cargo.toml`](calculator/Cargo.toml)
|
||||
We now have to edit the generated [`calculator/Cargo.toml`][calculator-Cargo.toml]
|
||||
file to invoke the LALRPOP preprocessor. The resulting file should
|
||||
look something like:
|
||||
|
||||
[calculator-Cargo.toml]: ../../calculator/Cargo.toml
|
||||
|
||||
```
|
||||
[package]
|
||||
name = "calculator"
|
||||
@ -51,8 +53,8 @@ now, though we will cover it in [the next section]; if you *do*
|
||||
know what a lexer is, and you want to know how to write a lexer by
|
||||
hand and use it with LALRPOP, then check out the [lexer tutorial].)
|
||||
|
||||
[the next section]: tutorial/002_paren_numbers.html
|
||||
[lexer tutorial]: lexer_tutorial/index.html
|
||||
[the next section]: 002_paren_numbers.md
|
||||
[lexer tutorial]: ../lexer_tutorial/index.md
|
||||
|
||||
Next we have to add `build.rs` itself. This should just look like the
|
||||
following:
|
||||
|
@ -129,5 +129,5 @@ fn parse<'input>(&self, input: &'input str)
|
||||
}
|
||||
```
|
||||
|
||||
[calculator1]: calculator/src/calculator1.lalrpop
|
||||
[main]: calculator/src/main.rs
|
||||
[calculator1]: ../../calculator/src/calculator1.lalrpop
|
||||
[main]: ../../calculator/src/main.rs
|
||||
|
@ -86,5 +86,5 @@ The `<>` expressions also works with struct constructors (like `Foo
|
||||
{...}` in examples above). This works out well if the names of your
|
||||
parsed values match the names of your struct fields.
|
||||
|
||||
[calculator1]: calculator/src/calculator1.lalrpop
|
||||
[calculator2]: calculator/src/calculator2.lalrpop
|
||||
[calculator1]: ../../calculator/src/calculator1.lalrpop
|
||||
[calculator2]: ../../calculator/src/calculator2.lalrpop
|
||||
|
@ -70,4 +70,4 @@ impossible: a `Factor` cannot have an `Expr` as its left-hand side.
|
||||
This is the purpose of the tiers: to force the parser into the
|
||||
precedence you want.
|
||||
|
||||
[calculator3]: calculator/src/calculator3.lalrpop
|
||||
[calculator3]: ../../calculator/src/calculator3.lalrpop
|
||||
|
@ -100,6 +100,6 @@ fn calculator4() {
|
||||
}
|
||||
```
|
||||
|
||||
[main]: calculator/src/main.rs
|
||||
[calculator4]: calculator/src/calculator4.lalrpop
|
||||
[astrs]: calculator/src/ast.rs
|
||||
[main]: ../../calculator/src/main.rs
|
||||
[calculator4]: ../../calculator/src/calculator4.lalrpop
|
||||
[astrs]: ../../calculator/src/ast.rs
|
||||
|
@ -134,6 +134,6 @@ fn calculator5() {
|
||||
}
|
||||
```
|
||||
|
||||
[main]: calculator/src/main.rs
|
||||
[calculator4]: calculator/src/calculator4.lalrpop
|
||||
[calculator5]: calculator/src/calculator5.lalrpop
|
||||
[main]: ../../calculator/src/main.rs
|
||||
[calculator4]: ../../calculator/src/calculator4.lalrpop
|
||||
[calculator5]: ../../calculator/src/calculator5.lalrpop
|
||||
|
@ -3,14 +3,14 @@ This is a tutorial for how to write a complete parser for a simple calculator us
|
||||
If you are unfamiliar with what a parser generator is, you should read [Crash course on parsers]
|
||||
first.
|
||||
|
||||
- [Adding LALRPOP to your project](001_adding_lalrpop.html)
|
||||
- [Parsing parenthesized numbers](002_paren_numbers.html)
|
||||
- [Type inference](003_type_inference.html)
|
||||
- [Handling full expressions](004_full_expressions.html)
|
||||
- [Building ASTs](005_building_asts.html)
|
||||
- [Macros](006_macros.html)
|
||||
- [Error recovery](007_error_recovery.html)
|
||||
- [Passing state parameter](008_state_parameter.html)
|
||||
- [Adding LALRPOP to your project](001_adding_lalrpop.md)
|
||||
- [Parsing parenthesized numbers](002_paren_numbers.md)
|
||||
- [Type inference](003_type_inference.md)
|
||||
- [Handling full expressions](004_full_expressions.md)
|
||||
- [Building ASTs](005_building_asts.md)
|
||||
- [Macros](006_macros.md)
|
||||
- [Error recovery](007_error_recovery.md)
|
||||
- [Passing state parameter](008_state_parameter.md)
|
||||
|
||||
This tutorial is still incomplete. Here are some topics that I aim to
|
||||
cover when I get time to write about them:
|
||||
@ -24,5 +24,5 @@ cover when I get time to write about them:
|
||||
- Converting to use `LALR(1)` instead of `LR(1)` (see e.g. [this test](https://github.com/lalrpop/lalrpop/blob/master/lalrpop-test/src/expr_lalr.lalrpop) invoked [from here]).
|
||||
- Plans for future features
|
||||
|
||||
[Crash course on parsers]: crash_course.html
|
||||
[Crash course on parsers]: ../crash_course.md
|
||||
[from here]: https://github.com/lalrpop/lalrpop/blob/master/lalrpop-test/src/main.rs
|
||||
|
Loading…
x
Reference in New Issue
Block a user