plan.add(regex) ;
plan.connect(constant1, regex) ;
plan.connect(constant2, regex) ;
CompilationMessageCollector collector = new CompilationMessageCollector() ;
TypeCheckingValidator typeValidator = new TypeCheckingValidator() ;
typeValidator.validate(plan, collector) ;
printMessageCollector(collector) ;
printTypeGraph(plan) ;
// After type checking
if (collector.hasError()) {
throw new Exception("Error not expected during type checking") ;
}
// check type
System.out.println(DataType.findTypeName(regex.getType())) ;