Class VerificationFunctionTreeListener
java.lang.Object
org.pgcodekeeper.core.parsers.antlr.pg.verification.VerificationFunctionTreeListener
- All Implemented Interfaces:
org.antlr.v4.runtime.tree.ParseTreeListener
public class VerificationFunctionTreeListener
extends Object
implements org.antlr.v4.runtime.tree.ParseTreeListener
Parse tree listener for function body verification.
Walks through function parse trees to count methods and perform
various code quality checks on function implementations.
-
Constructor Summary
ConstructorsConstructorDescriptionVerificationFunctionTreeListener(String fileName, VerificationProperties rules, List<Object> errors, org.antlr.v4.runtime.Token token) Creates a new function tree listener for verification. -
Method Summary
Modifier and TypeMethodDescriptionvoidenterEveryRule(org.antlr.v4.runtime.ParserRuleContext ctx) voidexitEveryRule(org.antlr.v4.runtime.ParserRuleContext ctx) intReturns the count of methods found during tree traversal.voidvisitErrorNode(org.antlr.v4.runtime.tree.ErrorNode node) voidvisitTerminal(org.antlr.v4.runtime.tree.TerminalNode node)
-
Constructor Details
-
VerificationFunctionTreeListener
public VerificationFunctionTreeListener(String fileName, VerificationProperties rules, List<Object> errors, org.antlr.v4.runtime.Token token) Creates a new function tree listener for verification.- Parameters:
fileName- the name of the file being verifiedrules- verification rules and properties to applyerrors- list to collect verification errorstoken- the token representing the function definition
-
-
Method Details
-
getMethodCount
public int getMethodCount()Returns the count of methods found during tree traversal.- Returns:
- the number of methods counted in the function
-
visitTerminal
public void visitTerminal(org.antlr.v4.runtime.tree.TerminalNode node) - Specified by:
visitTerminalin interfaceorg.antlr.v4.runtime.tree.ParseTreeListener
-
visitErrorNode
public void visitErrorNode(org.antlr.v4.runtime.tree.ErrorNode node) - Specified by:
visitErrorNodein interfaceorg.antlr.v4.runtime.tree.ParseTreeListener
-
enterEveryRule
public void enterEveryRule(org.antlr.v4.runtime.ParserRuleContext ctx) - Specified by:
enterEveryRulein interfaceorg.antlr.v4.runtime.tree.ParseTreeListener
-
exitEveryRule
public void exitEveryRule(org.antlr.v4.runtime.ParserRuleContext ctx) - Specified by:
exitEveryRulein interfaceorg.antlr.v4.runtime.tree.ParseTreeListener
-