Vidyashree Rama
Committed by Gerrit Code Review

[ONOS-4762][ONOS-4601]Grammar for meta data + Union defect fix

Change-Id: I8f78127e5b292cca6a79b32d496c2602c9105acd
Showing 21 changed files with 561 additions and 575 deletions
......@@ -27,904 +27,791 @@ import org.antlr.v4.runtime.tree.ParseTreeListener;
public interface GeneratedYangListener extends ParseTreeListener {
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* yangfile.
* Enters a parse tree produced by GeneratedYangParser for grammar rule yangfile.
*
* @param currentContext current context in the parsed tree
*/
void enterYangfile(GeneratedYangParser.YangfileContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* yangfile.
* Exits a parse tree produced by GeneratedYangParser for grammar rule yangfile.
*
* @param currentContext current context in the parsed tree
*/
void exitYangfile(GeneratedYangParser.YangfileContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* moduleStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule moduleStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterModuleStatement(GeneratedYangParser.ModuleStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* moduleStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule moduleStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitModuleStatement(GeneratedYangParser.ModuleStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* moduleBody.
* Enters a parse tree produced by GeneratedYangParser for grammar rule moduleBody.
*
* @param currentContext current context in the parsed tree
*/
void enterModuleBody(GeneratedYangParser.ModuleBodyContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* moduleBody.
* Exits a parse tree produced by GeneratedYangParser for grammar rule moduleBody.
*
* @param currentContext current context in the parsed tree
*/
void exitModuleBody(GeneratedYangParser.ModuleBodyContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* moduleHeaderStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule moduleHeaderStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterModuleHeaderStatement(GeneratedYangParser.ModuleHeaderStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* moduleHeaderStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule moduleHeaderStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitModuleHeaderStatement(GeneratedYangParser.ModuleHeaderStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* linkageStatements.
* Enters a parse tree produced by GeneratedYangParser for grammar rule linkageStatements.
*
* @param currentContext current context in the parsed tree
*/
void enterLinkageStatements(GeneratedYangParser.LinkageStatementsContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* linkageStatements.
* Exits a parse tree produced by GeneratedYangParser for grammar rule linkageStatements.
*
* @param currentContext current context in the parsed tree
*/
void exitLinkageStatements(GeneratedYangParser.LinkageStatementsContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* metaStatements.
* Enters a parse tree produced by GeneratedYangParser for grammar rule metaStatements.
*
* @param currentContext current context in the parsed tree
*/
void enterMetaStatements(GeneratedYangParser.MetaStatementsContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* metaStatements.
* Exits a parse tree produced by GeneratedYangParser for grammar rule metaStatements.
*
* @param currentContext current context in the parsed tree
*/
void exitMetaStatements(GeneratedYangParser.MetaStatementsContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* revisionStatements.
* Enters a parse tree produced by GeneratedYangParser for grammar rule revisionStatements.
*
* @param currentContext current context in the parsed tree
*/
void enterRevisionStatements(GeneratedYangParser.RevisionStatementsContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* revisionStatements.
* Exits a parse tree produced by GeneratedYangParser for grammar rule revisionStatements.
*
* @param currentContext current context in the parsed tree
*/
void exitRevisionStatements(GeneratedYangParser.RevisionStatementsContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* bodyStatements.
* Enters a parse tree produced by GeneratedYangParser for grammar rule bodyStatements.
*
* @param currentContext current context in the parsed tree
*/
void enterBodyStatements(GeneratedYangParser.BodyStatementsContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* bodyStatements.
* Exits a parse tree produced by GeneratedYangParser for grammar rule bodyStatements.
*
* @param currentContext current context in the parsed tree
*/
void exitBodyStatements(GeneratedYangParser.BodyStatementsContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* yangVersionStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule yangVersionStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterYangVersionStatement(GeneratedYangParser.YangVersionStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* yangVersionStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule yangVersionStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitYangVersionStatement(GeneratedYangParser.YangVersionStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* namespaceStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule namespaceStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterNamespaceStatement(GeneratedYangParser.NamespaceStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* namespaceStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule namespaceStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitNamespaceStatement(GeneratedYangParser.NamespaceStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* prefixStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule prefixStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterPrefixStatement(GeneratedYangParser.PrefixStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* prefixStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule prefixStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitPrefixStatement(GeneratedYangParser.PrefixStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* importStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule importStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterImportStatement(GeneratedYangParser.ImportStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* importStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule importStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitImportStatement(GeneratedYangParser.ImportStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* importStatementBody.
* Enters a parse tree produced by GeneratedYangParser for grammar rule importStatementBody.
*
* @param currentContext current context in the parsed tree
*/
void enterImportStatementBody(GeneratedYangParser.ImportStatementBodyContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* importStatementBody.
* Exits a parse tree produced by GeneratedYangParser for grammar rule importStatementBody.
*
* @param currentContext current context in the parsed tree
*/
void exitImportStatementBody(GeneratedYangParser.ImportStatementBodyContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* revisionDateStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule revisionDateStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterRevisionDateStatement(GeneratedYangParser.RevisionDateStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* revisionDateStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule revisionDateStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitRevisionDateStatement(GeneratedYangParser.RevisionDateStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* includeStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule includeStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterIncludeStatement(GeneratedYangParser.IncludeStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* includeStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule includeStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitIncludeStatement(GeneratedYangParser.IncludeStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* organizationStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule organizationStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterOrganizationStatement(GeneratedYangParser.OrganizationStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* organizationStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule organizationStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitOrganizationStatement(GeneratedYangParser.OrganizationStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* contactStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule contactStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterContactStatement(GeneratedYangParser.ContactStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* contactStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule contactStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitContactStatement(GeneratedYangParser.ContactStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* descriptionStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule descriptionStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterDescriptionStatement(GeneratedYangParser.DescriptionStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* descriptionStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule descriptionStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitDescriptionStatement(GeneratedYangParser.DescriptionStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* referenceStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule referenceStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterReferenceStatement(GeneratedYangParser.ReferenceStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* referenceStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule referenceStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitReferenceStatement(GeneratedYangParser.ReferenceStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* revisionStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule revisionStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterRevisionStatement(GeneratedYangParser.RevisionStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* revisionStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule revisionStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitRevisionStatement(GeneratedYangParser.RevisionStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* revisionStatementBody.
* Enters a parse tree produced by GeneratedYangParser for grammar rule revisionStatementBody.
*
* @param currentContext current context in the parsed tree
*/
void enterRevisionStatementBody(GeneratedYangParser.RevisionStatementBodyContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* revisionStatementBody.
* Exits a parse tree produced by GeneratedYangParser for grammar rule revisionStatementBody.
*
* @param currentContext current context in the parsed tree
*/
void exitRevisionStatementBody(GeneratedYangParser.RevisionStatementBodyContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* subModuleStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule subModuleStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterSubModuleStatement(GeneratedYangParser.SubModuleStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* subModuleStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule subModuleStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitSubModuleStatement(GeneratedYangParser.SubModuleStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* submoduleBody.
* Enters a parse tree produced by GeneratedYangParser for grammar rule submoduleBody.
*
* @param currentContext current context in the parsed tree
*/
void enterSubmoduleBody(GeneratedYangParser.SubmoduleBodyContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* submoduleBody.
* Exits a parse tree produced by GeneratedYangParser for grammar rule submoduleBody.
*
* @param currentContext current context in the parsed tree
*/
void exitSubmoduleBody(GeneratedYangParser.SubmoduleBodyContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* submoduleHeaderStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule submoduleHeaderStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterSubmoduleHeaderStatement(GeneratedYangParser.SubmoduleHeaderStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* submoduleHeaderStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule submoduleHeaderStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitSubmoduleHeaderStatement(GeneratedYangParser.SubmoduleHeaderStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* belongstoStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule belongstoStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterBelongstoStatement(GeneratedYangParser.BelongstoStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* belongstoStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule belongstoStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitBelongstoStatement(GeneratedYangParser.BelongstoStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* belongstoStatementBody.
* Enters a parse tree produced by GeneratedYangParser for grammar rule belongstoStatementBody.
*
* @param currentContext current context in the parsed tree
*/
void enterBelongstoStatementBody(GeneratedYangParser.BelongstoStatementBodyContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* belongstoStatementBody.
* Exits a parse tree produced by GeneratedYangParser for grammar rule belongstoStatementBody.
*
* @param currentContext current context in the parsed tree
*/
void exitBelongstoStatementBody(GeneratedYangParser.BelongstoStatementBodyContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* extensionStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule extensionStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterExtensionStatement(GeneratedYangParser.ExtensionStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* extensionStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule extensionStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitExtensionStatement(GeneratedYangParser.ExtensionStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* extensionBody.
* Enters a parse tree produced by GeneratedYangParser for grammar rule extensionBody.
*
* @param currentContext current context in the parsed tree
*/
void enterExtensionBody(GeneratedYangParser.ExtensionBodyContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* extensionBody.
* Exits a parse tree produced by GeneratedYangParser for grammar rule extensionBody.
*
* @param currentContext current context in the parsed tree
*/
void exitExtensionBody(GeneratedYangParser.ExtensionBodyContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* argumentStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule argumentStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterArgumentStatement(GeneratedYangParser.ArgumentStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* argumentStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule argumentStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitArgumentStatement(GeneratedYangParser.ArgumentStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* argumentBody.
* Enters a parse tree produced by GeneratedYangParser for grammar rule argumentBody.
*
* @param currentContext current context in the parsed tree
*/
void enterArgumentBody(GeneratedYangParser.ArgumentBodyContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* argumentBody.
* Exits a parse tree produced by GeneratedYangParser for grammar rule argumentBody.
*
* @param currentContext current context in the parsed tree
*/
void exitArgumentBody(GeneratedYangParser.ArgumentBodyContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* yinElementStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule yinElementStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterYinElementStatement(GeneratedYangParser.YinElementStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* yinElementStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule yinElementStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitYinElementStatement(GeneratedYangParser.YinElementStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* identityStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule identityStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterIdentityStatement(GeneratedYangParser.IdentityStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* identityStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule identityStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitIdentityStatement(GeneratedYangParser.IdentityStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* identityBody.
* Enters a parse tree produced by GeneratedYangParser for grammar rule identityBody.
*
* @param currentContext current context in the parsed tree
*/
void enterIdentityBody(GeneratedYangParser.IdentityBodyContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* identityBody.
* Exits a parse tree produced by GeneratedYangParser for grammar rule identityBody.
*
* @param currentContext current context in the parsed tree
*/
void exitIdentityBody(GeneratedYangParser.IdentityBodyContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* baseStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule baseStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterBaseStatement(GeneratedYangParser.BaseStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* baseStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule baseStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitBaseStatement(GeneratedYangParser.BaseStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* featureStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule featureStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterFeatureStatement(GeneratedYangParser.FeatureStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* featureStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule featureStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitFeatureStatement(GeneratedYangParser.FeatureStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* featureBody.
* Enters a parse tree produced by GeneratedYangParser for grammar rule featureBody.
*
* @param currentContext current context in the parsed tree
*/
void enterFeatureBody(GeneratedYangParser.FeatureBodyContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* featureBody.
* Exits a parse tree produced by GeneratedYangParser for grammar rule featureBody.
*
* @param currentContext current context in the parsed tree
*/
void exitFeatureBody(GeneratedYangParser.FeatureBodyContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* dataDefStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule dataDefStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterDataDefStatement(GeneratedYangParser.DataDefStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* dataDefStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule dataDefStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitDataDefStatement(GeneratedYangParser.DataDefStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* ifFeatureStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule ifFeatureStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterIfFeatureStatement(GeneratedYangParser.IfFeatureStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* ifFeatureStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule ifFeatureStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitIfFeatureStatement(GeneratedYangParser.IfFeatureStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* unitsStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule unitsStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterUnitsStatement(GeneratedYangParser.UnitsStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* unitsStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule unitsStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitUnitsStatement(GeneratedYangParser.UnitsStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* typedefStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule typedefStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterTypedefStatement(GeneratedYangParser.TypedefStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* typedefStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule typedefStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitTypedefStatement(GeneratedYangParser.TypedefStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* typeStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule typeStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterTypeStatement(GeneratedYangParser.TypeStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* typeStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule typeStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitTypeStatement(GeneratedYangParser.TypeStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* typeBodyStatements.
* Enters a parse tree produced by GeneratedYangParser for grammar rule typeBodyStatements.
*
* @param currentContext current context in the parsed tree
*/
void enterTypeBodyStatements(GeneratedYangParser.TypeBodyStatementsContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* typeBodyStatements.
* Exits a parse tree produced by GeneratedYangParser for grammar rule typeBodyStatements.
*
* @param currentContext current context in the parsed tree
*/
void exitTypeBodyStatements(GeneratedYangParser.TypeBodyStatementsContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* numericalRestrictions.
* Enters a parse tree produced by GeneratedYangParser for grammar rule numericalRestrictions.
*
* @param currentContext current context in the parsed tree
*/
void enterDecimal64Specification(GeneratedYangParser.Decimal64SpecificationContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* numericalRestrictions.
* Exits a parse tree produced by GeneratedYangParser for grammar rule numericalRestrictions.
*
* @param currentContext current context in the parsed tree
*/
void exitDecimal64Specification(GeneratedYangParser.Decimal64SpecificationContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* numericalRestrictions.
* Enters a parse tree produced by GeneratedYangParser for grammar rule numericalRestrictions.
*
* @param currentContext current context in the parsed tree
*/
void enterNumericalRestrictions(GeneratedYangParser.NumericalRestrictionsContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* numericalRestrictions.
* Exits a parse tree produced by GeneratedYangParser for grammar rule numericalRestrictions.
*
* @param currentContext current context in the parsed tree
*/
void exitNumericalRestrictions(GeneratedYangParser.NumericalRestrictionsContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* rangeStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule rangeStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterRangeStatement(GeneratedYangParser.RangeStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* rangeStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule rangeStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitRangeStatement(GeneratedYangParser.RangeStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* commonStatements.
* Enters a parse tree produced by GeneratedYangParser for grammar rule commonStatements.
*
* @param currentContext current context in the parsed tree
*/
void enterCommonStatements(GeneratedYangParser.CommonStatementsContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* commonStatements.
* Exits a parse tree produced by GeneratedYangParser for grammar rule commonStatements.
*
* @param currentContext current context in the parsed tree
*/
void exitCommonStatements(GeneratedYangParser.CommonStatementsContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* stringRestrictions.
* Enters a parse tree produced by GeneratedYangParser for grammar rule stringRestrictions.
*
* @param currentContext current context in the parsed tree
*/
void enterStringRestrictions(GeneratedYangParser.StringRestrictionsContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* stringRestrictions.
* Exits a parse tree produced by GeneratedYangParser for grammar rule stringRestrictions.
*
* @param currentContext current context in the parsed tree
*/
void exitStringRestrictions(GeneratedYangParser.StringRestrictionsContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* lengthStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule lengthStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterLengthStatement(GeneratedYangParser.LengthStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* lengthStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule lengthStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitLengthStatement(GeneratedYangParser.LengthStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* patternStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule patternStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterPatternStatement(GeneratedYangParser.PatternStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* patternStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule patternStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitPatternStatement(GeneratedYangParser.PatternStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* defaultStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule defaultStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterDefaultStatement(GeneratedYangParser.DefaultStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* defaultStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule defaultStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitDefaultStatement(GeneratedYangParser.DefaultStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* enumSpecification.
* Enters a parse tree produced by GeneratedYangParser for grammar rule enumSpecification.
*
* @param currentContext current context in the parsed tree
*/
void enterEnumSpecification(GeneratedYangParser.EnumSpecificationContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* enumSpecification.
* Exits a parse tree produced by GeneratedYangParser for grammar rule enumSpecification.
*
* @param currentContext current context in the parsed tree
*/
void exitEnumSpecification(GeneratedYangParser.EnumSpecificationContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* enumStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule enumStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterEnumStatement(GeneratedYangParser.EnumStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* enumStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule enumStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitEnumStatement(GeneratedYangParser.EnumStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* enumStatementBody.
* Enters a parse tree produced by GeneratedYangParser for grammar rule enumStatementBody.
*
* @param currentContext current context in the parsed tree
*/
void enterEnumStatementBody(GeneratedYangParser.EnumStatementBodyContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* enumStatementBody.
* Exits a parse tree produced by GeneratedYangParser for grammar rule enumStatementBody.
*
* @param currentContext current context in the parsed tree
*/
void exitEnumStatementBody(GeneratedYangParser.EnumStatementBodyContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* leafrefSpecification.
* Enters a parse tree produced by GeneratedYangParser for grammar rule leafrefSpecification.
*
* @param currentContext current context in the parsed tree
*/
void enterLeafrefSpecification(GeneratedYangParser.LeafrefSpecificationContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* leafrefSpecification.
* Exits a parse tree produced by GeneratedYangParser for grammar rule leafrefSpecification.
*
* @param currentContext current context in the parsed tree
*/
void exitLeafrefSpecification(GeneratedYangParser.LeafrefSpecificationContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* pathStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule pathStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterPathStatement(GeneratedYangParser.PathStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* pathStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule pathStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitPathStatement(GeneratedYangParser.PathStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* requireInstanceStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule requireInstanceStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterRequireInstanceStatement(GeneratedYangParser.RequireInstanceStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* requireInstanceStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule requireInstanceStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitRequireInstanceStatement(GeneratedYangParser.RequireInstanceStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* instanceIdentifierSpecification.
* Enters a parse tree produced by GeneratedYangParser for grammar rule instanceIdentifierSpecification.
*
* @param currentContext current context in the parsed tree
*/
......@@ -932,384 +819,336 @@ public interface GeneratedYangListener extends ParseTreeListener {
GeneratedYangParser.InstanceIdentifierSpecificationContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* instanceIdentifierSpecification.
* Exits a parse tree produced by GeneratedYangParser for grammar rule instanceIdentifierSpecification.
*
* @param currentContext current context in the parsed tree
*/
void exitInstanceIdentifierSpecification(GeneratedYangParser.InstanceIdentifierSpecificationContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* identityrefSpecification.
* Enters a parse tree produced by GeneratedYangParser for grammar rule identityrefSpecification.
*
* @param currentContext current context in the parsed tree
*/
void enterIdentityrefSpecification(GeneratedYangParser.IdentityrefSpecificationContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* identityrefSpecification.
* Exits a parse tree produced by GeneratedYangParser for grammar rule identityrefSpecification.
*
* @param currentContext current context in the parsed tree
*/
void exitIdentityrefSpecification(GeneratedYangParser.IdentityrefSpecificationContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* unionSpecification.
* Enters a parse tree produced by GeneratedYangParser for grammar rule unionSpecification.
*
* @param currentContext current context in the parsed tree
*/
void enterUnionSpecification(GeneratedYangParser.UnionSpecificationContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* unionSpecification.
* Exits a parse tree produced by GeneratedYangParser for grammar rule unionSpecification.
*
* @param currentContext current context in the parsed tree
*/
void exitUnionSpecification(GeneratedYangParser.UnionSpecificationContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* bitsSpecification.
* Enters a parse tree produced by GeneratedYangParser for grammar rule bitsSpecification.
*
* @param currentContext current context in the parsed tree
*/
void enterBitsSpecification(GeneratedYangParser.BitsSpecificationContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* bitsSpecification.
* Exits a parse tree produced by GeneratedYangParser for grammar rule bitsSpecification.
*
* @param currentContext current context in the parsed tree
*/
void exitBitsSpecification(GeneratedYangParser.BitsSpecificationContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* bitStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule bitStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterBitStatement(GeneratedYangParser.BitStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* bitStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule bitStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitBitStatement(GeneratedYangParser.BitStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* bitBodyStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule bitBodyStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterBitBodyStatement(GeneratedYangParser.BitBodyStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* bitBodyStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule bitBodyStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitBitBodyStatement(GeneratedYangParser.BitBodyStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* positionStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule positionStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterPositionStatement(GeneratedYangParser.PositionStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* positionStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule positionStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitPositionStatement(GeneratedYangParser.PositionStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* statusStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule statusStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterStatusStatement(GeneratedYangParser.StatusStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* statusStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule statusStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitStatusStatement(GeneratedYangParser.StatusStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* configStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule configStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterConfigStatement(GeneratedYangParser.ConfigStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* configStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule configStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitConfigStatement(GeneratedYangParser.ConfigStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* mandatoryStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule mandatoryStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterMandatoryStatement(GeneratedYangParser.MandatoryStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* mandatoryStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule mandatoryStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitMandatoryStatement(GeneratedYangParser.MandatoryStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* presenceStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule presenceStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterPresenceStatement(GeneratedYangParser.PresenceStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* presenceStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule presenceStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitPresenceStatement(GeneratedYangParser.PresenceStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* orderedByStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule orderedByStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterOrderedByStatement(GeneratedYangParser.OrderedByStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* orderedByStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule orderedByStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitOrderedByStatement(GeneratedYangParser.OrderedByStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* mustStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule mustStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterMustStatement(GeneratedYangParser.MustStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* mustStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule mustStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitMustStatement(GeneratedYangParser.MustStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* errorMessageStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule errorMessageStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterErrorMessageStatement(GeneratedYangParser.ErrorMessageStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* errorMessageStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule errorMessageStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitErrorMessageStatement(GeneratedYangParser.ErrorMessageStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* errorAppTagStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule errorAppTagStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterErrorAppTagStatement(GeneratedYangParser.ErrorAppTagStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* errorAppTagStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule errorAppTagStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitErrorAppTagStatement(GeneratedYangParser.ErrorAppTagStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* minElementsStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule minElementsStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterMinElementsStatement(GeneratedYangParser.MinElementsStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* minElementsStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule minElementsStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitMinElementsStatement(GeneratedYangParser.MinElementsStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* maxElementsStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule maxElementsStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterMaxElementsStatement(GeneratedYangParser.MaxElementsStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* maxElementsStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule maxElementsStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitMaxElementsStatement(GeneratedYangParser.MaxElementsStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* valueStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule valueStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterValueStatement(GeneratedYangParser.ValueStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* valueStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule valueStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitValueStatement(GeneratedYangParser.ValueStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* groupingStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule groupingStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterGroupingStatement(GeneratedYangParser.GroupingStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* groupingStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule groupingStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitGroupingStatement(GeneratedYangParser.GroupingStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* containerStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule containerStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterContainerStatement(GeneratedYangParser.ContainerStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* containerStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule containerStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitContainerStatement(GeneratedYangParser.ContainerStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* leafStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule leafStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterLeafStatement(GeneratedYangParser.LeafStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* leafStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule leafStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitLeafStatement(GeneratedYangParser.LeafStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* leafListStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule leafListStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterLeafListStatement(GeneratedYangParser.LeafListStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* leafListStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule leafListStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitLeafListStatement(GeneratedYangParser.LeafListStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* listStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule listStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterListStatement(GeneratedYangParser.ListStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* listStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule listStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitListStatement(GeneratedYangParser.ListStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* keyStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule keyStatement.
*
* @param currentContext current context in the parsed tree
*/
void enterKeyStatement(GeneratedYangParser.KeyStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* keyStatement.
* Exits a parse tree produced by GeneratedYangParser for grammar rule keyStatement.
*
* @param currentContext current context in the parsed tree
*/
void exitKeyStatement(GeneratedYangParser.KeyStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* uniqueStatement.
* Enters a parse tree produced by GeneratedYangParser for grammar rule uniqueStatement.
*
* @param currentContext current context in the parsed tree
*/
......@@ -1965,4 +1804,150 @@ public interface GeneratedYangListener extends ParseTreeListener {
* @param currentContext current context in the parsed tree
*/
void exitYangConstruct(GeneratedYangParser.YangConstructContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule compiler annotation statement.
*
* @param currentContext current context in the parsed tree
*/
void enterCompilerAnnotationStatement(GeneratedYangParser.CompilerAnnotationStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule compiler annotation statement.
*
* @param currentContext current context in the parsed tree
*/
void exitCompilerAnnotationStatement(GeneratedYangParser.CompilerAnnotationStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule annotation statement.
*
* @param currentContext current context in the parsed tree
*/
void enterAnnotationStatement(GeneratedYangParser.AnnotationStatementContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule annotation statement.
*
* @param currentContext current context in the parsed tree
*/
void exitAnnotationStatement(GeneratedYangParser.AnnotationStatementContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule annotation type.
*
* @param currentContext current context in the parsed tree
*/
void enterAnnotationType(GeneratedYangParser.AnnotationTypeContext currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule annotation type.
*
* @param currentContext current context in the parsed tree
*/
void exitAnnotationType(GeneratedYangParser.AnnotationTypeContext currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* annotation parameter specification.
*
* @param currentContext current context in the parsed tree
*/
void enterAnnotationParameterSpecification(GeneratedYangParser.AnnotationParameterSpecificationContext
currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* annotation parameter specification.
*
* @param currentContext current context in the parsed tree
*/
void exitAnnotationParameterSpecification(GeneratedYangParser.AnnotationParameterSpecificationContext
currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* annotation parameter specification argument.
*
* @param currentContext current context in the parsed tree
*/
void enterAnnotationParameterSpecificationArg(GeneratedYangParser.AnnotationParameterSpecificationArgContext
currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* annotation parameter specification argument.
*
* @param currentContext current context in the parsed tree
*/
void exitAnnotationParameterSpecificationArg(GeneratedYangParser.AnnotationParameterSpecificationArgContext
currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule annotation parameter instance.
*
* @param currentContext current context in the parsed tree
*/
void enterAnnotationParaInstance(GeneratedYangParser.AnnotationParaInstanceContext
currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule annotation parameter instance.
*
* @param currentContext current context in the parsed tree
*/
void exitAnnotationParaInstance(GeneratedYangParser.AnnotationParaInstanceContext
currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* annotation parameter type identifier.
*
* @param currentContext current context in the parsed tree
*/
void enterAnnotationParaTypeIdentifier(GeneratedYangParser.AnnotationParaTypeIdentifierContext
currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* annotation parameter type identifier.
*
* @param currentContext current context in the parsed tree
*/
void exitAnnotationParaTypeIdentifier(GeneratedYangParser.AnnotationParaTypeIdentifierContext
currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule
* annotation parameter type value.
*
* @param currentContext current context in the parsed tree
*/
void enterAnnotationParaTypeValue(GeneratedYangParser.AnnotationParaTypeValueContext
currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule
* annotation parameter type value.
*
* @param currentContext current context in the parsed tree
*/
void exitAnnotationParaTypeValue(GeneratedYangParser.AnnotationParaTypeValueContext
currentContext);
/**
* Enters a parse tree produced by GeneratedYangParser for grammar rule annotation identifier.
*
* @param currentContext current context in the parsed tree
*/
void enterAnnotationIdentifier(GeneratedYangParser.AnnotationIdentifierContext
currentContext);
/**
* Exits a parse tree produced by GeneratedYangParser for grammar rule annotation identifier.
*
* @param currentContext current context in the parsed tree
*/
void exitAnnotationIdentifier(GeneratedYangParser.AnnotationIdentifierContext
currentContext);
}
......
......@@ -1376,6 +1376,99 @@ public class TreeWalkListener implements GeneratedYangListener {
}
@Override
public void enterCompilerAnnotationStatement(GeneratedYangParser.CompilerAnnotationStatementContext ctx) {
// TODO: implement the method.
}
@Override
public void exitCompilerAnnotationStatement(GeneratedYangParser.CompilerAnnotationStatementContext ctx) {
// TODO: implement the method.
}
@Override
public void enterAnnotationStatement(GeneratedYangParser.AnnotationStatementContext ctx) {
// TODO: implement the method.
}
@Override
public void exitAnnotationStatement(GeneratedYangParser.AnnotationStatementContext ctx) {
// TODO: implement the method.
}
@Override
public void enterAnnotationType(GeneratedYangParser.AnnotationTypeContext ctx) {
// TODO: implement the method.
}
@Override
public void exitAnnotationType(GeneratedYangParser.AnnotationTypeContext ctx) {
// TODO: implement the method.
}
@Override
public void enterAnnotationParameterSpecification(GeneratedYangParser.AnnotationParameterSpecificationContext
ctx) {
// TODO: implement the method.
}
@Override
public void exitAnnotationParameterSpecification(GeneratedYangParser.AnnotationParameterSpecificationContext ctx) {
// TODO: implement the method.
}
@Override
public void enterAnnotationParameterSpecificationArg(GeneratedYangParser.AnnotationParameterSpecificationArgContext
ctx) {
// TODO: implement the method.
}
@Override
public void exitAnnotationParameterSpecificationArg(GeneratedYangParser.AnnotationParameterSpecificationArgContext
ctx) {
// TODO: implement the method.
}
@Override
public void enterAnnotationParaInstance(GeneratedYangParser.AnnotationParaInstanceContext ctx) {
// TODO: implement the method.
}
@Override
public void exitAnnotationParaInstance(GeneratedYangParser.AnnotationParaInstanceContext ctx) {
// TODO: implement the method.
}
@Override
public void enterAnnotationParaTypeIdentifier(GeneratedYangParser.AnnotationParaTypeIdentifierContext ctx) {
// TODO: implement the method.
}
@Override
public void exitAnnotationParaTypeIdentifier(GeneratedYangParser.AnnotationParaTypeIdentifierContext ctx) {
// TODO: implement the method.
}
@Override
public void enterAnnotationParaTypeValue(GeneratedYangParser.AnnotationParaTypeValueContext ctx) {
// TODO: implement the method.
}
@Override
public void exitAnnotationParaTypeValue(GeneratedYangParser.AnnotationParaTypeValueContext ctx) {
// TODO: implement the method.
}
@Override
public void enterAnnotationIdentifier(GeneratedYangParser.AnnotationIdentifierContext ctx) {
// TODO: implement the method.
}
@Override
public void exitAnnotationIdentifier(GeneratedYangParser.AnnotationIdentifierContext ctx) {
// TODO: implement the method.
}
@Override
public void enterVersion(GeneratedYangParser.VersionContext ctx) {
// do nothing.
}
......
......@@ -16,7 +16,6 @@
package org.onosproject.yangutils.parser.impl.listeners;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangDerivedInfo;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangLeafList;
......@@ -27,6 +26,7 @@ import org.onosproject.yangutils.datamodel.YangTypeDef;
import org.onosproject.yangutils.datamodel.YangUnion;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.linker.impl.YangResolutionInfoImpl;
import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
import org.onosproject.yangutils.parser.exceptions.ParserException;
......@@ -94,6 +94,8 @@ public final class TypeListener {
// Obtain the YANG data type.
YangDataTypes yangDataTypes = YangDataTypes.getType(ctx.string().getText());
validateTypeSubStatementCardinality(ctx, yangDataTypes);
// Create YANG type object and fill the values.
YangType<?> type = getYangType(JAVA_GENERATION);
type.setNodeIdentifier(nodeIdentifier);
......@@ -265,4 +267,37 @@ public final class TypeListener {
TYPE_DATA, ctx.string().getText(), ENTRY, e.getMessage()));
}
}
/**
* Validates type body statements cardinality.
*
* @param ctx context object of the grammar rule
* @param yangDataType yang data type
*/
private static void validateTypeSubStatementCardinality(GeneratedYangParser.TypeStatementContext ctx,
YangDataTypes yangDataType) {
if (ctx.typeBodyStatements() == null || ctx.typeBodyStatements().isEmpty()) {
ParserException parserException;
switch (yangDataType) {
case UNION:
parserException = new ParserException("YANG file error : a type union" +
" must have atleast one type statement.");
break;
case ENUMERATION:
parserException = new ParserException("YANG file error : a type enumeration" +
" must have atleast one enum statement.");
break;
case BITS:
parserException = new ParserException("YANG file error : a type bits" +
" must have atleast one bit statement.");
break;
// TODO : decimal64, identity ref, leafref
default:
return;
}
parserException.setLine(ctx.getStart().getLine());
parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
throw parserException;
}
}
}
......
......@@ -237,34 +237,13 @@ package org.onosproject.yangutils.parser.antlrgencode;
* [status-stmt stmtsep]
* [description-stmt stmtsep]
* [reference-stmt stmtsep]
* [compiler-annotation-stmt stmtsep]
* "}")
* TODO : 0..1 occurance to be checked in listener
*/
extensionStatement : EXTENSION_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE extensionBody RIGHT_CURLY_BRACE);
extensionBody : argumentStatement? statusStatement? descriptionStatement? referenceStatement?
| argumentStatement? statusStatement? referenceStatement? descriptionStatement?
| argumentStatement? descriptionStatement? statusStatement? referenceStatement?
| argumentStatement? descriptionStatement? referenceStatement? statusStatement?
| argumentStatement? referenceStatement? descriptionStatement? statusStatement?
| argumentStatement? referenceStatement? statusStatement? descriptionStatement?
| statusStatement? referenceStatement? argumentStatement? descriptionStatement?
| statusStatement? referenceStatement? descriptionStatement? argumentStatement?
| statusStatement? descriptionStatement? referenceStatement? argumentStatement?
| statusStatement? descriptionStatement? argumentStatement? referenceStatement?
| statusStatement? argumentStatement? referenceStatement? descriptionStatement?
| statusStatement? argumentStatement? descriptionStatement? referenceStatement?
| descriptionStatement? argumentStatement? statusStatement? referenceStatement?
| descriptionStatement? argumentStatement? referenceStatement? statusStatement?
| descriptionStatement? statusStatement? argumentStatement? referenceStatement?
| descriptionStatement? statusStatement? referenceStatement? argumentStatement?
| descriptionStatement? referenceStatement? statusStatement? argumentStatement?
| descriptionStatement? referenceStatement? argumentStatement? statusStatement?
| referenceStatement? descriptionStatement? argumentStatement? statusStatement?
| referenceStatement? descriptionStatement? statusStatement? argumentStatement?
| referenceStatement? statusStatement? argumentStatement? descriptionStatement?
| referenceStatement? statusStatement? descriptionStatement? argumentStatement?
| referenceStatement? argumentStatement? descriptionStatement? statusStatement?
| referenceStatement? argumentStatement? statusStatement? descriptionStatement?
;
extensionBody : (argumentStatement | statusStatement | descriptionStatement
| referenceStatement | compilerAnnotationStatement)* ;
/**
* argument-stmt = argument-keyword sep identifier-arg-str optsep
......@@ -291,35 +270,13 @@ package org.onosproject.yangutils.parser.antlrgencode;
* [status-stmt stmtsep]
* [description-stmt stmtsep]
* [reference-stmt stmtsep]
* [compiler-annotation-stmt stmtsep]
* "}")
* TODO : 0..1 occurance to be checked in listener
*/
identityStatement : IDENTITY_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE identityBody RIGHT_CURLY_BRACE);
identityBody : baseStatement? statusStatement? descriptionStatement? referenceStatement?
| baseStatement? statusStatement? referenceStatement? descriptionStatement?
| baseStatement? descriptionStatement? statusStatement? referenceStatement?
| baseStatement? descriptionStatement? referenceStatement? statusStatement?
| baseStatement? referenceStatement? descriptionStatement? statusStatement?
| baseStatement? referenceStatement? statusStatement? descriptionStatement?
| referenceStatement? baseStatement? statusStatement? descriptionStatement?
| referenceStatement? baseStatement? descriptionStatement? statusStatement?
| referenceStatement? statusStatement? baseStatement? descriptionStatement?
| referenceStatement? statusStatement? descriptionStatement? baseStatement?
| referenceStatement? descriptionStatement? statusStatement? baseStatement?
| referenceStatement? descriptionStatement? baseStatement? statusStatement?
| descriptionStatement? referenceStatement? statusStatement? baseStatement?
| descriptionStatement? referenceStatement? statusStatement? baseStatement?
| descriptionStatement? referenceStatement? baseStatement? statusStatement?
| descriptionStatement? statusStatement? baseStatement? referenceStatement?
| descriptionStatement? statusStatement? referenceStatement? baseStatement?
| descriptionStatement? baseStatement? referenceStatement? statusStatement?
| descriptionStatement? baseStatement? statusStatement? referenceStatement?
| statusStatement? baseStatement? descriptionStatement? referenceStatement?
| statusStatement? baseStatement? referenceStatement? descriptionStatement?
| statusStatement? descriptionStatement? baseStatement? referenceStatement?
| statusStatement? descriptionStatement? referenceStatement? baseStatement?
| statusStatement? referenceStatement? descriptionStatement? baseStatement?
| statusStatement? referenceStatement? baseStatement? descriptionStatement?
;
identityBody : (baseStatement | statusStatement | descriptionStatement | referenceStatement
| compilerAnnotationStatement)*;
/**
* base-stmt = base-keyword sep identifier-ref-arg-str
......@@ -337,34 +294,13 @@ package org.onosproject.yangutils.parser.antlrgencode;
* [status-stmt stmtsep]
* [description-stmt stmtsep]
* [reference-stmt stmtsep]
* [compiler-annotation-stmt stmtsep]
* "}")
* TODO : 0..1 occurance to be checked in listener
*/
featureStatement : FEATURE_KEYWORD string (STMTEND | LEFT_CURLY_BRACE featureBody RIGHT_CURLY_BRACE);
featureBody : ifFeatureStatement* statusStatement? descriptionStatement? referenceStatement?
| ifFeatureStatement* statusStatement? referenceStatement? descriptionStatement?
| ifFeatureStatement* descriptionStatement? statusStatement? referenceStatement?
| ifFeatureStatement* descriptionStatement? referenceStatement? statusStatement?
| ifFeatureStatement* referenceStatement? statusStatement? descriptionStatement?
| ifFeatureStatement* referenceStatement? descriptionStatement? statusStatement?
| statusStatement? ifFeatureStatement* descriptionStatement? referenceStatement?
| statusStatement? ifFeatureStatement* referenceStatement? descriptionStatement?
| statusStatement? descriptionStatement? ifFeatureStatement* referenceStatement?
| statusStatement? descriptionStatement? referenceStatement? ifFeatureStatement*
| statusStatement? referenceStatement? ifFeatureStatement* descriptionStatement?
| statusStatement? referenceStatement? descriptionStatement? ifFeatureStatement*
| descriptionStatement? ifFeatureStatement* statusStatement? referenceStatement?
| descriptionStatement? ifFeatureStatement* referenceStatement? statusStatement?
| descriptionStatement? statusStatement? ifFeatureStatement* referenceStatement?
| descriptionStatement? statusStatement? referenceStatement? ifFeatureStatement*
| descriptionStatement? referenceStatement* statusStatement? ifFeatureStatement*
| descriptionStatement? referenceStatement* ifFeatureStatement? statusStatement?
| referenceStatement? ifFeatureStatement* statusStatement? descriptionStatement?
| referenceStatement? ifFeatureStatement* descriptionStatement? statusStatement?
| referenceStatement? descriptionStatement? statusStatement? ifFeatureStatement*
| referenceStatement? descriptionStatement? ifFeatureStatement* statusStatement?
| referenceStatement? statusStatement? descriptionStatement? ifFeatureStatement*
| referenceStatement? statusStatement? ifFeatureStatement* descriptionStatement?
;
featureBody : (ifFeatureStatement | statusStatement | descriptionStatement
| referenceStatement | compilerAnnotationStatement)* ;
/**
* data-def-stmt = container-stmt /
......@@ -404,11 +340,13 @@ package org.onosproject.yangutils.parser.antlrgencode;
* [status-stmt stmtsep]
* [description-stmt stmtsep]
* [reference-stmt stmtsep]
* [compiler-annotation-stmt stmtsep]
* "}"
* TODO : 0..1 occurance to be validated in listener
*/
typedefStatement : TYPEDEF_KEYWORD identifier LEFT_CURLY_BRACE
(typeStatement | unitsStatement | defaultStatement | statusStatement | descriptionStatement | referenceStatement)*
(typeStatement | unitsStatement | defaultStatement | statusStatement | descriptionStatement
| compilerAnnotationStatement | referenceStatement)*
RIGHT_CURLY_BRACE;
/**
......@@ -770,6 +708,7 @@ package org.onosproject.yangutils.parser.antlrgencode;
* [status-stmt stmtsep]
* [description-stmt stmtsep]
* [reference-stmt stmtsep]
* [compiler-annotation-stmt stmtsep]
* *((typedef-stmt /
* grouping-stmt) stmtsep)
* *(data-def-stmt stmtsep)
......@@ -778,7 +717,7 @@ package org.onosproject.yangutils.parser.antlrgencode;
*/
groupingStatement : GROUPING_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE
(statusStatement | descriptionStatement | referenceStatement | typedefStatement | groupingStatement
| dataDefStatement)* RIGHT_CURLY_BRACE);
| dataDefStatement | compilerAnnotationStatement)* RIGHT_CURLY_BRACE);
/**
* container-stmt = container-keyword sep identifier-arg-str optsep
......@@ -793,6 +732,7 @@ package org.onosproject.yangutils.parser.antlrgencode;
* [status-stmt stmtsep]
* [description-stmt stmtsep]
* [reference-stmt stmtsep]
* [compiler-annotation-stmt stmtsep]
* *((typedef-stmt /
* grouping-stmt) stmtsep)
* *(data-def-stmt stmtsep)
......@@ -802,7 +742,7 @@ package org.onosproject.yangutils.parser.antlrgencode;
containerStatement : CONTAINER_KEYWORD identifier
(STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | mustStatement | presenceStatement | configStatement
| statusStatement | descriptionStatement | referenceStatement | typedefStatement | groupingStatement
| dataDefStatement)* RIGHT_CURLY_BRACE);
| dataDefStatement | compilerAnnotationStatement)* RIGHT_CURLY_BRACE);
/**
* leaf-stmt = leaf-keyword sep identifier-arg-str optsep
......@@ -824,7 +764,7 @@ package org.onosproject.yangutils.parser.antlrgencode;
*/
leafStatement : LEAF_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | typeStatement | unitsStatement
| mustStatement | defaultStatement | configStatement | mandatoryStatement | statusStatement | descriptionStatement
| referenceStatement)* RIGHT_CURLY_BRACE;
| referenceStatement | compilerAnnotationStatement)* RIGHT_CURLY_BRACE;
/**
* leaf-list-stmt = leaf-list-keyword sep identifier-arg-str optsep
......@@ -847,7 +787,7 @@ package org.onosproject.yangutils.parser.antlrgencode;
*/
leafListStatement : LEAF_LIST_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | typeStatement
| unitsStatement | mustStatement | configStatement | minElementsStatement | maxElementsStatement | orderedByStatement
| statusStatement | descriptionStatement | referenceStatement)* RIGHT_CURLY_BRACE;
| statusStatement | descriptionStatement | referenceStatement | compilerAnnotationStatement)* RIGHT_CURLY_BRACE;
/**
* list-stmt = list-keyword sep identifier-arg-str optsep
......@@ -873,7 +813,8 @@ package org.onosproject.yangutils.parser.antlrgencode;
*/
listStatement : LIST_KEYWORD identifier LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | mustStatement | keyStatement
| uniqueStatement | configStatement | minElementsStatement | maxElementsStatement | orderedByStatement | statusStatement
| descriptionStatement | referenceStatement | typedefStatement | groupingStatement| dataDefStatement)* RIGHT_CURLY_BRACE;
| descriptionStatement | referenceStatement | typedefStatement | groupingStatement| dataDefStatement
| compilerAnnotationStatement)* RIGHT_CURLY_BRACE;
/**
* key-stmt = key-keyword sep key-arg-str stmtend
......@@ -904,7 +845,7 @@ package org.onosproject.yangutils.parser.antlrgencode;
*/
choiceStatement : CHOICE_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | defaultStatement
| configStatement | mandatoryStatement | statusStatement | descriptionStatement | referenceStatement | shortCaseStatement
| caseStatement)* RIGHT_CURLY_BRACE);
| caseStatement | compilerAnnotationStatement)* RIGHT_CURLY_BRACE);
/**
* short-case-stmt = container-stmt /
......@@ -949,7 +890,7 @@ package org.onosproject.yangutils.parser.antlrgencode;
*/
anyxmlStatement : ANYXML_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement
| mustStatement | configStatement | mandatoryStatement | statusStatement | descriptionStatement
| referenceStatement)* RIGHT_CURLY_BRACE);
| referenceStatement | compilerAnnotationStatement)* RIGHT_CURLY_BRACE);
/**
* uses-stmt = uses-keyword sep identifier-ref-arg-str optsep
......@@ -961,13 +902,15 @@ package org.onosproject.yangutils.parser.antlrgencode;
* [status-stmt stmtsep]
* [description-stmt stmtsep]
* [reference-stmt stmtsep]
* [compiler-annotation-stmt stmtsep]
* *(refine-stmt stmtsep)
* *(uses-augment-stmt stmtsep)
* "}")
* TODO : 0..1 occurance to be checked in listener
*/
usesStatement : USES_KEYWORD string (STMTEND | LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | statusStatement
| descriptionStatement | referenceStatement | refineStatement | augmentStatement)* RIGHT_CURLY_BRACE);
| descriptionStatement | referenceStatement | refineStatement | augmentStatement
| compilerAnnotationStatement)* RIGHT_CURLY_BRACE);
/**
* refine-stmt = refine-keyword sep refine-arg-str optsep
......@@ -1082,7 +1025,8 @@ package org.onosproject.yangutils.parser.antlrgencode;
* TODO : 0..1 occurance to be checked in listener
*/
augmentStatement : AUGMENT_KEYWORD augment LEFT_CURLY_BRACE (whenStatement | ifFeatureStatement | statusStatement
| descriptionStatement | referenceStatement | dataDefStatement | caseStatement)* RIGHT_CURLY_BRACE;
| descriptionStatement | referenceStatement | dataDefStatement | caseStatement
| compilerAnnotationStatement)* RIGHT_CURLY_BRACE;
/**
* when-stmt = when-keyword sep string optsep
......@@ -1110,10 +1054,13 @@ package org.onosproject.yangutils.parser.antlrgencode;
* grouping-stmt) stmtsep)
* [input-stmt stmtsep]
* [output-stmt stmtsep]
* [compiler-annotation-stmt stmtsep]
* "}")
* TODO : 0..1 occurance to be checked in listener
*/
rpcStatement : RPC_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (ifFeatureStatement | statusStatement | descriptionStatement
| referenceStatement | typedefStatement | groupingStatement | inputStatement | outputStatement)* RIGHT_CURLY_BRACE);
rpcStatement : RPC_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (ifFeatureStatement | statusStatement
| descriptionStatement | referenceStatement | typedefStatement | groupingStatement | inputStatement
| outputStatement | compilerAnnotationStatement)* RIGHT_CURLY_BRACE);
/**
* input-stmt = input-keyword optsep
......@@ -1147,6 +1094,7 @@ package org.onosproject.yangutils.parser.antlrgencode;
* [status-stmt stmtsep]
* [description-stmt stmtsep]
* [reference-stmt stmtsep]
* [compiler-annotation-stmt stmtsep]
* *((typedef-stmt /
* grouping-stmt) stmtsep)
* *(data-def-stmt stmtsep)
......@@ -1155,7 +1103,7 @@ package org.onosproject.yangutils.parser.antlrgencode;
*/
notificationStatement : NOTIFICATION_KEYWORD identifier (STMTEND | LEFT_CURLY_BRACE (ifFeatureStatement
| statusStatement | descriptionStatement | referenceStatement | typedefStatement
| groupingStatement | dataDefStatement)* RIGHT_CURLY_BRACE);
| groupingStatement | dataDefStatement | compilerAnnotationStatement)* RIGHT_CURLY_BRACE);
/**
* deviation-stmt = deviation-keyword sep
......@@ -1164,6 +1112,7 @@ package org.onosproject.yangutils.parser.antlrgencode;
* ;; these stmts can appear in any order
* [description-stmt stmtsep]
* [reference-stmt stmtsep]
* [compiler-annotation-stmt stmtsep]
* (deviate-not-supported-stmt /
* 1*(deviate-add-stmt /
* deviate-replace-stmt /
......@@ -1173,7 +1122,7 @@ package org.onosproject.yangutils.parser.antlrgencode;
*/
deviationStatement: DEVIATION_KEYWORD deviation LEFT_CURLY_BRACE (descriptionStatement | referenceStatement
| deviateNotSupportedStatement | deviateAddStatement | deviateReplaceStatement
| deviateDeleteStatement)* RIGHT_CURLY_BRACE;
| deviateDeleteStatement | compilerAnnotationStatement)* RIGHT_CURLY_BRACE;
/**
* deviate-not-supported-stmt =
......@@ -1233,11 +1182,68 @@ package org.onosproject.yangutils.parser.antlrgencode;
defaultStatement? configStatement? mandatoryStatement? minElementsStatement?
maxElementsStatement? RIGHT_CURLY_BRACE));
/**
* compiler-annotation-stmt = compiler-annotation-keyword optsep
* "{" stmtsep
* ;; these stmts can appear in any order
* *(if-feature-stmt stmtsep)
* [status-stmt stmtsep]
* [units-stmt stmtsep]
* [reference-stmt stmtsep]
* 1*(compiler-annotation-stmt stmtsep)
* "}"
*/
compilerAnnotationStatement : COMPILER_ANNOTATION_KEYWORD LEFT_CURLY_BRACE (ifFeatureStatement | statusStatement
| unitsStatement | referenceStatement | annotationStatement)*
RIGHT_CURLY_BRACE;
/**
* annotation-stmt = "@" annotation-type [annotation-parameter-specification] ";"
*/
annotationStatement : annotationType annotationParameterSpecification? STMTEND;
/**
* annotation-type = identifier
*/
annotationType : annotationIdentifier;
/**
* annotation-parameter-specification = "(" optsep annotation-parameter-specification-arg optsep ")"
*/
annotationParameterSpecification : LEFT_ROUND_BRACE annotationParameterSpecificationArg RIGHT_ROUND_BRACE;
/**
* annotation-parameter-specification-arg = annotation-para-type-value
* / annotation-para-instance *("," annotation-para-instance)
*/
annotationParameterSpecificationArg : annotationParaTypeValue
| annotationParaInstance (COMMA annotationParaInstance)*;
/**
* annotation-para-instance = annotation-para-type-identifier optsep "=" optsep annotation-para-type-value
*/
annotationParaInstance : annotationParaTypeIdentifier EQUAL annotationParaTypeValue;
/**
* annotation-para-type-identifier = identifier
*/
annotationParaTypeIdentifier : identifier;
/**
* annotation-para-type-value = identifier
*/
annotationParaTypeValue : identifier;
string : STRING (PLUS STRING)*
| IDENTIFIER
| INTEGER
| yangConstruct;
annotationIdentifier : STRING (PLUS STRING)*
| ANNOTATION_IDENTIFIER
| IDENTIFIER
| yangConstruct;
identifier : STRING (PLUS STRING)*
| IDENTIFIER
| yangConstruct;
......@@ -1296,4 +1302,5 @@ package org.onosproject.yangutils.parser.antlrgencode;
| UNITS_KEYWORD | USES_KEYWORD | VALUE_KEYWORD | WHEN_KEYWORD | YANG_VERSION_KEYWORD
| YIN_ELEMENT_KEYWORD | ADD_KEYWORD | CURRENT_KEYWORD | DELETE_KEYWORD | DEPRECATED_KEYWORD
| FALSE_KEYWORD | MAX_KEYWORD | MIN_KEYWORD | NOT_SUPPORTED_KEYWORD | OBSOLETE_KEYWORD
| REPLACE_KEYWORD | SYSTEM_KEYWORD | TRUE_KEYWORD | UNBOUNDED_KEYWORD | USER_KEYWORD;
\ No newline at end of file
| REPLACE_KEYWORD | SYSTEM_KEYWORD | TRUE_KEYWORD | UNBOUNDED_KEYWORD | USER_KEYWORD
| COMPILER_ANNOTATION_KEYWORD;
......
......@@ -100,6 +100,7 @@ lexer grammar YangLexer;
TRUE_KEYWORD : 'true';
UNBOUNDED_KEYWORD : 'unbounded';
USER_KEYWORD : 'user';
COMPILER_ANNOTATION_KEYWORD : 'compiler-annotation';
// Lexer tokens to be skipped
COMMENT
......@@ -116,11 +117,18 @@ lexer grammar YangLexer;
DATE_ARG : DIGIT DIGIT DIGIT DIGIT '-' DIGIT DIGIT '-' DIGIT DIGIT;
LEFT_CURLY_BRACE : '{';
RIGHT_CURLY_BRACE : '}';
LEFT_ROUND_BRACE : '(';
RIGHT_ROUND_BRACE : ')';
ANNOTATION_START : '@';
ANNOTATION_IDENTIFIER : ('@')(ALPHA | '_')
(ALPHA | DIGIT | '_' | '-' | '.')*;
IDENTIFIER : (ALPHA | '_')
(ALPHA | DIGIT | '_' | '-' | '.')*;
STMTEND : ';';
DQUOTE : '"';
COLON : ':';
COMMA : ',';
EQUAL : '=';
PLUS : '+';
MINUS: '-';
......
......@@ -129,19 +129,6 @@ public class ConfigListenerTest {
}
/**
* Checks config statement as sub-statement of module.
*/
@Test
public void processModuleSubStatementConfig() throws IOException, ParserException {
thrown.expect(ParserException.class);
thrown.expectMessage("mismatched input 'config' expecting {'anyxml', 'augment', 'choice', 'contact', "
+ "'container', 'description', 'extension', 'deviation', 'feature', 'grouping', 'identity', 'import',"
+ " 'include', 'leaf', 'leaf-list', 'list', 'notification', 'organization', 'reference',"
+ " 'revision', 'rpc', 'typedef', 'uses', '}'}");
YangNode node = manager.getDataModel("src/test/resources/ModuleSubStatementConfig.yang");
}
/**
* Checks config statement as sub-statement of container.
*/
@Test
......
......@@ -91,13 +91,8 @@ public class LeafListListenerTest {
/**
* Checks whether exception is thrown when leaf-list keyword is incorrect.
*/
@Test
@Test(expected = ParserException.class)
public void processLeafListInvalidStatement() throws IOException, ParserException {
thrown.expect(ParserException.class);
thrown.expectMessage("mismatched input 'leaflist' expecting {'anyxml', 'augment', 'choice', 'contact', "
+ "'container', 'description', 'extension', 'deviation', 'feature', 'grouping', 'identity', 'import',"
+ " 'include', 'leaf', 'leaf-list', 'list', 'notification', 'organization', 'reference',"
+ " 'revision', 'rpc', 'typedef', 'uses', '}'}");
YangNode node = manager.getDataModel("src/test/resources/LeafListInvalidStatement.yang");
}
......
......@@ -90,19 +90,6 @@ public class LeafListenerTest {
}
/**
* Checks whether exception is thrown when leaf keyword is incorrect.
*/
@Test
public void processLeafInvalidStatement() throws IOException, ParserException {
thrown.expect(ParserException.class);
thrown.expectMessage("mismatched input 'leafs' expecting {'anyxml', 'augment', 'choice', 'contact', "
+ "'container', 'description', 'extension', 'deviation', 'feature', 'grouping', 'identity', 'import',"
+ " 'include', 'leaf', 'leaf-list', 'list', 'notification', 'organization', 'reference',"
+ " 'revision', 'rpc', 'typedef', 'uses', '}'}");
YangNode node = manager.getDataModel("src/test/resources/LeafInvalidStatement.yang");
}
/**
* Checks whether exception is thrown when leaf keyword without Left brace
* as per grammar.
*/
......
......@@ -140,18 +140,4 @@ public class MandatoryListenerTest {
thrown.expectMessage("missing ';' at '}'");
YangNode node = manager.getDataModel("src/test/resources/MandatoryWithoutStatementEnd.yang");
}
/**
* Checks mandatory statement as sub-statement of module and expects
* exception.
*/
@Test
public void processModuleSubStatementMandatory() throws IOException, ParserException {
thrown.expect(ParserException.class);
thrown.expectMessage("mismatched input 'mandatory' expecting {'anyxml', 'augment', 'choice', 'contact',"
+ " 'container', 'description', 'extension', 'deviation', 'feature', 'grouping', 'identity', 'import',"
+ " 'include', 'leaf', 'leaf-list', 'list', 'notification', 'organization', 'reference',"
+ " 'revision', 'rpc', 'typedef', 'uses', '}'}");
YangNode node = manager.getDataModel("src/test/resources/ModuleSubStatementMandatory.yang");
}
}
......
......@@ -92,19 +92,6 @@ public class MaxElementsListenerTest {
}
/**
* Checks whether exception is thrown when invalid max-elements keyword is
* given as input.
*/
@Test
public void processMaxElementsInvalidStatement() throws IOException, ParserException {
thrown.expect(ParserException.class);
thrown.expectMessage("extraneous input 'max-element' expecting {'config', 'description', 'if-feature',"
+ " 'max-elements', 'min-elements', 'must', 'ordered-by', 'reference', 'status', 'type', 'units', "
+ "'when', '}'}");
YangNode node = manager.getDataModel("src/test/resources/MaxElementsInvalidStatement.yang");
}
/**
* Checks whether exception is thrown when max-elements statement without
* statement end is given as input.
*/
......
......@@ -92,19 +92,6 @@ public class MinElementsListenerTest {
}
/**
* Checks whether exception is thrown when invalid min-elements keyword is
* given as input.
*/
@Test
public void processMinElementsInvalidKeyword() throws IOException, ParserException {
thrown.expect(ParserException.class);
thrown.expectMessage("extraneous input 'min-element' expecting {'config', 'description', 'if-feature',"
+ " 'max-elements', 'min-elements', 'must', 'ordered-by', 'reference', 'status', 'type', 'units',"
+ " 'when', '}'}");
YangNode node = manager.getDataModel("src/test/resources/MinElementsInvalidKeyword.yang");
}
/**
* Checks whether exception is thrown when invalid min-elements value is
* given as input.
*/
......
......@@ -145,19 +145,6 @@ public class StatusListenerTest {
}
/**
* Checks status statement as sub-statement of module.
*/
@Test
public void processModuleSubStatementStatus() throws IOException, ParserException {
thrown.expect(ParserException.class);
thrown.expectMessage("mismatched input 'status' expecting {'anyxml', 'augment', 'choice', 'contact', "
+ "'container', 'description', 'extension', 'deviation', 'feature', 'grouping', 'identity', 'import',"
+ " 'include', 'leaf', 'leaf-list', 'list', 'notification', 'organization', 'reference', "
+ "'revision', 'rpc', 'typedef', 'uses', '}'}");
YangNode node = manager.getDataModel("src/test/resources/ModuleSubStatementStatus.yang");
}
/**
* Checks status statement as sub-statement of container.
*/
@Test
......
......@@ -138,4 +138,12 @@ public class UnionListenerTest {
YangNode node = manager.getDataModel("src/test/resources/UnionWithEmptyType.yang");
}
/**
* Checks whether type union has atleast one type statement.
*/
@Test (expected = ParserException.class)
public void processUnionWithoutChild() throws IOException, ParserException {
manager.getDataModel("src/test/resources/UnionWithoutChild.yang");
}
}
......
......@@ -71,19 +71,6 @@ public class UnitsListenerTest {
}
/**
* Checks invalid units statement as sub-statement of module.
*/
@Test
public void processModuleSubStatementUnits() throws IOException, ParserException {
thrown.expect(ParserException.class);
thrown.expectMessage("mismatched input 'type' expecting {'anyxml', 'augment', 'choice', 'contact', "
+ "'container', 'description', 'extension', 'deviation', 'feature', 'grouping', 'identity',"
+ " 'import', 'include', 'leaf', 'leaf-list', 'list', 'notification', 'organization', "
+ "'reference', 'revision', 'rpc', 'typedef', 'uses', '}'}");
YangNode node = manager.getDataModel("src/test/resources/ModuleSubStatementUnits.yang");
}
/**
* Checks invalid units statement(without statement end).
*/
@Test
......
module Test {
yang-version 1;
namespace http://huawei.com;
prefix Ant;
leafs invalid-interval {
type "uint16";
units "seconds";
description "Interval before a route is declared invalid";
config true;
mandatory true;
status current;
reference "RFC 6020";
}
}
\ No newline at end of file
module Test {
yang-version 1;
namespace http://huawei.com;
prefix Ant;
leaf-list invalid-interval {
type "uint16";
units "seconds";
max-element 3;
description "Interval before a route is declared invalid;
config true;
status current;
reference "RFC 6020";
}
}
module Test {
yang-version 1;
namespace http://huawei.com;
prefix Ant;
leaf-list invalid-interval {
type "uint16";
units "seconds";
min-element 3;
description "Interval before a route is declared invalid";
config true;
status current;
reference "RFC 6020";
}
}
\ No newline at end of file
module Test {
yang-version 1;
namespace http://huawei.com;
prefix Ant;
mandatory false;
}
\ No newline at end of file
module Test {
yang-version 1;
namespace http://huawei.com;
prefix Ant;
status current;
}
\ No newline at end of file
module Test {
yang-version 1;
namespace http://huawei.com;
prefix Ant;
type "uint16";
units "seconds";
}
\ No newline at end of file
......@@ -2,5 +2,13 @@ module Test {
yang-version 1;
namespace http://huawei.com;
prefix Ant;
config invalid;
}
\ No newline at end of file
list valid {
key "invalid-interval";
leaf invalid-interval {
type union {
type "union";
}
}
}
}
......