embulk-filter-row 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,9 @@ import org.embulk.config.ConfigException;
4
4
  import org.embulk.spi.PageReader;
5
5
  import org.embulk.spi.time.Timestamp;
6
6
 
7
+ import java.util.regex.Matcher;
8
+ import java.util.regex.Pattern;
9
+
7
10
  // Operation Node of AST (Abstract Syntax Tree)
8
11
  public abstract class ParserExp extends ParserNode
9
12
  {
@@ -12,9 +15,11 @@ public abstract class ParserExp extends ParserNode
12
15
 
13
16
  abstract class BinaryOpExp extends ParserExp
14
17
  {
15
- protected ParserLiteral left;
16
- protected ParserLiteral right;
17
- protected int operator;
18
+ ParserLiteral left;
19
+ ParserLiteral right;
20
+ int operator;
21
+
22
+ public BinaryOpExp() {}
18
23
 
19
24
  public BinaryOpExp(ParserLiteral left, ParserLiteral right, int operator)
20
25
  {
@@ -27,10 +32,47 @@ abstract class BinaryOpExp extends ParserExp
27
32
  {
28
33
  this((ParserLiteral)(left.obj), (ParserLiteral)(right.obj), operator);
29
34
  }
35
+
36
+ static BinaryOpExp create(ParserLiteral left, ParserLiteral right, int operator)
37
+ {
38
+ if (left.isTimestamp() || right.isTimestamp()) {
39
+ // Either of left or right would be a string or a number
40
+ return new TimestampOpExp(left, right, operator);
41
+ }
42
+ else if (left.isString() || right.isString()) {
43
+ return new StringOpExp(left, right, operator);
44
+ }
45
+ else if (left.isNumber() || right.isNumber()) {
46
+ return new NumberOpExp(left, right, operator);
47
+ }
48
+ else if (left.isBoolean() || right.isBoolean()) {
49
+ return new BooleanOpExp(left, right, operator);
50
+ }
51
+ else {
52
+ throw new RuntimeException();
53
+ }
54
+ }
55
+
56
+ static BinaryOpExp create(ParserVal left, ParserVal right, int operator)
57
+ {
58
+ return BinaryOpExp.create(((ParserLiteral)left.obj), ((ParserLiteral)right.obj), operator);
59
+ }
60
+
61
+ static boolean isOperatorAllowed(int[] operators, int operator)
62
+ {
63
+ for (int o : operators) {
64
+ if (operator == o) {
65
+ return true;
66
+ }
67
+ }
68
+ return false;
69
+ }
30
70
  }
31
71
 
32
72
  class BooleanOpExp extends BinaryOpExp
33
73
  {
74
+ public static int[] operators = {Parser.EQ, Parser.NEQ, Parser.GT, Parser.GE, Parser.LT, Parser.LE};
75
+
34
76
  public BooleanOpExp(ParserLiteral left, ParserLiteral right, int operator)
35
77
  {
36
78
  super(left, right, operator);
@@ -40,6 +82,9 @@ class BooleanOpExp extends BinaryOpExp
40
82
  if (! right.isBoolean()) {
41
83
  throw new ConfigException(String.format("\"%s\" is not a Boolean column", ((IdentifierLiteral)right).name));
42
84
  }
85
+ if (! isOperatorAllowed(operators, operator)) {
86
+ throw new ConfigException(String.format("\"%s\" is not an allowed operator for BooleanOpExp", Parser.yyname[operator]));
87
+ }
43
88
  }
44
89
 
45
90
  public BooleanOpExp(ParserVal left, ParserVal right, int operator)
@@ -66,6 +111,8 @@ class BooleanOpExp extends BinaryOpExp
66
111
 
67
112
  class NumberOpExp extends BinaryOpExp
68
113
  {
114
+ public static int[] operators = {Parser.EQ, Parser.NEQ, Parser.GT, Parser.GE, Parser.LT, Parser.LE};
115
+
69
116
  public NumberOpExp(ParserLiteral left, ParserLiteral right, int operator)
70
117
  {
71
118
  super(left, right, operator);
@@ -75,6 +122,9 @@ class NumberOpExp extends BinaryOpExp
75
122
  if (! right.isNumber()) {
76
123
  throw new ConfigException(String.format("\"%s\" is not a Number column", ((IdentifierLiteral)right).name));
77
124
  }
125
+ if (! isOperatorAllowed(operators, operator)) {
126
+ throw new ConfigException(String.format("\"%s\" is not an allowed operator for NumberOpExp", Parser.yyname[operator]));
127
+ }
78
128
  }
79
129
 
80
130
  public NumberOpExp(ParserVal left, ParserVal right, int operator)
@@ -113,14 +163,22 @@ class NumberOpExp extends BinaryOpExp
113
163
 
114
164
  class TimestampOpExp extends BinaryOpExp
115
165
  {
166
+ public static int[] operators = {Parser.EQ, Parser.NEQ, Parser.GT, Parser.GE, Parser.LT, Parser.LE};
167
+
116
168
  public TimestampOpExp(ParserLiteral left, ParserLiteral right, int operator)
117
169
  {
118
- super(left, right, operator);
119
- if (! left.isTimestamp()) {
120
- throw new ConfigException(String.format("\"%s\" is not a Timestamp column", ((IdentifierLiteral)left).name));
170
+ this.left = left.isIdentifier() ? left : new TimestampLiteral(left);
171
+ this.right = right.isIdentifier() ? right : new TimestampLiteral(right);
172
+ this.operator = operator;
173
+
174
+ if (! this.left.isTimestamp()) {
175
+ throw new ConfigException(String.format("\"%s\" is not a Timestamp column", ((IdentifierLiteral)this.left).name));
176
+ }
177
+ if (! this.right.isTimestamp()) {
178
+ throw new ConfigException(String.format("\"%s\" is not a Timestamp column", ((IdentifierLiteral)this.right).name));
121
179
  }
122
- if (! right.isTimestamp()) {
123
- throw new ConfigException(String.format("\"%s\" is not a Timestamp column", ((IdentifierLiteral)right).name));
180
+ if (! isOperatorAllowed(operators, operator)) {
181
+ throw new ConfigException(String.format("\"%s\" is not an allowed operator for TimestampOpExp", Parser.yyname[operator]));
124
182
  }
125
183
  }
126
184
 
@@ -160,6 +218,11 @@ class TimestampOpExp extends BinaryOpExp
160
218
 
161
219
  class StringOpExp extends BinaryOpExp
162
220
  {
221
+ public static int[] operators = {
222
+ Parser.EQ, Parser.NEQ, Parser.GT, Parser.GE, Parser.LT, Parser.LE,
223
+ Parser.START_WITH, Parser.END_WITH, Parser.INCLUDE, Parser.REGEXP
224
+ };
225
+
163
226
  public StringOpExp(ParserLiteral left, ParserLiteral right, int operator)
164
227
  {
165
228
  super(left, right, operator);
@@ -169,6 +232,9 @@ class StringOpExp extends BinaryOpExp
169
232
  if (! right.isString()) {
170
233
  throw new ConfigException(String.format("\"%s\" is not a String column", ((IdentifierLiteral)right).name));
171
234
  }
235
+ if (! isOperatorAllowed(operators, operator)) {
236
+ throw new ConfigException(String.format("\"%s\" is not an allowed operator for StringOpExp", Parser.yyname[operator]));
237
+ }
172
238
  }
173
239
 
174
240
  public StringOpExp(ParserVal left, ParserVal right, int operator)
@@ -186,6 +252,18 @@ class StringOpExp extends BinaryOpExp
186
252
  else if (operator == Parser.NEQ) {
187
253
  return ! l.equals(r);
188
254
  }
255
+ else if (operator == Parser.GT) {
256
+ return l.compareTo(r) > 0;
257
+ }
258
+ else if (operator == Parser.GE) {
259
+ return l.compareTo(r) >= 0;
260
+ }
261
+ else if (operator == Parser.LT) {
262
+ return l.compareTo(r) < 0;
263
+ }
264
+ else if (operator == Parser.LE) {
265
+ return l.compareTo(r) <= 0;
266
+ }
189
267
  else if (operator == Parser.START_WITH) {
190
268
  return l.startsWith(r);
191
269
  }
@@ -202,6 +280,32 @@ class StringOpExp extends BinaryOpExp
202
280
  }
203
281
  }
204
282
 
283
+ class RegexpOpExp extends BinaryOpExp
284
+ {
285
+ Pattern pattern;
286
+
287
+ public RegexpOpExp(ParserLiteral left, ParserLiteral right, int operator)
288
+ {
289
+ super(left, right, operator);
290
+ this.pattern = Pattern.compile(((StringLiteral)right).val);
291
+ if (! left.isString()) {
292
+ throw new ConfigException(String.format("\"%s\" is not a String column", ((IdentifierLiteral)left).name));
293
+ }
294
+ }
295
+
296
+ public RegexpOpExp(ParserVal left, ParserVal right, int operator)
297
+ {
298
+ this((ParserLiteral)(left.obj), (ParserLiteral)(right.obj), operator);
299
+ }
300
+
301
+ public boolean eval(PageReader pageReader)
302
+ {
303
+ String l = left.getString(pageReader);
304
+ Matcher m = pattern.matcher(l);
305
+ return m.find();
306
+ }
307
+ }
308
+
205
309
  class NullOpExp extends ParserExp
206
310
  {
207
311
  protected ParserLiteral val;
@@ -22,7 +22,8 @@ import org.msgpack.value.Value;
22
22
  // Literal Node of AST (Abstract Syntax Tree)
23
23
  public abstract class ParserLiteral extends ParserNode
24
24
  {
25
- static ScriptingContainer jruby;
25
+ protected static ScriptingContainer jruby;
26
+ protected String yytext;
26
27
 
27
28
  public static void setJRuby(ScriptingContainer jruby)
28
29
  {
@@ -49,6 +50,10 @@ public abstract class ParserLiteral extends ParserNode
49
50
  {
50
51
  return false;
51
52
  }
53
+ public boolean isIdentifier()
54
+ {
55
+ return false;
56
+ }
52
57
 
53
58
  public boolean isNull(PageReader pageReader)
54
59
  {
@@ -78,11 +83,12 @@ public abstract class ParserLiteral extends ParserNode
78
83
 
79
84
  class BooleanLiteral extends ParserLiteral
80
85
  {
81
- public boolean val;
86
+ protected boolean val;
82
87
 
83
- public BooleanLiteral(boolean val)
88
+ public BooleanLiteral(String yytext)
84
89
  {
85
- this.val = val;
90
+ this.yytext = yytext;
91
+ this.val = Boolean.parseBoolean(yytext); // but, only true|TRUE|false|FALSE are allowed in lexer
86
92
  }
87
93
 
88
94
  public boolean isBoolean()
@@ -100,14 +106,10 @@ class NumberLiteral extends ParserLiteral
100
106
  {
101
107
  protected double val;
102
108
 
103
- public NumberLiteral(double val)
109
+ public NumberLiteral(String yytext)
104
110
  {
105
- this.val = val;
106
- }
107
-
108
- public NumberLiteral(String str)
109
- {
110
- this.val = Double.parseDouble(str);
111
+ this.yytext = yytext;
112
+ this.val = Double.parseDouble(yytext);
111
113
  }
112
114
 
113
115
  public boolean isNumber()
@@ -125,9 +127,10 @@ class StringLiteral extends ParserLiteral
125
127
  {
126
128
  protected String val;
127
129
 
128
- public StringLiteral(String val)
130
+ public StringLiteral(String yytext)
129
131
  {
130
- this.val = val;
132
+ this.yytext = yytext;
133
+ this.val = yytext;
131
134
  }
132
135
 
133
136
  public boolean isString()
@@ -146,21 +149,30 @@ class TimestampLiteral extends ParserLiteral
146
149
  protected Timestamp val;
147
150
  private static final DateTimeZone default_timezone = DateTimeZone.forID("UTC");
148
151
 
149
- public TimestampLiteral(ParserVal val)
152
+ public TimestampLiteral(ParserLiteral literal)
150
153
  {
151
- if (val.obj.getClass() == StringLiteral.class) {
152
- initTimestampLiteral(((StringLiteral)val.obj).val);
154
+ if (literal.getClass() == StringLiteral.class) {
155
+ initTimestampLiteral((StringLiteral)literal);
153
156
  }
154
- else if (val.obj.getClass() == NumberLiteral.class) {
155
- initTimestampLiteral(((NumberLiteral)(val.obj)).val);
157
+ else if (literal.getClass() == NumberLiteral.class) {
158
+ initTimestampLiteral((NumberLiteral)(literal));
159
+ }
160
+ else if (literal.getClass() == TimestampLiteral.class) {
161
+ initTimestampLiteral((TimestampLiteral)literal);
156
162
  }
157
163
  else {
158
- throw new RuntimeException();
164
+ throw new ConfigException(String.format("\"%s\" is not a Timestamp literal", literal.yytext));
159
165
  }
160
166
  }
161
167
 
162
- public void initTimestampLiteral(String str)
168
+ public TimestampLiteral(ParserVal val)
169
+ {
170
+ this((ParserLiteral)(val.obj));
171
+ }
172
+
173
+ void initTimestampLiteral(StringLiteral literal)
163
174
  {
175
+ this.yytext = literal.yytext;
164
176
  String[] formats = {
165
177
  "%Y-%m-%d %H:%M:%S.%N %z",
166
178
  "%Y-%m-%d %H:%M:%S.%N",
@@ -174,7 +186,7 @@ class TimestampLiteral extends ParserLiteral
174
186
  for (String format : formats) {
175
187
  try {
176
188
  TimestampParser timestampParser = new TimestampParser(jruby, format, default_timezone);
177
- this.val = timestampParser.parse(str);
189
+ this.val = timestampParser.parse(literal.val);
178
190
  break;
179
191
  }
180
192
  catch (TimestampParseException e) {
@@ -186,13 +198,21 @@ class TimestampLiteral extends ParserLiteral
186
198
  }
187
199
  }
188
200
 
189
- public void initTimestampLiteral(double epoch)
201
+ void initTimestampLiteral(NumberLiteral literal)
190
202
  {
203
+ this.yytext = literal.yytext;
204
+ double epoch = literal.val;
191
205
  int epochSecond = (int) epoch;
192
206
  long nanoAdjustment = (long) ((epoch - epochSecond) * 1000000000);
193
207
  this.val = Timestamp.ofEpochSecond(epochSecond, nanoAdjustment);
194
208
  }
195
209
 
210
+ void initTimestampLiteral(TimestampLiteral literal)
211
+ {
212
+ this.yytext = literal.yytext;
213
+ this.val = literal.val;
214
+ }
215
+
196
216
  public boolean isTimestamp()
197
217
  {
198
218
  return true;
@@ -239,6 +259,10 @@ class IdentifierLiteral extends ParserLiteral
239
259
  {
240
260
  return (column.getType() instanceof JsonType);
241
261
  }
262
+ public boolean isIdentifier()
263
+ {
264
+ return true;
265
+ }
242
266
 
243
267
  public boolean isNull(PageReader pageReader)
244
268
  {
@@ -37,14 +37,14 @@ class Yylex {
37
37
  * Translates characters to character classes
38
38
  */
39
39
  private static final String ZZ_CMAP_PACKED =
40
- "\11\0\1\52\1\12\1\53\1\53\1\11\22\0\1\52\1\24\1\4"+
40
+ "\11\0\1\54\1\12\1\55\1\55\1\11\22\0\1\54\1\24\1\4"+
41
41
  "\4\0\1\10\1\13\1\13\3\0\1\1\1\3\1\0\12\2\2\0"+
42
- "\1\22\1\21\1\23\2\0\1\14\1\5\1\34\1\16\1\33\1\51"+
43
- "\1\5\1\32\1\31\2\5\1\35\1\37\1\15\1\17\1\40\1\5"+
44
- "\1\20\1\25\1\26\1\36\1\5\1\30\3\5\1\6\1\7\2\6"+
45
- "\1\27\1\6\1\46\1\54\2\5\1\44\1\45\5\5\1\47\1\5"+
46
- "\1\55\3\5\1\42\1\50\1\41\1\43\5\5\12\0\1\53\u1fa2\0"+
47
- "\1\53\1\53\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\udfe6\0";
42
+ "\1\22\1\21\1\23\2\0\1\14\1\5\1\34\1\16\1\33\1\53"+
43
+ "\1\37\1\32\1\31\2\5\1\35\1\42\1\15\1\17\1\41\1\5"+
44
+ "\1\20\1\25\1\26\1\36\1\5\1\30\1\40\2\5\1\6\1\7"+
45
+ "\2\6\1\27\1\6\1\50\1\56\2\5\1\46\1\47\5\5\1\51"+
46
+ "\1\5\1\57\3\5\1\44\1\52\1\43\1\45\5\5\12\0\1\55"+
47
+ "\u1fa2\0\1\55\1\55\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\udfe6\0";
48
48
 
49
49
  /**
50
50
  * Translates characters to character classes
@@ -58,15 +58,15 @@ class Yylex {
58
58
 
59
59
  private static final String ZZ_ACTION_PACKED_0 =
60
60
  "\3\0\2\1\1\2\1\3\1\4\1\5\2\6\1\7"+
61
- "\3\4\1\10\1\11\1\12\1\1\7\4\1\6\1\13"+
61
+ "\4\4\1\10\1\11\1\12\1\1\7\4\1\6\1\13"+
62
62
  "\1\1\1\14\1\13\1\15\1\1\1\0\3\4\1\16"+
63
- "\1\17\1\20\1\21\4\4\1\22\4\4\1\23\1\24"+
64
- "\1\25\1\26\1\27\1\30\1\31\1\32\1\33\1\2"+
65
- "\1\34\1\35\11\4\1\36\1\4\1\37\11\4\1\40"+
66
- "\6\4\1\41\3\4\1\42\1\4\1\43\1\44";
63
+ "\1\4\1\17\1\20\1\21\4\4\1\22\4\4\1\23"+
64
+ "\1\24\1\25\1\26\1\27\1\30\1\31\1\32\1\33"+
65
+ "\1\2\1\34\1\35\12\4\1\36\2\4\1\37\10\4"+
66
+ "\1\40\6\4\1\41\3\4\1\42\1\4\1\43\1\44";
67
67
 
68
68
  private static int [] zzUnpackAction() {
69
- int [] result = new int[98];
69
+ int [] result = new int[101];
70
70
  int offset = 0;
71
71
  offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
72
72
  return result;
@@ -91,22 +91,22 @@ class Yylex {
91
91
  private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
92
92
 
93
93
  private static final String ZZ_ROWMAP_PACKED_0 =
94
- "\0\0\0\56\0\134\0\212\0\270\0\346\0\212\0\u0114"+
95
- "\0\212\0\u0142\0\212\0\212\0\u0170\0\u019e\0\u01cc\0\212"+
96
- "\0\u01fa\0\u0228\0\u0256\0\u0284\0\u02b2\0\u02e0\0\u030e\0\u033c"+
97
- "\0\u036a\0\u0398\0\u03c6\0\u03f4\0\u0422\0\212\0\u0450\0\212"+
98
- "\0\u047e\0\u04ac\0\u04da\0\u0508\0\u0536\0\u0114\0\212\0\212"+
99
- "\0\212\0\u0564\0\u0592\0\u05c0\0\u05ee\0\u0114\0\u061c\0\u064a"+
100
- "\0\u0678\0\u06a6\0\212\0\212\0\212\0\212\0\212\0\212"+
101
- "\0\212\0\212\0\212\0\u04ac\0\u0114\0\u0114\0\u06d4\0\u0702"+
102
- "\0\u0730\0\u075e\0\u078c\0\u07ba\0\u07e8\0\u0816\0\u0844\0\u0114"+
103
- "\0\u0872\0\u0114\0\u08a0\0\u08ce\0\u08fc\0\u092a\0\u0958\0\u0986"+
104
- "\0\u09b4\0\u09e2\0\u0a10\0\u0114\0\u0a3e\0\u0a6c\0\u0a9a\0\u0ac8"+
105
- "\0\u0af6\0\u0b24\0\u0114\0\u0b52\0\u0b80\0\u0bae\0\u0114\0\u0bdc"+
106
- "\0\u0114\0\u0114";
94
+ "\0\0\0\60\0\140\0\220\0\300\0\360\0\220\0\u0120"+
95
+ "\0\220\0\u0150\0\220\0\220\0\u0180\0\u01b0\0\u01e0\0\u0210"+
96
+ "\0\220\0\u0240\0\u0270\0\u02a0\0\u02d0\0\u0300\0\u0330\0\u0360"+
97
+ "\0\u0390\0\u03c0\0\u03f0\0\u0420\0\u0450\0\u0480\0\220\0\u04b0"+
98
+ "\0\220\0\u04e0\0\u0510\0\u0540\0\u0570\0\u05a0\0\u0120\0\u05d0"+
99
+ "\0\220\0\220\0\220\0\u0600\0\u0630\0\u0660\0\u0690\0\u0120"+
100
+ "\0\u06c0\0\u06f0\0\u0720\0\u0750\0\220\0\220\0\220\0\220"+
101
+ "\0\220\0\220\0\220\0\220\0\220\0\u0510\0\u0120\0\u0120"+
102
+ "\0\u0780\0\u07b0\0\u07e0\0\u0810\0\u0840\0\u0870\0\u08a0\0\u08d0"+
103
+ "\0\u0900\0\u0930\0\u0120\0\u0960\0\u0990\0\u0120\0\u09c0\0\u09f0"+
104
+ "\0\u0a20\0\u0a50\0\u0a80\0\u0ab0\0\u0ae0\0\u0b10\0\u0120\0\u0b40"+
105
+ "\0\u0b70\0\u0ba0\0\u0bd0\0\u0c00\0\u0c30\0\u0120\0\u0c60\0\u0c90"+
106
+ "\0\u0cc0\0\u0120\0\u0cf0\0\u0120\0\u0120";
107
107
 
108
108
  private static int [] zzUnpackRowMap() {
109
- int [] result = new int[98];
109
+ int [] result = new int[101];
110
110
  int offset = 0;
111
111
  offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
112
112
  return result;
@@ -130,97 +130,101 @@ class Yylex {
130
130
 
131
131
  private static final String ZZ_TRANS_PACKED_0 =
132
132
  "\1\4\1\5\1\6\1\4\1\7\1\10\2\4\1\11"+
133
- "\1\12\1\13\1\14\1\15\1\16\1\10\1\17\1\10"+
134
- "\1\20\1\21\1\22\1\23\1\24\1\25\2\10\1\26"+
135
- "\1\10\1\27\5\10\1\30\3\10\1\31\3\10\1\32"+
136
- "\1\33\1\4\2\10\7\34\1\35\1\36\2\4\43\34"+
137
- "\4\37\1\40\2\37\1\41\1\37\2\4\43\37\60\0"+
138
- "\1\6\55\0\1\6\1\42\54\0\1\10\2\0\3\10"+
139
- "\4\0\5\10\4\0\25\10\2\0\2\10\12\0\1\13"+
140
- "\45\0\1\10\2\0\3\10\4\0\1\10\1\43\3\10"+
141
- "\4\0\25\10\2\0\2\10\2\0\1\10\2\0\3\10"+
142
- "\4\0\3\10\1\44\1\10\4\0\11\10\1\45\13\10"+
133
+ "\1\12\1\13\1\14\1\15\1\16\1\10\1\17\1\20"+
134
+ "\1\21\1\22\1\23\1\24\1\25\1\26\2\10\1\27"+
135
+ "\1\10\1\30\7\10\1\31\3\10\1\32\3\10\1\33"+
136
+ "\1\34\1\4\2\10\7\35\1\36\1\37\2\4\45\35"+
137
+ "\4\40\1\41\2\40\1\42\1\40\2\4\45\40\62\0"+
138
+ "\1\6\57\0\1\6\1\43\56\0\1\10\2\0\3\10"+
139
+ "\4\0\5\10\4\0\27\10\2\0\2\10\12\0\1\13"+
140
+ "\47\0\1\10\2\0\3\10\4\0\1\10\1\44\3\10"+
141
+ "\4\0\27\10\2\0\2\10\2\0\1\10\2\0\3\10"+
142
+ "\4\0\3\10\1\45\1\10\4\0\11\10\1\46\15\10"+
143
143
  "\2\0\2\10\2\0\1\10\2\0\3\10\4\0\4\10"+
144
- "\1\46\4\0\25\10\2\0\2\10\21\0\1\47\1\0"+
145
- "\1\50\53\0\1\51\55\0\1\50\36\0\1\10\2\0"+
146
- "\3\10\4\0\5\10\4\0\1\10\1\52\23\10\2\0"+
147
- "\2\10\2\0\1\10\2\0\3\10\4\0\4\10\1\53"+
148
- "\4\0\4\10\1\54\20\10\2\0\2\10\2\0\1\10"+
149
- "\2\0\3\10\4\0\1\10\1\55\3\10\4\0\1\56"+
150
- "\24\10\2\0\2\10\2\0\1\10\2\0\3\10\4\0"+
151
- "\1\10\1\57\3\10\4\0\25\10\2\0\2\10\2\0"+
152
- "\1\10\2\0\3\10\4\0\5\10\4\0\15\10\1\60"+
153
- "\7\10\2\0\2\10\2\0\1\10\2\0\3\10\4\0"+
154
- "\5\10\4\0\21\10\1\61\3\10\2\0\2\10\2\0"+
155
- "\1\10\2\0\3\10\4\0\1\62\4\10\4\0\25\10"+
156
- "\2\0\2\10\52\0\1\33\3\0\7\34\4\0\43\34"+
157
- "\4\63\1\64\2\63\1\65\1\66\2\0\26\63\1\67"+
158
- "\1\70\2\63\1\71\5\63\1\0\1\72\1\73\4\37"+
159
- "\1\0\2\37\1\0\1\37\2\0\43\37\4\63\1\64"+
160
- "\2\63\1\65\1\66\2\0\40\63\1\0\2\63\2\0"+
161
- "\1\74\55\0\1\10\2\0\3\10\4\0\2\10\1\75"+
162
- "\2\10\4\0\25\10\2\0\2\10\2\0\1\10\2\0"+
163
- "\3\10\4\0\5\10\4\0\1\10\1\76\23\10\2\0"+
144
+ "\1\47\4\0\27\10\2\0\2\10\2\0\1\10\2\0"+
145
+ "\3\10\4\0\5\10\4\0\6\10\1\50\20\10\2\0"+
146
+ "\2\10\21\0\1\51\1\0\1\52\55\0\1\53\57\0"+
147
+ "\1\52\40\0\1\10\2\0\3\10\4\0\5\10\4\0"+
148
+ "\1\10\1\54\25\10\2\0\2\10\2\0\1\10\2\0"+
149
+ "\3\10\4\0\4\10\1\55\4\0\4\10\1\56\22\10"+
150
+ "\2\0\2\10\2\0\1\10\2\0\3\10\4\0\1\10"+
151
+ "\1\57\3\10\4\0\1\60\26\10\2\0\2\10\2\0"+
152
+ "\1\10\2\0\3\10\4\0\1\10\1\61\3\10\4\0"+
153
+ "\27\10\2\0\2\10\2\0\1\10\2\0\3\10\4\0"+
154
+ "\5\10\4\0\17\10\1\62\7\10\2\0\2\10\2\0"+
155
+ "\1\10\2\0\3\10\4\0\5\10\4\0\23\10\1\63"+
156
+ "\3\10\2\0\2\10\2\0\1\10\2\0\3\10\4\0"+
157
+ "\1\64\4\10\4\0\27\10\2\0\2\10\54\0\1\34"+
158
+ "\3\0\7\35\4\0\45\35\4\65\1\66\2\65\1\67"+
159
+ "\1\70\2\0\30\65\1\71\1\72\2\65\1\73\5\65"+
160
+ "\1\0\1\74\1\75\4\40\1\0\2\40\1\0\1\40"+
161
+ "\2\0\45\40\4\65\1\66\2\65\1\67\1\70\2\0"+
162
+ "\42\65\1\0\2\65\2\0\1\76\57\0\1\10\2\0"+
163
+ "\3\10\4\0\2\10\1\77\2\10\4\0\27\10\2\0"+
164
164
  "\2\10\2\0\1\10\2\0\3\10\4\0\5\10\4\0"+
165
- "\10\10\1\77\14\10\2\0\2\10\2\0\1\10\2\0"+
166
- "\3\10\4\0\1\100\4\10\4\0\25\10\2\0\2\10"+
165
+ "\1\10\1\100\25\10\2\0\2\10\2\0\1\10\2\0"+
166
+ "\3\10\4\0\5\10\4\0\10\10\1\101\16\10\2\0"+
167
+ "\2\10\2\0\1\10\2\0\3\10\4\0\5\10\4\0"+
168
+ "\12\10\1\102\14\10\2\0\2\10\2\0\1\10\2\0"+
169
+ "\3\10\4\0\1\103\4\10\4\0\27\10\2\0\2\10"+
167
170
  "\2\0\1\10\2\0\3\10\4\0\5\10\4\0\11\10"+
168
- "\1\101\13\10\2\0\2\10\2\0\1\10\2\0\3\10"+
169
- "\4\0\5\10\4\0\12\10\1\102\12\10\2\0\2\10"+
171
+ "\1\104\15\10\2\0\2\10\2\0\1\10\2\0\3\10"+
172
+ "\4\0\5\10\4\0\15\10\1\105\11\10\2\0\2\10"+
170
173
  "\2\0\1\10\2\0\3\10\4\0\5\10\4\0\7\10"+
171
- "\1\103\15\10\2\0\2\10\2\0\1\10\2\0\3\10"+
172
- "\4\0\2\10\1\104\2\10\4\0\25\10\2\0\2\10"+
173
- "\2\0\1\10\2\0\3\10\4\0\5\10\4\0\16\10"+
174
- "\1\105\6\10\2\0\2\10\2\0\1\10\2\0\3\10"+
175
- "\4\0\5\10\4\0\22\10\1\106\2\10\2\0\2\10"+
174
+ "\1\106\17\10\2\0\2\10\2\0\1\10\2\0\3\10"+
175
+ "\4\0\2\10\1\107\2\10\4\0\27\10\2\0\2\10"+
176
+ "\2\0\1\10\2\0\3\10\4\0\5\10\4\0\20\10"+
177
+ "\1\110\6\10\2\0\2\10\2\0\1\10\2\0\3\10"+
178
+ "\4\0\5\10\4\0\24\10\1\111\2\10\2\0\2\10"+
176
179
  "\2\0\1\10\2\0\3\10\4\0\5\10\4\0\10\10"+
177
- "\1\107\14\10\2\0\2\10\2\0\1\10\2\0\3\10"+
178
- "\4\0\5\10\4\0\10\10\1\110\14\10\2\0\2\10"+
179
- "\2\0\1\10\2\0\3\10\4\0\4\10\1\111\4\0"+
180
- "\25\10\2\0\2\10\2\0\1\10\2\0\3\10\4\0"+
181
- "\5\10\4\0\6\10\1\112\16\10\2\0\2\10\2\0"+
182
- "\1\10\2\0\3\10\4\0\5\10\4\0\6\10\1\113"+
180
+ "\1\112\16\10\2\0\2\10\2\0\1\10\2\0\3\10"+
181
+ "\4\0\5\10\4\0\10\10\1\113\16\10\2\0\2\10"+
182
+ "\2\0\1\10\2\0\3\10\4\0\5\10\4\0\6\10"+
183
+ "\1\114\20\10\2\0\2\10\2\0\1\10\2\0\3\10"+
184
+ "\4\0\4\10\1\115\4\0\27\10\2\0\2\10\2\0"+
185
+ "\1\10\2\0\3\10\4\0\5\10\4\0\6\10\1\116"+
186
+ "\20\10\2\0\2\10\2\0\1\10\2\0\3\10\4\0"+
187
+ "\5\10\4\0\6\10\1\117\20\10\2\0\2\10\2\0"+
188
+ "\1\10\2\0\3\10\4\0\5\10\4\0\10\10\1\120"+
183
189
  "\16\10\2\0\2\10\2\0\1\10\2\0\3\10\4\0"+
184
- "\5\10\4\0\10\10\1\114\14\10\2\0\2\10\2\0"+
185
- "\1\10\2\0\3\10\4\0\5\10\4\0\2\10\1\115"+
186
- "\22\10\2\0\2\10\2\0\1\10\2\0\3\10\4\0"+
187
- "\5\10\4\0\17\10\1\112\5\10\2\0\2\10\2\0"+
188
- "\1\10\2\0\3\10\4\0\5\10\4\0\23\10\1\116"+
189
- "\1\10\2\0\2\10\2\0\1\10\2\0\3\10\4\0"+
190
- "\5\10\4\0\1\117\24\10\2\0\2\10\2\0\1\10"+
191
- "\2\0\3\10\4\0\5\10\4\0\1\10\1\120\23\10"+
190
+ "\5\10\4\0\2\10\1\121\24\10\2\0\2\10\2\0"+
191
+ "\1\10\2\0\3\10\4\0\5\10\4\0\21\10\1\116"+
192
+ "\5\10\2\0\2\10\2\0\1\10\2\0\3\10\4\0"+
193
+ "\5\10\4\0\25\10\1\110\1\10\2\0\2\10\2\0"+
194
+ "\1\10\2\0\3\10\4\0\5\10\4\0\1\104\26\10"+
192
195
  "\2\0\2\10\2\0\1\10\2\0\3\10\4\0\5\10"+
193
- "\4\0\1\121\24\10\2\0\2\10\2\0\1\10\2\0"+
194
- "\3\10\4\0\5\10\4\0\11\10\1\122\13\10\2\0"+
195
- "\2\10\2\0\1\10\2\0\3\10\4\0\5\10\4\0"+
196
- "\3\10\1\123\21\10\2\0\2\10\2\0\1\10\2\0"+
197
- "\3\10\4\0\5\10\4\0\17\10\1\124\5\10\2\0"+
196
+ "\4\0\13\10\1\122\13\10\2\0\2\10\2\0\1\10"+
197
+ "\2\0\3\10\4\0\5\10\4\0\1\10\1\123\25\10"+
198
+ "\2\0\2\10\2\0\1\10\2\0\3\10\4\0\5\10"+
199
+ "\4\0\1\124\26\10\2\0\2\10\2\0\1\10\2\0"+
200
+ "\3\10\4\0\5\10\4\0\11\10\1\125\15\10\2\0"+
198
201
  "\2\10\2\0\1\10\2\0\3\10\4\0\5\10\4\0"+
199
- "\6\10\1\124\16\10\2\0\2\10\2\0\1\10\2\0"+
200
- "\3\10\4\0\5\10\4\0\2\10\1\125\22\10\2\0"+
202
+ "\3\10\1\126\23\10\2\0\2\10\2\0\1\10\2\0"+
203
+ "\3\10\4\0\5\10\4\0\14\10\1\127\12\10\2\0"+
201
204
  "\2\10\2\0\1\10\2\0\3\10\4\0\5\10\4\0"+
202
- "\1\10\1\126\23\10\2\0\2\10\2\0\1\10\2\0"+
203
- "\3\10\4\0\2\10\1\127\2\10\4\0\25\10\2\0"+
205
+ "\2\10\1\130\24\10\2\0\2\10\2\0\1\10\2\0"+
206
+ "\3\10\4\0\5\10\4\0\1\10\1\131\25\10\2\0"+
207
+ "\2\10\2\0\1\10\2\0\3\10\4\0\2\10\1\132"+
208
+ "\2\10\4\0\27\10\2\0\2\10\2\0\1\10\2\0"+
209
+ "\3\10\4\0\5\10\4\0\4\10\1\133\22\10\2\0"+
204
210
  "\2\10\2\0\1\10\2\0\3\10\4\0\5\10\4\0"+
205
- "\4\10\1\130\20\10\2\0\2\10\2\0\1\10\2\0"+
206
- "\3\10\4\0\5\10\4\0\3\10\1\131\21\10\2\0"+
207
- "\2\10\2\0\1\10\2\0\3\10\4\0\1\132\4\10"+
208
- "\4\0\25\10\2\0\2\10\2\0\1\10\2\0\3\10"+
209
- "\4\0\5\10\4\0\6\10\1\133\16\10\2\0\2\10"+
210
- "\2\0\1\10\2\0\3\10\4\0\5\10\4\0\1\10"+
211
- "\1\134\23\10\2\0\2\10\2\0\1\10\2\0\3\10"+
212
- "\4\0\5\10\4\0\4\10\1\135\20\10\2\0\2\10"+
213
- "\2\0\1\10\2\0\3\10\4\0\5\10\4\0\12\10"+
214
- "\1\136\12\10\2\0\2\10\2\0\1\10\2\0\3\10"+
215
- "\4\0\5\10\4\0\5\10\1\137\17\10\2\0\2\10"+
216
- "\2\0\1\10\2\0\3\10\4\0\5\10\4\0\1\10"+
217
- "\1\140\23\10\2\0\2\10\2\0\1\10\2\0\3\10"+
218
- "\4\0\5\10\4\0\13\10\1\141\11\10\2\0\2\10"+
211
+ "\3\10\1\134\23\10\2\0\2\10\2\0\1\10\2\0"+
212
+ "\3\10\4\0\1\135\4\10\4\0\27\10\2\0\2\10"+
213
+ "\2\0\1\10\2\0\3\10\4\0\5\10\4\0\6\10"+
214
+ "\1\136\20\10\2\0\2\10\2\0\1\10\2\0\3\10"+
215
+ "\4\0\5\10\4\0\1\10\1\137\25\10\2\0\2\10"+
216
+ "\2\0\1\10\2\0\3\10\4\0\5\10\4\0\4\10"+
217
+ "\1\140\22\10\2\0\2\10\2\0\1\10\2\0\3\10"+
218
+ "\4\0\5\10\4\0\15\10\1\141\11\10\2\0\2\10"+
219
219
  "\2\0\1\10\2\0\3\10\4\0\5\10\4\0\5\10"+
220
- "\1\142\17\10\2\0\2\10";
220
+ "\1\142\21\10\2\0\2\10\2\0\1\10\2\0\3\10"+
221
+ "\4\0\5\10\4\0\1\10\1\143\25\10\2\0\2\10"+
222
+ "\2\0\1\10\2\0\3\10\4\0\5\10\4\0\14\10"+
223
+ "\1\144\12\10\2\0\2\10\2\0\1\10\2\0\3\10"+
224
+ "\4\0\5\10\4\0\5\10\1\145\21\10\2\0\2\10";
221
225
 
222
226
  private static int [] zzUnpackTrans() {
223
- int [] result = new int[3082];
227
+ int [] result = new int[3360];
224
228
  int offset = 0;
225
229
  offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
226
230
  return result;
@@ -259,11 +263,11 @@ class Yylex {
259
263
 
260
264
  private static final String ZZ_ATTRIBUTE_PACKED_0 =
261
265
  "\3\0\1\11\2\1\1\11\1\1\1\11\1\1\2\11"+
262
- "\3\1\1\11\15\1\1\11\1\1\1\11\1\1\1\0"+
263
- "\4\1\3\11\11\1\11\11\47\1";
266
+ "\4\1\1\11\15\1\1\11\1\1\1\11\1\1\1\0"+
267
+ "\5\1\3\11\11\1\11\11\50\1";
264
268
 
265
269
  private static int [] zzUnpackAttribute() {
266
- int [] result = new int[98];
270
+ int [] result = new int[101];
267
271
  int offset = 0;
268
272
  offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
269
273
  return result;
@@ -371,7 +375,7 @@ class Yylex {
371
375
  char [] map = new char[0x110000];
372
376
  int i = 0; /* index in packed string */
373
377
  int j = 0; /* index in unpacked array */
374
- while (i < 178) {
378
+ while (i < 180) {
375
379
  int count = packed.charAt(i++);
376
380
  char value = packed.charAt(i++);
377
381
  do map[j++] = value; while (--count > 0);
@@ -799,11 +803,11 @@ class Yylex {
799
803
  }
800
804
  case 66: break;
801
805
  case 31:
802
- { yyparser.yylval = new ParserVal(new BooleanLiteral(true)); return Parser.BOOLEAN;
806
+ { yyparser.yylval = new ParserVal(new BooleanLiteral(yytext())); return Parser.BOOLEAN;
803
807
  }
804
808
  case 67: break;
805
809
  case 32:
806
- { yyparser.yylval = new ParserVal(new BooleanLiteral(false)); return Parser.BOOLEAN;
810
+ { return Parser.REGEXP;
807
811
  }
808
812
  case 68: break;
809
813
  case 33: