SkSLSymbol.h 742 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. #ifndef SKSL_SYMBOL
  8. #define SKSL_SYMBOL
  9. #include "src/sksl/ir/SkSLIRNode.h"
  10. namespace SkSL {
  11. /**
  12. * Represents a symboltable entry.
  13. */
  14. struct Symbol : public IRNode {
  15. enum Kind {
  16. kFunctionDeclaration_Kind,
  17. kUnresolvedFunction_Kind,
  18. kType_Kind,
  19. kVariable_Kind,
  20. kField_Kind,
  21. kExternal_Kind
  22. };
  23. Symbol(int offset, Kind kind, StringFragment name)
  24. : INHERITED(offset)
  25. , fKind(kind)
  26. , fName(name) {}
  27. virtual ~Symbol() {}
  28. Kind fKind;
  29. StringFragment fName;
  30. typedef IRNode INHERITED;
  31. };
  32. } // namespace
  33. #endif