AERA
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
r_comp::RepliStruct Class Reference

Public Types

enum  Type {
  Root, Structure, Set, Atom,
  Directive, Condition, Development
}
 

Public Member Functions

 RepliStruct (RepliStruct::Type type)
 
void reset ()
 
uint32 getIndent (std::istream *stream)
 
int32 parse (std::istream *stream, const std::string &file_path, uint32 &cur_indent, uint32 &prev_indent, int32 param_expect=0)
 
bool parseDirective (std::istream *stream, const std::string &file_path, uint32 &cur_indent, uint32 &prev_indent)
 
int32 process ()
 
RepliStructfindAtom (const std::string &name)
 
RepliStructloadReplicodeFile (const std::string &filename)
 
RepliStructclone () const
 
std::string print () const
 
std::string printError () const
 

Static Public Member Functions

static bool isFileLoaded (const std::string &file_path)
 

Public Attributes

Type type_
 
std::string cmd_
 
std::string tail_
 
std::string label_
 
std::string error_
 
uint32 line_
 
std::list< RepliStruct * > args_
 
RepliStructparent_
 
std::string filePath_
 

Static Public Attributes

static std::unordered_map< std::string, RepliMacro * > RepliMacros_
 
static std::unordered_map< std::string, int32 > Counters_
 
static std::list< RepliCondition * > Conditions_
 
static uint32 GlobalLine_ = 1
 
static std::vector< std::string > LoadedFilePaths_
 

Friends

std::ostream & operator<< (std::ostream &os, const RepliStruct &structure)
 
std::ostream & operator<< (std::ostream &os, RepliStruct *structure)
 

Detailed Description

Definition at line 98 of file preprocessor.h.

Member Function Documentation

◆ isFileLoaded()

bool r_comp::RepliStruct::isFileLoaded ( const std::string &  file_path)
static

Search RepliStruct::LoadedFilePaths_ to check if the filePath is already loaded. This checks for equivalent file paths.So, for example, "Test/file.replicode" will match with "/work/AERA/Test/file.replicode" and "Test/../Test/file.replicode" if they all refer to the same file.

Parameters
file_pathThe file path to check.
Returns
True if an equivalend file path is already loaded, otherwise false.

Definition at line 811 of file preprocessor.cpp.

◆ loadReplicodeFile()

RepliStruct * r_comp::RepliStruct::loadReplicodeFile ( const std::string &  filename)

Load the Replicode file from the filename and call parse, which will store the filename in any !load directives for later use.

Parameters
filenameThe file path which is already combined with the directory of the code with the !load directive.
Returns
The parsed code.

Definition at line 783 of file preprocessor.cpp.


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