SkSLIRNode.h 762 B

1234567891011121314151617181920212223242526272829303132333435
  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_IRNODE
  8. #define SKSL_IRNODE
  9. #include "src/sksl/SkSLLexer.h"
  10. #include "src/sksl/SkSLString.h"
  11. namespace SkSL {
  12. /**
  13. * Represents a node in the intermediate representation (IR) tree. The IR is a fully-resolved
  14. * version of the program (all types determined, everything validated), ready for code generation.
  15. */
  16. struct IRNode {
  17. IRNode(int offset)
  18. : fOffset(offset) {}
  19. virtual ~IRNode() {}
  20. virtual String description() const = 0;
  21. // character offset of this element within the program being compiled, for error reporting
  22. // purposes
  23. int fOffset;
  24. };
  25. } // namespace
  26. #endif