-
Couldn't load subscription status.
- Fork 25
1260 cfg semantic domain lite #1735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
General code improvements :
|
|
ControlFlowGraphBuilder possible improvements
|
Be carefull Refactoring does not means redesign. Switch case help me to identifiy what is concerned by CFG graph construction what be can be considered as simple instruction. Don't forget the first task is to validate CFG construction not to start changing every things. |
| /// <summary> | ||
| /// Any tag associated to this Node. | ||
| /// </summary> | ||
| public object Tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used to memorize the section or paragraph name in which this block appears, so this can be turned into string ProcedureName.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a general tag having object type, I don't want to give it as meaning ProcedureName out of any context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well actually, the Tag property is defined for the derived class BasicBlockForNode so it already acknowledges a Cobol (or TypeCobol) context because it uses the Node class to describe instructions. In Cobol context I think it makes sense to describe a block with the section or paragraph in which it appears.
TypeCobol.Analysis/Cfg/ControlFlowGraphBuilder.CfgParagraphSymbol.cs
Outdated
Show resolved
Hide resolved
TypeCobol.Analysis/Cfg/ControlFlowGraphBuilder.CfgSectionSymbol.cs
Outdated
Show resolved
Hide resolved
TypeCobol.Analysis/Cfg/ControlFlowGraphBuilder.CfgSectionSymbol.cs
Outdated
Show resolved
Hide resolved
TypeCobol.Analysis/Cfg/ControlFlowGraphBuilder.DeclarativesContext.cs
Outdated
Show resolved
Hide resolved
TypeCobol.Analysis/Cfg/ControlFlowGraphBuilder.MultiBranchContext.cs
Outdated
Show resolved
Hide resolved
TypeCobol.Analysis/Cfg/ControlFlowGraphBuilder.MultiBranchContext.cs
Outdated
Show resolved
Hide resolved
| /// </summary> | ||
| /// <param name="node">The node to be checked</param> | ||
| /// <returns>Return true if the node is a statement, false otherwise.</returns> | ||
| public static bool IsStatement(Node node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cobol V6.2 new statements missing.
Naming may be a bit confusing because to determine if a Node is a Statement, we already have the Statement marker interface. This is more like "Is this node a statement that CFG should handle".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is the purpose of the static method: "Is this node that CFG can handle" Because for instance it exists Node without CodeElement, CFG cannot take in account such nodes (like Then, WhenGroup, ...).
…te_IntegrateAsAnalyzer 1260 cfg semantic domain lite integrate as analyzer
| Block27 -> Block28 | ||
| Block28 -> Block29 | ||
| Block29 -> Block30 | ||
| Block30 -> Block31 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied comment from @rooksdo
As discussed together from analysis on perform loops.
Graph doesn't show loop on block30 for Perform until (as for Perform varying in PerfromNested0)
…PERFORMs Fix for iterative and recursive PERFORMs
ed9e15e to
7b4f5b3
Compare
|
See rebase version: #1806. |
This is a draft PR to discuss all code enhancements/refactorings.