47 lines
1.1 KiB
Markdown
47 lines
1.1 KiB
Markdown
# 42_EXT_05_computorv1
|
|
|
|
|
|
## ressources
|
|
|
|
- project intra : https://projects.intra.42.fr/projects/42cursus-computorv1
|
|
- project luke : https://github.com/LuckyLaszlo/computorv1
|
|
|
|
## install
|
|
|
|
this project uses submodules (maybe recursively), so either :
|
|
|
|
- `git clone --recurse-submodules <repo-url>`
|
|
- or, after cloning : `git submodule update --init --recursive`
|
|
|
|
## steps
|
|
|
|
1. lexer
|
|
-> tokens types :
|
|
- TOKEN_VARIABLE // x, y, etc.
|
|
- TOKEN_NUMBER_INT // int
|
|
- TOKEN_NUMBER_DOUBLE // double
|
|
- TOKEN_POWER // ^ or **
|
|
- TOKEN_SIGN_PLUS // +
|
|
- TOKEN_SIGN_MINUS // -
|
|
- TOKEN_FACTOR_MULT // *
|
|
- TOKEN_FACTOR_DIV // / or :
|
|
- TOKEN_EQUAL // =
|
|
- END // null
|
|
2. parser
|
|
-> terms :
|
|
- POSITION // left or righ from =
|
|
- SIGN // + or -
|
|
- COEFFICIENT // double
|
|
- EXPONENT // double
|
|
3. reduce
|
|
-> polynom :
|
|
- 0
|
|
- 1
|
|
- 2
|
|
- 3
|
|
- ...
|
|
4. print reduced form
|
|
5. find degree
|
|
6. print degree
|
|
7. solve
|
|
8. print solution |