Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
bb53a5a
#9 Modify OptionsPanel
Darcolosse Jun 5, 2025
dec5015
ShadowJAR update
Hugo-CASTELL Jun 11, 2025
2a91fe1
#31 Bug with editor scrollBar going to the end at every update line n…
Darcolosse Jun 11, 2025
a7c2818
Changed model architecture
Hugo-CASTELL Jun 11, 2025
bab49aa
#24 Added TestGrammarToC.java / Corrected TestGrammarToPython.java
IngEastrOWL Jun 12, 2025
f7fce62
#35 Finished working on popups
Hugo-CASTELL Jun 12, 2025
f970f90
Merge branch 'dev-darco' into dev-darco-Popup
Hugo-CASTELL Jun 12, 2025
f4e3544
#35 Handled conflicts
Hugo-CASTELL Jun 12, 2025
1d923ba
Popup management for #35
Hugo-CASTELL Jun 12, 2025
6f94b6f
#18 Adding support of C++, Rust, Ada, Java to Mcdalang. Test and spec…
KenTizen17 Jun 14, 2025
14e9502
#42 Add Fonts
Darcolosse Jun 15, 2025
bdc6b7a
#42 Change font size with options menu
Darcolosse Jun 15, 2025
237578c
mcdabot vierge
Alexis-Wamster Jun 16, 2025
4f547d0
#30 mcdabot vierge
Alexis-Wamster Jun 16, 2025
2e43a1a
Added test rust, corrected test, remade TestGrammarToRust.java
IngEastrOWL Jun 16, 2025
2d5513d
Merge remote-tracking branch 'origin/dev-darco' into dev-darco
IngEastrOWL Jun 16, 2025
688d380
#30 mcdabot vierge
Alexis-Wamster Jun 16, 2025
ee32487
Merge branch 'dev-darco' of https://github.com/Hugo-CASTELL/mcdalang …
Alexis-Wamster Jun 16, 2025
9cb251b
#40 Handled settings save as and load from file
Hugo-CASTELL Jun 16, 2025
1e1d0a6
Merge branch 'dev-darco' into dev-darco-save-settings
Hugo-CASTELL Jun 16, 2025
7fedf04
Merge pull request #47 from Hugo-CASTELL/dev-darco-save-settings
Hugo-CASTELL Jun 16, 2025
4361a34
Refactor Translate C++
IngEastrOWL Jun 16, 2025
9ca4087
#42 Add Fonts + OptionPopup
Darcolosse Jun 16, 2025
8a71da7
#18 Adding implementation for JavaScript, Powershell, GO and Assembly…
KenTizen17 Jun 16, 2025
0e95192
Merge remote-tracking branch 'origin/dev-darco' into dev-darco-fonts
Darcolosse Jun 16, 2025
aebad51
Merge pull request #48 from Hugo-CASTELL/dev-darco-fonts
Darcolosse Jun 16, 2025
81f33ee
#36 Export and Import refactor
Hugo-CASTELL Jun 16, 2025
9d394d5
#46 #30 mcdabot and clean code
Alexis-Wamster Jun 16, 2025
86fc5ac
Refactor Translate Java
IngEastrOWL Jun 16, 2025
673b734
#42 bug fix
Darcolosse Jun 16, 2025
e08cfc6
#30 package pour clean
Alexis-Wamster Jun 16, 2025
49bfbbe
Java translate test update
IngEastrOWL Jun 16, 2025
767d071
Merge pull request #49 from Hugo-CASTELL/dev-darco-fonts
Darcolosse Jun 16, 2025
d24645d
#36 Export and Import refactor
Hugo-CASTELL Jun 16, 2025
d7e6da6
#42 Resolved save bugs
Darcolosse Jun 16, 2025
b8d721a
Merge pull request #50 from Hugo-CASTELL/dev-darco-file-picker
Hugo-CASTELL Jun 16, 2025
6e583ba
#37 Handled editor IDE like
Hugo-CASTELL Jun 16, 2025
e22615f
Merge pull request #52 from Hugo-CASTELL/dev-editor-ide-like
Hugo-CASTELL Jun 16, 2025
233da53
#51 Clean UI
Darcolosse Jun 16, 2025
608215f
Merge pull request #53 from Hugo-CASTELL/dev-darco-option_view_refractor
Darcolosse Jun 16, 2025
338d7d7
#43 add icon
Darcolosse Jun 16, 2025
1362305
Merge pull request #54 from Hugo-CASTELL/dev-darco-option_view_refractor
Darcolosse Jun 16, 2025
8c6e952
#35 Code cleaning in utils package
Hugo-CASTELL Jun 16, 2025
628c4d5
#24 adding complete test for JavaScript, PowerShell, Rust. Test for A…
KenTizen17 Jun 16, 2025
042e553
Merge remote-tracking branch 'origin/dev-antoine-tests' into dev-anto…
KenTizen17 Jun 16, 2025
b6fe3d3
Merge remote-tracking branch 'origin/dev-darco' into dev-darco
Hugo-CASTELL Jun 16, 2025
babc2f7
#30 ajout du contenus dans mcdabot
Alexis-Wamster Jun 16, 2025
b8889cc
Resolve conflicts
Hugo-CASTELL Jun 16, 2025
8b10595
#30 ajout du contenus dans mcdabot
Alexis-Wamster Jun 16, 2025
51f308d
Added McdalangToAda.java
IngEastrOWL Jun 16, 2025
6fbf74c
Merge remote-tracking branch 'origin/dev-antoine-tests' into dev-anto…
IngEastrOWL Jun 16, 2025
4dcde12
Merge branch 'dev-darco' into dev-mcdala
Alexis-Wamster Jun 16, 2025
b68e733
#33 GuideBook Mcdalang
Arthur5268 Jun 16, 2025
22d9029
#30 bug fix
Alexis-Wamster Jun 16, 2025
d583293
Merge remote-tracking branch 'origin/dev-mcdala' into dev-mcdala
Alexis-Wamster Jun 16, 2025
82ba4e0
Merge pull request #57 from Hugo-CASTELL/dev-mcdala
Alexis-Wamster Jun 16, 2025
2fb566c
Merge branch 'dev-darco' into dev-antoine-tests
IngEastrOWL Jun 16, 2025
95154fc
Merge pull request #58 from Hugo-CASTELL/dev-antoine-tests
IngEastrOWL Jun 16, 2025
49a7c7b
#46 #30 Bugs corrected
Hugo-CASTELL Jun 16, 2025
25bb3da
Ident bugs fix on Java
IngEastrOWL Jun 16, 2025
d15b59f
#35 Cleaned view package
Hugo-CASTELL Jun 16, 2025
3037a58
#35 Cleaned controller package
Hugo-CASTELL Jun 16, 2025
43fefc4
#35 Cleaned input (-> listeners) package
Hugo-CASTELL Jun 16, 2025
2a7def6
tests correction in c and rust
IngEastrOWL Jun 17, 2025
1f9bdc2
Merge pull request #61 from Hugo-CASTELL/dev-clean-up
Hugo-CASTELL Jun 17, 2025
6f93209
gif easter egg
Alexis-Wamster Jun 18, 2025
49794dc
gif easter egg
Alexis-Wamster Jun 18, 2025
1328015
add easter egg
Alexis-Wamster Jun 19, 2025
400b877
#59 #60 adding support for boolean operator to mcdalang grammar, and …
KenTizen17 Jun 19, 2025
e876685
#62 add resize for (dialogue and codeArea)
Alexis-Wamster Jun 19, 2025
68fba6d
#59 Added support for boolean operations in Ada, Java, C++ and Python
IngEastrOWL Jun 19, 2025
cec08ea
#59 Added support for boolean operations in Ada, Java, C++ and Python up
IngEastrOWL Jun 19, 2025
56579e7
Merge remote-tracking branch 'origin/dev-darco' into dev-mcdala
Hugo-CASTELL Jun 19, 2025
b036525
#30 Cleaned up
Hugo-CASTELL Jun 19, 2025
5c9bcf7
Merge pull request #64 from Hugo-CASTELL/dev-mcdala
Hugo-CASTELL Jun 19, 2025
db9ca17
#59 replacing GOLang by Rust, test are Ok, now doing some test in the…
KenTizen17 Jun 19, 2025
b735ecb
Merge remote-tracking branch 'origin/dev-darco' into dev-darco
KenTizen17 Jun 19, 2025
cf254f1
"#59 replacing GoLAng by Rust"
KenTizen17 Jun 19, 2025
d56d141
#62 Mega bruh wtf
Hugo-CASTELL Jun 19, 2025
bb7126c
Merge pull request #65 from Hugo-CASTELL/dev-font-mcdabot
Hugo-CASTELL Jun 19, 2025
dba9a23
Swap Darco
Hugo-CASTELL Jun 19, 2025
c1ddaef
Merge remote-tracking branch 'origin/dev-darco' into dev-darco
KenTizen17 Jun 19, 2025
43d9b56
#34 Add themes options
Darcolosse Jun 19, 2025
8153a8c
Bug fix : C and tests corrected
IngEastrOWL Jun 19, 2025
a1a2537
"correcting error in JavaScript tests"
KenTizen17 Jun 19, 2025
9d6dec4
#34 Bug fix
Hugo-CASTELL Jun 19, 2025
95e52f2
Merge pull request #66 from Hugo-CASTELL/dev-theme
Hugo-CASTELL Jun 19, 2025
6dfa253
#34 Bug fixes
Hugo-CASTELL Jun 19, 2025
575b5da
#35 Bug fixes
Hugo-CASTELL Jun 19, 2025
1f6ca8a
Xavier Cregut file architecture compliance
Hugo-CASTELL Jun 20, 2025
8406078
Bug fixes
Hugo-CASTELL Jun 20, 2025
84e91ca
SonarQube suggestions
Hugo-CASTELL Jun 20, 2025
0397d23
Disabling editable code areas in McdaBot
Hugo-CASTELL Jun 20, 2025
8207568
C++ name fix
Hugo-CASTELL Jun 20, 2025
b8cfa04
Theme light fix
Hugo-CASTELL Jun 20, 2025
846267d
Theme light fix
Hugo-CASTELL Jun 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Runtime properties
mcdalang.properties

# Compiled class file
*.class

Expand Down
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,40 @@
# mcdalang
# mcdalang

**mcdalang** is a pseudo-code programming language designed to help learners write and understand core programming concepts easily.
It is especially useful for students, educators, and beginner programmers who want to focus on logic and structure without being overwhelmed by syntax.

The project includes tools to **translate mcdalang code into several popular programming languages**, making it a great educational bridge from pseudocode to real-world languages.

---

## Features

- Simple and expressive pseudocode syntax
- Supports translation to:
- C
- C++
- Java
- Python
- JavaScript
- Rust
- Ruby
- Ada
- PowerShell
- Built using [ANTLR4](https://www.antlr.org/), a powerful parser generator for reading, processing, executing, or translating structured text.

---

## Getting Started

### Prerequisites

- Java 8+
- [ANTLR4 Tool & Runtime](https://github.com/antlr/antlr4)
- Maven or Gradle (optional, for builds)
- (Optional) IDE like IntelliJ IDEA or VSCode with ANTLR plugins

### Clone the repository

```shell
git clone https://github.com/Hugo-CASTELL/mcdalang.git && cd mcdalang
```
13 changes: 12 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
plugins {
id("java")
id("antlr")
id("com.github.johnrengelman.shadow") version "8.1.1"
}

group = "n7.mcdalang"
version = "1.0-SNAPSHOT"
version = "1.1.0"

repositories {
mavenCentral()
Expand Down Expand Up @@ -37,6 +38,16 @@ java {
}
}

tasks.jar {
manifest {
attributes(
"Main-Class" to "n7.mcdalang.Main"
)
}
from(sourceSets.main.get().resources)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

tasks.test {
useJUnitPlatform()
}
Expand Down
Binary file added livrables/GuideBook_Mcdalang.pdf
Binary file not shown.
File renamed without changes.
8 changes: 8 additions & 0 deletions livrables/description_intro.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Au début on voit le texte "MC-DALA" en rouge foncé gras gros et bien arrondis sans empâtement dans une police très lisse former de trait droit et arrondis avec des bord radius. juste en dessous en moins gros le texte "corporation" en noir dans une police plus standard.
De 0 à 0.5 en linéaire: le texte "corporation" disparait en fondu pour laisser place à seulement "MC-DALA".
De 0 à 0.7 en ease in out: le C le tiret et la barre vertical du D se rapprochent pour former un symbole se rapprochant du signe € ou d'un marteau (représenté par la barre vertical et le tiret) enfoncé dans une forme arrondis (représenté par le C).
De 0.7 à 1 : Le logo marque une petite pause pour laisser le viewer ce concentreer sur l'animation précédente. on voit donc "M € )ALA" peandant 0.3 sec.
De 1 à 2 en ease in out : plusieurs animation se passe simultanément pour transformer le texxte en emoji stylisé: les 2 "A" se transforme en 2 croix qui peuvent ressembler à 2 yeux, le trait du M avance jusqu'à former un trait arrondis qui souligne les deux X (comme un sourire), le logo "€" monte et tourne en même temps pour laisser voire un logo final. Qui est en même temps entourer par une casquette formé par la partie arrondis du D. Le "L" se rapproche du visage et forme une oreille. on passe donc "M € )ALA" se transformer en smiley avec 2 croix pour les yeux un trait arrondis pour la bouche un autre pour l'oreil droite et une casquette avec le logo de Mc-Dala corporation (en 1 sec)
De 1 à 1.3 : petite pause sur le smiley pour laisser le viewer digérer l'animation
De 1.3 à 1.6 en ease in out : la croix X de droite tourne pour former un + (comme un clin d'œil). et l'extrémité d'une flèche émerge du trait arrondis formant la bouche cela donne une certaine personnalité au smiley qui est former par une flèche une croix un plus une casquette et un arrondis pour l'oreille.
De 1.6 à 3 sec: il ne se passe plus rien comme pour montrer que l'animation est terminé
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions src/main/java/n7/mcdalang/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import n7.mcdalang.util.GlobalInstances;

import javax.swing.*;
import java.awt.*;

public class Main {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> GlobalInstances.getAppManager().startApp());
SwingUtilities.invokeLater(() -> GlobalInstances.getAppManager().onStartUp());
}
}
46 changes: 41 additions & 5 deletions src/main/java/n7/mcdalang/controllers/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,24 @@
import n7.mcdalang.views.View;

public abstract class Controller<V extends View> {

//#region Fields

protected boolean isViewReady;
protected final V view;

//#region Fields

//#region Constructor

protected Controller(V view) {
this.view = view;
this.isViewReady = false;
}

public void showView() {
updateView();
registerListeners();
GlobalInstances.getAppManager().display(view);
}
//#endregion Constructor

//#region Abstract Methods

/**
* Updates the view with the latest data or state.
Expand All @@ -26,4 +33,33 @@ public void showView() {
* This method should be implemented to set up any necessary event handling.
*/
protected abstract void registerListeners();

//#endregion Abstract Methods

//#region Public Methods

public void show() {
prepareView();
GlobalInstances.getAppManager().display(view);
}

public int showAsPopup() {
prepareView();
return GlobalInstances.getAppManager().displayPopup(view);
}

//#endregion Public Methods

//#region Private Methods

private void prepareView() {
if (!isViewReady) {
updateView();
registerListeners();
this.isViewReady = true;
}
}

//#endregion Private Methods

}
37 changes: 37 additions & 0 deletions src/main/java/n7/mcdalang/controllers/EasterEggController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package n7.mcdalang.controllers;

import n7.mcdalang.util.app.AppConfig;
import n7.mcdalang.util.audio.AudioPlayer;
import n7.mcdalang.views.EasterEggView;

public class EasterEggController extends Controller<EasterEggView> {

//#region Constructor

public EasterEggController(EasterEggView view) {
super(view);
}

//#endregion Constructor

//#region Overriden Methods

@Override
protected void updateView() {
// No updates needed for the easter egg screen
}

@Override
protected void registerListeners() {
// No listeners to register for the easter egg screen
}

@Override
public void show() {
super.show();
AudioPlayer.play(AppConfig.TOTEM_AUDIO);
}

//#endregion Overriden Methods

}
108 changes: 72 additions & 36 deletions src/main/java/n7/mcdalang/controllers/MainController.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package n7.mcdalang.controllers;

import n7.mcdalang.input.CodeKeyListener;
import n7.mcdalang.input.OptionActionListener;
import n7.mcdalang.input.RunActionListener;
import n7.mcdalang.input.SwitchActionListener;
import n7.mcdalang.listeners.*;
import n7.mcdalang.listeners.mcdabot.McdaBotActionListener;
import n7.mcdalang.util.GlobalInstances;
import n7.mcdalang.util.app.AppConfig;
import n7.mcdalang.util.font.Fonts;
import n7.mcdalang.util.theme.Themes;
import n7.mcdalang.views.MainView;
import n7.mcdalang.views.components.CodeTextArea;
import n7.mcdalang.views.components.util.CodeTextArea;

import javax.swing.*;
import java.awt.*;
import java.util.logging.Level;
import java.util.logging.Logger;
Expand All @@ -16,12 +17,6 @@

public class MainController extends Controller<MainView> {

//#region Fields

private boolean autoRun;

//#endregion Fields

//#region Constructor

public MainController(MainView view) {
Expand All @@ -33,56 +28,97 @@ public MainController(MainView view) {

//#endregion Constructor

//#region Implemented Methods
//#region Overriden Methods

@Override
protected void updateView() {

// No specific updates needed for the main view at this time.
setFont(GlobalInstances.getAppSettings().getFont());
setFontSize(GlobalInstances.getAppSettings().getFontSize());
}

@Override
protected void registerListeners() {
view.getRunButton().addActionListener(new RunActionListener(this));
view.getSwitchButton().addActionListener(new SwitchActionListener(autoRun));
view.getOptionsButton().addActionListener(new OptionActionListener(this, autoRun));

view.getSwitchButton().addActionListener(new SwitchActionListener());
view.getOptionsButton().addActionListener(new OptionActionListener(this));
view.getMcdaBotButton().addActionListener(new McdaBotActionListener(this));
view.getOriginTextArea().registerListener(new CodeKeyListener(this, view.getOriginTextArea()));
view.getImportButton().addActionListener(new ImportActionListener(this));
view.getExportButton().addActionListener(new ExportActionListener());
}

//#endregion Implemented Methods
//#endregion Overriden Methods

public void setAutoRun(boolean b) {
autoRun = b;
this.autoRun();
}
//#region Public Methods

public void setOriginTextAreaCode(String code) {
view.getOriginTextArea().setCode(code);
public void triggerChangeForOriginCode(String code) {
changeOriginCode(code);
}

public void triggerAutoRun() {
autoRun();
}

public void run() {
try {
for (CodeTextArea textArea : view.getCodeTextAreas()) {
runTranslation(textArea);
}
} catch (Exception e) {
Logger.getLogger(MainController.class.getName()).log(Level.SEVERE, e.getMessage());
}
}

public void enableAutoRun(boolean enabled) {
GlobalInstances.getAppSettings().setAutoRun(enabled);
this.autoRun();
}

public void setFontSize(int fontSize) {
GlobalInstances.getAppSettings().setFontSize(fontSize);
for (CodeTextArea textArea : view.getCodeTextAreas()) {
textArea.setSizeFont(fontSize);
}
view.getOriginTextArea().setSizeFont(fontSize);
}

public void setFont(Fonts font) {
GlobalInstances.getAppSettings().setFont(font);
for (CodeTextArea textArea : view.getCodeTextAreas()) {
textArea.setFont(textArea.createFont(AppConfig.FONT_ADAPTERS.get(font)));
}
view.getOriginTextArea().setFont(view.getOriginTextArea().createFont(AppConfig.FONT_ADAPTERS.get(font)));
}

public void setTheme(Themes theme) {
GlobalInstances.getAppSettings().setTheme(theme);
}

//#endregion Public Methods

//#region Private Methods

private void changeOriginCode(String newCode){
if(newCode != null){
view.getOriginTextArea().setCode(newCode);
}
}

private void autoRun() {
if (autoRun) {
if (GlobalInstances.getAppSettings().getAutoRun()) {
run();
}
}

public void run() {
private void runTranslation(CodeTextArea textArea) {
try {
for (CodeTextArea textArea : view.getCodeTextArea()) {
try {
String code = translateToOther(view.getOriginTextArea().getCode(), textArea.getLanguage());
textArea.setCode(code, Color.BLACK);
} catch (Exception e) {
textArea.setCode(e.getMessage(), Color.RED);
}
}
String code = translateToOther(view.getOriginTextArea().getCode(), textArea.getLanguage());
textArea.setCode(code, Color.BLACK);
} catch (Exception e) {
Logger.getLogger(MainController.class.getName()).log(Level.SEVERE, e.getMessage());
textArea.setCode(e.getMessage(), Color.RED);
}

}

//#region Private Methods
}
Loading