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 | */ |
| 7 | |
| 8 | #ifndef SKSL_ASTNODE |
| 9 | #define SKSL_ASTNODE |
| 10 | |
Greg Daniel | 792d0f1 | 2016-11-20 14:53:35 +0000 | [diff] [blame^] | 11 | #include <memory> |
| 12 | #include <string> |
ethannicholas | b3058bd | 2016-07-01 08:22:01 -0700 | [diff] [blame] | 13 | |
| 14 | namespace SkSL { |
| 15 | |
| 16 | /** |
| 17 | * Represents a node in the abstract syntax tree (AST). The AST is based directly on the parse tree; |
| 18 | * it is a parsed-but-not-yet-analyzed version of the program. |
| 19 | */ |
| 20 | struct ASTNode { |
| 21 | virtual ~ASTNode() {} |
ethannicholas | f789b38 | 2016-08-03 12:43:36 -0700 | [diff] [blame] | 22 | |
Greg Daniel | 792d0f1 | 2016-11-20 14:53:35 +0000 | [diff] [blame^] | 23 | virtual std::string description() const = 0; |
ethannicholas | b3058bd | 2016-07-01 08:22:01 -0700 | [diff] [blame] | 24 | }; |
| 25 | |
| 26 | } // namespace |
| 27 | |
| 28 | #endif |