| /*=============================================================================# |
| # Copyright (c) 2012, 2018 Stephan Wahlbrink and others. |
| # |
| # 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, or the Apache License, Version 2.0 |
| # which is available at https://www.apache.org/licenses/LICENSE-2.0. |
| # |
| # SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 |
| # |
| # Contributors: |
| # Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation |
| #=============================================================================*/ |
| |
| package org.eclipse.statet.docmlet.tex.core.model; |
| |
| import org.eclipse.core.runtime.IProgressMonitor; |
| |
| import org.eclipse.statet.docmlet.tex.core.ast.TexAstNode; |
| import org.eclipse.statet.internal.docmlet.tex.core.model.LtxProblemAstVisitor; |
| import org.eclipse.statet.internal.docmlet.tex.core.model.LtxProblemModelCheck; |
| import org.eclipse.statet.ltk.ast.core.AstInfo; |
| import org.eclipse.statet.ltk.core.SourceContent; |
| import org.eclipse.statet.ltk.issues.core.ProblemRequestor; |
| |
| |
| public class LtxProblemReporter { |
| |
| |
| private final LtxProblemAstVisitor astVisitor= new LtxProblemAstVisitor(); |
| private final LtxProblemModelCheck modelCheck= new LtxProblemModelCheck(); |
| |
| |
| public LtxProblemReporter() { |
| } |
| |
| |
| public void run(final ITexSourceUnit su, final SourceContent content, |
| final ILtxModelInfo model, |
| final ProblemRequestor requestor, final int level, final IProgressMonitor monitor) { |
| final AstInfo ast= model.getAst(); |
| if (ast.getRoot() instanceof TexAstNode) { |
| this.astVisitor.run(su, content, (TexAstNode) ast.getRoot(), requestor); |
| } |
| this.modelCheck.run(su, content, model, requestor); |
| } |
| |
| } |