blob: 9f260f32f641be8ca1e65379244ac5651d3c025b [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
Mike Kleinc0bd9f92019-04-23 12:05:21 -050011#include "src/sksl/ast/SkSLASTPositionNode.h"
ethannicholasb3058bd2016-07-01 08:22:01 -070012
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,
Ethan Nicholasaae47c82017-11-10 15:34:03 -050026 kSection_Kind,
27 kEnum_Kind
ethannicholasb3058bd2016-07-01 08:22:01 -070028 };
29
Ethan Nicholas5b5f0962017-09-11 13:50:14 -070030 ASTDeclaration(int offset, Kind kind)
31 : INHERITED(offset)
ethannicholasb3058bd2016-07-01 08:22:01 -070032 , fKind(kind) {}
33
34 Kind fKind;
35
36 typedef ASTPositionNode INHERITED;
37};
38
39} // namespace
40
41#endif