Skip to content

Commit

Permalink
Merge pull request #368 from NeoKaios/feat/cobol-cfg
Browse files Browse the repository at this point in the history
Support for COBOL CFG display with `graphviz` and `d3`
  • Loading branch information
nberth authored Oct 22, 2024
2 parents 24673c9 + 56546b2 commit 71275bf
Show file tree
Hide file tree
Showing 45 changed files with 2,753 additions and 22 deletions.
32 changes: 26 additions & 6 deletions .drom

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:

- run: opam pin add . -y --no-action

- run: opam depext -y superbol-studio-oss superbol-vscode-platform polka-js-stubs interop-js-stubs node-js-stubs vscode-js-stubs vscode-languageclient-js-stubs vscode-json vscode-debugadapter vscode-debugprotocol superbol-free superbol_free_lib superbol_preprocs superbol_project cobol_common cobol_parser cobol_ptree ebcdic_lib cobol_lsp ppx_cobcflags pretty cobol_config cobol_indent cobol_indent_old cobol_preproc cobol_data cobol_typeck cobol_unit ez_toml ezr_toml sql_ast sql_parser
- run: opam depext -y superbol-studio-oss superbol-vscode-platform polka-js-stubs interop-js-stubs node-js-stubs vscode-js-stubs vscode-languageclient-js-stubs vscode-json vscode-debugadapter vscode-debugprotocol superbol-free superbol_free_lib superbol_preprocs superbol_project cobol_common cobol_parser cobol_ptree ebcdic_lib cobol_lsp ppx_cobcflags pretty cobol_config cobol_indent cobol_indent_old cobol_preproc cobol_data cobol_typeck cobol_unit ez_toml ezr_toml sql_ast sql_parser cobol_cfg
# if: steps.cache-opam.outputs.cache-hit != 'true'

- run: opam install -y opam/*.opam --deps-only --with-test
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [0.1.4] Next release

### Added
- CFG explorer for COBOL programs [368](https://github.com/OCamlPro/superbol-studio-oss/pull/368)
- Detection of copybooks based on contents prefix and configured search path [373](https://github.com/OCamlPro/superbol-studio-oss/pull/373)
- Support for connecting to the LSP server remotely (TCP only) [#102](https://github.com/OCamlPro/superbol-studio-oss/pull/102)
- Support for Symbol Renaming command [#351](https://github.com/OCamlPro/superbol-studio-oss/pull/351)
Expand Down
2 changes: 1 addition & 1 deletion Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions assets/cfg-arc-renderer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!-- ----------------------------------------------------------------------- -->
<!-- -->
<!-- SuperBOL OSS Studio -->
<!-- -->
<!-- -->
<!-- Copyright (c) 2024 OCamlPro SAS -->
<!-- -->
<!-- All rights reserved. -->
<!-- This source code is licensed under the MIT license found in the -->
<!-- LICENSE.md file in the root directory of this source tree. -->
<!-- -->
<!-- ----------------------------------------------------------------------- -->

<!-- Base html file used to render arc cfg variant -->
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v7.min.js"></script>
</head>
<body>
<h2 id="title">Title</h2>
<div id="buttons">
<button onclick="toggleLegend()">Toggle Legend</button>
</div>
<div id="legend" class="hidden"></div>
<div id="graph"></div>
</body>
43 changes: 43 additions & 0 deletions assets/cfg-arc.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* -----------------------------------------------------------------------
*
* SuperBOL OSS Studio
*
*
* Copyright (c) 2024 OCamlPro SAS
*
* All rights reserved.
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* -----------------------------------------------------------------------
*/

html, body {
height: 100%;
}
text {
font: 12px monospace;
pointer-events: none;
}
svg {
background-color: white;
}
path {
animation: dash 1.5s linear infinite;
animation-play-state: paused;
}
.animated {
animation-play-state: running;
}

@keyframes dash {
to {
stroke-dashoffset: -51; // lcm of sum of dasharray values to avoid flicker
}
}
.hidden {
display: none !important;
}
#title {
margin-block: .2em;
}
Loading

0 comments on commit 71275bf

Please sign in to comment.