Gave up on implementing scanner before parser. Just porting C# code.
Generated parser
More porting of C#