PUMA Library Reference Manual
Puma::PreprocessorParser Class Reference

#include <PreprocessorParser.h>

+ Inheritance diagram for Puma::PreprocessorParser:

Public Types

enum  PreMode {
  INITIAL,
  DEFINING,
  MAYBEMACRO,
  ASSERT,
  TOKENLIST,
  DIRECTIVE,
  MACRO
}
 

Public Member Functions

Array< PreMacro * > * macroStack () const
 
PreLevelStatelevelState () const
 
PreParserStateparserState () const
 
PreMacroManagermacroManager () const
 
PreFileIncluderfileIncluder () const
 
PrePredicateManagerpredicateManager () const
 
UnitManagerunitManager () const
 
UnitManagerlocals () const
 
PreMode pre_mode () const
 
bool supportGNU () const
 
CScannercscanner () const
 
const char * importHandler () const
 
void macroManager (PreMacroManager *m)
 
void fileIncluder (PreFileIncluder *f)
 
void predicateManager (PrePredicateManager *p)
 
PreTreesyntaxTree () const
 
 PreprocessorParser (ErrorStream *, UnitManager *, UnitManager *, std::ostream &out=std::cout, int max_depth=400)
 
 ~PreprocessorParser ()
 
void reset (ErrorStream *, UnitManager *, UnitManager *, std::ostream &out=std::cout, int max_depth=400)
 
void freeSyntaxTree ()
 
void configure (const Config &, bool=true)
 
Tokennext ()
 Get the next token. More...
 
TokenStreamscanner () const
 
void stream (TokenStream *s)
 
int map_token (Token *token, bool &parse)
 
void parse ()
 
void silentMode (bool mode=true)
 
void defMacro (const char *, const char *=(const char *) 0, char=0) const
 
void defUndefinedMacro (const char *, const char *=(const char *) 0, char=0) const
 
void undefMacro (const char *) const
 
void defPredicate (const char *, const char *) const
 
void undefPredicate (const char *) const
 
void addInclPath (const char *) const
 
void addSysInclPath (const char *) const
 
void supportGNU (bool)
 
- Public Member Functions inherited from Puma::TokenSource
virtual ~TokenSource ()
 Destructor. More...
 

Member Enumeration Documentation

◆ PreMode

Enumerator
INITIAL 
DEFINING 
MAYBEMACRO 
ASSERT 
TOKENLIST 
DIRECTIVE 
MACRO 

Constructor & Destructor Documentation

◆ PreprocessorParser()

Puma::PreprocessorParser::PreprocessorParser ( ErrorStream ,
UnitManager ,
UnitManager ,
std::ostream &  out = std::cout,
int  max_depth = 400 
)

◆ ~PreprocessorParser()

Puma::PreprocessorParser::~PreprocessorParser ( )

Member Function Documentation

◆ addInclPath()

void Puma::PreprocessorParser::addInclPath ( const char *  ) const

◆ addSysInclPath()

void Puma::PreprocessorParser::addSysInclPath ( const char *  ) const

◆ configure()

void Puma::PreprocessorParser::configure ( const Config ,
bool  = true 
)

◆ cscanner()

CScanner& Puma::PreprocessorParser::cscanner ( ) const
inline

◆ defMacro()

void Puma::PreprocessorParser::defMacro ( const char *  ,
const char *  = (const char *) 0,
char  = 0 
) const

◆ defPredicate()

void Puma::PreprocessorParser::defPredicate ( const char *  ,
const char *   
) const

◆ defUndefinedMacro()

void Puma::PreprocessorParser::defUndefinedMacro ( const char *  ,
const char *  = (const char *) 0,
char  = 0 
) const

◆ fileIncluder() [1/2]

PreFileIncluder* Puma::PreprocessorParser::fileIncluder ( ) const
inline

◆ fileIncluder() [2/2]

void Puma::PreprocessorParser::fileIncluder ( PreFileIncluder f)
inline

◆ freeSyntaxTree()

void Puma::PreprocessorParser::freeSyntaxTree ( )

◆ importHandler()

const char* Puma::PreprocessorParser::importHandler ( ) const
inline

◆ levelState()

PreLevelState* Puma::PreprocessorParser::levelState ( ) const
inline

◆ locals()

UnitManager* Puma::PreprocessorParser::locals ( ) const
inline

◆ macroManager() [1/2]

PreMacroManager* Puma::PreprocessorParser::macroManager ( ) const
inline

◆ macroManager() [2/2]

void Puma::PreprocessorParser::macroManager ( PreMacroManager m)
inline

◆ macroStack()

Array<PreMacro*>* Puma::PreprocessorParser::macroStack ( ) const
inline

◆ map_token()

int Puma::PreprocessorParser::map_token ( Token token,
bool &  parse 
)

◆ next()

Token* Puma::PreprocessorParser::next ( )
virtual

Get the next token.

Returns
The next token from the source, or NULL if no more tokens.

Implements Puma::TokenSource.

◆ parse()

void Puma::PreprocessorParser::parse ( )

◆ parserState()

PreParserState* Puma::PreprocessorParser::parserState ( ) const
inline

◆ pre_mode()

PreMode Puma::PreprocessorParser::pre_mode ( ) const
inline

◆ predicateManager() [1/2]

PrePredicateManager* Puma::PreprocessorParser::predicateManager ( ) const
inline

◆ predicateManager() [2/2]

void Puma::PreprocessorParser::predicateManager ( PrePredicateManager p)
inline

◆ reset()

void Puma::PreprocessorParser::reset ( ErrorStream ,
UnitManager ,
UnitManager ,
std::ostream &  out = std::cout,
int  max_depth = 400 
)

◆ scanner()

TokenStream* Puma::PreprocessorParser::scanner ( ) const
inline

◆ silentMode()

void Puma::PreprocessorParser::silentMode ( bool  mode = true)
inline

◆ stream()

void Puma::PreprocessorParser::stream ( TokenStream s)
inline

◆ supportGNU() [1/2]

bool Puma::PreprocessorParser::supportGNU ( ) const
inline

◆ supportGNU() [2/2]

void Puma::PreprocessorParser::supportGNU ( bool  )

◆ syntaxTree()

PreTree* Puma::PreprocessorParser::syntaxTree ( ) const

◆ undefMacro()

void Puma::PreprocessorParser::undefMacro ( const char *  ) const

◆ undefPredicate()

void Puma::PreprocessorParser::undefPredicate ( const char *  ) const

◆ unitManager()

UnitManager* Puma::PreprocessorParser::unitManager ( ) const
inline