Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9228939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:26:59+00:00 2026-06-18T05:26:59+00:00

I am trying to compile a .l file to create a lexical analyzer. the

  • 0

I am trying to compile a .l file to create a lexical analyzer. the code is:

%{
#include "ifanw.tab.h"
extern int yylval;
%}
%%
"="      { return EQ; }
"!="     { return NE; }
"<"      { return LT; }
"<="     { return LE; }
">"      { return GT; }
">="     { return GE; }
"+"      { return PLUS; }
"-"      { return MINUS; }
"*"      { return MULT; }
"/"      { return DIVIDE; }
")"      { return RPAREN; }
"("      { return LPAREN; }
":="     { return ASSIGN; }
";"      { return SEMICOLON; }
"IF"     { return IF; }
"THEN"   { return THEN; }
"ELSE"   { return ELSE; }
"FI"     { return FI; }
"WHILE"  { return WHILE; }
"DO"     { return DO; }
"OD"     { return OD; }
"PRINT"  { return PRINT; }
[0-9]+   { yylval = atoi(yytext); return NUMBER; }
[a-z]    { yylval = yytext[0] - 'a'; return NAME; }   
\        { ; }
\n       { nextline(); }
\t       { ; }
"//".*\n { nextline(); }
.        { yyerror("illegal token"); }
%%

the commands I have entered were:

flex filename.l 

gcc -c lex.yy.c -o out

the output was

filename.l:2:23: fatal error: ifanw.tab.h: no such file or directory.

Is the problem in gcc libraries? If so, where can I download an updated/fixed library?
Otherwise, what’s the problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:27:00+00:00Added an answer on June 18, 2026 at 5:27 am

    gcc is telling you what the trouble is: it cannot find the include file you specified.

    It’s not a problem of libraries.

    You need to create that file from your .y file first

    bison --debug --verbose -d ifanw.y
    

    You might find this small tutorial useful.

    If you do not have the .y file, then you’re trying to compile an incomplete package, and that just won’t work. You will have to somehow obtain the missing files from wherever you got the files you already have.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When trying to compile this code: #include <iostream> #include <vector> using namespace std; class
I'm trying to create a make file which will compile all the .cpp files
I am getting this error when trying to compile my code: 1> c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/ostream: In
I am trying to create a java header file. I compiled the project in
Iam trying to compile a file of the following format by making a parser
I always get this error when trying to compile my file with Boost::GIL PNG
LLVM 2.6 + clang. Trying to compile C++ file and got: clang: warning: not
I was trying to compile a f90 file with triple precision (I know it's
I am trying to compile 2 shared libraries in the same mk file. The
I am trying to compile Xuggler under windows. It's ivy.xml file contains the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.