Class StatementCounter

java.lang.Object
org.ek9lang.compiler.phase5.IntScopeCounter
org.ek9lang.compiler.phase5.StatementCounter

class StatementCounter extends IntScopeCounter
Tracks statement counts within functions/methods/operators. Increments on each executable statement encountered during AST traversal. This is used to enforce NCSS (Non-Commenting Source Statement) limits, preventing overly long functions that become hard to read and maintain.

A statement is always encountered inside an open scope, so incrementCount() asserts that invariant rather than silently ignoring an out-of-scope increment.

  • Constructor Details

    • StatementCounter

      StatementCounter()
  • Method Details

    • incrementCount

      void incrementCount()
      Increment the statement count for the current scope. Called when encountering an executable statement.