Relative Content

Tag Archive for parsingcompiler-constructionlexer

Why do lexers usually define a var as not being able to start with a number?

What’s the difference between the token _123jh and 123jh that makes most lexers not include a number-starting identifier? I suppose one reason might be that a number-only token might be confusing, and so it’s easier to just eliminate the leading-number entirely as opposed to allowing something like: