code: public static Integer computeGrammarSize(GrammarRules rules, Integer paaSize) {
  
      // The final grammar's size in BYTES
      //
      int res = 0;
  
      // The final size is the sum of the sizes of all rules
      //
      for (GrammarRuleRecord r : rules) {
        String ruleStr = r.getRuleString();
        String[] tokens = ruleStr.split("\\s+");
        int ruleSize = computeRuleSize(paaSize, tokens);
        res += ruleSize;
      }
  
      return res;
    }
docs: Computes the size of a normal, i.e. unpruned grammar.
  
  @param rules the grammar rules.
  @param paaSize the SAX transform word size.
  
  @return the grammar size, in BYTES.