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

Simplification of grammar that encodes mutations with the same productions as reactions #1318

Merged
merged 45 commits into from
Sep 28, 2022
Merged

Conversation

Wonseo-C
Copy link
Collaborator

@Wonseo-C Wonseo-C commented Aug 3, 2022

This PR:

  • Updates the Lingua Franca grammar to delete the Mutation class, and merge it with the Reaction class. (They have the similar properties Trigger, Source, Effect, Code)
  • Updates the TypeScript code generator to uses a WritablePort for mutations

@Wonseo-C Wonseo-C requested review from lhstrh and hokeun August 3, 2022 06:17
@hokeun hokeun mentioned this pull request Aug 8, 2022
@hokeun
Copy link
Member

hokeun commented Aug 8, 2022

@lhstrh, I talked to @Wonseo-C and we found that Reaction and Mutation have a lot in common. Do you know if we can define a parent of these two objects in LinguaFranca.xtext? If we have a sort of "parent class" of Reaction and Mutation, we will be able to write code a lot cleaner without repeating the same code. :) For example, we can define common functions used by procedures generating codes for reactions and mutations.

@hokeun hokeun changed the title Generating the mutation in TypeScript target Make mutation a type of reaction (LF syntax change), and enable mutation in TypeScript target Sep 19, 2022
@hokeun hokeun changed the title Make mutation a type of reaction (LF syntax change), and enable mutation in TypeScript target Make mutation a special type of reaction (LF syntax change), and enable mutation in TypeScript target Sep 19, 2022
@Wonseo-C Wonseo-C requested a review from lhstrh September 28, 2022 05:15
@lhstrh lhstrh changed the title Make mutation a special type of reaction (LF syntax change), and enable mutation in TypeScript target Simplification of grammar that encodes mutations with the same productions as reactions Sep 28, 2022
Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for these fixes!

@lhstrh lhstrh merged commit f266f51 into lf-lang:master Sep 28, 2022
@hokeun
Copy link
Member

hokeun commented Sep 28, 2022

Great work @Wonseo-C ! Thanks for the review @lhstrh !

@lhstrh lhstrh added the refactoring Code quality enhancement label Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Code quality enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants