Package: SlAccessTrans

SlAccessTrans

nameinstructionbranchcomplexitylinemethod
SlAccessTrans()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
caseAMethodDeclIR(AMethodDeclIR)
M: 0 C: 11
100%
M: 0 C: 4
100%
M: 0 C: 3
100%
M: 0 C: 4
100%
M: 0 C: 1
100%

Coverage

1: package org.overture.codegen.trans;
2:
3: import org.overture.ast.lex.Dialect;
4: import org.overture.codegen.ir.IRConstants;
5: import org.overture.codegen.ir.analysis.AnalysisException;
6: import org.overture.codegen.ir.analysis.DepthFirstAnalysisAdaptor;
7: import org.overture.codegen.ir.declarations.AMethodDeclIR;
8: import org.overture.config.Settings;
9:
10: public class SlAccessTrans extends DepthFirstAnalysisAdaptor {
11:
12: @Override
13: public void caseAMethodDeclIR(AMethodDeclIR node) throws AnalysisException {
14:
15:• if(Settings.dialect == Dialect.VDM_SL)
16: {
17:• if(!node.getIsConstructor())
18: {
19: // Pre- and postconditions and invariants are private in the VDM AST -- even when they're being exported.
20: // Therefore, we'll need to adjust their access modifiers. To keep things simple we'll just make any
21: // method public.
22: node.setAccess(IRConstants.PUBLIC);
23: }
24: }
25: }
26: }