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 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 verified
      rules - verification rules and properties to apply
      errors - list to collect verification errors
      token - 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:
      visitTerminal in interface org.antlr.v4.runtime.tree.ParseTreeListener
    • visitErrorNode

      public void visitErrorNode(org.antlr.v4.runtime.tree.ErrorNode node)
      Specified by:
      visitErrorNode in interface org.antlr.v4.runtime.tree.ParseTreeListener
    • enterEveryRule

      public void enterEveryRule(org.antlr.v4.runtime.ParserRuleContext ctx)
      Specified by:
      enterEveryRule in interface org.antlr.v4.runtime.tree.ParseTreeListener
    • exitEveryRule

      public void exitEveryRule(org.antlr.v4.runtime.ParserRuleContext ctx)
      Specified by:
      exitEveryRule in interface org.antlr.v4.runtime.tree.ParseTreeListener