Skip to content

Instantly share code, notes, and snippets.

@alexandervasyuk
Created October 8, 2014 22:58
Show Gist options
  • Save alexandervasyuk/b98cfe77f5dd33fb5ade to your computer and use it in GitHub Desktop.
Save alexandervasyuk/b98cfe77f5dd33fb5ade to your computer and use it in GitHub Desktop.
infixToBinary Parsing
for (var s = 0; s < input.length; ) {
var token;
if (isNaN(input[s])) {
token = input[s];
s+=1;
} else {
var i = s + 1;
while(i < input.length && !isNaN(input[i])) {
i+=1;
}
token = input.substring(s,i);
s = i;
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment