Flutter Engine
The Flutter Engine
SkSLContext.h
Go to the documentation of this file.
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
8#ifndef SKSL_CONTEXT
9#define SKSL_CONTEXT
10
12
13namespace SkSL {
14
15class BuiltinTypes;
16class ErrorReporter;
17struct Module;
18struct ProgramConfig;
19class SymbolTable;
20
21/**
22 * Contains compiler-wide objects and state.
23 */
24class Context {
25public:
27 ~Context();
28
29 // The Context holds a reference to all of the built-in types.
31
32 // The Context holds a pointer to the configuration of the program being compiled.
34
35 // The Context holds a pointer to our error reporter.
37
39 SkASSERT(e);
40 fErrors = e;
41 }
42
43 // The Context holds a pointer to our module with built-in declarations.
44 const Module* fModule = nullptr;
45
46 // This is the current symbol table of the code we are processing, and therefore changes during
47 // compilation.
49};
50
51} // namespace SkSL
52
53#endif
#define SkASSERT(cond)
Definition: SkAssert.h:116
const BuiltinTypes & fTypes
Definition: SkSLContext.h:30
void setErrorReporter(ErrorReporter *e)
Definition: SkSLContext.h:38
const Module * fModule
Definition: SkSLContext.h:44
ErrorReporter * fErrors
Definition: SkSLContext.h:36
SymbolTable * fSymbolTable
Definition: SkSLContext.h:48
ProgramConfig * fConfig
Definition: SkSLContext.h:33
Context(const BuiltinTypes &types, ErrorReporter &errors)
Definition: SkSLContext.cpp:17