blob: c30a7a8f68ee25102917caf1b9dfd314ac123037 [file] [log] [blame]
Vidyashree Rama92fc5562016-02-12 18:44:12 +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 * status-stmt = status-keyword sep status-arg-str stmtend
27 * status-arg-str = < a string that matches the rule
28 * status-arg >
29 * status-arg = current-keyword /
30 * obsolete-keyword /
31 * deprecated-keyword
32 *
33 * ANTLR grammar rule
34 * statusStatement : STATUS_KEYWORD (CURRENT_KEYWORD | OBSOLETE_KEYWORD | DEPRECATED_KEYWORD) STMTEND;
35 */
36
37/**
38 * Implements listener based call back function corresponding to the "status"
39 * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
40 */
41public final class StatusListener {
42
43 /**
44 * Creates a new status listener.
45 */
46 private StatusListener() {
47 }
48
49 /**
50 * It is called when parser receives an input matching the grammar
51 * rule (status), performs validation and updates the data model
52 * tree.
53 *
54 * @param listener listener's object.
55 * @param ctx context object of the grammar rule.
56 */
57 public static void processStatusEntry(TreeWalkListener listener,
58 GeneratedYangParser.StatusStatementContext ctx) {
59 // TODO method implementation
60 }
61
62 /**
63 * It is called when parser exits from grammar rule (status), it performs
64 * validation and updates the data model tree.
65 *
66 * @param listener listener's object.
67 * @param ctx context object of the grammar rule.
68 */
69 public static void processStatusExit(TreeWalkListener listener,
70 GeneratedYangParser.StatusStatementContext ctx) {
71 // TODO method implementation
72 }
73}