uhmanoa-transpiler-project / shaka-scheme

The official repository for the UH Manoa Transpiler Project's Scheme interpreter, Shaka Scheme.
32 stars 24 forks source link

Removed Tokenizer; created LexerInput wrapper #39

Closed CinchBlue closed 7 years ago

CinchBlue commented 7 years ago

I have implemented LexerInput to wrap std::istream& and also provide get(), peek() and unget(). These methods also make sure to keep track of the line, column, and position numbers. This means that this serves as a good primitive to implement the Lexer (new Tokenizer design) on, as we'll just be able to just copy the current line information stored in the struct LexInfo over into the Token.

Please check that the LexerInput test cases are good -- the semantics for unget() are a bit strange, and I want your feedback on it.

Please also check for general mistakes or faulty asserts in the implementation or test case.

CinchBlue commented 7 years ago

I am going to close this pull request. I have done some independent work on the LexerRules and my own parser combinator functionality that I will include in a future pull request.