flex-lexer Questions

2

Solved

I want to change yylex to alpha_yylex, that also takes in a vector as an argument. . . #define YY_DECL int yyFlexLexer::alpha_yylex(std::vector<alpha_token_t> tokens) %} . . . in main() std::...
Kloman asked 28/2, 2022 at 19:24

9

Hi I'm learing Lex and yacc. I created the following lex program. %{ #include <stdio.h> %} %% [0123456789]+ printf("NUMBER\n"); [a-zA-Z][a-zA-Z0-9]* printf("WORD\n"); %% I'm trying to run...
Pharmacopsychosis asked 16/4, 2012 at 14:13

1

I'm trying to interface a C++ flex with a C++ bison and I'm stumped. The Bison 3.8.1 manual has an example of a C++ Bison w/a C Flex. The Flex 2.6.4 doesn't have an example. The issue that I'm tryi...
Hooker asked 19/6, 2023 at 20:21

7

For example, I want to match a string consisting of m to n Chinese characters, then I can use: [single Chinese character regular expression]{m,n} Is there some regular expression of a single Chi...
Ureter asked 6/3, 2012 at 0:53

4

I met this problem when I was compiling the Android 7.1.2 source code after I updated my debian. I do not know what is the real problem . It seems problem from the flex. However, how can i solve it...
Ivo asked 15/3, 2018 at 14:7

4

I'm trying to use flex and bison to create a simple scripting language. Right now, I'm just trying to get a calculator working. I can't get it to compile, though. When I run this makefile: OBJECT...
Crow asked 26/9, 2009 at 1:2

9

Solved

I want to make a rule in flex to consume a c-style comment like /* */ i have the following c_comment "/*"[\n.]*"*/" But it doesn't ever get matched. Any idea why? if you need more of my code pl...
Hardback asked 25/1, 2010 at 3:52

3

I have just started with Flex and can't seem to figure out how to match the following Expression : "Dog".*"Cat" ------------------ Input : Dog Ca Cat Cc Cat ------------------ Output: Dog Ca Cat C...
Phooey asked 21/10, 2013 at 7:45

2

Solved

In previous versions of Jison, it was possible to have a Flex-like feature that allowed defining variables accessible in both the lexer and parser contexts, such as: %{ var chars = 0; var words = ...
Carrelli asked 31/5, 2015 at 20:6

3

Solved

I'm interested in adding semi-colon insertion ala Google Go to my flex file. From the Go documentation: Semicolons Like C, Go's formal grammar uses semicolons to terminate statements; unlik...
Apology asked 31/5, 2012 at 2:32

2

Solved

I am making a GUI program using Qt4, under git source control (Github page). Small part of project requires scanning and parsing. So I want to use flex and bison with the project. I can think of 3 ...
Tennant asked 19/1, 2013 at 8:14

3

I'm trying to work on postgresql locally with ubuntu 10.04. I get this error after I configure with ./configure --enable-cassert --enable-debug --prefix=$HOME/pgsql when I make && make i...
Semiporcelain asked 30/9, 2010 at 5:14

1

Solved

I need to have proper error messages for syntax errors for a grammar I'm writing. I've figured out that I can define a rule (? not sure about the terminology) for newlines in the flex file th...
Boadicea asked 31/5, 2020 at 12:7

4

Solved

So I've used flex to generate a c file from my lex code, and then used gcc to create the corresponding actual parser .exe. However, I can't figure out how to get it to read from anything other than...
Featherveined asked 2/2, 2013 at 20:8

3

Solved

I`m using the above regex to identify multiline comments in Flex: [/][*][^*]*[*]+([^*/][^*]*[*]+)*[/] { /* DO NOTHING */ } But seems to me that flex/bison is not returning properly the line coun...
Dimenhydrinate asked 21/8, 2014 at 0:15

3

Solved

OK, so I suppose my question is quite self-explanatory. I'm currently building a parser in Bison, and I want to make error reporting somewhat better. Currently, I've set %define parse.error verbo...
Aboutship asked 14/3, 2014 at 14:24

2

Solved

I've got a file, test.lex, which I run through as $ flex test.lex That gives me lex.yy.c, which I try to compile with: $ gcc lex.yy.c -lfl This gives me the error ld: library not found for -l...
Serpens asked 26/9, 2014 at 16:24

9

Solved

I'm having Lex and YACC files to parse my files (.l file and .y file). How to compile those files and how to make equivalent .c file for them in windows platform?
Drawtube asked 28/3, 2011 at 7:47

6

I'm experimenting to learn flex and would like to match string literals. My code currently looks like: "\""([^\n\"\\]*(\\[.\n])*)*"\"" {/*matches string-literal*/;} I've been struggling with var...
Shoelace asked 11/1, 2010 at 3:45

5

Solved

I have a simple "language" that I'm using Flex(Lexical Analyzer), it's like this: /* Just like UNIX wc */ %{ int chars = 0; int words = 0; int lines = 0; %} %% [a-zA-Z]+ { words++; chars += strle...
Snorkel asked 28/11, 2009 at 0:30

1

Solved

I already have a calculator program based on bison and flex which takes input from command line arguments. Now how can I rewrite the programs, so that I don't have to call flex but only call biso...
Competence asked 8/2, 2019 at 21:47

1

Solved

When using flex and bison together, whyc does a flex file need to #include a C header created by bison? compilation requires both the C source files created by bison and by flex. What do the C s...
Frottage asked 7/2, 2019 at 22:45

8

Solved

I want to create a read-eval-print loop using flex/bison parser. Trouble is, the flex generated lexer wants input of type FILE* and i would like it to be char*. Is there anyway to do this? One sug...
Parliamentary asked 23/4, 2009 at 7:34

2

Solved

I am working on building a lexical and syntax analyzer. I am getting the following warning when I try to use flex with my .l file. littleDuck.l:26: warning, rule cannot be matched Rule 26 is th...
Camail asked 24/2, 2013 at 22:25

1

Solved

The flex info manual provides allows whitespace in regular expressions using the "x" modifier in the (?r-s:pattern) form. It specifically offers a simple example (without whitespace) (?:foo) same ...
Anagram asked 24/10, 2018 at 19:1

© 2022 - 2024 — McMap. All rights reserved.