scanner: add some char class definitions
scanner: add variable to store position of string before any processing
scanner: declare functions via macro template