Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/Validator.java')
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/Validator.java49
1 files changed, 49 insertions, 0 deletions
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/Validator.java b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/Validator.java
new file mode 100644
index 000000000..0a6a77ef3
--- /dev/null
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/Validator.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2011 protos software gmbh (http://www.protos.de).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * CONTRIBUTORS:
+ * Henrik Rentz-Reichert (initial contribution)
+ *
+ *******************************************************************************/
+
+package org.eclipse.etrice.generator.cpp.gen;
+
+import org.eclipse.etrice.core.genmodel.etricegen.Root;
+import org.eclipse.etrice.core.genmodel.base.ILogger;
+
+import com.google.inject.Inject;
+
+/**
+ * @author Henrik Rentz-Reichert
+ *
+ */
+public class Validator {
+
+ @Inject
+ private ILogger logger;
+
+ public boolean validate(Root genModel) {
+
+// currently unused
+
+ int errorCount = 0;
+// for (RoomModel mdl : genModel.getUsedRoomModels()) {
+// TreeIterator<EObject> it = mdl.eAllContents();
+// while (it.hasNext()) {
+// EObject obj = it.next();
+//
+// }
+// }
+
+ if (errorCount>0) {
+ logger.logError("C++ generator detected "+errorCount+" error(s) - terminating", null);
+ return false;
+ }
+
+ return true;
+ }
+}

Back to the top