Skip to content

Commit

Permalink
docs: various smaller fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
igordejanovic committed Oct 25, 2023
1 parent 95e5ca7 commit 2b0fb7e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ Be sure to check [Rustemo book](https://igordejanovic.github.io/rustemo/)!
- [x] Disambiguation filters: priorities, associativities.
- [x] Rule/production meta-data. E.g. production kinds.
- [x] CLI and API. A `rcomp` compiler CLI is available that can be called on
Rustemo grammars. Also an API enables integrating parser compiling into
Rust `build.rs` scripts. See [the calculator
Rustemo grammars. Also, API enables integrating parser code generation
into Rust `build.rs` scripts. See [the calculator
example](./examples/calculator/) or [integration tests](./tests/).
- [x] Tracking of position and reporting error with line/column works.
- [x] Tracking of position and reporting error with line/column.
- [x] Support for a layout (comments, whitespaces given as CFG). It is
implemented as a special grammar rule and parsed by the LR parser. Result
is passed by context to actions which can do whatever they please. E.g. a
Expand Down
15 changes: 8 additions & 7 deletions docs/src/builders.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Currently Rustemo can be configured with three builder types:

When default builder is used, Rustemo will perform type inference for
Abstract-Syntax Tree (AST) node types based on the grammar. The builder, AST
types and actions for creating instances of AST nodes will be generated.
types, and actions for creating instances of AST nodes will be generated.

- **Generic tree builder**

Expand All @@ -27,8 +27,9 @@ following a certain set of rules explained in this section. The generated
builder will then call into actions to produce instances of the AST types. The
final output of this builder is AST tailored for the given grammar.

The builder will be generated inside `<lang>.rs` file where `<lang>` is the name
of the grammar. The actions will be generated into `<lang>_actions.rs` file.
The builder will be generated, together with the parser, inside `<lang>.rs` file
where `<lang>` is the name of the grammar. The actions will be generated into
`<lang>_actions.rs` file.

```admonish note
There are two approaches where generated files are stored. See [the configuration section](./configuration.md).
Expand Down Expand Up @@ -68,7 +69,7 @@ be:
3. Multiple content matches and/or assignments -> a `struct` type where fields
types are of the referred symbols.

In addtion, production kinds and assignments LHS names are used for
In addition, production kinds and assignments LHS names are used for
fields/function/type naming. Also, cycle refs are broken using `Box`.

Probably the best way to explain is by using an example. For example, if we have
Expand Down Expand Up @@ -161,8 +162,8 @@ builder from scratch.

To provide a custom builder you start with a type that implements a
`rustemo::Builder` trait and after that implements a concrete parsing algorithm
trait. Currently, Rustemo is a LR parser thus you can use `rustemo::LRBuilder`
trait.
trait. Currently, Rustemo is a (G)LR parser thus you can use
`rustemo::LRBuilder` trait.

Let's see how can we do all of this by implementing a builder that does
on-the-fly calculation of the arithmetic expression. Start with a type and a
Expand All @@ -183,7 +184,7 @@ For example, given the grammar:

```

in file `custom_builder.rustemo` the following builder from file
in the file `custom_builder.rustemo`, the following builder from file
`custom_builder_builder.rs` will perform arithmetic operation on-the-fly (during
parsing):

Expand Down
4 changes: 2 additions & 2 deletions docs/src/docs_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ For UML diagrams we use [PlantUML](https://plantuml.com/), while for general gra

# Trees diagrams

For tree diagrams LaTeX (pdflatex) with qtree package is used to produce PDF and
afterwards the PDF file is converted to PNG using `pdftoppm`. See
For tree diagrams LaTeX (`pdflatex`) with `qtree` package is used to produce PDF
and afterwards the PDF file is converted to PNG using `pdftoppm`. See
`docs/build-latex-images.sh` script. This script must be called whenever `.tex`
files with trees description are changed.
2 changes: 1 addition & 1 deletion docs/src/grammar_language.md
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ This will be parsed correctly:

for a=10 to 20

As `=` is not matched by the `KEYWORD` rule and thus doesn&rsquo;t require to be
As `=` is not matched by the `KEYWORD` rule and thus doesn't require to be
separated from the surrounding tokens.

```admonish note
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/calculator/calculator.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

```admonish note
This tutorial assumes that you have Rustemo CLI properly installed. Refer to
section Installation if you have trouble running `rcomp` command.
the [CLI section](../../cli.md) if you have trouble running `rcomp` command.
```


Expand Down

0 comments on commit 2b0fb7e

Please sign in to comment.