Los tests se encuentran en la carpeta "./src/test":
-
Tests TP1 en la carpeta "tests_parser_json".
-
Tests TP2 en la carpeta "tests_interpreter".
- python v3.11
- PLY v3.11
- Pytest v7.4.2
- argparse
Note: If "py" not works use "python3" / "python".
-
Go to repository root folder
-
Build image from Dockerfile with:
docker build -t flecha .
-
Execute image as container with:
docker run -it --entrypoint bash --name flecha flecha
-
Use commands in Tests or Execute sections (you might need to replace command "py" with "python3")
pip install -r requirements.txt
py -m pytest -v
py ./src/main.py -h
Some commands has priority. This means that a command which has more priority force to execute in that mode and output that mode until execution ends
1- REPL (-r
|--repl
)
2- Tokenizer Mode (-tM
|--repl
)
3- Parser Mode (-p
|-pM
)
Note:The priority is 1 to N where less value is more priority than a greater one
Example:
- command
-r
will execute as REPL. - command
-tM
will execute as 'Tokenizer Mode' and only return all program tokens as output. - command
-pM
will execute as 'Parser mode' and only return an ast program as output. - command
-r -pM
will execute as REPL. - command
-pM -tM
will execute as Tokenizer Mode.
Enables Read Evaluate Print Loop. Note: disable all other flags
py ./src/main.py -r
py ./src/main.py -s "def main = 12 * 234"
py ./src/main.py -i "./src/test/tests_interpreter/test18.input"
Note: need to be executed from root of repo
py ./src/main.py -i "./src/test/tests_interpreter/test18.input" -o "./out/test18.input"
Note: need to be executed from root of repo
py ./src/main.py -t -i "./src/test/tests_interpreter/test18.input"
py ./src/main.py -tM -i "./src/test/tests_interpreter/test18.input"
py ./src/main.py -p -i "./src/test/tests_interpreter/test18.input"
py ./src/main.py -pM -i "./src/test/tests_interpreter/test18.input"
py ./src/main.py -d -p -t -i "./src/test/tests_interpreter/test18.input"