1 /* 2 * Copyright 2017 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 /***************************************************************************************** 8 ******************** This file was generated by sksllex. Do not edit. ******************* 9 *****************************************************************************************/ 10 #ifndef SKSL_LayoutLexer 11 #define SKSL_LayoutLexer 12 #include <cstddef> 13 #include <cstdint> 14 namespace SkSL { 15 16 struct LayoutToken { 17 enum Kind { 18 #undef END_OF_FILE 19 END_OF_FILE, 20 #undef LOCATION 21 LOCATION, 22 #undef OFFSET 23 OFFSET, 24 #undef BINDING 25 BINDING, 26 #undef INDEX 27 INDEX, 28 #undef SET 29 SET, 30 #undef BUILTIN 31 BUILTIN, 32 #undef INPUT_ATTACHMENT_INDEX 33 INPUT_ATTACHMENT_INDEX, 34 #undef ORIGIN_UPPER_LEFT 35 ORIGIN_UPPER_LEFT, 36 #undef OVERRIDE_COVERAGE 37 OVERRIDE_COVERAGE, 38 #undef BLEND_SUPPORT_ALL_EQUATIONS 39 BLEND_SUPPORT_ALL_EQUATIONS, 40 #undef BLEND_SUPPORT_MULTIPLY 41 BLEND_SUPPORT_MULTIPLY, 42 #undef BLEND_SUPPORT_SCREEN 43 BLEND_SUPPORT_SCREEN, 44 #undef BLEND_SUPPORT_OVERLAY 45 BLEND_SUPPORT_OVERLAY, 46 #undef BLEND_SUPPORT_DARKEN 47 BLEND_SUPPORT_DARKEN, 48 #undef BLEND_SUPPORT_LIGHTEN 49 BLEND_SUPPORT_LIGHTEN, 50 #undef BLEND_SUPPORT_COLORDODGE 51 BLEND_SUPPORT_COLORDODGE, 52 #undef BLEND_SUPPORT_COLORBURN 53 BLEND_SUPPORT_COLORBURN, 54 #undef BLEND_SUPPORT_HARDLIGHT 55 BLEND_SUPPORT_HARDLIGHT, 56 #undef BLEND_SUPPORT_SOFTLIGHT 57 BLEND_SUPPORT_SOFTLIGHT, 58 #undef BLEND_SUPPORT_DIFFERENCE 59 BLEND_SUPPORT_DIFFERENCE, 60 #undef BLEND_SUPPORT_EXCLUSION 61 BLEND_SUPPORT_EXCLUSION, 62 #undef BLEND_SUPPORT_HSL_HUE 63 BLEND_SUPPORT_HSL_HUE, 64 #undef BLEND_SUPPORT_HSL_SATURATION 65 BLEND_SUPPORT_HSL_SATURATION, 66 #undef BLEND_SUPPORT_HSL_COLOR 67 BLEND_SUPPORT_HSL_COLOR, 68 #undef BLEND_SUPPORT_HSL_LUMINOSITY 69 BLEND_SUPPORT_HSL_LUMINOSITY, 70 #undef PUSH_CONSTANT 71 PUSH_CONSTANT, 72 #undef POINTS 73 POINTS, 74 #undef LINES 75 LINES, 76 #undef LINE_STRIP 77 LINE_STRIP, 78 #undef LINES_ADJACENCY 79 LINES_ADJACENCY, 80 #undef TRIANGLES 81 TRIANGLES, 82 #undef TRIANGLE_STRIP 83 TRIANGLE_STRIP, 84 #undef TRIANGLES_ADJACENCY 85 TRIANGLES_ADJACENCY, 86 #undef MAX_VERTICES 87 MAX_VERTICES, 88 #undef INVOCATIONS 89 INVOCATIONS, 90 #undef WHEN 91 WHEN, 92 #undef KEY 93 KEY, 94 #undef CTYPE 95 CTYPE, 96 #undef INVALID 97 INVALID, 98 }; 99 100 LayoutToken() : fKind(Kind::INVALID), fOffset(-1), fLength(-1) {} 101 102 LayoutToken(Kind kind, int offset, int length) 103 : fKind(kind), fOffset(offset), fLength(length) {} 104 105 Kind fKind; 106 int fOffset; 107 int fLength; 108 }; 109 110 class LayoutLexer { 111 public: 112 void start(const char* text, size_t length) { 113 fText = text; 114 fLength = length; 115 fOffset = 0; 116 } 117 118 LayoutToken next(); 119 120 private: 121 const char* fText; 122 int fLength; 123 int fOffset; 124 }; 125 126 } // namespace 127 #endif 128