Category "flex-lexer"

How to declare and reuse a character class in flex lexer?

Normally, when you want to reuse a regular expression, you can declare it in flex in declaration section. They will get enclosed by parenthesis by default. Eg:

Why I am getting "unbalanced parenthesis" error in flex

I was testing something with lexer, and wrote this regex rule:[0-9([a-b])[c-f]] ; According this docs, this is equivalent to:[0-9a-f()] ; For example, the foll

Trailing context match EOF flex-lexer

I want to match these two tokens: 1. NUM: A series of characters in [0-9_] with an optional . in between. 2. ID: A series of characters in [a-zA-Z0-9_] with at-

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

How to access FlexLexer's input function without deriving from yyFlexLexer?

I am writing a simple compiler for a simple C like language. To do that I would like to use Flex and Bison but use them both in the context of modern C++ Right

Flex lexer modifying constant in output .lex.c file

I'm working with flex to generate custom language. I'm wondering if there is a possibility to add in some way a setting that will change a part of generated .le