Commit 8f1db2b3 authored by Tomislav Pree's avatar Tomislav Pree
Browse files

adde evaluated exprs

parent 7151835e
Pipeline #73014 passed with stages
in 102 minutes and 26 seconds
......@@ -26,16 +26,16 @@
<!-- debug info grid -->
<mat-grid-list cols="8" rowHeight="310px">
<mat-grid-list cols="16" rowHeight="310px">
<!-- editor -->
<mat-grid-tile [colspan]="2" [rowspan]="2" class="onegrid" style="background-color: #f8f8ff; align-items: baseline !important; display:block !important;">
<mat-grid-tile [colspan]="4" [rowspan]="2" class="onegrid" style="background-color: #f8f8ff; align-items: baseline !important; display:block !important;">
<div id="editor1" class="app_editor" style="float: left;"></div>
</mat-grid-tile>
<!-- store list -->
<mat-grid-tile [colspan]="2" [rowspan]="2" class="onegrid" style="background-color: #f8f8ff; align-items: baseline !important; display:block !important;">
<mat-grid-tile [colspan]="4" [rowspan]="2" class="onegrid" style="background-color: #f8f8ff; align-items: baseline !important; display:block !important;">
<h3 style="margin-top: -1px;">Store</h3>
<mat-form-field>
......@@ -73,7 +73,7 @@
</mat-grid-tile>
<!-- resolved store element -->
<mat-grid-tile [colspan]="2" [rowspan]="2" class="onegrid" style="background-color: #f8f8ff; align-items: baseline !important; display:block !important;">
<mat-grid-tile [colspan]="4" [rowspan]="2" class="onegrid" style="background-color: #f8f8ff; align-items: baseline !important; display:block !important;">
<h3 style="margin-top: -1px;">Resolved Store Element</h3>
<div style="overflow:auto">
......@@ -115,7 +115,7 @@
<!-- stack elements table -->
<mat-grid-tile [colspan]="1" [rowspan]="2" style="background-color: #f0f8ff;">
<mat-grid-tile [colspan]="2" [rowspan]="2" style="background-color: #f0f8ff;">
<h3 style="margin-top: -1px; margin-bottom: -1px;">Stack</h3>
<mat-table [dataSource]="stack" class="mat-elevation-z8" style="background-color: #f0f8ff;">
......@@ -137,7 +137,7 @@
<!-- environment elements table -->
<mat-grid-tile [colspan]="1" [rowspan]="2" style="background-color: snow;">
<mat-grid-tile [colspan]="2" [rowspan]="2" style="background-color: snow;">
<h3 style="margin-top: -1px; margin-bottom: -1px;">Environment</h3>
<mat-table [dataSource]="latestEnv" class="mat-elevation-z8" style="background-color: snow;">
......@@ -158,9 +158,9 @@
</mat-grid-tile>
<!-- current expression -->
<mat-grid-tile [colspan]="2" [rowspan]="1" style="background-color: #f7f8e7;">
<h3 style="margin-top: -1px; margin-bottom: -1px;">Evaluated Expression</h3>
<!-- processed expression -->
<mat-grid-tile [colspan]="3" [rowspan]="1" style="background-color: #f7f8e7;">
<h3 style="margin-top: -1px; margin-bottom: -1px;">Processed Expression</h3>
<div id="exprsDiv">
<mat-list role="list">
<mat-list-item *ngFor="let expr of exprs" role="listitem" #tooltip="matTooltip" matTooltip="{{expr.long}}" matTooltipClass="expr-tooltip">
......@@ -171,8 +171,30 @@
</mat-grid-tile>
<!-- evaluated expression -->
<mat-grid-tile [colspan]="5" [rowspan]="1" style="background-color: #f7f8e7;">
<div id="evaluatedExprsDiv">
<h3 style="margin-top: -1px; margin-bottom: -1px;">Evaluated Expression</h3>
<mat-list role="list" id="evaluatedExprsDiv">
<mat-list-item *ngFor="let expr of evaluatedExprs" role="listitem" #tooltip="matTooltip" matTooltip="{{expr.long}}" matTooltipClass="expr-tooltip">
{{expr.short}}
<div style="float: right; margin-left: auto;">
{{expr.val}}
</div>
</mat-list-item>
</mat-list>
</div>
</mat-grid-tile>
<!-- CFG -->
<mat-grid-tile [colspan]="6" [rowspan]="1" style="background-color: #f8f4ff;">
<mat-grid-tile [colspan]="8" [rowspan]="1" style="background-color: #f8f4ff;">
<h3 style="margin-top: -1px;">Control-Flow Graph</h3>
<div style="display:flex;height:80%;">
<ngx-graph class="chart-container" [links]="hierarchialGraph.links" [nodes]="hierarchialGraph.nodes" [draggingEnabled]="false" layout="dagre">
......
......@@ -49,6 +49,12 @@ interface Expr {
long: string;
}
interface EvaluatedExpr {
short: string;
long: string;
val: string;
}
interface StoreGraphNode {
id: string;
label: string;
......@@ -91,7 +97,8 @@ export class EditorComponent implements OnInit {
storeGraphEdges: StoreGraphEdge []; // edges of resolved store element
derefStoreElem: string; // value of resolved store element
derefStoreElemAddress: string; // address of resolved store element
exprs: Expr [] = [];
exprs: Expr [] = []; // list of processed expressions
evaluatedExprs: EvaluatedExpr [] = []; // list of evaluated expressions and values
curve = shape.curveBundle.beta(1); // CFG curves
// apply filter on store table
......@@ -118,6 +125,9 @@ export class EditorComponent implements OnInit {
else if(msg.tag == "CurrentExpressionResponse"){
this.currentExpressionResponseHandler(JSON.stringify(msg))
}
else if(msg.tag == "EvaluatedExpressionResponse"){
this.evaluatedExpressionResponseHandler(JSON.stringify(msg))
}
})
}
......@@ -229,20 +239,33 @@ export class EditorComponent implements OnInit {
console.log(obj.exception)
}
// logs current expression to console
// displays current expression
currentExpressionResponseHandler(msg){
var obj = JSON.parse(msg)
if(obj.expr.length < 60){
this.exprs.push({short:obj.expr, long:obj.expr})
}
else{
this.exprs.push({short:obj.expr.slice(0,57) + "...", long:obj.expr})
this.exprs.push({short:obj.expr.slice(0,50) + "...", long:obj.expr})
}
var objDiv = document.getElementById("exprsDiv");
objDiv.scrollIntoView(false)
}
// displays the evaluated expression and the value
evaluatedExpressionResponseHandler(msg){
var obj = JSON.parse(msg)
if(obj.expr.length < 60){
this.evaluatedExprs.push({short:obj.expr, long:obj.expr, val: obj.val})
}
else{
this.evaluatedExprs.push({short:obj.expr.slice(0,50) + "...", long:obj.expr, val: obj.val})
}
var objEvalDiv = document.getElementById("evaluatedExprsDiv");
objEvalDiv.scrollIntoView(false)
}
// updates CFG to given nodes and edges
changeGraph(nodes,edges) {
this.hierarchialGraph.nodes = nodes;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment