LemaireEmilien / calculator-cucumber-2024

This repository is used for teaching purposes at the University of Mons. It contains Java code for computing arithmetic expressions. The code uses design patterns and is accompanied with JavaDoc, unit tests and BDD scenarios. We have also paid particular attention to code quality.
0 stars 0 forks source link

[FEATURE] Expression parser #8

Closed Super-JK closed 6 months ago

Super-JK commented 7 months ago

Describe the new functionality you would like to see In order to make the Calculator usable in practice, it needs to accept an input parameter of type string. This string will be read, parsed and converted into a syntactically valid expression, or a syntax error will be returned if the string does not respect the correct syntax. Valid expressions will be evaluated, and the result of the evaluation will be printed on the console.

In order to achieve this functionality we need an expression parser:

Is your feature request related to a specific need or problem? Without a proper expression parser, the caclulator is not really practically useful, since creating expressions manually in terms of object trees is very cumbersome, error-prone and time-consuming.

Additional context Several Java libraries exist for creating parsers, it is recommended to choice the most appropriate one of them rather than to reinvent the wheel from scratch.

Faltmatix commented 6 months ago

Salut. Ce serait bien de finir cette feature ainsi je peux finir le GUI et merge avec la branche principale. On aura bientôt la deadline donc ne traînons pas trop.

Super-JK commented 6 months ago

@Faltmatix La branche ui a été update avec la derniere PR #20, plus un petit example d'integration avec le parser (c90e52bd4318e29f0a1d6f98a2810183886993c7).

Faltmatix commented 6 months ago

@Super-JK Top. Tu dirais que les changements sont stables ou tu anticipes encore des modifications? Si c'est stable, on peut fermer l'issue et je peux commencer à tout intégrer dès demain.

Super-JK commented 6 months ago

@Faltmatix l'interface va pas changer non

Faltmatix commented 6 months ago

@Super-JK

@DanLoris et moi on arrive pas à run le projet. On a une erreur avec lombok où il ne trouve pas les symboles pour les variables et méthodes. Mes dépendences sont à jour et Intellij arrive bien à parse le code mais aucune exécution ne marche. Des idées?

image

Super-JK commented 6 months ago

@Faltmatix @DanLoris Il faut bien utiliser maven sinon ca marche pas.

mvn javafx:run pour la gui mvn exec:java pour le main mvn test pour les tests etc.

Faltmatix commented 6 months ago

@Super-JK

Je confirme que mvn exec:java et mvn test fonctionnent. Mais mvn javafx:run plante avec le message suivant:

java.lang.module.FindException: Error reading module: C:\Users\sacry_000\.m2\repository\org\openjfx\javafx-base\21\javafx-base-21-win.jar
Caused by: java.lang.module.InvalidModuleDescriptorException: Unsupported major.minor version 61.0
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)

J'ai investigué le problème. La "solution" stackoverflow parle d'un mismatch entre le jdk qui compile et le jre qui run le code. Mais j'ai vérifié et notre pom.xml est bien à java 21 pour les deux et javafx. Et j'ai recompilé avec le jdk 17 pour voir et cela n'a rien changé.

Je me demande si c'est un problème sur Windows ou pas parce que Loris a le même que moi. Faudrait voir si @LemaireEmilien aussi a ce problème pour run javafx.

Super-JK commented 6 months ago

Met bien tout a jour fait un mvn clean Essaie le jar qu'il y a dans les actions et essaie de pas faire ca depuis intelij

Faltmatix commented 6 months ago

Oui. J'ai fais plusieurs fois un mvn clean avant de compiler et run, cela n'a pas changé le résultat. Je viens d'essayer de produire le jar comme on le fait avec CI/CD mais j'ai no main manifest attribute, in .\calculator-cucumber-0.5.0.jar quand je l'exécute. Je regarderai une nouvelle fois à cela plus tard si personne ne trouve de solution.