scanner: share code in XkbParse{File,String} Some refactoring to prepare for changes in the parse() function. Signed-off-by: Ran Benita <ran234@gmail.com>