Questions tagged [flex-lexer]

Flex (fast lexical analyzer generator) is a free software that generates lexical analyzers ("scanners" or "lexers").

Flex (fast lexical analyzer generator) is a free software that generates lexical analyzers ("scanners" or "lexers"). It is frequently used with the free Bison parser generator. Unlike Bison, flex is not part of the GNU Project. You can (and should) read the manual which can be found here.

See also:

2072 questions
0
votes
1 answer

Very simple query about Flex

I would like to ask you what does this character mean when you are writing a Flex file: '^'
FranTastic
  • 61
  • 6
0
votes
1 answer

Flex-lexer error to build rapidnet stimulator

I was trying to install rapidnet from website netdb.cis.upenn.edu/rapidnet/ , and after that following instructions from github https://github.com/netdb2017/rapidnet_v1.0, however still faced some error as Script.py should be Python.py(mentioned in…
Ali Zafar
  • 1
  • 2
0
votes
1 answer

ANTLR: Different token with trailing bracket

I am working on an ANTLRv4 grammar for BUGS - my repo is here, the link points to a particular commit so shouldn't go out of date. Minimum code example below. I would like the input rule to go along t route if input is T(, but to go along the id…
tales
  • 593
  • 2
  • 5
  • 12
0
votes
0 answers

Using Bison & Flex in Qt : Syntax Error

I am trying to do something like this : /* * comment block */ Sequence seq001 is { /* * comment block */ Phase phase001 is { /* * comment block */ Step step001 : /* * …
0
votes
1 answer

Bison & flex error

I'm not very experienced in bison and flex and i need some help. i have some errors in my .y file. syntax wise its fine and it compiles when i "bison -d" it but when i try to compile with gcc it gives me some errors that im not sure how to…
naknik
  • 11
  • 2
0
votes
1 answer

Setting yyout to file output in Lex is not working

I created a program to append line numbers to the text file passed as an argument to the program. yyin is working fine, but yyout is not working i.e, contents are being read from the specified file, but nothing is being written to the output file…
Rakshith
  • 11
  • 2
0
votes
1 answer

Flex / Bison: Configure yylineno to recognize '\r' as newline

Is there a way to configure/modify yylineno to recognize a single \r (carriage return) character as newline? Ultimately, I'd like to use yylineno for 3 different types of file: \n: Unix-like \r\n: Windows-based (will be recognized as a single…
Sam Tatasurya
  • 223
  • 2
  • 15
0
votes
0 answers

Conflicts on expression Bison

I'm making a parser for a language similar to C. I have problem to the statement expression . I've seen at many posts how they have the declaration of the expression, but for me it doesn't work... I have many conflicts. Can you help me please? .y…
0
votes
1 answer

Bison Unexpected token

I'm creating a bison/flex compiler and I have a problem. I added %glr-parser but the problem still exists. I have: There is a simple example which represents my problem .y file: %{ #include #include extern FILE…
0
votes
1 answer

How can I parse into a data structure for later execution? (Flex - Bison)

This is for a school assignment. I'm just looking for a point in the right direction. Maybe I'm just not recognizing the answer when I see it (googling). Instead of parsing the grammar and immediately performing the { action }, I would like to…
0
votes
1 answer

Question in Flex (parser)

I want to ask you a question about Flex, the program for parsing code. Supposing I have an instruction like this one, in the rules part: "=" BEGIN(attribution); {var_name} { fprintf(yyout, "="); ECHO; } ";"…
shkk
  • 1
  • 1
0
votes
1 answer

In a Flex Lexer, why are last chars moved to the beginning of a buffer before loading new input?

I'm trying to understand a Lexer (source) I'm porting to JavaScript and am stuck understanding how data from an input is read into a buffer. It's a standard Lexer so I'm hoping someone can give me some hints on what is happening on #919. Snippet in…
frequent
  • 27,643
  • 59
  • 181
  • 333
0
votes
2 answers

RegEx expression that will match Date format

I have a line with "1999-08-16"^^xsd:date. What will be the regex to capture the whole string as "1999-08-16"^^xsd:datein flex file? And, is it possible to capture only "1999-08-16" as a string. If yes, then what will be the regex for it in flex?
Abir Chokraborty
  • 1,695
  • 4
  • 15
  • 23
0
votes
1 answer

My result expected doesn't work in bison

The code is for study bison and flex, I am new but I want to learn to handle them. I'm trying to run this code but I don't know where the mistake is because the compiler says it is ok, but I don't know why there is the error when I test with the…
0
votes
2 answers

flex and bison issue for real numbers

I have been using flex and bison for making a small calculator. My files are the following: bisonFile.y %{ #include %} /* declare tokens */ %token NUMBER %token ADD SUB MUL DIV ABS %token EOL %% calclist: /* nothing */ | calclist exp EOL {…
Little
  • 3,363
  • 10
  • 45
  • 74