| /********************************************************************* |
| * Copyright (c) 2019 The University of York. |
| * |
| * This program and the accompanying materials are made |
| * available under the terms of the Eclipse Public License 2.0 |
| * which is available at https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| **********************************************************************/ |
| package org.eclipse.epsilon.executors.ecl; |
| |
| import org.eclipse.epsilon.ecl.EclModule; |
| import org.eclipse.epsilon.ecl.IEclModule; |
| import org.eclipse.epsilon.ecl.trace.MatchTrace; |
| import org.eclipse.epsilon.eol.exceptions.EolRuntimeException; |
| import org.eclipse.epsilon.executors.AbstractLanguageExecutor; |
| import org.slf4j.Logger; |
| import org.slf4j.LoggerFactory; |
| |
| /** |
| * |
| * |
| * @author Sina Madani |
| * @since 1.6 |
| */ |
| public class EclExecutor extends AbstractLanguageExecutor implements IEclExecutor { |
| |
| static final Logger logger = LoggerFactory.getLogger(EclExecutor.class); |
| |
| public EclExecutor() { |
| this(new EclModule()); |
| } |
| |
| public EclExecutor(IEclModule module) { |
| super(module); |
| logger.info("Creating the EclStandaloneEngine"); |
| } |
| |
| @Override |
| protected MatchTrace executeInternal() throws EolRuntimeException { |
| logger.info("Executing ECL script."); |
| return getModule().execute(); |
| } |
| |
| @Override |
| public MatchTrace getResult() { |
| return (MatchTrace) result; |
| } |
| |
| @Override |
| public IEclModule getModule() { |
| return (IEclModule) module; |
| } |
| } |