I am writing a parser for a language. After implementation I have found that there are so many parser rules. So, I split the grammars. I have added the lexer rules in both the grammars. But, now I have found that the lexer is generated from the first grammar and they are not matched in the other grammar and hence no viable alt exception.

Can anyone guide me how to use the same lexer rules in both the grammars?