line begin number at nodes, so visitor can give a nice error msg to the user
reducing code repetition by using a template method