Category "lexer"

Making a lexer piece by piece and am struggling with reading operators correctly

I am pretty new to coding and am working on a lexer project for school. I have made it so it can register everything as tokens and have been expanding its abili

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-

ValueError: Ran into a $end where it wasn't expected - RPLY Parsing

I'm trying to create a parser for a basic interpreted language. When I run my program I get the following error: ValueError: Ran into a $end where it wasn't exp

How to setup Javacc in windows 10 [closed]

How do I install javacc in Windows 10? I visited https://javacc.github.io/javacc/, but there's no clear instruction to set it up on Windows.

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