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_FUNCTIONREFERENCE
9 : #define SKSL_FUNCTIONREFERENCE
10 :
11 : #include "SkSLContext.h"
12 : #include "SkSLExpression.h"
13 : #include "SkSLFunctionDeclaration.h"
14 :
15 : namespace SkSL {
16 :
17 : /**
18 : * An identifier referring to a function name. This is an intermediate value: FunctionReferences are
19 : * always eventually replaced by FunctionCalls in valid programs.
20 : */
21 0 : struct FunctionReference : public Expression {
22 0 : FunctionReference(const Context& context, Position position,
23 : std::vector<const FunctionDeclaration*> function)
24 0 : : INHERITED(position, kFunctionReference_Kind, *context.fInvalid_Type)
25 0 : , fFunctions(function) {}
26 :
27 0 : virtual String description() const override {
28 0 : ASSERT(false);
29 0 : return String("<function>");
30 : }
31 :
32 : const std::vector<const FunctionDeclaration*> fFunctions;
33 :
34 : typedef Expression INHERITED;
35 : };
36 :
37 : } // namespace
38 :
39 : #endif
|