private static void LoadMaps() { foreach (var fileName in Directory.GetFiles(UtilitySettings.Default.MapLocation, "*.xml")) { using (var mapFile = File.Open(fileName, FileMode.Open)) { var mapDocument = XDocument.Load(mapFile); switch (MapReader.ReadHandlerType(mapDocument)) { case HandlerType.ModuleRegistration: ModuleRegistrarFactory.LoadMap(MapReader.ReadMap(mapDocument)); break; case HandlerType.TypeResolution: TypeResolverFactory.LoadMap(MapReader.ReadMap(mapDocument)); break; case HandlerType.LibraryReader: LibraryReaderFactory.LoadMap(MapReader.ReadMap(mapDocument)); break; case HandlerType.Verification: NodeVerifierFactory.LoadMap(MapReader.ReadMap(mapDocument)); break; case HandlerType.Translation: ArtifactTranslatorFactory.LoadMap(MapReader.ReadMap(mapDocument)); break; case HandlerType.NodeTranslation: NodeTranslatorFactory.LoadMap(MapReader.ReadMap(mapDocument)); break; case HandlerType.ModelTranslation: ModelTranslatorFactory.LoadMap(MapReader.ReadMap(mapDocument)); break; case HandlerType.Writing: ArtifactWriterFactory.LoadMap(MapReader.ReadMap(mapDocument)); break; } } } }
public static void Verify(VerificationContext context, ASTNode node) { try { var verifier = NodeVerifierFactory.GetHandler(node.NodeType); // Traversal occurs within the verify, because traversal may happen differently depending on the operation. verifier.Verify(context, node); } catch (Exception e) { context.ReportMessage(e, node); } }