Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
ca588cb
Create draft of visualization page
Process-ing Jun 28, 2024
d23eb27
Fix WebSocket connection
Process-ing Jun 28, 2024
a2a6de2
Move page files to public folder
Process-ing Jun 28, 2024
31ccd8f
Create simple textareas for the AST and code
Process-ing Jun 28, 2024
18569ee
Improve AST and code containers
Process-ing Jun 28, 2024
b618729
Fix missing favicon error
Process-ing Jun 28, 2024
ee1858e
Highlight AST node on hover
Process-ing Jun 28, 2024
b5ee929
Highlight code of AST node when node hovered
Process-ing Jun 28, 2024
a46b5a5
Fix highlight of code with special characters
Process-ing Jun 28, 2024
f83b781
Create AST import script
Process-ing Jul 1, 2024
2dd87da
Refactor AST node indentation
Process-ing Jul 1, 2024
e44a6cd
Refactor node to code linking
Process-ing Jul 2, 2024
e962aeb
Refactor visualization script
Process-ing Jul 2, 2024
23c17cc
Implement highlighting of nodes and code when code is hovered
Process-ing Jul 2, 2024
b178a4f
Make tool highlight all possible code correspondences
Process-ing Jul 2, 2024
fe272a1
Convert launch script into a module
Process-ing Jul 2, 2024
2f87372
Export launcher script to TypeScript
Process-ing Jul 3, 2024
51a5cd7
Convert launch script to VisualizationTool class
Process-ing Jul 3, 2024
d5652c2
Convert page scripts to TypeScript
Process-ing Jul 4, 2024
c19b1c8
Add VisualizationTool method to create a WebSocket connection
Process-ing Jul 4, 2024
16275d5
Allow dynamic port allocation
Process-ing Jul 4, 2024
572b708
Specify default port
Process-ing Jul 4, 2024
907860d
Launch visualization tool on startup
Process-ing Jul 4, 2024
43c76c8
Convert VisualizationTool to a singleton
Process-ing Jul 4, 2024
8f9d370
Create function to wait for tool
Process-ing Jul 4, 2024
019c396
Create continue button
Process-ing Jul 4, 2024
2e02b4f
Establish communication between tool server and page
Process-ing Jul 5, 2024
110b692
Small refactor on VisualizationTool.ts
Process-ing Jul 5, 2024
62ddd26
Convert tool not running warning into an error
Process-ing Jul 5, 2024
a785806
Remove outdated TODO
Process-ing Jul 5, 2024
53b2215
Create function to update tool AST
Process-ing Jul 5, 2024
d3634bc
Add main script and remove default execution from the remaining modules
Process-ing Jul 5, 2024
f5d3cfc
Fix node highlighting
Process-ing Jul 5, 2024
a0261de
Try to make code generation and linking more dynamic
Process-ing Jul 5, 2024
58cf7b9
Fix AST updates
Process-ing Jul 5, 2024
645f6af
Send tree data to web page
Process-ing Jul 8, 2024
eb191ca
Create ToolJoinPoint class
Process-ing Jul 8, 2024
80ca285
Use real AST on visualization tool
Process-ing Jul 8, 2024
f88ecf4
Fix problems with indentation and incerment statements in for loops
Process-ing Jul 8, 2024
5d78beb
Fix search and replace bounds
Process-ing Jul 8, 2024
5cc9ab5
Fix condition search for while and do-while loops
Process-ing Jul 9, 2024
5173d20
Fix multiple variable declaration statements search
Process-ing Jul 9, 2024
f4a0393
Fix more bugs with search of expressions inside loop parentheses
Process-ing Jul 9, 2024
c58638a
Refactor highlighting
Process-ing Jul 9, 2024
3b0c425
Add favicon
Process-ing Jul 11, 2024
1393fd4
Make WebSocket reconnect on close
Process-ing Jul 12, 2024
daee025
Create color scheme
Process-ing Jul 12, 2024
f72fad9
Change default font
Process-ing Jul 12, 2024
4b894e0
Fix child node ordering
Process-ing Jul 12, 2024
0811c81
Upload SPeCS logo
Process-ing Jul 14, 2024
675986b
Create tool header
Process-ing Jul 14, 2024
425d994
Add Lucide icon to resume button
Process-ing Jul 15, 2024
38825fb
Refactor page layout and style continue button
Process-ing Jul 15, 2024
25a628f
Fix container sizes
Process-ing Jul 15, 2024
4cb3155
Refactor container style
Process-ing Jul 15, 2024
95a3a9f
Refactor containers
Process-ing Jul 15, 2024
0878ba6
Refactor AST container style
Process-ing Jul 15, 2024
6738081
Group child node elements in dropdowns
Process-ing Jul 15, 2024
5fb5a13
Make dropdown collapsable
Process-ing Jul 15, 2024
99744ce
Stylish node dropdown buttons
Process-ing Jul 15, 2024
6fa008f
Fix invalid HTML
Process-ing Jul 15, 2024
0b45c2f
Finish old CSS refactor
Process-ing Jul 15, 2024
aeb5c41
Fix container size
Process-ing Jul 15, 2024
0573581
Restylish code container
Process-ing Jul 16, 2024
b18c196
Change continue button style and migrate icon to Material Icons
Process-ing Jul 16, 2024
5d7bc9b
Refactor highlighting
Process-ing Jul 16, 2024
f49b475
Fix child node order
Process-ing Jul 16, 2024
18833c4
Fix invalid HTML code
Process-ing Jul 16, 2024
a3003b2
Start using joinPointType instead of astName
Process-ing Jul 17, 2024
ae3f433
Fix AST code corrections
Process-ing Jul 17, 2024
0dba16e
Pass compiler dependant actions to Clava
Process-ing Jul 18, 2024
bccf687
Move AST refining to Clava
Process-ing Jul 18, 2024
efacf60
Perform node to code linking on Clava
Process-ing Jul 18, 2024
af11f3a
Remove code from ToolJoinPoint
Process-ing Jul 18, 2024
3e292a5
Fix highlighting of nodes with multiple code blocks
Process-ing Jul 18, 2024
cac2a55
Allow fixed highlighting of node on click
Process-ing Jul 19, 2024
0147f06
Fix invalid CSS
Process-ing Jul 19, 2024
e55fd00
Allow scroll to position on node click
Process-ing Jul 19, 2024
7c9a2cd
Fix non-closed pre tag
Process-ing Jul 19, 2024
256f003
Make hover highlight weaker
Process-ing Jul 19, 2024
c890ae2
Fix accessibility issues
Process-ing Jul 19, 2024
ab48cca
Refactor highlighting and remove dropdown from leaf nodes
Process-ing Jul 19, 2024
0fae4ba
Refactor aspect of AST leaf node dropdown button
Process-ing Jul 19, 2024
149c014
Add info to ToolJoinPoint
Process-ing Jul 20, 2024
27c2455
Create node info container
Process-ing Jul 20, 2024
afda5a1
Refactor node info container style and behavior
Process-ing Jul 20, 2024
8b16880
Fix scroll to code on click
Process-ing Jul 20, 2024
8079162
Allow updating with random root
Process-ing Jul 22, 2024
769075a
Fix highlighting after update
Process-ing Jul 22, 2024
c1ad803
Refactor scroll
Process-ing Jul 22, 2024
fd0dcfd
Create loading text
Process-ing Jul 22, 2024
add9506
Create divider
Process-ing Jul 22, 2024
5ae0d76
Implement resizer behavior
Process-ing Jul 22, 2024
45e05af
Add file tabs
Process-ing Jul 23, 2024
814a905
Clean CSS
Process-ing Jul 23, 2024
7fada89
Style file tabs and refactor some CSS
Process-ing Jul 23, 2024
af57f19
Start division of code into files
Process-ing Jul 23, 2024
b0d486b
Finish division of code into files
Process-ing Jul 23, 2024
cb00d25
Create components script
Process-ing Jul 23, 2024
32a2f59
Refactor code file element logic
Process-ing Jul 23, 2024
b0737d9
Allow file focus on node click
Process-ing Jul 24, 2024
d887ccd
Fix files clearing
Process-ing Jul 24, 2024
230d328
Add syntax higlighting color scheme and classes
Process-ing Jul 24, 2024
1959272
Fix scrollIntoViewIfNeeded and add overflow to node info container
Process-ing Jul 24, 2024
e9fd2d4
Show node code when it cannot be found
Process-ing Jul 25, 2024
b97c7da
Implement dark mode
Process-ing Jul 25, 2024
5ab2355
Display when node does not have code
Process-ing Jul 25, 2024
3c17add
Switch from filename to filepath
Process-ing Jul 25, 2024
078406b
Make file tab use full file path in title
Process-ing Jul 25, 2024
85c20f5
Fix accessibility problems
Process-ing Jul 25, 2024
c756a07
Refactor dark theme
Process-ing Jul 25, 2024
c638ad8
Refactor page scripts to use the main components functions
Process-ing Jul 25, 2024
8cfeaaa
Pass AST rebuilding to Clava
Process-ing Jul 25, 2024
c64f384
Refactor visualization.ts
Process-ing Jul 25, 2024
4376518
Refactor ast-import.ts
Process-ing Jul 25, 2024
256360a
Refactor communication.ts
Process-ing Jul 25, 2024
d465928
Refactor files.ts
Process-ing Jul 25, 2024
56ce415
Refactor main.ts
Process-ing Jul 25, 2024
02bb178
Refactor GenericVisualizationTool
Process-ing Jul 25, 2024
579cf39
Refactor GenericVisualizationTool.ts
Process-ing Jul 25, 2024
5ac3b17
Create AstConverterUtils.ts
Process-ing Jul 25, 2024
054defc
Create getSyntaxHighlightTags
Process-ing Jul 26, 2024
4ddc19b
Write ast-import.ts documentation
Process-ing Jul 26, 2024
7bf4f67
Write documentation for communication.ts
Process-ing Jul 26, 2024
d23552f
Write documentation for files.ts
Process-ing Jul 26, 2024
9902228
Write documentation for ToolJoinPoint.ts
Process-ing Jul 26, 2024
4126411
Write documentation for utils.ts
Process-ing Jul 26, 2024
cd82c24
Add documentation to visualization.ts
Process-ing Jul 26, 2024
7965e69
Write documentation for GenericVisualizationTool
Process-ing Jul 26, 2024
598997c
Write documentation of GenericAstConverter.ts
Process-ing Jul 26, 2024
c490286
Write documentation for AstConverterUtils.ts
Process-ing Jul 26, 2024
10959a0
Fix file tabs horizontal scroll bar missing
Process-ing Jul 29, 2024
ded496e
Refactor files tabs overflow behavior
Process-ing Jul 30, 2024
3df2f40
Add README
Process-ing Aug 14, 2024
332a06e
Add report
Process-ing Aug 16, 2024
2ca5134
Change code folder
Process-ing Jan 27, 2025
26055f2
FIx imports
Process-ing Jan 27, 2025
fc6e690
Install dependencies
Process-ing Jan 27, 2025
6ecea75
Add compilation script
Process-ing Jan 27, 2025
e0b73f3
Move README and report to base folder
Process-ing Jan 27, 2025
122796e
Fix dependencies
Process-ing Jan 28, 2025
8ee6a88
Update README
Process-ing Jan 28, 2025
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Output directory
api/
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,44 @@
# lara-visualization
LARA package for visualization of the mapping between source code and AST.
# LARA Visualization Tool

Web tool for visualization and analysis of the AST and its source code.

## Integration

Internally, the tool follows a system for interaction with the compiler, to be able to apply code linkage and correction, among others, while still being independent of the specific compiler. This system is an implementation of the Factory Method pattern, and the integration with Clava is illustrated in the following diagram:

![Compiler Abstracted System](./compiler-abstracted-system.svg)

To integrate the tool in another compiler:

1. Implement the `GenericAstConverter` interface, with its functions properly implemented. More information can be found in their documentation.
2. Create a class that extends `GenericVisualizationTool`, and override `getAstConverter` so that it returns an instance of the class declared in the previous step.
3. Use an instance of the previous class as the entry point of the visualization tool API, for the compiler in question.

## Usage

The tool is best suited to be extended as a new NPM package. For integration, create a new NPM project and include LARA Visualization Tool's package.

```bash
npm install @specs-feup/lara-visualization
```

From there, make all adjustments necessary to use the tool for your compiler in that package, and include it in the project where your LARA scripts are found.

After integration, and being `VisualizationTool` the extended derived class of `GenericVisualizationTool`, to launch or update the visualization tool, execute the following statement:

```js
await VisualizationTool.visualize();
```

Once ready, the tool will provide the URL that should be opened in the browser to access the web interface. The function can also change the AST root and URL domain and port.

Other properties will allow the user to know other important information from the server:

```js
VisualizationTool.isLaunched; // true if the server is running
VisualizationTool.url; // URL where the server is running
VisualizationTool.port; // port to which the server is listening
VisualizationTool.hostname; // hostname to which the server is listening
```

For more details, refer to the `GenericVisualizationTool` documentation.
Binary file added capstone-project-report.pdf
Binary file not shown.
4 changes: 4 additions & 0 deletions compiler-abstracted-system.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading