I am designing a language where I want to use .. to define an integer range. The problem is that 0..10 is tokenized as the floats 0. and .10.
How do I allow support this syntax with flex? Is it is simple as making 0. an invalid float?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is really up to how you define your lexer. If you define the ellipsis as being a token made up of two periods, and also define your floating point numbers correctly, there should not be a conflict. Just make sure the token for the ellipsis is defined first in your specification. And, yes, 0. should be an invalid float.