diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2010-11-01 01:35:04 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2010-11-01 01:35:04 -0700 |
commit | 6130e39b18b5f53902e4eab14f6d5cdde5219563 (patch) | |
tree | 0db0628479a1b750e9af1f66cb8379ebd0913d31 /src/bdd/parse | |
parent | f0e77f6797c0504b0da25a56152b707d3357f386 (diff) | |
download | abc-6130e39b18b5f53902e4eab14f6d5cdde5219563.tar.gz abc-6130e39b18b5f53902e4eab14f6d5cdde5219563.tar.bz2 abc-6130e39b18b5f53902e4eab14f6d5cdde5219563.zip |
initial commit of public abc
Diffstat (limited to 'src/bdd/parse')
-rw-r--r-- | src/bdd/parse/parse.h | 8 | ||||
-rw-r--r-- | src/bdd/parse/parseCore.c | 13 | ||||
-rw-r--r-- | src/bdd/parse/parseEqn.c | 15 | ||||
-rw-r--r-- | src/bdd/parse/parseInt.h | 16 | ||||
-rw-r--r-- | src/bdd/parse/parseStack.c | 13 |
5 files changed, 47 insertions, 18 deletions
diff --git a/src/bdd/parse/parse.h b/src/bdd/parse/parse.h index 4923fbdd..5c97dd4e 100644 --- a/src/bdd/parse/parse.h +++ b/src/bdd/parse/parse.h @@ -19,6 +19,10 @@ #ifndef __PARSE_H__ #define __PARSE_H__ + +ABC_NAMESPACE_HEADER_START + + //////////////////////////////////////////////////////////////////////// /// INCLUDES /// //////////////////////////////////////////////////////////////////////// @@ -47,6 +51,10 @@ extern DdNode * Parse_FormulaParser( FILE * pOutput, char * pFormula, int nVars, int nRanks, char * ppVarNames[], DdManager * dd, DdNode * pbVars[] ); + + +ABC_NAMESPACE_HEADER_END + #endif //////////////////////////////////////////////////////////////////////// diff --git a/src/bdd/parse/parseCore.c b/src/bdd/parse/parseCore.c index 85200dd9..497d603c 100644 --- a/src/bdd/parse/parseCore.c +++ b/src/bdd/parse/parseCore.c @@ -43,6 +43,9 @@ #include "parseInt.h" +ABC_NAMESPACE_IMPL_START + + // the list of operation symbols to be used in expressions #define PARSE_SYM_OPEN '(' // opening paranthesis #define PARSE_SYM_CLOSE ')' // closing paranthesis @@ -342,7 +345,7 @@ DdNode * Parse_FormulaParser( FILE * pOutput, char * pFormulaInit, int nVars, in if ( fLower ) { - bFunc = Parse_StackFnPop( pStackFn ); + bFunc = (DdNode *)Parse_StackFnPop( pStackFn ); bFunc = Extra_bddMove( dd, bTemp = bFunc, -nVars ); Cudd_Ref( bFunc ); Cudd_RecursiveDeref( dd, bTemp ); Parse_StackFnPush( pStackFn, bFunc ); @@ -465,7 +468,7 @@ DdNode * Parse_FormulaParser( FILE * pOutput, char * pFormulaInit, int nVars, in { if ( !Parse_StackFnIsEmpty(pStackFn) ) { - bFunc = Parse_StackFnPop(pStackFn); + bFunc = (DdNode *)Parse_StackFnPop(pStackFn); if ( Parse_StackFnIsEmpty(pStackFn) ) if ( Parse_StackOpIsEmpty(pStackOp) ) { @@ -502,8 +505,8 @@ DdNode * Parse_ParserPerformTopOp( DdManager * dd, Parse_StackFn_t * pStackFn, i { DdNode * bArg1, * bArg2, * bFunc; // perform the given operation - bArg2 = Parse_StackFnPop( pStackFn ); - bArg1 = Parse_StackFnPop( pStackFn ); + bArg2 = (DdNode *)Parse_StackFnPop( pStackFn ); + bArg1 = (DdNode *)Parse_StackFnPop( pStackFn ); if ( Oper == PARSE_OPER_AND ) bFunc = Cudd_bddAnd( dd, bArg1, bArg2 ); else if ( Oper == PARSE_OPER_XOR ) @@ -529,3 +532,5 @@ DdNode * Parse_ParserPerformTopOp( DdManager * dd, Parse_StackFn_t * pStackFn, i //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// +ABC_NAMESPACE_IMPL_END + diff --git a/src/bdd/parse/parseEqn.c b/src/bdd/parse/parseEqn.c index eceecc0c..55b9c2f0 100644 --- a/src/bdd/parse/parseEqn.c +++ b/src/bdd/parse/parseEqn.c @@ -25,6 +25,9 @@ #include "vec.h" #include "hop.h" +ABC_NAMESPACE_IMPL_START + + // the list of operation symbols to be used in expressions #define PARSE_EQN_SYM_OPEN '(' // opening paranthesis #define PARSE_EQN_SYM_CLOSE ')' // closing paranthesis @@ -213,7 +216,7 @@ Hop_Obj_t * Parse_FormulaParserEqn( FILE * pOutput, char * pFormInit, Vec_Ptr_t } // variable name is found fFound = 0; - Vec_PtrForEachEntry( vVarNames, pName, v ) + Vec_PtrForEachEntry( char *, vVarNames, pName, v ) if ( strncmp(pTemp, pName, i) == 0 && strlen(pName) == (unsigned)i ) { pTemp += i-1; @@ -254,7 +257,7 @@ Hop_Obj_t * Parse_FormulaParserEqn( FILE * pOutput, char * pFormInit, Vec_Ptr_t } else { - Parse_StackFnPush( pStackFn, Hop_Not(Parse_StackFnPop(pStackFn)) ); + Parse_StackFnPush( pStackFn, Hop_Not((Hop_Obj_t *)Parse_StackFnPop(pStackFn)) ); } } else // if ( Flag == PARSE_EQN_FLAG_OPER ) @@ -291,7 +294,7 @@ Hop_Obj_t * Parse_FormulaParserEqn( FILE * pOutput, char * pFormInit, Vec_Ptr_t { if ( !Parse_StackFnIsEmpty(pStackFn) ) { - gFunc = Parse_StackFnPop(pStackFn); + gFunc = (Hop_Obj_t *)Parse_StackFnPop(pStackFn); if ( Parse_StackFnIsEmpty(pStackFn) ) if ( Parse_StackOpIsEmpty(pStackOp) ) { @@ -328,8 +331,8 @@ Hop_Obj_t * Parse_ParserPerformTopOp( Hop_Man_t * pMan, Parse_StackFn_t * pStack { Hop_Obj_t * gArg1, * gArg2, * gFunc; // perform the given operation - gArg2 = Parse_StackFnPop( pStackFn ); - gArg1 = Parse_StackFnPop( pStackFn ); + gArg2 = (Hop_Obj_t *)Parse_StackFnPop( pStackFn ); + gArg1 = (Hop_Obj_t *)Parse_StackFnPop( pStackFn ); if ( Oper == PARSE_EQN_OPER_AND ) gFunc = Hop_And( pMan, gArg1, gArg2 ); else if ( Oper == PARSE_EQN_OPER_OR ) @@ -347,3 +350,5 @@ Hop_Obj_t * Parse_ParserPerformTopOp( Hop_Man_t * pMan, Parse_StackFn_t * pStack //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// +ABC_NAMESPACE_IMPL_END + diff --git a/src/bdd/parse/parseInt.h b/src/bdd/parse/parseInt.h index 17f48375..f0f3f302 100644 --- a/src/bdd/parse/parseInt.h +++ b/src/bdd/parse/parseInt.h @@ -19,16 +19,20 @@ #ifndef __PARSE_INT_H__ #define __PARSE_INT_H__ + //////////////////////////////////////////////////////////////////////// /// INCLUDES /// //////////////////////////////////////////////////////////////////////// #include <stdio.h> -#include "cuddInt.h" #include "extra.h" +#include "cuddInt.h" #include "parse.h" +ABC_NAMESPACE_HEADER_START + + //////////////////////////////////////////////////////////////////////// /// PARAMETERS /// //////////////////////////////////////////////////////////////////////// @@ -37,8 +41,6 @@ /// STRUCTURE DEFINITIONS /// //////////////////////////////////////////////////////////////////////// -typedef int bool; - typedef struct ParseStackFnStruct Parse_StackFn_t; // the function stack typedef struct ParseStackOpStruct Parse_StackOp_t; // the operation stack @@ -56,17 +58,21 @@ typedef struct ParseStackOpStruct Parse_StackOp_t; // the operation stack /*=== parseStack.c =============================================================*/ extern Parse_StackFn_t * Parse_StackFnStart ( int nDepth ); -extern bool Parse_StackFnIsEmpty( Parse_StackFn_t * p ); +extern int Parse_StackFnIsEmpty( Parse_StackFn_t * p ); extern void Parse_StackFnPush ( Parse_StackFn_t * p, void * bFunc ); extern void * Parse_StackFnPop ( Parse_StackFn_t * p ); extern void Parse_StackFnFree ( Parse_StackFn_t * p ); extern Parse_StackOp_t * Parse_StackOpStart ( int nDepth ); -extern bool Parse_StackOpIsEmpty( Parse_StackOp_t * p ); +extern int Parse_StackOpIsEmpty( Parse_StackOp_t * p ); extern void Parse_StackOpPush ( Parse_StackOp_t * p, int Oper ); extern int Parse_StackOpPop ( Parse_StackOp_t * p ); extern void Parse_StackOpFree ( Parse_StackOp_t * p ); + + +ABC_NAMESPACE_HEADER_END + #endif //////////////////////////////////////////////////////////////////////// diff --git a/src/bdd/parse/parseStack.c b/src/bdd/parse/parseStack.c index 7ce488f1..2e6d266d 100644 --- a/src/bdd/parse/parseStack.c +++ b/src/bdd/parse/parseStack.c @@ -18,6 +18,9 @@ #include "parseInt.h" +ABC_NAMESPACE_IMPL_START + + //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// @@ -72,9 +75,9 @@ Parse_StackFn_t * Parse_StackFnStart( int nDepth ) SeeAlso [] ***********************************************************************/ -bool Parse_StackFnIsEmpty( Parse_StackFn_t * p ) +int Parse_StackFnIsEmpty( Parse_StackFn_t * p ) { - return (bool)(p->Top == 0); + return (int)(p->Top == 0); } /**Function************************************************************* @@ -171,9 +174,9 @@ Parse_StackOp_t * Parse_StackOpStart( int nDepth ) SeeAlso [] ***********************************************************************/ -bool Parse_StackOpIsEmpty( Parse_StackOp_t * p ) +int Parse_StackOpIsEmpty( Parse_StackOp_t * p ) { - return (bool)(p->Top == 0); + return (int)(p->Top == 0); } /**Function************************************************************* @@ -241,3 +244,5 @@ void Parse_StackOpFree( Parse_StackOp_t * p ) //////////////////////////////////////////////////////////////////////// +ABC_NAMESPACE_IMPL_END + |