#include "bddBdd.h"
#include "relStatement.h"
#include "FlexLexer.h"
#include "relReaderWriter.h"
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <csignal>
#include <unistd.h>
#include <time.h>
Include dependency graph for crocopat.cpp:

Go to the source code of this file.
Defines | |
| #define | STRINGIFY(x) #x |
| #define | EXPAND(x) STRINGIFY(x) |
Functions | |
| int | yyparse (void) |
| Global function. | |
| double | string2double (string pStr) |
| string | double2string (double pNum) |
| Global function. | |
| string | unsigned2string (unsigned pUnsigned) |
| Global functions. | |
| double | elapsed () |
| Global function. | |
| void | signal_handler (int pSignal) |
| Signal handler. | |
| bool | readValue (string &pValue, int pLineNo) |
| Reads a next value into 'pValue', uses global configuration set by file2vector (gReadPos). | |
| void | file2vector (istream &pDataInStream, vector< vector< string > > &pRelationVector) |
| Reads a relation from a stream into a vector. | |
| void | createBddRelation (vector< vector< string > > &pRelation) |
| Create BDD representation for relation. | |
| void | printVersion (void) |
| void | printHelp (void) |
| Print usage and info message. | |
| int | crocopat (int argc, char *argv[]) |
| Main program. | |
Variables | |
| yyFlexLexer | gScanner |
| Global variables for scanner, parser, interpreter.. | |
| int | gNoParseErrs = 0 |
| bddSymTab * | gSymTab = NULL |
| relStatement * | gSyntaxTree = NULL |
| map< string, relDataType * > | gVariables |
| Global variables for interpreter. | |
| bool | gPrintWarnings = true |
| const unsigned | gRSFLineLength = 100000 |
| Global variable for BDD init, RSF reader, symtab init. | |
| const char * | gRSFDelimiter = " \t\f\r\v\n" |
| char * | gReadPos = NULL |
| const unsigned | gAttributeNum = 1000 |
| const char | gAttributePrefix = '.' |
| set< string > | gValueUniverse |
| clock_t | gStart = 0 |
| Time measurement. | |
| char ** | gArgv |
| Cmd line arg handling for the interpreter. | |
| int | gArgc |
| #define EXPAND | ( | x | ) | STRINGIFY(x) |
| #define STRINGIFY | ( | x | ) | #x |
Definition at line 284 of file crocopat.cpp.
| void createBddRelation | ( | vector< vector< string > > & | pRelation | ) |
Create BDD representation for relation.
Parser already added symbols to the symbol table. Load all relations and assign them to relation variables. (pRelation) contains a set of triples of form (rel, x, y). (rel) is the name of the relation (variable name), (x, y) is the pair of the binary relation.
Definition at line 228 of file crocopat.cpp.
References gAttributeNum, gAttributePrefix, gPrintWarnings, gSymTab, gVariables, bddRelation::intersect(), bddRelation::mArity, bddRelation::mkAttributeValue(), bddRelation::unite(), and unsigned2string().
Referenced by crocopat().
Here is the call graph for this function:

Here is the caller graph for this function:

| int crocopat | ( | int | argc, | |
| char * | argv[] | |||
| ) |
Main program.
Definition at line 324 of file crocopat.cpp.
References bddSymTab::addAttribute(), bddRelation::complement(), createBddRelation(), bddBdd::done(), file2vector(), gArgc, gArgv, gAttributeNum, gAttributePrefix, relObject::GetCount(), gNoParseErrs, gPrintWarnings, gScanner, gStart, gSymTab, gSyntaxTree, gValueUniverse, gVariables, bddBdd::init(), bddSymTab::initValueUniverse(), relStatement::interpret(), bddRelation::mkEqual(), bddRelation::mkLess(), printHelp(), printVersion(), signal_handler(), bddRelation::unite(), unsigned2string(), yyparse(), and yyFlexLexer::yyrestart().
Referenced by main().
Here is the call graph for this function:

Here is the caller graph for this function:

| string double2string | ( | double | pNum | ) |
Global function.
Definition at line 82 of file crocopat.cpp.
Referenced by relStrExprNum::interpret().
Here is the caller graph for this function:

| double elapsed | ( | ) |
Global function.
Definition at line 104 of file crocopat.cpp.
References gStart.
Referenced by relNumExprTimeElapsed::interpret().
Here is the caller graph for this function:

| void file2vector | ( | istream & | pDataInStream, | |
| vector< vector< string > > & | pRelationVector | |||
| ) |
Reads a relation from a stream into a vector.
Definition at line 170 of file crocopat.cpp.
References gReadPos, gRSFLineLength, gSymTab, gValueUniverse, gVariables, readValue(), and bddSymTab::setQuoted().
Referenced by crocopat().
Here is the call graph for this function:

Here is the caller graph for this function:

| void printHelp | ( | void | ) |
Print usage and info message.
Definition at line 298 of file crocopat.cpp.
Referenced by crocopat().
Here is the caller graph for this function:

| void printVersion | ( | void | ) |
Definition at line 287 of file crocopat.cpp.
References EXPAND.
Referenced by crocopat().
Here is the caller graph for this function:

| bool readValue | ( | string & | pValue, | |
| int | pLineNo | |||
| ) |
Reads a next value into 'pValue', uses global configuration set by file2vector (gReadPos).
Returns false, if no more values available at current line.
Definition at line 127 of file crocopat.cpp.
References gPrintWarnings, gReadPos, and gRSFDelimiter.
Referenced by file2vector().
Here is the caller graph for this function:

| void signal_handler | ( | int | pSignal | ) |
Signal handler.
'pSignal' is the signal number to handle. Will install this signal handler for keyboard interrupt (C-c).
Definition at line 115 of file crocopat.cpp.
Referenced by crocopat().
Here is the caller graph for this function:

| double string2double | ( | string | pStr | ) |
Definition at line 75 of file crocopat.cpp.
Referenced by relNumExprStr::interpret(), and relNumExprUnOp::interpret().
Here is the caller graph for this function:

| string unsigned2string | ( | unsigned | pUnsigned | ) |
| int yyparse | ( | void | ) |
| int gArgc |
Definition at line 70 of file crocopat.cpp.
Referenced by crocopat(), and relStrCmdArg::interpret().
| char** gArgv |
Cmd line arg handling for the interpreter.
Definition at line 69 of file crocopat.cpp.
Referenced by crocopat(), and relStrCmdArg::interpret().
| const unsigned gAttributeNum = 1000 |
Definition at line 61 of file crocopat.cpp.
Referenced by createBddRelation(), crocopat(), and relExprRelVar::interpret().
| const char gAttributePrefix = '.' |
Definition at line 62 of file crocopat.cpp.
Referenced by createBddRelation(), crocopat(), relStmtFor::interpret(), relStmtWhile::interpret(), relStmtIf::interpret(), relStmtPrint::interpret(), relStmtAssignStr::interpret(), relStmtAssignNum::interpret(), relStmtAssign::interpret(), relPrintExprBDT::interpret(), relPrintExprGraph::interpret(), relPrintExprNodesPerVarId::interpret(), relPrintExprRelInfo::interpret(), relPrintExprValues::interpret(), relPrintExprInt::interpret(), relPrintExprString::interpret(), and relExprRelVar::interpret().
| int gNoParseErrs = 0 |
| bool gPrintWarnings = true |
Definition at line 55 of file crocopat.cpp.
Referenced by createBddRelation(), crocopat(), relStmtWhile::interpret(), relStmtIf::interpret(), relExprRegExTerm::interpret(), relExprRelVar::interpret(), and readValue().
| char* gReadPos = NULL |
| const char* gRSFDelimiter = " \t\f\r\v\n" |
| const unsigned gRSFLineLength = 100000 |
Global variable for BDD init, RSF reader, symtab init.
Definition at line 58 of file crocopat.cpp.
Referenced by file2vector().
Global variables for scanner, parser, interpreter..
Definition at line 50 of file crocopat.cpp.
Referenced by crocopat().
| clock_t gStart = 0 |
Time measurement.
Definition at line 66 of file crocopat.cpp.
Referenced by crocopat(), and elapsed().
Definition at line 52 of file crocopat.cpp.
Referenced by relExprRegExTerm::collectFreeAttrs(), relExprExists::collectFreeAttrs(), relExprRelVar::collectFreeAttrs(), createBddRelation(), crocopat(), and file2vector().
| relStatement* gSyntaxTree = NULL |
| set<string> gValueUniverse |
| map<string, relDataType*> gVariables |
Global variables for interpreter.
Definition at line 54 of file crocopat.cpp.
Referenced by createBddRelation(), crocopat(), file2vector(), relStrExprVar::interpret(), relStmtFor::interpret(), relStmtExec::interpret(), relStmtAssignStr::interpret(), relStmtAssignNum::interpret(), relStmtAssign::interpret(), relNumExprVar::interpret(), and relExprRelVar::interpret().
1.5.1