Search in sources :

Example 1 with IXtextGeneratorFragment

use of org.eclipse.xtext.xtext.generator.IXtextGeneratorFragment in project xtext-core by eclipse.

the class CompositeGeneratorFragment2 method generate.

@Override
public void generate() {
    final CompositeGeneratorException composite = new CompositeGeneratorException();
    for (final IXtextGeneratorFragment fragment : this.fragments) {
        try {
            fragment.generate();
        } catch (final Throwable _t) {
            if (_t instanceof Exception) {
                final Exception e = (Exception) _t;
                composite.addException(e);
            } else {
                throw Exceptions.sneakyThrow(_t);
            }
        }
    }
    boolean _hasExceptions = composite.hasExceptions();
    if (_hasExceptions) {
        throw composite;
    }
}
Also used : IXtextGeneratorFragment(org.eclipse.xtext.xtext.generator.IXtextGeneratorFragment) CompositeGeneratorException(org.eclipse.xtext.xtext.generator.CompositeGeneratorException) CompositeGeneratorException(org.eclipse.xtext.xtext.generator.CompositeGeneratorException)

Aggregations

CompositeGeneratorException (org.eclipse.xtext.xtext.generator.CompositeGeneratorException)1 IXtextGeneratorFragment (org.eclipse.xtext.xtext.generator.IXtextGeneratorFragment)1