OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SKSL_PARSER | 8 #ifndef SKSL_PARSER |
9 #define SKSL_PARSER | 9 #define SKSL_PARSER |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 struct ASTIfStatement; | 33 struct ASTIfStatement; |
34 struct ASTInterfaceBlock; | 34 struct ASTInterfaceBlock; |
35 struct ASTLayout; | 35 struct ASTLayout; |
36 struct ASTModifiers; | 36 struct ASTModifiers; |
37 struct ASTParameter; | 37 struct ASTParameter; |
38 struct ASTReturnStatement; | 38 struct ASTReturnStatement; |
39 struct ASTStatement; | 39 struct ASTStatement; |
40 struct ASTSuffix; | 40 struct ASTSuffix; |
41 struct ASTType; | 41 struct ASTType; |
42 struct ASTWhileStatement; | 42 struct ASTWhileStatement; |
43 struct ASTVarDeclaration; | 43 struct ASTVarDeclarations; |
44 class SymbolTable; | 44 class SymbolTable; |
45 | 45 |
46 /** | 46 /** |
47 * Consumes .sksl text and produces an abstract syntax tree describing the conte
nts. | 47 * Consumes .sksl text and produces an abstract syntax tree describing the conte
nts. |
48 */ | 48 */ |
49 class Parser { | 49 class Parser { |
50 public: | 50 public: |
51 Parser(std::string text, SymbolTable& types, ErrorReporter& errors); | 51 Parser(std::string text, SymbolTable& types, ErrorReporter& errors); |
52 | 52 |
53 ~Parser(); | 53 ~Parser(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // these functions parse individual grammar rules from the current parse pos
ition; you probably | 99 // these functions parse individual grammar rules from the current parse pos
ition; you probably |
100 // don't need to call any of these outside of the parser. The function decla
rations in the .cpp | 100 // don't need to call any of these outside of the parser. The function decla
rations in the .cpp |
101 // file have comments describing the grammar rules. | 101 // file have comments describing the grammar rules. |
102 | 102 |
103 void precision(); | 103 void precision(); |
104 | 104 |
105 std::unique_ptr<ASTDeclaration> directive(); | 105 std::unique_ptr<ASTDeclaration> directive(); |
106 | 106 |
107 std::unique_ptr<ASTDeclaration> declaration(); | 107 std::unique_ptr<ASTDeclaration> declaration(); |
108 | 108 |
109 std::unique_ptr<ASTVarDeclaration> varDeclaration(); | 109 std::unique_ptr<ASTVarDeclarations> varDeclarations(); |
110 | 110 |
111 std::unique_ptr<ASTType> structDeclaration(); | 111 std::unique_ptr<ASTType> structDeclaration(); |
112 | 112 |
113 std::unique_ptr<ASTVarDeclaration> structVarDeclaration(ASTModifiers modifie
rs); | 113 std::unique_ptr<ASTVarDeclarations> structVarDeclaration(ASTModifiers modifi
ers); |
114 | 114 |
115 std::unique_ptr<ASTVarDeclaration> varDeclarationEnd(ASTModifiers modifiers, | 115 std::unique_ptr<ASTVarDeclarations> varDeclarationEnd(ASTModifiers modifiers
, |
116 std::unique_ptr<ASTType
> type, | 116 std::unique_ptr<ASTTyp
e> type, |
117 std::string name); | 117 std::string name); |
118 | 118 |
119 std::unique_ptr<ASTParameter> parameter(); | 119 std::unique_ptr<ASTParameter> parameter(); |
120 | 120 |
121 int layoutInt(); | 121 int layoutInt(); |
122 | 122 |
123 ASTLayout layout(); | 123 ASTLayout layout(); |
124 | 124 |
125 ASTModifiers modifiers(); | 125 ASTModifiers modifiers(); |
126 | 126 |
127 ASTModifiers modifiersWithDefaults(int defaultFlags); | 127 ASTModifiers modifiersWithDefaults(int defaultFlags); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 void* fScanner; | 200 void* fScanner; |
201 YY_BUFFER_STATE fBuffer; | 201 YY_BUFFER_STATE fBuffer; |
202 Token fPushback; | 202 Token fPushback; |
203 SymbolTable& fTypes; | 203 SymbolTable& fTypes; |
204 ErrorReporter& fErrors; | 204 ErrorReporter& fErrors; |
205 }; | 205 }; |
206 | 206 |
207 } // namespace | 207 } // namespace |
208 | 208 |
209 #endif | 209 #endif |
OLD | NEW |