*/
package org.opendaylight.yangtools.yang.parser.impl;
-import static org.opendaylight.yangtools.yang.parser.util.ParserListenerUtils.*;
-
+import static org.opendaylight.yangtools.yang.parser.util.ParserListenerUtils.checkMissingBody;
+import static org.opendaylight.yangtools.yang.parser.util.ParserListenerUtils.createActualSchemaPath;
+import static org.opendaylight.yangtools.yang.parser.util.ParserListenerUtils.createListKey;
+import static org.opendaylight.yangtools.yang.parser.util.ParserListenerUtils.getConfig;
+import static org.opendaylight.yangtools.yang.parser.util.ParserListenerUtils.getIdentityrefBase;
+import static org.opendaylight.yangtools.yang.parser.util.ParserListenerUtils.parseConstraints;
+import static org.opendaylight.yangtools.yang.parser.util.ParserListenerUtils.parseDefault;
+import static org.opendaylight.yangtools.yang.parser.util.ParserListenerUtils.parseRefine;
+import static org.opendaylight.yangtools.yang.parser.util.ParserListenerUtils.parseSchemaNodeArgs;
+import static org.opendaylight.yangtools.yang.parser.util.ParserListenerUtils.parseStatus;
+import static org.opendaylight.yangtools.yang.parser.util.ParserListenerUtils.parseTypeWithBody;
+import static org.opendaylight.yangtools.yang.parser.util.ParserListenerUtils.parseUnits;
+import static org.opendaylight.yangtools.yang.parser.util.ParserListenerUtils.parseUnknownTypeWithBody;
+import static org.opendaylight.yangtools.yang.parser.util.ParserListenerUtils.parseUserOrdered;
+import static org.opendaylight.yangtools.yang.parser.util.ParserListenerUtils.parseYinValue;
+import static org.opendaylight.yangtools.yang.parser.util.ParserListenerUtils.stringFromNode;
+
+import com.google.common.base.Strings;
import java.net.URI;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Stack;
-
import org.antlr.v4.runtime.tree.ParseTree;
-import org.opendaylight.yangtools.antlrv4.code.gen.*;
+import org.opendaylight.yangtools.antlrv4.code.gen.YangParser;
import org.opendaylight.yangtools.antlrv4.code.gen.YangParser.Argument_stmtContext;
import org.opendaylight.yangtools.antlrv4.code.gen.YangParser.Base_stmtContext;
import org.opendaylight.yangtools.antlrv4.code.gen.YangParser.Contact_stmtContext;
import org.opendaylight.yangtools.antlrv4.code.gen.YangParser.Units_stmtContext;
import org.opendaylight.yangtools.antlrv4.code.gen.YangParser.When_stmtContext;
import org.opendaylight.yangtools.antlrv4.code.gen.YangParser.Yang_version_stmtContext;
+import org.opendaylight.yangtools.antlrv4.code.gen.YangParserBaseListener;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.util.BaseTypes;
import org.opendaylight.yangtools.yang.model.util.YangTypesConverter;
import org.opendaylight.yangtools.yang.parser.builder.api.AugmentationSchemaBuilder;
+import org.opendaylight.yangtools.yang.parser.builder.api.Builder;
import org.opendaylight.yangtools.yang.parser.builder.api.GroupingBuilder;
import org.opendaylight.yangtools.yang.parser.builder.api.TypeDefinitionBuilder;
import org.opendaylight.yangtools.yang.parser.builder.api.UsesNodeBuilder;
import org.slf4j.LoggerFactory;
public final class YangParserListenerImpl extends YangParserBaseListener {
- private static final Logger logger = LoggerFactory.getLogger(YangParserListenerImpl.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(YangParserListenerImpl.class);
+ private static final String AUGMENT_STR = "augment";
+ private final String sourcePath;
private ModuleBuilder moduleBuilder;
private String moduleName;
private URI namespace;
private String yangModelPrefix;
private Date revision = new Date(0L);
- public final static DateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+ private final DateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
private final Stack<Stack<QName>> actualPath = new Stack<>();
+ private int augmentOrder;
private void addNodeToPath(QName name) {
actualPath.peek().push(name);
return actualPath.peek().pop();
}
+ public YangParserListenerImpl(String sourcePath) {
+ this.sourcePath = sourcePath;
+ }
+
@Override
public void enterModule_stmt(YangParser.Module_stmtContext ctx) {
moduleName = stringFromNode(ctx);
- logger.debug("entering module " + moduleName);
+ LOGGER.trace("entering module " + moduleName);
enterLog("module", moduleName, 0);
actualPath.push(new Stack<QName>());
- moduleBuilder = new ModuleBuilder(moduleName);
+ moduleBuilder = new ModuleBuilder(moduleName, sourcePath);
String description = null;
String reference = null;
actualPath.pop();
}
+ @Override public void enterSubmodule_stmt(YangParser.Submodule_stmtContext ctx) {
+ moduleName = stringFromNode(ctx);
+ LOGGER.trace("entering submodule " + moduleName);
+ enterLog("submodule", moduleName, 0);
+ actualPath.push(new Stack<QName>());
+
+ moduleBuilder = new ModuleBuilder(moduleName, true, sourcePath);
+
+ String description = null;
+ String reference = null;
+ for (int i = 0; i < ctx.getChildCount(); i++) {
+ ParseTree child = ctx.getChild(i);
+ if (child instanceof Description_stmtContext) {
+ description = stringFromNode(child);
+ } else if (child instanceof Reference_stmtContext) {
+ reference = stringFromNode(child);
+ } else {
+ if (description != null && reference != null) {
+ break;
+ }
+ }
+ }
+ moduleBuilder.setDescription(description);
+ moduleBuilder.setReference(reference);
+ }
+
+ @Override public void exitSubmodule_stmt(YangParser.Submodule_stmtContext ctx) {
+ exitLog("submodule", "");
+ actualPath.pop();
+ }
+
+ @Override public void enterBelongs_to_stmt(YangParser.Belongs_to_stmtContext ctx) {
+ moduleBuilder.setBelongsTo(stringFromNode(ctx));
+ }
+
@Override
public void enterModule_header_stmts(Module_header_stmtsContext ctx) {
enterLog("module_header", "", ctx.getStart().getLine());
private void updateRevisionForRevisionStatement(final ParseTree treeNode) {
final String revisionDateStr = stringFromNode(treeNode);
try {
- final Date revision = simpleDateFormat.parse(revisionDateStr);
- if ((revision != null) && (this.revision.compareTo(revision) < 0)) {
- this.revision = revision;
+ final Date revisionDate = SIMPLE_DATE_FORMAT.parse(revisionDateStr);
+ if ((revisionDate != null) && (this.revision.compareTo(revisionDate) < 0)) {
+ this.revision = revisionDate;
moduleBuilder.setRevision(this.revision);
setLog("revision", this.revision.toString());
for (int i = 0; i < treeNode.getChildCount(); ++i) {
}
} catch (ParseException e) {
final String message = "Failed to parse revision string: " + revisionDateStr;
- logger.warn(message);
+ LOGGER.warn(message);
}
}
if (treeNode instanceof Revision_date_stmtContext) {
String importRevisionStr = stringFromNode(treeNode);
try {
- importRevision = simpleDateFormat.parse(importRevisionStr);
+ importRevision = SIMPLE_DATE_FORMAT.parse(importRevisionStr);
} catch (ParseException e) {
- logger.warn("Failed to parse import revision-date at line " + line + ": " + importRevisionStr);
+ LOGGER.warn("Failed to parse import revision-date at line " + line + ": " + importRevisionStr);
}
}
}
public void enterAugment_stmt(YangParser.Augment_stmtContext ctx) {
final int line = ctx.getStart().getLine();
final String augmentPath = stringFromNode(ctx);
- enterLog("augment", augmentPath, line);
+ enterLog(AUGMENT_STR, augmentPath, line);
actualPath.push(new Stack<QName>());
- AugmentationSchemaBuilder builder = moduleBuilder.addAugment(line, augmentPath);
+ AugmentationSchemaBuilder builder = moduleBuilder.addAugment(line, augmentPath, augmentOrder++);
for (int i = 0; i < ctx.getChildCount(); i++) {
ParseTree child = ctx.getChild(i);
@Override
public void exitAugment_stmt(YangParser.Augment_stmtContext ctx) {
moduleBuilder.exitNode();
- exitLog("augment", "");
+ exitLog(AUGMENT_STR, "");
actualPath.pop();
}
addNodeToPath(qname);
SchemaPath path = createActualSchemaPath(actualPath.peek());
- ExtensionBuilder builder = moduleBuilder.addExtension(qname, line);
- builder.setPath(path);
+ ExtensionBuilder builder = moduleBuilder.addExtension(qname, line, path);
parseSchemaNodeArgs(ctx, builder);
String argument = null;
addNodeToPath(typedefQName);
SchemaPath path = createActualSchemaPath(actualPath.peek());
- TypeDefinitionBuilder builder = moduleBuilder.addTypedef(line, typedefQName);
- builder.setPath(path);
+ TypeDefinitionBuilder builder = moduleBuilder.addTypedef(line, typedefQName, path);
parseSchemaNodeArgs(ctx, builder);
builder.setUnits(parseUnits(ctx));
builder.setDefaultValue(parseDefault(ctx));
// check for types which must have body
checkMissingBody(typeName, moduleName, line);
// if there are no constraints, just grab default base yang type
- QName qname = BaseTypes.constructQName(typeName);
- addNodeToPath(qname);
- SchemaPath path = createActualSchemaPath(actualPath.peek());
- type = YangTypesConverter.javaTypeForBaseYangType(path, typeName);
+ type = YangTypesConverter.javaTypeForBaseYangType(typeName);
+ addNodeToPath(type.getQName());
moduleBuilder.setType(type);
} else {
- if ("union".equals(typeName)) {
- QName qname = BaseTypes.constructQName("union");
- addNodeToPath(qname);
- SchemaPath path = createActualSchemaPath(actualPath.peek());
- UnionTypeBuilder unionBuilder = moduleBuilder.addUnionType(line, namespace, revision);
- moduleBuilder.enterNode(unionBuilder);
- unionBuilder.setPath(path);
- } else if ("identityref".equals(typeName)) {
- QName qname = BaseTypes.constructQName("identityref");
- addNodeToPath(qname);
- SchemaPath path = createActualSchemaPath(actualPath.peek());
- moduleBuilder.addIdentityrefType(line, path, getIdentityrefBase(typeBody));
- } else {
- type = parseTypeWithBody(typeName, typeBody, actualPath.peek(), namespace, revision, yangModelPrefix, moduleBuilder.getActualNode());
- moduleBuilder.setType(type);
- addNodeToPath(type.getQName());
+ QName qname;
+ switch (typeName) {
+ case "union":
+ qname = BaseTypes.constructQName("union");
+ addNodeToPath(qname);
+ UnionTypeBuilder unionBuilder = moduleBuilder.addUnionType(line, namespace, revision);
+ Builder parent = moduleBuilder.getActualNode();
+ unionBuilder.setParent(parent);
+ moduleBuilder.enterNode(unionBuilder);
+ break;
+ case "identityref":
+ qname = BaseTypes.constructQName("identityref");
+ addNodeToPath(qname);
+ SchemaPath path = createActualSchemaPath(actualPath.peek());
+ moduleBuilder.addIdentityrefType(line, path, getIdentityrefBase(typeBody));
+ break;
+ default:
+ type = parseTypeWithBody(typeName, typeBody, actualPath.peek(), namespace, revision,
+ yangModelPrefix, moduleBuilder.getActualNode());
+ moduleBuilder.setType(type);
+ addNodeToPath(type.getQName());
}
}
} else {
- type = parseUnknownTypeWithBody(typeQName, typeBody, actualPath.peek(), namespace, revision, yangModelPrefix,
- moduleBuilder.getActualNode());
+ type = parseUnknownTypeWithBody(typeQName, typeBody, actualPath.peek(), namespace, revision,
+ yangModelPrefix, moduleBuilder.getActualNode());
// add parent node of this type statement to dirty nodes
moduleBuilder.markActualNodeDirty();
moduleBuilder.setType(type);
addNodeToPath(groupQName);
SchemaPath path = createActualSchemaPath(actualPath.peek());
- GroupingBuilder builder = moduleBuilder.addGrouping(ctx.getStart().getLine(), groupQName);
- builder.setPath(path);
+ GroupingBuilder builder = moduleBuilder.addGrouping(ctx.getStart().getLine(), groupQName, path);
parseSchemaNodeArgs(ctx, builder);
moduleBuilder.enterNode(builder);
ContainerSchemaNodeBuilder builder = moduleBuilder.addContainerNode(line, containerQName, path);
parseSchemaNodeArgs(ctx, builder);
parseConstraints(ctx, builder.getConstraints());
- builder.setConfiguration(getConfig(ctx, moduleBuilder.getActualParent(), moduleName, line));
+ builder.setConfiguration(getConfig(ctx, builder, moduleName, line));
for (int i = 0; i < ctx.getChildCount(); ++i) {
final ParseTree childNode = ctx.getChild(i);
LeafSchemaNodeBuilder builder = moduleBuilder.addLeafNode(line, leafQName, path);
parseSchemaNodeArgs(ctx, builder);
parseConstraints(ctx, builder.getConstraints());
- builder.setConfiguration(getConfig(ctx, moduleBuilder.getActualParent(), moduleName, line));
+ builder.setConfiguration(getConfig(ctx, builder, moduleName, line));
String defaultStr = null;
String unitsStr = null;
actualPath.push(new Stack<QName>());
final int line = ctx.getStart().getLine();
final String augmentPath = stringFromNode(ctx);
- enterLog("augment", augmentPath, line);
+ enterLog(AUGMENT_STR, augmentPath, line);
- AugmentationSchemaBuilder builder = moduleBuilder.addAugment(line, augmentPath);
+ AugmentationSchemaBuilder builder = moduleBuilder.addAugment(line, augmentPath, augmentOrder++);
for (int i = 0; i < ctx.getChildCount(); i++) {
ParseTree child = ctx.getChild(i);
@Override
public void exitUses_augment_stmt(YangParser.Uses_augment_stmtContext ctx) {
moduleBuilder.exitNode();
- exitLog("augment", "");
+ exitLog(AUGMENT_STR, "");
actualPath.pop();
}
parseSchemaNodeArgs(ctx, builder);
parseConstraints(ctx, builder.getConstraints());
- builder.setConfiguration(getConfig(ctx, moduleBuilder.getActualParent(), moduleName, ctx.getStart().getLine()));
+ builder.setConfiguration(getConfig(ctx, builder, moduleName, ctx.getStart().getLine()));
for (int i = 0; i < ctx.getChildCount(); ++i) {
final ParseTree childNode = ctx.getChild(i);
parseSchemaNodeArgs(ctx, builder);
parseConstraints(ctx, builder.getConstraints());
- builder.setConfiguration(getConfig(ctx, moduleBuilder.getActualParent(), moduleName, line));
+ builder.setConfiguration(getConfig(ctx, builder, moduleName, line));
- String keyDefinition = "";
for (int i = 0; i < ctx.getChildCount(); ++i) {
ParseTree childNode = ctx.getChild(i);
if (childNode instanceof Ordered_by_stmtContext) {
final boolean userOrdered = parseUserOrdered(orderedBy);
builder.setUserOrdered(userOrdered);
} else if (childNode instanceof Key_stmtContext) {
- keyDefinition = stringFromNode(childNode);
- List<QName> key = createListKey(keyDefinition, namespace, revision, yangModelPrefix);
- builder.setKeyDefinition(key);
+ List<String> key = createListKey((Key_stmtContext) childNode);
+ builder.setKeys(key);
}
}
}
parseSchemaNodeArgs(ctx, builder);
parseConstraints(ctx, builder.getConstraints());
- builder.setConfiguration(getConfig(ctx, moduleBuilder.getActualParent(), moduleName, line));
+ builder.setConfiguration(getConfig(ctx, builder, moduleName, line));
}
@Override
addNodeToPath(choiceQName);
SchemaPath path = createActualSchemaPath(actualPath.peek());
- ChoiceBuilder builder = moduleBuilder.addChoice(line, choiceQName);
- builder.setPath(path);
+ ChoiceBuilder builder = moduleBuilder.addChoice(line, choiceQName, path);
moduleBuilder.enterNode(builder);
parseSchemaNodeArgs(ctx, builder);
parseConstraints(ctx, builder.getConstraints());
- builder.setConfiguration(getConfig(ctx, moduleBuilder.getActualParent(), moduleName, line));
+ builder.setConfiguration(getConfig(ctx, builder, moduleName, line));
// set 'default' case
for (int i = 0; i < ctx.getChildCount(); i++) {
addNodeToPath(caseQName);
SchemaPath path = createActualSchemaPath(actualPath.peek());
- ChoiceCaseBuilder builder = moduleBuilder.addCase(line, caseQName);
- builder.setPath(path);
+ ChoiceCaseBuilder builder = moduleBuilder.addCase(line, caseQName, path);
moduleBuilder.enterNode(builder);
parseSchemaNodeArgs(ctx, builder);
addNodeToPath(notificationQName);
SchemaPath path = createActualSchemaPath(actualPath.peek());
- NotificationBuilder builder = moduleBuilder.addNotification(line, notificationQName);
- builder.setPath(path);
+ NotificationBuilder builder = moduleBuilder.addNotification(line, notificationQName, path);
moduleBuilder.enterNode(builder);
parseSchemaNodeArgs(ctx, builder);
// Unknown nodes
@Override
public void enterIdentifier_stmt(YangParser.Identifier_stmtContext ctx) {
- final int line = ctx.getStart().getLine();
- final String nodeParameter = stringFromNode(ctx);
- enterLog("unknown-node", nodeParameter, line);
+ handleUnknownNode(ctx.getStart().getLine(), ctx);
+ }
- QName nodeType = null;
+ @Override
+ public void exitIdentifier_stmt(YangParser.Identifier_stmtContext ctx) {
+ moduleBuilder.exitNode();
+ exitLog("unknown-node", removeNodeFromPath());
+ }
- final String nodeTypeStr = ctx.getChild(0).getText();
- final String[] splittedElement = nodeTypeStr.split(":");
- if (splittedElement.length == 1) {
- nodeType = new QName(null, null, yangModelPrefix, splittedElement[0]);
- } else {
- nodeType = new QName(null, null, splittedElement[0], splittedElement[1]);
- }
+ @Override public void enterUnknown_statement(YangParser.Unknown_statementContext ctx) {
+ handleUnknownNode(ctx.getStart().getLine(), ctx);
+ }
- QName qname;
- if (nodeParameter != null) {
- String[] splittedName = nodeParameter.split(":");
- if (splittedName.length == 2) {
- qname = new QName(null, null, splittedName[0], splittedName[1]);
- } else {
- qname = new QName(namespace, revision, yangModelPrefix, splittedName[0]);
- }
- } else {
- qname = new QName(namespace, revision, yangModelPrefix, nodeParameter);
- }
+ @Override public void exitUnknown_statement(YangParser.Unknown_statementContext ctx) {
+ moduleBuilder.exitNode();
+ exitLog("unknown-node", removeNodeFromPath());
+ }
- UnknownSchemaNodeBuilder builder = moduleBuilder.addUnknownSchemaNode(line, qname);
- builder.setNodeType(nodeType);
- builder.setNodeParameter(nodeParameter);
- addNodeToPath(new QName(namespace, revision, yangModelPrefix, nodeParameter));
+ @Override public void enterUnknown_statement2(YangParser.Unknown_statement2Context ctx) {
+ handleUnknownNode(ctx.getStart().getLine(), ctx);
+ }
- SchemaPath path = createActualSchemaPath(actualPath.peek());
- builder.setPath(path);
+ @Override public void exitUnknown_statement2(YangParser.Unknown_statement2Context ctx) {
+ moduleBuilder.exitNode();
+ exitLog("unknown-node", removeNodeFromPath());
+ }
- parseSchemaNodeArgs(ctx, builder);
- moduleBuilder.enterNode(builder);
+ @Override public void enterUnknown_statement3(YangParser.Unknown_statement3Context ctx) {
+ handleUnknownNode(ctx.getStart().getLine(), ctx);
}
- @Override
- public void exitIdentifier_stmt(YangParser.Identifier_stmtContext ctx) {
+ @Override public void exitUnknown_statement3(YangParser.Unknown_statement3Context ctx) {
moduleBuilder.exitNode();
exitLog("unknown-node", removeNodeFromPath());
}
enterLog("rpc", rpcName, line);
QName rpcQName = new QName(namespace, revision, yangModelPrefix, rpcName);
- RpcDefinitionBuilder rpcBuilder = moduleBuilder.addRpc(line, rpcQName);
- moduleBuilder.enterNode(rpcBuilder);
addNodeToPath(rpcQName);
-
SchemaPath path = createActualSchemaPath(actualPath.peek());
- rpcBuilder.setPath(path);
+
+ RpcDefinitionBuilder rpcBuilder = moduleBuilder.addRpc(line, rpcQName, path);
+ moduleBuilder.enterNode(rpcBuilder);
+
parseSchemaNodeArgs(ctx, rpcBuilder);
}
ContainerSchemaNodeBuilder builder = moduleBuilder.addRpcInput(line, rpcQName, path);
moduleBuilder.enterNode(builder);
+ builder.setConfiguration(true);
parseSchemaNodeArgs(ctx, builder);
parseConstraints(ctx, builder.getConstraints());
ContainerSchemaNodeBuilder builder = moduleBuilder.addRpcOutput(path, rpcQName, line);
moduleBuilder.enterNode(builder);
+ builder.setConfiguration(true);
parseSchemaNodeArgs(ctx, builder);
parseConstraints(ctx, builder.getConstraints());
enterLog("feature", featureName, line);
QName featureQName = new QName(namespace, revision, yangModelPrefix, featureName);
- FeatureBuilder featureBuilder = moduleBuilder.addFeature(line, featureQName);
- moduleBuilder.enterNode(featureBuilder);
addNodeToPath(featureQName);
-
SchemaPath path = createActualSchemaPath(actualPath.peek());
- featureBuilder.setPath(path);
+
+ FeatureBuilder featureBuilder = moduleBuilder.addFeature(line, featureQName, path);
+ moduleBuilder.enterNode(featureBuilder);
+
parseSchemaNodeArgs(ctx, featureBuilder);
}
enterLog("identity", identityName, line);
final QName identityQName = new QName(namespace, revision, yangModelPrefix, identityName);
- IdentitySchemaNodeBuilder builder = moduleBuilder.addIdentity(identityQName, line);
- moduleBuilder.enterNode(builder);
addNodeToPath(identityQName);
-
SchemaPath path = createActualSchemaPath(actualPath.peek());
- builder.setPath(path);
+
+ IdentitySchemaNodeBuilder builder = moduleBuilder.addIdentity(identityQName, line, path);
+ moduleBuilder.enterNode(builder);
+
parseSchemaNodeArgs(ctx, builder);
}
private void enterLog(String p1, String p2, int line) {
- logger.trace("entering {} {} ({})", p1, p2, line);
+ LOGGER.trace("entering {} {} ({})", p1, p2, line);
}
private void exitLog(String p1, String p2) {
- logger.trace("exiting {} {}", p1, p2);
+ LOGGER.trace("exiting {} {}", p1, p2);
}
private void exitLog(String p1, QName p2) {
- logger.trace("exiting {} {}", p1, p2.getLocalName());
+ LOGGER.trace("exiting {} {}", p1, p2.getLocalName());
}
private void setLog(String p1, String p2) {
- logger.trace("setting {} {}", p1, p2);
+ LOGGER.trace("setting {} {}", p1, p2);
+ }
+
+ private void handleUnknownNode(final int line, final ParseTree ctx) {
+ final String nodeParameter = stringFromNode(ctx);
+ enterLog("unknown-node", nodeParameter, line);
+
+ QName nodeType;
+ final String nodeTypeStr = ctx.getChild(0).getText();
+ final String[] splittedElement = nodeTypeStr.split(":");
+ if (splittedElement.length == 1) {
+ nodeType = new QName(namespace, revision, yangModelPrefix, splittedElement[0]);
+ } else {
+ nodeType = new QName(namespace, revision, splittedElement[0], splittedElement[1]);
+ }
+
+ QName qname = null;
+ try {
+ if (!Strings.isNullOrEmpty(nodeParameter)) {
+ String[] splittedName = nodeParameter.split(":");
+ if (splittedName.length == 2) {
+ qname = new QName(null, null, splittedName[0], splittedName[1]);
+ } else {
+ qname = new QName(namespace, revision, yangModelPrefix, splittedName[0]);
+ }
+ } else {
+ qname = nodeType;
+ }
+ } catch (IllegalArgumentException e) {
+ qname = nodeType;
+
+ }
+ addNodeToPath(qname);
+ SchemaPath path = createActualSchemaPath(actualPath.peek());
+
+ UnknownSchemaNodeBuilder builder = moduleBuilder.addUnknownSchemaNode(line, qname, path);
+ builder.setNodeType(nodeType);
+ builder.setNodeParameter(nodeParameter);
+
+
+ parseSchemaNodeArgs(ctx, builder);
+ moduleBuilder.enterNode(builder);
}
}