PenguinF / sandra-three

Third incarnation of a chess UI for Windows 7 and higher.
Apache License 2.0
4 stars 0 forks source link

PGN parsing #213

Open PenguinF opened 4 years ago

PenguinF commented 4 years ago

Following these specifications.

Use a state-machine-with-stacks parser rather than anything recursive like in the Json parser, since this is vulnerable to StackOverFlowExceptions. This also has the advantage of more naturally supporting FileReader vs. existing string scenarios; the latter can be accessed with Span, the former with sequences of Spans while leaving the parser in a valid intermediate state. And this has the potential of allowing reconstruction of a PgnParser state given a red syntax tree which helps with live parsing of edits.

PenguinF commented 4 years ago

Angle brackets just not allowed. Will generate an illegal character error.