So far the biggest benefit of this approach is that it make the Debugging/Testing much easier as I could just step through and find out wherever the problems were. For drawbacks, I think it made the code more verbose, but I'm not typically too worried about that. There's also the potential to have the wrong Type returned in a Pair/Triple, but I'm building it using TDD to captures such problems. Anyways, I'm currently working on the Parser and I am planning to attempt a similar approach to generate the AST from my Tokens.
My question is this: Is there some specific reason why global variables might be preferable for Lexing and Parsing? Might I be making some kind of huge mistake which will bite me down the road in later stages, or is it simply just going to result in a different and possibly more verbose code style? Thank you kindly for any info and perspectives.
If you wanted to have a look at the full source so far, it's
here.