mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
libSyntax: create a basic infrastructure for generating libSyntax entities by using Parser.
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
#include "swift/AST/Module.h"
|
||||
#include "swift/AST/Pattern.h"
|
||||
#include "swift/AST/Stmt.h"
|
||||
#include "swift/Syntax/RawTokenSyntax.h"
|
||||
#include "swift/Syntax/SyntaxParsingContext.h"
|
||||
#include "swift/Basic/OptionSet.h"
|
||||
#include "swift/Parse/Lexer.h"
|
||||
#include "swift/Parse/LocalContext.h"
|
||||
@@ -325,6 +327,9 @@ public:
|
||||
/// This vector is managed by \c StructureMarkerRAII objects.
|
||||
llvm::SmallVector<StructureMarker, 16> StructureMarkers;
|
||||
|
||||
/// Current syntax parsing context where call backs should be directed to.
|
||||
syntax::SyntaxParsingContext *SyntaxContext;
|
||||
|
||||
public:
|
||||
Parser(unsigned BufferID, SourceFile &SF, SILParserTUStateBase *SIL,
|
||||
PersistentParserState *PersistentState = nullptr);
|
||||
@@ -1417,6 +1422,11 @@ tokenizeWithTrivia(const LangOptions &LangOpts,
|
||||
unsigned Offset = 0,
|
||||
unsigned EndOffset = 0);
|
||||
|
||||
|
||||
void populateTokenSyntaxMap(const LangOptions &LangOpts,
|
||||
const SourceManager &SM,
|
||||
unsigned BufferID,
|
||||
std::vector<syntax::RawTokenInfo> &Result);
|
||||
} // end namespace swift
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user