MCPcopy Create free account
hub / github.com/csyonghe/Spire / PreprocessSource

Function PreprocessSource

Source/SpireCore/Preprocessor.cpp:1818–1837  ·  view source on GitHub ↗

Take a string of source code and preprocess it into a list of tokens.

Source from the content-addressed store, hash-verified

1816
1817// Take a string of source code and preprocess it into a list of tokens.
1818TokenList PreprocessSource(
1819 CoreLib::String const& source,
1820 CoreLib::String const& fileName,
1821 DiagnosticSink* sink,
1822 IncludeHandler* includeHandler)
1823{
1824 Preprocessor preprocessor;
1825 InitializePreprocessor(&preprocessor, sink);
1826
1827 preprocessor.includeHandler = includeHandler;
1828
1829 // create an initial input stream based on the provided buffer
1830 preprocessor.inputStream = CreateInputStreamForSource(&preprocessor, source, fileName);
1831
1832 TokenList tokens = ReadAllTokens(&preprocessor);
1833
1834 FinalizePreprocessor(&preprocessor);
1835
1836 return tokens;
1837}
1838
1839TokenList PreprocessSource(
1840 CoreLib::String const& source,

Callers 1

ParseMethod · 0.85

Calls 6

InitializePreprocessorFunction · 0.85
ReadAllTokensFunction · 0.85
FinalizePreprocessorFunction · 0.85
DefineMacroFunction · 0.85
ProduceStringMethod · 0.80

Tested by

no test coverage detected