Committed by
Thomas Vachuska
[ONOS-3878] YANG Listeners methods for Module and SubModule
Change-Id: Ied2fcf631d302b26ef84af8e98895d8ccb6d6269
Showing
13 changed files
with
997 additions
and
0 deletions
utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BaseFileListener.java
0 → 100644
1 | +/* | ||
2 | + * Copyright 2016 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | + | ||
17 | +package org.onosproject.yangutils.parser.impl.listeners; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; | ||
20 | +import org.onosproject.yangutils.parser.impl.TreeWalkListener; | ||
21 | + | ||
22 | +/* | ||
23 | + * Reference: RFC6020 and YANG ANTLR Grammar | ||
24 | + * | ||
25 | + * ANTLR grammar rule | ||
26 | + * yangfile : module_stmt | ||
27 | + * | submodule_stmt; | ||
28 | + */ | ||
29 | + | ||
30 | +/** | ||
31 | + * Implements call back function corresponding to the "base rule" defined in | ||
32 | + * ANTLR grammar file. | ||
33 | + */ | ||
34 | +public final class BaseFileListener { | ||
35 | + | ||
36 | + /** | ||
37 | + * Creates a new base listener. | ||
38 | + */ | ||
39 | + private BaseFileListener() { | ||
40 | + } | ||
41 | + | ||
42 | + /** | ||
43 | + * It is called when parser receives an input matching the grammar | ||
44 | + * rule (yangfile), perform validations and update the data model | ||
45 | + * tree. | ||
46 | + * | ||
47 | + * @param listener Listener's object. | ||
48 | + * @param ctx context object of the grammar rule. | ||
49 | + */ | ||
50 | + public static void processYangFileEntry(TreeWalkListener listener, GeneratedYangParser.YangfileContext ctx) { | ||
51 | + // TODO method implementation | ||
52 | + } | ||
53 | + | ||
54 | + /** | ||
55 | + * It is called when parser exits from grammar rule (yangfile), it perform | ||
56 | + * validations and update the data model tree. | ||
57 | + * | ||
58 | + * @param listener Listener's object. | ||
59 | + * @param ctx context object of the grammar rule. | ||
60 | + */ | ||
61 | + public static void processYangFileExit(TreeWalkListener listener, GeneratedYangParser.YangfileContext ctx) { | ||
62 | + // TODO method implementation | ||
63 | + } | ||
64 | +} |
utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/BelongsToListener.java
0 → 100644
1 | +/* | ||
2 | + * Copyright 2016 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | + | ||
17 | +package org.onosproject.yangutils.parser.impl.listeners; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; | ||
20 | +import org.onosproject.yangutils.parser.impl.TreeWalkListener; | ||
21 | + | ||
22 | +/* | ||
23 | + * Reference: RFC6020 and YANG ANTLR Grammar | ||
24 | + * | ||
25 | + * ABNF grammar as per RFC6020 | ||
26 | + * submodule-header-stmts = | ||
27 | + * ;; these stmts can appear in any order | ||
28 | + * [yang-version-stmt stmtsep] | ||
29 | + * belongs-to-stmt stmtsep | ||
30 | + * | ||
31 | + * belongs-to-stmt = belongs-to-keyword sep identifier-arg-str | ||
32 | + * optsep | ||
33 | + * "{" stmtsep | ||
34 | + * prefix-stmt stmtsep | ||
35 | + * "}" | ||
36 | + * | ||
37 | + * ANTLR grammar rule | ||
38 | + * submodule_header_statement : yang_version_stmt? belongs_to_stmt | ||
39 | + * | belongs_to_stmt yang_version_stmt? | ||
40 | + * ; | ||
41 | + * belongs_to_stmt : BELONGS_TO_KEYWORD IDENTIFIER LEFT_CURLY_BRACE belongs_to_stmt_body RIGHT_CURLY_BRACE; | ||
42 | + * belongs_to_stmt_body : prefix_stmt; | ||
43 | + */ | ||
44 | + | ||
45 | +/** | ||
46 | + * Implements listener based call back function corresponding to the "belongs to" | ||
47 | + * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020. | ||
48 | + */ | ||
49 | +public final class BelongsToListener { | ||
50 | + | ||
51 | + /** | ||
52 | + * Creates a new belongto listener. | ||
53 | + */ | ||
54 | + private BelongsToListener() { | ||
55 | + } | ||
56 | + | ||
57 | + /** | ||
58 | + * It is called when parser receives an input matching the grammar | ||
59 | + * rule (belongsto), perform validations and update the data model | ||
60 | + * tree. | ||
61 | + * | ||
62 | + * @param listener Listener's object. | ||
63 | + * @param ctx context object of the grammar rule. | ||
64 | + */ | ||
65 | + public static void processBelongsToEntry(TreeWalkListener listener, | ||
66 | + GeneratedYangParser.BelongstoStatementContext ctx) { | ||
67 | + // TODO method implementation | ||
68 | + } | ||
69 | + | ||
70 | + /** | ||
71 | + * It is called when parser exits from grammar rule (belongsto), it perform | ||
72 | + * validations and update the data model tree. | ||
73 | + * | ||
74 | + * @param listener Listener's object. | ||
75 | + * @param ctx context object of the grammar rule. | ||
76 | + */ | ||
77 | + public static void processBelongsToExit(TreeWalkListener listener, | ||
78 | + GeneratedYangParser.BelongstoStatementContext ctx) { | ||
79 | + // TODO method implementation | ||
80 | + } | ||
81 | +} |
utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ContactListener.java
0 → 100644
1 | +/* | ||
2 | + * Copyright 2016 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | + | ||
17 | +package org.onosproject.yangutils.parser.impl.listeners; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; | ||
20 | +import org.onosproject.yangutils.parser.impl.TreeWalkListener; | ||
21 | + | ||
22 | +/* | ||
23 | + * Reference: RFC6020 and YANG ANTLR Grammar | ||
24 | + * | ||
25 | + * ABNF grammar as per RFC6020 | ||
26 | + * meta-stmts = ;; these stmts can appear in any order | ||
27 | + * [organization-stmt stmtsep] | ||
28 | + * [contact-stmt stmtsep] | ||
29 | + * [description-stmt stmtsep] | ||
30 | + * [reference-stmt stmtsep] | ||
31 | + * organization-stmt = organization-keyword sep string | ||
32 | + * optsep stmtend | ||
33 | + * | ||
34 | + * ANTLR grammar rule | ||
35 | + * meta_stmts : organization_stmt? contact_stmt? description_stmt? reference_stmt? | ||
36 | + * | organization_stmt? contact_stmt? reference_stmt? description_stmt? | ||
37 | + * | organization_stmt? description_stmt? contact_stmt? reference_stmt? | ||
38 | + * | organization_stmt? description_stmt? reference_stmt? contact_stmt? | ||
39 | + * | organization_stmt? reference_stmt? contact_stmt? description_stmt? | ||
40 | + * | organization_stmt? reference_stmt? description_stmt? contact_stmt? | ||
41 | + * | contact_stmt? organization_stmt? description_stmt? reference_stmt? | ||
42 | + * | contact_stmt? organization_stmt? reference_stmt? description_stmt? | ||
43 | + * | contact_stmt? reference_stmt? organization_stmt? description_stmt? | ||
44 | + * | contact_stmt? reference_stmt? description_stmt? organization_stmt? | ||
45 | + * | contact_stmt? description_stmt? reference_stmt? organization_stmt? | ||
46 | + * | contact_stmt? description_stmt? organization_stmt? reference_stmt? | ||
47 | + * | reference_stmt? contact_stmt? organization_stmt? description_stmt? | ||
48 | + * | reference_stmt? contact_stmt? description_stmt? organization_stmt? | ||
49 | + * | reference_stmt? organization_stmt? contact_stmt? description_stmt? | ||
50 | + * | reference_stmt? organization_stmt? description_stmt? contact_stmt? | ||
51 | + * | reference_stmt? description_stmt? organization_stmt? contact_stmt? | ||
52 | + * | reference_stmt? description_stmt? contact_stmt? organization_stmt? | ||
53 | + * | description_stmt? reference_stmt? contact_stmt? organization_stmt? | ||
54 | + * | description_stmt? reference_stmt? organization_stmt? contact_stmt? | ||
55 | + * | description_stmt? contact_stmt? reference_stmt? organization_stmt? | ||
56 | + * | description_stmt? contact_stmt? organization_stmt? reference_stmt? | ||
57 | + * | description_stmt? organization_stmt? contact_stmt? reference_stmt? | ||
58 | + * | description_stmt? organization_stmt? reference_stmt? contact_stmt? | ||
59 | + * ; | ||
60 | + * organization_stmt : ORGANIZATION_KEYWORD string STMTEND; | ||
61 | + */ | ||
62 | + | ||
63 | +/** | ||
64 | + * Implements listener based call back function corresponding to the "contact" | ||
65 | + * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020. | ||
66 | + */ | ||
67 | +public final class ContactListener { | ||
68 | + | ||
69 | + /** | ||
70 | + * Creates a new contact listener. | ||
71 | + */ | ||
72 | + private ContactListener() { | ||
73 | + } | ||
74 | + | ||
75 | + /** | ||
76 | + * It is called when parser receives an input matching the grammar | ||
77 | + * rule (contact), perform validations and update the data model | ||
78 | + * tree. | ||
79 | + * | ||
80 | + * @param listener Listener's object. | ||
81 | + * @param ctx context object of the grammar rule. | ||
82 | + */ | ||
83 | + public static void processContactEntry(TreeWalkListener listener, GeneratedYangParser.ContactStatementContext ctx) { | ||
84 | + // TODO method implementation | ||
85 | + } | ||
86 | +} |
utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ImportListener.java
0 → 100644
1 | +/* | ||
2 | + * Copyright 2016 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | + | ||
17 | +package org.onosproject.yangutils.parser.impl.listeners; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; | ||
20 | +import org.onosproject.yangutils.parser.impl.TreeWalkListener; | ||
21 | + | ||
22 | +/* | ||
23 | + * Reference: RFC6020 and YANG ANTLR Grammar | ||
24 | + * | ||
25 | + * ABNF grammar as per RFC6020 | ||
26 | + * linkage-stmts = ;; these stmts can appear in any order | ||
27 | + * *(import-stmt stmtsep) | ||
28 | + * *(include-stmt stmtsep) | ||
29 | + * | ||
30 | + * import-stmt = import-keyword sep identifier-arg-str optsep | ||
31 | + * "{" stmtsep | ||
32 | + * prefix-stmt stmtsep | ||
33 | + * [revision-date-stmt stmtsep] | ||
34 | + * "}" | ||
35 | + * | ||
36 | + * ANTLR grammar rule | ||
37 | + * linkage_stmts : (import_stmt | ||
38 | + * | include_stmt)*; | ||
39 | + * import_stmt : IMPORT_KEYWORD IDENTIFIER LEFT_CURLY_BRACE import_stmt_body | ||
40 | + * RIGHT_CURLY_BRACE; | ||
41 | + * import_stmt_body : prefix_stmt revision_date_stmt?; | ||
42 | + */ | ||
43 | + | ||
44 | +/** | ||
45 | + * Implements listener based call back function corresponding to the "import" | ||
46 | + * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020. | ||
47 | + */ | ||
48 | +public final class ImportListener { | ||
49 | + | ||
50 | + /** | ||
51 | + * Creates a new import listener. | ||
52 | + */ | ||
53 | + private ImportListener() { | ||
54 | + } | ||
55 | + | ||
56 | + /** | ||
57 | + * It is called when parser receives an input matching the grammar | ||
58 | + * rule (import), perform validations and update the data model | ||
59 | + * tree. | ||
60 | + * | ||
61 | + * @param listener Listener's object. | ||
62 | + * @param ctx context object of the grammar rule. | ||
63 | + */ | ||
64 | + public static void processImportEntry(TreeWalkListener listener, GeneratedYangParser.ImportStatementContext ctx) { | ||
65 | + // TODO method implementation | ||
66 | + } | ||
67 | + | ||
68 | + /** | ||
69 | + * It is called when parser exits from grammar rule (import), it perform | ||
70 | + * validations and update the data model tree. | ||
71 | + * | ||
72 | + * @param listener Listener's object. | ||
73 | + * @param ctx context object of the grammar rule. | ||
74 | + */ | ||
75 | + public static void processImportExit(TreeWalkListener listener, GeneratedYangParser.ImportStatementContext ctx) { | ||
76 | + // TODO method implementation | ||
77 | + } | ||
78 | +} |
utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/IncludeListener.java
0 → 100644
1 | +/* | ||
2 | + * Copyright 2016 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | + | ||
17 | +package org.onosproject.yangutils.parser.impl.listeners; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; | ||
20 | +import org.onosproject.yangutils.parser.impl.TreeWalkListener; | ||
21 | + | ||
22 | +/* | ||
23 | + * Reference: RFC6020 and YANG ANTLR Grammar | ||
24 | + * | ||
25 | + * ABNF grammar as per RFC6020 | ||
26 | + * linkage-stmts = ;; these stmts can appear in any order | ||
27 | + * *(import-stmt stmtsep) | ||
28 | + * *(include-stmt stmtsep) | ||
29 | + * | ||
30 | + * include-stmt = include-keyword sep identifier-arg-str optsep | ||
31 | + * (";" / | ||
32 | + * "{" stmtsep | ||
33 | + * [revision-date-stmt stmtsep] | ||
34 | + * "}") | ||
35 | + * | ||
36 | + * ANTLR grammar rule | ||
37 | + * linkage_stmts : (import_stmt | ||
38 | + * | include_stmt)*; | ||
39 | + * include_stmt : INCLUDE_KEYWORD IDENTIFIER (STMTEND | LEFT_CURLY_BRACE | ||
40 | + * revision_date_stmt_body? RIGHT_CURLY_BRACE); | ||
41 | + */ | ||
42 | + | ||
43 | +/** | ||
44 | + * Implements listener based call back function corresponding to the "include" | ||
45 | + * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020. | ||
46 | + */ | ||
47 | +public final class IncludeListener { | ||
48 | + | ||
49 | + /** | ||
50 | + * Creates a new include listener. | ||
51 | + */ | ||
52 | + private IncludeListener() { | ||
53 | + } | ||
54 | + | ||
55 | + /** | ||
56 | + * It is called when parser receives an input matching the grammar | ||
57 | + * rule (include), perform validations and update the data model | ||
58 | + * tree. | ||
59 | + * | ||
60 | + * @param listener Listener's object. | ||
61 | + * @param ctx context object of the grammar rule. | ||
62 | + */ | ||
63 | + public static void processIncludeEntry(TreeWalkListener listener, GeneratedYangParser.IncludeStatementContext ctx) { | ||
64 | + // TODO method implementation | ||
65 | + } | ||
66 | + | ||
67 | + /** | ||
68 | + * It is called when parser exits from grammar rule (include), it perform | ||
69 | + * validations and update the data model tree. | ||
70 | + * | ||
71 | + * @param listener Listener's object. | ||
72 | + * @param ctx context object of the grammar rule. | ||
73 | + */ | ||
74 | + public static void processIncludeExit(TreeWalkListener listener, GeneratedYangParser.IncludeStatementContext ctx) { | ||
75 | + // TODO method implementation | ||
76 | + } | ||
77 | +} |
utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/ModuleListener.java
0 → 100644
1 | +/* | ||
2 | + * Copyright 2016 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | + | ||
17 | +package org.onosproject.yangutils.parser.impl.listeners; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; | ||
20 | +import org.onosproject.yangutils.parser.impl.TreeWalkListener; | ||
21 | + | ||
22 | +/* | ||
23 | + * Reference: RFC6020 and YANG ANTLR Grammar | ||
24 | + * | ||
25 | + * ABNF grammar as per RFC6020 | ||
26 | + * module-stmt = optsep module-keyword sep identifier-arg-str | ||
27 | + * optsep | ||
28 | + * "{" stmtsep | ||
29 | + * module-header-stmts | ||
30 | + * linkage-stmts | ||
31 | + * meta-stmts | ||
32 | + * revision-stmts | ||
33 | + * body-stmts | ||
34 | + * "}" optsep | ||
35 | + * | ||
36 | + * ANTLR grammar rule | ||
37 | + * module_stmt : MODULE_KEYWORD IDENTIFIER LEFT_CURLY_BRACE module_body* RIGHT_CURLY_BRACE; | ||
38 | + */ | ||
39 | + | ||
40 | +/** | ||
41 | + * Implements listener based call back function corresponding to the "module" | ||
42 | + * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020. | ||
43 | + */ | ||
44 | +public final class ModuleListener { | ||
45 | + | ||
46 | + /** | ||
47 | + * Creates a new module listener. | ||
48 | + */ | ||
49 | + private ModuleListener() { | ||
50 | + } | ||
51 | + | ||
52 | + /** | ||
53 | + * It is called when parser receives an input matching the grammar | ||
54 | + * rule (module), perform validations and update the data model | ||
55 | + * tree. | ||
56 | + * | ||
57 | + * @param listener Listener's object. | ||
58 | + * @param ctx context object of the grammar rule. | ||
59 | + */ | ||
60 | + public static void processModuleEntry(TreeWalkListener listener, GeneratedYangParser.ModuleStatementContext ctx) { | ||
61 | + // TODO method implementation | ||
62 | + } | ||
63 | + | ||
64 | + /** | ||
65 | + * It is called when parser exits from grammar rule (module), it perform | ||
66 | + * validations and update the data model tree. | ||
67 | + * | ||
68 | + * @param listener Listener's object. | ||
69 | + * @param ctx context object of the grammar rule. | ||
70 | + */ | ||
71 | + public static void processModuleExit(TreeWalkListener listener, GeneratedYangParser.ModuleStatementContext ctx) { | ||
72 | + // TODO method implementation | ||
73 | + } | ||
74 | +} |
utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/NamespaceListener.java
0 → 100644
1 | +/* | ||
2 | + * Copyright 2016 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | + | ||
17 | +package org.onosproject.yangutils.parser.impl.listeners; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; | ||
20 | +import org.onosproject.yangutils.parser.impl.TreeWalkListener; | ||
21 | + | ||
22 | +/* | ||
23 | + * Reference: RFC6020 and YANG ANTLR Grammar | ||
24 | + * | ||
25 | + * ABNF grammar as per RFC6020 | ||
26 | + * module-header-stmts = ;; these stmts can appear in any order | ||
27 | + * [yang-version-stmt stmtsep] | ||
28 | + * namespace-stmt stmtsep | ||
29 | + * prefix-stmt stmtsep | ||
30 | + * | ||
31 | + * namespace-stmt = namespace-keyword sep uri-str optsep stmtend | ||
32 | + * | ||
33 | + * ANTLR grammar rule | ||
34 | + * module_header_statement : yang_version_stmt? namespace_stmt prefix_stmt | ||
35 | + * | yang_version_stmt? prefix_stmt namespace_stmt | ||
36 | + * | namespace_stmt yang_version_stmt? prefix_stmt | ||
37 | + * | namespace_stmt prefix_stmt yang_version_stmt? | ||
38 | + * | prefix_stmt namespace_stmt yang_version_stmt? | ||
39 | + * | prefix_stmt yang_version_stmt? namespace_stmt | ||
40 | + * ; | ||
41 | + * namespace_stmt : NAMESPACE_KEYWORD string STMTEND; | ||
42 | + */ | ||
43 | + | ||
44 | +/** | ||
45 | + * Implements listener based call back function corresponding to the "namespace" | ||
46 | + * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020. | ||
47 | + */ | ||
48 | +public final class NamespaceListener { | ||
49 | + | ||
50 | + /** | ||
51 | + * Creates a new namespace listener. | ||
52 | + */ | ||
53 | + private NamespaceListener() { | ||
54 | + } | ||
55 | + | ||
56 | + /** | ||
57 | + * It is called when parser receives an input matching the grammar | ||
58 | + * rule (namespace), perform validations and update the data model | ||
59 | + * tree. | ||
60 | + * | ||
61 | + * @param listener Listener's object. | ||
62 | + * @param ctx context object of the grammar rule. | ||
63 | + */ | ||
64 | + public static void processNamespaceEntry(TreeWalkListener listener, | ||
65 | + GeneratedYangParser.NamespaceStatementContext ctx) { | ||
66 | + // TODO method implementation | ||
67 | + } | ||
68 | +} |
1 | +/* | ||
2 | + * Copyright 2016 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | + | ||
17 | +package org.onosproject.yangutils.parser.impl.listeners; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; | ||
20 | +import org.onosproject.yangutils.parser.impl.TreeWalkListener; | ||
21 | + | ||
22 | +/* | ||
23 | + * Reference: RFC6020 and YANG ANTLR Grammar | ||
24 | + * | ||
25 | + * ABNF grammar as per RFC6020 | ||
26 | + * meta-stmts = ;; these stmts can appear in any order | ||
27 | + * [organization-stmt stmtsep] | ||
28 | + * [contact-stmt stmtsep] | ||
29 | + * [description-stmt stmtsep] | ||
30 | + * [reference-stmt stmtsep] | ||
31 | + * contact-stmt = contact-keyword sep string optsep stmtend | ||
32 | + * | ||
33 | + * ANTLR grammar rule | ||
34 | + * meta_stmts : organization_stmt? contact_stmt? description_stmt? reference_stmt? | ||
35 | + * | organization_stmt? contact_stmt? reference_stmt? description_stmt? | ||
36 | + * | organization_stmt? description_stmt? contact_stmt? reference_stmt? | ||
37 | + * | organization_stmt? description_stmt? reference_stmt? contact_stmt? | ||
38 | + * | organization_stmt? reference_stmt? contact_stmt? description_stmt? | ||
39 | + * | organization_stmt? reference_stmt? description_stmt? contact_stmt? | ||
40 | + * | contact_stmt? organization_stmt? description_stmt? reference_stmt? | ||
41 | + * | contact_stmt? organization_stmt? reference_stmt? description_stmt? | ||
42 | + * | contact_stmt? reference_stmt? organization_stmt? description_stmt? | ||
43 | + * | contact_stmt? reference_stmt? description_stmt? organization_stmt? | ||
44 | + * | contact_stmt? description_stmt? reference_stmt? organization_stmt? | ||
45 | + * | contact_stmt? description_stmt? organization_stmt? reference_stmt? | ||
46 | + * | reference_stmt? contact_stmt? organization_stmt? description_stmt? | ||
47 | + * | reference_stmt? contact_stmt? description_stmt? organization_stmt? | ||
48 | + * | reference_stmt? organization_stmt? contact_stmt? description_stmt? | ||
49 | + * | reference_stmt? organization_stmt? description_stmt? contact_stmt? | ||
50 | + * | reference_stmt? description_stmt? organization_stmt? contact_stmt? | ||
51 | + * | reference_stmt? description_stmt? contact_stmt? organization_stmt? | ||
52 | + * | description_stmt? reference_stmt? contact_stmt? organization_stmt? | ||
53 | + * | description_stmt? reference_stmt? organization_stmt? contact_stmt? | ||
54 | + * | description_stmt? contact_stmt? reference_stmt? organization_stmt? | ||
55 | + * | description_stmt? contact_stmt? organization_stmt? reference_stmt? | ||
56 | + * | description_stmt? organization_stmt? contact_stmt? reference_stmt? | ||
57 | + * | description_stmt? organization_stmt? reference_stmt? contact_stmt? | ||
58 | + * ; | ||
59 | + * contact_stmt : CONTACT_KEYWORD string STMTEND; | ||
60 | + */ | ||
61 | + | ||
62 | +/** | ||
63 | + * Implements listener based call back function corresponding to the "organization" | ||
64 | + * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020. | ||
65 | + */ | ||
66 | +public final class OrganizationListener { | ||
67 | + | ||
68 | + /** | ||
69 | + * Creates a new organization listener. | ||
70 | + */ | ||
71 | + private OrganizationListener() { | ||
72 | + } | ||
73 | + | ||
74 | + /** | ||
75 | + * It is called when parser receives an input matching the grammar | ||
76 | + * rule (organization), perform validations and update the data model | ||
77 | + * tree. | ||
78 | + * | ||
79 | + * @param listener Listener's object. | ||
80 | + * @param ctx context object of the grammar rule. | ||
81 | + */ | ||
82 | + public static void processOrganizationEntry(TreeWalkListener listener, | ||
83 | + GeneratedYangParser.OrganizationStatementContext ctx) { | ||
84 | + // TODO method implementation | ||
85 | + } | ||
86 | +} |
utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/PrefixListener.java
0 → 100644
1 | +/* | ||
2 | + * Copyright 2016 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | + | ||
17 | +package org.onosproject.yangutils.parser.impl.listeners; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; | ||
20 | +import org.onosproject.yangutils.parser.impl.TreeWalkListener; | ||
21 | + | ||
22 | +/* | ||
23 | + * Reference: RFC6020 and YANG ANTLR Grammar | ||
24 | + * | ||
25 | + * ABNF grammar as per RFC6020 | ||
26 | + * module-header-stmts = ;; these stmts can appear in any order | ||
27 | + * [yang-version-stmt stmtsep] | ||
28 | + * namespace-stmt stmtsep | ||
29 | + * prefix-stmt stmtsep | ||
30 | + * | ||
31 | + * prefix-stmt = prefix-keyword sep prefix-arg-str | ||
32 | + * optsep stmtend | ||
33 | + * | ||
34 | + * ANTLR grammar rule | ||
35 | + * module_header_statement : yang_version_stmt? namespace_stmt prefix_stmt | ||
36 | + * | yang_version_stmt? prefix_stmt namespace_stmt | ||
37 | + * | namespace_stmt yang_version_stmt? prefix_stmt | ||
38 | + * | namespace_stmt prefix_stmt yang_version_stmt? | ||
39 | + * | prefix_stmt namespace_stmt yang_version_stmt? | ||
40 | + * | prefix_stmt yang_version_stmt? namespace_stmt | ||
41 | + * ; | ||
42 | + * prefix_stmt : PREFIX_KEYWORD IDENTIFIER STMTEND; | ||
43 | + */ | ||
44 | + | ||
45 | +/** | ||
46 | + * Implements listener based call back function corresponding to the "prefix" | ||
47 | + * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020. | ||
48 | + */ | ||
49 | +public final class PrefixListener { | ||
50 | + | ||
51 | + /** | ||
52 | + * Creates a new prefix listener. | ||
53 | + */ | ||
54 | + private PrefixListener() { | ||
55 | + } | ||
56 | + | ||
57 | + /** | ||
58 | + * It is called when parser receives an input matching the grammar | ||
59 | + * rule (prefix),perform validations and update the data model | ||
60 | + * tree. | ||
61 | + * | ||
62 | + * @param listener Listener's object. | ||
63 | + * @param ctx context object of the grammar rule. | ||
64 | + */ | ||
65 | + public static void processPrefixEntry(TreeWalkListener listener, GeneratedYangParser.PrefixStatementContext ctx) { | ||
66 | + // TODO method implementation | ||
67 | + } | ||
68 | +} |
1 | +/* | ||
2 | + * Copyright 2016 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | + | ||
17 | +package org.onosproject.yangutils.parser.impl.listeners; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; | ||
20 | +import org.onosproject.yangutils.parser.impl.TreeWalkListener; | ||
21 | + | ||
22 | +/* | ||
23 | + * Reference: RFC6020 and YANG ANTLR Grammar | ||
24 | + * | ||
25 | + * ABNF grammar as per RFC6020 | ||
26 | + * import-stmt = import-keyword sep identifier-arg-str optsep | ||
27 | + * "{" stmtsep | ||
28 | + * prefix-stmt stmtsep | ||
29 | + * [revision-date-stmt stmtsep] | ||
30 | + * "}" | ||
31 | + * include-stmt = include-keyword sep identifier-arg-str optsep | ||
32 | + * (";" / | ||
33 | + * "{" stmtsep | ||
34 | + * [revision-date-stmt stmtsep] | ||
35 | + * "}") | ||
36 | + * revision-date-stmt = revision-date-keyword sep revision-date stmtend | ||
37 | + * | ||
38 | + * ANTLR grammar rule | ||
39 | + * import_stmt : IMPORT_KEYWORD IDENTIFIER LEFT_CURLY_BRACE import_stmt_body | ||
40 | + * RIGHT_CURLY_BRACE; | ||
41 | + * import_stmt_body : prefix_stmt revision_date_stmt?; | ||
42 | + * | ||
43 | + * include_stmt : INCLUDE_KEYWORD IDENTIFIER (STMTEND | LEFT_CURLY_BRACE | ||
44 | + * revision_date_stmt_body? RIGHT_CURLY_BRACE); | ||
45 | + * | ||
46 | + * revision_date_stmt : REVISION_DATE_KEYWORD DATE_ARG STMTEND; | ||
47 | + * | ||
48 | + */ | ||
49 | + | ||
50 | +/** | ||
51 | + * Implements listener based call back function corresponding to the "revision date" | ||
52 | + * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020. | ||
53 | + */ | ||
54 | +public final class RevisionDateListener { | ||
55 | + | ||
56 | + /** | ||
57 | + * Creates a new revision date listener. | ||
58 | + */ | ||
59 | + private RevisionDateListener() { | ||
60 | + } | ||
61 | + | ||
62 | + /** | ||
63 | + * It is called when parser receives an input matching the grammar | ||
64 | + * rule (revision date),perform validations and update the data model | ||
65 | + * tree. | ||
66 | + * | ||
67 | + * @param listener Listener's object. | ||
68 | + * @param ctx context object of the grammar rule. | ||
69 | + */ | ||
70 | + public static void processRevisionDateEntry(TreeWalkListener listener, | ||
71 | + GeneratedYangParser.RevisionDateStatementContext ctx) { | ||
72 | + // TODO method implementation | ||
73 | + } | ||
74 | +} |
utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RevisionListener.java
0 → 100644
1 | +/* | ||
2 | + * Copyright 2016 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | + | ||
17 | +package org.onosproject.yangutils.parser.impl.listeners; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; | ||
20 | +import org.onosproject.yangutils.parser.impl.TreeWalkListener; | ||
21 | + | ||
22 | +/* | ||
23 | + * Reference: RFC6020 and YANG ANTLR Grammar | ||
24 | + * | ||
25 | + * ABNF grammar as per RFC6020 | ||
26 | + * module-stmt = optsep module-keyword sep identifier-arg-str | ||
27 | + * optsep | ||
28 | + * "{" stmtsep | ||
29 | + * module-header-stmts | ||
30 | + * linkage-stmts | ||
31 | + * meta-stmts | ||
32 | + * revision-stmts | ||
33 | + * body-stmts | ||
34 | + * "}" optsep | ||
35 | + * | ||
36 | + * revision-stmt = revision-keyword sep revision-date optsep | ||
37 | + * (";" / | ||
38 | + * "{" stmtsep | ||
39 | + * [description-stmt stmtsep] | ||
40 | + * [reference-stmt stmtsep] | ||
41 | + * "}") | ||
42 | + * | ||
43 | + * ANTLR grammar rule | ||
44 | + * module_stmt : MODULE_KEYWORD IDENTIFIER LEFT_CURLY_BRACE module_body* RIGHT_CURLY_BRACE; | ||
45 | + * | ||
46 | + * revision_stmt : REVISION_KEYWORD DATE_ARG (STMTEND | LEFT_CURLY_BRACE revision_stmt_body RIGHT_CURLY_BRACE); | ||
47 | + * revision_stmt_body : description_stmt? reference_stmt?; | ||
48 | + */ | ||
49 | + | ||
50 | +/** | ||
51 | + * Implements listener based call back function corresponding to the "revision" | ||
52 | + * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020. | ||
53 | + */ | ||
54 | +public final class RevisionListener { | ||
55 | + | ||
56 | + /** | ||
57 | + * Creates a new revision listener. | ||
58 | + */ | ||
59 | + private RevisionListener() { | ||
60 | + } | ||
61 | + | ||
62 | + /** | ||
63 | + * It is called when parser receives an input matching the grammar | ||
64 | + * rule (revision), perform validations and update the data model | ||
65 | + * tree. | ||
66 | + * | ||
67 | + * @param listener Listener's object. | ||
68 | + * @param ctx context object of the grammar rule. | ||
69 | + */ | ||
70 | + public static void processRevisionEntry(TreeWalkListener listener, GeneratedYangParser.RevisionStatementContext | ||
71 | + ctx) { | ||
72 | + // TODO method implementation | ||
73 | + } | ||
74 | + | ||
75 | + /** | ||
76 | + * It is called when parser exits from grammar rule (revision), it perform | ||
77 | + * validations and update the data model tree. | ||
78 | + * | ||
79 | + * @param listener Listener's object. | ||
80 | + * @param ctx context object of the grammar rule. | ||
81 | + */ | ||
82 | + public static void processRevisionExit(TreeWalkListener listener, GeneratedYangParser.RevisionStatementContext | ||
83 | + ctx) { | ||
84 | + // TODO method implementation | ||
85 | + } | ||
86 | +} |
utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/SubModuleListener.java
0 → 100644
1 | +/* | ||
2 | + * Copyright 2016 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | + | ||
17 | +package org.onosproject.yangutils.parser.impl.listeners; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; | ||
20 | +import org.onosproject.yangutils.parser.impl.TreeWalkListener; | ||
21 | + | ||
22 | +/* | ||
23 | + * Reference: RFC6020 and YANG ANTLR Grammar | ||
24 | + * | ||
25 | + * ABNF grammar as per RFC6020 | ||
26 | + * submodule-stmt = optsep submodule-keyword sep identifier-arg-str | ||
27 | + * optsep | ||
28 | + * "{" stmtsep | ||
29 | + * submodule-header-stmts | ||
30 | + * linkage-stmts | ||
31 | + * meta-stmts | ||
32 | + * revision-stmts | ||
33 | + * body-stmts | ||
34 | + * "}" optsep | ||
35 | + * | ||
36 | + * ANTLR grammar rule | ||
37 | + * submodule_stmt : SUBMODULE_KEYWORD IDENTIFIER LEFT_CURLY_BRACE submodule_body* RIGHT_CURLY_BRACE; | ||
38 | + * submodule_body : submodule_header_statement linkage_stmts meta_stmts revision_stmts body_stmts; | ||
39 | + */ | ||
40 | + | ||
41 | +/** | ||
42 | + * Implements listener based call back function corresponding to the "submodule" | ||
43 | + * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020. | ||
44 | + */ | ||
45 | +public final class SubModuleListener { | ||
46 | + | ||
47 | + /** | ||
48 | + * Creates a new sub module listener. | ||
49 | + */ | ||
50 | + private SubModuleListener() { | ||
51 | + } | ||
52 | + | ||
53 | + /** | ||
54 | + * It is called when parser receives an input matching the grammar | ||
55 | + * rule (sub module), perform validations and update the data model | ||
56 | + * tree. | ||
57 | + * | ||
58 | + * @param listener Listener's object. | ||
59 | + * @param ctx context object of the grammar rule. | ||
60 | + */ | ||
61 | + public static void processSubModuleEntry(TreeWalkListener listener, | ||
62 | + GeneratedYangParser.SubModuleStatementContext ctx) { | ||
63 | + // TODO method implementation | ||
64 | + } | ||
65 | + | ||
66 | + /** | ||
67 | + * It is called when parser exits from grammar rule (submodule), it perform | ||
68 | + * validations and update the data model tree. | ||
69 | + * | ||
70 | + * @param listener Listener's object. | ||
71 | + * @param ctx context object of the grammar rule. | ||
72 | + */ | ||
73 | + public static void processSubModuleExit(TreeWalkListener listener, | ||
74 | + GeneratedYangParser.SubModuleStatementContext ctx) { | ||
75 | + // TODO method implementation | ||
76 | + } | ||
77 | +} |
utils/yangutils/src/main/java/org/onosproject/yangutils/parser/impl/listeners/VersionListener.java
0 → 100644
1 | +/* | ||
2 | + * Copyright 2016 Open Networking Laboratory | ||
3 | + * | ||
4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | + * you may not use this file except in compliance with the License. | ||
6 | + * You may obtain a copy of the License at | ||
7 | + * | ||
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * | ||
10 | + * Unless required by applicable law or agreed to in writing, software | ||
11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | + * See the License for the specific language governing permissions and | ||
14 | + * limitations under the License. | ||
15 | + */ | ||
16 | + | ||
17 | +package org.onosproject.yangutils.parser.impl.listeners; | ||
18 | + | ||
19 | +import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; | ||
20 | +import org.onosproject.yangutils.parser.impl.TreeWalkListener; | ||
21 | + | ||
22 | +/* | ||
23 | + * Reference: RFC6020 and YANG ANTLR Grammar | ||
24 | + * | ||
25 | + * ABNF grammar as per RFC6020 | ||
26 | + * module-header-stmts = ;; these stmts can appear in any order | ||
27 | + * [yang-version-stmt stmtsep] | ||
28 | + * namespace-stmt stmtsep | ||
29 | + * prefix-stmt stmtsep | ||
30 | + * | ||
31 | + * submodule-header-stmts = | ||
32 | + * ;; these stmts can appear in any order | ||
33 | + * [yang-version-stmt stmtsep] | ||
34 | + * belongs-to-stmt stmtsep | ||
35 | + * | ||
36 | + * yang-version-stmt = yang-version-keyword sep yang-version-arg-str | ||
37 | + * optsep stmtend | ||
38 | + * | ||
39 | + * | ||
40 | + * ANTLR grammar rule | ||
41 | + * module_header_statement : yang_version_stmt? namespace_stmt prefix_stmt | ||
42 | + * | yang_version_stmt? prefix_stmt namespace_stmt | ||
43 | + * | namespace_stmt yang_version_stmt? prefix_stmt | ||
44 | + * | namespace_stmt prefix_stmt yang_version_stmt? | ||
45 | + * | prefix_stmt namespace_stmt yang_version_stmt? | ||
46 | + * | prefix_stmt yang_version_stmt? namespace_stmt? | ||
47 | + * ; | ||
48 | + * submodule_header_statement : yang_version_stmt? belongs_to_stmt | ||
49 | + * | belongs_to_stmt yang_version_stmt? | ||
50 | + * ; | ||
51 | + * yang_version_stmt : YANG_VERSION_KEYWORD INTEGER STMTEND; | ||
52 | + */ | ||
53 | + | ||
54 | +/** | ||
55 | + * Implements listener based call back function corresponding to the "version" | ||
56 | + * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020. | ||
57 | + */ | ||
58 | +public final class VersionListener { | ||
59 | + | ||
60 | + /** | ||
61 | + * Creates a new version listener. | ||
62 | + */ | ||
63 | + private VersionListener() { | ||
64 | + } | ||
65 | + | ||
66 | + /** | ||
67 | + * It is called when parser receives an input matching the grammar | ||
68 | + * rule (version), perform validations and update the data model | ||
69 | + * tree. | ||
70 | + * | ||
71 | + * @param listener Listener's object. | ||
72 | + * @param ctx context object of the grammar rule. | ||
73 | + */ | ||
74 | + public static void processVersionEntry(TreeWalkListener listener, | ||
75 | + GeneratedYangParser.YangVersionStatementContext ctx) { | ||
76 | + // TODO method implementation | ||
77 | + } | ||
78 | +} |
-
Please register or login to post a comment