Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eecs398-search
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vcday
eecs398-search
Commits
82b4b36f
Commit
82b4b36f
authored
6 years ago
by
zldunn
Browse files
Options
Downloads
Patches
Plain Diff
added back tuple class
parent
3b687fe3
No related branches found
Branches containing commit
No related tags found
1 merge request
!8
Origin/constraint solver
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
util/DataStructureLib/tuple.cpp
+78
-0
78 additions, 0 deletions
util/DataStructureLib/tuple.cpp
with
78 additions
and
0 deletions
util/DataStructureLib/tuple.cpp
0 → 100644
+
78
−
0
View file @
82b4b36f
//
// Created by Zane Dunnings on 3/17/18.
//
// Outline of query language from Prof. Nicole Hamilton, University of Michigan 03/15/2018
//31 lines
#include
<string>
#include
<vector>
#include
"../../parser/Parser.h"
//#include "../../constraintSolver/ISRAnd.h"
using
namespace
std
;
class
Token
{
public:
Token
()
:
text
(
""
),
end
(
true
),
OR
(
false
),
AND
(
false
){}
Token
(
string
input
)
:
text
(
input
),
end
(
false
),
OR
(
false
),
AND
(
false
)
{
if
(
input
==
"-OR-"
)
OR
=
true
;
else
if
(
input
==
"-AND-"
)
AND
=
true
;
}
//TODO: This is for scaling to add more ISR types
string
text
;
bool
OR
;
bool
AND
;
bool
end
;
};
enum
TupleType
{
PhraseTupleType
,
OrTupleType
,
AndTupleType
,
NotTupleType
,
SearchTupleType
};
class
Tuple
{
public:
Token
object
;
vector
<
Tuple
*>
Next
;
TupleType
Type
;
//ISR *Compile( );
Tuple
(
)
:
object
(
Token
()
),
Type
(
AndTupleType
)
{}
Tuple
(
Token
input
)
:
object
(
input
),
Type
(
AndTupleType
)
{
if
(
input
.
AND
)
Type
=
AndTupleType
;
else
if
(
input
.
OR
)
Type
=
OrTupleType
;
else
Type
=
PhraseTupleType
;
}
Tuple
(
TupleType
type
)
:
object
(
Token
(
)
),
Type
(
type
)
{
switch
(
type
)
{
case
(
AndTupleType
):
object
=
Token
(
"-AND-"
);
break
;
case
(
OrTupleType
):
object
=
Token
(
"-OR-"
);
default:
break
;
}
}
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment