Basically I am creating my own language using Python currently. I had started the Lexer program and the way it works was that it tokenizes the source by seperating spaces. However, I want to be able to read both of these possible scenarios:
My lexer does not work for the first 'name' variable declaration, but does work for the second. How can I make it so either can work? Not sure if anyone has done any lexers here, but maybe somebody has some insight.
I also am wondering how lexers can take something like
and it is completely valid code to write so long as the open parenthesis each have a corresponding closing parenthesis.
Code:
name="Jack";
name = "Jack";
I also am wondering how lexers can take something like
Code:
name = ((5))
