abstract getTagCount() in scanner.js