g/scanner: implement operator precedences