From c16abd4fe1bda5ebcd50dbb22f30c6be43bb885f Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 7 May 2020 15:00:33 -0400 Subject: Enhanced C++ extractor (#1340) * Extractor builds without any reference to syntax (as it will be helping to produce this!). * Change macros to include the super class. * Added indexOf(const UnownedSubString& in) to UnownedSubString. Refactored extractor * Output a macro for each type with the extracted info - can be used during injection in class * Simplify the header file - as can get super type and last from macro now * Store the 'origin' of a definition * Some small tidy ups to the extractor. * Improve comments on the extractor options. * Made CPPExtractor own SourceOrigins * Small fixes around SourceOrigin. * Small tidy up around macroOrign --- source/slang/slang-syntax.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source/slang/slang-syntax.h') diff --git a/source/slang/slang-syntax.h b/source/slang/slang-syntax.h index ff5da913f..5e1f057e4 100644 --- a/source/slang/slang-syntax.h +++ b/source/slang/slang-syntax.h @@ -33,6 +33,22 @@ namespace Slang class Parser; class SyntaxNode; + class Decl; + struct QualType; + class Type; + struct TypeExp; + class Val; + + void printDiagnosticArg(StringBuilder& sb, Decl* decl); + void printDiagnosticArg(StringBuilder& sb, Type* type); + void printDiagnosticArg(StringBuilder& sb, TypeExp const& type); + void printDiagnosticArg(StringBuilder& sb, QualType const& type); + void printDiagnosticArg(StringBuilder& sb, Val* val); + + class SyntaxNode; + SourceLoc const& getDiagnosticPos(SyntaxNode const* syntax); + SourceLoc const& getDiagnosticPos(TypeExp const& typeExp); + typedef RefPtr (*SyntaxParseCallback)(Parser* parser, void* userData); typedef unsigned int ConversionCost; -- cgit v1.2.3