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