straightline/src/main/java/org/poormanscastle/studies/compilers/ch01/part1/ProgramScanner.java
/**
     * counts and returns the max number of arguments for any given print statement contained within
     * the given stm.
     *
     * @param stm
     * @return the maximum number of arguments to any print statement contained within
     * the program wrapped inside the stm input parameter.
     */
counts and returns the max number of arguments for any given print statement contained within
the given stm.

@param stm
@return the maximum number of arguments to any print statement contained within
the program wrapped inside the stm input parameter.
counts and returns the max number of arguments for any given print statement contained within the given stm . @param stm @return the maximum number of arguments to any print statement contained within the program wrapped inside the stm input parameter .
public int maxArgs(Stm stm) {
        PrintStmArgCounterVisitor visitor = new PrintStmArgCounterVisitor();
        if (stm.handleProceedWith(visitor)) {
            stm.accept(visitor);
        }
        int maxArgNumber = 0;
        for (PrintContext printContext : visitor.getPrintContexts()) {
            maxArgNumber = Math.max(maxArgNumber, printContext.getNumberOfArguments());
        }
        return maxArgNumber;
    }
public int maxArgs ( Stm stm ) { PrintStmArgCounterVisitor visitor = new PrintStmArgCounterVisitor ( ) ; if ( stm . handleProceedWith ( visitor ) ) { stm . accept ( visitor ) ; } int maxArgNumber = 0 ; for ( PrintContext printContext : visitor . getPrintContexts ( ) ) { maxArgNumber = Math . max ( maxArgNumber , printContext . getNumberOfArguments ( ) ) ; } return maxArgNumber ; }
counts and returns the max number of arguments for any given print statement contained within
 the given stm.
counts and returns the max number of arguments for any given print statement contained within the given stm .