AndroMeta  2.0.0
AndroMeta/include/AndroMeta/MGenerator.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2009-2012 AndroMeta LLC. All rights reserved.
00003  *
00004  * AndroMeta LLC retains all intellectual property and proprietary 
00005  * rights to this software and related documentation and any modifications 
00006  * thereto.  Any use, reproduction, disclosure, or distribution of this 
00007  * software and related documentation without an express license agreement 
00008  * from AndroMeta LLC is strictly prohibited.
00009  * 
00010  */
00011 
00019 #ifndef ANDROMETA_M_GENERATOR_H
00020 #define ANDROMETA_M_GENERATOR_H
00021 
00022 #include <AndroMeta/MNode.h>
00023 #include <AndroMeta/MProcessor.h>
00024 
00025 namespace Meta{
00026   
00038   class MGenerator : public MProcessor{
00039   public:
00040     
00044     MGenerator();
00045     
00049     virtual ~MGenerator();
00050     
00058     void createFile(const mstr& fileName, std::ofstream& ostr);
00059     
00072     void finalizeFile(const mstr& fileName, std::ofstream& ostr);
00073     
00077     void setTarget(const mstr& target);
00078     
00082     const mstr& target() const;
00083     
00087     void setDirectory(const mstr& dir);
00088     
00093     const mstr& directory() const;
00094     
00098     void setDebugBuild(bool debug);
00099     
00104     bool isDebugBuild() const;
00105     
00111     bool isConcise() const;
00112     
00117     void setConcise(bool flag);
00118     
00131     void error(mnode n, const mstr& msg, bool warn=false);
00132     
00137     int status() const;
00138     
00142     void setStatus(int status);
00143     
00152     static int precedence(const mstr& functionName);
00153     
00158     static bool isStandardError(const mstr& errorName);
00159     
00167     static mstr formatMCode(mnode n,
00168                             const mstr& indent="");
00169 
00174     void setMessagePrefix(const mstr& prefix);
00175     
00179     virtual void clear() = 0;
00180     
00181   private:
00182     MGenerator& operator=(const MGenerator&);
00183     MGenerator(const MGenerator&);
00184     
00185     class MGenerator_* x_;
00186   };
00187   
00188 } // end namespace Meta
00189 
00190 #endif // ANDROMETA_M_GENERATOR_H
00191 
00192