Java: Fix RangeAnalysis/ModulusAnalysis.

This commit is contained in:
Anders Schack-Mulligen
2026-02-09 14:05:07 +01:00
parent 6fbdb2c52b
commit 1e9dcea88b
3 changed files with 38 additions and 2 deletions

View File

@@ -706,6 +706,14 @@ module Make0<LocationSig Location, AstSig<Location> Ast> {
*/
abstract AstNode getAstNode();
/**
* INTERNAL: Do not use.
*
* Gets a tag such that the pair `(getAstNode(), getIdTag())` uniquely
* identifies this node.
*/
abstract string getIdTag();
/** Gets a textual representation of this node. */
abstract string toString();
@@ -727,6 +735,8 @@ module Make0<LocationSig Location, AstSig<Location> Ast> {
override AstNode getAstNode() { result = n }
override string getIdTag() { result = "before" }
override string toString() {
if postOrInOrder(n) then result = "Before " + n.toString() else result = n.toString()
}
@@ -739,6 +749,8 @@ module Make0<LocationSig Location, AstSig<Location> Ast> {
override AstNode getAstNode() { result = n }
override string getIdTag() { result = "ast" }
override string toString() { result = n.toString() }
}
@@ -750,6 +762,12 @@ module Make0<LocationSig Location, AstSig<Location> Ast> {
override AstNode getAstNode() { result = n }
override string getIdTag() {
t.getValue() = true and result = "after-true"
or
t.getValue() = false and result = "after-false"
}
override string toString() { result = "After " + n.toString() + " [" + t.toString() + "]" }
}
@@ -760,6 +778,8 @@ module Make0<LocationSig Location, AstSig<Location> Ast> {
override AstNode getAstNode() { result = n }
override string getIdTag() { result = "after" }
override string toString() { result = "After " + n.toString() }
}
@@ -773,6 +793,8 @@ module Make0<LocationSig Location, AstSig<Location> Ast> {
NormalSuccessor getSuccessorType() { additionalNode(n, tag, result) }
override string getIdTag() { result = "add. " + tag }
override string toString() { result = tag + " " + n.toString() }
}
@@ -785,6 +807,8 @@ module Make0<LocationSig Location, AstSig<Location> Ast> {
override AstNode getAstNode() { result = c }
override string getIdTag() { result = "entry" }
override string toString() { result = "Entry" }
}
@@ -799,6 +823,12 @@ module Make0<LocationSig Location, AstSig<Location> Ast> {
override AstNode getAstNode() { result = c }
override string getIdTag() {
normal = true and result = "exit-normal"
or
normal = false and result = "exit-exc"
}
override string toString() {
normal = true and result = "Normal Exit"
or
@@ -826,6 +856,8 @@ module Make0<LocationSig Location, AstSig<Location> Ast> {
override AstNode getAstNode() { result = c }
override string getIdTag() { result = "exit" }
override string toString() { result = "Exit" }
}