blob: ec1fc3804c221ab9d35241316dfe11a55ac16881 [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 */
7
8#ifndef SKSL_FUNCTIONREFERENCE
9#define SKSL_FUNCTIONREFERENCE
10
ethannicholasd598f792016-07-25 10:08:54 -070011#include "SkSLContext.h"
ethannicholasb3058bd2016-07-01 08:22:01 -070012#include "SkSLExpression.h"
13
14namespace SkSL {
15
16/**
17 * An identifier referring to a function name. This is an intermediate value: FunctionReferences are
18 * always eventually replaced by FunctionCalls in valid programs.
19 */
20struct FunctionReference : public Expression {
ethannicholasd598f792016-07-25 10:08:54 -070021 FunctionReference(const Context& context, Position position,
22 std::vector<const FunctionDeclaration*> function)
23 : INHERITED(position, kFunctionReference_Kind, *context.fInvalid_Type)
ethannicholasb3058bd2016-07-01 08:22:01 -070024 , fFunctions(function) {}
25
Ethan Nicholas9e1138d2016-11-21 10:39:35 -050026 virtual SkString description() const override {
ethannicholasf789b382016-08-03 12:43:36 -070027 ASSERT(false);
Ethan Nicholas9e1138d2016-11-21 10:39:35 -050028 return SkString("<function>");
ethannicholasb3058bd2016-07-01 08:22:01 -070029 }
30
ethannicholasd598f792016-07-25 10:08:54 -070031 const std::vector<const FunctionDeclaration*> fFunctions;
ethannicholasb3058bd2016-07-01 08:22:01 -070032
33 typedef Expression INHERITED;
34};
35
36} // namespace
37
38#endif