diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-10-29 14:49:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-29 14:49:26 +0800 |
| commit | f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch) | |
| tree | ea1d61342cd29368e19135000ec2948813096205 /source/slang/slang-parser.h | |
| parent | a729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff) | |
format
* format
* Minor test fixes
* enable checking cpp format in ci
Diffstat (limited to 'source/slang/slang-parser.h')
| -rw-r--r-- | source/slang/slang-parser.h | 77 |
1 files changed, 37 insertions, 40 deletions
diff --git a/source/slang/slang-parser.h b/source/slang/slang-parser.h index 22b3e73ce..bef03c9fe 100644 --- a/source/slang/slang-parser.h +++ b/source/slang/slang-parser.h @@ -2,50 +2,47 @@ #define SLANG_PARSER_H #include "../compiler-core/slang-lexer.h" - #include "slang-compiler.h" #include "slang-syntax.h" namespace Slang { - // Parse a source file into an existing translation unit - void parseSourceFile( - ASTBuilder* astBuilder, - TranslationUnitRequest* translationUnit, - SourceLanguage sourceLanguage, - TokenSpan const& tokens, - DiagnosticSink* sink, - Scope* outerScope, - ContainerDecl* parentDecl); - - Expr* parseTermFromSourceFile( - ASTBuilder* astBuilder, - TokenSpan const& tokens, - DiagnosticSink* sink, - Scope* outerScope, - NamePool* namePool, - SourceLanguage sourceLanguage); - - ModuleDecl* populateBaseLanguageModule( - ASTBuilder* astBuilder, - Scope* scope); - - /// Information used to set up SyntaxDecl. Such decls - /// when correctly setup define a callback. For some of the callbacks it's necessary - /// for the `parseUserData` to be set the the associated classInfo - struct SyntaxParseInfo - { - const char* keywordName; ///< The keyword associated with this parse - SyntaxParseCallback callback; ///< The callback to apply to the parse - const ReflectClassInfo* classInfo; ///< - }; - - /// Get all of the predefined SyntaxParseInfos - ConstArrayView<SyntaxParseInfo> getSyntaxParseInfos(); - - /// Assumes the userInfo is the ReflectClassInfo - NodeBase* parseSimpleSyntax(Parser* parser, void* userData); - -} +// Parse a source file into an existing translation unit +void parseSourceFile( + ASTBuilder* astBuilder, + TranslationUnitRequest* translationUnit, + SourceLanguage sourceLanguage, + TokenSpan const& tokens, + DiagnosticSink* sink, + Scope* outerScope, + ContainerDecl* parentDecl); + +Expr* parseTermFromSourceFile( + ASTBuilder* astBuilder, + TokenSpan const& tokens, + DiagnosticSink* sink, + Scope* outerScope, + NamePool* namePool, + SourceLanguage sourceLanguage); + +ModuleDecl* populateBaseLanguageModule(ASTBuilder* astBuilder, Scope* scope); + +/// Information used to set up SyntaxDecl. Such decls +/// when correctly setup define a callback. For some of the callbacks it's necessary +/// for the `parseUserData` to be set the the associated classInfo +struct SyntaxParseInfo +{ + const char* keywordName; ///< The keyword associated with this parse + SyntaxParseCallback callback; ///< The callback to apply to the parse + const ReflectClassInfo* classInfo; ///< +}; + +/// Get all of the predefined SyntaxParseInfos +ConstArrayView<SyntaxParseInfo> getSyntaxParseInfos(); + +/// Assumes the userInfo is the ReflectClassInfo +NodeBase* parseSimpleSyntax(Parser* parser, void* userData); + +} // namespace Slang #endif |
