replaced old Template class with newer bison/lex based implementation