blob: f06240405eb4816844563496402be4e3ee3dd6c2 [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 * mandatory-stmt = mandatory-keyword sep
27 * mandatory-arg-str stmtend
28 *
29 * mandatory-arg-str = < a string that matches the rule
30 * mandatory-arg >
31 *
32 * mandatory-arg = true-keyword / false-keyword
33 *
34 * ANTLR grammar rule
35 * mandatoryStatement : MANDATORY_KEYWORD (TRUE_KEYWORD | FALSE_KEYWORD) STMTEND;
36 */
37
38/**
39 * Implements listener based call back function corresponding to the "mandatory"
40 * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
41 */
42public final class MandatoryListener {
43
44 /**
45 * Creates a new mandatory listener.
46 */
47 private MandatoryListener() {
48 }
49
50 /**
51 * It is called when parser receives an input matching the grammar
52 * rule (mandatory), performs validation and updates the data model
53 * tree.
54 *
55 * @param listener listener's object.
56 * @param ctx context object of the grammar rule.
57 */
58 public static void processMandatoryEntry(TreeWalkListener listener,
59 GeneratedYangParser.MandatoryStatementContext ctx) {
60 // TODO method implementation
61 }
62
63 /**
64 * It is called when parser exits from grammar rule (mandatory), it performs
65 * validation and updates the data model tree.
66 *
67 * @param listener listener's object.
68 * @param ctx context object of the grammar rule.
69 */
70 public static void processMandatoryExit(TreeWalkListener listener,
71 GeneratedYangParser.MandatoryStatementContext ctx) {
72 // TODO method implementation
73 }
74}