Skip to content

Commit

Permalink
handling of explicitComparisonOK
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeantoni committed Jul 25, 2024
1 parent 2297534 commit 16d2eac
Show file tree
Hide file tree
Showing 14 changed files with 876 additions and 665 deletions.
22 changes: 17 additions & 5 deletions examples/languages/ParLang/src/ccfg/ccfglib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export class CCFG {
* @param t
* @returns the node with the given astNode and type or undefined if not found
*/
getNodeFromASTNode(astNode: AstNode, t:NodeType): Node | undefined {
getNodeFromASTNode(astNode: AstNode, t?:NodeType): Node | undefined {
for(let n of this.nodes){
if(n.astNode != undefined && n.astNode == astNode && n.type == t){
return n;
Expand Down Expand Up @@ -493,6 +493,8 @@ export class CCFG {
return "parallelogram";
case "Hole":
return "cylinder";
case "CollectionHole":
return "cylinder";
default:
return "box";
}
Expand All @@ -507,7 +509,7 @@ export class CCFG {
for (let inputEdge of h.inputEdges) {
inputEdge.to = ccfg.initialState as Node;
}
let terminalNode = ccfg.nodes.find(n => n.getType() == "terminates");
let terminalNode = ccfg.nodes.find(n => n.type == "terminates");
if (terminalNode == undefined) {
throw new Error("no terminal node found in the ccfg");
}
Expand Down Expand Up @@ -537,8 +539,8 @@ export class Step extends Node {
}

export class Choice extends Node {
constructor() {
super(undefined);
constructor(astNode?:AstNode) {
super(astNode);
}
}

Expand Down Expand Up @@ -568,7 +570,7 @@ export class AndJoin extends Join {
}

export class Hole extends Node {
constructor(astNode:AstNode) {
constructor(astNode?:AstNode) {
super(astNode);
}
}
Expand All @@ -583,6 +585,16 @@ export class TimerHole extends Hole {
}
}

export class CollectionHole extends Hole {
astNodeCollection: AstNode[];
constructor(astNode:AstNode[]) {
super(undefined);
this.astNodeCollection = astNode;
}
isSequential: boolean = false;
parallelSyncPolicy: string = "lastOf";
}

// export class Timer extends Node {
// constructor(value: any) {
// super(value);
Expand Down
22 changes: 17 additions & 5 deletions examples/languages/fsm/src/ccfg/ccfglib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export class CCFG {
* @param t
* @returns the node with the given astNode and type or undefined if not found
*/
getNodeFromASTNode(astNode: AstNode, t:NodeType): Node | undefined {
getNodeFromASTNode(astNode: AstNode, t?:NodeType): Node | undefined {
for(let n of this.nodes){
if(n.astNode != undefined && n.astNode == astNode && n.type == t){
return n;
Expand Down Expand Up @@ -493,6 +493,8 @@ export class CCFG {
return "parallelogram";
case "Hole":
return "cylinder";
case "CollectionHole":
return "cylinder";
default:
return "box";
}
Expand All @@ -507,7 +509,7 @@ export class CCFG {
for (let inputEdge of h.inputEdges) {
inputEdge.to = ccfg.initialState as Node;
}
let terminalNode = ccfg.nodes.find(n => n.getType() == "terminates");
let terminalNode = ccfg.nodes.find(n => n.type == "terminates");
if (terminalNode == undefined) {
throw new Error("no terminal node found in the ccfg");
}
Expand Down Expand Up @@ -537,8 +539,8 @@ export class Step extends Node {
}

export class Choice extends Node {
constructor() {
super(undefined);
constructor(astNode?:AstNode) {
super(astNode);
}
}

Expand Down Expand Up @@ -568,7 +570,7 @@ export class AndJoin extends Join {
}

export class Hole extends Node {
constructor(astNode:AstNode) {
constructor(astNode?:AstNode) {
super(astNode);
}
}
Expand All @@ -583,6 +585,16 @@ export class TimerHole extends Hole {
}
}

export class CollectionHole extends Hole {
astNodeCollection: AstNode[];
constructor(astNode:AstNode[]) {
super(undefined);
this.astNodeCollection = astNode;
}
isSequential: boolean = false;
parallelSyncPolicy: string = "lastOf";
}

// export class Timer extends Node {
// constructor(value: any) {
// super(value);
Expand Down
6 changes: 3 additions & 3 deletions examples/languages/testSoSLang/src/ccfg/ccfglib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export class CCFG {
* @param t
* @returns the node with the given astNode and type or undefined if not found
*/
getNodeFromASTNode(astNode: AstNode, t:NodeType): Node | undefined {
getNodeFromASTNode(astNode: AstNode, t?:NodeType): Node | undefined {
for(let n of this.nodes){
if(n.astNode != undefined && n.astNode == astNode && n.type == t){
return n;
Expand Down Expand Up @@ -539,8 +539,8 @@ export class Step extends Node {
}

export class Choice extends Node {
constructor() {
super(undefined);
constructor(astNode?:AstNode) {
super(astNode);
}
}

Expand Down
Loading

0 comments on commit 16d2eac

Please sign in to comment.