alopezlago / YetAnotherPacketParser

A parser to convert quiz bowl packets to different file formats
Other
8 stars 0 forks source link

Change lexer to categorize every line, then drive the parser based on those categories #15

Closed alopezlago closed 3 years ago

alopezlago commented 3 years ago

Instead of relying on doing a lookahead of a certain number of lines, the lexer should categorize all the lines during lexing into one of the following categories:

Then the parser can use a real grammar to see what it expects the next tokens to be. Lines of question text can always be followed by more question text. We can then reject and continue if we find that, for example, a Question start + Question text isn't followed by an Answer start next.

alopezlago commented 3 years ago

Fixed by #16