Apologies if this is a repost. How would you define a lexer to tokenize the following so that the grammar rules use EOL? x = y // some comment // some comment x = y I want to parse both obviously language statement as IDENTIFIER EQ IDENTIFIER EOL I hope this makes sense! Thanks Sohail