Class AcceptableNestingDepthOrError

java.lang.Object
org.ek9lang.compiler.phase5.AcceptableNestingDepthOrError
All Implemented Interfaces:
Consumer<org.antlr.v4.runtime.tree.ParseTree>

class AcceptableNestingDepthOrError extends Object implements Consumer<org.antlr.v4.runtime.tree.ParseTree>
Checks nesting depth at function/method/operator exit and emits error if too deep. Deep nesting makes code hard to read and maintain - this enforces a reasonable limit. The limit applies to control structures: if, while, for, switch, try/catch/finally.
  • Constructor Details

  • Method Details

    • accept

      public void accept(org.antlr.v4.runtime.tree.ParseTree node)
      Specified by:
      accept in interface Consumer<org.antlr.v4.runtime.tree.ParseTree>