INCLUDES ///.
Date [Ver. 1.0. Started - September 8, 2003.]
]PARAMETERS ///STRUCTURE DEFINITIONS ///GLOBAL VARIABLES ///MACRO DEFINITIONS ///FUNCTION DEFINITIONS ///
INCLUDES ///.
Description [Takes the stream to output messages, the formula, the number variables and the rank in the formula. The array of variable names is also given. The BDD manager and the elementary 0-rank variable are the last two arguments. The manager should have at least as many variables as nVars * (nRanks + 1). The 0-rank variables should have numbers larger than the variables of other ranks.]
124 int nParans, fFound, Flag;
125 int Oper, Oper1, Oper2;
130 if ( nVars * (nRanks + 1) > dd->
size )
132 printf(
"Parse_FormulaParser(): The BDD manager does not have enough variables.\n" );
138 for ( pTemp = pFormulaInit; *pTemp; pTemp++ )
141 else if ( *pTemp ==
')' )
145 fprintf( pOutput,
"Parse_FormulaParser(): Different number of opening and closing parantheses ().\n" );
150 for ( pTemp = pFormulaInit; *pTemp; pTemp++ )
153 else if ( *pTemp ==
']' )
157 fprintf( pOutput,
"Parse_FormulaParser(): Different number of opening and closing brackets [].\n" );
163 sprintf( pFormula,
"(%s)", pFormulaInit );
171 for ( pTemp = pFormula; *pTemp; pTemp++ )
187 fprintf( pOutput,
"Parse_FormulaParser(): No operation symbol before constant 0.\n" );
199 fprintf( pOutput,
"Parse_FormulaParser(): No operation symbol before constant 1.\n" );
219 fprintf( pOutput,
"Parse_FormulaParser(): No variable is specified before the negation suffix.\n" );
234 fprintf( pOutput,
"Parse_FormulaParser(): There is no variable before AND, EXOR, or OR.\n" );
250 fprintf( pOutput,
"Parse_FormulaParser(): There is no variable before Equivalence or Implication\n" );
283 fprintf( pOutput,
"Parse_FormulaParser(): Wrong symbol after \"%c\"\n",
PARSE_SYM_EQU1 );
293 fprintf( pOutput,
"Parse_FormulaParser(): There is no variable before Reverse Implication\n" );
304 fprintf( pOutput,
"Parse_FormulaParser(): Wrong symbol after \"%c\"\n",
PARSE_SYM_EQU2 );
329 fprintf( pOutput,
"Parse_FormulaParser(): There is no opening paranthesis\n" );
340 fprintf( pOutput,
"Parse_FormulaParser(): Unknown operation\n" );
356 fprintf( pOutput,
"Parse_FormulaParser(): There is no opening paranthesis\n" );
385 for ( i = 0; pTemp[i] && pTemp[i] !=
' ' && pTemp[i] !=
'\t' && pTemp[i] !=
'\r' && pTemp[i] !=
'\n' &&
392 for ( v = 0; v < nVars; v++ )
394 if (
strncmp( pTemp, ppVarNames[v], i ) == 0 &&
strlen(ppVarNames[v]) == (
unsigned)(i) )
404 fprintf( pOutput,
"Parse_FormulaParser(): The parser cannot find var \"%s\" in the input var list.\n", pTemp );
447 if ( Oper2 >= Oper1 )
452 fprintf( pOutput,
"Parse_FormulaParser(): Unknown operation\n" );
482 fprintf( pOutput,
"Parse_FormulaParser(): Something is left in the operation stack\n" );
484 fprintf( pOutput,
"Parse_FormulaParser(): Something is left in the function stack\n" );
487 fprintf( pOutput,
"Parse_FormulaParser(): The input string is empty\n" );
#define PARSE_SYM_OPEN
DECLARATIONS ///.
Parse_StackOp_t * Parse_StackOpStart(int nDepth)
void Cudd_RecursiveDeref(DdManager *table, DdNode *n)
#define PARSE_SYM_NEGBEF2
void * Parse_StackFnPop(Parse_StackFn_t *p)
void Cudd_Deref(DdNode *node)
#define ABC_ALLOC(type, num)
void Parse_StackFnFree(Parse_StackFn_t *p)
int Parse_StackFnIsEmpty(Parse_StackFn_t *p)
int Parse_StackOpIsEmpty(Parse_StackOp_t *p)
static DdNode * Parse_ParserPerformTopOp(DdManager *dd, Parse_StackFn_t *pStackFn, int Oper)
#define PARSE_SYM_NEGBEF1
void Parse_StackOpPush(Parse_StackOp_t *p, int Oper)
typedefABC_NAMESPACE_HEADER_START struct ParseStackFnStruct Parse_StackFn_t
INCLUDES ///.
void Parse_StackOpFree(Parse_StackOp_t *p)
void Parse_StackFnPush(Parse_StackFn_t *p, void *bFunc)
Parse_StackFn_t * Parse_StackFnStart(int nDepth)
GLOBAL VARIABLES ///.
int Parse_StackOpPop(Parse_StackOp_t *p)