Commit 078d7f24 by John Kessenich

HLSL: Simplify appearances a bit to make easier to read.

parent 5f934b03
......@@ -41,10 +41,13 @@
namespace glslang {
// Should just be the grammar aspect of HLSL.
// Described in more detail in hlslGrammar.cpp.
class HlslGrammar {
public:
HlslGrammar(HlslScanContext& scanContext, HlslParseContext& parseContext)
: scanContext(scanContext), parseContext(parseContext) { }
HlslGrammar(HlslScanContext& scanner, HlslParseContext& parseContext)
: scanner(scanner), parseContext(parseContext), intermediate(parseContext.intermediate) { }
virtual ~HlslGrammar() { }
bool parse();
......@@ -53,6 +56,8 @@ namespace glslang {
void expected(const char*);
void advanceToken();
bool acceptTokenClass(EHlslTokenClass);
bool peekTokenClass(EHlslTokenClass);
bool lookAheadTokenClass(EHlslTokenClass);
bool acceptCompilationUnit();
bool acceptDeclaration(TIntermNode*& node);
......@@ -69,11 +74,13 @@ namespace glslang {
bool acceptOperator(TOperator& op);
bool acceptCompoundStatement(TIntermAggregate*&);
bool acceptStatement(TIntermNode*&);
bool acceptSemantic();
HlslScanContext& scanContext;
HlslParseContext& parseContext;
HlslScanContext& scanner; // lexical scanner, to get next token
HlslParseContext& parseContext; // state of parsing and helper functions for building the intermediate
TIntermediate& intermediate; // the final product, the intermediate representation, includes the AST
HlslToken token;
HlslToken token; // the current token we are processing
};
} // end namespace glslang
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment