2016-07-01 15:22:01 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
2017-03-31 17:56:23 +00:00
|
|
|
|
2016-07-01 15:22:01 +00:00
|
|
|
#ifndef SKSL_SYMBOL
|
|
|
|
#define SKSL_SYMBOL
|
|
|
|
|
|
|
|
#include "SkSLIRNode.h"
|
|
|
|
|
|
|
|
namespace SkSL {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents a symboltable entry.
|
|
|
|
*/
|
|
|
|
struct Symbol : public IRNode {
|
|
|
|
enum Kind {
|
|
|
|
kFunctionDeclaration_Kind,
|
|
|
|
kUnresolvedFunction_Kind,
|
|
|
|
kType_Kind,
|
|
|
|
kVariable_Kind,
|
|
|
|
kField_Kind
|
|
|
|
};
|
|
|
|
|
2017-09-11 16:33:48 +00:00
|
|
|
Symbol(Position position, Kind kind, String name)
|
|
|
|
: INHERITED(position)
|
2016-07-01 15:22:01 +00:00
|
|
|
, fKind(kind)
|
2017-09-11 16:33:48 +00:00
|
|
|
, fName(std::move(name)) {}
|
2016-07-01 15:22:01 +00:00
|
|
|
|
2017-08-17 15:07:59 +00:00
|
|
|
const Kind fKind;
|
2017-09-11 16:33:48 +00:00
|
|
|
const String fName;
|
2016-07-01 15:22:01 +00:00
|
|
|
|
|
|
|
typedef IRNode INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|