It's Raining Tokens

It's raining what? Tokens. Lexical analysis is a fancy way of talking about the process of converting a sequence of characters into a sequence of tokens. Now, lucky for us, most of our tokens can be mapped directly to their single character equivalent. These include:

), (, /, *, +, -

If it's that straight forward, why not just skip this step? Valid point, to show you why it is necessary, imagine if we saw the following sequence of characters:> 1 0 3 7Is that four separete digits 1 0 3 7? Or, is it 10 and 37? Or is it 1037?
Remember, we can only see one character at a time. Turns out this is exactly what the lexical anaylsis stage tries to solve.

To complete this stage, you need to implement a Scanner. A template scanner has been defined in compiler/Scanner/Scanner.js. To test your implementation as you go along, run: $ yarn run test:Scanner When it is all green (that is the tests are passing), you should be able to enter any expression within the textbox on the right, and see each corresponding token below.

Stream of Tokens:
(hover to view JS Object)