Package: ITypeCheckerAssistantFactory

ITypeCheckerAssistantFactory

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;
23:
24: import java.util.Collection;
25: import java.util.LinkedList;
26: import java.util.List;
27:
28: import org.overture.ast.analysis.AnalysisAdaptor;
29: import org.overture.ast.analysis.AnswerAdaptor;
30: import org.overture.ast.analysis.QuestionAnswerAdaptor;
31: import org.overture.ast.analysis.intf.IAnswer;
32: import org.overture.ast.analysis.intf.IQuestion;
33: import org.overture.ast.analysis.intf.IQuestionAnswer;
34: import org.overture.ast.assistant.IAstAssistantFactory;
35: import org.overture.ast.assistant.pattern.PTypeList;
36: import org.overture.ast.definitions.PDefinition;
37: import org.overture.ast.intf.lex.ILexLocation;
38: import org.overture.ast.intf.lex.ILexNameToken;
39: import org.overture.ast.lex.LexNameList;
40: import org.overture.ast.lex.LexNameSet;
41: import org.overture.ast.modules.AModuleModules;
42: import org.overture.ast.patterns.PMultipleBind;
43: import org.overture.ast.types.AAccessSpecifierAccessSpecifier;
44: import org.overture.ast.types.AClassType;
45: import org.overture.ast.types.AFunctionType;
46: import org.overture.ast.types.AOperationType;
47: import org.overture.ast.types.AProductType;
48: import org.overture.ast.types.ARecordInvariantType;
49: import org.overture.ast.types.SSetType;
50: import org.overture.ast.types.AUnionType;
51: import org.overture.ast.types.PType;
52: import org.overture.ast.types.SMapType;
53: import org.overture.ast.types.SSeqType;
54: import org.overture.ast.util.PTypeSet;
55: import org.overture.typechecker.Environment;
56: import org.overture.typechecker.LexNameTokenAssistant;
57: import org.overture.typechecker.TypeCheckInfo;
58: import org.overture.typechecker.TypeComparator;
59: import org.overture.typechecker.assistant.definition.AExplicitFunctionDefinitionAssistantTC;
60: import org.overture.typechecker.assistant.definition.AExplicitOperationDefinitionAssistantTC;
61: import org.overture.typechecker.assistant.definition.AImplicitFunctionDefinitionAssistantTC;
62: import org.overture.typechecker.assistant.definition.AImplicitOperationDefinitionAssistantTC;
63: import org.overture.typechecker.assistant.definition.PAccessSpecifierAssistantTC;
64: import org.overture.typechecker.assistant.definition.PDefinitionAssistantTC;
65: import org.overture.typechecker.assistant.definition.PDefinitionListAssistantTC;
66: import org.overture.typechecker.assistant.definition.PDefinitionSet;
67: import org.overture.typechecker.assistant.definition.SClassDefinitionAssistantTC;
68: import org.overture.typechecker.assistant.definition.SFunctionDefinitionAssistantTC;
69: import org.overture.typechecker.assistant.module.AModuleExportsAssistantTC;
70: import org.overture.typechecker.assistant.module.AModuleImportsAssistantTC;
71: import org.overture.typechecker.assistant.module.AModuleModulesAssistantTC;
72: import org.overture.typechecker.assistant.pattern.APatternTypePairAssistant;
73: import org.overture.typechecker.assistant.pattern.ATypeBindAssistantTC;
74: import org.overture.typechecker.assistant.pattern.PBindAssistantTC;
75: import org.overture.typechecker.assistant.pattern.PMultipleBindAssistantTC;
76: import org.overture.typechecker.assistant.pattern.PPatternAssistantTC;
77: import org.overture.typechecker.assistant.pattern.PPatternListAssistantTC;
78: import org.overture.typechecker.assistant.pattern.PatternListTC;
79: import org.overture.typechecker.assistant.type.AClassTypeAssistantTC;
80: import org.overture.typechecker.assistant.type.AFunctionTypeAssistantTC;
81: import org.overture.typechecker.assistant.type.AOperationTypeAssistantTC;
82: import org.overture.typechecker.assistant.type.ARecordInvariantTypeAssistantTC;
83: import org.overture.typechecker.assistant.type.PTypeAssistantTC;
84: import org.overture.typechecker.utilities.DefinitionFinder;
85: import org.overture.typechecker.utilities.DefinitionTypeResolver;
86: import org.overture.typechecker.utilities.FreeVarInfo;
87: import org.overture.typechecker.utilities.NameFinder;
88: import org.overture.typechecker.utilities.pattern.AllDefinitionLocator;
89: import org.overture.typechecker.utilities.pattern.PatternResolver;
90: import org.overture.typechecker.utilities.type.ConcreateTypeImplementor;
91: import org.overture.typechecker.utilities.type.PTypeResolver;
92: import org.overture.typechecker.utilities.type.QualifiedDefinition;
93:
94: //TODO Add assistant Javadoc
95: /**
96: * The Interface specifying what is offered by the Overture TC assistant functionalities.
97: *
98: * @author ldc
99: */
100: public interface ITypeCheckerAssistantFactory extends IAstAssistantFactory
101: {
102:
103: //        ABusClassDefinitionAssistantTC createABusClassDefinitionAssistant();
104:
105: //        ACpuClassDefinitionAssistantTC createACpuClassDefinitionAssistant();
106:
107:         AExplicitFunctionDefinitionAssistantTC createAExplicitFunctionDefinitionAssistant();
108:
109:         AExplicitOperationDefinitionAssistantTC createAExplicitOperationDefinitionAssistant(String fromModule);
110:
111:         AImplicitFunctionDefinitionAssistantTC createAImplicitFunctionDefinitionAssistant();
112:
113:         AImplicitOperationDefinitionAssistantTC createAImplicitOperationDefinitionAssistant();
114:
115:         // AImportedDefinitionAssistantTC createAImportedDefinitionAssistant();
116:
117:         //AInstanceVariableDefinitionAssistantTC createAInstanceVariableDefinitionAssistant();
118:
119:         //ALocalDefinitionAssistantTC createALocalDefinitionAssistant();
120:
121:         //AStateDefinitionAssistantTC createAStateDefinitionAssistant();
122:
123:         // ASystemClassDefinitionAssistantTC createASystemClassDefinitionAssistant();
124:
125: //        AThreadDefinitionAssistantTC createAThreadDefinitionAssistant();
126:
127: //        ATypeDefinitionAssistantTC createATypeDefinitionAssistant();
128:
129:         // AValueDefinitionAssistantTC createAValueDefinitionAssistant();
130:
131:         PAccessSpecifierAssistantTC createPAccessSpecifierAssistant();
132:
133:         PDefinitionAssistantTC createPDefinitionAssistant();
134:
135:         PDefinitionListAssistantTC createPDefinitionListAssistant();
136:
137:         PDefinitionSet createPDefinitionSet();
138:
139: //        PTraceDefinitionAssistantTC createPTraceDefinitionAssistant();
140:
141:         SClassDefinitionAssistantTC createSClassDefinitionAssistant();
142:
143:         SFunctionDefinitionAssistantTC createSFunctionDefinitionAssistant();
144:         
145:         // expression
146:         //AApplyExpAssistantTC createAApplyExpAssistant();
147:
148:         //ACaseAlternativeAssistantTC createACaseAlternativeAssistant();
149:
150:         //PExpAssistantTC createPExpAssistant();
151:
152: //        SBinaryExpAssistantTC createSBinaryExpAssistant();
153:
154:         // module
155:
156:         //AFromModuleImportsAssistantTC createAFromModuleImportsAssistant();
157:
158:         //AModuleExportsAssistantTC createAModuleExportsAssistant();
159:
160:         AModuleImportsAssistantTC createAModuleImportsAssistant();
161:
162:         AModuleExportsAssistantTC createAModuleExportsAssistant();
163:
164:         AModuleModulesAssistantTC createAModuleModulesAssistant();
165:
166:         //PExportAssistantTC createPExportAssistant();
167:
168:         //PImportAssistantTC createPImportAssistant();
169:
170:         // pattern
171:         // ABooleanPatternAssistantTC createABooleanPatternAssistant();
172:
173:         // ACharacterPatternAssistantTC createACharacterPatternAssistant();
174:
175:         // AConcatenationPatternAssistantTC createAConcatenationPatternAssistant();
176:         
177:         // AExpressionPatternAssistantTC createAExpressionPatternAssistant();
178:
179: //        AMapletPatternMapletAssistantTC createAMapletPatternMapletAssistant();
180:
181:         // AMapPatternAssistantTC createAMapPatternAssistant();
182:
183:         // AMapUnionPatternAssistantTC createAMapUnionPatternAssistant();
184:
185:         APatternTypePairAssistant createAPatternTypePairAssistant(String fromModule);
186:
187:         // ARecordPatternAssistantTC createARecordPatternAssistant();
188:
189:         // ASeqPatternAssistantTC createASeqPatternAssistant();
190:
191:         //ASetBindAssistantTC createASetBindAssistant();
192:
193:         // ASetPatternAssistantTC createASetPatternAssistant();
194:
195:         // ATuplePatternAssistantTC createATuplePatternAssistant();
196:
197:         ATypeBindAssistantTC createATypeBindAssistant();
198:
199:         // AUnionPatternAssistantTC createAUnionPatternAssistant();
200:
201:         PatternListTC createPatternList();
202:
203:         PBindAssistantTC createPBindAssistant();
204:
205:         PMultipleBindAssistantTC createPMultipleBindAssistant();
206:
207:         PPatternAssistantTC createPPatternAssistant(String fromModule);
208:
209:         //PPatternBindAssistantTC createPPatternBindAssistant();
210:
211:         PPatternListAssistantTC createPPatternListAssistant();
212:
213:         // statement
214:         // AAlwaysStmAssistantTC createAAlwaysStmAssistant();
215:         // AAssignmentStmAssistantTC createAAssignmentStmAssistant();
216: //        ABlockSimpleBlockStmAssistantTC createABlockSimpleBlockStmAssistant();
217:
218: //        ACallObjectStatementAssistantTC createACallObjectStatementAssistant();
219:
220: //        ACallStmAssistantTC createACallStmAssistant();
221:
222:         // ACaseAlternativeStmAssistantTC createACaseAlternativeStmAssistant();
223:         // ACasesStmAssistantTC createACasesStmAssistant();
224:         // AElseIfStmAssistantTC createAElseIfStmAssistant();
225:         // AExitStmAssistantTC createAExitStmAssistant();
226: //        AExternalClauseAssistantTC createAExternalClauseAssistant();
227:
228:         // AForAllStmAssistantTC createAForAllStmAssistant();
229:         // AForIndexStmAssistantTC createAForIndexStmAssistant();
230:         // AForPatternBindStmAssitantTC createAForPatternBindStmAssitant();
231:         // AIfStmAssistantTC createAIfStmAssistant();
232:         // ALetBeStStmAssistantTC createALetBeStStmAssistant();
233: //        ANonDeterministicSimpleBlockStmAssistantTC createANonDeterministicSimpleBlockStmAssistant();
234:
235:         // AReturnStmAssistantTC createAReturnStmAssistant();
236:         // ATixeStmAssistantTC createATixeStmAssistant();
237:         // ATrapStmAssistantTC createATrapStmAssistant();
238:         // AWhileStmAssistantTC createAWhileStmAssistant();
239: //        PStateDesignatorAssistantTC createPStateDesignatorAssistant();
240:
241:         //PStmAssistantTC createPStmAssistant();
242:
243:         // SLetDefStmAssistantTC createSLetDefStmAssistant();
244:         // SSimpleBlockStmAssistantTC createSSimpleBlockStmAssistant();
245:
246:         // Type
247: //        AApplyObjectDesignatorAssistantTC createAApplyObjectDesignatorAssistant();
248:
249:         // ABracketTypeAssistantTC createABracketTypeAssistant();
250:
251:         AClassTypeAssistantTC createAClassTypeAssistant();
252:
253:         AFunctionTypeAssistantTC createAFunctionTypeAssistant();
254:
255:         AOperationTypeAssistantTC createAOperationTypeAssistant();
256:
257: //        APatternListTypePairAssistantTC createAPatternListTypePairAssistant();
258:
259:         ARecordInvariantTypeAssistantTC createARecordInvariantTypeAssistant();
260:
261: //        AUnionTypeAssistantTC createAUnionTypeAssistant();
262:
263:         PTypeAssistantTC createPTypeAssistant();
264:
265:         // visitors
266:
267:         // SSeqTypeAssistantTC createSSeqTypeAssistant();
268:
269:         // stuff to delete ends here
270:
271:         // visitor getters that we will actually keep
272:
273:         IAnswer<List<PDefinition>> getDefinitionCollector();
274:
275:         IAnswer<PType> getDefinitionTypeFinder();
276:
277:         IQuestionAnswer<Object, Boolean> getDefinitionEqualityChecker();
278:
279:         QuestionAnswerAdaptor<String, Boolean> getMapBasisChecker();
280:
281:         IAnswer<LexNameList> getVariableNameCollector();
282:
283:         IAnswer<PDefinition> getSelfDefinitionFinder();
284:
285:         IAnswer<PTypeSet> getExitTypeCollector();
286:
287:         IQuestionAnswer<DefinitionFinder.Newquestion, PDefinition> getDefinitionFinder();
288:
289:         IQuestionAnswer<NameFinder.Newquestion, PDefinition> getNameFinder();
290:
291:         AnswerAdaptor<Boolean> getFunctionChecker();
292:
293:         IAnswer<Boolean> getOperationChecker();
294:
295:         IAnswer<String> getKindFinder();
296:
297:         IAnswer<Boolean> getUpdatableChecker();
298:
299:         IAnswer<Boolean> getCallableOperationChecker();
300:
301:         AnalysisAdaptor getUsedMarker();
302:
303:         IQuestion<Environment> getImplicitDefinitionFinder();
304:
305:         IAnswer<Boolean> getUsedChecker();
306:
307:         IAnswer<Boolean> getPTypeFunctionChecker(String fromModule);
308:
309:         AnalysisAdaptor getUnusedChecker();
310:
311:         IAnswer<PDefinition> getDereferer();
312:
313:         IQuestion<DefinitionTypeResolver.NewQuestion> getDefinitionTypeResolver();
314:
315:         QuestionAnswerAdaptor<String, SMapType> getMapTypeFinder();
316:
317:         QuestionAnswerAdaptor<String, SSeqType> getSeqTypeFinder();
318:
319:         QuestionAnswerAdaptor<String, Boolean> getSeqBasisChecker();
320:
321:         QuestionAnswerAdaptor<String, AOperationType> getOperationTypeFinder();
322:
323:         QuestionAnswerAdaptor<String, Boolean> getOperationBasisChecker();
324:
325:         QuestionAnswerAdaptor<String, Boolean> getSetBasisChecker();
326:
327:         QuestionAnswerAdaptor<String, SSetType> getSetTypeFinder();
328:
329:         QuestionAnswerAdaptor<String, Boolean> getRecordBasisChecker();
330:
331:         QuestionAnswerAdaptor<String, Boolean> getTagBasisChecker();
332:
333:         QuestionAnswerAdaptor<String, ARecordInvariantType> getRecordTypeFinder();
334:
335:         QuestionAnswerAdaptor<String, Boolean> getClassBasisChecker(Environment env);
336:
337:         QuestionAnswerAdaptor<String, AClassType> getClassTypeFinder(Environment env);
338:
339:         QuestionAnswerAdaptor<String, AProductType> getProductTypeFinder();
340:
341:         QuestionAnswerAdaptor<String, Boolean> getProductBasisChecker();
342:
343:         IAnswer<String> getTypeDisplayer();
344:
345:         AnalysisAdaptor getTypeUnresolver();
346:
347:         IQuestionAnswer<AAccessSpecifierAccessSpecifier, Boolean> getNarrowerThanComparator();
348:
349:         QuestionAnswerAdaptor<String, AUnionType> getUnionTypeFinder();
350:
351:         IQuestionAnswer<Object, Boolean> getTypeEqualityChecker();
352:
353:         QuestionAnswerAdaptor<String, Boolean> getUnionBasisChecker();
354:
355:         IAnswer<AFunctionType> getFunctionTypeFinder();
356:
357:         IQuestionAnswer<PTypeResolver.Newquestion, PType> getPTypeResolver();
358:
359:         IQuestionAnswer<ConcreateTypeImplementor.Newquestion, PType> getConcreateTypeImplementor();
360:
361:         IQuestionAnswer<String, PType> getPTypeFinder(String fromModule);
362:
363:         IQuestionAnswer<Integer, Boolean> getProductExtendedChecker(String fromModule);
364:
365:         IQuestionAnswer<Integer, AProductType> getProductExtendedTypeFinder(String fromModule);
366:
367:         IQuestionAnswer<Class<? extends PType>, Boolean> getPTypeExtendedChecker(String fromModule);
368:
369:         IAnswer<Boolean> getVoidExistanceChecker();
370:
371:         IAnswer<Boolean> getVoidBasisChecker();
372:
373:         IAnswer<PType> getPossibleTypeFinder();
374:
375:         IAnswer<Boolean> getSimplePatternChecker();
376:
377:         IAnswer<Boolean> getAlwaysMatchingPatternChecker(String fromModule);
378:
379:         AnalysisAdaptor getPatternUnresolver();
380:
381:         IQuestion<PatternResolver.NewQuestion> getPatternResolver(String fromModule);
382:
383:         IQuestionAnswer<AllDefinitionLocator.NewQuestion, List<PDefinition>> getAllDefinitionLocator(String fromModule);
384:
385:         IAnswer<PType> getPossibleBindTypeFinder();
386:
387:         IAnswer<List<PMultipleBind>> getMultipleBindLister();
388:
389:         IAnswer<ILexNameToken> getPreNameFinder();
390:
391:         IQuestionAnswer<LinkedList<PDefinition>, Collection<? extends PDefinition>> getExportDefinitionFinder();
392:
393:         IAnswer<Collection<? extends PDefinition>> getExportDefinitionListFinder();
394:
395:         IQuestionAnswer<AModuleModules, List<PDefinition>> getImportDefinitionFinder();
396:
397:         IAnswer<PTypeList> getComposeTypeCollector();
398:
399:         TypeComparator getTypeComparator();
400:
401:         LexNameTokenAssistant getLexNameTokenAssistant();
402:
403:         IQuestionAnswer<TypeCheckInfo, List<QualifiedDefinition>> getQualificationVisitor();
404:         
405:         IAnswer<Boolean> getInstanceVariableChecker();
406:
407:         IAnswer<Boolean> getTypeDefinitionChecker();
408:
409:         IAnswer<Boolean> getValueDefinitionChecker();
410:
411:         IQuestionAnswer<FreeVarInfo, LexNameSet> getFreeVariablesChecker();
412:
413:         IQuestionAnswer<ILexLocation,Boolean> getIsOrderedVisitor();
414:
415:         IQuestionAnswer<ILexLocation,Boolean> getIsEqVisitor();
416:
417:         IQuestion<TypeCheckInfo> getMultipleEqualityChecker();
418: }