OpenCores
URL https://opencores.org/ocsvn/sc2v/sc2v/trunk

Subversion Repositories sc2v

[/] [sc2v/] [trunk/] [src/] [sc2v_step2.l] - Diff between revs 14 and 15

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 14 Rev 15
Line 24... Line 24...
%{
%{
#include 
#include 
#include "y.tab.h"
#include "y.tab.h"
 
 
extern int yylval;
extern int yylval;
 
extern FILE* yyin;
 
extern FILE* yyout;
 
 
 
extern int lineno;
 
 
int includefound = 0;
int includefound = 0;
int linecomment = 0;
int linecomment = 0;
int multilinecomment = 0;
int multilinecomment = 0;
%}
%}
Line 71... Line 75...
[a-zA-Z][a-z_A-Z0-9]*   if(!includefound & !linecomment & !multilinecomment) {
[a-zA-Z][a-z_A-Z0-9]*   if(!includefound & !linecomment & !multilinecomment) {
                           yylval=(int)strdup(yytext);
                           yylval=(int)strdup(yytext);
                           return WORD;
                           return WORD;
                        }
                        }
"*"                     if(!includefound & !linecomment & !multilinecomment) return ASTERISCO;
"*"                     if(!includefound & !linecomment & !multilinecomment) return ASTERISCO;
"\n"                    includefound = 0; linecomment = 0;
"\n"                    includefound = 0; linecomment = 0; lineno++;
"\\\n"                  /* no new line */
"\\\n"                  lineno++;/* no new line */
"$"                     /* ignore */
"$"                     /* ignore */
"."                     /* ignore */
"."                     /* ignore */
":"                     /* ignore */
":"                     /* ignore */
"#include"              includefound = 1;
"#include"              includefound = 1;
"//"                    if (!multilinecomment) linecomment = 1;
"//"                    if (!multilinecomment) linecomment = 1;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.