Category "lex"

Flex and Bison compiler doesn't show lexical errors when he meets one syntax error

I'm coding a compiler using Flex and Bison, I coded yyerror(char*) and some printf() messages to show lexical and syntax errors. I tested my code by adding some

Limit integer and decimal parts length in flex

Is there a way I can extract the number of digits before and after the '.' in a float in Flex? I want to limit the number of digits in the integer part to 4, an

Optional characters in Flex expression

I'm trying to make a flex expression which identifies money, to 2 decimal places. This isn't for any practical use, I'm just messing around with flex and tryin