Skip to content
LAPCoder edited this page Mar 19, 2022 · 4 revisions

Welcome to the 4U-Programming-language wiki!

Here is the wiki!

How to use 4u ?

You must have gcc, bison or yacc, flex or lex and glib execute.

1: Go to your directory

Windows

On Windows, enter this command:

cd <directory name>

<directory name> is the directory where you installed folder "4u vX.X.X" (X.X.X is your version number). It's like C:\Users\user\Documents\4U\4U 0.0.0

Linux

On Linux, enter this command:

cd <directory name>

<directory name> is the directory where you installed folder "4u vX.X.X" (X.X.X is your version number). It's like /home/user/Documents/4U/4U\ 0.0.0 (for with space enter \ ).

2: Compile the lexical analyzer

Enter this command (if you use flex):

flex -o lexique_4u.c lexique_4u.lex

3: Compile the syntax analyzer

Enter this command (if you use bison):

bison -d syntaxe_4u.y

4: Compile the compiler

Enter this command (if you use gcc):

gcc lexique_4u.c syntaxe_4u.tab.c generation_code.c `pkg-config --cflags --libs glib-2.0` -o 4u

5: Execute the 4u program

Enter this command (if you use gcc) in a terminal (CMD):

./4u program.4u

<program.4u> is the name of your program.

6: Compile the program

Enter this command:

gcc program.c

<program.c> is the name of your program (compiled).

7: Compile the program

Enter this command:

./a.out

It's OK! Your code was executed! If you want to re-execute your code (and it's not changed), you can just do this command (step 7). Else, you can execute (if you want):

cd

Why there is so many files?

All files are important.

In V0.0.0, generation_code.c, lexique_4u.lex, syntaxe_4u.y and 4u.h are very important (and the program *.4u). Other are compiled files.