[ONOS-4350] Inter file linking implementation and inter-jar linking framework
Change-Id: I71a26ba3e0b9d17261e78a9313fe7f047195932e
diff --git a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ImportListener.java b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ImportListener.java
index 03938b1..061c4dd 100644
--- a/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ImportListener.java
+++ b/utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ImportListener.java
@@ -73,7 +73,7 @@
* (import), perform validations and update the data model tree.
*
* @param listener Listener's object
- * @param ctx context object of the grammar rule
+ * @param ctx context object of the grammar rule
*/
public static void processImportEntry(TreeWalkListener listener, GeneratedYangParser.ImportStatementContext ctx) {
@@ -85,6 +85,12 @@
YangImport importNode = new YangImport();
importNode.setModuleName(identifier);
+ // Set the line number and character position in line for the belongs to.
+ int errorLine = ctx.getStart().getLine();
+ int errorPosition = ctx.getStart().getCharPositionInLine();
+ importNode.setLineNumber(errorLine);
+ importNode.setCharPosition(errorPosition);
+
// Push import node to the stack.
listener.getParsedDataStack().push(importNode);
}
@@ -94,7 +100,7 @@
* validations and update the data model tree.
*
* @param listener Listener's object
- * @param ctx context object of the grammar rule
+ * @param ctx context object of the grammar rule
*/
public static void processImportExit(TreeWalkListener listener, GeneratedYangParser.ImportStatementContext ctx) {
@@ -107,7 +113,7 @@
// Check for stack to be non empty.
checkStackIsNotEmpty(listener, MISSING_HOLDER, IMPORT_DATA, ctx.identifier().getText(),
- EXIT);
+ EXIT);
Parsable tmpNode = listener.getParsedDataStack().peek();
switch (tmpNode.getYangConstructType()) {
@@ -128,7 +134,7 @@
}
} else {
throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, IMPORT_DATA,
- ctx.identifier().getText(), EXIT));
+ ctx.identifier().getText(), EXIT));
}
}
}