SizzleParser.ReInit(new StringReader(source));
TestCodeGeneratingVisitor.typeChecker.visit(SizzleParser.Start(), st);
SizzleParser.ReInit(new StringReader(source));
final String src = codeGenerator.visit(SizzleParser.Start(), st);
SizzleRunner sizzleRunner = null;
try {
sizzleRunner = TestCodeGeneratingVisitor.compiler.compile("sizzle.Regex", src, null, new Class<?>[] { SizzleRunner.class }).newInstance();
} catch (final CharSequenceCompilerException e) {
for (final Diagnostic<? extends JavaFileObject> d : e.getDiagnostics().getDiagnostics())
System.err.println(d.toString());
throw e;
}
final MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable> mapReduceDriver = new MapReduceDriver<LongWritable, Text, EmitKey, EmitValue, Text, NullWritable>();
mapReduceDriver.setMapper(sizzleRunner.getMapper());
// TODO: add the combiner when MAPREDUCE-797 is integrated
mapReduceDriver.setReducer(sizzleRunner.getReducer());
mapReduceDriver.addInput(new LongWritable(0), new Text(""));
mapReduceDriver.addOutput(new Text("out[float] = [-+]?[0-9]*\\.?[0-9]+(e[-+]?[0-9]+)?"), NullWritable.get());
mapReduceDriver.addOutput(new Text("out[int,10] = [+-]?[0-9]+"), NullWritable.get());
mapReduceDriver.addOutput(new Text("out[int,16] = (0x)?[A-Fa-f0-9]+h?"), NullWritable.get());
mapReduceDriver.addOutput(new Text("out[int,8] = 0[0-7]+"), NullWritable.get());