Questions tagged [lex]

Lex is a computer program that generates lexical analyzers ("scanners" or "lexers"). Lex is commonly used with the yacc parser generator.

Filter by
Sorted by
Tagged with
1
vote
0answers
34 views

implementing lexical, syntatic and semantic analysis

My program , developed with C using win_flex , implements lexical, syntatic and semantic analysis , given defined grammar rules. I would like to know if you any suggestion for improving or ...
1
vote
1answer
88 views

Lex code to convert C for and do while loops into while loops [closed]

This is my lex code to convert possibly nested for and do while loops into while loops. (Other control flows like if or switch ...
6
votes
0answers
384 views

Creating a new language: FreezeFlame

Where it shines FreezeFlame shines in readibility while still maintaining most of the C-like syntax. It also implements a few (Planning on several) operators that are still in testing for other ...
2
votes
0answers
53 views

Lex simple line-counting grammar

I'm trying to make a lex (flex) grammar that kicks out tokens while always being aware of the current line number. As an exercise, I made a simple grammar that accepts raw strings ...
2
votes
0answers
62 views

Parsing key:value metadata in a file

I have written some Flex and Bison code for parsing a file. The following is a simplified example of the input file as well as the code used for parsing. There are a few things I am not satisfied ...
4
votes
1answer
3k views

Yet another C++ Json Parser (Recursive)

Following on from this request Yet another C++ Json Parser A friend pointed out that he though a recursive decent parser would be more efficient. Before I agree I want to test it so I wrote it for ...
46
votes
1answer
7k views

Yet another C++ JSON parser

This is a framework for a JSON parser I put together last night. Any comments appreciated. JsonLexer.l: Breaks the input into lexemes JsonParser.y: Understands the language syntax JsonParser.h: ...