ParsedData Class Reference

#include <Parser.h>

Collaboration diagram for ParsedData:

Collaboration graph
[legend]

Public Member Functions

 ParsedData ()
void setStmtType (StatementType type)
void setTableName (char *name)
void setIndexName (char *name)
char * getTableName ()
char * getIndexName ()
void insertValue (char *value)
void insertInValue (char *value)
void ** insertCondValueAndGetPtr (char *fName, char *value)
void insertUpdateValue (char *fldName, char *value)
void insertField (char *fName)
void clearFieldNameList ()
PredicateinsertPredicate (char *fldName, ComparisionOp op, void **value)
PredicateinsertPredicate (char *fldName, ComparisionOp op, char *fldName)
PredicateinsertPredicate (Predicate *p1, LogicalOp op, Predicate *p2=NULL)
void setCondition (Predicate *pred)
ConditiongetCondition ()
void insertFieldValue (FieldValue *newVal)
List getFieldNameList ()
List getConditionValueList ()
List getFieldValueList ()
List getInValueList ()
List getUpdateFieldValueList ()
void setFldName (char *name)
void setFldType (DataType type)
void setFldLength (size_t length)
void setDefaultValue (char *value)
void setFldNotNull (bool notNull)
void setUnique (bool unique)
void setPrimary (bool primary)
void setIndexType (IndexType type)
IndexType getIndexType ()
bool getUnique ()
bool getPrimary ()
void insertFldDef ()
FieldList getCreFldList ()
StatementType getStmtType ()
void reset ()
 ParsedData ()
void setStmtType (StatementType type)
void setTableName (char *name)
void setIndexName (char *name)
char * getTableName ()
char * getIndexName ()
void insertValue (char *value)
void insertInValue (char *value)
void ** insertCondValueAndGetPtr (char *fName, char *value)
void insertUpdateValue (char *fldName, char *value)
void insertField (char *fName)
void clearFieldNameList ()
PredicateinsertPredicate (char *fldName, ComparisionOp op, void **value)
PredicateinsertPredicate (char *fldName, ComparisionOp op, char *fldName)
PredicateinsertPredicate (Predicate *p1, LogicalOp op, Predicate *p2=NULL)
void setCondition (Predicate *pred)
ConditiongetCondition ()
void insertFieldValue (FieldValue *newVal)
List getFieldNameList ()
List getConditionValueList ()
List getFieldValueList ()
List getInValueList ()
List getUpdateFieldValueList ()
void setFldName (char *name)
void setFldType (DataType type)
void setFldLength (size_t length)
void setDefaultValue (char *value)
void setFldNotNull (bool notNull)
void setUnique (bool unique)
void setPrimary (bool primary)
void setIndexType (IndexType type)
IndexType getIndexType ()
bool getUnique ()
bool getPrimary ()
void insertFldDef ()
FieldList getCreFldList ()
StatementType getStmtType ()
void reset ()

Detailed Description

Definition at line 74 of file Parser.h.


Constructor & Destructor Documentation

ParsedData::ParsedData (  )  [inline]

Definition at line 121 of file Parser.h.

References hashIndex, and UnknownStatement.

00121                  { paramCounter = 0; stmtType = UnknownStatement; 
00122                  isUnique = false; isPrimary = false; indexType = hashIndex;} 

ParsedData::ParsedData (  )  [inline]

Definition at line 121 of file Parser.h.

References hashIndex, and UnknownStatement.

00121                  { paramCounter = 0; stmtType = UnknownStatement; 
00122                  isUnique = false; isPrimary = false; indexType = hashIndex;} 


Member Function Documentation

void ParsedData::clearFieldNameList (  ) 

void ParsedData::clearFieldNameList (  ) 

Definition at line 153 of file ParsedData.cxx.

References List::reset().

00154 {
00155     fieldNameList.reset();
00156 }

Here is the call graph for this function:

Condition* ParsedData::getCondition (  )  [inline]

Definition at line 148 of file Parser.h.

00148 { return &predicate; }

Condition* ParsedData::getCondition (  )  [inline]

Definition at line 148 of file Parser.h.

Referenced by UpdStatement::resolve(), SelStatement::resolve(), and DelStatement::resolve().

00148 { return &predicate; }

Here is the caller graph for this function:

List ParsedData::getConditionValueList (  )  [inline]

Definition at line 153 of file Parser.h.

00153 { return conditionValueList; }

List ParsedData::getConditionValueList (  )  [inline]

Definition at line 153 of file Parser.h.

Referenced by UpdStatement::resolveForAssignment(), and DelStatement::resolveForCondition().

00153 { return conditionValueList; }

Here is the caller graph for this function:

FieldList ParsedData::getCreFldList (  )  [inline]

Definition at line 174 of file Parser.h.

00174 { return creFldList; }

FieldList ParsedData::getCreFldList (  )  [inline]

Definition at line 174 of file Parser.h.

Referenced by CreateTblStatement::resolve().

00174 { return creFldList; }

Here is the caller graph for this function:

List ParsedData::getFieldNameList (  )  [inline]

Definition at line 152 of file Parser.h.

00152 { return fieldNameList; }

List ParsedData::getFieldNameList (  )  [inline]

Definition at line 152 of file Parser.h.

Referenced by CreateIdxStatement::execute(), CreateTblStatement::execute(), SelStatement::getFieldName(), SelStatement::getProjFldInfo(), SelStatement::resolve(), InsStatement::resolve(), and CreateTblStatement::resolve().

00152 { return fieldNameList; }

Here is the caller graph for this function:

List ParsedData::getFieldValueList (  )  [inline]

Definition at line 154 of file Parser.h.

00154 { return fieldValueList; }

List ParsedData::getFieldValueList (  )  [inline]

Definition at line 154 of file Parser.h.

Referenced by InsStatement::resolve().

00154 { return fieldValueList; }

Here is the caller graph for this function:

char* ParsedData::getIndexName (  )  [inline]

Definition at line 128 of file Parser.h.

00128 { return idxName; }

char* ParsedData::getIndexName (  )  [inline]

Definition at line 128 of file Parser.h.

Referenced by DropIdxStatement::execute(), and CreateIdxStatement::execute().

00128 { return idxName; }

Here is the caller graph for this function:

IndexType ParsedData::getIndexType (  )  [inline]

Definition at line 168 of file Parser.h.

00168 { return indexType; }

IndexType ParsedData::getIndexType (  )  [inline]

Definition at line 168 of file Parser.h.

Referenced by CreateIdxStatement::execute().

00168 { return indexType; }

Here is the caller graph for this function:

List ParsedData::getInValueList (  )  [inline]

Definition at line 155 of file Parser.h.

00155 { return inValueList; }

List ParsedData::getInValueList (  )  [inline]

Definition at line 155 of file Parser.h.

Referenced by yyparse().

00155 { return inValueList; }

Here is the caller graph for this function:

bool ParsedData::getPrimary (  )  [inline]

Definition at line 170 of file Parser.h.

00170 { return isPrimary; }

bool ParsedData::getPrimary (  )  [inline]

Definition at line 170 of file Parser.h.

Referenced by CreateIdxStatement::execute().

00170 { return isPrimary; }

Here is the caller graph for this function:

StatementType ParsedData::getStmtType (  )  [inline]

Definition at line 176 of file Parser.h.

00176 { return stmtType; }

StatementType ParsedData::getStmtType (  )  [inline]

Definition at line 176 of file Parser.h.

Referenced by SqlStatement::bindField(), SqlStatement::close(), SqlStatement::fetch(), SqlStatement::fetchAndPrint(), SqlStatement::getFieldLength(), SqlStatement::getFieldName(), SqlStatement::getFieldType(), SqlStatement::getFieldValuePtr(), SqlStatement::getParamFldInfo(), SqlStatement::getProjFldInfo(), StatementFactory::getStatement(), SqlStatement::isSelect(), SqlStatement::next(), and SqlStatement::noOfProjFields().

00176 { return stmtType; }

Here is the caller graph for this function:

char* ParsedData::getTableName (  )  [inline]

Definition at line 127 of file Parser.h.

00127 { return tblName; }

char* ParsedData::getTableName (  )  [inline]

Definition at line 127 of file Parser.h.

Referenced by DropTblStatement::execute(), CreateIdxStatement::execute(), SqlStatement::getTableName(), UpdStatement::resolve(), SelStatement::resolve(), InsStatement::resolve(), DelStatement::resolve(), and CreateTblStatement::resolve().

00127 { return tblName; }

Here is the caller graph for this function:

bool ParsedData::getUnique (  )  [inline]

Definition at line 169 of file Parser.h.

00169 { return isUnique; }

bool ParsedData::getUnique (  )  [inline]

Definition at line 169 of file Parser.h.

Referenced by CreateIdxStatement::execute().

00169 { return isUnique; }

Here is the caller graph for this function:

List ParsedData::getUpdateFieldValueList (  )  [inline]

Definition at line 156 of file Parser.h.

00156 { return updFldValList; }

List ParsedData::getUpdateFieldValueList (  )  [inline]

Definition at line 156 of file Parser.h.

Referenced by UpdStatement::resolveForAssignment().

00156 { return updFldValList; }

Here is the caller graph for this function:

void** ParsedData::insertCondValueAndGetPtr ( char *  fName,
char *  value 
)

void ** ParsedData::insertCondValueAndGetPtr ( char *  fName,
char *  value 
)

Definition at line 49 of file ParsedData.cxx.

References List::append(), ConditionValue::fName, ConditionValue::length, ConditionValue::paramNo, ConditionValue::parsedString, ConditionValue::type, typeUnknown, and ConditionValue::value.

Referenced by yyparse().

00050 {
00051     ConditionValue *newVal = new ConditionValue();
00052     if (val == NULL) 
00053         newVal->parsedString = NULL;
00054     else
00055         newVal->parsedString = strdup(val);
00056     newVal->value = NULL;
00057     newVal->paramNo = 0;
00058     newVal->type = typeUnknown;
00059     newVal->length = 0;
00060     strcpy(newVal->fName, fldName);
00061     conditionValueList.append(newVal);
00062     return &(newVal->value);
00063 
00064 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ParsedData::insertField ( char *  fName  ) 

void ParsedData::insertField ( char *  fName  ) 

Definition at line 66 of file ParsedData.cxx.

References List::append(), and FieldName::fldName.

Referenced by yyparse().

00067 {
00068     FieldName *newVal = new FieldName();
00069     strcpy(newVal->fldName , fName);
00070     fieldNameList.append(newVal);
00071 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ParsedData::insertFieldValue ( FieldValue newVal  )  [inline]

Definition at line 150 of file Parser.h.

References List::append().

00150 { fieldValueList.append(newVal); }

Here is the call graph for this function:

void ParsedData::insertFieldValue ( FieldValue newVal  )  [inline]

Definition at line 150 of file Parser.h.

References List::append().

Referenced by SelStatement::resolve().

00150 { fieldValueList.append(newVal); }

Here is the call graph for this function:

Here is the caller graph for this function:

void ParsedData::insertFldDef (  ) 

void ParsedData::insertFldDef (  ) 

Definition at line 191 of file ParsedData.cxx.

References FieldList::append(), and FieldDef::init().

Referenced by yyparse().

00192 {
00193     DbRetVal rv = creFldList.append(fldDef);
00194     fldDef.init();
00195 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ParsedData::insertInValue ( char *  value  ) 

void ParsedData::insertInValue ( char *  value  ) 

Definition at line 35 of file ParsedData.cxx.

References List::append(), FieldValue::length, FieldValue::paramNo, FieldValue::parsedString, FieldValue::type, typeUnknown, and FieldValue::value.

Referenced by yyparse().

00036 {
00037     FieldValue *newVal = new FieldValue();
00038     if (val == NULL) 
00039         newVal->parsedString = NULL;
00040     else 
00041         newVal->parsedString = strdup(val);
00042     newVal->value = NULL;
00043     newVal->paramNo = 0;
00044     newVal->type = typeUnknown;
00045     newVal->length = 0;
00046     inValueList.append(newVal);
00047 }

Here is the call graph for this function:

Here is the caller graph for this function:

Predicate* ParsedData::insertPredicate ( Predicate p1,
LogicalOp  op,
Predicate p2 = NULL 
)

Predicate* ParsedData::insertPredicate ( char *  fldName,
ComparisionOp  op,
char *  fldName 
)

Predicate* ParsedData::insertPredicate ( char *  fldName,
ComparisionOp  op,
void **  value 
)

Predicate * ParsedData::insertPredicate ( Predicate p1,
LogicalOp  op,
Predicate p2 = NULL 
)

Definition at line 99 of file ParsedData.cxx.

References PredicateImpl::setTerm().

00100 {
00101     PredicateImpl *pImpl = new PredicateImpl();
00102     pImpl->setTerm(p1, op, p2);
00103     return (Predicate*) pImpl;
00104 }

Here is the call graph for this function:

Predicate * ParsedData::insertPredicate ( char *  fldName,
ComparisionOp  op,
char *  fldName 
)

Definition at line 92 of file ParsedData.cxx.

References PredicateImpl::setTerm().

00093 {
00094     PredicateImpl *pImpl = new PredicateImpl();
00095     pImpl->setTerm(fName1, op, fName2);
00096     return (Predicate*) pImpl;
00097 }

Here is the call graph for this function:

Predicate * ParsedData::insertPredicate ( char *  fldName,
ComparisionOp  op,
void **  value 
)

Definition at line 86 of file ParsedData.cxx.

References PredicateImpl::setTerm().

Referenced by yyparse().

00087 {
00088     PredicateImpl *pImpl = new PredicateImpl();
00089     pImpl->setTerm(fName, op, val);
00090     return (Predicate*) pImpl;
00091 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ParsedData::insertUpdateValue ( char *  fldName,
char *  value 
)

void ParsedData::insertUpdateValue ( char *  fldName,
char *  value 
)

Definition at line 73 of file ParsedData.cxx.

References List::append(), UpdateFieldValue::fldName, UpdateFieldValue::paramNo, UpdateFieldValue::parsedString, and UpdateFieldValue::value.

Referenced by yyparse().

00074 {
00075     UpdateFieldValue *newVal = new UpdateFieldValue();
00076     strcpy(newVal->fldName, fName);
00077     if (val == NULL) 
00078         newVal->parsedString = NULL;
00079     else 
00080         newVal->parsedString = strdup(val);
00081     newVal->value = NULL;
00082     newVal->paramNo = 0;
00083     updFldValList.append(newVal);
00084 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ParsedData::insertValue ( char *  value  ) 

void ParsedData::insertValue ( char *  value  ) 

Definition at line 21 of file ParsedData.cxx.

References List::append(), FieldValue::length, FieldValue::paramNo, FieldValue::parsedString, FieldValue::type, typeUnknown, and FieldValue::value.

Referenced by yyparse().

00022 {
00023     FieldValue *newVal = new FieldValue();
00024     if (val == NULL) 
00025         newVal->parsedString = NULL;
00026     else 
00027         newVal->parsedString = strdup(val);
00028     newVal->value = NULL;
00029     newVal->paramNo = 0;
00030     newVal->type = typeUnknown;
00031     newVal->length = 0;
00032     fieldValueList.append(newVal);
00033 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ParsedData::reset (  ) 

void ParsedData::reset (  ) 

Definition at line 106 of file ParsedData.cxx.

References List::getIterator(), ListIterator::hasElement(), hashIndex, ListIterator::nextElement(), UpdateFieldValue::parsedString, ConditionValue::parsedString, FieldValue::parsedString, FieldList::removeAll(), Condition::reset(), List::reset(), ListIterator::reset(), UpdateFieldValue::value, ConditionValue::value, and FieldValue::value.

Referenced by SqlStatement::free().

00107 {
00108     ListIterator fNameIter = fieldNameList.getIterator();
00109     fNameIter.reset();
00110     while (fNameIter.hasElement())
00111         delete (Identifier *) fNameIter.nextElement();
00112     fieldNameList.reset();
00113     ListIterator iter = fieldValueList.getIterator();
00114     FieldValue *value;
00115     while (iter.hasElement())
00116     {
00117         value = (FieldValue*)iter.nextElement();
00118         free(value->parsedString);
00119         free(value->value);
00120         delete value;
00121     }
00122     fieldValueList.reset();
00123     inValueList.reset();
00124     predicate.reset();
00125 
00126     iter = conditionValueList.getIterator();
00127     ConditionValue *condVal;
00128     while (iter.hasElement())
00129     {
00130         condVal = (ConditionValue*)iter.nextElement();
00131         free(condVal->parsedString);
00132         free(condVal->value);
00133         delete condVal;
00134     }
00135     conditionValueList.reset();
00136 
00137     iter = updFldValList.getIterator();
00138     UpdateFieldValue *updFldVal;
00139     while (iter.hasElement())
00140     {
00141         updFldVal = (UpdateFieldValue*)iter.nextElement();
00142         free(updFldVal->parsedString);
00143         free(updFldVal->value);
00144         delete updFldVal;
00145     }
00146     updFldValList.reset();
00147     
00148     creFldList.removeAll();
00149     isUnique = false; 
00150     isPrimary = false; 
00151     indexType = hashIndex;
00152 }

Here is the call graph for this function:

Here is the caller graph for this function:

void ParsedData::setCondition ( Predicate pred  )  [inline]

Definition at line 142 of file Parser.h.

References Condition::setPredicate().

00143     { 
00144         //No body is deleting memory allocated during condition::setTerm for PredicateImpl 
00145         //have list in this pared data and delete it during reset
00146         predicate.setPredicate(pred); 
00147     }

Here is the call graph for this function:

void ParsedData::setCondition ( Predicate pred  )  [inline]

Definition at line 142 of file Parser.h.

References Condition::setPredicate().

Referenced by yyparse().

00143     { 
00144         //No body is deleting memory allocated during condition::setTerm for PredicateImpl 
00145         //have list in this pared data and delete it during reset
00146         predicate.setPredicate(pred); 
00147     }

Here is the call graph for this function:

Here is the caller graph for this function:

void ParsedData::setDefaultValue ( char *  value  ) 

void ParsedData::setDefaultValue ( char *  value  ) 

Definition at line 178 of file ParsedData.cxx.

References DEFAULT_VALUE_BUF_LENGTH, FieldDef::defaultValueBuf_, and FieldDef::isDefault_.

Referenced by yyparse().

00179 {
00180     fldDef.isDefault_ = true;
00181     if (strlen(value) > DEFAULT_VALUE_BUF_LENGTH -1) 
00182     {
00183         strncpy(fldDef.defaultValueBuf_, value, DEFAULT_VALUE_BUF_LENGTH -1);
00184         fldDef.defaultValueBuf_[DEFAULT_VALUE_BUF_LENGTH] ='\0';
00185     } else
00186         strcpy(fldDef.defaultValueBuf_, value);
00187     return;
00188 }

Here is the caller graph for this function:

void ParsedData::setFldLength ( size_t  length  ) 

void ParsedData::setFldLength ( size_t  length  ) 

Definition at line 169 of file ParsedData.cxx.

References FieldDef::length_.

Referenced by yyparse().

00170 {
00171     fldDef.length_ = length;
00172 }

Here is the caller graph for this function:

void ParsedData::setFldName ( char *  name  ) 

void ParsedData::setFldName ( char *  name  ) 

Definition at line 158 of file ParsedData.cxx.

References FieldDef::fldName_, and IDENTIFIER_LENGTH.

Referenced by yyparse().

00159 {
00160     strcpy(fldDef.fldName_, name);
00161     fldDef.fldName_[IDENTIFIER_LENGTH] = '\0';
00162 }

Here is the caller graph for this function:

void ParsedData::setFldNotNull ( bool  notNull  ) 

void ParsedData::setFldNotNull ( bool  notNull  ) 

Definition at line 174 of file ParsedData.cxx.

References FieldDef::isNull_.

Referenced by yyparse().

00175 {
00176     fldDef.isNull_ = notNull;
00177 }

Here is the caller graph for this function:

void ParsedData::setFldType ( DataType  type  ) 

void ParsedData::setFldType ( DataType  type  ) 

Definition at line 164 of file ParsedData.cxx.

References FieldDef::type_.

Referenced by yyparse().

00165 {
00166     fldDef.type_ = type;
00167 }

Here is the caller graph for this function:

void ParsedData::setIndexName ( char *  name  )  [inline]

Definition at line 125 of file Parser.h.

00125 { strcpy(idxName, name); }

void ParsedData::setIndexName ( char *  name  )  [inline]

Definition at line 125 of file Parser.h.

Referenced by yyparse().

00125 { strcpy(idxName, name); }

Here is the caller graph for this function:

void ParsedData::setIndexType ( IndexType  type  )  [inline]

Definition at line 167 of file Parser.h.

00167 { indexType = type; }

void ParsedData::setIndexType ( IndexType  type  )  [inline]

Definition at line 167 of file Parser.h.

Referenced by yyparse().

00167 { indexType = type; }

Here is the caller graph for this function:

void ParsedData::setPrimary ( bool  primary  )  [inline]

Definition at line 166 of file Parser.h.

00166 { isPrimary = primary; }

void ParsedData::setPrimary ( bool  primary  )  [inline]

Definition at line 166 of file Parser.h.

Referenced by yyparse().

00166 { isPrimary = primary; }

Here is the caller graph for this function:

void ParsedData::setStmtType ( StatementType  type  )  [inline]

Definition at line 123 of file Parser.h.

00123 { stmtType = type; }

void ParsedData::setStmtType ( StatementType  type  )  [inline]

Definition at line 123 of file Parser.h.

Referenced by yyparse().

00123 { stmtType = type; }

Here is the caller graph for this function:

void ParsedData::setTableName ( char *  name  )  [inline]

Definition at line 124 of file Parser.h.

00124 { strcpy(tblName, name); }

void ParsedData::setTableName ( char *  name  )  [inline]

Definition at line 124 of file Parser.h.

Referenced by yyparse().

00124 { strcpy(tblName, name); }

Here is the caller graph for this function:

void ParsedData::setUnique ( bool  unique  )  [inline]

Definition at line 165 of file Parser.h.

00165 { isUnique = unique; }

void ParsedData::setUnique ( bool  unique  )  [inline]

Definition at line 165 of file Parser.h.

Referenced by yyparse().

00165 { isUnique = unique; }

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated on Mon Jun 9 22:50:01 2008 for csql by  doxygen 1.4.7