Skip to content

Commit 5eb5193

Browse files
committed
Add a link with "tree-rewriting actions" section
Signed-off-by: Markus Rudolph <markus.rudolph@typefox.io>
1 parent 76103c3 commit 5eb5193

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • hugo/content/docs/reference/grammar-language

hugo/content/docs/reference/grammar-language/_index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ SimpleExpression:
272272
'(' Addition ')' | value=INT;
273273
```
274274
Essentially this means that when a `+` keyword is found, a new object of type `Addition` is created and the current object is assigned to the `left` property of the new object. The `Addition` then becomes the new current object. In imperative pseudo code it may look like this:
275+
275276
```js
276277
function Addition() {
277278
let current = SimpleExpression()
@@ -283,7 +284,10 @@ function Addition() {
283284
}
284285
}
285286
```
286-
Please refer to [this blog post](https://www.typefox.io/blog/parsing-expressions-with-xtext) for further details.
287+
288+
If you want to learn more about parsing binary operators in Langium, please refer to this [dedicated documentation page](/docs/reference/grammar-language/infix-operators).
289+
290+
You can also refer to [this blog post](https://www.typefox.io/blog/parsing-expressions-with-xtext) for further details how this was done in Xtext.
287291

288292
### Data Type Rules
289293
Data type rules are similar to terminal rules as they match a sequence of characters. However, they are parser rules and are therefore context-dependent. This allows for more flexible parsing, as they can be interspersed with hidden terminals, such as whitespaces or comments. Contrary to terminal rules, they cannot use *regular expressions* to match a stream of characters, so they have to be composed of keywords, terminal rules or other data type rules.

0 commit comments

Comments
 (0)