blob: 25f2764131ce456245fc205865b0b46d0d895415 [file] [log] [blame]
Gaurav Agrawal22db16d2016-02-12 16:50:55 +05301/*
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
17package org.onosproject.yangutils.parser.impl.listeners;
18
19import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
20import 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 */
45public 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}