Package: TestAnnotation

TestAnnotation

nameinstructionbranchcomplexitylinemethod
TestAnnotation()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
astAfter(ClassReader, SClassDefinition)
M: 23 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
astAfter(DefinitionReader, PDefinition)
M: 23 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
astAfter(ExpressionReader, PExp)
M: 23 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
astAfter(ModuleReader, AModuleModules)
M: 23 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
astAfter(StatementReader, PStm)
M: 23 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
astBefore(ClassReader)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
astBefore(DefinitionReader)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
astBefore(ExpressionReader)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
astBefore(ModuleReader)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
astBefore(StatementReader)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
doInit()
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
inAfter(PExp, Value, Context)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
inAfter(PStm, Value, Context)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
inBefore(PExp, Context)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
inBefore(PStm, Context)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
poAfter(AModuleModules, IProofObligationList, IPOContextStack)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
poAfter(PDefinition, IProofObligationList, IPOContextStack)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
poAfter(PExp, IProofObligationList, IPOContextStack)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
poAfter(PStm, IProofObligationList, IPOContextStack)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
poAfter(SClassDefinition, IProofObligationList, IPOContextStack)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
poBefore(AModuleModules, IPOContextStack)
M: 20 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
poBefore(PDefinition, IPOContextStack)
M: 20 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
poBefore(PExp, IPOContextStack)
M: 20 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
poBefore(PStm, IPOContextStack)
M: 20 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
poBefore(SClassDefinition, IPOContextStack)
M: 20 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
tcAfter(AModuleModules, TypeCheckInfo)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
tcAfter(PDefinition, TypeCheckInfo)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
tcAfter(PExp, TypeCheckInfo)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
tcAfter(PStm, TypeCheckInfo)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
tcAfter(SClassDefinition, TypeCheckInfo)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
tcBefore(AModuleModules, TypeCheckInfo)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
tcBefore(PDefinition, TypeCheckInfo)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
tcBefore(PExp, TypeCheckInfo)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
tcBefore(PStm, TypeCheckInfo)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
tcBefore(SClassDefinition, TypeCheckInfo)
M: 17 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
typecheckArgs()
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: *        Copyright (c) 2019 Nick Battle.
4: *
5: *        Author: Nick Battle
6: *
7: *        This file is part of Overture
8: *
9: ******************************************************************************/
10:
11: package org.overture.annotations.provided;
12:
13: import org.overture.ast.definitions.PDefinition;
14: import org.overture.ast.definitions.SClassDefinition;
15: import org.overture.ast.expressions.PExp;
16: import org.overture.ast.modules.AModuleModules;
17: import org.overture.ast.statements.PStm;
18: import org.overture.interpreter.annotations.INAnnotation;
19: import org.overture.interpreter.runtime.Context;
20: import org.overture.interpreter.values.Value;
21: import org.overture.parser.annotations.ASTAnnotationAdapter;
22: import org.overture.parser.syntax.ClassReader;
23: import org.overture.parser.syntax.DefinitionReader;
24: import org.overture.parser.syntax.ExpressionReader;
25: import org.overture.parser.syntax.ModuleReader;
26: import org.overture.parser.syntax.StatementReader;
27: import org.overture.pog.annotations.POAnnotation;
28: import org.overture.pog.obligation.ProofObligationList;
29: import org.overture.pog.pub.IPOContextStack;
30: import org.overture.pog.pub.IProofObligationList;
31: import org.overture.typechecker.TypeCheckInfo;
32: import org.overture.typechecker.annotations.TCAnnotation;
33:
34: public class TestAnnotation extends ASTAnnotationAdapter implements TCAnnotation, INAnnotation, POAnnotation
35: {
36:         public TestAnnotation()
37:         {
38:                 super();
39:         }
40:         
41:         public static void doInit()
42:         {
43:                 System.out.printf("doInit TestAnnotation\n");
44:         }
45:         
46:         @Override
47:         public boolean typecheckArgs()
48:         {
49:                 return false;        // Allow any expressions
50:         }
51:         
52:         /**
53:          * Parser...
54:          */
55:
56:         @Override
57:         public void astBefore(DefinitionReader reader)
58:         {
59:                 System.out.printf("astBefore %s\n", reader.getClass().getSimpleName(), this);
60:         }
61:
62:         @Override
63:         public void astBefore(StatementReader reader)
64:         {
65:                 System.out.printf("astBefore %s\n", reader.getClass().getSimpleName(), this);
66:         }
67:
68:         @Override
69:         public void astBefore(ExpressionReader reader)
70:         {
71:                 System.out.printf("astBefore %s\n", reader.getClass().getSimpleName(), this);
72:         }
73:
74:         @Override
75:         public void astBefore(ModuleReader reader)
76:         {
77:                 System.out.printf("astBefore %s\n", reader.getClass().getSimpleName(), this);
78:         }
79:
80:         @Override
81:         public void astBefore(ClassReader reader)
82:         {
83:                 System.out.printf("astBefore %s\n", reader.getClass().getSimpleName(), this);
84:         }
85:
86:         @Override
87:         public void astAfter(DefinitionReader reader, PDefinition def)
88:         {
89:                 System.out.printf("astAfter %s\n", reader.getClass().getSimpleName(), def.getClass().getSimpleName(), this);
90:         }
91:
92:         @Override
93:         public void astAfter(StatementReader reader, PStm stmt)
94:         {
95:                 System.out.printf("astAfter %s %s %s\n", reader.getClass().getSimpleName(), stmt.getClass().getSimpleName(), this);
96:         }
97:
98:         @Override
99:         public void astAfter(ExpressionReader reader, PExp exp)
100:         {
101:                 System.out.printf("astAfter %s %s %s\n", reader.getClass().getSimpleName(), exp.getClass().getSimpleName(), this);
102:         }
103:
104:         @Override
105:         public void astAfter(ModuleReader reader, AModuleModules module)
106:         {
107:                 System.out.printf("astAfter %s %s %s\n", reader.getClass().getSimpleName(), module.getClass().getSimpleName(), this);
108:         }
109:
110:         @Override
111:         public void astAfter(ClassReader reader, SClassDefinition clazz)
112:         {
113:                 System.out.printf("astAfter %s %s %s\n", reader.getClass().getSimpleName(), clazz.getClass().getSimpleName(), this);
114:         }
115:         
116:         /**
117:          * Type checker...
118:          */
119:
120:         @Override
121:         public void tcBefore(PDefinition node, TypeCheckInfo question)
122:         {
123:                 System.out.printf("tcBefore %s %s\n", node.getClass().getSimpleName(), this);
124:         }
125:
126:         @Override
127:         public void tcBefore(PExp node, TypeCheckInfo question)
128:         {
129:                 System.out.printf("tcBefore %s %s\n", node.getClass().getSimpleName(), this);
130:         }
131:
132:         @Override
133:         public void tcBefore(PStm node, TypeCheckInfo question)
134:         {
135:                 System.out.printf("tcBefore %s %s\n", node.getClass().getSimpleName(), this);
136:         }
137:
138:         @Override
139:         public void tcBefore(AModuleModules node, TypeCheckInfo question)
140:         {
141:                 System.out.printf("tcBefore %s %s\n", node.getClass().getSimpleName(), this);
142:         }
143:
144:         @Override
145:         public void tcBefore(SClassDefinition node, TypeCheckInfo question)
146:         {
147:                 System.out.printf("tcBefore %s %s\n", node.getClass().getSimpleName(), this);
148:         }
149:
150:         @Override
151:         public void tcAfter(PDefinition node, TypeCheckInfo question)
152:         {
153:                 System.out.printf("tcAfter %s %s\n", node.getClass().getSimpleName(), this);
154:         }
155:
156:         @Override
157:         public void tcAfter(PExp node, TypeCheckInfo question)
158:         {
159:                 System.out.printf("tcAfter %s %s\n", node.getClass().getSimpleName(), this);
160:         }
161:
162:         @Override
163:         public void tcAfter(PStm node, TypeCheckInfo question)
164:         {
165:                 System.out.printf("tcAfter %s %s\n", node.getClass().getSimpleName(), this);
166:         }
167:
168:         @Override
169:         public void tcAfter(AModuleModules node, TypeCheckInfo question)
170:         {
171:                 System.out.printf("tcAfter %s %s\n", node.getClass().getSimpleName(), this);
172:         }
173:
174:         @Override
175:         public void tcAfter(SClassDefinition node, TypeCheckInfo question)
176:         {
177:                 System.out.printf("tcAfter %s %s\n", node.getClass().getSimpleName(), this);
178:         }
179:
180:         /**
181:          * Interpreter...
182:          */
183:         
184:         @Override
185:         public void inBefore(PStm node, Context ctxt)
186:         {
187:                 System.out.printf("inBefore %s %s\n", node.getClass().getSimpleName(), this);
188:         }
189:
190:         @Override
191:         public void inAfter(PStm node, Value value, Context ctxt)
192:         {
193:                 System.out.printf("inAfter %s %s\n", node.getClass().getSimpleName(), this);
194:         }
195:
196:         @Override
197:         public void inBefore(PExp node, Context ctxt)
198:         {
199:                 System.out.printf("inBefore %s %s\n", node.getClass().getSimpleName(), this);
200:         }
201:
202:         @Override
203:         public void inAfter(PExp node, Value value, Context ctxt)
204:         {
205:                 System.out.printf("inAfter %s %s\n", node.getClass().getSimpleName(), this);
206:         }
207:         
208:         /**
209:          * POG...
210:          */
211:
212:         @Override
213:         public IProofObligationList poBefore(PDefinition node, IPOContextStack question)
214:         {
215:                 System.out.printf("poBefore %s %s\n", node.getClass().getSimpleName(), this);
216:                 return new ProofObligationList();
217:         }
218:
219:         @Override
220:         public void poAfter(PDefinition node, IProofObligationList list, IPOContextStack question)
221:         {
222:                 System.out.printf("poAfter %s %s\n", node.getClass().getSimpleName(), this);
223:         }
224:         
225:         @Override
226:         public IProofObligationList poBefore(PExp node, IPOContextStack question)
227:         {
228:                 System.out.printf("poBefore %s %s\n", node.getClass().getSimpleName(), this);
229:                 return new ProofObligationList();
230:         }
231:
232:         @Override
233:         public void poAfter(PExp node, IProofObligationList list, IPOContextStack question)
234:         {
235:                 System.out.printf("poAfter %s %s\n", node.getClass().getSimpleName(), this);
236:         }
237:         
238:         @Override
239:         public IProofObligationList poBefore(PStm node, IPOContextStack question)
240:         {
241:                 System.out.printf("poBefore %s %s\n", node.getClass().getSimpleName(), this);
242:                 return new ProofObligationList();
243:         }
244:
245:         @Override
246:         public void poAfter(PStm node, IProofObligationList list, IPOContextStack question)
247:         {
248:                 System.out.printf("poAfter %s %s\n", node.getClass().getSimpleName(), this);
249:         }
250:         
251:         @Override
252:         public IProofObligationList poBefore(AModuleModules node, IPOContextStack question)
253:         {
254:                 System.out.printf("poBefore %s %s\n", node.getClass().getSimpleName(), this);
255:                 return new ProofObligationList();
256:         }
257:
258:         @Override
259:         public void poAfter(AModuleModules node, IProofObligationList list, IPOContextStack question)
260:         {
261:                 System.out.printf("poAfter %s %s\n", node.getClass().getSimpleName(), this);
262:         }
263:         
264:         @Override
265:         public IProofObligationList poBefore(SClassDefinition node, IPOContextStack question)
266:         {
267:                 System.out.printf("poBefore %s %s\n", node.getClass().getSimpleName(), this);
268:                 return new ProofObligationList();
269:         }
270:
271:         @Override
272:         public void poAfter(SClassDefinition node, IProofObligationList list, IPOContextStack question)
273:         {
274:                 System.out.printf("poAfter %s %s\n", node.getClass().getSimpleName(), this);
275:         }
276: }