Class InjectionCounter

java.lang.Object
org.ek9lang.compiler.phase5.InjectionCounter

class InjectionCounter extends Object
Tracks injection counts within functions/methods/operators. Increments when a variable declaration with '!' (BANG) is encountered. Used to store injection count as squirrelled data for metrics display.
  • Constructor Details

    • InjectionCounter

      InjectionCounter()
  • Method Details

    • pushScope

      void pushScope()
      Push new scope when entering function/method/operator.
    • popScope

      int popScope()
      Pop scope and return injection count.
      Returns:
      the total injection count in this scope
    • incrementCount

      void incrementCount()
      Increment the injection count for the current scope.
    • isNotEmpty

      boolean isNotEmpty()
      Check if there are any scopes on the stack.