Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

TApplication Class Reference

UESQLC compiler application. More...

#include <application.hh>

Inheritance diagram for TApplication:

mpcl::TAbstractApplication List of all members.

Public Methods

 TApplication (const char *pkcAPPLICATION_NAME, const char *pkcAPPLICATION_RELEASE, int iPARAMETER_COUNT, const char **ppkcPARAMETERS)
 ~TApplication (void)
 Destroys the instance.

void bindCodeParameter (const TString &rkyVARIABLE, const TString &rkyVALUE)
TString collapseStringLiteral (const char *pkcSOURCE_TEXT)
void handleTarget (const TString &rkySOURCE_TEXT)
int identifyToken (const char *pkcSOURCE_TEXT, unsigned int uiPERIOD_COUNT=0)
void initCodeParameters (void)
void initialize (void)
void loadCodeGenerator (const TString &rkyTARGET)
void outputClauseCode (const char *pkcINSTRUCTION_NAME, const char *pkcCLAUSE_NAME="body")
void outputCode (const char *pkccSOURCE_TEXT, size_t zLENGTH=0)
void outputCode (const TString &rkySOURCE_TEXT)
void postAppend (const TString &rkySOURCE_TEXT)
void preAppend (const TString &rkySOURCE_TEXT)
void pushTokenName (const char *pkcLAST_TOKEN)
void pushTokenName (const TString &kyLAST_TOKEN)
void setCompilationFailed (void)
 Sets the compilation status to failed.

int splitToken (unsigned int uiPERIOD_COUNT) throw (TFatalException)
int start (void)
bool compilationFailed (void) const
 Gets the compilation status.

void createComplementaryFiles (void) const
TString debugDescription (void) const
 Gets debug description, according with debug level.

TString getClauseCode (const char *pkcINSTRUCTION_NAME, const char *pkcCLAUSE_NAME="body")
size_t getEmbeddedLineNumber (void) const
TString getLineDirective (unsigned int uiLINE_NUMBER=0) const
void handleCompilerError (const char *pkcMESSAGE)
bool isReusingTarget (void) const
void printDebugInformation (void) const
 Writes to standard error a debug description, according with debug level.

TString programFileName (void) const
void require (long int liINVARIANT_IDENTIFIER...) const
bool useLineDirective (void) const

Detailed Description

UESQLC compiler application.

Definition at line 51 of file application.hh.


Constructor & Destructor Documentation

TApplication::TApplication const char *    pkcAPPLICATION_NAME,
const char *    pkcAPPLICATION_RELEASE,
int    iPARAMETER_COUNT,
const char **    ppkcPARAMETERS
 

Builds a new instance.

Parameters:
pkcAPPLICATION_NAME  Application name.
pkcAPPLICATION_RELEASE  Application release.
iPARAMETER_COUNT  Parameter count.
ppkcPARAMETERS  Parameter array.

Definition at line 50 of file application.cc.


Member Function Documentation

void TApplication::bindCodeParameter const TString &    rkyVARIABLE,
const TString &    rkyVALUE
[inline]
 

Binds code parameter rktVARIABLE with value rkyVALUE.

Parameters:
rkyVARIABLE  Code parameter name.
rkyVALUE  Code parameter value.

Definition at line 206 of file application.hh.

References mpcl::text::TString.

mpcl::text::TString TApplication::collapseStringLiteral const char *    pkcSOURCE_TEXT
 

Collapses multiple string_literal parts into an only one.

Parameters:
pkcSOURCE_TEXT  Source text with multiple string_literal parts.
Returns:
Collapsed string.

Definition at line 335 of file application.cc.

void TApplication::createComplementaryFiles void    const
 

Create complementary files (if any). These files correspond with all variables named as "file::*".

Definition at line 1176 of file application.cc.

References mpcl::text::TString.

Referenced by start().

mpcl::text::TString TApplication::getClauseCode const char *    pkcINSTRUCTION_NAME,
const char *    pkcCLAUSE_NAME = "body"
 

Gets clause body for clause pkcCLAUSE_NAME in instruction pkcINSTRUCTION_NAME.

Parameters:
pkcINSTRUCTION_NAME  Instruction name.
pkcCLAUSE_NAME  Clause name.
Returns:
Clause code.

Definition at line 1232 of file application.cc.

References programFileName(), and mpcl::text::TString.

Referenced by outputClauseCode().

size_t TApplication::getEmbeddedLineNumber void    const [inline]
 

Gets line directive for in line uiLINE_NUMBER. If uiLINE_NUMBER isn't passed, then it uses the line number of the last embedded introducer.

Parameters:
uiLINE_NUMBER  Line number.
Returns:
Text for line directive.

Definition at line 381 of file application.hh.

mpcl::text::TString TApplication::getLineDirective unsigned int    uiLINE_NUMBER = 0 const
 

Gets line directive for in line uiLINE_NUMBER. If uiLINE_NUMBER isn't passed, then it uses the line number of the last embedded introducer.

Parameters:
uiLINE_NUMBER  Line number.
Returns:
Text for line directive.

Definition at line 1305 of file application.cc.

References mpcl::text::Format().

void TApplication::handleCompilerError const char *    pkcMESSAGE
 

Handles syntactic errors. Throws an TErrorException exception with pkcMESSAGE message.

Parameters:
pkcMESSAGE  Error message.
Exceptions:
TErrorException  Exception for errors.

Definition at line 1313 of file application.cc.

References mpcl::text::Format(), setCompilationFailed(), and mpcl::text::TString.

void TApplication::handleTarget const TString &    rkySOURCE_TEXT
 

Extracts target from EMBEDDED_SQL_BEGIN and sets the proper CDML target.

Parameters:
rkySOURCE_TEXT  Source text with parsed string.

Referenced by start().

int TApplication::identifyToken const char *    pkcSOURCE_TEXT,
unsigned int    uiPERIOD_COUNT = 0
 

Searches reserved-word map for the token bound to pkcSOURCE_TEXT, and if it is found, then the token is returned, else token IDENTIFIER_BODY is returned. But, if uiPERIOD_COUNT is not zero, then it calls splitToken() cause it is multi-identifier token.

Parameters:
pkcSOURCE_TEXT  Token name.
uiPERIOD_COUNT  Period count.
Returns:
Token code.

Definition at line 572 of file application.cc.

References printDebugInformation(), pushTokenName(), splitToken(), and mpcl::text::TString.

void TApplication::initCodeParameters void   
 

Initializes tCodeParametersMap with one value. That value is "_target", that contains the current target value.

Definition at line 626 of file application.cc.

void TApplication::initialize void    [virtual]
 

Initialize from parameters.

Implements mpcl::TAbstractApplication.

Definition at line 650 of file application.cc.

References mpcl::invariant::IVerifier< TStackValue * >::addConformanceLevel(), and mpcl::invariant::IVerifier< TStackValue * >::clearConformanceLevelSet().

bool TApplication::isReusingTarget void    const
 

Returns true if current target has been used before.

Returns:
True if reusing target.

Definition at line 1328 of file application.cc.

void TApplication::loadCodeGenerator const TString &    rkyTARGET
 

Loads the code-generator with the proper CDML target file. It doesn't load it, if it has been loaded before.

Parameters:
rkyTARGET  Target code generator.

Referenced by start().

void TApplication::outputClauseCode const char *    pkcINSTRUCTION_NAME,
const char *    pkcCLAUSE_NAME = "body"
[inline]
 

Writes on output, the code corresponding to instruction pkcINSTRUCTION_NAME and clause pkcCLAUSE_NAME.

Parameters:
pkcINSTRUCTION_NAME  Instruction name.
pkcCLAUSE_NAME  Clause name.

Definition at line 261 of file application.hh.

References getClauseCode().

void TApplication::outputCode const TString &    rkySOURCE_TEXT [inline]
 

Appends on output, the text in rkySOURCE_TEXT.

Parameters:
rkySOURCE_TEXT  Source text.

Definition at line 277 of file application.hh.

References mpcl::text::TString.

void TApplication::outputCode const char *    pkccSOURCE_TEXT,
size_t    zLENGTH = 0
 

Appends on output, zLENGTH characters from pkcSOURCE_TEXT.

Parameters:
pkccSOURCE_TEXT  Source text.
zLENGTH  Source text length.

Definition at line 832 of file application.cc.

void TApplication::postAppend const TString &    rkySOURCE_TEXT [inline]
 

Writes at the end of output, the text rkySOURCE_TEXT.

Parameters:
rkySOURCE_TEXT  Source text.

Definition at line 286 of file application.hh.

References mpcl::text::TString.

void TApplication::preAppend const TString &    rkySOURCE_TEXT [inline]
 

Writes at the begining of output, the text rkySOURCE_TEXT.

Parameters:
rkySOURCE_TEXT  Source text.

Definition at line 295 of file application.hh.

References mpcl::text::TString.

TString TApplication::programFileName void    const [inline, virtual]
 

Returns compiler program file name.

Returns:
Program file name.

Implements mpcl::TAbstractApplication.

Definition at line 422 of file application.hh.

References mpcl::text::TString.

Referenced by getClauseCode().

void TApplication::pushTokenName const TString &    kyLAST_TOKEN [inline]
 

Sets the last read token from scanner.

Parameters:
kyLAST_TOKEN  Last token read.

Definition at line 313 of file application.hh.

References mpcl::text::TString.

void TApplication::pushTokenName const char *    pkcLAST_TOKEN [inline]
 

Sets the last read token from scanner.

Parameters:
pkcLAST_TOKEN  Last token read.

Definition at line 304 of file application.hh.

Referenced by identifyToken().

void TApplication::require long int    liINVARIANT_IDENTIFIER... const
 

Verifies that invariant corresponding to liINVARIANT_IDENTIFIER, is true. If not, then throws the corresponding exception.

Parameters:
liINVARIANT_IDENTIFIER  Invariant identifier.
Warning:
The proper declaration for this member function is: void require (long int, TStackValue*...);

Definition at line 1437 of file application.cc.

int TApplication::splitToken unsigned int    uiPERIOD_COUNT throw (TFatalException)
 

Splits the token in yytext in, uiPERIOD_COUNT plus one, identifiers, and then, stored in the parser stack. It returns FOURTH_LEVEL_IDENTIFIER, THIRD_LEVEL_IDENTIFIER or SECOND_LEVEL_IDENTIFIER, corresponding to the number of periods inside the token.

Parameters:
uiPERIOD_COUNT  Period count.
Returns:
Token code.

Definition at line 847 of file application.cc.

References mpcl::text::TString, and mpcl::text::Uppercase().

Referenced by identifyToken().

int TApplication::start void    [virtual]
 

Opens files and runs the compiler.

Returns:
Exit status.

Implements mpcl::TAbstractApplication.

Definition at line 903 of file application.cc.

References compilationFailed(), createComplementaryFiles(), mpcl::text::Format(), handleTarget(), loadCodeGenerator(), mpcl::TAbstractApplication::release(), and mpcl::text::TString.

bool TApplication::useLineDirective void    const [inline]
 

Returns true if compiler must use 'line' preprocessor directive. This depends on the language selected, because only C derived languages have this preprocessor directive.

Returns:
True if the compiler must include line directives.

Definition at line 442 of file application.hh.

References mpcl::text::TString, and useLineDirective().

Referenced by useLineDirective().


The documentation for this class was generated from the following files:
Generated on Mon Oct 13 02:40:11 2003 for UESQLC by doxygen1.2.18