Skip to content

Commit

Permalink
rename links
Browse files Browse the repository at this point in the history
Signed-off-by: emilkrebs <emil.krebs@typefox.io>

modified links

Signed-off-by: emilkrebs <emil.krebs@typefox.io>
Signed-off-by: emilkrebs <onlime@gmx.de>
Signed-off-by: emilkrebs <emil.krebs@typefox.io>
Signed-off-by: emilkrebs <onlime@gmx.de>
  • Loading branch information
emilkrebs authored and emilkrebs committed Aug 21, 2023
1 parent 17321bf commit cacf41d
Show file tree
Hide file tree
Showing 23 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion hugo/assets/scripts/sql/ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class App extends React.Component<{}> {
<div className="w-1/2 p-4 text-white overflow-auto">
<h1 className="text-2xl">Langium/SQL</h1>
<p className="pt-2">
This is a showcase of <a className="text-emeraldLangium" href="https://github.com/langium/langium-sql" target="_blank">Langium/SQL</a>. The editor above
This is a showcase of <a className="text-emeraldLangium" href="https://github.com/eclipse-langium/langium-sql" target="_blank">Langium/SQL</a>. The editor above
is a Monaco editor driven by our SQL language server. The current setup mimics <a className="text-emeraldLangium" href="https://www.mysql.com" target="_blank">MySQL</a>.
</p>
<h2 className="text-xl pt-4 underline">Features</h2>
Expand Down
2 changes: 1 addition & 1 deletion hugo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ enableRobotsTXT = true
# It can be either a remote url or a local file path relative to your content directory.
# geekdocPrivacyPolicy = "https://www.typefox.io/imprint-privacy/#privacy"

geekdocRepo = "https://github.com/langium/langium-website"
geekdocRepo = "https://github.com/eclipse-langium/langium-website"
geekdocEditPath = "blob/main/hugo/content"

# (Optional, default true) Add an anchor link to headlines.
Expand Down
2 changes: 1 addition & 1 deletion hugo/content/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ This reference documentation provides [an overview](/docs/langium-overview), a [

## Want to contribute?

Visit the [Langium repository](https://github.com/langium/langium) to take part in improving Langium.
Visit the [Langium repository](https://github.com/eclipse-langium/langium) to take part in improving Langium.
4 changes: 2 additions & 2 deletions hugo/content/docs/configuration-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ The *language specific services* are services specific to one Langium language a
## Customization
If you have used the [Yeoman generator](https://www.npmjs.com/package/generator-langium), the entry point to services customization is found in the `src/language-server/...-module.ts` file, where '...' is the name of your language. There you can register new services or override the default implementations of services. Langium implements the *Inversion of Control* principle via the *Dependency Injection* pattern, which promotes loosely-coupled architectures, maintainability, and extensibility.

For the following sections, we will use the [arithmetics example](https://github.com/langium/langium/tree/main/examples/arithmetics) to describe the procedure for replacing or adding services. Note that all names prefixed with *Arithmetics* should be understood as being specific to the language named *Arithmetics*, and in your project those services' names will be prefixed with your own language name.
For the following sections, we will use the [arithmetics example](https://github.com/eclipse-langium/langium/tree/main/examples/arithmetics) to describe the procedure for replacing or adding services. Note that all names prefixed with *Arithmetics* should be understood as being specific to the language named *Arithmetics*, and in your project those services' names will be prefixed with your own language name.

Please note that it is *not mandatory* to implement all custom code via dependency injection. The main reason for using dependency injection is when your custom code *depends* on other services. In many cases you can use plain functions instead of service classes to implement your application logic.

### Overriding and Extending Services
Thanks to the dependency injection pattern used in Langium, your can change the behavior of a service or add to its functionality in one place without having to modify every piece of code that depends on the service to be overridden or extended.

The [arithmetics example](https://github.com/langium/langium/tree/main/examples/arithmetics) provides a custom implementation of the `ScopeProvider` service, which overrides functionalities from the default implementation `DefaultScopeProvider`.
The [arithmetics example](https://github.com/eclipse-langium/langium/tree/main/examples/arithmetics) provides a custom implementation of the `ScopeProvider` service, which overrides functionalities from the default implementation `DefaultScopeProvider`.

First, we need to register the new implementation of `ScopeProvider` inside of the `ArithmeticsModule`:

Expand Down
2 changes: 1 addition & 1 deletion hugo/content/docs/document-lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Local scope computation consists of gathering all symbols contained in the AST,

The default implementation of the `ScopeComputation` service attaches the description of every symbol to its direct container. This means that the container holds information about which named nodes are nested inside of it. You can override this default behavior to change the position where a symbol is reachable, or to change the name by which it can be referenced. It is even possible to associate the same symbol to multiple container nodes, possibly with different names, to control precisely where and how references to it can be resolved. However, keep in mind that you cannot access any cross-references in this phase. More complex, context-dependent scope mechanisms can be implemented in the `ScopeProvider` (see [next section](#linking)).

The *"Domainmodel"* example includes a [customization of scopes precomputation](https://github.com/langium/langium/blob/main/examples/domainmodel/src/language-server/domain-model-scope.ts) where every *entity* contained in a *package declaration* is exposed using its *qualified name*, that is the concatenation of the package name and entity name separated with `.` (similar to Java).
The *"Domainmodel"* example includes a [customization of scopes precomputation](https://github.com/eclipse-langium/langium/blob/main/examples/domainmodel/src/language-server/domain-model-scope.ts) where every *entity* contained in a *package declaration* is exposed using its *qualified name*, that is the concatenation of the package name and entity name separated with `.` (similar to Java).

In languages with a type system, you would typically implement computation of types in an additional pre-processing step in order to make type information available in the document. This additional step can be registered to run after scope computation with the `onBuildPhase` method of `DocumentBuilder`. How types are computed heavily depends on the kind of type system, so there is no default implementation for it.

Expand Down
6 changes: 3 additions & 3 deletions hugo/content/docs/grammar-language.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "The Grammar Language"
weight: 100
---
The grammar language describes the syntax and structure of your language. The [Langium grammar language](https://github.com/langium/langium/blob/main/packages/langium/src/grammar/langium-grammar.langium) is implemented using Langium itself and therefore follows the same syntactic rules as any language created with Langium. The grammar language will define the structure of the *abstract syntax tree* (AST) which in Langium is a collection of *TypeScript types* describing the content of a parsed document and organized hierarchically. The individual nodes of the tree are then represented with JavaScript objects at runtime.
The grammar language describes the syntax and structure of your language. The [Langium grammar language](https://github.com/eclipse-langium/langium/blob/main/packages/langium/src/grammar/langium-grammar.langium) is implemented using Langium itself and therefore follows the same syntactic rules as any language created with Langium. The grammar language will define the structure of the *abstract syntax tree* (AST) which in Langium is a collection of *TypeScript types* describing the content of a parsed document and organized hierarchically. The individual nodes of the tree are then represented with JavaScript objects at runtime.

In the following, we describe the Langium syntax and document structure.
## Language Declaration
Expand Down Expand Up @@ -168,7 +168,7 @@ will result in an error message since the cross reference resolution will fail b

#### Unassigned Rule Calls
Parser rules do not necessarily need to create an object, they can also refer to other parser rules which in turn will be responsible for returning the object.
For example, in the [Arithmetics example](https://github.com/langium/langium/blob/main/examples/arithmetics/src/language-server/arithmetics.langium):
For example, in the [Arithmetics example](https://github.com/eclipse-langium/langium/blob/main/examples/arithmetics/src/language-server/arithmetics.langium):
```langium
AbstractDefinition:
Definition | DeclaredParameter;
Expand Down Expand Up @@ -274,7 +274,7 @@ Please refer to [this blog post](https://www.typefox.io/blog/parsing-expressions
### Data Type Rules
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.

The following example from the [domain model example](https://github.com/langium/langium/blob/main/examples/domainmodel/src/language-server/domain-model.langium) uses the `QualifiedName` data type rule to enable references to other elements using their fully qualified name.
The following example from the [domain model example](https://github.com/eclipse-langium/langium/blob/main/examples/domainmodel/src/language-server/domain-model.langium) uses the `QualifiedName` data type rule to enable references to other elements using their fully qualified name.
```langium
QualifiedName returns string:
ID ('.' ID)*;
Expand Down
2 changes: 1 addition & 1 deletion hugo/content/docs/sematic-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ interface B extends AstNode {

Actions can also be used to control the structure of the semantic model types. This is a more advanced topic, so we recommend getting familiar with the rest of the documentation before diving into this section.

Let's consider two different grammars derived from the [Arithmetics example](https://github.com/langium/langium/blob/main/examples/arithmetics/src/language-server/arithmetics.langium). These grammars are designed to parse a document containing a single definition comprised of a name and an expression assignment, with an expression being any amount of additions or a numerical value.
Let's consider two different grammars derived from the [Arithmetics example](https://github.com/eclipse-langium/langium/blob/main/examples/arithmetics/src/language-server/arithmetics.langium). These grammars are designed to parse a document containing a single definition comprised of a name and an expression assignment, with an expression being any amount of additions or a numerical value.

The first one does not use assigned actions:

Expand Down
2 changes: 1 addition & 1 deletion hugo/content/guides/formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const CustomModule: Module<CustomServices, PartialLangiumServices> = {

The entry point for the formatter is the abstract `format(AstNode)` method. The `AbstractFormatter` calls this method for every node of our model.
To perform custom formatting for every type of node, we will use pattern matching.
In the following example, we will take a closer look at a formatter for the [domain-model](https://github.com/langium/langium/tree/main/examples/domainmodel) language.
In the following example, we will take a closer look at a formatter for the [domain-model](https://github.com/eclipse-langium/langium/tree/main/examples/domainmodel) language.
In particular, we will see how we can format the root of our model (`DomainModel`) and each nested element (`Entity` and `PackageDeclaration`).

To format each node, we use the `getNodeFormatter` method of the `AbstractFormatter`. The resulting generic `NodeFormatter<T extends AstNode>` provides us with methods to select specific parts of a parsed `AstNode` such as properties or keywords.
Expand Down
4 changes: 2 additions & 2 deletions hugo/content/guides/scoping/class-member.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function test(): void {

Member based scoping like this requires not only a modification of the default scoping provider, but also some other prerequisites.
This includes adding a member call mechanism in your grammar and a rudimentary type system.
For this guide, we will use excerpts from the [langium-lox](https://github.com/langium/langium-lox) project to demonstrate how you can set this up yourself.
For this guide, we will use excerpts from the [langium-lox](https://github.com/eclipse-langium/langium-lox) project to demonstrate how you can set this up yourself.
This project implements a strongly-typed version of the [Lox language](https://craftinginterpreters.com/the-lox-language.html) from the popular book [Crafting Interpreters](https://craftinginterpreters.com/).

We'll first start with the `MemberCall` grammar rule, which references one of our `NamedElements`. These elements could be variable declarations, functions, classes or methods and fields of those classes. Additionally, we want to allow function calls on elements. Note that the grammar has no notion of whether these elements can actually be executed as functions. Instead, we always allow function calls on every named element, and simply provide validation errors in case an element is called erroneously. After parsing the first member call, we continue parsing further members as long as the input text provides us with further references to elements; which are separated by dots.
Expand Down Expand Up @@ -97,7 +97,7 @@ export class LoxScopeProvider extends DefaultScopeProvider {
}
```

When trying to compute the type of an expression, we are only interested in the final piece of the member call. However, to derive the type and scope of the final member call, we have to recursively identify the type of the previous member call. This is done by looking at the member call stored in the `previous` property and inferring its type. See [here for the full implementation of the type inference system in Lox](https://github.com/langium/langium-lox/blob/main/src/language-server/type-system/infer.ts). This kind of type inference requires scoping.
When trying to compute the type of an expression, we are only interested in the final piece of the member call. However, to derive the type and scope of the final member call, we have to recursively identify the type of the previous member call. This is done by looking at the member call stored in the `previous` property and inferring its type. See [here for the full implementation of the type inference system in Lox](https://github.com/eclipse-langium/langium-lox/blob/main/src/language-server/type-system/infer.ts). This kind of type inference requires scoping.

To illustrate this behavior a bit better, take a look at the following code snippet:

Expand Down
2 changes: 1 addition & 1 deletion hugo/content/guides/scoping/qualified-name.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class CppScopeComputation extends DefaultScopeComputation {
```
This new change now allows us to use local names of functions in the local scope, while they are still exported using their fully qualified name to the global scope.
Another example for this style of scoping can be seen in the [domain-model example language](https://github.com/langium/langium/tree/main/examples/domainmodel).
Another example for this style of scoping can be seen in the [domain-model example language](https://github.com/eclipse-langium/langium/tree/main/examples/domainmodel).
Also, click the following note to see the full implementation of the scope computation service.
<details>
Expand Down
2 changes: 1 addition & 1 deletion hugo/content/imprint.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h2 class="text-center text-2xl tracking-tight sm:text-3xl lg:text-4xl mt-20">
<a href="https://www.typefox.io/language-engineering/" class="nav-link-mobile">
Support
</a>
<a class='w-10 h-10' target="_blank" href="https://github.com/langium/langium">
<a class='w-10 h-10' target="_blank" href="https://github.com/eclipse-langium/langium">
<img src="../assets/GitHub-Mark-Light-120px-plus.png" alt="GitHub" />
</a>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion hugo/content/tutorials/building_an_extension/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In this tutorial we'll be going over how to build a VSIX extension (VSCode exten

## Setting up the Scripts

To get started, you'll want to have a language expressed in Langium, such as [Lox](https://github.com/langium/langium-lox) or [MiniLogo](https://github.com/langium/langium-minilogo). If you have been following along with these tutorials, you should already have something ready. If you don't you can also use the default language generated by the yeoman generator for Langium, presented in the [getting started](/docs/getting-started/) section.
To get started, you'll want to have a language expressed in Langium, such as [Lox](https://github.com/eclipse-langium/langium-lox) or [MiniLogo](https://github.com/eclipse-langium/langium-minilogo). If you have been following along with these tutorials, you should already have something ready. If you don't you can also use the default language generated by the yeoman generator for Langium, presented in the [getting started](/docs/getting-started/) section.

Regardless of what you're working with, you'll want to make sure you have the following scripts in your **package.json**.

Expand Down
2 changes: 1 addition & 1 deletion hugo/content/tutorials/customizing_cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ weight: 2

{{< toc format=html >}}

In this tutorial, we'll be talking about customizing the command line interface for your language. We recommend reading through previous tutorials about [writing a grammar](/tutorials/writing_a_grammar) and [validation](/tutorials/validation). Once you have a good grasp on those concepts, then you should be all set for setting up a CLI. We will also continue to use the [MiniLogo](https://github.com/langium/langium-minilogo) language as a motivating example.
In this tutorial, we'll be talking about customizing the command line interface for your language. We recommend reading through previous tutorials about [writing a grammar](/tutorials/writing_a_grammar) and [validation](/tutorials/validation). Once you have a good grasp on those concepts, then you should be all set for setting up a CLI. We will also continue to use the [MiniLogo](https://github.com/eclipse-langium/langium-minilogo) language as a motivating example.

## Overview

Expand Down
2 changes: 1 addition & 1 deletion hugo/content/tutorials/generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ our JSON output should be:
]
```

If you're looking at the implementation of [MiniLogo that we've already written in the Langium organization on Github](https://github.com/langium/langium-minilogo), you may notice that the program and output there are *slightly* different. This interpretation of MiniLogo has gone through some iterations, and so there are some slight differences here and there. What's most important is that your version produces the generated output that you expect.
If you're looking at the implementation of [MiniLogo that we've already written in the Langium organization on Github](https://github.com/eclipse-langium/langium-minilogo), you may notice that the program and output there are *slightly* different. This interpretation of MiniLogo has gone through some iterations, and so there are some slight differences here and there. What's most important is that your version produces the generated output that you expect.

We could continue to extend on this with new features, and generate new sorts of output using a given input language. In this tutorial, we're able to take a MiniLogo program and convert it into some simple JSON drawing instructions that can be consumed by another program. This opens the door for us to write such a program in another language, such as Python or Javascript, and draw with these results. In later tutorials, we'll be talking about how to run Langium in the web with generation, so that we can immediately verify our results by drawing on an HTML5 canvas.

Expand Down
Loading

0 comments on commit cacf41d

Please sign in to comment.