Is there a way to make a prediction using fslex / Lexing.LexBuffer

I use fslex, and in one of the rules of my tokenizer, I need to look for the next char so that I can decide whether to continue tokens or stop, relax, and allow the old rule to be used.

I did some verification of the source code, and it seems that the only way is to compile a version that provides some internal methods. Maybe someone has a better solution?

+3
source share
1 answer

Perhaps look at the source code for LexBuffer. Although there are properties ( BufferScanStartand BufferScanLength) to set the lexer position in the input stream, they are internal. I am not sure what is required to ensure their safe use.

There is also a question about HubFS which is about return. The conclusion seems to be the same: fslex does not currently support it.

+1
source

All Articles