aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/SkSLLayoutLexer.h
blob: 148a8f3af72dc1b3b2b663d973a5e2bc6a3c4fcd (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
/*
 * 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 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
#endif