Note that there are some explanatory texts on larger screens.

plurals
  1. PO.... undeclared (first use in this function)?
    primarykey
    data
    text
    <p>I have a simple code in lex language and i generate lex.yy.c with Flex. when i want to compile lex.yy.c to .exe file i get some error like "undeclared (first use in this function) " ! when i search in web i understand i need a Const.h file, so i want to generate that file. how i can do this ?</p> <p>Some Errors:</p> <p>35 C:\Users\Majid\Desktop\win\lex.l <code>STRING' undeclared (first use in this function) 38 C:\Users\Majid\Desktop\win\lex.l</code>LC' undeclared (first use in this function) 39 C:\Users\Majid\Desktop\win\lex.l `LP' undeclared (first use in this function) ....</p> <p>Beginnig of The Code is :</p> <pre><code>%{int stk[20],stk1[20]; int lbl=0,wlbl=0; int lineno=0; int pcount=1; int lcount=0,wlcount=0; int token=100; int dtype=0; int count=0; int fexe=0; char c,str[20],str1[10],idename[10]; char a[100]; void eatcom(); void eatWS(); int set(int); void check(char); void checkop(); int chfunction(char *);%} Digit [0-9] Letter [a-zA-Z] ID {letter}({letter}|{digit})* NUM {digit}+ Delim [ \t] A [A-Za-z]] %% "/*" eatcom(); "//"(.)* \"(\\.|[^\"])*\" return (STRING); \"(\\.|[^\"])*\n printf("Adding missing \" to sting constant"); "{" {a[count++]='{';fexe=0;eatWS();return LC;} "(" {a[count++]='(';eatWS();return LP;} "[" {a[count++]='[';eatWS();return LB;} "}" {check('{');eatWS(); if(cflag) { //stk[lbl++]=lcount++; fprintf(fc,"lbl%d:\n",stk[--lbl]); //stk[lbl++]=lcount++; printf("%d\n",stk[lbl]); cflag=0; } return RC; } "]" {check('[');eatWS();return RB;} ")" {check('(');eatWS();return RP;} "++" | "--" return INCOP; [~!] return UNOP; "*" {eatWS();return STAR;} [/%] {eatWS();return DIVOP;} "+" {eatWS();return PLUS;} "-" {eatWS();return MINUS;} </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload