
I've implemented my language using the LLParser and it's working excellent so far. However this language is a little ambiguous.
For example, the string 'ABCD' would be interpreted as a hexadecimal number, but if a variable has been declared with the name 'ABCD', it would be interpreted as a variable instead.
Now, I can determine whether it's a hexadecimal number or a variable quite easily in my grammar, however I don't see any way to change the token produced by the lexer. Is this even possible or is there another way to do this?
The real problem here lies in the fact that the language I'm trying to parse has been poorly designed, but unfortunately that's the way it is for now.
Hugh
For example, the string 'ABCD' would be interpreted as a hexadecimal number, but if a variable has been declared with the name 'ABCD', it would be interpreted as a variable instead.
Now, I can determine whether it's a hexadecimal number or a variable quite easily in my grammar, however I don't see any way to change the token produced by the lexer. Is this even possible or is there another way to do this?
The real problem here lies in the fact that the language I'm trying to parse has been poorly designed, but unfortunately that's the way it is for now.
Hugh