1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.apache.directory.api.ldap.model.schema.syntaxes;
23
24 import java.io.StringReader;
25 import java.util.List;
26
27
28 import antlr.TokenBuffer;
29 import antlr.TokenStreamException;
30 import antlr.TokenStreamIOException;
31 import antlr.ANTLRException;
32 import antlr.LLkParser;
33 import antlr.Token;
34 import antlr.TokenStream;
35 import antlr.RecognitionException;
36 import antlr.NoViableAltException;
37 import antlr.MismatchedTokenException;
38 import antlr.SemanticException;
39 import antlr.ParserSharedInputState;
40 import antlr.collections.impl.BitSet;
41
42
43
44
45
46
47
48 public class AntlrSchemaExtensionParser extends antlr.LLkParser implements AntlrSchemaExtensionTokenTypes
49 {
50
51 protected AntlrSchemaExtensionParser(TokenBuffer tokenBuf, int k) {
52 super(tokenBuf,k);
53 tokenNames = _tokenNames;
54 }
55
56 public AntlrSchemaExtensionParser(TokenBuffer tokenBuf) {
57 this(tokenBuf,3);
58 }
59
60 protected AntlrSchemaExtensionParser(TokenStream lexer, int k) {
61 super(lexer,k);
62 tokenNames = _tokenNames;
63 }
64
65 public AntlrSchemaExtensionParser(TokenStream lexer) {
66 this(lexer,3);
67 }
68
69 public AntlrSchemaExtensionParser(ParserSharedInputState state) {
70 super(state,3);
71 tokenNames = _tokenNames;
72 }
73
74
75
76
77
78 public final AntlrSchemaParser.Extension extension() throws RecognitionException, TokenStreamException {
79 AntlrSchemaParser.Extension extension = new AntlrSchemaParser.Extension();
80
81 Token xkey = null;
82 Token xvalues = null;
83
84 {
85 xkey = LT(1);
86 match(XKEY);
87 extension.key = xkey.getText();
88 }
89 {
90 xvalues = LT(1);
91 match(XVALUES);
92 extension.values = qdstrings(xvalues.getText());
93 }
94 return extension;
95 }
96
97 public final List<String> qdstrings(
98 String s
99 ) throws RecognitionException, TokenStreamException {
100 List<String> qdstrings;
101
102
103 try
104 {
105 AntlrSchemaQdstringLexer lexer = new AntlrSchemaQdstringLexer(new StringReader(s));
106 AntlrSchemaQdstringParser parser = new AntlrSchemaQdstringParser(lexer);
107 qdstrings = parser.qdstrings();
108 }
109 catch (RecognitionException re) {
110 re.printStackTrace();
111 throw re;
112 }
113 catch (TokenStreamException tse) {
114 tse.printStackTrace();
115 throw tse;
116 }
117
118
119 return qdstrings;
120 }
121
122
123 public static final String[] _tokenNames = {
124 "<0>",
125 "EOF",
126 "<2>",
127 "NULL_TREE_LOOKAHEAD",
128 "WHSP",
129 "QUOTE",
130 "XKEY",
131 "XVALUES",
132 "XSTRING",
133 "VALUES",
134 "VALUE",
135 "QUOTED_STRING"
136 };
137
138
139 }