How to recognize a keyword only when followed by an open-paren.

In the example below, "OFFSET" is a keyword, but only should be recognized as such when the next character is an open-paren, "(". The close-paren that indicates an error should actually be the "ROWS" close and the close-paren at the end belongs to the "OFFSET" at the beginning.

What should my lexem look like in order to properly handle this?

Image_4796_1724683090911


Loader.
Up arrow icon