changed types of main rule methods and removed parameters, to use forward/backward methods of scanner