xref: /foundation/ability/idl_tool/parser/token.h (revision ca0551cf)
1/*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef OHOS_IDL_TOKEN_H
17#define OHOS_IDL_TOKEN_H
18
19namespace OHOS {
20namespace Idl {
21enum class Token {
22    UNKNOWN              = 0,
23    // types
24    BOOLEAN,
25    CHAR,
26    BYTE,
27    SHORT,
28    INTEGER,
29    LONG,
30    FLOAT,
31    DOUBLE,
32    STRING,
33    LIST,
34    MAP,
35    // keywords
36    IN,
37    INTERFACE,
38    ONEWAY,
39    OUT,
40    INOUT,
41    SEQUENCEABLE,
42    CACHEABLE,
43    // symbols
44    DOT,   // '.'
45    COMMA,   // ','
46    SEMICOLON,   // ';'
47    BRACES_LEFT,   // '{'
48    BRACES_RIGHT,   // '}'
49    BRACKETS_LEFT,   // '['
50    BRACKETS_RIGHT,   // ']'
51    PARENTHESES_LEFT,   // '('
52    PARENTHESES_RIGHT,   // ')'
53    ANGLE_BRACKETS_LEFT,   // '<'
54    ANGLE_BRACKETS_RIGHT,   // '>'
55    // others
56    IDENTIFIER,
57    COMMENT_BLOCK,
58    COMMENT_LINE,
59    END_OF_FILE,
60};
61} // namespace Idl
62} // namespace OHOS
63#endif // OHOS_IDL_TOKEN_H
64