xref: /OpenGrok/opengrok-indexer/src/main/jflex/analysis/sql/SQLSymbolTokenizer.lex (revision d219b4cea555a12b602d2d5518daa22134ad4879)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * See LICENSE.txt included in this distribution for the specific
9  * language governing permissions and limitations under the License.
10  *
11  * When distributing Covered Code, include this CDDL HEADER in each
12  * file and include the License file at LICENSE.txt.
13  * If applicable, add the following below this CDDL HEADER, with the
14  * fields enclosed by brackets "[]" replaced with your own identifying
15  * information: Portions Copyright [yyyy] [name of copyright owner]
16  *
17  * CDDL HEADER END
18  */
19 
20 /*
21  * Copyright (c) 2019, Chris Fraire <cfraire@me.com>.
22  */
23 
24 package org.opengrok.indexer.analysis.sql;
25 
26 import java.io.IOException;
27 import java.util.Set;
28 import org.opengrok.indexer.util.StringUtils;
29 import org.opengrok.indexer.web.HtmlConsts;
30 %%
31 %public
32 %class SQLSymbolTokenizer
33 %extends JointSQLSymbolTokenizer
34 %unicode
35 %ignorecase
36 %int
37 %char
38 %include ../CommonLexer.lexh
39 %{
40     /** Gets the keywords from {@link Consts}. */
41     @Override
getDialectKeywords()42     Set<String> getDialectKeywords() {
43         return Consts.KEYWORDS;
44     }
45 
46     /**
47      * Gets the constant value created by JFlex to represent
48      * BRACKETED_COMMENT.
49      */
50     @Override
BRACKETED_COMMENT()51     int BRACKETED_COMMENT() {
52         return BRACKETED_COMMENT;
53     }
54 
55     /**
56      * Gets the constant value created by JFlex to represent
57      * SINGLE_LINE_COMMENT.
58      */
59     @Override
SINGLE_LINE_COMMENT()60     int SINGLE_LINE_COMMENT() {
61         return SINGLE_LINE_COMMENT;
62     }
63 %}
64 
65 %include ../Common.lexh
66 %include ../CommonURI.lexh
67 %include JointSQL.lexh
68 %include SQL.lexh
69 %include JointSQLProductions.lexh
70