[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trouble with yytext
From: |
ROLAND |
Subject: |
Re: Trouble with yytext |
Date: |
Fri, 7 Dec 2001 01:47:25 -0800 (PST) |
--- Hans Aberg <address@hidden> wrote:
> Since you do not explain or give any explanatory
> code example, it is hard
> to guess more than that.
>
> Hans Aberg
Well, here is a snip from my FLEX, my BISON and my
C-file...
Let me tell that all code comes trhough the compiler
correctly, and that the problems I get are at runtime.
So don't come with something like: "Is that variable
set?"
I hope someone can tell me what's wrong now...
If there is not sufficient code to locate the problem,
I can put some more code up...
Roland
__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com
command : /* Empty */
| LPROM FILN
{ loadprom(yytext);}
loadprom(fname)
char *fname;
{
FILE *fp;
int addr;
struct breakp *helpbrk;
microword opcode;
if ( (fp = fopen(fname,"r")) != NULL)
{
while ( fscanf(fp,"%d%x%x",&addr,&addr,&opcode) != EOF)
if (prom[addr] == BRKPINSTR)
{
if ( (helpbrk=findbrkp(addr)) != NULL)
helpbrk->instr = opcode;
else prom[addr] = opcode;
}
else prom[addr] = opcode;
fclose(fp);
clrprch();
Intstatus=NOINT;
}
else illfile(fname);
}
#define SCOMSTR scomstr()
extern char comstring[];
%Start regex decnex fileex hexex hexfileex
spacetab [ \t]
hexdec [0-9a-f]
decimal [0-9]+
register {hexdec}|m|q|p|i|pa
hexdata {hexdec}+
filenm [^ \t\n][^\n]*
carret [\n]
comment "*".*
alphanum [^ \t\n]+
%%
^lp { BEGIN fileex; SCOMSTR; return(LPROM);}
{spacetab} SCOMSTR;
<fileex>{filenm} { BEGIN 0;SCOMSTR;return(FILN);}
%%
scomstr()
{ if (logflag)
strcat(comstring,yytext);
}