Debian Codegraph @

src/main/org/h2/bnf/BnfVisitor.java

raw
1 /*
2 * Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0,
3 * and the EPL 1.0 (https://h2database.com/html/license.html).
4 * Initial Developer: H2 Group
5 */
6 package org.h2.bnf;
7
8 import java.util.ArrayList;
9
10 /**
11 * The visitor interface for BNF rules.
12 */
13 public interface BnfVisitor {
14
15 /**
16 * Visit a rule element.
17 *
18 * @param keyword whether this is a keyword
19 * @param name the element name
20 * @param link the linked rule if it's not a keyword
21 */
22 void visitRuleElement(boolean keyword, String name, Rule link);
23
24 /**
25 * Visit a repeat rule.
26 *
27 * @param comma whether the comma is repeated as well
28 * @param rule the element to repeat
29 */
30 void visitRuleRepeat(boolean comma, Rule rule);
31
32 /**
33 * Visit a fixed rule.
34 *
35 * @param type the type
36 */
37 void visitRuleFixed(int type);
38
39 /**
40 * Visit a rule list.
41 *
42 * @param or true for OR, false for AND
43 * @param list the rules
44 */
45 void visitRuleList(boolean or, ArrayList<Rule> list);
46
47 /**
48 * Visit an optional rule.
49 *
50 * @param rule the rule
51 */
52 void visitRuleOptional(Rule rule);
53
54 /**
55 * Visit an OR list of optional rules.
56 *
57 * @param list the optional rules
58 */
59 void visitRuleOptional(ArrayList<Rule> list);
60
61 /**
62 * Visit a rule with non-standard extension.
63 *
64 * @param rule the rule
65 * @param compatibility whether this rule exists for compatibility only
66 */
67 void visitRuleExtension(Rule rule, boolean compatibility);
68
69 }