Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
80884d8
draft of classes
milenanedeljkovic Nov 9, 2021
9a06766
Practice writing interpreter
mattea777 Nov 15, 2021
2da4b25
Update ast.hpp
milenanedeljkovic Nov 15, 2021
be4692d
Merge branch 'Workspace' of https://github.com/elena-mrdja/Algorithm-…
mattea777 Nov 15, 2021
01c8aa0
Added cache to AST and Block
mattea777 Nov 15, 2021
4128555
Update ast.hpp
daryatodoskova Nov 15, 2021
1e34751
Merge branch 'zorkotdasha-patch-2' into Workspace
Nov 16, 2021
a488cf4
added references and corrected bugs
milenanedeljkovic Nov 16, 2021
b6a923c
added shapes to the viewer
elena-mrdja Nov 17, 2021
da32376
varcell should be scrollable, but there is a bug to be fixed
goranovic37 Nov 17, 2021
3010208
Merge branch 'Workspace' of https://github.com/elena-mrdja/Algorithm-…
goranovic37 Nov 18, 2021
2f40448
line missing
goranovic37 Nov 18, 2021
c74361c
Deleted unnecessary code
mattea777 Nov 18, 2021
e8e1eab
evdokia + milena + dasha changes
milenanedeljkovic Nov 18, 2021
10e3773
dasha + milena + evdokia changes
milenanedeljkovic Nov 18, 2021
37a3af0
dasha + milena + evdokia changes
milenanedeljkovic Nov 18, 2021
5d19385
fixed qt mainwindow SetUp
elena-mrdja Nov 18, 2021
8a1847b
Added individual hpp/cpp files for every class
mattea777 Nov 18, 2021
426309e
Merge branch 'Workspace' of https://github.com/elena-mrdja/Algorithm-…
mattea777 Nov 18, 2021
aeb47ee
Merge branch 'mattea777-patch-1' into Workspace
mattea777 Nov 18, 2021
a4e7d4a
Merge branch 'milenanedeljkovic-patch-2' into Workspace
mattea777 Nov 18, 2021
6c8c3bc
Update ast.hpp
Evdokia-Gneusheva Nov 21, 2021
3b7aa5e
Update project_design.md
goranovic37 Nov 22, 2021
fef3159
Update reports.md
goranovic37 Nov 22, 2021
1d06ee2
setting up varcell
goranovic37 Nov 22, 2021
a128c6d
edited comments, added number.hpp
Nov 22, 2021
ef80796
Merge branch 'Workspace' of https://github.com/elena-mrdja/Algorithm-…
Nov 22, 2021
2d22ce8
number + comment changes
Nov 22, 2021
8bbfe3f
changed variable and declaration. only shifted attributes around but …
Nov 22, 2021
3592f43
I added method which insert variable to a list of variables
Evdokia-Gneusheva Nov 22, 2021
e9e12e7
virtual methods (still empty) for Dasha
milenanedeljkovic Nov 25, 2021
b34c19d
get_num_value in number.hpp and virtual classes in expression.hpp
Nov 25, 2021
28344eb
Merge branch 'Workspace' of https://github.com/elena-mrdja/Algorithm-…
Nov 25, 2021
ecce1e9
Create .DS_Store
daryatodoskova Nov 25, 2021
f068850
Merge branch 'Workspace' of https://github.com/elena-mrdja/Algorithm-…
daryatodoskova Nov 25, 2021
f0eb7f4
Merge branch 'Workspace' of https://github.com/elena-mrdja/Algorithm-…
Evdokia-Gneusheva Nov 26, 2021
953fb8b
new files: tried creating templates for Expression and Variable; rena…
Nov 27, 2021
38c75fa
Merge branch 'Workspace' of https://github.com/elena-mrdja/Algorithm-…
Nov 27, 2021
a4bf24f
just some part of updated BinOp but I am struggling with it
Nov 28, 2021
77c297b
deleted parsing folder
elena-mrdja Dec 7, 2021
7100e25
Merge branch 'Workspace' of https://github.com/elena-mrdja/Algorithm-…
elena-mrdja Dec 7, 2021
2c0d155
added all of the work since Week 1
ekaterina-borisova Dec 12, 2021
69698f4
Work from Week 1. Parser done
ekaterina-borisova Dec 14, 2021
672e84e
Work from Week 1. Parser Done
ekaterina-borisova Dec 14, 2021
2743104
Update AlgoParser.g4
ekaterina-borisova Dec 20, 2021
d182395
Fixed some bugs related to AST class and Expression
ekaterina-borisova Dec 20, 2021
4655ba4
Merge branch 'Workspace' of https://github.com/elena-mrdja/Algorithm-…
ekaterina-borisova Dec 20, 2021
c6fb13a
classes Jump and UnOP
VirgileMartinBX23 Dec 23, 2021
95833db
added enumeration types in ast.hpp for simplicity, renamed get_value(…
Dec 23, 2021
f9475f9
added the definition of struct flowchart at the end of file ast.hpp
Dec 24, 2021
5ceec4e
outline of num_blocks function (asked by the GUI team)
Dec 25, 2021
7be100f
started merging Cache
Dec 25, 2021
6518633
the minorest changes imaginable but i have to commit in order to not …
Dec 25, 2021
52bce06
Example with negative numbers
elsa-bismuth Dec 29, 2021
83630d2
Adding classes + fixing bugs
elsa-bismuth Dec 29, 2021
6a0a2ef
adding classes + fixing bugs
elsa-bismuth Dec 29, 2021
73acc05
resolved some conflicts, did get_value for SingleOutput
Jan 2, 2022
66740e1
started filling in cache names
Jan 2, 2022
55857ba
pop function in ValuesList
Jan 2, 2022
aa8a96e
function for filling in Cache names is about done but NOT TESTED
Jan 2, 2022
ac95a01
Fixed a typo
mattea777 Jan 4, 2022
cb43286
Merge branch 'Workspace' of https://github.com/elena-mrdja/Algorithm-…
VirgileMartinBX23 Jan 4, 2022
ddade59
class while
VirgileMartinBX23 Jan 4, 2022
1217f13
more examples a bit more complex
VirgileMartinBX23 Jan 4, 2022
e28cdf5
minor changes, merging
Jan 6, 2022
6e334af
more merging
Jan 6, 2022
bc7eab5
merging...
Jan 6, 2022
68615b1
get_text and some other stuffs
Jan 6, 2022
a8dc3d1
very unfinished filling in the cache
Jan 6, 2022
73ca734
almost solved cache filling
Jan 6, 2022
5459c61
Stefan's code, he has git problems: if and else
Jan 6, 2022
a4dc742
more filling cache
Jan 6, 2022
5aee979
distances of line jumps in cache filling function
Jan 6, 2022
dcab095
some minor syntax errors
Jan 6, 2022
8bb7a34
some chart colors, diddies, tralala
Jan 7, 2022
ba1fee6
it's 1:23 am i'm stopping byw
Jan 7, 2022
9292e59
New version of Unop
VirgileMartinBX23 Jan 8, 2022
9a12c79
Filled cache for UnOp
mattea777 Jan 8, 2022
5e757da
charts finished
Jan 8, 2022
17ff140
cache filling for if else
Jan 8, 2022
b233f85
finished filling the cache
Jan 8, 2022
f7a460c
added fill_unop to fill_statement
Jan 8, 2022
a9b8935
get size for blocks for flowchart (get_flowchart_size)
Jan 8, 2022
6e5b4d0
get flowchart size for block
Jan 8, 2022
ebee7c3
merging flowchart
goranovic37 Jan 8, 2022
e25af9a
Some changes made
ekaterina-borisova Jan 9, 2022
b395694
get_condition
Jan 9, 2022
a12958c
Katia and Milena debugging for 5 hours
ekaterina-borisova Jan 9, 2022
a568ba9
Katia and Milena debugging for 5h
ekaterina-borisova Jan 9, 2022
268cba8
Fixing BinOpExp Katia + Milena +2h
ekaterina-borisova Jan 9, 2022
cb7c890
Katia + Milena working for another 2h
ekaterina-borisova Jan 9, 2022
41ea288
Expression works after Katia working for 4h straight
ekaterina-borisova Jan 9, 2022
9dffe3b
statements functions. should be all of them
Jan 9, 2022
004ab38
expression methods
Jan 9, 2022
7441546
Fixed value_type
ekaterina-borisova Jan 9, 2022
a9df190
flowchart from this morning, again
Jan 9, 2022
597be7d
Some changes
ekaterina-borisova Jan 9, 2022
4e11566
More examples
VirgileMartinBX23 Jan 9, 2022
26c02d3
made flowchart functions return pointers
Jan 9, 2022
40e2951
Merge branch 'Workspace' of https://github.com/elena-mrdja/Algorithm-…
Jan 9, 2022
902bdd2
Warnings handled
ekaterina-borisova Jan 9, 2022
b75e817
rewrite print statement
elsa-bismuth Jan 9, 2022
cc008fb
Create limitations file
elsa-bismuth Jan 9, 2022
7435704
Rename limitations to limitations.txt
elsa-bismuth Jan 9, 2022
1e5181d
Some more changes Katia + Milena
ekaterina-borisova Jan 9, 2022
348053d
sth that might help
Jan 9, 2022
ad4c2c9
Update README.txt
goranovic37 Jan 9, 2022
a7abedd
Update ast.cpp
ekaterina-borisova Jan 9, 2022
6b1c04d
Update ast.cpp
StefanVaylBX2023 Jan 9, 2022
00a425a
Update ast.hpp
ekaterina-borisova Jan 9, 2022
29b6fa2
Update ast.hpp
StefanVaylBX2023 Jan 9, 2022
f781ae6
Update ast.hpp
StefanVaylBX2023 Jan 9, 2022
2cc33c4
some bugs
Jan 10, 2022
c5f0692
Merge branch 'Workspace' of https://github.com/elena-mrdja/Algorithm-…
Jan 10, 2022
e54b162
Update example15.cpp
goranovic37 Jan 10, 2022
cde10bc
access to the examples
VirgileMartinBX23 Jan 10, 2022
63247ef
Merge branch 'Workspace' of https://github.com/elena-mrdja/Algorithm-…
VirgileMartinBX23 Jan 10, 2022
44b814c
some debugs and tests
daryatodoskova Jan 10, 2022
d36fcac
.
daryatodoskova Jan 10, 2022
567d3c1
Update ast.cpp
daryatodoskova Jan 10, 2022
8d4dbf7
Merge branch 'Workspace' of https://github.com/elena-mrdja/Algorithm-…
daryatodoskova Jan 10, 2022
97da477
Update example17.cpp
goranovic37 Jan 11, 2022
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
Binary file added .DS_Store
Binary file not shown.
66 changes: 66 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"files.associations": {
"__bit_reference": "cpp",
"__config": "cpp",
"__debug": "cpp",
"__errc": "cpp",
"__functional_base": "cpp",
"__hash_table": "cpp",
"__locale": "cpp",
"__mutex_base": "cpp",
"__node_handle": "cpp",
"__nullptr": "cpp",
"__split_buffer": "cpp",
"__string": "cpp",
"__threading_support": "cpp",
"__tree": "cpp",
"__tuple": "cpp",
"algorithm": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"cmath": "cpp",
"complex": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"exception": "cpp",
"functional": "cpp",
"initializer_list": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"locale": "cpp",
"map": "cpp",
"memory": "cpp",
"mutex": "cpp",
"new": "cpp",
"optional": "cpp",
"ostream": "cpp",
"ratio": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"utility": "cpp",
"vector": "cpp"
}
}
29 changes: 29 additions & 0 deletions Algorithm-visualizer/AST/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "antlr-debug",
"request": "launch",
"name": "Debug Current Grammar",
"input": "input.txt",
"visualParseTree": true
},

{
"name": "g++ - Build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb",
"preLaunchTask": "C/C++: g++ build active file"
}
]
}
48 changes: 48 additions & 0 deletions Algorithm-visualizer/AST/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": "build",
"detail": "Task generated by Debugger."
},
{
"type": "cppbuild",
"label": "C/C++: cpp build active file",
"command": "/usr/bin/cpp",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
77 changes: 77 additions & 0 deletions Algorithm-visualizer/AST/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# minimum required CMAKE version
CMAKE_MINIMUM_REQUIRED(VERSION 3.7 FATAL_ERROR)

project(test_antlr4)

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)


# compiler must be 11 or 14
set(CMAKE_CXX_STANDARD 17)

# required if linking to static library
add_definitions(-DANTLR4CPP_STATIC)

set(ANTLR4_TAG 4.9.3)
# using /MD flag for antlr4_runtime (for Visual C++ compilers only)
set(ANTLR4_WITH_STATIC_CRT OFF)
# add external build for antlrcpp
include(ExternalAntlr4Cpp)
# add antrl4cpp artifacts to project environment
include_directories(${ANTLR4_INCLUDE_DIRS})

# set variable pointing to the antlr tool that supports C++
# this is not required if the jar file can be found under PATH environment
set(ANTLR_EXECUTABLE ${PROJECT_SOURCE_DIR}/thirdparty/antlr/antlr-4.9.3-complete.jar)
# add macros to generate ANTLR Cpp code from grammar
find_package(ANTLR REQUIRED)

# Call macro to add lexer and grammar to your build dependencies.
antlr_target(SampleGrammarLexer ${CMAKE_CURRENT_SOURCE_DIR}/grammar/AlgoLexer.g4 LEXER
PACKAGE antlrcpptest)
antlr_target(SampleGrammarParser ${CMAKE_CURRENT_SOURCE_DIR}/grammar/AlgoParser.g4 PARSER
PACKAGE antlrcpptest
DEPENDS_ANTLR SampleGrammarLexer
COMPILE_FLAGS -lib ${ANTLR_SampleGrammarLexer_OUTPUT_DIR})

# include generated files in project environment
include_directories(${ANTLR_SampleGrammarLexer_OUTPUT_DIR})
include_directories(${ANTLR_SampleGrammarParser_OUTPUT_DIR})
include_directories(${ANTLR_SampleGrammarListener_OUTPUT_DIR})
include_directories(${ANTLR_SampleGrammarVisitor_OUTPUT_DIR})

# add generated grammar to demo binary target
add_executable(test_antlr4 main.cpp ast.cpp ast.hpp
${ANTLR_SampleGrammarLexer_CXX_OUTPUTS}
${ANTLR_SampleGrammarParser_CXX_OUTPUTS}
${ANTLR_SampleGrammarListener_CXX_OUTPUTS}
${ANTLR_SampleGrammarVisitor_CXX_OUTPUTS})
target_link_libraries(test_antlr4 antlr4_static)


add_custom_command(TARGET test_antlr4 POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/examples/example1.cpp"
"${PROJECT_SOURCE_DIR}/examples/example2.cpp"
"${PROJECT_SOURCE_DIR}/examples/example3.cpp"
"${PROJECT_SOURCE_DIR}/examples/example4.cpp"
"${PROJECT_SOURCE_DIR}/examples/example5.cpp"
"${PROJECT_SOURCE_DIR}/examples/example6.cpp"
"${PROJECT_SOURCE_DIR}/examples/example7.cpp"
"${PROJECT_SOURCE_DIR}/examples/example11.cpp"
"${PROJECT_SOURCE_DIR}/examples/example8.cpp"
"${PROJECT_SOURCE_DIR}/examples/example9.cpp"
"${PROJECT_SOURCE_DIR}/examples/example10.cpp"
"${PROJECT_SOURCE_DIR}/examples/example11.cpp"
"${PROJECT_SOURCE_DIR}/examples/example12.cpp"
"${PROJECT_SOURCE_DIR}/examples/example13.cpp"
"${PROJECT_SOURCE_DIR}/examples/example14.cpp"
"${PROJECT_SOURCE_DIR}/examples/example15.cpp"
"${PROJECT_SOURCE_DIR}/examples/example16.cpp"
"${PROJECT_SOURCE_DIR}/examples/example17.cpp"
"${PROJECT_SOURCE_DIR}/examples/example18.cpp"
"${PROJECT_SOURCE_DIR}/examples/example19.cpp"
"${PROJECT_SOURCE_DIR}/examples/example20.cpp"
"${PROJECT_SOURCE_DIR}/examples/example21.cpp"
"${PROJECT_SOURCE_DIR}/examples/example22.cpp"
$<TARGET_FILE_DIR:test_antlr4>)
16 changes: 16 additions & 0 deletions Algorithm-visualizer/AST/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
This folder is our second successful tryout of the ANTLR library that we have managed to do. All the work that has been done while working on the things that are
included here, will be used for the final product. The difference of this tryout is that we have fixed some important bugs, included our own grammar and included
the folder with examples which you can use in order to test the library.

SETUP:
1) Download the files
2) Download Java (you might use this link for that: https://www.oracle.com/java/technologies/downloads/#java11-windows)
2) Creat an empty folder called (ex. build) (inside the AST folder)
3) In the Terminal direct yourself into build folder
4) Call: cmake ../ (you might need to download and install cmake)
5) Call: make
6) Now your project is configurated and you can open it in QT (use CMakeLists.txt file to configurate QT project)

Now when all is set up, open the main.cpp file and if you run it, it will do the lexing and parsing, creating a parse tree as the final product.

Folder ResultParseTree contains the png files which represent the parse tree obtained from the example files in the folder Examples.
Loading