bit-shift operators in the CST

This commit is contained in:
John Kerl 2020-09-09 21:26:48 -04:00
parent 2fba2f78f6
commit 723703ea47
12 changed files with 89659 additions and 83788 deletions

View file

@ -133,7 +133,16 @@ func BuildBinaryOperatorNode(astNode *dsl.ASTNode) (IEvaluable, error) {
return BuildBitwiseXOROperatorNode(leftCSTChild, rightCSTChild), nil
break
// TO DO: implement short-circuiting for these, as special cases.
case "<<":
return BuildLeftShiftOperatorNode(leftCSTChild, rightCSTChild), nil
break
case ">>":
return BuildSignedRightShiftOperatorNode(leftCSTChild, rightCSTChild), nil
break
case ">>>":
return BuildUnsignedRightShiftOperatorNode(leftCSTChild, rightCSTChild), nil
break
case "&&":
return BuildLogicalANDOperatorNode(leftCSTChild, rightCSTChild), nil
break
@ -408,6 +417,42 @@ func (this *BitwiseXOROperatorNode) Evaluate(state *State) lib.Mlrval {
return lib.MlrvalBitwiseXOR(&aout, &bout)
}
// ----------------------------------------------------------------
type LeftShiftOperatorNode struct{ a, b IEvaluable }
func BuildLeftShiftOperatorNode(a, b IEvaluable) *LeftShiftOperatorNode {
return &LeftShiftOperatorNode{a: a, b: b}
}
func (this *LeftShiftOperatorNode) Evaluate(state *State) lib.Mlrval {
aout := this.a.Evaluate(state)
bout := this.b.Evaluate(state)
return lib.MlrvalLeftShift(&aout, &bout)
}
// ----------------------------------------------------------------
type SignedRightShiftOperatorNode struct{ a, b IEvaluable }
func BuildSignedRightShiftOperatorNode(a, b IEvaluable) *SignedRightShiftOperatorNode {
return &SignedRightShiftOperatorNode{a: a, b: b}
}
func (this *SignedRightShiftOperatorNode) Evaluate(state *State) lib.Mlrval {
aout := this.a.Evaluate(state)
bout := this.b.Evaluate(state)
return lib.MlrvalSignedRightShift(&aout, &bout)
}
// ----------------------------------------------------------------
type UnsignedRightShiftOperatorNode struct{ a, b IEvaluable }
func BuildUnsignedRightShiftOperatorNode(a, b IEvaluable) *UnsignedRightShiftOperatorNode {
return &UnsignedRightShiftOperatorNode{a: a, b: b}
}
func (this *UnsignedRightShiftOperatorNode) Evaluate(state *State) lib.Mlrval {
aout := this.a.Evaluate(state)
bout := this.b.Evaluate(state)
return lib.MlrvalUnsignedRightShift(&aout, &bout)
}
// ----------------------------------------------------------------
type BitwiseNOTOperatorNode struct{ a IEvaluable }

View file

@ -907,6 +907,81 @@ func MlrvalBitwiseNOT(ma *Mlrval) Mlrval {
return bitwise_not_dispositions[ma.mvtype](ma)
}
// ----------------------------------------------------------------
// Left shift
func lsh_i_ii(ma, mb *Mlrval) Mlrval {
return MlrvalFromInt64(ma.intval << mb.intval)
}
var left_shift_dispositions = [MT_DIM][MT_DIM]binaryFunc{
// ERROR ABSENT EMPTY STRING INT FLOAT BOOL
/*ERROR */ {_erro, _erro, _erro, _erro, _erro, _erro, _erro, _absn, _absn},
/*ABSENT */ {_erro, _absn, _absn, _erro, _2___, _erro, _erro, _absn, _absn},
/*EMPTY */ {_erro, _absn, _void, _erro, _void, _void, _erro, _absn, _absn},
/*STRING */ {_erro, _erro, _erro, _erro, _erro, _erro, _erro, _absn, _absn},
/*INT */ {_erro, _1___, _void, _erro, lsh_i_ii, _erro, _erro, _absn, _absn},
/*FLOAT */ {_erro, _erro, _void, _erro, _erro, _erro, _erro, _absn, _absn},
/*BOOL */ {_erro, _erro, _erro, _erro, _erro, _erro, _erro, _absn, _absn},
/*ARRAY */ {_absn, _absn, _absn, _absn, _absn, _absn, _absn, _absn, _absn},
/*MAP */ {_absn, _absn, _absn, _absn, _absn, _absn, _absn, _absn, _absn},
}
func MlrvalLeftShift(ma, mb *Mlrval) Mlrval {
return left_shift_dispositions[ma.mvtype][mb.mvtype](ma, mb)
}
// ----------------------------------------------------------------
// Signed right shift
func srsh_i_ii(ma, mb *Mlrval) Mlrval {
return MlrvalFromInt64(ma.intval >> mb.intval)
}
var signed_right_shift_dispositions = [MT_DIM][MT_DIM]binaryFunc{
// ERROR ABSENT EMPTY STRING INT FLOAT BOOL
/*ERROR */ {_erro, _erro, _erro, _erro, _erro, _erro, _erro, _absn, _absn},
/*ABSENT */ {_erro, _absn, _absn, _erro, _2___, _erro, _erro, _absn, _absn},
/*EMPTY */ {_erro, _absn, _void, _erro, _void, _void, _erro, _absn, _absn},
/*STRING */ {_erro, _erro, _erro, _erro, _erro, _erro, _erro, _absn, _absn},
/*INT */ {_erro, _1___, _void, _erro, srsh_i_ii, _erro, _erro, _absn, _absn},
/*FLOAT */ {_erro, _erro, _void, _erro, _erro, _erro, _erro, _absn, _absn},
/*BOOL */ {_erro, _erro, _erro, _erro, _erro, _erro, _erro, _absn, _absn},
/*ARRAY */ {_absn, _absn, _absn, _absn, _absn, _absn, _absn, _absn, _absn},
/*MAP */ {_absn, _absn, _absn, _absn, _absn, _absn, _absn, _absn, _absn},
}
func MlrvalSignedRightShift(ma, mb *Mlrval) Mlrval {
return signed_right_shift_dispositions[ma.mvtype][mb.mvtype](ma, mb)
}
// ----------------------------------------------------------------
// Unsigned right shift
func ursh_i_ii(ma, mb *Mlrval) Mlrval {
var ua uint64 = uint64(ma.intval)
var ub uint64 = uint64(mb.intval)
var uc = ua >> ub
return MlrvalFromInt64(int64(uc))
}
var unsigned_right_shift_dispositions = [MT_DIM][MT_DIM]binaryFunc{
// ERROR ABSENT EMPTY STRING INT FLOAT BOOL
/*ERROR */ {_erro, _erro, _erro, _erro, _erro, _erro, _erro, _absn, _absn},
/*ABSENT */ {_erro, _absn, _absn, _erro, _2___, _erro, _erro, _absn, _absn},
/*EMPTY */ {_erro, _absn, _void, _erro, _void, _void, _erro, _absn, _absn},
/*STRING */ {_erro, _erro, _erro, _erro, _erro, _erro, _erro, _absn, _absn},
/*INT */ {_erro, _1___, _void, _erro, ursh_i_ii, _erro, _erro, _absn, _absn},
/*FLOAT */ {_erro, _erro, _void, _erro, _erro, _erro, _erro, _absn, _absn},
/*BOOL */ {_erro, _erro, _erro, _erro, _erro, _erro, _erro, _absn, _absn},
/*ARRAY */ {_absn, _absn, _absn, _absn, _absn, _absn, _absn, _absn, _absn},
/*MAP */ {_absn, _absn, _absn, _absn, _absn, _absn, _absn, _absn, _absn},
}
func MlrvalUnsignedRightShift(ma, mb *Mlrval) Mlrval {
return unsigned_right_shift_dispositions[ma.mvtype][mb.mvtype](ma, mb)
}
// ----------------------------------------------------------------
// Boolean expressions for ==, !=, >, >=, <, <=

View file

@ -29,7 +29,7 @@ var ActTab = ActionTable{
Ignore: "!whitespace",
},
ActionRow{ // S2
Accept: 64,
Accept: 66,
Ignore: "",
},
ActionRow{ // S3
@ -41,55 +41,55 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S5
Accept: 60,
Accept: 62,
Ignore: "",
},
ActionRow{ // S6
Accept: 49,
Accept: 50,
Ignore: "",
},
ActionRow{ // S7
Accept: 67,
Accept: 69,
Ignore: "",
},
ActionRow{ // S8
Accept: 68,
Accept: 70,
Ignore: "",
},
ActionRow{ // S9
Accept: 57,
Accept: 59,
Ignore: "",
},
ActionRow{ // S10
Accept: 52,
Accept: 54,
Ignore: "",
},
ActionRow{ // S11
Accept: 74,
Accept: 76,
Ignore: "",
},
ActionRow{ // S12
Accept: 53,
Accept: 55,
Ignore: "",
},
ActionRow{ // S13
Accept: 56,
Ignore: "",
},
ActionRow{ // S14
Accept: 58,
Ignore: "",
},
ActionRow{ // S14
Accept: 60,
Ignore: "",
},
ActionRow{ // S15
Accept: 70,
Accept: 72,
Ignore: "",
},
ActionRow{ // S16
Accept: 70,
Accept: 72,
Ignore: "",
},
ActionRow{ // S17
Accept: 35,
Accept: 36,
Ignore: "",
},
ActionRow{ // S18
@ -97,7 +97,7 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S19
Accept: 45,
Accept: 46,
Ignore: "",
},
ActionRow{ // S20
@ -105,11 +105,11 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S21
Accept: 43,
Accept: 44,
Ignore: "",
},
ActionRow{ // S22
Accept: 34,
Accept: 35,
Ignore: "",
},
ActionRow{ // S23
@ -141,7 +141,7 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S30
Accept: 48,
Accept: 49,
Ignore: "",
},
ActionRow{ // S31
@ -165,7 +165,7 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S36
Accept: 47,
Accept: 48,
Ignore: "",
},
ActionRow{ // S37
@ -173,11 +173,11 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S38
Accept: 65,
Accept: 67,
Ignore: "",
},
ActionRow{ // S39
Accept: 42,
Accept: 43,
Ignore: "",
},
ActionRow{ // S40
@ -185,7 +185,7 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S41
Accept: 69,
Accept: 71,
Ignore: "",
},
ActionRow{ // S42
@ -221,43 +221,43 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S50
Accept: 32,
Accept: 33,
Ignore: "",
},
ActionRow{ // S51
Accept: 38,
Accept: 39,
Ignore: "",
},
ActionRow{ // S52
Accept: 66,
Accept: 68,
Ignore: "",
},
ActionRow{ // S53
Accept: 29,
Accept: 30,
Ignore: "",
},
ActionRow{ // S54
Accept: 26,
Accept: 27,
Ignore: "",
},
ActionRow{ // S55
Accept: 28,
Accept: 29,
Ignore: "",
},
ActionRow{ // S56
Accept: 61,
Accept: 63,
Ignore: "",
},
ActionRow{ // S57
Accept: 54,
Accept: 56,
Ignore: "",
},
ActionRow{ // S58
Accept: 55,
Accept: 57,
Ignore: "",
},
ActionRow{ // S59
Accept: 62,
Accept: 64,
Ignore: "",
},
ActionRow{ // S60
@ -265,19 +265,19 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S61
Accept: 27,
Accept: 28,
Ignore: "",
},
ActionRow{ // S62
Accept: 59,
Accept: 61,
Ignore: "",
},
ActionRow{ // S63
Accept: 30,
Accept: 31,
Ignore: "",
},
ActionRow{ // S64
Accept: 71,
Accept: 73,
Ignore: "",
},
ActionRow{ // S65
@ -289,35 +289,35 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S67
Accept: 50,
Accept: 0,
Ignore: "",
},
ActionRow{ // S68
Accept: 46,
Ignore: "",
},
ActionRow{ // S69
Accept: 41,
Ignore: "",
},
ActionRow{ // S70
Accept: 39,
Ignore: "",
},
ActionRow{ // S71
Accept: 44,
Ignore: "",
},
ActionRow{ // S72
Accept: 51,
Ignore: "",
},
ActionRow{ // S69
Accept: 47,
Ignore: "",
},
ActionRow{ // S70
Accept: 42,
Ignore: "",
},
ActionRow{ // S71
Accept: 40,
Ignore: "",
},
ActionRow{ // S72
Accept: 45,
Ignore: "",
},
ActionRow{ // S73
Accept: 18,
Accept: 52,
Ignore: "",
},
ActionRow{ // S74
Accept: 15,
Accept: 18,
Ignore: "",
},
ActionRow{ // S75
@ -325,15 +325,15 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S76
Accept: 16,
Ignore: "",
},
ActionRow{ // S77
Accept: 15,
Ignore: "",
},
ActionRow{ // S77
Accept: 16,
Ignore: "",
},
ActionRow{ // S78
Accept: 0,
Accept: 15,
Ignore: "",
},
ActionRow{ // S79
@ -357,15 +357,15 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S84
Accept: 81,
Accept: 0,
Ignore: "",
},
ActionRow{ // S85
Accept: 82,
Accept: 83,
Ignore: "",
},
ActionRow{ // S86
Accept: 0,
Accept: 84,
Ignore: "",
},
ActionRow{ // S87
@ -377,15 +377,15 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S89
Accept: 23,
Accept: 0,
Ignore: "",
},
ActionRow{ // S90
Accept: 37,
Accept: 23,
Ignore: "",
},
ActionRow{ // S91
Accept: 0,
Accept: 38,
Ignore: "",
},
ActionRow{ // S92
@ -401,23 +401,23 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S95
Accept: 22,
Accept: 0,
Ignore: "",
},
ActionRow{ // S96
Accept: 36,
Accept: 22,
Ignore: "",
},
ActionRow{ // S97
Accept: 40,
Accept: 37,
Ignore: "",
},
ActionRow{ // S98
Accept: 69,
Accept: 41,
Ignore: "",
},
ActionRow{ // S99
Accept: 0,
Accept: 71,
Ignore: "",
},
ActionRow{ // S100
@ -429,31 +429,31 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S102
Accept: 21,
Accept: 0,
Ignore: "",
},
ActionRow{ // S103
Accept: 33,
Accept: 21,
Ignore: "",
},
ActionRow{ // S104
Accept: 63,
Accept: 34,
Ignore: "",
},
ActionRow{ // S105
Accept: 0,
Accept: 65,
Ignore: "",
},
ActionRow{ // S106
Accept: 31,
Accept: 0,
Ignore: "",
},
ActionRow{ // S107
Accept: 71,
Accept: 32,
Ignore: "",
},
ActionRow{ // S108
Accept: 0,
Accept: 73,
Ignore: "",
},
ActionRow{ // S109
@ -461,75 +461,75 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S110
Accept: 71,
Accept: 0,
Ignore: "",
},
ActionRow{ // S111
Accept: 70,
Accept: 73,
Ignore: "",
},
ActionRow{ // S112
Accept: 24,
Accept: 72,
Ignore: "",
},
ActionRow{ // S113
Accept: 25,
Accept: 72,
Ignore: "",
},
ActionRow{ // S114
Accept: 0,
Accept: 24,
Ignore: "",
},
ActionRow{ // S115
Accept: 0,
Accept: 25,
Ignore: "",
},
ActionRow{ // S116
Accept: 0,
Accept: 53,
Ignore: "",
},
ActionRow{ // S117
Accept: 83,
Accept: 0,
Ignore: "",
},
ActionRow{ // S118
Accept: 76,
Accept: 0,
Ignore: "",
},
ActionRow{ // S119
Accept: 75,
Accept: 0,
Ignore: "",
},
ActionRow{ // S120
Accept: 77,
Accept: 85,
Ignore: "",
},
ActionRow{ // S121
Accept: 79,
Ignore: "",
},
ActionRow{ // S122
Accept: 78,
Ignore: "",
},
ActionRow{ // S122
Accept: 77,
Ignore: "",
},
ActionRow{ // S123
Accept: 80,
Accept: 79,
Ignore: "",
},
ActionRow{ // S124
Accept: 20,
Accept: 81,
Ignore: "",
},
ActionRow{ // S125
Accept: 0,
Accept: 80,
Ignore: "",
},
ActionRow{ // S126
Accept: 7,
Accept: 82,
Ignore: "",
},
ActionRow{ // S127
Accept: 0,
Accept: 20,
Ignore: "",
},
ActionRow{ // S128
@ -537,7 +537,7 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S129
Accept: 19,
Accept: 7,
Ignore: "",
},
ActionRow{ // S130
@ -545,11 +545,11 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S131
Accept: 13,
Accept: 0,
Ignore: "",
},
ActionRow{ // S132
Accept: 13,
Accept: 19,
Ignore: "",
},
ActionRow{ // S133
@ -557,11 +557,11 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S134
Accept: 0,
Accept: 13,
Ignore: "",
},
ActionRow{ // S135
Accept: 71,
Accept: 13,
Ignore: "",
},
ActionRow{ // S136
@ -573,11 +573,11 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S138
Accept: 71,
Accept: 73,
Ignore: "",
},
ActionRow{ // S139
Accept: 71,
Accept: 0,
Ignore: "",
},
ActionRow{ // S140
@ -585,15 +585,15 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S141
Accept: 17,
Accept: 73,
Ignore: "",
},
ActionRow{ // S142
Accept: 17,
Accept: 73,
Ignore: "",
},
ActionRow{ // S143
Accept: 0,
Accept: 26,
Ignore: "",
},
ActionRow{ // S144
@ -601,11 +601,11 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S145
Accept: 0,
Accept: 17,
Ignore: "",
},
ActionRow{ // S146
Accept: 72,
Accept: 17,
Ignore: "",
},
ActionRow{ // S147
@ -613,7 +613,7 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S148
Accept: 71,
Accept: 0,
Ignore: "",
},
ActionRow{ // S149
@ -621,39 +621,39 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S150
Accept: 71,
Accept: 74,
Ignore: "",
},
ActionRow{ // S151
Accept: 71,
Accept: 0,
Ignore: "",
},
ActionRow{ // S152
Accept: 0,
Accept: 73,
Ignore: "",
},
ActionRow{ // S153
Accept: 4,
Accept: 0,
Ignore: "",
},
ActionRow{ // S154
Accept: 72,
Accept: 73,
Ignore: "",
},
ActionRow{ // S155
Accept: 0,
Accept: 73,
Ignore: "",
},
ActionRow{ // S156
Accept: 71,
Accept: 0,
Ignore: "",
},
ActionRow{ // S157
Accept: 0,
Accept: 4,
Ignore: "",
},
ActionRow{ // S158
Accept: 0,
Accept: 74,
Ignore: "",
},
ActionRow{ // S159
@ -661,11 +661,11 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S160
Accept: 0,
Accept: 73,
Ignore: "",
},
ActionRow{ // S161
Accept: 85,
Accept: 0,
Ignore: "",
},
ActionRow{ // S162
@ -673,7 +673,7 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S163
Accept: 84,
Accept: 0,
Ignore: "",
},
ActionRow{ // S164
@ -681,11 +681,27 @@ var ActTab = ActionTable{
Ignore: "",
},
ActionRow{ // S165
Accept: 0,
Accept: 87,
Ignore: "",
},
ActionRow{ // S166
Accept: 73,
Accept: 0,
Ignore: "",
},
ActionRow{ // S167
Accept: 86,
Ignore: "",
},
ActionRow{ // S168
Accept: 0,
Ignore: "",
},
ActionRow{ // S169
Accept: 0,
Ignore: "",
},
ActionRow{ // S170
Accept: 75,
Ignore: "",
},
}

View file

@ -11,8 +11,8 @@ import (
const (
NoState = -1
NumStates = 167
NumSymbols = 285
NumStates = 171
NumSymbols = 295
)
type Lexer struct {
@ -117,285 +117,295 @@ Lexer symbols:
1: '"'
2: '0'
3: 'x'
4: '.'
5: '-'
4: '0'
5: 'b'
6: '.'
7: '.'
8: '-'
7: '-'
8: '.'
9: '.'
10: '.'
11: '-'
12: 'I'
13: 'P'
14: 'S'
15: 'I'
16: 'F'
17: 'S'
18: 'I'
19: 'R'
20: 'S'
21: 'O'
22: 'P'
23: 'S'
24: 'O'
25: 'F'
26: 'S'
27: 'O'
28: 'R'
29: 'S'
30: 'N'
31: 'F'
10: '-'
11: '.'
12: '.'
13: '-'
14: 'I'
15: 'P'
16: 'S'
17: 'I'
18: 'F'
19: 'S'
20: 'I'
21: 'R'
22: 'S'
23: 'O'
24: 'P'
25: 'S'
26: 'O'
27: 'F'
28: 'S'
29: 'O'
30: 'R'
31: 'S'
32: 'N'
33: 'R'
34: 'F'
35: 'N'
36: 'R'
37: 'F'
38: 'I'
39: 'L'
40: 'E'
41: 'N'
42: 'A'
43: 'M'
44: 'E'
45: 'F'
46: 'I'
47: 'L'
48: 'E'
49: 'N'
50: 'U'
51: 'M'
52: 'b'
53: 'e'
54: 'g'
55: 'i'
56: 'n'
57: 'e'
33: 'F'
34: 'N'
35: 'R'
36: 'F'
37: 'N'
38: 'R'
39: 'F'
40: 'I'
41: 'L'
42: 'E'
43: 'N'
44: 'A'
45: 'M'
46: 'E'
47: 'F'
48: 'I'
49: 'L'
50: 'E'
51: 'N'
52: 'U'
53: 'M'
54: 'b'
55: 'e'
56: 'g'
57: 'i'
58: 'n'
59: 'd'
60: '$'
61: '$'
62: '{'
63: '}'
64: '$'
65: '*'
66: '@'
67: '@'
68: '{'
69: '}'
70: '@'
71: '*'
72: '%'
73: '%'
59: 'e'
60: 'n'
61: 'd'
62: '$'
63: '$'
64: '{'
65: '}'
66: '$'
67: '*'
68: '@'
69: '@'
70: '{'
71: '}'
72: '@'
73: '*'
74: '%'
75: 'p'
76: 'a'
77: 'n'
78: 'i'
79: 'c'
80: '%'
81: '%'
75: '%'
76: '%'
77: 'p'
78: 'a'
79: 'n'
80: 'i'
81: 'c'
82: '%'
83: ';'
84: '{'
85: '}'
86: '='
87: '['
88: ']'
89: '$'
90: '['
91: '@'
83: '%'
84: '%'
85: ';'
86: '{'
87: '}'
88: '='
89: '['
90: ']'
91: '$'
92: '['
93: '|'
94: '|'
95: '='
96: '^'
97: '^'
98: '='
99: '&'
100: '&'
101: '='
102: '|'
93: '@'
94: '['
95: '|'
96: '|'
97: '='
98: '^'
99: '^'
100: '='
101: '&'
102: '&'
103: '='
104: '^'
104: '|'
105: '='
106: '<'
107: '<'
108: '='
109: '>'
110: '>'
111: '='
112: '+'
106: '^'
107: '='
108: '<'
109: '<'
110: '='
111: '>'
112: '>'
113: '='
114: '.'
115: '='
116: '-'
114: '>'
115: '>'
116: '>'
117: '='
118: '*'
118: '+'
119: '='
120: '/'
120: '.'
121: '='
122: '/'
123: '/'
124: '='
125: '%'
126: '='
127: '*'
128: '*'
129: '='
130: '?'
131: ':'
132: '|'
133: '|'
134: '^'
135: '^'
136: '&'
137: '&'
138: '='
139: '~'
140: '!'
141: '='
142: '~'
143: '='
122: '-'
123: '='
124: '*'
125: '='
126: '/'
127: '='
128: '/'
129: '/'
130: '='
131: '%'
132: '='
133: '*'
134: '*'
135: '='
136: '?'
137: ':'
138: '|'
139: '|'
140: '^'
141: '^'
142: '&'
143: '&'
144: '='
145: '!'
146: '='
147: '>'
148: '>'
145: '~'
146: '!'
147: '='
148: '~'
149: '='
150: '<'
151: '<'
150: '='
151: '!'
152: '='
153: '|'
154: '^'
155: '&'
153: '>'
154: '>'
155: '='
156: '<'
157: '<'
158: '>'
159: '>'
160: '+'
161: '-'
162: '.'
163: '+'
164: '.'
165: '-'
166: '.'
167: '*'
168: '/'
169: '/'
170: '/'
171: '%'
172: '.'
173: '*'
174: '.'
175: '/'
176: '.'
158: '='
159: '|'
160: '^'
161: '&'
162: '<'
163: '<'
164: '>'
165: '>'
166: '>'
167: '>'
168: '>'
169: '+'
170: '-'
171: '.'
172: '+'
173: '.'
174: '-'
175: '.'
176: '*'
177: '/'
178: '/'
179: '!'
180: '~'
181: '*'
179: '/'
180: '%'
181: '.'
182: '*'
183: '('
184: ')'
185: ','
186: '_'
187: ' '
183: '.'
184: '/'
185: '.'
186: '/'
187: '/'
188: '!'
189: '#'
190: '$'
191: '%'
192: '&'
193: '''
194: '\'
195: '('
196: ')'
197: '*'
198: '+'
199: ','
200: '-'
201: '.'
202: '/'
203: ':'
204: ';'
205: '<'
206: '='
207: '>'
208: '?'
209: '@'
210: '['
211: ']'
212: '^'
213: '_'
214: '`'
215: '{'
216: '|'
217: '}'
218: '~'
219: '\'
220: '"'
221: 'e'
222: 'E'
223: 't'
224: 'r'
225: 'u'
226: 'e'
227: 'f'
228: 'a'
229: 'l'
230: 's'
231: 'e'
232: ' '
233: '!'
234: '#'
235: '$'
236: '%'
237: '&'
238: '''
239: '\'
240: '('
241: ')'
242: '*'
243: '+'
244: ','
245: '-'
246: '.'
247: '/'
248: ':'
249: ';'
250: '<'
251: '='
252: '>'
253: '?'
254: '@'
255: '['
256: ']'
257: '^'
258: '_'
259: '`'
260: '|'
261: '~'
262: '\'
263: '{'
264: '\'
265: '}'
266: ' '
267: '\t'
268: '\n'
269: '\r'
270: 'a'-'z'
271: 'A'-'Z'
272: '0'-'9'
273: '0'-'9'
274: 'a'-'f'
275: 'A'-'F'
276: 'A'-'Z'
277: 'a'-'z'
278: '0'-'9'
279: \u0100-\U0010ffff
189: '~'
190: '*'
191: '*'
192: '('
193: ')'
194: ','
195: '_'
196: ' '
197: '!'
198: '#'
199: '$'
200: '%'
201: '&'
202: '''
203: '\'
204: '('
205: ')'
206: '*'
207: '+'
208: ','
209: '-'
210: '.'
211: '/'
212: ':'
213: ';'
214: '<'
215: '='
216: '>'
217: '?'
218: '@'
219: '['
220: ']'
221: '^'
222: '_'
223: '`'
224: '{'
225: '|'
226: '}'
227: '~'
228: '\'
229: '"'
230: 'e'
231: 'E'
232: 't'
233: 'r'
234: 'u'
235: 'e'
236: 'f'
237: 'a'
238: 'l'
239: 's'
240: 'e'
241: ' '
242: '!'
243: '#'
244: '$'
245: '%'
246: '&'
247: '''
248: '\'
249: '('
250: ')'
251: '*'
252: '+'
253: ','
254: '-'
255: '.'
256: '/'
257: ':'
258: ';'
259: '<'
260: '='
261: '>'
262: '?'
263: '@'
264: '['
265: ']'
266: '^'
267: '_'
268: '`'
269: '|'
270: '~'
271: '\'
272: '{'
273: '\'
274: '}'
275: ' '
276: '\t'
277: '\n'
278: '\r'
279: 'a'-'z'
280: 'A'-'Z'
281: 'a'-'z'
281: '0'-'9'
282: '0'-'9'
283: \u0100-\U0010ffff
284: .
283: 'a'-'f'
284: 'A'-'F'
285: '0'-'1'
286: 'A'-'Z'
287: 'a'-'z'
288: '0'-'9'
289: \u0100-\U0010ffff
290: 'A'-'Z'
291: 'a'-'z'
292: '0'-'9'
293: \u0100-\U0010ffff
294: .
*/

File diff suppressed because it is too large Load diff

View file

@ -51,6 +51,7 @@
_letter : 'a'-'z' | 'A'-'Z' ;
_decdig : '0'-'9' ;
_hexdig : '0'-'9' | 'a'-'f' | 'A'-'F';
_bindig : '0'-'1' ;
_idchar : _letter | _decdig | '_' ;
!whitespace : ' ' | '\t' | '\n' | '\r' ;
@ -79,6 +80,7 @@ md_token_string_literal : '"' {_string_literal_element} '"' ;
md_token_int_literal
: _decdig { _decdig }
| '0' 'x' _hexdig { _hexdig }
| '0' 'b' _bindig { _bindig }
;
// Notes on float literals:
@ -538,6 +540,14 @@ Assignment
dsl.NodeTypeAssignment,
) >>
| Lvalue ">>>=" Rvalue
<< dsl.NewASTNodeBinary(
dsl.NewASTToken("=", $1),
$0,
dsl.NewASTNodeBinaryNestable(dsl.NewASTToken(">"+">"+">", $1), $0, $2, dsl.NodeTypeOperator),
dsl.NodeTypeAssignment,
) >>
| Lvalue "+=" Rvalue
<< dsl.NewASTNodeBinary(
dsl.NewASTToken("=", $1),
@ -667,8 +677,9 @@ BitwiseANDTerm
;
BitwiseShiftTerm
: BitwiseShiftTerm "<<" AddsubdotTerm << dsl.NewASTNodeBinary($1, $0, $2, dsl.NodeTypeOperator) >>
| BitwiseShiftTerm ">>" AddsubdotTerm << dsl.NewASTNodeBinary($1, $0, $2, dsl.NodeTypeOperator) >>
: BitwiseShiftTerm "<<" AddsubdotTerm << dsl.NewASTNodeBinary($1, $0, $2, dsl.NodeTypeOperator) >>
| BitwiseShiftTerm ">>" AddsubdotTerm << dsl.NewASTNodeBinary($1, $0, $2, dsl.NodeTypeOperator) >>
| BitwiseShiftTerm ">>>" AddsubdotTerm << dsl.NewASTNodeBinary($1, $0, $2, dsl.NodeTypeOperator) >>
| AddsubdotTerm
;

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -11,9 +11,9 @@ import (
)
const (
numProductions = 150
numStates = 1390
numSymbols = 134
numProductions = 152
numStates = 1410
numSymbols = 136
)
// Stack

View file

@ -570,6 +570,26 @@ var productionsTable = ProdTab{
)
},
},
ProdTabEntry{
String: `Assignment : Lvalue ">>>=" Rvalue << dsl.NewASTNodeBinary(
dsl.NewASTToken("=", X[1]),
X[0],
dsl.NewASTNodeBinaryNestable(dsl.NewASTToken(">"+">"+">", X[1]), X[0], X[2], dsl.NodeTypeOperator),
dsl.NodeTypeAssignment,
) >>`,
Id: "Assignment",
NTType: 7,
Index: 46,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(
dsl.NewASTToken("=", X[1]),
X[0],
dsl.NewASTNodeBinaryNestable(dsl.NewASTToken(">"+">"+">", X[1]), X[0], X[2], dsl.NodeTypeOperator),
dsl.NodeTypeAssignment,
)
},
},
ProdTabEntry{
String: `Assignment : Lvalue "+=" Rvalue << dsl.NewASTNodeBinary(
dsl.NewASTToken("=", X[1]),
@ -579,7 +599,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "Assignment",
NTType: 7,
Index: 46,
Index: 47,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(
@ -599,7 +619,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "Assignment",
NTType: 7,
Index: 47,
Index: 48,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(
@ -619,7 +639,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "Assignment",
NTType: 7,
Index: 48,
Index: 49,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(
@ -639,7 +659,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "Assignment",
NTType: 7,
Index: 49,
Index: 50,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(
@ -659,7 +679,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "Assignment",
NTType: 7,
Index: 50,
Index: 51,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(
@ -679,7 +699,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "Assignment",
NTType: 7,
Index: 51,
Index: 52,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(
@ -699,7 +719,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "Assignment",
NTType: 7,
Index: 52,
Index: 53,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(
@ -719,7 +739,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "Assignment",
NTType: 7,
Index: 53,
Index: 54,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(
@ -734,7 +754,7 @@ var productionsTable = ProdTab{
String: `Rvalue : PrecedenceChainStart << >>`,
Id: "Rvalue",
NTType: 21,
Index: 54,
Index: 55,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -744,7 +764,7 @@ var productionsTable = ProdTab{
String: `PrecedenceChainStart : TernaryTerm << >>`,
Id: "PrecedenceChainStart",
NTType: 22,
Index: 55,
Index: 56,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -754,7 +774,7 @@ var productionsTable = ProdTab{
String: `TernaryTerm : LogicalOrTerm "?" TernaryTerm ":" TernaryTerm << dsl.NewASTNodeTernary(dsl.NewASTToken("?:", X[1]), X[0], X[2], X[4], dsl.NodeTypeOperator) >>`,
Id: "TernaryTerm",
NTType: 23,
Index: 56,
Index: 57,
NumSymbols: 5,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeTernary(dsl.NewASTToken("?:", X[1]), X[0], X[2], X[4], dsl.NodeTypeOperator)
@ -764,7 +784,7 @@ var productionsTable = ProdTab{
String: `TernaryTerm : LogicalOrTerm << >>`,
Id: "TernaryTerm",
NTType: 23,
Index: 57,
Index: 58,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -774,7 +794,7 @@ var productionsTable = ProdTab{
String: `LogicalOrTerm : LogicalOrTerm "||" LogicalXORTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "LogicalOrTerm",
NTType: 24,
Index: 58,
Index: 59,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -784,7 +804,7 @@ var productionsTable = ProdTab{
String: `LogicalOrTerm : LogicalXORTerm << >>`,
Id: "LogicalOrTerm",
NTType: 24,
Index: 59,
Index: 60,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -794,7 +814,7 @@ var productionsTable = ProdTab{
String: `LogicalXORTerm : LogicalXORTerm "^^" LogicalAndTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "LogicalXORTerm",
NTType: 25,
Index: 60,
Index: 61,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -804,7 +824,7 @@ var productionsTable = ProdTab{
String: `LogicalXORTerm : LogicalAndTerm << >>`,
Id: "LogicalXORTerm",
NTType: 25,
Index: 61,
Index: 62,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -814,7 +834,7 @@ var productionsTable = ProdTab{
String: `LogicalAndTerm : LogicalAndTerm "&&" EqneTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "LogicalAndTerm",
NTType: 26,
Index: 62,
Index: 63,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -824,7 +844,7 @@ var productionsTable = ProdTab{
String: `LogicalAndTerm : EqneTerm << >>`,
Id: "LogicalAndTerm",
NTType: 26,
Index: 63,
Index: 64,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -834,7 +854,7 @@ var productionsTable = ProdTab{
String: `EqneTerm : EqneTerm "=~" CmpTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "EqneTerm",
NTType: 27,
Index: 64,
Index: 65,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -844,7 +864,7 @@ var productionsTable = ProdTab{
String: `EqneTerm : EqneTerm "!=~" CmpTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "EqneTerm",
NTType: 27,
Index: 65,
Index: 66,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -854,7 +874,7 @@ var productionsTable = ProdTab{
String: `EqneTerm : EqneTerm "==" CmpTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "EqneTerm",
NTType: 27,
Index: 66,
Index: 67,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -864,7 +884,7 @@ var productionsTable = ProdTab{
String: `EqneTerm : EqneTerm "!=" CmpTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "EqneTerm",
NTType: 27,
Index: 67,
Index: 68,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -874,7 +894,7 @@ var productionsTable = ProdTab{
String: `EqneTerm : CmpTerm << >>`,
Id: "EqneTerm",
NTType: 27,
Index: 68,
Index: 69,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -884,7 +904,7 @@ var productionsTable = ProdTab{
String: `CmpTerm : CmpTerm ">" BitwiseORTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "CmpTerm",
NTType: 28,
Index: 69,
Index: 70,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -894,7 +914,7 @@ var productionsTable = ProdTab{
String: `CmpTerm : CmpTerm ">=" BitwiseORTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "CmpTerm",
NTType: 28,
Index: 70,
Index: 71,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -904,7 +924,7 @@ var productionsTable = ProdTab{
String: `CmpTerm : CmpTerm "<" BitwiseORTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "CmpTerm",
NTType: 28,
Index: 71,
Index: 72,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -914,7 +934,7 @@ var productionsTable = ProdTab{
String: `CmpTerm : CmpTerm "<=" BitwiseORTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "CmpTerm",
NTType: 28,
Index: 72,
Index: 73,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -924,7 +944,7 @@ var productionsTable = ProdTab{
String: `CmpTerm : BitwiseORTerm << >>`,
Id: "CmpTerm",
NTType: 28,
Index: 73,
Index: 74,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -934,7 +954,7 @@ var productionsTable = ProdTab{
String: `BitwiseORTerm : BitwiseORTerm "|" BitwiseXORTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "BitwiseORTerm",
NTType: 29,
Index: 74,
Index: 75,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -944,7 +964,7 @@ var productionsTable = ProdTab{
String: `BitwiseORTerm : BitwiseXORTerm << >>`,
Id: "BitwiseORTerm",
NTType: 29,
Index: 75,
Index: 76,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -954,7 +974,7 @@ var productionsTable = ProdTab{
String: `BitwiseXORTerm : BitwiseXORTerm "^" BitwiseANDTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "BitwiseXORTerm",
NTType: 30,
Index: 76,
Index: 77,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -964,7 +984,7 @@ var productionsTable = ProdTab{
String: `BitwiseXORTerm : BitwiseANDTerm << >>`,
Id: "BitwiseXORTerm",
NTType: 30,
Index: 77,
Index: 78,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -974,7 +994,7 @@ var productionsTable = ProdTab{
String: `BitwiseANDTerm : BitwiseANDTerm "&" BitwiseShiftTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "BitwiseANDTerm",
NTType: 31,
Index: 78,
Index: 79,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -984,7 +1004,7 @@ var productionsTable = ProdTab{
String: `BitwiseANDTerm : BitwiseShiftTerm << >>`,
Id: "BitwiseANDTerm",
NTType: 31,
Index: 79,
Index: 80,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -994,7 +1014,7 @@ var productionsTable = ProdTab{
String: `BitwiseShiftTerm : BitwiseShiftTerm "<<" AddsubdotTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "BitwiseShiftTerm",
NTType: 32,
Index: 80,
Index: 81,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -1004,7 +1024,17 @@ var productionsTable = ProdTab{
String: `BitwiseShiftTerm : BitwiseShiftTerm ">>" AddsubdotTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "BitwiseShiftTerm",
NTType: 32,
Index: 81,
Index: 82,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
},
},
ProdTabEntry{
String: `BitwiseShiftTerm : BitwiseShiftTerm ">>>" AddsubdotTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "BitwiseShiftTerm",
NTType: 32,
Index: 83,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -1014,7 +1044,7 @@ var productionsTable = ProdTab{
String: `BitwiseShiftTerm : AddsubdotTerm << >>`,
Id: "BitwiseShiftTerm",
NTType: 32,
Index: 82,
Index: 84,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -1024,7 +1054,7 @@ var productionsTable = ProdTab{
String: `AddsubdotTerm : AddsubdotTerm "+" MuldivTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "AddsubdotTerm",
NTType: 33,
Index: 83,
Index: 85,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -1034,7 +1064,7 @@ var productionsTable = ProdTab{
String: `AddsubdotTerm : AddsubdotTerm "-" MuldivTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "AddsubdotTerm",
NTType: 33,
Index: 84,
Index: 86,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -1044,7 +1074,7 @@ var productionsTable = ProdTab{
String: `AddsubdotTerm : AddsubdotTerm ".+" MuldivTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "AddsubdotTerm",
NTType: 33,
Index: 85,
Index: 87,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -1054,7 +1084,7 @@ var productionsTable = ProdTab{
String: `AddsubdotTerm : AddsubdotTerm ".-" MuldivTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "AddsubdotTerm",
NTType: 33,
Index: 86,
Index: 88,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -1064,7 +1094,7 @@ var productionsTable = ProdTab{
String: `AddsubdotTerm : AddsubdotTerm "." MuldivTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "AddsubdotTerm",
NTType: 33,
Index: 87,
Index: 89,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -1074,7 +1104,7 @@ var productionsTable = ProdTab{
String: `AddsubdotTerm : MuldivTerm << >>`,
Id: "AddsubdotTerm",
NTType: 33,
Index: 88,
Index: 90,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -1084,7 +1114,7 @@ var productionsTable = ProdTab{
String: `MuldivTerm : MuldivTerm "*" UnaryOpTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "MuldivTerm",
NTType: 34,
Index: 89,
Index: 91,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -1094,7 +1124,7 @@ var productionsTable = ProdTab{
String: `MuldivTerm : MuldivTerm "/" UnaryOpTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "MuldivTerm",
NTType: 34,
Index: 90,
Index: 92,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -1104,7 +1134,7 @@ var productionsTable = ProdTab{
String: `MuldivTerm : MuldivTerm "//" UnaryOpTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "MuldivTerm",
NTType: 34,
Index: 91,
Index: 93,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -1114,7 +1144,7 @@ var productionsTable = ProdTab{
String: `MuldivTerm : MuldivTerm "%!"(MISSING) UnaryOpTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "MuldivTerm",
NTType: 34,
Index: 92,
Index: 94,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -1124,7 +1154,7 @@ var productionsTable = ProdTab{
String: `MuldivTerm : MuldivTerm ".*" UnaryOpTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "MuldivTerm",
NTType: 34,
Index: 93,
Index: 95,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -1134,7 +1164,7 @@ var productionsTable = ProdTab{
String: `MuldivTerm : MuldivTerm "./" UnaryOpTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "MuldivTerm",
NTType: 34,
Index: 94,
Index: 96,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -1144,7 +1174,7 @@ var productionsTable = ProdTab{
String: `MuldivTerm : MuldivTerm ".//" UnaryOpTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "MuldivTerm",
NTType: 34,
Index: 95,
Index: 97,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -1154,7 +1184,7 @@ var productionsTable = ProdTab{
String: `MuldivTerm : UnaryOpTerm << >>`,
Id: "MuldivTerm",
NTType: 34,
Index: 96,
Index: 98,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -1164,7 +1194,7 @@ var productionsTable = ProdTab{
String: `UnaryOpTerm : "+" PowTerm << dsl.NewASTNodeUnary(X[0], X[1], dsl.NodeTypeOperator) >>`,
Id: "UnaryOpTerm",
NTType: 35,
Index: 97,
Index: 99,
NumSymbols: 2,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeUnary(X[0], X[1], dsl.NodeTypeOperator)
@ -1174,7 +1204,7 @@ var productionsTable = ProdTab{
String: `UnaryOpTerm : "-" PowTerm << dsl.NewASTNodeUnary(X[0], X[1], dsl.NodeTypeOperator) >>`,
Id: "UnaryOpTerm",
NTType: 35,
Index: 98,
Index: 100,
NumSymbols: 2,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeUnary(X[0], X[1], dsl.NodeTypeOperator)
@ -1184,7 +1214,7 @@ var productionsTable = ProdTab{
String: `UnaryOpTerm : ".+" PowTerm << dsl.NewASTNodeUnary(X[0], X[1], dsl.NodeTypeOperator) >>`,
Id: "UnaryOpTerm",
NTType: 35,
Index: 99,
Index: 101,
NumSymbols: 2,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeUnary(X[0], X[1], dsl.NodeTypeOperator)
@ -1194,7 +1224,7 @@ var productionsTable = ProdTab{
String: `UnaryOpTerm : ".-" PowTerm << dsl.NewASTNodeUnary(X[0], X[1], dsl.NodeTypeOperator) >>`,
Id: "UnaryOpTerm",
NTType: 35,
Index: 100,
Index: 102,
NumSymbols: 2,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeUnary(X[0], X[1], dsl.NodeTypeOperator)
@ -1204,7 +1234,7 @@ var productionsTable = ProdTab{
String: `UnaryOpTerm : "!" PowTerm << dsl.NewASTNodeUnary(X[0], X[1], dsl.NodeTypeOperator) >>`,
Id: "UnaryOpTerm",
NTType: 35,
Index: 101,
Index: 103,
NumSymbols: 2,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeUnary(X[0], X[1], dsl.NodeTypeOperator)
@ -1214,7 +1244,7 @@ var productionsTable = ProdTab{
String: `UnaryOpTerm : "~" PowTerm << dsl.NewASTNodeUnary(X[0], X[1], dsl.NodeTypeOperator) >>`,
Id: "UnaryOpTerm",
NTType: 35,
Index: 102,
Index: 104,
NumSymbols: 2,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeUnary(X[0], X[1], dsl.NodeTypeOperator)
@ -1224,7 +1254,7 @@ var productionsTable = ProdTab{
String: `UnaryOpTerm : PowTerm << >>`,
Id: "UnaryOpTerm",
NTType: 35,
Index: 103,
Index: 105,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -1234,7 +1264,7 @@ var productionsTable = ProdTab{
String: `PowTerm : PrecedenceChainEnd "**" PowTerm << dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator) >>`,
Id: "PowTerm",
NTType: 36,
Index: 104,
Index: 106,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(X[1], X[0], X[2], dsl.NodeTypeOperator)
@ -1244,7 +1274,7 @@ var productionsTable = ProdTab{
String: `PowTerm : PrecedenceChainEnd << >>`,
Id: "PowTerm",
NTType: 36,
Index: 105,
Index: 107,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -1254,7 +1284,7 @@ var productionsTable = ProdTab{
String: `PrecedenceChainEnd : "(" Rvalue ")" << dsl.Nestable(X[1]) >>`,
Id: "PrecedenceChainEnd",
NTType: 37,
Index: 106,
Index: 108,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.Nestable(X[1])
@ -1264,7 +1294,7 @@ var productionsTable = ProdTab{
String: `PrecedenceChainEnd : MlrvalOrFunction << >>`,
Id: "PrecedenceChainEnd",
NTType: 37,
Index: 107,
Index: 109,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -1274,7 +1304,7 @@ var productionsTable = ProdTab{
String: `MlrvalOrFunction : FieldValue << >>`,
Id: "MlrvalOrFunction",
NTType: 38,
Index: 108,
Index: 110,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -1284,7 +1314,7 @@ var productionsTable = ProdTab{
String: `MlrvalOrFunction : FullSrec << >>`,
Id: "MlrvalOrFunction",
NTType: 38,
Index: 109,
Index: 111,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -1294,7 +1324,7 @@ var productionsTable = ProdTab{
String: `MlrvalOrFunction : OosvarValue << >>`,
Id: "MlrvalOrFunction",
NTType: 38,
Index: 110,
Index: 112,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -1304,7 +1334,7 @@ var productionsTable = ProdTab{
String: `MlrvalOrFunction : FullOosvar << >>`,
Id: "MlrvalOrFunction",
NTType: 38,
Index: 111,
Index: 113,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -1317,7 +1347,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "MlrvalOrFunction",
NTType: 38,
Index: 112,
Index: 114,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeStripDoubleQuotePair(
@ -1330,7 +1360,7 @@ var productionsTable = ProdTab{
String: `MlrvalOrFunction : md_token_int_literal << dsl.NewASTNode(X[0], dsl.NodeTypeIntLiteral) >>`,
Id: "MlrvalOrFunction",
NTType: 38,
Index: 113,
Index: 115,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNode(X[0], dsl.NodeTypeIntLiteral)
@ -1340,7 +1370,7 @@ var productionsTable = ProdTab{
String: `MlrvalOrFunction : md_token_float_literal << dsl.NewASTNode(X[0], dsl.NodeTypeFloatLiteral) >>`,
Id: "MlrvalOrFunction",
NTType: 38,
Index: 114,
Index: 116,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNode(X[0], dsl.NodeTypeFloatLiteral)
@ -1350,7 +1380,7 @@ var productionsTable = ProdTab{
String: `MlrvalOrFunction : md_token_boolean_literal << dsl.NewASTNode(X[0], dsl.NodeTypeBoolLiteral) >>`,
Id: "MlrvalOrFunction",
NTType: 38,
Index: 115,
Index: 117,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNode(X[0], dsl.NodeTypeBoolLiteral)
@ -1360,7 +1390,7 @@ var productionsTable = ProdTab{
String: `MlrvalOrFunction : md_token_panic << dsl.NewASTNode(X[0], dsl.NodeTypePanic) >>`,
Id: "MlrvalOrFunction",
NTType: 38,
Index: 116,
Index: 118,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNode(X[0], dsl.NodeTypePanic)
@ -1370,7 +1400,7 @@ var productionsTable = ProdTab{
String: `MlrvalOrFunction : ArrayLiteral << >>`,
Id: "MlrvalOrFunction",
NTType: 38,
Index: 117,
Index: 119,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -1383,7 +1413,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "ArrayLiteral",
NTType: 39,
Index: 118,
Index: 120,
NumSymbols: 2,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeZary(
@ -1402,7 +1432,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "ArrayLiteral",
NTType: 39,
Index: 119,
Index: 121,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.AdoptChildren(
@ -1422,7 +1452,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "ArrayLiteralElements",
NTType: 40,
Index: 120,
Index: 122,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeUnary(
@ -1440,7 +1470,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "ArrayLiteralElements",
NTType: 40,
Index: 121,
Index: 123,
NumSymbols: 2,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeUnary(
@ -1457,7 +1487,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "ArrayLiteralElements",
NTType: 40,
Index: 122,
Index: 124,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.PrependChild(
@ -1470,7 +1500,7 @@ var productionsTable = ProdTab{
String: `ArrayLiteralElement : Rvalue << >>`,
Id: "ArrayLiteralElement",
NTType: 41,
Index: 123,
Index: 125,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -1480,7 +1510,7 @@ var productionsTable = ProdTab{
String: `MlrvalOrFunction : MapLiteral << >>`,
Id: "MlrvalOrFunction",
NTType: 38,
Index: 124,
Index: 126,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -1493,7 +1523,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "MapLiteral",
NTType: 42,
Index: 125,
Index: 127,
NumSymbols: 2,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeZary(
@ -1512,7 +1542,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "MapLiteral",
NTType: 42,
Index: 126,
Index: 128,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.AdoptChildren(
@ -1532,7 +1562,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "MapLiteralKeyValuePairs",
NTType: 43,
Index: 127,
Index: 129,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeUnary(
@ -1550,7 +1580,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "MapLiteralKeyValuePairs",
NTType: 43,
Index: 128,
Index: 130,
NumSymbols: 2,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeUnary(
@ -1567,7 +1597,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "MapLiteralKeyValuePairs",
NTType: 43,
Index: 129,
Index: 131,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.PrependChild(
@ -1585,7 +1615,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "MapLiteralKeyValuePair",
NTType: 44,
Index: 130,
Index: 132,
NumSymbols: 3,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(
@ -1600,7 +1630,7 @@ var productionsTable = ProdTab{
String: `MlrvalOrFunction : ContextVariable << >>`,
Id: "MlrvalOrFunction",
NTType: 38,
Index: 131,
Index: 133,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -1610,7 +1640,7 @@ var productionsTable = ProdTab{
String: `ContextVariable : md_token_IPS << dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable) >>`,
Id: "ContextVariable",
NTType: 45,
Index: 132,
Index: 134,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable)
@ -1620,7 +1650,7 @@ var productionsTable = ProdTab{
String: `ContextVariable : md_token_IFS << dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable) >>`,
Id: "ContextVariable",
NTType: 45,
Index: 133,
Index: 135,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable)
@ -1630,7 +1660,7 @@ var productionsTable = ProdTab{
String: `ContextVariable : md_token_IRS << dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable) >>`,
Id: "ContextVariable",
NTType: 45,
Index: 134,
Index: 136,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable)
@ -1640,7 +1670,7 @@ var productionsTable = ProdTab{
String: `ContextVariable : md_token_OPS << dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable) >>`,
Id: "ContextVariable",
NTType: 45,
Index: 135,
Index: 137,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable)
@ -1650,7 +1680,7 @@ var productionsTable = ProdTab{
String: `ContextVariable : md_token_OFS << dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable) >>`,
Id: "ContextVariable",
NTType: 45,
Index: 136,
Index: 138,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable)
@ -1660,7 +1690,7 @@ var productionsTable = ProdTab{
String: `ContextVariable : md_token_ORS << dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable) >>`,
Id: "ContextVariable",
NTType: 45,
Index: 137,
Index: 139,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable)
@ -1670,7 +1700,7 @@ var productionsTable = ProdTab{
String: `ContextVariable : md_token_NF << dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable) >>`,
Id: "ContextVariable",
NTType: 45,
Index: 138,
Index: 140,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable)
@ -1680,7 +1710,7 @@ var productionsTable = ProdTab{
String: `ContextVariable : md_token_NR << dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable) >>`,
Id: "ContextVariable",
NTType: 45,
Index: 139,
Index: 141,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable)
@ -1690,7 +1720,7 @@ var productionsTable = ProdTab{
String: `ContextVariable : md_token_FNR << dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable) >>`,
Id: "ContextVariable",
NTType: 45,
Index: 140,
Index: 142,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable)
@ -1700,7 +1730,7 @@ var productionsTable = ProdTab{
String: `ContextVariable : md_token_FILENAME << dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable) >>`,
Id: "ContextVariable",
NTType: 45,
Index: 141,
Index: 143,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable)
@ -1710,7 +1740,7 @@ var productionsTable = ProdTab{
String: `ContextVariable : md_token_FILENUM << dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable) >>`,
Id: "ContextVariable",
NTType: 45,
Index: 142,
Index: 144,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNode(X[0], dsl.NodeTypeContextVariable)
@ -1720,7 +1750,7 @@ var productionsTable = ProdTab{
String: `MlrvalOrFunction : ArrayOrMapIndexAccess << >>`,
Id: "MlrvalOrFunction",
NTType: 38,
Index: 143,
Index: 145,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -1735,7 +1765,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "ArrayOrMapIndexAccess",
NTType: 46,
Index: 144,
Index: 146,
NumSymbols: 4,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeBinary(
@ -1750,7 +1780,7 @@ var productionsTable = ProdTab{
String: `MlrvalOrFunction : ArraySliceAccess << >>`,
Id: "MlrvalOrFunction",
NTType: 38,
Index: 145,
Index: 147,
NumSymbols: 1,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return X[0], nil
@ -1766,7 +1796,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "ArraySliceAccess",
NTType: 47,
Index: 146,
Index: 148,
NumSymbols: 6,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeTernary(
@ -1791,7 +1821,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "ArraySliceAccess",
NTType: 47,
Index: 147,
Index: 149,
NumSymbols: 5,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeTernary(
@ -1819,7 +1849,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "ArraySliceAccess",
NTType: 47,
Index: 148,
Index: 150,
NumSymbols: 5,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeTernary(
@ -1850,7 +1880,7 @@ var productionsTable = ProdTab{
) >>`,
Id: "ArraySliceAccess",
NTType: 47,
Index: 149,
Index: 151,
NumSymbols: 4,
ReduceFunc: func(X []Attrib) (Attrib, error) {
return dsl.NewASTNodeTernary(

View file

@ -145,6 +145,7 @@ var TokMap = TokenMap{
"^=",
"<<=",
">>=",
">>>=",
"+=",
".=",
"-=",
@ -171,6 +172,7 @@ var TokMap = TokenMap{
"&",
"<<",
">>",
">>>",
"+",
"-",
".+",
@ -234,65 +236,67 @@ var TokMap = TokenMap{
"^=": 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,
"md_token_string_literal": 69,
"md_token_int_literal": 70,
"md_token_float_literal": 71,
"md_token_boolean_literal": 72,
"md_token_panic": 73,
",": 74,
"md_token_IPS": 75,
"md_token_IFS": 76,
"md_token_IRS": 77,
"md_token_OPS": 78,
"md_token_OFS": 79,
"md_token_ORS": 80,
"md_token_NF": 81,
"md_token_NR": 82,
"md_token_FNR": 83,
"md_token_FILENAME": 84,
"md_token_FILENUM": 85,
">>>=": 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,
"md_token_string_literal": 71,
"md_token_int_literal": 72,
"md_token_float_literal": 73,
"md_token_boolean_literal": 74,
"md_token_panic": 75,
",": 76,
"md_token_IPS": 77,
"md_token_IFS": 78,
"md_token_IRS": 79,
"md_token_OPS": 80,
"md_token_OFS": 81,
"md_token_ORS": 82,
"md_token_NF": 83,
"md_token_NR": 84,
"md_token_FNR": 85,
"md_token_FILENAME": 86,
"md_token_FILENUM": 87,
},
}

View file

@ -2,6 +2,10 @@
TOP OF LIST:
* wednesday:
* copy-on-write
- MapPutNoCopy w/ comments
? dsl/ast.go -> parsing/ast.go? then, put new-ast ctor -> parsing package
o if so, update r.mds
! array-assigns with auto-extend
this needs to work: '@records[FILENAME][NR]=$*'
o indexed-lvalue assignment ops -- need ints too
@ -132,3 +136,5 @@ NITS/NON-IMMEDIATE:
* better error-identification in the lexer / parser
o research gocc support
o maybe a case for hand-roll
* ICE on scan of 0xffffffffffffffff
* support 0b0101 et al.? mlrdoc if so