blob: 53aa65f6f258f81ac7d41879913fb150f98c5a3b [file] [log] [blame]
ethannicholasb3058bd2016-07-01 08:22:01 -07001/*
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 Nicholas0df1b042017-03-31 13:56:23 -04007
ethannicholasb3058bd2016-07-01 08:22:01 -07008#ifndef SKSL_ASTDECLARATION
9#define SKSL_ASTDECLARATION
10
11#include "SkSLASTPositionNode.h"
12
13namespace SkSL {
14
15/**
Ethan Nicholas0df1b042017-03-31 13:56:23 -040016 * Abstract supertype of declarations such as variables and functions.
ethannicholasb3058bd2016-07-01 08:22:01 -070017 */
18struct ASTDeclaration : public ASTPositionNode {
19 enum Kind {
20 kVar_Kind,
21 kFunction_Kind,
22 kInterfaceBlock_Kind,
ethannicholas5961bc92016-10-12 06:39:56 -070023 kExtension_Kind,
24 kPrecision_Kind,
Ethan Nicholas762466e2017-06-29 10:03:38 -040025 kModifiers_Kind,
26 kSection_Kind
ethannicholasb3058bd2016-07-01 08:22:01 -070027 };
28
Ethan Nicholas5b5f0962017-09-11 13:50:14 -070029 ASTDeclaration(int offset, Kind kind)
30 : INHERITED(offset)
ethannicholasb3058bd2016-07-01 08:22:01 -070031 , fKind(kind) {}
32
33 Kind fKind;
34
35 typedef ASTPositionNode INHERITED;
36};
37
38} // namespace
39
40#endif