Identifier::Identifier()
{
	this->setCode(IDENTIFIER);
	setLeftChild(NULL);
    setRightChild(NULL);
	list = NULL;
}
Exemple #2
0
Token::Token()
{
    //What code do I need here to initialize everything.
    setLeftChild(NULL);
    setRightChild(NULL);
    list = NULL;
}
Identifier::Identifier(): Token()
{
	this->setCode(IDENTIFIER);
    //What code do I need here to initialize everything.
    setLeftChild(NULL);
    setRightChild(NULL);
    list = NULL;
}
Exemple #4
0
void test1() {

    struct node * root = calloc(1, sizeof(struct node));
    struct node * lStruct = calloc(1, sizeof(struct node));

    struct node * lStruct2 = calloc(1, sizeof(struct node));

    setLeftChild(root, lStruct);
    setRightChild(root, lStruct2);

    setNodeRed(lStruct2);
    setNodeRed(root->left);


    struct node * third1 = calloc(1, sizeof(struct node));
    struct node * third2 = calloc(1, sizeof(struct node));
    struct node * third3 = calloc(1, sizeof(struct node));
    struct node * third4 = calloc(1, sizeof(struct node));

    setLeftChild(lStruct, third1);
    setRightChild(lStruct, third2);
    setLeftChild(lStruct2, third3);
    setRightChild(lStruct2, third4);

    // setNodeRed(third1);
    setNodeRed(third2);

    assert(!is_red_black_tree(root));

    free(third1);
    free(third2);
    free(third3);
    free(third4);

    free(lStruct);
    free(lStruct2);

    free(root);

}
Exemple #5
0
Identifier::Identifier()
{
    setLeftChild(NULL);
    setRightChild(NULL);
}