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

parse_util.hh File Reference

Go to the source code of this file.

Compounds

struct  t_Position
struct  t_CodeChunk
class  ParseException

Typedefs

typedef struct t_Position  Position
typedef struct t_CodeChunk  CodeChunk

Functions

ostream& operator<< (ostream &os, const Position &pos)
string formatError (const Position &pos, const string &message)
string formatError (const string &message)
string formatError (const ParseException &ex)
string formatWarning (const Position &pos, const string &message)
string formatWarning (const string &message)
void die (const string &message)


Typedef Documentation

typedef struct t_Position Position
 

A position into the input file. The usual line&column thing.

Referenced by IEbnfNodeBuilder_createCatNode(), IEbnfNodeBuilder_createCatchClause(), IEbnfNodeBuilder_createLaSpec(), IEbnfNodeBuilder_createNonterminalNode(), IEbnfNodeBuilder_createOptionalNode(), IEbnfNodeBuilder_createOrNode(), IEbnfNodeBuilder_createPlusNode(), IEbnfNodeBuilder_createStarNode(), IEbnfNodeBuilder_createTerminalNode(), IEbnfNodeBuilder_setEndCode(), IEbnfNodeBuilder_setStartCode(), IParserSpec_addCodeBlock(), IParserSpec_addProduction(), IParserSpec_setInheritance(), IParserSpec_setPreambleCode(), IReNodeBuilder_createCatNode(), IReNodeBuilder_createCharListNode(), IReNodeBuilder_createOptionalNode(), IReNodeBuilder_createOrNode(), IReNodeBuilder_createPlusNode(), IReNodeBuilder_createStarNode(), IReNodeBuilder_createStringLiteralNode(), IScannerSpec_addCodeBlock(), IScannerSpec_addKeywordToken(), IScannerSpec_addMoreToken(), IScannerSpec_addRegToken(), IScannerSpec_addSkipToken(), IScannerSpec_addSpecialToken(), IScannerSpec_setInheritance(), IScannerSpec_setPreambleCode(), ITokenSpec_addCodeBlock(), ITokenSpec_setInheritance(), ITokenSpec_setPreambleCode(), MacroTokenExpander_addMacro(), MacroTokenExpander_getMacro(), OptionsRecorder_setBoolOption(), OptionsRecorder_setIntOption(), OptionsRecorder_setStringOption(), ScannerSpec::ScannerSpec(), formatError(), formatWarning(), EbnfLl1CheckAlgo::operator()(), ScannerSpec::updateStates(), ScannerDfaWriter::writeScanner(), yyerror(), and yywarn().

typedef struct t_CodeChunk CodeChunk
 

This structure keeps a chunk of user code and the starting position in the file from where it came from (we use the positions to generate the line thingies.

Definition at line 58 of file writer.hh.


Function Documentation

ostream & operator<< ( ostream & os,
const Position & pos ) [inline]
 

Definition at line 119 of file parse_util.hh.

string formatError ( const Position & pos,
const string & message )
 

Returns a string of the form:

Error: <line>:<column>: <message>.

If the column number is 0, it is not included in the error line.

string formatError ( const string & message )
 

Returns a string of the form:

Error: <message>.

string formatError ( const ParseException & ex )
 

Returns a string of the fom:

Errro: <ex.where()>. <ex.what()>.

Definition at line 61 of file parse_util.cc.

Referenced by IEbnfNodeBuilder_createTerminalNode(), IParserSpec_addProduction(), IScannerSpec_addKeywordToken(), IScannerSpec_addMoreToken(), IScannerSpec_addRegToken(), IScannerSpec_addSkipToken(), IScannerSpec_addSpecialToken(), MacroTokenExpander_getMacro(), OptionsRecorder_setBoolOption(), OptionsRecorder_setIntOption(), OptionsRecorder_setStringOption(), DfaReNodeBuilder::createCharListNode(), formatError(), main(), LexYaccParser::parse(), CppCcDriver::run(), and yyerror().

string formatWarning ( const Position & pos,
const string & message )
 

Returns a string of the form:

Warning: <line>:<column>: <message>.

If the column number is 0, it is not included in the error line.

string formatWarning ( const string & message )
 

Returns a string of the form:

Warning: <message>.

Definition at line 81 of file parse_util.cc.

Referenced by MacroTokenExpander::addMacro(), LaEpDeclWriter::operator()(), EbnfLl1CheckAlgo::warn(), LaParserWriter::writeProductionLaDecls(), ScannerDfaWriter::writeScanner(), and yywarn().

void die ( const string & message )
 

Prints an error message of the form:

CppCC: <message>

then exit(1)s.

Definition at line 87 of file parse_util.cc.

Referenced by IEbnfNodeBuilder_createTerminalNode(), IParserSpec_addProduction(), IScannerSpec_addKeywordToken(), IScannerSpec_addMoreToken(), IScannerSpec_addRegToken(), IScannerSpec_addSkipToken(), IScannerSpec_addSpecialToken(), MacroTokenExpander_getMacro(), OptionsRecorder_setBoolOption(), OptionsRecorder_setIntOption(), OptionsRecorder_setStringOption(), DfaReNodeBuilder::createCharListNode(), cw_die(), main(), Writer::openStream(), LexYaccParser::parse(), CppCcDriver::run(), yyerror(), and yywarn().


Generated at Tue Jul 9 21:05:47 2002 for CppCC by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001