Package: MultipleBindLister

MultipleBindLister

nameinstructionbranchcomplexitylinemethod
MultipleBindLister(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%
caseASeqBind(ASeqBind)
M: 0 C: 22
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
caseASetBind(ASetBind)
M: 0 C: 22
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
caseATypeBind(ATypeBind)
M: 0 C: 24
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
createNewReturnValue(INode)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
createNewReturnValue(Object)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
defaultPBind(PBind)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 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.utilities.pattern;
23:
24: import java.util.ArrayList;
25: import java.util.List;
26: import java.util.Vector;
27:
28: import org.overture.ast.analysis.AnalysisException;
29: import org.overture.ast.analysis.AnswerAdaptor;
30: import org.overture.ast.factory.AstFactory;
31: import org.overture.ast.node.INode;
32: import org.overture.ast.patterns.ASeqBind;
33: import org.overture.ast.patterns.ASetBind;
34: import org.overture.ast.patterns.ATypeBind;
35: import org.overture.ast.patterns.PBind;
36: import org.overture.ast.patterns.PMultipleBind;
37: import org.overture.ast.patterns.PPattern;
38: import org.overture.typechecker.assistant.ITypeCheckerAssistantFactory;
39:
40: public class MultipleBindLister extends AnswerAdaptor<List<PMultipleBind>>
41: {
42:         protected ITypeCheckerAssistantFactory af;
43:
44:         public MultipleBindLister(ITypeCheckerAssistantFactory af)
45:         {
46:                 this.af = af;
47:         }
48:
49:         @Override
50:         public List<PMultipleBind> caseASetBind(ASetBind bind)
51:                         throws AnalysisException
52:         {
53:                 List<PPattern> plist = new ArrayList<PPattern>();
54:                 plist.add(bind.getPattern());
55:                 List<PMultipleBind> mblist = new Vector<PMultipleBind>();
56:                 mblist.add(AstFactory.newASetMultipleBind(plist, bind.getSet()));
57:                 return mblist;
58:         }
59:
60:         @Override
61:         public List<PMultipleBind> caseASeqBind(ASeqBind bind)
62:                         throws AnalysisException
63:         {
64:                 List<PPattern> plist = new ArrayList<PPattern>();
65:                 plist.add(bind.getPattern());
66:                 List<PMultipleBind> mblist = new Vector<PMultipleBind>();
67:                 mblist.add(AstFactory.newASeqMultipleBind(plist, bind.getSeq()));
68:                 return mblist;
69:         }
70:
71:         @Override
72:         public List<PMultipleBind> caseATypeBind(ATypeBind bind)
73:                         throws AnalysisException
74:         {
75:                 List<PPattern> plist = new Vector<PPattern>();
76:                 plist.add(bind.getPattern().clone());
77:                 List<PMultipleBind> mblist = new Vector<PMultipleBind>();
78:                 mblist.add(AstFactory.newATypeMultipleBind(plist, bind.getType().clone()));
79:                 return mblist;
80:         }
81:
82:         @Override
83:         public List<PMultipleBind> defaultPBind(PBind bind)
84:                         throws AnalysisException
85:         {
86:                 return null;
87:         }
88:
89:         @Override
90:         public List<PMultipleBind> createNewReturnValue(INode node)
91:                         throws AnalysisException
92:         {
93:                 // TODO Auto-generated method stub
94:                 return null;
95:         }
96:
97:         @Override
98:         public List<PMultipleBind> createNewReturnValue(Object node)
99:                         throws AnalysisException
100:         {
101:                 // TODO Auto-generated method stub
102:                 return null;
103:         }
104:
105: }