blob: f3f8fb71daf5581c7639a918573c5074394d4053 [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
Greg Daniel792d0f12016-11-20 14:53:35 +000026 virtual std::string description() const override {
ethannicholasf789b382016-08-03 12:43:36 -070027 ASSERT(false);
Greg Daniel792d0f12016-11-20 14:53:35 +000028 return "<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