Skip to content

Instantly share code, notes, and snippets.

@toptensoftware
Created October 26, 2016 02:08
Show Gist options
  • Select an option

  • Save toptensoftware/7b3483b01bad2606d33d92ec07fede14 to your computer and use it in GitHub Desktop.

Select an option

Save toptensoftware/7b3483b01bad2606d33d92ec07fede14 to your computer and use it in GitHub Desktop.
var testString = "10 + 20 - 30.123";
var t = new Tokenizer(new StringReader(testString));
// "10"
Assert.AreEqual(t.Token, Token.Number);
Assert.AreEqual(t.Number, 10);
t.NextToken();
// "+"
Assert.AreEqual(t.Token, Token.Add);
t.NextToken();
// etc...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment