Fix tutorial document link

This commit is contained in:
HyeockJinKim 2020-02-21 15:03:20 +09:00
parent 40e1c57dad
commit df662e6ddb
9 changed files with 30 additions and 28 deletions

View File

@ -321,6 +321,6 @@ match {
And now any reference in your grammar to `"BEGIN"` will actually match And now any reference in your grammar to `"BEGIN"` will actually match
any capitalization. any capitalization.
[lexer tutorial]: lexer_tutorial/index.html [lexer tutorial]: index.md
[calculator2b]: calculator/src/calculator2b.lalrpop [calculator2b]: ../../calculator/src/calculator2b.lalrpop
[calculator3]: calculator/src/calculator3.lalrpop [calculator3]: ../../calculator/src/calculator3.lalrpop

View File

@ -1,5 +1,5 @@
For getting started with LALRPOP, it's probably best if you read 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. to the syntax of LALRPOP files and so forth.
But if you've done this before, or you're just the impatient sort, 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. That's it! Note that `process_root` simply uses the default settings.
If you want to configure how LALRPOP executes, see the If you want to configure how LALRPOP executes, see the
[advanced setup](advanced_setup.html) section. [advanced setup](advanced_setup.md) section.
#### Running manually #### Running manually

View File

@ -17,10 +17,12 @@ To start, let's use `cargo new` to make a new project. We'll call it
> cargo new --bin calculator > 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 file to invoke the LALRPOP preprocessor. The resulting file should
look something like: look something like:
[calculator-Cargo.toml]: ../../calculator/Cargo.toml
``` ```
[package] [package]
name = "calculator" 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 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].) hand and use it with LALRPOP, then check out the [lexer tutorial].)
[the next section]: tutorial/002_paren_numbers.html [the next section]: 002_paren_numbers.md
[lexer tutorial]: lexer_tutorial/index.html [lexer tutorial]: ../lexer_tutorial/index.md
Next we have to add `build.rs` itself. This should just look like the Next we have to add `build.rs` itself. This should just look like the
following: following:

View File

@ -129,5 +129,5 @@ fn parse<'input>(&self, input: &'input str)
} }
``` ```
[calculator1]: calculator/src/calculator1.lalrpop [calculator1]: ../../calculator/src/calculator1.lalrpop
[main]: calculator/src/main.rs [main]: ../../calculator/src/main.rs

View File

@ -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 {...}` in examples above). This works out well if the names of your
parsed values match the names of your struct fields. parsed values match the names of your struct fields.
[calculator1]: calculator/src/calculator1.lalrpop [calculator1]: ../../calculator/src/calculator1.lalrpop
[calculator2]: calculator/src/calculator2.lalrpop [calculator2]: ../../calculator/src/calculator2.lalrpop

View File

@ -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 This is the purpose of the tiers: to force the parser into the
precedence you want. precedence you want.
[calculator3]: calculator/src/calculator3.lalrpop [calculator3]: ../../calculator/src/calculator3.lalrpop

View File

@ -100,6 +100,6 @@ fn calculator4() {
} }
``` ```
[main]: calculator/src/main.rs [main]: ../../calculator/src/main.rs
[calculator4]: calculator/src/calculator4.lalrpop [calculator4]: ../../calculator/src/calculator4.lalrpop
[astrs]: calculator/src/ast.rs [astrs]: ../../calculator/src/ast.rs

View File

@ -134,6 +134,6 @@ fn calculator5() {
} }
``` ```
[main]: calculator/src/main.rs [main]: ../../calculator/src/main.rs
[calculator4]: calculator/src/calculator4.lalrpop [calculator4]: ../../calculator/src/calculator4.lalrpop
[calculator5]: calculator/src/calculator5.lalrpop [calculator5]: ../../calculator/src/calculator5.lalrpop

View File

@ -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] If you are unfamiliar with what a parser generator is, you should read [Crash course on parsers]
first. first.
- [Adding LALRPOP to your project](001_adding_lalrpop.html) - [Adding LALRPOP to your project](001_adding_lalrpop.md)
- [Parsing parenthesized numbers](002_paren_numbers.html) - [Parsing parenthesized numbers](002_paren_numbers.md)
- [Type inference](003_type_inference.html) - [Type inference](003_type_inference.md)
- [Handling full expressions](004_full_expressions.html) - [Handling full expressions](004_full_expressions.md)
- [Building ASTs](005_building_asts.html) - [Building ASTs](005_building_asts.md)
- [Macros](006_macros.html) - [Macros](006_macros.md)
- [Error recovery](007_error_recovery.html) - [Error recovery](007_error_recovery.md)
- [Passing state parameter](008_state_parameter.html) - [Passing state parameter](008_state_parameter.md)
This tutorial is still incomplete. Here are some topics that I aim to This tutorial is still incomplete. Here are some topics that I aim to
cover when I get time to write about them: 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]). - 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 - 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 [from here]: https://github.com/lalrpop/lalrpop/blob/master/lalrpop-test/src/main.rs