use of the yyleng function in ml-lex

1.1k Views Asked by At

Could some help me out with the use of the yyleng function of the ml-lex. How could i use it to display the length of the length of the recently matched text in the analyser

1

There are 1 best solutions below

0
On

(This question was answered in the comments. Converted to Community Wiki Answer to suit SO Q&A format.)

@Jesper.Reenberg noted:

You might wan't to rephrase your question. It is not completely clear what your exact problem is. As far as I know, then you only have yypos and yytext in ml-lex. Where you then can take the length of yytext to get the length of the matched.

See the user guide, here or here for examples.