forked from chuckpreslar/codex
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbinary.go
More file actions
81 lines (71 loc) · 2.18 KB
/
binary.go
File metadata and controls
81 lines (71 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package codex
// Binary node struct.
type BinaryNode struct {
Left interface{} // Binary nodes left leaf.
Right interface{} // Binary nodes right leaf.
}
type AsNode BinaryNode // AsNode is a BinaryNode struct.
type BetweenNode BinaryNode // BetweenNode is a BinaryNode struct.
type InnerJoinNode BinaryNode // InnerJoinNode is a BinaryNode struct.
type OuterJoinNode BinaryNode // OuterJoinNode is a BinaryNode struct.
type AssignmentNode BinaryNode // AssignmentNode is a BinaryNode struct.
type UnionNode BinaryNode // UnionNode is a BinaryNode struct.
type IntersectNode BinaryNode // IntersectNode is a BinaryNode struct.
type ExceptNode BinaryNode // ExceptNode is a BinaryNode struct.
type BinaryLiteralNode BinaryNode // see AttributeNode.Literal() and table_test.go TestTableColLiteral()
// AsNode factory method.
func As(left, right interface{}) (as *AsNode) {
as = new(AsNode)
as.Left = left
as.Right = right
return
}
// BetweenNode factory method.
func Between(left, right interface{}) (between *BetweenNode) {
between = new(BetweenNode)
between.Left = left
between.Right = right
return
}
// InnerJoinNode factory method.
func InnerJoin(left, right interface{}) (join *InnerJoinNode) {
join = new(InnerJoinNode)
join.Left = left
join.Right = right
return
}
// OuterJoinNode factory method.
func OuterJoin(left, right interface{}) (join *OuterJoinNode) {
join = new(OuterJoinNode)
join.Left = left
join.Right = right
return
}
// AssignmentNode factory method.
func Assignment(left, right interface{}) (assignment *AssignmentNode) {
assignment = new(AssignmentNode)
assignment.Left = left
assignment.Right = right
return
}
// UnionNode factory method.
func Union(left, right interface{}) (union *UnionNode) {
union = new(UnionNode)
union.Left = left
union.Right = right
return
}
// IntersectNode factory method.
func Intersect(left, right interface{}) (intersect *IntersectNode) {
intersect = new(IntersectNode)
intersect.Left = left
intersect.Right = right
return
}
// ExceptNode factory method.
func Except(left, right interface{}) (except *ExceptNode) {
except = new(ExceptNode)
except.Left = left
except.Right = right
return
}