aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLLayoutLexer.h
blob: e95f20e06ce545ca6e9ed2b6e116db9c03e0f639 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
 * Copyright 2017 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */
/*****************************************************************************************
 ******************** This file was generated by sksllex. Do not edit. *******************
 *****************************************************************************************/
#ifndef SKSL_LayoutLexer
#define SKSL_LayoutLexer
#include <cstddef>
#include <cstdint>
namespace SkSL {

struct LayoutToken {
    enum Kind {
#undef END_OF_FILE
        END_OF_FILE,
#undef LOCATION
        LOCATION,
#undef OFFSET
        OFFSET,
#undef BINDING
        BINDING,
#undef INDEX
        INDEX,
#undef SET
        SET,
#undef BUILTIN
        BUILTIN,
#undef INPUT_ATTACHMENT_INDEX
        INPUT_ATTACHMENT_INDEX,
#undef ORIGIN_UPPER_LEFT
        ORIGIN_UPPER_LEFT,
#undef OVERRIDE_COVERAGE
        OVERRIDE_COVERAGE,
#undef BLEND_SUPPORT_ALL_EQUATIONS
        BLEND_SUPPORT_ALL_EQUATIONS,
#undef BLEND_SUPPORT_MULTIPLY
        BLEND_SUPPORT_MULTIPLY,
#undef BLEND_SUPPORT_SCREEN
        BLEND_SUPPORT_SCREEN,
#undef BLEND_SUPPORT_OVERLAY
        BLEND_SUPPORT_OVERLAY,
#undef BLEND_SUPPORT_DARKEN
        BLEND_SUPPORT_DARKEN,
#undef BLEND_SUPPORT_LIGHTEN
        BLEND_SUPPORT_LIGHTEN,
#undef BLEND_SUPPORT_COLORDODGE
        BLEND_SUPPORT_COLORDODGE,
#undef BLEND_SUPPORT_COLORBURN
        BLEND_SUPPORT_COLORBURN,
#undef BLEND_SUPPORT_HARDLIGHT
        BLEND_SUPPORT_HARDLIGHT,
#undef BLEND_SUPPORT_SOFTLIGHT
        BLEND_SUPPORT_SOFTLIGHT,
#undef BLEND_SUPPORT_DIFFERENCE
        BLEND_SUPPORT_DIFFERENCE,
#undef BLEND_SUPPORT_EXCLUSION
        BLEND_SUPPORT_EXCLUSION,
#undef BLEND_SUPPORT_HSL_HUE
        BLEND_SUPPORT_HSL_HUE,
#undef BLEND_SUPPORT_HSL_SATURATION
        BLEND_SUPPORT_HSL_SATURATION,
#undef BLEND_SUPPORT_HSL_COLOR
        BLEND_SUPPORT_HSL_COLOR,
#undef BLEND_SUPPORT_HSL_LUMINOSITY
        BLEND_SUPPORT_HSL_LUMINOSITY,
#undef PUSH_CONSTANT
        PUSH_CONSTANT,
#undef POINTS
        POINTS,
#undef LINES
        LINES,
#undef LINE_STRIP
        LINE_STRIP,
#undef LINES_ADJACENCY
        LINES_ADJACENCY,
#undef TRIANGLES
        TRIANGLES,
#undef TRIANGLE_STRIP
        TRIANGLE_STRIP,
#undef TRIANGLES_ADJACENCY
        TRIANGLES_ADJACENCY,
#undef MAX_VERTICES
        MAX_VERTICES,
#undef INVOCATIONS
        INVOCATIONS,
#undef WHEN
        WHEN,
#undef KEY
        KEY,
#undef CTYPE
        CTYPE,
#undef INVALID
        INVALID,
    };

    LayoutToken() : fKind(Kind::INVALID), fOffset(-1), fLength(-1) {}

    LayoutToken(Kind kind, int offset, int length)
            : fKind(kind), fOffset(offset), fLength(length) {}

    Kind fKind;
    int fOffset;
    int fLength;
};

class LayoutLexer {
public:
    void start(const char* text, size_t length) {
        fText = text;
        fLength = length;
        fOffset = 0;
    }

    LayoutToken next();

private:
    const char* fText;
    int fLength;
    int fOffset;
};

}  // namespace SkSL
#endif