42 lines
829 B
Markdown
42 lines
829 B
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[] :
|
|
{
|
|
PLUS -> +
|
|
MINUS -> -
|
|
VARIABLE -> x
|
|
NUMBER -> int or double
|
|
POWER -> ^
|
|
MULTIPLICATION -> *
|
|
DIVISION -> /
|
|
END -> null
|
|
}[]
|
|
2. parser
|
|
-> terms[] :
|
|
{
|
|
SIGN -> + or -
|
|
COEFFICIENT -> double
|
|
EXPONENT -> double
|
|
}[]
|
|
3. reduce
|
|
4. print reduced form
|
|
5. find degree
|
|
6. print degree
|
|
7. solve
|
|
8. print solution |