Package: PatternListTC

PatternListTC

nameinstructionbranchcomplexitylinemethod
PatternListTC(ITypeCheckerAssistantFactory)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
typeResolve(QuestionAnswerAdaptor, TypeCheckInfo)
M: 21 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
unResolve()
M: 20 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * #%~
3: * The VDM Type Checker
4: * %%
5: * Copyright (C) 2008 - 2014 Overture
6: * %%
7: * This program is free software: you can redistribute it and/or modify
8: * it under the terms of the GNU General Public License as
9: * published by the Free Software Foundation, either version 3 of the
10: * License, or (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public
18: * License along with this program. If not, see
19: * <http://www.gnu.org/licenses/gpl-3.0.html>.
20: * #~%
21: */
22: package org.overture.typechecker.assistant.pattern;
23:
24: import java.util.Vector;
25:
26: import org.overture.ast.analysis.AnalysisException;
27: import org.overture.ast.analysis.QuestionAnswerAdaptor;
28: import org.overture.ast.patterns.PPattern;
29: import org.overture.ast.types.PType;
30: import org.overture.typechecker.TypeCheckInfo;
31: import org.overture.typechecker.assistant.ITypeCheckerAssistantFactory;
32:
33: public class PatternListTC extends Vector<PPattern>
34: {
35:
36:         /**
37:          *
38:          */
39:         private static final long serialVersionUID = 8197456560367128159L;
40:
41:         protected ITypeCheckerAssistantFactory af;
42:
43:         public PatternListTC(ITypeCheckerAssistantFactory af)
44:         {
45:                 this.af = af;
46:         }
47:
48:         public void typeResolve(
49:                         QuestionAnswerAdaptor<TypeCheckInfo, PType> rootVisitor,
50:                         TypeCheckInfo question) throws AnalysisException
51:         {
52:•                for (PPattern pPattern : this)
53:                 {
54:                         af.createPPatternAssistant(question.fromModule).typeResolve(pPattern, rootVisitor, question);
55:                 }
56:         }
57:
58:         public void unResolve()
59:         {
60:•                for (PPattern pPattern : this)
61:                 {
62:                         af.createPPatternAssistant(pPattern.getLocation().getModule()).unResolve(pPattern);
63:                 }
64:         }
65:
66: }