YANG construct collision detection framework added
Change-Id: I1458f9e3192641f3f90c444798c31a64536ffa5d
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/VersionListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/VersionListener.java
index 021ae0d..9b9a388 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/VersionListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/VersionListener.java
@@ -23,7 +23,7 @@
import org.onosproject.yangutils.parser.exceptions.ParserException;
import org.onosproject.yangutils.parser.impl.TreeWalkListener;
-import static org.onosproject.yangutils.parser.ParsableDataType.VERSION_DATA;
+import static org.onosproject.yangutils.utils.YangConstructType.VERSION_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
@@ -78,8 +78,8 @@
* It is called when parser receives an input matching the grammar rule
* (version), perform validations and update the data model tree.
*
- * @param listener Listener's object.
- * @param ctx context object of the grammar rule.
+ * @param listener Listener's object
+ * @param ctx context object of the grammar rule
*/
public static void processVersionEntry(TreeWalkListener listener,
GeneratedYangParser.YangVersionStatementContext ctx) {
@@ -89,7 +89,7 @@
Integer version = Integer.valueOf(ctx.INTEGER().getText());
if (!isVersionValid(version)) {
- ParserException parserException = new ParserException("Input version not supported");
+ ParserException parserException = new ParserException("YANG file error: Input version not supported");
parserException.setLine(ctx.INTEGER().getSymbol().getLine());
parserException.setCharPosition(ctx.INTEGER().getSymbol().getCharPositionInLine());
throw parserException;
@@ -97,7 +97,7 @@
// Obtain the node of the stack.
Parsable tmpNode = listener.getParsedDataStack().peek();
- switch (tmpNode.getParsableDataType()) {
+ switch (tmpNode.getYangConstructType()) {
case MODULE_DATA: {
YangModule module = (YangModule) tmpNode;
module.setVersion((byte) 1);