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

Subversion Repositories sc2v

[/] [sc2v/] [trunk/] [src/] [sc2v_step1.y] - Diff between revs 4 and 6

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

Rev 4 Rev 6
Line 110... Line 110...
%}
%}
 
 
%token NUMBER WORD SC_INT SC_UINT BOOL BIGGER LOWER OPENKEY CLOSEKEY WRITE WORD SYMBOL NEWLINE ENUM INCLUDE
%token NUMBER WORD SC_INT SC_UINT BOOL BIGGER LOWER OPENKEY CLOSEKEY WRITE WORD SYMBOL NEWLINE ENUM INCLUDE
%token COLON SEMICOLON RANGE OPENPAR CLOSEPAR TWODOUBLEPOINTS OPENCORCH CLOSECORCH SWITCH CASE DEFAULT BREAK
%token COLON SEMICOLON RANGE OPENPAR CLOSEPAR TWODOUBLEPOINTS OPENCORCH CLOSECORCH SWITCH CASE DEFAULT BREAK
%token SC_BIGINT SC_BIGUINT HEXA DEFINE READ TRANSLATEOFF TRANSLATEON VERILOGBEGIN VERILOGEND TAB DOLLAR INTCONV
%token SC_BIGINT SC_BIGUINT HEXA DEFINE READ TRANSLATEOFF TRANSLATEON VERILOGBEGIN VERILOGEND TAB DOLLAR INTCONV
%token VOID
%token VOID TTRUE TFALSE
%token PIFDEF PENDDEF PELSE
%token PIFDEF PENDDEF PELSE
 
 
%%
%%
 
 
commands: /* empty */
commands: /* empty */
Line 205... Line 205...
        |
        |
        ifdef
        ifdef
        |
        |
        endif
        endif
        |
        |
        else
        pelse
 
        |
 
        ttrue
 
        |
 
        tfalse
        ;
        ;
 
 
 
 
 
 
voidword:
voidword:
Line 661... Line 665...
                                        regname2 = (char *)malloc(256*sizeof(int));
                                        regname2 = (char *)malloc(256*sizeof(int));
                                }
                                }
                                if(processfound)
                                if(processfound)
                                        if(openedkeys != switchparenthesis)
                                        if(openedkeys != switchparenthesis)
                                        {
                                        {
 
                                            fprintf(file,"\n");
                                                for(i = 0; i < openedkeys; i++)
                                                for(i = 0; i < openedkeys; i++)
                                                        fprintf(file,"   ");
                                                        fprintf(file,"   ");
                                                fprintf(file,"begin\n");
                                                fprintf(file,"begin\n");
                                                newline = 1;
                                                newline = 1;
                                        }
                                        }
Line 937... Line 942...
                                        fprintf(FILE_DEFINES,"`endif");
                                        fprintf(FILE_DEFINES,"`endif");
                                }
                                }
                        }else if(verilog==1)
                        }else if(verilog==1)
                       fprintf(file,"#endif");
                       fprintf(file,"#endif");
                        };
                        };
else:
pelse:
       PELSE
       PELSE
           {
           {
            if(translate==1&& verilog==0){
            if(translate==1&& verilog==0){
                                if(processfound)
                                if(processfound)
                                {
                                {
Line 952... Line 957...
                                        fprintf(FILE_DEFINES,"`else");
                                        fprintf(FILE_DEFINES,"`else");
                                }
                                }
                        }else if(verilog==1)
                        }else if(verilog==1)
                       fprintf(file,"#else");
                       fprintf(file,"#else");
                        };
                        };
 
ttrue:
 
      TTRUE
 
          {
 
                if(translate==1&& verilog==0){
 
                                if(processfound)
 
                                {
 
                                        fprintf(file,"1");
 
                                }
 
                        }else if(verilog==1)
 
                       fprintf(file,"1");
 
                        };
 
 
 
 
 
tfalse:
 
      TFALSE
 
          {
 
                if(translate==1&& verilog==0){
 
                                if(processfound)
 
                                {
 
                                        fprintf(file,"0");
 
                                }
 
                        }else if(verilog==1)
 
                       fprintf(file,"0");
 
                        };

powered by: WebSVN 2.1.0

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