Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [lexer]

The tag has no usage guidance.

1
vote
1answer
53 views

Parsing a C++ function declaration with Perl 6 grammar

I wrote a Perl 6 grammar to parse a C++ function. My final goal would be to parse an entire header. The aim is not to correct C++ syntax errors, but to parse valid C++. Do you have some advice or ...
2
votes
0answers
68 views

Lexer function to handle the '/' character

I'm writing a toy compiler, which is in a very early stage of development. The lexer contains the following block of code: ...
4
votes
2answers
166 views

Lexer for Apache logs in Python

I recently learned Python using the book by Mark Summerfeld and I am now doing a few katas of mine when I learn a new language. This helps to get the “how the language works” and I wrote a simple ...
4
votes
1answer
233 views

Simple flex-based lexer

I am trying to learn flex and have created this simple program. The rule for comments works correctly for single line comments such as: // this is a comment and ...