Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancing the documentation #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

tiagobstr
Copy link

Enhancing the documentation by working on the following sections:

  • Updating broken links;
  • Semantic validation;
  • Symbol resolution
  • Code generation
  • Chisel method;
  • Dual Code Model APIs

@tiagobstr tiagobstr requested a review from ftomassetti January 6, 2025 15:56
Copy link

netlify bot commented Jan 6, 2025

Deploy Preview for majestic-fenglisu-8c6786 failed.

Name Link
🔨 Latest commit e354386
🔍 Latest deploy log https://app.netlify.com/sites/majestic-fenglisu-8c6786/deploys/677bfd0f7556e60009fde35e

Copy link
Member

@ftomassetti ftomassetti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks very good to me. I added comments about small refinements, but overall this PR is a good step forward for this documentation

The Chisel method for writing parsers allows to build parsers consistently using the same approach which allows to achieve a consistency on the architectural decisions and enables developers to get familiar with a project easily.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here parsers is repeated. We may write "The Chisel method allows to build parsers consistently using the same approach..."


The Chisel method is based on the following principles:
1. We define a clear goal, which is shared by the Client and the Language Engineering Team. This goal is objective, and it is not subject to interpretation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For lists to work in markdown I am not sure if we need an empty line before the first point

The Chisel method is based on the following principles:
1. We define a clear goal, which is shared by the Client and the Language Engineering Team. This goal is objective, and it is not subject to interpretation.
2. At each step, the Language Engineering Team should clearly understand where we are and what should be done next - parsing and then refining the produced AST. Tool support should facilitate each single step, removing friction due to repetitive tasks. For this the StarLasu Libraries can be used since it provides user-friendly APIs for seamless integration as well as cross-language integration.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the StarLasu Libraries also the StarLasu Tools play a role

Code Generation modules are usefull to generate new files programmatically. This is the case when building a transpiler, where there is the need to generate text (code) from an AST representation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usefull -> useful

Code Generation modules are usefull to generate new files programmatically. This is the case when building a transpiler, where there is the need to generate text (code) from an AST representation.

Currently Code Generation modules can be written only with Kolasu.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now support them also in SharpLasu

## Heterogeneous APIs

On the other hand, each Node can also have its own specific set of properties and methods. For instance a Node that represents an if statement can have the condition and the body properties.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just add that this is typically useful to write specific applications like interpreters or semantic enrichment modules.

@@ -1,12 +1,21 @@
# Semantic Enrichment

_To be written_
People who are new to parser development may attempt to enforce grammar-level type coherence. For example, defining that a variable declared with type int can only have a subset of the expression types as its initial value, that doesn't work and can increase the complexity of writing a grammar and still not obtaining the desired constraints.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good explanation!

## Semantic Checks

- [](SymbolResolution.md);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we put the name between []?


StarLasu supports exporting ASTs to JSON and XML.
StarLasu supports exporting ASTs to JSON and XML.
Additionally, kolasu supports import/export from the [Lionweb](https://github.com/Strumenta/kolasu/blob/main/lionweb/src/main/kotlin/com/strumenta/kolasu/lionweb/LionWebModelConverter.kt) format.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also Tylasu should have support for LionWeb, I think


## Declarative symbol resolution

As mentioned in the previous section, it is surely possible to manually implement symbol resolution as some kind of tree-traversal algorithm. However, StarLasu provides support to ease such task and allows the developer to focus on language-specific concerns by providing rules for each reference in a given AST.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants