src/base/ver/verParse.c File Reference

#include "ver.h"
Include dependency graph for verParse.c:

Go to the source code of this file.

Functions

int Ver_ParseSkipComments (Ver_Man_t *pMan)
char * Ver_ParseGetName (Ver_Man_t *pMan)

Function Documentation

char* Ver_ParseGetName ( Ver_Man_t pMan  ) 

Function*************************************************************

Synopsis [Parses a Verilog name that can be being with a slash.]

Description []

SideEffects []

SeeAlso []

Definition at line 88 of file verParse.c.

00089 {
00090     Ver_Stream_t * p = pMan->pReader;
00091     char Symbol;
00092     char * pWord;
00093     pMan->fNameLast = 0;
00094     if ( !Ver_StreamIsOkey(p) )
00095         return NULL;
00096     if ( !Ver_ParseSkipComments( pMan ) )
00097         return NULL;
00098     Symbol = Ver_StreamScanChar( p );
00099     if ( Symbol == '\\' )
00100     {
00101         pMan->fNameLast = 1;
00102         Ver_StreamPopChar( p );
00103         pWord = Ver_StreamGetWord( p, " \r\n" );
00104     }
00105     else
00106         pWord = Ver_StreamGetWord( p, " \t\n\r(),;" );
00107     if ( !Ver_ParseSkipComments( pMan ) )
00108         return NULL;
00109     return pWord;
00110 }

int Ver_ParseSkipComments ( Ver_Man_t pMan  ) 

CFile****************************************************************

FileName [verParse.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Verilog parser.]

Synopsis [Performs some Verilog parsing tasks.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - August 19, 2006.]

Revision [

Id
verParse.c,v 1.00 2006/08/19 00:00:00 alanmi Exp

] DECLARATIONS /// FUNCTION DEFINITIONS ///Function*************************************************************

Synopsis [Skips the comments of they are present.]

Description []

SideEffects []

SeeAlso []

Definition at line 42 of file verParse.c.

00043 {
00044     Ver_Stream_t * p = pMan->pReader;
00045     char Symbol;
00046     // skip spaces
00047     Ver_StreamSkipChars( p, " \t\n\r" );
00048     if ( !Ver_StreamIsOkey(pMan->pReader) )
00049         return 1;
00050     // read the first symbol
00051     Symbol = Ver_StreamScanChar( p );
00052     if ( Symbol != '/' )
00053         return 1;
00054     Ver_StreamPopChar( p );
00055     // read the second symbol
00056     Symbol = Ver_StreamScanChar( p );
00057     if ( Symbol == '/' )
00058     { // skip till the end of line
00059         Ver_StreamSkipToChars( p, "\n" );
00060         return Ver_ParseSkipComments( pMan );
00061     }
00062     if ( Symbol == '*' )
00063     { // skip till the next occurance of */
00064         Ver_StreamPopChar( p );
00065         do {
00066             Ver_StreamSkipToChars( p, "*" );
00067             Ver_StreamPopChar( p );
00068         } while ( Ver_StreamScanChar( p ) != '/' );
00069         Ver_StreamPopChar( p );
00070         return Ver_ParseSkipComments( pMan );
00071     }
00072     sprintf( pMan->sError, "Cannot parse after symbol \"/\"." );
00073     Ver_ParsePrintErrorMessage( pMan );
00074     return 0;
00075 }


Generated on Tue Jan 5 12:18:50 2010 for abc70930 by  doxygen 1.6.1