Line data Source code
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 : */
7 :
8 : #ifndef SKSL_STATEMENT
9 : #define SKSL_STATEMENT
10 :
11 : #include "SkSLIRNode.h"
12 : #include "SkSLType.h"
13 :
14 : namespace SkSL {
15 :
16 : /**
17 : * Abstract supertype of all statements.
18 : */
19 0 : struct Statement : public IRNode {
20 : enum Kind {
21 : kBlock_Kind,
22 : kBreak_Kind,
23 : kContinue_Kind,
24 : kDiscard_Kind,
25 : kDo_Kind,
26 : kExpression_Kind,
27 : kFor_Kind,
28 : kIf_Kind,
29 : kReturn_Kind,
30 : kSwitch_Kind,
31 : kVarDeclarations_Kind,
32 : kWhile_Kind
33 : };
34 :
35 0 : Statement(Position position, Kind kind)
36 0 : : INHERITED(position)
37 0 : , fKind(kind) {}
38 :
39 : const Kind fKind;
40 :
41 : typedef IRNode INHERITED;
42 : };
43 :
44 : } // namespace
45 :
46 : #endif
|