ethannicholas | b3058bd | 2016-07-01 08:22:01 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 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 | */ |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 7 | |
ethannicholas | b3058bd | 2016-07-01 08:22:01 -0700 | [diff] [blame] | 8 | #ifndef SKSL_ASTDECLARATION |
| 9 | #define SKSL_ASTDECLARATION |
| 10 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "src/sksl/ast/SkSLASTPositionNode.h" |
ethannicholas | b3058bd | 2016-07-01 08:22:01 -0700 | [diff] [blame] | 12 | |
| 13 | namespace SkSL { |
| 14 | |
| 15 | /** |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 16 | * Abstract supertype of declarations such as variables and functions. |
ethannicholas | b3058bd | 2016-07-01 08:22:01 -0700 | [diff] [blame] | 17 | */ |
| 18 | struct ASTDeclaration : public ASTPositionNode { |
| 19 | enum Kind { |
| 20 | kVar_Kind, |
| 21 | kFunction_Kind, |
| 22 | kInterfaceBlock_Kind, |
ethannicholas | 5961bc9 | 2016-10-12 06:39:56 -0700 | [diff] [blame] | 23 | kExtension_Kind, |
| 24 | kPrecision_Kind, |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 25 | kModifiers_Kind, |
Ethan Nicholas | aae47c8 | 2017-11-10 15:34:03 -0500 | [diff] [blame] | 26 | kSection_Kind, |
| 27 | kEnum_Kind |
ethannicholas | b3058bd | 2016-07-01 08:22:01 -0700 | [diff] [blame] | 28 | }; |
| 29 | |
Ethan Nicholas | 5b5f096 | 2017-09-11 13:50:14 -0700 | [diff] [blame] | 30 | ASTDeclaration(int offset, Kind kind) |
| 31 | : INHERITED(offset) |
ethannicholas | b3058bd | 2016-07-01 08:22:01 -0700 | [diff] [blame] | 32 | , fKind(kind) {} |
| 33 | |
| 34 | Kind fKind; |
| 35 | |
| 36 | typedef ASTPositionNode INHERITED; |
| 37 | }; |
| 38 | |
| 39 | } // namespace |
| 40 | |
| 41 | #endif |