CCCC - C and C++ Code Counter  9999-git
CCCC Development version (post-3.1.4)
Macros | Enumerations | Functions
cccc_utl.cc File Reference
#include "cccc.h"
#include "cccc_itm.h"
#include "cccc_utl.h"
#include "cccc_db.h"
#include "cccc_tok.h"
#include "AParser.h"
#include "ATokPtr.h"
#include <cassert>
#include <iomanip>
Include dependency graph for cccc_utl.cc:

Go to the source code of this file.

Macros

#define DEBUG_EXTENT_STREAMS   1
 
#define FS   "@"
 
#define RS   "\n"
 

Enumerations

enum  InOrOut { IO_IN, IO_OUT }
 

Functions

void insert_enum (ostream &os, int e)
 
void extract_enum (istream &is, int &e)
 
ostream & operator<< (ostream &os, AugmentedBool ab)
 
istream & operator>> (istream &is, AugmentedBool &ab)
 
ostream & operator<< (ostream &os, Visibility v)
 
istream & operator>> (istream &is, Visibility &v)
 
ostream & operator<< (ostream &os, UseType ut)
 
istream & operator>> (istream &is, UseType &ut)
 
static void toktrace (ANTLRAbstractToken *tok)
 
static void rectrace (const char *rulename, const char *dir_indic, int guessing, ANTLRAbstractToken *tok)
 

Macro Definition Documentation

#define DEBUG_EXTENT_STREAMS   1

Definition at line 33 of file cccc_utl.cc.

#define FS   "@"

Definition at line 45 of file cccc_utl.cc.

#define RS   "\n"

Definition at line 46 of file cccc_utl.cc.

Enumeration Type Documentation

enum InOrOut
Enumerator
IO_IN 
IO_OUT 

Definition at line 479 of file cccc_utl.cc.

479 { IO_IN, IO_OUT };

Function Documentation

void extract_enum ( istream &  is,
int &  e 
)

Definition at line 62 of file cccc_utl.cc.

63 {
64  e=0;
65  is >> (char&) e;
66 }

Here is the caller graph for this function:

void insert_enum ( ostream &  os,
int  e 
)

Definition at line 57 of file cccc_utl.cc.

58 {
59  os << (char) e;
60 }

Here is the caller graph for this function:

ostream& operator<< ( ostream &  os,
AugmentedBool  ab 
)

Definition at line 69 of file cccc_utl.cc.

69  {
70  insert_enum(os,ab);
71  return os;
72 }
void insert_enum(ostream &os, int e)
Definition: cccc_utl.cc:57

Here is the call graph for this function:

ostream& operator<< ( ostream &  os,
Visibility  v 
)

Definition at line 79 of file cccc_utl.cc.

79  {
80  insert_enum(os,v);
81  return os;
82 }
void insert_enum(ostream &os, int e)
Definition: cccc_utl.cc:57

Here is the call graph for this function:

ostream& operator<< ( ostream &  os,
UseType  ut 
)

Definition at line 89 of file cccc_utl.cc.

89  {
90  insert_enum(os,ut);
91  return os;
92 }
void insert_enum(ostream &os, int e)
Definition: cccc_utl.cc:57

Here is the call graph for this function:

istream& operator>> ( istream &  is,
AugmentedBool ab 
)

Definition at line 74 of file cccc_utl.cc.

74  {
75  extract_enum(is,(int&)ab);
76  return is;
77 }
void extract_enum(istream &is, int &e)
Definition: cccc_utl.cc:62

Here is the call graph for this function:

istream& operator>> ( istream &  is,
Visibility v 
)

Definition at line 84 of file cccc_utl.cc.

84  {
85  extract_enum(is,(int&)v);
86  return is;
87 }
void extract_enum(istream &is, int &e)
Definition: cccc_utl.cc:62

Here is the call graph for this function:

istream& operator>> ( istream &  is,
UseType ut 
)

Definition at line 94 of file cccc_utl.cc.

94  {
95  extract_enum(is,(int&)ut);
96  return is;
97 }
void extract_enum(istream &is, int &e)
Definition: cccc_utl.cc:62

Here is the call graph for this function:

static void rectrace ( const char *  rulename,
const char *  dir_indic,
int  guessing,
ANTLRAbstractToken *  tok 
)
static

Definition at line 481 of file cccc_utl.cc.

485 {
486  static int trace_depth=0;
487  if(guessing)
488  {
489  DbgMsg(PARSER,cerr,
490  setw(trace_depth*4+1) << "" << dir_indic
491  << "?" << rulename << endl);
492  }
493  else
494  {
495  trace_depth=((ANTLRToken*) tok)->getNestingLevel();
496  DbgMsg(PARSER,cerr,
497  setw(trace_depth*4)<< "" << dir_indic << rulename << endl);
498  }
499 }
Definition: cccc.h:45
#define DbgMsg(DF, OS, X)
Definition: cccc.h:51

Here is the caller graph for this function:

static void toktrace ( ANTLRAbstractToken *  tok)
static

Definition at line 460 of file cccc_utl.cc.

461 {
462  // at the LHS we put out information about the current token
463  if(tok != NULL)
464  {
465  DbgMsg(PARSER,cerr,
466  std::setw(6) << tok->getLine()
467  << std::setw(4) << (int)tok->getType()
468  << std::setiosflags(ios::left)
469  << std::resetiosflags(ios::right)
470  << std::setw(20) << tok->getText()
471  );
472  }
473  else
474  {
475  DbgMsg(PARSER,cerr,std::setw(30)<<"");
476  }
477 }
Definition: cccc.h:45
#define DbgMsg(DF, OS, X)
Definition: cccc.h:51

Here is the caller graph for this function: