Cogs.Core
Public Member Functions | Public Attributes | List of all members
Cogs::Core::PartialPreprocessor Struct Reference

Partial C preprocessor. More...

#include <Preprocessor.h>

Public Member Functions

bool process (Context *context, const StringView input)
 Run a text block through the preprocessor.
 

Public Attributes

std::string processed
 Resulting processed text.
 
std::unordered_set< StringRefidentifiersSeen
 Set of identifiers encountered in active text.
 
std::unordered_map< StringRef, StringRefdefinitions
 Set of preprocessor defines encountered in active text.
 

Detailed Description

Partial C preprocessor.

This preprocessor does:

It does not:

Definition at line 41 of file Preprocessor.h.

Member Function Documentation

◆ process()

bool Cogs::Core::PartialPreprocessor::process ( Context context,
const StringView  input 
)

Run a text block through the preprocessor.

Can be invoked multiple times, to incrementally populate processed, identifiersSeen and definitions

Returns
True on success

Definition at line 833 of file Preprocessor.cpp.

Member Data Documentation

◆ definitions

std::unordered_map<StringRef, StringRef> Cogs::Core::PartialPreprocessor::definitions

Set of preprocessor defines encountered in active text.

Definition at line 54 of file Preprocessor.h.

◆ identifiersSeen

std::unordered_set<StringRef> Cogs::Core::PartialPreprocessor::identifiersSeen

Set of identifiers encountered in active text.

Definition at line 51 of file Preprocessor.h.

◆ processed

std::string Cogs::Core::PartialPreprocessor::processed

Resulting processed text.

The preprocessor doesn't use this except for outputing, so it is safe to steal the contents between invocations of process.

Definition at line 48 of file Preprocessor.h.


The documentation for this struct was generated from the following files: