mirror of https://github.com/CGAL/cgal
Release before handing over to Susan Hert.
This commit is contained in:
parent
730575e298
commit
5c0cd50a43
|
|
@ -1,7 +1,7 @@
|
|||
INSTALLATION for the Specification and Manual Writing Tools
|
||||
for C++ Reference Manuals
|
||||
===========================================================
|
||||
03.08.1998 Zurich Lutz Kettner
|
||||
24.08.1999 Zurich Lutz Kettner
|
||||
|
||||
|
||||
Installation of the Supporting Tools:
|
||||
|
|
@ -11,7 +11,7 @@ Installation of the Supporting Tools:
|
|||
|
||||
(1) System Requirements:
|
||||
|
||||
* C++ Compiler (Gnu g++ 2.8.1 and SGI CC 7.2 were tested)
|
||||
* C++ Compiler (Gnu g++ 2.8.1, 2.95.1, Gnu egcs 1.1.2)
|
||||
* C Compiler (Gnu gcc 2.6.3 or the usual system cc compiler)
|
||||
* flex and bison
|
||||
* perl 5
|
||||
|
|
|
|||
|
|
@ -94,20 +94,22 @@ all: $(ALL)
|
|||
# modules
|
||||
# --------------------
|
||||
|
||||
database.o : database.C database.h config.h
|
||||
basic.o : basic.h
|
||||
|
||||
extract_lex.o : extract_syntax.tab.h database.h config.h
|
||||
buffer.o : buffer.C buffer.h config.h basic.h
|
||||
|
||||
extract_syntax.o : extract_syntax.tab.h database.h config.h
|
||||
extract_lex.o : extract_syntax.tab.h buffer.h config.h basic.h
|
||||
|
||||
cc_extract.o : database.h config.h
|
||||
extract_syntax.o : extract_syntax.tab.h buffer.h config.h basic.h
|
||||
|
||||
cc_build_checker.o : database.h config.h
|
||||
cc_extract.o : buffer.h config.h basic.h
|
||||
|
||||
cc_build_checker.o : buffer.h config.h basic.h
|
||||
|
||||
# program
|
||||
# --------------------
|
||||
OBJ = extract_lex.o extract_syntax.o database.o
|
||||
HEADER = extract_syntax.tab.h database.h config.h
|
||||
OBJ = extract_lex.o extract_syntax.o buffer.o basic.o
|
||||
HEADER = extract_syntax.tab.h buffer.h config.h basic.h
|
||||
|
||||
cc_extract : ${OBJ} ${HEADER} cc_extract.o
|
||||
${CXX} ${CXXFLAGS} -o $@ $@.o ${OBJ} ${LDFLAGS}
|
||||
|
|
@ -132,7 +134,8 @@ cc_extract_html.o : cc_extract_html.C
|
|||
# --------------------
|
||||
OBJHTML = html_lex.o \
|
||||
html_syntax.o \
|
||||
database.o \
|
||||
basic.o \
|
||||
buffer.o \
|
||||
macro_dictionary.o \
|
||||
internal_macros.o \
|
||||
html_error.o \
|
||||
|
|
@ -202,7 +205,8 @@ install: rminstall pathinstall cpinstall mvinstall refinstall gifinstall
|
|||
|
||||
DEPENDSRC = html_lex.C \
|
||||
html_syntax.C \
|
||||
database.C \
|
||||
basic.C \
|
||||
buffer.C \
|
||||
macro_dictionary.C \
|
||||
internal_macros.C \
|
||||
html_error.C \
|
||||
|
|
@ -216,7 +220,7 @@ DEPENDSRC = html_lex.C \
|
|||
|
||||
depend: ${DEPENDSRC}
|
||||
# Works only with SunPro CC
|
||||
CC -I. ${CPPFLAGS} ${CXXFLAGS} -xM1 ${DEPENDSRC} | grep -v "STL/SUN" | grep -v "ADT" | grep -v "opt/SUNWspro" | sort | uniq > Makefile_depend
|
||||
CC -I. ${CPPFLAGS} ${CXXFLAGS} -xM1 ${DEPENDSRC} | grep -v "STL/SUN" | grep -v "opt/SUNWspro" | sort | uniq > Makefile_depend
|
||||
|
||||
|
||||
# =====================================================================
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
cc_extract_html.C:
|
||||
cc_extract_html.o : ./database.h
|
||||
cc_extract_html.o : ./basic.h
|
||||
cc_extract_html.o : ./buffer.h
|
||||
cc_extract_html.o : ./html_config.h
|
||||
cc_extract_html.o : ./html_error.h
|
||||
cc_extract_html.o : ./html_lex.h
|
||||
|
|
@ -13,7 +14,8 @@ cc_extract_html.o : ./string_conversion.h
|
|||
cc_extract_html.o : cc_extract_html.C
|
||||
cpp_formatting.C:
|
||||
cpp_formatting.o : ./cpp_formatting.h
|
||||
cpp_formatting.o : ./database.h
|
||||
cpp_formatting.o : ./basic.h
|
||||
cpp_formatting.o : ./buffer.h
|
||||
cpp_formatting.o : ./html_config.h
|
||||
cpp_formatting.o : ./html_error.h
|
||||
cpp_formatting.o : ./html_lex.h
|
||||
|
|
@ -23,18 +25,21 @@ cpp_formatting.o : ./mstring.h
|
|||
cpp_formatting.o : ./output.h
|
||||
cpp_formatting.o : ./string_conversion.h
|
||||
cpp_formatting.o : cpp_formatting.C
|
||||
database.C:
|
||||
database.o : ./database.h
|
||||
database.o : database.C
|
||||
buffer.C:
|
||||
buffer.o : ./basic.h
|
||||
buffer.o : ./buffer.h
|
||||
buffer.o : buffer.C
|
||||
html_error.C:
|
||||
html_error.o : ./database.h
|
||||
html_error.o : ./basic.h
|
||||
html_error.o : ./buffer.h
|
||||
html_error.o : ./html_config.h
|
||||
html_error.o : ./html_error.h
|
||||
html_error.o : ./lex_include.h
|
||||
html_error.o : ./mstring.h
|
||||
html_error.o : html_error.C
|
||||
html_lex.C:
|
||||
html_lex.o : ./database.h
|
||||
html_lex.o : ./basic.h
|
||||
html_lex.o : ./buffer.h
|
||||
html_lex.o : ./html_config.h
|
||||
html_lex.o : ./html_error.h
|
||||
html_lex.o : ./html_lex.h
|
||||
|
|
@ -47,8 +52,9 @@ html_lex.o : ./mstring.h
|
|||
html_lex.o : ./string_conversion.h
|
||||
html_lex.o : html_lex.C
|
||||
html_syntax.C:
|
||||
html_syntax.o : ./basic.h
|
||||
html_syntax.o : ./cpp_formatting.h
|
||||
html_syntax.o : ./database.h
|
||||
html_syntax.o : ./buffer.h
|
||||
html_syntax.o : ./html_config.h
|
||||
html_syntax.o : ./html_error.h
|
||||
html_syntax.o : ./html_lex.h
|
||||
|
|
@ -60,8 +66,9 @@ html_syntax.o : ./mstring.h
|
|||
html_syntax.o : ./string_conversion.h
|
||||
html_syntax.o : html_syntax.C
|
||||
internal_macros.C:
|
||||
internal_macros.o : ./basic.h
|
||||
internal_macros.o : ./cpp_formatting.h
|
||||
internal_macros.o : ./database.h
|
||||
internal_macros.o : ./buffer.h
|
||||
internal_macros.o : ./html_config.h
|
||||
internal_macros.o : ./html_error.h
|
||||
internal_macros.o : ./html_lex.h
|
||||
|
|
@ -73,7 +80,8 @@ internal_macros.o : ./output.h
|
|||
internal_macros.o : ./string_conversion.h
|
||||
internal_macros.o : internal_macros.C
|
||||
macro_dictionary.C:
|
||||
macro_dictionary.o : ./database.h
|
||||
macro_dictionary.o : ./basic.h
|
||||
macro_dictionary.o : ./buffer.h
|
||||
macro_dictionary.o : ./html_config.h
|
||||
macro_dictionary.o : ./html_error.h
|
||||
macro_dictionary.o : ./html_lex.h
|
||||
|
|
@ -83,8 +91,9 @@ macro_dictionary.o : ./mstring.h
|
|||
macro_dictionary.o : ./string_conversion.h
|
||||
macro_dictionary.o : macro_dictionary.C
|
||||
output.C:
|
||||
output.o : ./basic.h
|
||||
output.o : ./cpp_formatting.h
|
||||
output.o : ./database.h
|
||||
output.o : ./buffer.h
|
||||
output.o : ./html_config.h
|
||||
output.o : ./html_error.h
|
||||
output.o : ./html_lex.h
|
||||
|
|
@ -94,7 +103,8 @@ output.o : ./output.h
|
|||
output.o : ./string_conversion.h
|
||||
output.o : output.C
|
||||
string_conversion.C:
|
||||
string_conversion.o : ./database.h
|
||||
string_conversion.o : ./basic.h
|
||||
string_conversion.o : ./buffer.h
|
||||
string_conversion.o : ./html_config.h
|
||||
string_conversion.o : ./html_lex.h
|
||||
string_conversion.o : ./mstring.h
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
README for the Specification and Manual Writing Tools
|
||||
for C++ Reference Manuals
|
||||
=====================================================
|
||||
03.08.1998 Zurich Lutz Kettner kettner@acm.org
|
||||
24.08.1999 Zurich Lutz Kettner kettner@acm.org
|
||||
|
||||
This is the directory containing the tools for extracting the
|
||||
C++ declarations from a specification, to check the specification
|
||||
|
|
@ -12,7 +12,6 @@ The directory structure is:
|
|||
INSTALLATION installation instructions.
|
||||
|
||||
RCS/ revision controlled files.
|
||||
ADT/ a list and a stack implementation.
|
||||
latex_converter_config/ configuration files for the LaTeX converter.
|
||||
test/ test suit.
|
||||
test_html/ conversion example using multiple directories.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,101 @@
|
|||
/**************************************************************************
|
||||
|
||||
basic.C
|
||||
=============================================================
|
||||
Project : CGAL merger tool for the specification task
|
||||
Function : Assertions, indented output, etc.
|
||||
System : C++ (g++)
|
||||
Author : (c) 1995 Lutz Kettner
|
||||
(c) 1999 Susan Hert
|
||||
Revision : $Revision$
|
||||
Date : $Date$
|
||||
|
||||
**************************************************************************/
|
||||
|
||||
#include <basic.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// Own assertion macro
|
||||
// ================================================
|
||||
|
||||
void cc_assertion_error( char *cond, char *fname, int line) {
|
||||
cerr << endl << "fatal error: assertion '" << cond << "' failed in line "
|
||||
<< line << " of file '" << fname << "'." << endl;
|
||||
abort();
|
||||
}
|
||||
|
||||
// Indented output, using global indentation counter
|
||||
// ====================================================
|
||||
|
||||
class Output_indentation {
|
||||
int n;
|
||||
int step;
|
||||
public:
|
||||
Output_indentation( int stepSize = 4) : n(0), step( stepSize) {}
|
||||
void operator++(){ n += step;}
|
||||
void operator--(){ n -= step;}
|
||||
int indentation() { return n; }
|
||||
};
|
||||
|
||||
ostream& operator<< (ostream& out, Output_indentation& ind) {
|
||||
const char* s = " "; // 32 spaces !!!
|
||||
int n = ind.indentation();
|
||||
while ( n > 32) { // 32 !!!
|
||||
n -= 32;
|
||||
out << s;
|
||||
}
|
||||
if ( n > 0)
|
||||
out << (s + 32 - n);
|
||||
return out;
|
||||
}
|
||||
|
||||
static Output_indentation output_indentation;
|
||||
|
||||
ostream& indent( ostream& out){
|
||||
++ output_indentation;
|
||||
return out;
|
||||
}
|
||||
|
||||
ostream& outdent( ostream& out){
|
||||
-- output_indentation;
|
||||
return out;
|
||||
}
|
||||
|
||||
ostream& ind_newline( ostream& out){
|
||||
out << endl << output_indentation;
|
||||
return out;
|
||||
}
|
||||
|
||||
ostream& ind_space( ostream& out){
|
||||
out << output_indentation;
|
||||
return out;
|
||||
}
|
||||
|
||||
int indentation_number() {
|
||||
return output_indentation.indentation();
|
||||
}
|
||||
|
||||
// Substitute old style malloc, realloc, strdup ...
|
||||
// ================================================
|
||||
char* renew( char* old, size_t old_size, size_t new_size) {
|
||||
CC_Assert( old_size == 0 || old != 0);
|
||||
CC_Assert( new_size > old_size);
|
||||
char* cpy = new char[ new_size];
|
||||
if ( old && old_size > 0) {
|
||||
size_t min = ( old_size < new_size ? old_size : new_size);
|
||||
memcpy( cpy, old, min);
|
||||
delete[] old;
|
||||
}
|
||||
return cpy;
|
||||
}
|
||||
|
||||
char* newstr( const char* src) {
|
||||
CC_Assert( src);
|
||||
if ( ! src)
|
||||
return 0;
|
||||
char* s = new char[ strlen( src) + 1];
|
||||
strcpy( s, src);
|
||||
return s;
|
||||
}
|
||||
|
||||
// EOF //
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
/**************************************************************************
|
||||
|
||||
basic.h
|
||||
=============================================================
|
||||
Project : CGAL merger tool for the specification task
|
||||
Function : Assertions, indented output, etc.
|
||||
System : C++ (g++)
|
||||
Author : (c) 1995 Lutz Kettner
|
||||
(c) 1999 Susan Hert
|
||||
Revision : $Revision$
|
||||
Date : $Date$
|
||||
|
||||
**************************************************************************/
|
||||
|
||||
#if ! defined( MODULE_BASIC)
|
||||
#define MODULE_BASIC 1
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <iostream.h>
|
||||
|
||||
// Own assertion macro
|
||||
// ================================================
|
||||
|
||||
void cc_assertion_error( char *cond, char *fname, int line);
|
||||
|
||||
#if !NDEBUG
|
||||
#define CC_Assert( cond) {\
|
||||
if (!( cond)) \
|
||||
cc_assertion_error( #cond, __FILE__, __LINE__); \
|
||||
}
|
||||
#else // NDEBUG
|
||||
#define CC_Assert( cond) (void)0
|
||||
#endif // NDEBUG
|
||||
|
||||
|
||||
// Indented output, using global indentation counter
|
||||
// ====================================================
|
||||
|
||||
ostream& indent( ostream&);
|
||||
ostream& outdent( ostream&);
|
||||
ostream& ind_newline( ostream&);
|
||||
ostream& ind_space( ostream&);
|
||||
int indentation_number();
|
||||
|
||||
// Substitute old style malloc, realloc, strdup ...
|
||||
// ================================================
|
||||
|
||||
char* renew( char* old, size_t old_size, size_t new_size);
|
||||
char* newstr( const char* src);
|
||||
|
||||
|
||||
|
||||
#endif // MODULE_BASIC //
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
/**************************************************************************
|
||||
|
||||
database.C
|
||||
buffer.C
|
||||
=============================================================
|
||||
Project : CGAL merger tool for the specification task
|
||||
Function : Datastructures for the database extracted from
|
||||
the TeX and C++ code mixed files.
|
||||
Function : List of buffers (similar to strings) keeping the text
|
||||
parsed from the TeX input files.
|
||||
System : C++ (g++)
|
||||
Author : (c) 1995 Lutz Kettner
|
||||
Revision : $Revision$
|
||||
|
|
@ -12,239 +12,12 @@
|
|||
|
||||
**************************************************************************/
|
||||
|
||||
// Other modules needed:
|
||||
// =====================
|
||||
#include <database.h>
|
||||
#include <ADT/adtbase.cc>
|
||||
#include <buffer.h>
|
||||
|
||||
|
||||
// Substitute old style malloc, realloc, strdup ...
|
||||
// ================================================
|
||||
char* renew( char* old, size_t old_size, size_t new_size) {
|
||||
ADT_Assert( old_size == 0 || old != 0);
|
||||
ADT_Assert( new_size > old_size);
|
||||
char* cpy = new char[ new_size];
|
||||
if ( old && old_size > 0) {
|
||||
size_t min = ( old_size < new_size ? old_size : new_size);
|
||||
memcpy( cpy, old, min);
|
||||
delete[] old;
|
||||
}
|
||||
return cpy;
|
||||
void delete_list( Buffer_list* l) {
|
||||
for ( Buffer_iterator i = l->begin(); i != l->end(); ++i)
|
||||
delete *i;
|
||||
delete l;
|
||||
}
|
||||
|
||||
char* newstr( const char* src) {
|
||||
ADT_Assert( src);
|
||||
if ( ! src)
|
||||
return 0;
|
||||
char* s = new char[ strlen( src) + 1];
|
||||
strcpy( s, src);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
// Class definitions:
|
||||
// ==============================================
|
||||
int printComment( ostream &out, const Text& T, bool leadingLine, bool HTML) {
|
||||
InListFIter< TextToken> words( (Text&)T);
|
||||
int width = MaxTextWidth - indentation_number() - 3;
|
||||
int w = width;
|
||||
int state = 0; // 0 = start, 1 = after token, 2 = spaces
|
||||
// 3 = one newline (and spaces), 4 = newlines
|
||||
ForAll( words) {
|
||||
switch ( state) {
|
||||
case 0:
|
||||
if ( !words->isSpace) {
|
||||
if ( leadingLine)
|
||||
out << endl;
|
||||
out << indNewline << (HTML ? "" : "// ") << words->string;
|
||||
w -= words->len;
|
||||
state = 1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if ( !words->isSpace || words->len > 0) {
|
||||
if ( !words->isSpace) {
|
||||
if ((words->len > w) && (w != width)) {
|
||||
w = width;
|
||||
out << indNewline << (HTML ? "" : "// ");
|
||||
}
|
||||
out << words->string;
|
||||
w -= words->len;
|
||||
} else {
|
||||
if ( words->string[0] == '\n')
|
||||
state = 3;
|
||||
else
|
||||
state = 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if ( !words->isSpace || words->len > 0) {
|
||||
if ( !words->isSpace) {
|
||||
if ((words->len >= w) && (w != width)) {
|
||||
w = width;
|
||||
out << indNewline << (HTML ? "" : "// ");
|
||||
} else {
|
||||
out << ' ';
|
||||
w--;
|
||||
}
|
||||
out << words->string;
|
||||
w -= words->len;
|
||||
state = 1;
|
||||
} else {
|
||||
if ( words->string[0] == '\n')
|
||||
state = 3;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if ( !words->isSpace || words->len > 0) {
|
||||
if ( !words->isSpace) {
|
||||
if ((words->len >= w) && (w != width)) {
|
||||
w = width;
|
||||
out << indNewline << (HTML ? "" : "// ");
|
||||
} else {
|
||||
out << ' ';
|
||||
w--;
|
||||
}
|
||||
out << words->string;
|
||||
w -= words->len;
|
||||
state = 1;
|
||||
} else {
|
||||
if ( words->string[0] == '\n')
|
||||
state = 4;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if ( !words->isSpace || words->len > 0) {
|
||||
if ( !words->isSpace) {
|
||||
if (HTML)
|
||||
out << indNewline << "<P>";
|
||||
out << indNewline << (HTML ? "" : "// ");
|
||||
out << indNewline << (HTML ? "" : "// ");
|
||||
w = width;
|
||||
out << words->string;
|
||||
w -= words->len;
|
||||
state = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
int printTrueComment( ostream &out, const Text& T, bool leadingLine) {
|
||||
InListFIter< TextToken> words( (Text&)T);
|
||||
int state = 0; // 0 = start, 1 = spaces at start, 2 = at least one token
|
||||
int spaces = 0;
|
||||
ForAll( words) {
|
||||
switch ( state) {
|
||||
case 0:
|
||||
if ( !words->isSpace) {
|
||||
if ( leadingLine)
|
||||
out << endl;
|
||||
out << indNewline << "// " << words->string;
|
||||
state = 1;
|
||||
} else {
|
||||
if ( words->string[0] != '\n') {
|
||||
state = 1;
|
||||
spaces = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if ( !words->isSpace) {
|
||||
if ( leadingLine)
|
||||
out << endl;
|
||||
out << indNewline << "// ";
|
||||
while ( spaces--)
|
||||
out << ' ';
|
||||
out << words->string;
|
||||
} else {
|
||||
if ( words->string[0] == '\n')
|
||||
state = 0;
|
||||
else
|
||||
spaces++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if ( words->isSpace && ( words->string[0] == '\n'))
|
||||
out << indNewline << "// ";
|
||||
else
|
||||
out << words->string;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
ostream&
|
||||
operator<< (ostream& out, const TextToken& t) {
|
||||
out << t.isSpace << ", ";
|
||||
printString( out, t.string, t.len);
|
||||
return out;
|
||||
}
|
||||
|
||||
istream&
|
||||
operator>> (istream& in, TextToken& t) {
|
||||
char c;
|
||||
int e;
|
||||
in >> e >> c; // c == ','
|
||||
t.isSpace = bool( e);
|
||||
delete[] t.string;
|
||||
t.len = scanString( in, t.string);
|
||||
return in;
|
||||
}
|
||||
|
||||
|
||||
// Auxiliary function definitions
|
||||
// ==============================================
|
||||
/* ...
|
||||
char* catString( const char* r, const char* s, int l, int m) {
|
||||
char *p;
|
||||
if ( l < 0)
|
||||
l = strlen( r);
|
||||
if ( m < 0)
|
||||
m = strlen( s);
|
||||
p = (char *)malloc( l + m + 1);
|
||||
ADT_Assert( p != NULL);
|
||||
memcpy( p, r, l);
|
||||
memcpy( p+l, s, m);
|
||||
p[ l+m] = 0;
|
||||
return( p);
|
||||
}
|
||||
... */
|
||||
|
||||
void printString( ostream &out, const char *s, int len) {
|
||||
if ( len < 0)
|
||||
len = strlen( s);
|
||||
out << len;
|
||||
if ( len > 0)
|
||||
out << ", " << s;
|
||||
}
|
||||
|
||||
int scanString( istream &in, char*& s) {
|
||||
int len;
|
||||
int i;
|
||||
in >> len;
|
||||
if ( len > 0) {
|
||||
s = new char[ len + 1];
|
||||
ADT_Assert( s != NULL);
|
||||
in.get( s[0]); // the comma
|
||||
in.get( s[0]); // the space
|
||||
for ( i=0; i<len; i++)
|
||||
in.get( s[i]);
|
||||
s[i] = 0;
|
||||
} else {
|
||||
s = NULL;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// EOF //
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
/**************************************************************************
|
||||
|
||||
database.h
|
||||
buffer.h
|
||||
=============================================================
|
||||
Project : CGAL merger tool for the specification task
|
||||
Function : Datastructures for the database extracted from
|
||||
the TeX and C++ code mixed files.
|
||||
Function : List of buffers (similar to strings) keeping the text
|
||||
parsed from the TeX input files.
|
||||
System : C++ (g++)
|
||||
Author : (c) 1995 Lutz Kettner
|
||||
Revision : $Revision$
|
||||
|
|
@ -12,338 +12,74 @@
|
|||
|
||||
**************************************************************************/
|
||||
|
||||
#if ! defined( MODULE_DATABASE)
|
||||
#define MODULE_DATABASE 1
|
||||
#if ! defined( MODULE_BUFFER)
|
||||
#define MODULE_BUFFER 1
|
||||
|
||||
#define MaxTextWidth 74
|
||||
|
||||
// Other modules needed:
|
||||
// ==============================================
|
||||
#include <stdlib.h>
|
||||
#include <ADT/adtbase.h>
|
||||
#undef LK_RestrictedOverloading
|
||||
#define LK_RestrictedOverloading 0
|
||||
#include <ADT/list.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
// Class declarations:
|
||||
// ==============================================
|
||||
class TextToken;
|
||||
|
||||
// Substitute old style malloc, realloc, strdup ...
|
||||
// ================================================
|
||||
|
||||
char* renew( char* old, size_t old_size, size_t new_size);
|
||||
char* newstr( const char* src);
|
||||
#include <list.h>
|
||||
#include <vector.h>
|
||||
#include <basic.h>
|
||||
|
||||
|
||||
// Class specifications:
|
||||
// ==============================================
|
||||
|
||||
// Auxiliary class:
|
||||
// ------------------------------------
|
||||
class Buffer {
|
||||
size_t fibo1; // fibonacci numbers to increase buffer in
|
||||
size_t fibo2; // the case of an overflow.
|
||||
size_t len;
|
||||
char* data;
|
||||
typedef vector<char>::const_iterator const_iterator;
|
||||
vector<char> buf;
|
||||
public:
|
||||
Buffer() {
|
||||
fibo1 = 610;
|
||||
fibo2 = 987;
|
||||
len = 0;
|
||||
data = new char[ fibo2];
|
||||
*data = '\0';
|
||||
// Assert( data != NULL);
|
||||
}
|
||||
~Buffer() {
|
||||
// ADT_Assert( fibo2 > fibo1); // SGI complains in the test_suit
|
||||
// ADT_Assert( fibo2 > len); // Gnu complains in the test_suit
|
||||
// ADT_Assert( data[ len] == '\0');
|
||||
// ADT_Assert( strlen( data) == len);
|
||||
delete[] data;
|
||||
}
|
||||
Buffer( const Buffer& t) {
|
||||
ADT_Assert( t.data[ t.len] == '\0');
|
||||
fibo1 = t.fibo1;
|
||||
fibo2 = t.fibo2;
|
||||
len = t.len;
|
||||
ADT_Assert( fibo2 > fibo1);
|
||||
ADT_Assert( fibo2 > len);
|
||||
data = newstr( t.data); // ============== ?? FALSCH ERROR !!!!
|
||||
cerr << "Error: Buffer copy constructor called." << endl;
|
||||
exit( 6);
|
||||
}
|
||||
Buffer& operator=( const Buffer& t) {
|
||||
if( this != &t) { // beware of this=t; see Stroustrup pp.238
|
||||
delete[] data;
|
||||
t.data[ t.len] = '\0';
|
||||
fibo1 = t.fibo1;
|
||||
fibo2 = t.fibo2;
|
||||
len = t.len;
|
||||
data = newstr( t.data);// ============== ?? FALSCH ERROR !!!!
|
||||
} else {
|
||||
fibo1 = 610;
|
||||
fibo2 = 987;
|
||||
len = 0;
|
||||
data = new char[ fibo2];
|
||||
}
|
||||
ADT_Assert( fibo2 > fibo1);
|
||||
ADT_Assert( fibo2 > len);
|
||||
cerr << "Error: Buffer assignment operator called." << endl;
|
||||
exit( 6);
|
||||
return *this;
|
||||
Buffer() : buf( 1, '\0') {}
|
||||
Buffer( char c) : buf( 2, '\0') { *(buf.begin()) = c; }
|
||||
Buffer( const char* s, int l = -1) {
|
||||
if (s)
|
||||
buf.insert( 0, s, s + 1 + ((l<0) ? strlen(s) : l));
|
||||
else
|
||||
buf.push_back( '\0');
|
||||
}
|
||||
void add( const char* s, int l = -1) {
|
||||
ADT_Assert( data[ len] == '\0');
|
||||
int tmp;
|
||||
if ( l < 0)
|
||||
l = strlen( s);
|
||||
// ADT_Assert( l == (int)strlen( s)); // this is definitly wrong!
|
||||
if ( len + l >= fibo2) { // increase buffer
|
||||
do {
|
||||
tmp = fibo2;
|
||||
fibo2 += fibo1;
|
||||
fibo1 = tmp;
|
||||
} while ( len + l >= fibo2); // increase buffer
|
||||
data = renew( data, fibo1, fibo2);
|
||||
// Assert( data != NULL);
|
||||
}
|
||||
memcpy( data + len, s, l);
|
||||
len += l;
|
||||
data[ len] = '\0';
|
||||
ADT_Assert( fibo2 > fibo1);
|
||||
ADT_Assert( fibo2 > len);
|
||||
}
|
||||
void add( const Buffer& buf) {
|
||||
add( buf.string(), buf.length());
|
||||
}
|
||||
void add( const Buffer* buf) {
|
||||
add( buf->string(), buf->length());
|
||||
buf.insert( buf.end() - 1, s, s + l);
|
||||
}
|
||||
void add( const Buffer& buf) { add( buf.begin(), buf.size() - 1); }
|
||||
void add( char c) {
|
||||
ADT_Assert( data[ len] == '\0');
|
||||
if ( len + 1 >= fibo2) { // increase buffer
|
||||
int tmp = fibo2;
|
||||
fibo2 += fibo1;
|
||||
fibo1 = tmp;
|
||||
data = renew( data, fibo1, fibo2);
|
||||
// Assert( data != NULL);
|
||||
}
|
||||
data[ len++] = c;
|
||||
data[ len] = '\0';
|
||||
ADT_Assert( fibo2 > fibo1);
|
||||
ADT_Assert( fibo2 > len);
|
||||
buf.pop_back();
|
||||
buf.push_back(c);
|
||||
buf.push_back( '\0');
|
||||
}
|
||||
void prepend( const char* s, int l = -1) {
|
||||
ADT_Assert( s);
|
||||
ADT_Assert( data[ len] == '\0');
|
||||
int tmp;
|
||||
if ( l == 0 || s == 0)
|
||||
return;
|
||||
if ( l < 0)
|
||||
l = strlen( s);
|
||||
ADT_Assert( l == (int)strlen( s));
|
||||
if ( len + l >= fibo2) { // increase buffer
|
||||
do {
|
||||
tmp = fibo2;
|
||||
fibo2 += fibo1;
|
||||
fibo1 = tmp;
|
||||
} while ( len + l >= fibo2); // increase buffer
|
||||
data = renew( data, fibo1, fibo2);
|
||||
// Assert( data != NULL);
|
||||
}
|
||||
// relocate current text
|
||||
int i;
|
||||
for ( i = len-1; i >= 0; i--)
|
||||
data[i+l] = data[ i];
|
||||
memcpy( data, s, l);
|
||||
len += l;
|
||||
data[ len] = '\0';
|
||||
ADT_Assert( fibo2 > fibo1);
|
||||
ADT_Assert( fibo2 > len);
|
||||
buf.insert( buf.begin(), s, s + l);
|
||||
}
|
||||
void prepend( char c) {
|
||||
ADT_Assert( data[ len] == '\0');
|
||||
if ( len + 1 >= fibo2) { // increase buffer
|
||||
int tmp = fibo2;
|
||||
fibo2 += fibo1;
|
||||
fibo1 = tmp;
|
||||
data = renew( data, fibo1, fibo2);
|
||||
// Assert( data != NULL);
|
||||
}
|
||||
// relocate current text
|
||||
int i;
|
||||
for ( i = len; i > 0; i--)
|
||||
data[i] = data[ i-1];
|
||||
data[ 0] = c;
|
||||
len++;
|
||||
data[ len] = '\0';
|
||||
ADT_Assert( fibo2 > fibo1);
|
||||
ADT_Assert( fibo2 > len);
|
||||
}
|
||||
void cut( int i) {
|
||||
ADT_Assert( data[ len] == '\0');
|
||||
ADT_Assert( i >= 0);
|
||||
if ( (int)len >= i) {
|
||||
len -= i;
|
||||
}
|
||||
data[ len] = '\0';
|
||||
ADT_Assert( fibo2 > fibo1);
|
||||
ADT_Assert( fibo2 > len);
|
||||
}
|
||||
const char* string() const {
|
||||
ADT_Assert( data[ len] == '\0');
|
||||
ADT_Assert( len < fibo2);
|
||||
return data;
|
||||
}
|
||||
void set( int i, char c) {
|
||||
ADT_Assert( c != 0);
|
||||
ADT_Assert( i >= 0);
|
||||
ADT_Assert( size_t(i) < len);
|
||||
data[i] = c;
|
||||
}
|
||||
int length() const {
|
||||
ADT_Assert( data[ len] == '\0');
|
||||
ADT_Assert( len < fibo2);
|
||||
return (int)len;
|
||||
}
|
||||
void flush() {
|
||||
ADT_Assert( data[ len] == '\0');
|
||||
ADT_Assert( len < fibo2);
|
||||
len = 0;
|
||||
*data = '\0';
|
||||
}
|
||||
void capitalize() {
|
||||
for ( size_t i = 0; i < len; i++)
|
||||
data[i] = toupper( data[i]);
|
||||
void prepend( const Buffer& t) { prepend( t.begin(), t.size() - 1);}
|
||||
void prepend( char c) { buf.insert( buf.begin(), c); }
|
||||
char* begin() { return &*(buf.begin()); }
|
||||
const char* begin() const { return &*(buf.begin()); }
|
||||
char* end() { return &*(buf.end()); }
|
||||
const char* end() const { return &*(buf.end()); }
|
||||
void set( int i, char c) { buf[i] = c; }
|
||||
size_t size() const { return buf.size(); }
|
||||
void flush() { buf.erase( buf.begin(), buf.end()-1); }
|
||||
bool is_space() const {
|
||||
CC_Assert( buf.size() > 0);
|
||||
for ( const_iterator i = buf.begin(); i != buf.end() - 1; ++i)
|
||||
if ( *i > ' ')
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class TextToken : public ListLink{
|
||||
public:
|
||||
bool isSpace;
|
||||
int len;
|
||||
char* string;
|
||||
TextToken() {
|
||||
isSpace = false;
|
||||
len = 0;
|
||||
string = newstr( "");
|
||||
}
|
||||
TextToken( const char* s, int l = -1, bool space = false) {
|
||||
isSpace = space;
|
||||
if ( s) {
|
||||
if ( l < 0)
|
||||
len = strlen( s);
|
||||
else
|
||||
len = l;
|
||||
string = newstr( s);
|
||||
} else {
|
||||
string = newstr( "");
|
||||
len = 0;
|
||||
}
|
||||
}
|
||||
TextToken( const TextToken& t) {
|
||||
isSpace = t.isSpace;
|
||||
len = t.len;
|
||||
string = newstr( t.string);
|
||||
}
|
||||
~TextToken() {
|
||||
ADT_Assert( (! string && len == 0) || (int)strlen( string) == len);
|
||||
ADT_Assert( ! string || string[ len] == '\0');
|
||||
delete[] string;
|
||||
}
|
||||
TextToken& operator=( const TextToken& t) {
|
||||
if( this != &t) { // beware of this=t; see Stroustrup pp.238
|
||||
delete[] string;
|
||||
isSpace = t.isSpace;
|
||||
len = t.len;
|
||||
string = newstr( t.string);
|
||||
}
|
||||
ADT_Assert( (! string && len == 0) || (int)strlen( string) == len);
|
||||
ADT_Assert( ! string || string[ len] == '\0');
|
||||
return *this;
|
||||
}
|
||||
TextToken& add( const TextToken& t) {
|
||||
if ( t.len > 0) {
|
||||
string = renew( string, len + 1, len + t.len + 1);
|
||||
memcpy( string + len, t.string, t.len);
|
||||
len += t.len;
|
||||
string[len] = '\0';
|
||||
isSpace = isSpace && t.isSpace;
|
||||
}
|
||||
ADT_Assert( (! string && len == 0) || (int)strlen( string) == len);
|
||||
ADT_Assert( ! string || string[ len] == '\0');
|
||||
return *this;
|
||||
}
|
||||
TextToken& add( const char* s, int l = -1) {
|
||||
if ( s == 0)
|
||||
l = 0;
|
||||
if ( l == -1)
|
||||
l = strlen(s);
|
||||
if ( l > 0) {
|
||||
string = renew( string, len + 1, len + l + 1);
|
||||
memcpy( string + len, s, l);
|
||||
len += l;
|
||||
string[len] = '\0';
|
||||
isSpace = false;
|
||||
}
|
||||
ADT_Assert( (! string && len == 0) || (int)strlen( string) == len);
|
||||
ADT_Assert( ! string || string[ len] == '\0');
|
||||
return *this;
|
||||
}
|
||||
TextToken& add( char c) {
|
||||
string = renew( string, len + 1, len + 2);
|
||||
string[ len] = c;
|
||||
len ++;
|
||||
string[ len] = '\0';
|
||||
isSpace = isSpace && (( c == ' ') || ( c == '\t'));
|
||||
ADT_Assert( (! string && len == 0) || (int)strlen( string) == len);
|
||||
ADT_Assert( ! string || string[ len] == '\0');
|
||||
return *this;
|
||||
}
|
||||
TextToken& prepend( const TextToken& t) {
|
||||
if ( t.len > 0) {
|
||||
int i;
|
||||
string = renew( string, len + 1, len + t.len + 1);
|
||||
for( i=len; i>=0; i--) // 0 will also be copied
|
||||
string[ i + t.len] = string[ i];
|
||||
memcpy( string, t.string, t.len);
|
||||
len += t.len;
|
||||
isSpace = isSpace && t.isSpace;
|
||||
}
|
||||
ADT_Assert( (! string && len == 0) || (int)strlen( string) == len);
|
||||
ADT_Assert( ! string || string[ len] == '\0');
|
||||
return *this;
|
||||
}
|
||||
TextToken& prepend( char c) {
|
||||
int i;
|
||||
string = renew( string, len + 1, len + 2);
|
||||
for( i=len; i>=0; i--) // 0 will also be copied
|
||||
string[ i + 1] = string[ i];
|
||||
*string = c;
|
||||
len ++;
|
||||
isSpace = isSpace && (( c == ' ') || ( c == '\t'));
|
||||
ADT_Assert( (! string && len == 0) || (int)strlen( string) == len);
|
||||
ADT_Assert( ! string || string[ len] == '\0');
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
typedef list< Buffer*> Buffer_list;
|
||||
typedef Buffer_list::iterator Buffer_iterator;
|
||||
typedef Buffer_list::const_iterator Buffer_const_iterator;
|
||||
|
||||
ostream& operator<< (ostream& out, const TextToken& t);
|
||||
istream& operator>> (istream& in, TextToken& t);
|
||||
void delete_list( Buffer_list* l);
|
||||
|
||||
//class InList< TextToken>;
|
||||
|
||||
typedef InList< TextToken> Text;
|
||||
|
||||
int printComment( ostream& out, const Text& T,
|
||||
bool leadingLine = false, bool HTML = false);
|
||||
int printTrueComment( ostream& out, const Text& T, bool leadingLine = false);
|
||||
#endif // MODULE_BUFFER //
|
||||
|
||||
|
||||
|
||||
void printString( ostream &out, const char* s, int len = -1);
|
||||
int scanString( istream &in, char*& s);
|
||||
|
||||
|
||||
#endif // MODULE_DATABASE //
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include <stream.h>
|
||||
#include <ctype.h>
|
||||
#include <fstream.h>
|
||||
#include <database.h>
|
||||
#include <buffer.h>
|
||||
#include <config.h>
|
||||
|
||||
#define MaxParameters 1002
|
||||
|
|
@ -450,8 +450,8 @@ void printPattern( ostream& out_pattern,
|
|||
return;
|
||||
}
|
||||
int i;
|
||||
int l = err->length();
|
||||
const char *str = err->string();
|
||||
int l = err->size() - 1;
|
||||
const char *str = err->begin();
|
||||
if ( pat == 0) {
|
||||
pat = pattern;
|
||||
pat->flush();
|
||||
|
|
@ -460,7 +460,7 @@ void printPattern( ostream& out_pattern,
|
|||
pat->add( patternText( str[i], str[i+1]));
|
||||
pat->add( '"');
|
||||
}
|
||||
printReducedPattern( out_pattern, pat->string(), pat->length());
|
||||
printReducedPattern( out_pattern, pat->begin(), pat->size() - 1);
|
||||
out_pattern << " {" << endl;
|
||||
out_pattern << " tags[" << n_pattern << "] = -1;" << endl;
|
||||
out_pattern << " count_newlines( yytext);" << endl;
|
||||
|
|
@ -498,8 +498,8 @@ void printFunctionPattern( ostream& out_pattern,
|
|||
bool default_params = false;
|
||||
bool nonzero_param_list = false;
|
||||
int nesting = 0;
|
||||
int l = err->length();
|
||||
const char *str = err->string();
|
||||
int l = err->size() - 1;
|
||||
const char *str = err->begin();
|
||||
if ( pat == 0) {
|
||||
pat = pattern;
|
||||
pat->flush();
|
||||
|
|
@ -516,7 +516,7 @@ void printFunctionPattern( ostream& out_pattern,
|
|||
pat->add( "\"{ws}*\"");
|
||||
pat2 = pattern2;
|
||||
pat2->flush();
|
||||
pat2->add( pat);
|
||||
pat2->add( * pat);
|
||||
if ( nonzero_param_list)
|
||||
pat2->add( ',');
|
||||
pat2->add( "\"{ws}*[^ \\n\\r\\t)]");
|
||||
|
|
@ -534,14 +534,14 @@ void printFunctionPattern( ostream& out_pattern,
|
|||
// if ( default_params)
|
||||
// pat2->add( '"');
|
||||
}
|
||||
printReducedPattern( out_pattern, pat->string(), pat->length());
|
||||
printReducedPattern( out_pattern, pat->begin(), pat->size() - 1);
|
||||
out_pattern << " {" << endl;
|
||||
out_pattern << " tags[" << n_pattern << "] = -1;" << endl;
|
||||
out_pattern << " count_newlines( yytext);" << endl;
|
||||
out_pattern << " MD;" << endl;
|
||||
out_pattern << " }" << endl;
|
||||
if ( default_params || pat2 != 0) {
|
||||
printReducedPattern( out_pattern, pat2->string(), pat2->length());
|
||||
printReducedPattern( out_pattern, pat2->begin(), pat2->size() - 1);
|
||||
out_pattern << " {" << endl;
|
||||
out_pattern << " if (tags[" << n_pattern << "] == 0) {" << endl;
|
||||
out_pattern << " tags[" << n_pattern << "] = line_number;"
|
||||
|
|
@ -628,11 +628,11 @@ void translateFunctionArgumentLists( const char* decl, Buffer *func) {
|
|||
const char* current = decl;
|
||||
while ( *current != '(') {
|
||||
current++;
|
||||
ADT_Assert( *current);
|
||||
CC_Assert( *current);
|
||||
}
|
||||
ADT_Assert( *current == '(');
|
||||
CC_Assert( *current == '(');
|
||||
current++;
|
||||
ADT_Assert( *current);
|
||||
CC_Assert( *current);
|
||||
func->add( decl, current - decl);
|
||||
|
||||
/* the parsing starts here. It counts parenthesis. */
|
||||
|
|
@ -641,7 +641,7 @@ void translateFunctionArgumentLists( const char* decl, Buffer *func) {
|
|||
const char* from = current;
|
||||
const char* last_idfier = current - 1;
|
||||
while ( nesting > 0) {
|
||||
ADT_Assert( *current);
|
||||
CC_Assert( *current);
|
||||
if ( nesting == 1 && *current == '=')
|
||||
in_init = true;
|
||||
if ( nesting == 1
|
||||
|
|
@ -658,7 +658,7 @@ void translateFunctionArgumentLists( const char* decl, Buffer *func) {
|
|||
while( isalnum( *p) || *p == '_')
|
||||
p--;
|
||||
p++; /* points to idfier start */
|
||||
ADT_Assert( p - from >= 0);
|
||||
CC_Assert( p - from >= 0);
|
||||
if ( isTypeInFunctionArgument( from, p)) {
|
||||
func->add( from, p - from);
|
||||
func->add( IDFIER_TAG);
|
||||
|
|
@ -681,7 +681,7 @@ void translateFunctionArgumentLists( const char* decl, Buffer *func) {
|
|||
case ')':
|
||||
case '>':
|
||||
nesting--;
|
||||
ADT_Assert( nesting >= 1);
|
||||
CC_Assert( nesting >= 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -694,8 +694,8 @@ void translateFunctionArgumentLists( const char* decl, Buffer *func) {
|
|||
// if so, use the INLINE_TAG to add the regular expression for an optional
|
||||
// inline keyword right after the template declaration.
|
||||
void checkTemplateKeyword( Buffer *decl){
|
||||
if( 0 == strncmp( "template", decl->string(), 8)) {
|
||||
const char* p = decl->string() + 8;
|
||||
if( 0 == strncmp( "template", decl->begin(), 8)) {
|
||||
const char* p = decl->begin() + 8;
|
||||
int nesting = 0;
|
||||
while( *p != '\0') {
|
||||
switch( *p) {
|
||||
|
|
@ -709,7 +709,7 @@ void checkTemplateKeyword( Buffer *decl){
|
|||
case '>':
|
||||
nesting --;
|
||||
if ( nesting == 0) {
|
||||
decl->set( p - decl->string(), INLINE_TAG);
|
||||
decl->set( p - decl->begin(), INLINE_TAG);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
|
@ -723,11 +723,11 @@ void checkTemplateKeyword( Buffer *decl){
|
|||
/* Taylored semantic functions used in syntax.y */
|
||||
/* ============================================ */
|
||||
|
||||
void handleMainComment( const Text& ) {
|
||||
void handleMainComment( const Buffer_list& ) {
|
||||
return;
|
||||
}
|
||||
|
||||
void handleComment( const Text& ) {
|
||||
void handleComment( const Buffer_list& ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -857,7 +857,7 @@ void handleNestedType( const char* decl) {
|
|||
void handleMethodDeclaration( const char* decl) {
|
||||
translateFunctionArgumentLists( decl, function_decl);
|
||||
checkTemplateKeyword( function_decl);
|
||||
decl = function_decl->string();
|
||||
decl = function_decl->begin();
|
||||
errmessage->flush();
|
||||
int l = strlen( decl);
|
||||
while ( l > 0 && decl[ l-1] == ' ') l--;
|
||||
|
|
@ -873,7 +873,7 @@ void handleMethodDeclaration( const char* decl) {
|
|||
void handleFunctionDeclaration( const char* decl) {
|
||||
translateFunctionArgumentLists( decl, function_decl);
|
||||
checkTemplateKeyword( function_decl);
|
||||
decl = function_decl->string();
|
||||
decl = function_decl->begin();
|
||||
errmessage->flush();
|
||||
int l = strlen( decl);
|
||||
while ( l > 0 && decl[ l-1] == ' ') l--;
|
||||
|
|
@ -888,7 +888,7 @@ void handleFunctionDeclaration( const char* decl) {
|
|||
|
||||
void handleFunctionTemplateDeclaration( const char* templ, const char* decl) {
|
||||
translateFunctionArgumentLists( decl, function_decl);
|
||||
decl = function_decl->string();
|
||||
decl = function_decl->begin();
|
||||
errmessage->flush();
|
||||
pattern->flush();
|
||||
pattern2->flush();
|
||||
|
|
@ -952,7 +952,7 @@ void handleFunctionTemplateDeclaration( const char* templ, const char* decl) {
|
|||
if ( nesting == 0) {
|
||||
default_params = true;
|
||||
pattern->add( "\"{ws}*\"");
|
||||
pattern2->add( pattern);
|
||||
pattern2->add( * pattern);
|
||||
pattern2->add( ",\".*\"");
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -17,9 +17,12 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stream.h>
|
||||
#include <database.h>
|
||||
#include <buffer.h>
|
||||
#include <config.h>
|
||||
|
||||
// Max. width of the formatted output
|
||||
#define MaxTextWidth 74
|
||||
|
||||
typedef char Switch;
|
||||
|
||||
#define NO_SWITCH 0
|
||||
|
|
@ -31,7 +34,97 @@ Switch noc_switch = NO_SWITCH;
|
|||
Switch nomc_switch = NO_SWITCH;
|
||||
Switch nosc_switch = NO_SWITCH;
|
||||
|
||||
|
||||
// Format comments
|
||||
// ==========================
|
||||
int printComment( ostream &out, const Buffer_list& T, bool leadingLine) {
|
||||
int width = MaxTextWidth - indentation_number() - 3;
|
||||
int w = width;
|
||||
int state = 0; // 0 = start, 1 = after token, 2 = spaces
|
||||
// 3 = one newline (and spaces), 4 = newlines
|
||||
for ( Buffer_const_iterator words = T.begin(); words != T.end(); ++words) {
|
||||
bool is_space = (*words)->is_space();
|
||||
int len = int((*words)->size()) - 1;
|
||||
switch ( state) {
|
||||
case 0:
|
||||
if ( ! is_space) {
|
||||
if ( leadingLine)
|
||||
out << endl;
|
||||
out << ind_newline << "// " << (*words)->begin();
|
||||
w -= len;
|
||||
state = 1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if ( ! is_space || len > 0) {
|
||||
if ( ! is_space) {
|
||||
if ((len > w) && (w != width)) {
|
||||
w = width;
|
||||
out << ind_newline << "// ";
|
||||
}
|
||||
out << (*words)->begin();
|
||||
w -= len;
|
||||
} else {
|
||||
if ( (*words)->begin()[0] == '\n')
|
||||
state = 3;
|
||||
else
|
||||
state = 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if ( ! is_space || len > 0) {
|
||||
if ( ! is_space) {
|
||||
if ((len >= w) && (w != width)) {
|
||||
w = width;
|
||||
out << ind_newline << "// ";
|
||||
} else {
|
||||
out << ' ';
|
||||
w--;
|
||||
}
|
||||
out << (*words)->begin();
|
||||
w -= len;
|
||||
state = 1;
|
||||
} else {
|
||||
if ( (*words)->begin()[0] == '\n')
|
||||
state = 3;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if ( ! is_space || len > 0) {
|
||||
if ( !is_space) {
|
||||
if ((len >= w) && (w != width)) {
|
||||
w = width;
|
||||
out << ind_newline << "// ";
|
||||
} else {
|
||||
out << ' ';
|
||||
w--;
|
||||
}
|
||||
out << (*words)->begin();
|
||||
w -= len;
|
||||
state = 1;
|
||||
} else {
|
||||
if ( (*words)->begin()[0] == '\n')
|
||||
state = 4;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if ( ! is_space || len > 0) {
|
||||
if ( ! is_space) {
|
||||
out << ind_newline << "// ";
|
||||
out << ind_newline << "// ";
|
||||
w = width;
|
||||
out << (*words)->begin();
|
||||
w -= len;
|
||||
state = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
/* Declarations from syntax.y */
|
||||
/* ========================== */
|
||||
|
|
@ -54,7 +147,7 @@ const char* file_name = "<stdin>";
|
|||
/* Taylored semantic functions used in syntax.y */
|
||||
/* ============================================ */
|
||||
|
||||
void handleMainComment( const Text& T) {
|
||||
void handleMainComment( const Buffer_list& T) {
|
||||
if ( noc_switch || nomc_switch)
|
||||
return;
|
||||
if ( indentation_number() > 0) {
|
||||
|
|
@ -66,7 +159,7 @@ void handleMainComment( const Text& T) {
|
|||
}
|
||||
}
|
||||
|
||||
void handleComment( const Text& T) {
|
||||
void handleComment( const Buffer_list& T) {
|
||||
if ( noc_switch || nosc_switch)
|
||||
return;
|
||||
cout << indent;
|
||||
|
|
@ -83,13 +176,13 @@ void handleClass( const char* classname) {
|
|||
s++;
|
||||
|
||||
if ( *s == 0) {
|
||||
cout << indNewline;
|
||||
cout << ind_newline;
|
||||
cout << "class " << classname;
|
||||
} else {
|
||||
global_template_params = global_classname;
|
||||
while( *global_template_params && *global_template_params != '<')
|
||||
++global_template_params;
|
||||
cout << indNewline;
|
||||
cout << ind_newline;
|
||||
cout << "template < class ";
|
||||
int nesting = 0;
|
||||
s++;
|
||||
|
|
@ -118,7 +211,7 @@ void handleClass( const char* classname) {
|
|||
}
|
||||
if ( nesting >= 0)
|
||||
printErrorMessage( MalformedTemplateParamError);
|
||||
cout << " >" << indNewline;
|
||||
cout << " >" << ind_newline;
|
||||
cout << "class ";
|
||||
s = classname;
|
||||
while ( *s != 0 && *s != '<') {
|
||||
|
|
@ -126,8 +219,8 @@ void handleClass( const char* classname) {
|
|||
s++;
|
||||
}
|
||||
}
|
||||
cout << " {" << indNewline;
|
||||
cout << "public:" << indNewline;
|
||||
cout << " {" << ind_newline;
|
||||
cout << "public:" << ind_newline;
|
||||
cout << indent;
|
||||
}
|
||||
|
||||
|
|
@ -137,8 +230,8 @@ void handleClassEnd( void) {
|
|||
free( global_classname);
|
||||
global_classname = NULL;
|
||||
cout << outdent;
|
||||
cout << indNewline;
|
||||
cout << "};" << indNewline;
|
||||
cout << ind_newline;
|
||||
cout << "};" << ind_newline;
|
||||
}
|
||||
|
||||
void handleRefPage( const char* token) {
|
||||
|
|
@ -154,27 +247,27 @@ void handleRefPageEnd( void) {
|
|||
}
|
||||
|
||||
void handleDeclaration( const char* decl) {
|
||||
cout << endl << indNewline;
|
||||
cout << endl << ind_newline;
|
||||
cout << decl;
|
||||
}
|
||||
|
||||
void handleNestedType( const char* decl) {
|
||||
cout << endl << indNewline;
|
||||
cout << endl << ind_newline;
|
||||
cout << "Nested type required: " << global_classname << "::" << decl;
|
||||
}
|
||||
|
||||
void handleMethodDeclaration( const char* decl) {
|
||||
cout << endl << indNewline;
|
||||
cout << endl << ind_newline;
|
||||
cout << decl;
|
||||
}
|
||||
|
||||
void handleFunctionDeclaration( const char* decl) {
|
||||
cout << endl << indNewline;
|
||||
cout << endl << ind_newline;
|
||||
cout << decl;
|
||||
}
|
||||
|
||||
void handleFunctionTemplateDeclaration( const char* templ, const char* decl) {
|
||||
cout << endl << indNewline;
|
||||
cout << endl << ind_newline;
|
||||
cout << "template < class ";
|
||||
const char* s = templ;
|
||||
int nesting = 0;
|
||||
|
|
@ -203,7 +296,7 @@ void handleFunctionTemplateDeclaration( const char* templ, const char* decl) {
|
|||
}
|
||||
if ( nesting != 0)
|
||||
printErrorMessage( MalformedTemplateParamError);
|
||||
cout << " >" << indNewline;
|
||||
cout << " >" << ind_newline;
|
||||
cout << decl;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,14 +18,13 @@
|
|||
#include <fstream.h>
|
||||
#include <strstream.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <mstring.h>
|
||||
|
||||
#include <lex_include.h>
|
||||
#include <macro_dictionary.h>
|
||||
#include <internal_macros.h>
|
||||
#include <database.h>
|
||||
#include <buffer.h>
|
||||
#include <html_config.h>
|
||||
#include <html_syntax.h>
|
||||
#include <html_error.h>
|
||||
|
|
@ -121,44 +120,40 @@ void init_commandline_args() {
|
|||
|
||||
|
||||
|
||||
int text_block_length( const Text& T) {
|
||||
int text_block_length( const Buffer_list& T) {
|
||||
int l = 0;
|
||||
InListFIter< TextToken> words( (Text&)T);
|
||||
ForAll( words) {
|
||||
if ( words->isSpace)
|
||||
for ( Buffer_const_iterator words = T.begin(); words != T.end(); ++words) {
|
||||
if ( (*words)->is_space())
|
||||
++l;
|
||||
else
|
||||
l += (*words).len;
|
||||
l += (*words)->size() - 1;
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
char* text_block_to_string( const Text& T) {
|
||||
char* string = new char[ text_block_length( T) + 1];
|
||||
char* text_block_to_string( const Buffer_list& T) {
|
||||
char* string = new char[ text_block_length(T) + 1];
|
||||
string[0] = '\0';
|
||||
InListFIter< TextToken> words( (Text&)T);
|
||||
ForAll( words) {
|
||||
if ( words->isSpace)
|
||||
for ( Buffer_const_iterator words = T.begin(); words != T.end(); ++words) {
|
||||
if ( (*words)->is_space())
|
||||
strcat( string, " ");
|
||||
else
|
||||
strcat( string, (*words).string);
|
||||
strcat( string, (*words)->begin());
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
bool is_text_block_empty( const Text& T) {
|
||||
InListFIter< TextToken> words( (Text&)T);
|
||||
ForAll( words) {
|
||||
if ( !words->isSpace)
|
||||
bool is_text_block_empty( const Buffer_list& T) {
|
||||
for ( Buffer_const_iterator words = T.begin(); words != T.end(); ++words) {
|
||||
if ( ! (*words)->is_space())
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void print_html_text_block( ostream &out, const Text& T) {
|
||||
InListFIter< TextToken> words( (Text&)T);
|
||||
ForAll( words) {
|
||||
const char* s = words->string;
|
||||
void print_html_text_block( ostream &out, const Buffer_list& T) {
|
||||
for ( Buffer_const_iterator words = T.begin(); words != T.end(); ++words) {
|
||||
const char* s = (*words)->begin();
|
||||
while ( *s) {
|
||||
if ( *s != SEPARATOR)
|
||||
out << *s;
|
||||
|
|
@ -172,15 +167,15 @@ void print_html_text_block( ostream &out, const Text& T) {
|
|||
/* Taylored semantic functions used in syntax.y */
|
||||
/* ============================================ */
|
||||
|
||||
void handleText( const Text& T) {
|
||||
void handleText( const Buffer_list& T) {
|
||||
if ( ! current_ostream)
|
||||
return;
|
||||
print_html_text_block( *current_ostream, T);
|
||||
}
|
||||
|
||||
void handleTextToken( const TextToken& TT) {
|
||||
void handleBuffer( const Buffer& TT) {
|
||||
if ( current_ostream)
|
||||
*current_ostream << TT.string;
|
||||
*current_ostream << TT.begin();
|
||||
}
|
||||
|
||||
void handleString( const char* s) {
|
||||
|
|
|
|||
|
|
@ -14,14 +14,15 @@
|
|||
#if ! defined( MODULE_CONFIG)
|
||||
#define MODULE_CONFIG 1
|
||||
|
||||
#include <buffer.h>
|
||||
|
||||
// Global declarations that are implemented in the main module.
|
||||
// There they can be taylored to the specific application, i.e.
|
||||
// extraction or checker.
|
||||
|
||||
void handleComment( const Text& T);
|
||||
void handleConstructorComment( const Text& T);
|
||||
void handleMainComment( const Text& T);
|
||||
void handleComment( const Buffer_list& T);
|
||||
void handleConstructorComment( const Buffer_list& T);
|
||||
void handleMainComment( const Buffer_list& T);
|
||||
|
||||
void handleClass( const char* classname);
|
||||
void handleClassEnd( void);
|
||||
|
|
|
|||
|
|
@ -72,36 +72,36 @@ inline double estimate_html_size( const string& s) {
|
|||
|
||||
void three_cols_html_begin( ostream& out, bool big_col1) {
|
||||
current_font = it_font;
|
||||
out << indent << indent << indNewline
|
||||
out << indent << indent << ind_newline
|
||||
<< "<!3><TABLE BORDER=0 CELLSPACING=2 CELLPADDING=0 WIDTH="
|
||||
<< table_width << ">" << indNewline
|
||||
<< table_width << ">" << ind_newline
|
||||
<< "<TR><TD ALIGN=LEFT VALIGN=TOP WIDTH="
|
||||
<< table_first_col + (big_col1 ? (table_second_col+table_third_col) :0)
|
||||
<< "%" << ( big_col1 ? " COLSPAN=3>" : " NOWRAP>")
|
||||
<< indNewline << "<I><NOBR>" << outdent << indNewline;
|
||||
<< ind_newline << "<I><NOBR>" << outdent << ind_newline;
|
||||
}
|
||||
|
||||
void three_cols_html_premature_end( ostream& out) {
|
||||
out << indent << indNewline << store_remember_font() << "</I></NOBR>"
|
||||
<< indNewline << "</TD></TR>" << indNewline
|
||||
<< "</TABLE><!3>" << outdent << outdent << indNewline;
|
||||
out << indent << ind_newline << store_remember_font() << "</I></NOBR>"
|
||||
<< ind_newline << "</TD></TR>" << ind_newline
|
||||
<< "</TABLE><!3>" << outdent << outdent << ind_newline;
|
||||
}
|
||||
|
||||
void three_cols_html_second( ostream& out, bool big_col1, bool big_col2) {
|
||||
out << indent << indNewline << store_remember_font() << "</I></NOBR>"
|
||||
<< indNewline << "</TD>";
|
||||
out << indent << ind_newline << store_remember_font() << "</I></NOBR>"
|
||||
<< ind_newline << "</TD>";
|
||||
if ( big_col1)
|
||||
out << "</TR><TR><TD WIDTH=" << table_first_col << "% NOWRAP></TD>";
|
||||
out << "<TD ALIGN=LEFT VALIGN=TOP WIDTH="
|
||||
<< table_second_col + ( big_col2 ? table_third_col : 0)
|
||||
<< "% NOWRAP" << ( big_col2 ? " COLSPAN=2>" : ">")
|
||||
<< indNewline << "<I><NOBR>" << get_remember_font() << outdent
|
||||
<< indNewline;
|
||||
<< ind_newline << "<I><NOBR>" << get_remember_font() << outdent
|
||||
<< ind_newline;
|
||||
}
|
||||
|
||||
void three_cols_html_third( ostream& out, bool big_col2, bool empty_col3) {
|
||||
out << indent << indNewline << store_remember_font() << "</I></NOBR>"
|
||||
<< indNewline;
|
||||
out << indent << ind_newline << store_remember_font() << "</I></NOBR>"
|
||||
<< ind_newline;
|
||||
if ( ! big_col2)
|
||||
out << "</TD>";
|
||||
if ( ! empty_col3) {
|
||||
|
|
@ -111,15 +111,15 @@ void three_cols_html_third( ostream& out, bool big_col2, bool empty_col3) {
|
|||
<< "% NOWRAP></TD>";
|
||||
out << "<TD ALIGN=LEFT VALIGN=TOP WIDTH=" << table_third_col << "%>";
|
||||
}
|
||||
out << outdent << indNewline;
|
||||
out << outdent << ind_newline;
|
||||
}
|
||||
|
||||
void three_cols_html_end( ostream& out, bool empty_col3) {
|
||||
out << indent << indNewline;
|
||||
out << indent << ind_newline;
|
||||
if ( ! empty_col3)
|
||||
out << "</TD>";
|
||||
out << "</TR>" << indNewline
|
||||
<< "</TABLE><!3>" << outdent << outdent << indNewline;
|
||||
out << "</TR>" << ind_newline
|
||||
<< "</TABLE><!3>" << outdent << outdent << ind_newline;
|
||||
}
|
||||
|
||||
void three_cols_html_new_closing( ostream& out) {
|
||||
|
|
@ -128,40 +128,40 @@ void three_cols_html_new_closing( ostream& out) {
|
|||
|
||||
void two_cols_html_begin( ostream& out) {
|
||||
current_font = it_font;
|
||||
out << indent << indent << indNewline
|
||||
out << indent << indent << ind_newline
|
||||
<< "<!2><TABLE BORDER=0 CELLSPACING=2 CELLPADDING=0 WIDTH="
|
||||
<< table_width << ">" << indNewline
|
||||
<< table_width << ">" << ind_newline
|
||||
<< "<TR><TD ALIGN=LEFT VALIGN=TOP WIDTH="
|
||||
<< table_2c_first_col + table_2c_second_col << "% NOWRAP COLSPAN=2>"
|
||||
<< indNewline << "<I><NOBR>" << outdent << indNewline;
|
||||
<< ind_newline << "<I><NOBR>" << outdent << ind_newline;
|
||||
}
|
||||
|
||||
void two_cols_html_premature_end( ostream& out) {
|
||||
out << indent << indNewline << store_remember_font() <<"</I></NOBR>"
|
||||
<< indNewline << "</TD></TR>" << indNewline
|
||||
<< "</TABLE><!2>" << outdent << outdent << indNewline;
|
||||
out << indent << ind_newline << store_remember_font() <<"</I></NOBR>"
|
||||
<< ind_newline << "</TD></TR>" << ind_newline
|
||||
<< "</TABLE><!2>" << outdent << outdent << ind_newline;
|
||||
}
|
||||
|
||||
void two_cols_html_second( ostream& out, bool empty_col2) {
|
||||
out << indent << indNewline << store_remember_font() << "</I></NOBR>"
|
||||
<< indNewline << "</TD></TR>";
|
||||
out << indent << ind_newline << store_remember_font() << "</I></NOBR>"
|
||||
<< ind_newline << "</TD></TR>";
|
||||
if ( ! empty_col2)
|
||||
out << "<TR><TD WIDTH=" << table_2c_first_col
|
||||
<< "% NOWRAP></TD><TD ALIGN=LEFT VALIGN=TOP WIDTH="
|
||||
<< table_2c_second_col << "%>";
|
||||
out << outdent << indNewline;
|
||||
out << outdent << ind_newline;
|
||||
}
|
||||
|
||||
void two_cols_html_new_closing( ostream& out) {
|
||||
out << indent << indNewline << store_remember_font() << "</I></NOBR>"
|
||||
<< indNewline << "</TD></TR>" << outdent << outdent;
|
||||
out << indent << ind_newline << store_remember_font() << "</I></NOBR>"
|
||||
<< ind_newline << "</TD></TR>" << outdent << outdent;
|
||||
}
|
||||
|
||||
void two_cols_html_end( ostream& out, bool empty_col2) {
|
||||
out << indent << indNewline;
|
||||
out << indent << ind_newline;
|
||||
if ( ! empty_col2)
|
||||
out << "</TD></TR>" << indNewline;
|
||||
out << "</TABLE><!2>" << outdent << outdent << indNewline;
|
||||
out << "</TD></TR>" << ind_newline;
|
||||
out << "</TABLE><!2>" << outdent << outdent << ind_newline;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1000,7 +1000,7 @@ void format_function( bool method, const char* signature,
|
|||
! macroIsTrue( "\\ccAlternateThreeColumn"))
|
||||
*current_ostream << " COLSPAN=2";
|
||||
*current_ostream << "><I>" << get_remember_font()
|
||||
<< indNewline;
|
||||
<< ind_newline;
|
||||
}
|
||||
if ( method) {
|
||||
if ( ! definedMacro( "\\ccPureVar")) {
|
||||
|
|
@ -1026,7 +1026,7 @@ void format_function( bool method, const char* signature,
|
|||
<< " NOWRAP></TD>";
|
||||
*current_ostream << "<TD ALIGN=LEFT VALIGN=TOP "
|
||||
"NOWRAP><I>";
|
||||
*current_ostream << get_remember_font() << indNewline;
|
||||
*current_ostream << get_remember_font() << ind_newline;
|
||||
}
|
||||
char* p = parameter_list;
|
||||
while ( n--) {
|
||||
|
|
@ -1035,13 +1035,13 @@ void format_function( bool method, const char* signature,
|
|||
if ( n) {
|
||||
*current_ostream << ", ";
|
||||
if ( exp_size > dd_width)
|
||||
*current_ostream << "<BR>" << indNewline;
|
||||
*current_ostream << "<BR>" << ind_newline;
|
||||
}
|
||||
}
|
||||
*current_ostream << ")";
|
||||
if ( exp_size > dd_width) {
|
||||
*current_ostream << store_remember_font();
|
||||
*current_ostream << "</I></TD></TR></TABLE>" << indNewline;
|
||||
*current_ostream << "</I></TD></TR></TABLE>" <<ind_newline;
|
||||
}
|
||||
} else
|
||||
*current_ostream << " ()";
|
||||
|
|
@ -1332,7 +1332,7 @@ void format_struct( const char* signature) {
|
|||
"<TR><TD ALIGN=LEFT VALIGN=TOP NOWRAP";
|
||||
//if ( tag_long_param_layout)
|
||||
//*current_ostream << " COLSPAN=2";
|
||||
*current_ostream << "><I>" << get_remember_font() << indNewline;
|
||||
*current_ostream << "><I>" << get_remember_font() << ind_newline;
|
||||
}
|
||||
if ( return_value) {
|
||||
print_ascii_to_html_spc( *current_ostream, return_value);
|
||||
|
|
@ -1346,7 +1346,7 @@ void format_struct( const char* signature) {
|
|||
if ( exp_size > table_width) {
|
||||
*current_ostream << store_remember_font();
|
||||
*current_ostream << "</TD><TD ALIGN=LEFT VALIGN=TOP NOWRAP>";
|
||||
*current_ostream << get_remember_font() << indNewline;
|
||||
*current_ostream << get_remember_font() << ind_newline;
|
||||
}
|
||||
char* p = parameter_list;
|
||||
while ( n--) {
|
||||
|
|
@ -1358,13 +1358,13 @@ void format_struct( const char* signature) {
|
|||
if ( n) {
|
||||
*current_ostream << ", ";
|
||||
if ( exp_size > table_width)
|
||||
*current_ostream << "<BR>" << indNewline;
|
||||
*current_ostream << "<BR>" << ind_newline;
|
||||
}
|
||||
}
|
||||
*current_ostream << "};";
|
||||
if ( exp_size > table_width) {
|
||||
*current_ostream << store_remember_font();
|
||||
*current_ostream << "</TD></TR></TABLE>" << indNewline;
|
||||
*current_ostream << "</TD></TR></TABLE>" << ind_newline;
|
||||
}
|
||||
} else
|
||||
*current_ostream << ';';
|
||||
|
|
@ -1504,7 +1504,7 @@ void format_enum( const char* signature) {
|
|||
"<TR><TD ALIGN=LEFT VALIGN=TOP NOWRAP";
|
||||
//if ( tag_long_param_layout)
|
||||
//*current_ostream << " COLSPAN=2";
|
||||
*current_ostream << "><I>" << get_remember_font() << indNewline;
|
||||
*current_ostream << "><I>" << get_remember_font() << ind_newline;
|
||||
}
|
||||
if ( return_value) {
|
||||
print_ascii_to_html_spc( *current_ostream, return_value);
|
||||
|
|
@ -1518,7 +1518,7 @@ void format_enum( const char* signature) {
|
|||
if ( exp_size > table_width) {
|
||||
*current_ostream << store_remember_font();
|
||||
*current_ostream << "</TD><TD ALIGN=LEFT VALIGN=TOP NOWRAP>";
|
||||
*current_ostream << get_remember_font() << indNewline;
|
||||
*current_ostream << get_remember_font() << ind_newline;
|
||||
}
|
||||
char* p = parameter_list;
|
||||
while ( n--) {
|
||||
|
|
@ -1580,13 +1580,13 @@ void format_enum( const char* signature) {
|
|||
if ( n) {
|
||||
*current_ostream << ", ";
|
||||
if ( exp_size > table_width)
|
||||
*current_ostream << "<BR>" << indNewline;
|
||||
*current_ostream << "<BR>" << ind_newline;
|
||||
}
|
||||
}
|
||||
*current_ostream << "};";
|
||||
if ( exp_size > table_width) {
|
||||
*current_ostream << store_remember_font();
|
||||
*current_ostream << "</TD></TR></TABLE>" << indNewline;
|
||||
*current_ostream << "</TD></TR></TABLE>" << ind_newline;
|
||||
}
|
||||
} else
|
||||
*current_ostream << ';';
|
||||
|
|
@ -1645,7 +1645,7 @@ void format_constructor( const char* signature) {
|
|||
if ( macroIsTrue( "\\ccLongParamLayout") ||
|
||||
! macroIsTrue( "\\ccAlternateThreeColumn"))
|
||||
*current_ostream << " COLSPAN=2";
|
||||
*current_ostream << "><I>" << get_remember_font() << indNewline;
|
||||
*current_ostream << "><I>" << get_remember_font() << ind_newline;
|
||||
}
|
||||
// Of no use here!
|
||||
// if ( scope)
|
||||
|
|
@ -1666,7 +1666,7 @@ void format_constructor( const char* signature) {
|
|||
<< " NOWRAP></TD>";
|
||||
*current_ostream << "<TD ALIGN=LEFT VALIGN=TOP "
|
||||
"NOWRAP><I>";
|
||||
*current_ostream << get_remember_font() << indNewline;
|
||||
*current_ostream << get_remember_font() << ind_newline;
|
||||
}
|
||||
char* p = parameter_list;
|
||||
while ( n--) {
|
||||
|
|
@ -1675,13 +1675,13 @@ void format_constructor( const char* signature) {
|
|||
if ( n) {
|
||||
*current_ostream << ", ";
|
||||
if ( exp_size > table_width)
|
||||
*current_ostream << "<BR>" << indNewline;
|
||||
*current_ostream << "<BR>" << ind_newline;
|
||||
}
|
||||
}
|
||||
*current_ostream << ");";
|
||||
if ( exp_size > table_width) {
|
||||
*current_ostream << store_remember_font();
|
||||
*current_ostream << "</I></TD></TR></TABLE>" << indNewline;
|
||||
*current_ostream << "</I></TD></TR></TABLE>" << ind_newline;
|
||||
}
|
||||
} else
|
||||
*current_ostream << ';';
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
#define CPP_FORMATTING_H 1
|
||||
|
||||
#include <mstring.h>
|
||||
#include <database.h>
|
||||
|
||||
extern string class_name;
|
||||
extern string template_class_name;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <database.h>
|
||||
#include <buffer.h>
|
||||
#include <config.h>
|
||||
#include <extract_syntax.tab.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ int yyerror( char *s);
|
|||
|
||||
/* Datastructures for the parser */
|
||||
/* ============================= */
|
||||
#include <database.h>
|
||||
#include <buffer.h>
|
||||
#include <config.h>
|
||||
%}
|
||||
|
||||
|
|
@ -53,11 +53,10 @@ int yyerror( char *s);
|
|||
struct {
|
||||
char* text; /* a (meaningless) chunk of zero terminated text */
|
||||
int len; /* its length */
|
||||
} string;
|
||||
char character; /* a (meaningless) character */
|
||||
Buffer* pBuffer; /* Buffer for collected strings and characters */
|
||||
TextToken* pTextToken;
|
||||
Text* pText;
|
||||
} string;
|
||||
char character; /* a (meaningless) character */
|
||||
Buffer* pBuffer; /* Buffer for collected strings and characters */
|
||||
Buffer_list* pText;
|
||||
}
|
||||
|
||||
/* Elementary data types */
|
||||
|
|
@ -112,19 +111,25 @@ int yyerror( char *s);
|
|||
/* -------------------------- */
|
||||
%token LALRRESTRICTION
|
||||
|
||||
%type <pBuffer> string
|
||||
%type <pBuffer> declaration classname template_params
|
||||
%type <pBuffer> cc_stmts cc_stmt cc_stmts_skip_space
|
||||
%type <pText> comment_group comment_sequence
|
||||
%type <pText> nested_token_sequence nested_token
|
||||
%type <pText> compound_comment full_comment_sequence
|
||||
%type <pText> non_empty_comment_sequence
|
||||
|
||||
%type <pText> whitespaces optional_whitespaces
|
||||
|
||||
%type <pTextToken> comment_token non_empty_token whitespace
|
||||
|
||||
%type <pBuffer> string
|
||||
%type <pBuffer> whitespace
|
||||
%type <pBuffer> cc_stmts
|
||||
%type <pBuffer> cc_stmt
|
||||
%type <pBuffer> cc_stmts_skip_space
|
||||
%type <pBuffer> comment_token
|
||||
%type <pBuffer> declaration
|
||||
%type <pBuffer> classname
|
||||
%type <pBuffer> template_params
|
||||
|
||||
%type <pText> whitespaces
|
||||
%type <pText> optional_whitespaces
|
||||
%type <pText> comment_group
|
||||
%type <pText> comment_sequence
|
||||
%type <pText> compound_comment
|
||||
%type <pText> full_comment_sequence
|
||||
%type <pText> non_empty_comment_sequence
|
||||
%type <pText> nested_token_sequence
|
||||
%type <pText> nested_token
|
||||
|
||||
%%
|
||||
/* Grammar: Top Level */
|
||||
|
|
@ -138,7 +143,7 @@ stmt: string { delete $1;}
|
|||
| SPACE {}
|
||||
| NEWLINE
|
||||
| BEGINCLASS
|
||||
classname { handleClass( $2->string());
|
||||
classname { handleClass( $2->begin());
|
||||
delete $2;}
|
||||
decl_sequence
|
||||
ENDCLASS
|
||||
|
|
@ -148,8 +153,8 @@ stmt: string { delete $1;}
|
|||
creationvariable = NULL;
|
||||
}
|
||||
| BEGINREFCLASS
|
||||
classname { handleClass( $2->string());
|
||||
handleRefPage( $2->string());
|
||||
classname { handleClass( $2->begin());
|
||||
handleRefPage( $2->begin());
|
||||
delete $2;}
|
||||
decl_sequence
|
||||
ENDREFCLASS
|
||||
|
|
@ -161,9 +166,9 @@ stmt: string { delete $1;}
|
|||
}
|
||||
| BEGINREFCLASS
|
||||
'[' nested_token_sequence ']'
|
||||
classname { handleClass( $5->string());
|
||||
handleRefPage( $5->string());
|
||||
delete $3;
|
||||
classname { handleClass( $5->begin());
|
||||
handleRefPage( $5->begin());
|
||||
delete_list( $3);
|
||||
delete $5;}
|
||||
decl_sequence
|
||||
ENDREFCLASS
|
||||
|
|
@ -174,21 +179,21 @@ stmt: string { delete $1;}
|
|||
creationvariable = NULL;
|
||||
}
|
||||
| BEGINREFPAGE
|
||||
classname { handleRefPage( $2->string());
|
||||
classname { handleRefPage( $2->begin());
|
||||
delete $2; }
|
||||
| BEGINREFPAGE
|
||||
'[' nested_token_sequence ']'
|
||||
classname { handleRefPage( $5->string());
|
||||
delete $3;
|
||||
classname { handleRefPage( $5->begin());
|
||||
delete_list( $3);
|
||||
delete $5; }
|
||||
| ENDREFPAGE { handleRefPageEnd(); }
|
||||
| CREATIONVARIABLE {}
|
||||
| CCSTYLE '{' nested_token_sequence '}' { set_INITIAL = 1;
|
||||
delete $3;
|
||||
delete_list($3);
|
||||
}
|
||||
| HEADING '{' comment_sequence '}' { delete $3; }
|
||||
| INCLUDE '{' comment_sequence '}' { delete $3; }
|
||||
| COMMENTHEADING '{' comment_sequence '}' { delete $3; }
|
||||
| HEADING '{' comment_sequence '}' { delete_list($3); }
|
||||
| INCLUDE '{' comment_sequence '}' { delete_list($3); }
|
||||
| COMMENTHEADING '{' comment_sequence '}' { delete_list($3); }
|
||||
| gobble_parameters
|
||||
| GOBBLEAFTERONEPARAM reduced_group reduced_group
|
||||
| global_tagged_declarator
|
||||
|
|
@ -221,11 +226,11 @@ reduced_statement:
|
|||
| NEWLINE
|
||||
| CREATIONVARIABLE {}
|
||||
| CCSTYLE '{' nested_token_sequence '}' { set_INITIAL = 1;
|
||||
delete $3;
|
||||
delete_list($3);
|
||||
}
|
||||
| HEADING '{' comment_sequence '}' { delete $3; }
|
||||
| INCLUDE '{' comment_sequence '}' { delete $3; }
|
||||
| COMMENTHEADING '{' comment_sequence '}' { delete $3; }
|
||||
| HEADING '{' comment_sequence '}' { delete_list($3); }
|
||||
| INCLUDE '{' comment_sequence '}' { delete_list($3); }
|
||||
| COMMENTHEADING '{' comment_sequence '}' { delete_list($3); }
|
||||
| gobble_parameters
|
||||
| GOBBLEAFTERONEPARAM reduced_group reduced_group
|
||||
| reduced_group
|
||||
|
|
@ -251,36 +256,31 @@ string: STRING {
|
|||
}
|
||||
;
|
||||
|
||||
non_empty_token: string { $$ = new TextToken(
|
||||
$1->string(), $1->length());
|
||||
delete $1;
|
||||
}
|
||||
;
|
||||
|
||||
optional_whitespaces: /* empty */ { $$ = new Text( managed); }
|
||||
optional_whitespaces: /* empty */ { $$ = new Buffer_list(); }
|
||||
| whitespaces { $$ = $1; }
|
||||
;
|
||||
|
||||
whitespaces: whitespace { $$ = new Text( * $1, managed); }
|
||||
whitespaces: whitespace { $$ = new Buffer_list( 1, $1); }
|
||||
| GOBBLEAFTERONEPARAM comment_group comment_group {
|
||||
$$ = $2;
|
||||
delete $3;
|
||||
delete_list( $3);
|
||||
}
|
||||
| whitespaces whitespace {
|
||||
$$ = $1;
|
||||
$$->append( * $2);
|
||||
$$->push_back( $2);
|
||||
}
|
||||
| whitespaces GOBBLEAFTERONEPARAM comment_group comment_group {
|
||||
| whitespaces GOBBLEAFTERONEPARAM comment_group
|
||||
comment_group {
|
||||
$$ = $3;
|
||||
delete $1;
|
||||
delete $4;
|
||||
delete_list( $1);
|
||||
delete_list( $4);
|
||||
}
|
||||
;
|
||||
|
||||
whitespace: SPACE { $$ = new TextToken( $1.text, $1.len, true); }
|
||||
| NEWLINE { $$ = new TextToken( "\n", 1, true); }
|
||||
whitespace: SPACE { $$ = new Buffer( $1.text, $1.len); }
|
||||
| NEWLINE { $$ = new Buffer( "\n", 1); }
|
||||
| gobble_parameters
|
||||
{ $$ = new TextToken( " ", 1, true); }
|
||||
{ $$ = new Buffer( " ", 1); }
|
||||
;
|
||||
|
||||
|
||||
|
|
@ -289,39 +289,39 @@ whitespace: SPACE { $$ = new TextToken( $1.text, $1.len, true); }
|
|||
/* =============================== */
|
||||
decl_sequence: comment_sequence {
|
||||
handleMainComment( * $1);
|
||||
delete $1;
|
||||
delete_list($1);
|
||||
}
|
||||
| decl_sequence
|
||||
tagged_declarator
|
||||
comment_sequence {
|
||||
handleMainComment( * $3);
|
||||
delete $3;
|
||||
delete_list($3);
|
||||
}
|
||||
;
|
||||
|
||||
tagged_declarator:
|
||||
global_tagged_declarator
|
||||
| CONSTRUCTOR declaration comment_group {
|
||||
handleFunctionDeclaration( $2->string());
|
||||
handleFunctionDeclaration( $2->begin());
|
||||
delete $2;
|
||||
handleComment( * $3);
|
||||
delete $3;
|
||||
delete_list( $3);
|
||||
}
|
||||
| METHOD declaration comment_group {
|
||||
handleMethodDeclaration( $2->string());
|
||||
handleMethodDeclaration( $2->begin());
|
||||
delete $2;
|
||||
handleComment( * $3);
|
||||
delete $3;
|
||||
delete_list( $3);
|
||||
}
|
||||
;
|
||||
|
||||
global_tagged_declarator:
|
||||
error {}
|
||||
| FUNCTION declaration comment_group {
|
||||
handleFunctionDeclaration( $2->string());
|
||||
handleFunctionDeclaration( $2->begin());
|
||||
delete $2;
|
||||
handleComment( * $3);
|
||||
delete $3;
|
||||
delete_list( $3);
|
||||
}
|
||||
| FUNCTIONTEMPLATE
|
||||
template_params
|
||||
|
|
@ -329,46 +329,46 @@ global_tagged_declarator:
|
|||
declaration
|
||||
comment_group {
|
||||
handleFunctionTemplateDeclaration(
|
||||
$2->string(),
|
||||
$4->string());
|
||||
$2->begin(),
|
||||
$4->begin());
|
||||
delete $2;
|
||||
delete $3;
|
||||
delete_list( $3);
|
||||
delete $4;
|
||||
handleComment( * $5);
|
||||
delete $5;
|
||||
delete_list( $5);
|
||||
}
|
||||
| VARIABLE declaration comment_group {
|
||||
handleDeclaration( $2->string());
|
||||
handleDeclaration( $2->begin());
|
||||
delete $2;
|
||||
handleComment( * $3);
|
||||
delete $3;
|
||||
delete_list( $3);
|
||||
}
|
||||
| TYPEDEF declaration comment_group {
|
||||
handleDeclaration( $2->string());
|
||||
handleDeclaration( $2->begin());
|
||||
delete $2;
|
||||
handleComment( * $3);
|
||||
delete $3;
|
||||
delete_list( $3);
|
||||
}
|
||||
| NESTEDTYPE declaration comment_group {
|
||||
handleNestedType( $2->string());
|
||||
handleNestedType( $2->begin());
|
||||
delete $2;
|
||||
handleComment( * $3);
|
||||
delete $3;
|
||||
delete_list( $3);
|
||||
}
|
||||
| ENUM declaration comment_group {
|
||||
handleDeclaration( $2->string());
|
||||
handleDeclaration( $2->begin());
|
||||
delete $2;
|
||||
handleComment( * $3);
|
||||
delete $3;
|
||||
delete_list( $3);
|
||||
}
|
||||
| STRUCT declaration comment_group {
|
||||
handleDeclaration( $2->string());
|
||||
handleDeclaration( $2->begin());
|
||||
delete $2;
|
||||
handleComment( * $3);
|
||||
delete $3;
|
||||
delete_list( $3);
|
||||
}
|
||||
| GLOBALFUNCTION declaration {
|
||||
handleFunctionDeclaration( $2->string());
|
||||
handleFunctionDeclaration( $2->begin());
|
||||
delete $2;
|
||||
}
|
||||
| GLOBALFUNCTIONTEMPLATE
|
||||
|
|
@ -376,30 +376,30 @@ global_tagged_declarator:
|
|||
optional_whitespaces
|
||||
declaration {
|
||||
handleFunctionTemplateDeclaration(
|
||||
$2->string(),
|
||||
$4->string());
|
||||
$2->begin(),
|
||||
$4->begin());
|
||||
delete $2;
|
||||
delete $3;
|
||||
delete_list( $3);
|
||||
delete $4;
|
||||
}
|
||||
| GLOBALVARIABLE declaration {
|
||||
handleDeclaration( $2->string());
|
||||
handleDeclaration( $2->begin());
|
||||
delete $2;
|
||||
}
|
||||
| GLOBALTYPEDEF declaration {
|
||||
handleDeclaration( $2->string());
|
||||
handleDeclaration( $2->begin());
|
||||
delete $2;
|
||||
}
|
||||
| GLOBALENUM declaration {
|
||||
handleDeclaration( $2->string());
|
||||
handleDeclaration( $2->begin());
|
||||
delete $2;
|
||||
}
|
||||
| GLOBALSTRUCT declaration {
|
||||
handleDeclaration( $2->string());
|
||||
handleDeclaration( $2->begin());
|
||||
delete $2;
|
||||
}
|
||||
| DECLARATION declaration {
|
||||
handleDeclaration( $2->string());
|
||||
handleDeclaration( $2->begin());
|
||||
delete $2;
|
||||
}
|
||||
;
|
||||
|
|
@ -408,55 +408,61 @@ global_tagged_declarator:
|
|||
/* ===================================== */
|
||||
comment_group: optional_whitespaces '{' comment_sequence '}' {
|
||||
$$ = $3;
|
||||
delete $1;
|
||||
delete_list( $1);
|
||||
}
|
||||
| optional_whitespaces BLOCKINTRO comment_sequence '}' {
|
||||
$$ = $3;
|
||||
delete $1;
|
||||
delete_list( $1);
|
||||
}
|
||||
;
|
||||
|
||||
comment_sequence: optional_whitespaces { $$ = new Text(managed);
|
||||
delete $1;
|
||||
comment_sequence: optional_whitespaces { $$ = new Buffer_list();
|
||||
delete_list( $1);
|
||||
}
|
||||
| optional_whitespaces
|
||||
non_empty_comment_sequence
|
||||
optional_whitespaces { $$ = $2;
|
||||
delete $1;
|
||||
delete $3;
|
||||
delete_list( $1);
|
||||
delete_list( $3);
|
||||
}
|
||||
;
|
||||
|
||||
full_comment_sequence: /* empty */ { $$ = new Text(managed); }
|
||||
full_comment_sequence: /* empty */ { $$ = new Buffer_list(); }
|
||||
| whitespaces { $$ = $1; }
|
||||
| optional_whitespaces
|
||||
non_empty_comment_sequence
|
||||
optional_whitespaces {
|
||||
$$ = $1;
|
||||
$$->append( * $2);
|
||||
$$->append( * $3);
|
||||
$$->insert($$->end(), $2->begin(),$2->end());
|
||||
$$->insert($$->end(), $3->begin(),$3->end());
|
||||
delete $2;
|
||||
delete $3;
|
||||
}
|
||||
;
|
||||
|
||||
non_empty_comment_sequence:
|
||||
comment_token { $$ = new Text( * $1, managed); }
|
||||
comment_token { $$ = new Buffer_list( 1, $1); }
|
||||
| compound_comment { $$ = $1; }
|
||||
| non_empty_comment_sequence optional_whitespaces comment_token {
|
||||
| non_empty_comment_sequence optional_whitespaces
|
||||
comment_token {
|
||||
$$ = $1;
|
||||
$$->append( * $2);
|
||||
$$->append( * $3);
|
||||
$$->insert($$->end(), $2->begin(),$2->end());
|
||||
delete $2;
|
||||
$$->push_back( $3);
|
||||
}
|
||||
| non_empty_comment_sequence
|
||||
optional_whitespaces
|
||||
compound_comment {
|
||||
$$ = $1;
|
||||
$$->append( * $2);
|
||||
$$->append( * $3);
|
||||
$$->insert($$->end(), $2->begin(),$2->end());
|
||||
delete $2;
|
||||
$$->insert($$->end(), $3->begin(),$3->end());
|
||||
delete $3;
|
||||
}
|
||||
;
|
||||
|
||||
comment_token: non_empty_token { $$ = $1; }
|
||||
| comment_token non_empty_token {
|
||||
comment_token: string { $$ = $1; }
|
||||
| comment_token string {
|
||||
$$ = $1;
|
||||
$$->add( * $2);
|
||||
delete $2;
|
||||
|
|
@ -465,8 +471,8 @@ comment_token: non_empty_token { $$ = $1; }
|
|||
|
||||
compound_comment: '{' full_comment_sequence '}' {
|
||||
$$ = $2;
|
||||
$$->cons( *new TextToken( "{", 1));
|
||||
$$->append( *new TextToken( "}", 1));
|
||||
$$->push_front( new Buffer( "{", 1));
|
||||
$$->push_back( new Buffer( "}", 1));
|
||||
}
|
||||
| BLOCKINTRO full_comment_sequence '}' {
|
||||
$$ = $2;
|
||||
|
|
@ -474,140 +480,120 @@ compound_comment: '{' full_comment_sequence '}' {
|
|||
| CCSTYLE '{' nested_token_sequence '}' {
|
||||
$$ = $3;
|
||||
set_INITIAL = 1;
|
||||
if ( $$->head().isSpace) // should not
|
||||
$$->cons( *new TextToken( "`", 1));
|
||||
if ( $$->front()->is_space()) // should not
|
||||
$$->push_front( new Buffer( "`", 1));
|
||||
else
|
||||
$$->head().prepend( "`");
|
||||
InListFIter< TextToken> ix( * $$);
|
||||
ForAll( ix) {
|
||||
if ( ix.isLast())
|
||||
if ( ix->isSpace)
|
||||
$$->append( *new TextToken(
|
||||
"'", 1));
|
||||
else
|
||||
ix->add( "'");
|
||||
}
|
||||
}
|
||||
$$->front()->prepend( "`");
|
||||
if ( $$->back()->is_space())
|
||||
$$->push_back( new Buffer( "'", 1));
|
||||
else
|
||||
$$->back()->add( "'");
|
||||
}
|
||||
| CCSECTION '{' comment_sequence '}' {
|
||||
$$ = $3;
|
||||
$$->cons( *new TextToken( " ", 1, true));
|
||||
$$->cons( *new TextToken( "SECTION:"));
|
||||
$$->cons( *new TextToken( "\n", 1, true));
|
||||
$$->cons( *new TextToken( "\n", 1, true));
|
||||
$$->append( *new TextToken( "\n", 1, true));
|
||||
$$->append( *new TextToken(
|
||||
$$->push_front( new Buffer( " ", 1));
|
||||
$$->push_front( new Buffer( "SECTION:"));
|
||||
$$->push_front( new Buffer( "\n", 1));
|
||||
$$->push_front( new Buffer( "\n", 1));
|
||||
$$->push_back( new Buffer( "\n", 1));
|
||||
$$->push_back( new Buffer(
|
||||
"===================================="
|
||||
"===================================="));
|
||||
$$->append( *new TextToken( "\n", 1, true));
|
||||
$$->append( *new TextToken( "\n", 1, true));
|
||||
$$->push_back( new Buffer( "\n", 1));
|
||||
$$->push_back( new Buffer( "\n", 1));
|
||||
}
|
||||
| CCSUBSECTION '{' comment_sequence '}' {
|
||||
$$ = $3;
|
||||
$$->cons( *new TextToken( " ", 1, true));
|
||||
$$->cons( *new TextToken( "Subsection:"));
|
||||
$$->cons( *new TextToken( "\n", 1, true));
|
||||
$$->cons( *new TextToken( "\n", 1, true));
|
||||
$$->append( *new TextToken( "\n", 1, true));
|
||||
$$->append( *new TextToken(
|
||||
$$->push_front( new Buffer( " ", 1));
|
||||
$$->push_front( new Buffer( "Subsection:"));
|
||||
$$->push_front( new Buffer( "\n", 1));
|
||||
$$->push_front( new Buffer( "\n", 1));
|
||||
$$->push_back( new Buffer( "\n", 1));
|
||||
$$->push_back( new Buffer(
|
||||
"------------------------------------"
|
||||
"------------------------------------"));
|
||||
$$->append( *new TextToken( "\n", 1, true));
|
||||
$$->append( *new TextToken( "\n", 1, true));
|
||||
$$->push_back( new Buffer( "\n", 1));
|
||||
$$->push_back( new Buffer( "\n", 1));
|
||||
}
|
||||
| HEADING '{' comment_sequence '}' {
|
||||
$$ = $3;
|
||||
}
|
||||
| INCLUDE '{' comment_sequence '}' {
|
||||
$$ = $3;
|
||||
$$->cons( *new TextToken( "<"));
|
||||
$$->cons( *new TextToken( " ", 1, true));
|
||||
$$->cons( *new TextToken( "#include"));
|
||||
$$->append( *new TextToken( ">"));
|
||||
$$->push_front( new Buffer( "<"));
|
||||
$$->push_front( new Buffer( " ", 1));
|
||||
$$->push_front( new Buffer( "#include"));
|
||||
$$->push_back( new Buffer( ">"));
|
||||
}
|
||||
| COMMENTHEADING '{' comment_sequence '}' {
|
||||
$$ = $3;
|
||||
}
|
||||
| CREATIONVARIABLE {
|
||||
$$ = new Text( managed);
|
||||
$$->append( *new TextToken( "\n", 1, true));
|
||||
$$->append( *new TextToken( "\n", 1, true));
|
||||
$$->append( *new TextToken(
|
||||
$$ = new Buffer_list();
|
||||
$$->push_back( new Buffer( "\n", 1));
|
||||
$$->push_back( new Buffer( "\n", 1));
|
||||
$$->push_back( new Buffer(
|
||||
"New creation variable is:"));
|
||||
$$->append( *new TextToken( " ", 1, true));
|
||||
TextToken* t = new TextToken($1.text,$1.len);
|
||||
$$->push_back( new Buffer( " ", 1));
|
||||
Buffer* t = new Buffer( $1.text, $1.len);
|
||||
t->prepend( "`");
|
||||
t->add( "'");
|
||||
$$->append( *t);
|
||||
$$->append( *new TextToken( "\n", 1, true));
|
||||
$$->append( *new TextToken( "\n", 1, true));
|
||||
$$->push_back( t);
|
||||
$$->push_back( new Buffer( "\n", 1));
|
||||
$$->push_back( new Buffer( "\n", 1));
|
||||
}
|
||||
;
|
||||
|
||||
/* Parsing of a C++ expression/statement with nested expressions */
|
||||
/* ============================================================= */
|
||||
nested_token_sequence:
|
||||
/* empty */ {
|
||||
$$ = new Text(managed);
|
||||
}
|
||||
/* empty */ { $$ = new Buffer_list(); }
|
||||
| nested_token_sequence nested_token
|
||||
{
|
||||
$1->append( * $2);
|
||||
$1->insert($1->end(), $2->begin(),$2->end());
|
||||
delete $2;
|
||||
$$ = $1;
|
||||
}
|
||||
;
|
||||
|
||||
nested_token: string {
|
||||
$$ = new Text(*new TextToken(
|
||||
$1->string(),
|
||||
$1->length()),
|
||||
managed);
|
||||
delete $1;
|
||||
}
|
||||
nested_token: string { $$ = new Buffer_list( 1, $1); }
|
||||
| SPACE {
|
||||
$$ = new Text(*new TextToken(
|
||||
$1.text,
|
||||
$1.len,
|
||||
true),
|
||||
managed);
|
||||
$$ = new Buffer_list( 1,
|
||||
new Buffer( $1.text, $1.len));
|
||||
}
|
||||
| NEWLINE {
|
||||
$$ = new Text(*new TextToken( "\n", 1, true),
|
||||
managed);
|
||||
$$ = new Buffer_list( 1,
|
||||
new Buffer( "\n", 1));
|
||||
}
|
||||
| '{' nested_token_sequence '}' {
|
||||
$2->cons( *new TextToken( "{", 1));
|
||||
$2->append( *new TextToken( "}", 1));
|
||||
$2->push_front( new Buffer( "{", 1));
|
||||
$2->push_back( new Buffer( "}", 1));
|
||||
$$ = $2;
|
||||
}
|
||||
| BLOCKINTRO nested_token_sequence '}' {
|
||||
$$ = $2;
|
||||
}
|
||||
| '[' nested_token_sequence ']' {
|
||||
$2->cons( *new TextToken( "[", 1));
|
||||
$2->append( *new TextToken( "]", 1));
|
||||
$2->push_front( new Buffer( "[", 1));
|
||||
$2->push_back( new Buffer( "]", 1));
|
||||
$$ = $2;
|
||||
}
|
||||
| '(' nested_token_sequence ')' {
|
||||
$2->cons( *new TextToken( "(", 1));
|
||||
$2->append( *new TextToken( ")", 1));
|
||||
$2->push_front( new Buffer( "(", 1));
|
||||
$2->push_back( new Buffer( ")", 1));
|
||||
$$ = $2;
|
||||
}
|
||||
| CCSTYLE '{' nested_token_sequence '}' {
|
||||
$$ = $3;
|
||||
set_INITIAL = 1;
|
||||
if ( $$->head().isSpace) // should not
|
||||
$$->cons( *new TextToken( "`", 1));
|
||||
if ( $$->front()->is_space()) // should not
|
||||
$$->push_front( new Buffer( "`", 1));
|
||||
else
|
||||
$$->head().prepend( "`");
|
||||
InListFIter< TextToken> ix( * $$);
|
||||
ForAll( ix) {
|
||||
if ( ix.isLast())
|
||||
if ( ix->isSpace)
|
||||
$$->append( *new TextToken(
|
||||
"'", 1));
|
||||
else
|
||||
ix->add( "'");
|
||||
}
|
||||
$$->front()->prepend( "`");
|
||||
if ( $$->back()->is_space())
|
||||
$$->push_back( new Buffer( "'", 1));
|
||||
else
|
||||
$$->back()->add( "'");
|
||||
}
|
||||
;
|
||||
|
||||
|
|
@ -653,7 +639,7 @@ cc_stmts: /* empty */
|
|||
{ $$ = new Buffer;}
|
||||
| cc_stmts cc_stmt {
|
||||
$$ = $1;
|
||||
$$->add( $2);
|
||||
$$->add( * $2);
|
||||
delete $2;
|
||||
}
|
||||
;
|
||||
|
|
@ -680,7 +666,7 @@ cc_stmts_skip_space:
|
|||
{ $$ = new Buffer;}
|
||||
| string
|
||||
cc_stmts { $$ = $1;
|
||||
$$->add( $2);
|
||||
$$->add( * $2);
|
||||
delete $2;
|
||||
}
|
||||
| SPACE cc_stmts { $$ = $2;}
|
||||
|
|
@ -692,7 +678,7 @@ cc_stmts_skip_space:
|
|||
$$ = $3;
|
||||
$$->prepend( '{');
|
||||
$$->add( '}');
|
||||
$$->add( $6);
|
||||
$$->add( * $6);
|
||||
delete $6;
|
||||
}
|
||||
;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#if ! defined( MODULE_CONFIG)
|
||||
#define MODULE_CONFIG 1
|
||||
|
||||
#include <database.h>
|
||||
#include <buffer.h>
|
||||
#include <mstring.h>
|
||||
|
||||
|
||||
|
|
@ -49,16 +49,16 @@ extern const string reference_icon;
|
|||
|
||||
|
||||
// outdated
|
||||
int text_block_length( const Text& T);
|
||||
char* text_block_to_string( const Text& T);
|
||||
bool is_text_block_empty( const Text& T);
|
||||
void print_html_text_block( ostream &out, const Text& T);
|
||||
int text_block_length( const Buffer_list& T);
|
||||
char* text_block_to_string( const Buffer_list& T);
|
||||
bool is_text_block_empty( const Buffer_list& T);
|
||||
void print_html_text_block( ostream &out, const Buffer_list& T);
|
||||
|
||||
|
||||
void handleText( const Text& T);
|
||||
void handleTextToken( const TextToken& TT);
|
||||
void handleString( const char* s);
|
||||
void handleString( const string& s);
|
||||
void handleChar( char c);
|
||||
void handleText( const Buffer_list& T);
|
||||
void handleBuffer( const Buffer& TT);
|
||||
void handleString( const char* s);
|
||||
void handleString( const string& s);
|
||||
void handleChar( char c);
|
||||
|
||||
#endif // MODULE_CONFIG //
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <database.h>
|
||||
#include <buffer.h>
|
||||
#include <html_config.h>
|
||||
#include <string_conversion.h>
|
||||
#include <internal_macros.h>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include <cpp_formatting.h>
|
||||
#include <internal_macros.h>
|
||||
|
||||
#include <database.h>
|
||||
#include <buffer.h>
|
||||
#include <html_config.h>
|
||||
|
||||
|
||||
|
|
@ -39,11 +39,11 @@ int yyerror( char *s);
|
|||
%}
|
||||
|
||||
%union {
|
||||
const char* text; /* a chunk of zero terminated text */
|
||||
char character; /* a character */
|
||||
int number; /* an integer */
|
||||
TextToken* pTextToken;
|
||||
Text* pText;
|
||||
const char* text; /* a chunk of zero terminated text */
|
||||
char character; /* a character */
|
||||
int number; /* an integer */
|
||||
Buffer* pBuffer;
|
||||
Buffer_list* pText;
|
||||
}
|
||||
|
||||
/* Elementary data types */
|
||||
|
|
@ -81,8 +81,10 @@ int yyerror( char *s);
|
|||
|
||||
/* Type declarations for production rules */
|
||||
/* -------------------------------------------- */
|
||||
%type <pTextToken> string_token
|
||||
%type <pText> comment_group comment_sequence comment_token
|
||||
%type <pBuffer> string_token
|
||||
%type <pText> comment_group
|
||||
%type <pText> comment_sequence
|
||||
%type <pText> comment_token
|
||||
|
||||
|
||||
|
||||
|
|
@ -98,13 +100,13 @@ stmt: error {}
|
|||
| direct_string {}
|
||||
| CHAPTER '{' comment_sequence '}' {
|
||||
handleChapter( * $3);
|
||||
delete $3;
|
||||
delete_list( $3);
|
||||
}
|
||||
| BEGINCLASS { handleClassEnvironment(); }
|
||||
| ENDCLASS { handleClassEnd(); }
|
||||
| HTMLBEGINCLASSFILE comment_group
|
||||
{ handleHtmlClassFile( cc_filename,*$2);
|
||||
delete $2;
|
||||
delete_list( $2);
|
||||
}
|
||||
| '{' input '}'
|
||||
;
|
||||
|
|
@ -174,27 +176,27 @@ direct_string: STRING { handleString( $1); }
|
|||
;
|
||||
|
||||
|
||||
string_token: STRING { $$ = new TextToken( $1); }
|
||||
| CHAR { $$ = new TextToken(); $$->add( $1); }
|
||||
string_token: STRING { $$ = new Buffer( $1); }
|
||||
| CHAR { $$ = new Buffer( $1); }
|
||||
| ASCIITOHTML PARAMETER {
|
||||
char* s = convert_ascii_to_html($2);
|
||||
$$ = new TextToken( s);
|
||||
$$ = new Buffer( s);
|
||||
delete[] $2;
|
||||
delete[] s;
|
||||
set_old_state = 1;
|
||||
}
|
||||
| RAWOUTPUT PARAMETER {
|
||||
$$ = new TextToken( $2);
|
||||
$$ = new Buffer( $2);
|
||||
delete[] $2;
|
||||
set_old_state = 1;
|
||||
}
|
||||
| RAWOUTPUTN {
|
||||
$$ = new TextToken( $1);
|
||||
$$ = new Buffer( $1);
|
||||
delete[] $1;
|
||||
set_old_state = 1;
|
||||
}
|
||||
| DEFWITHARGS PARAMETER {
|
||||
$$ = new TextToken();
|
||||
$$ = new Buffer();
|
||||
if ( number_of_args < 1 ||
|
||||
number_of_args> 9)
|
||||
printErrorMessage( NParamRangeError);
|
||||
|
|
@ -207,7 +209,7 @@ string_token: STRING { $$ = new TextToken( $1); }
|
|||
set_old_state = 1;
|
||||
}
|
||||
| GDEFWITHARGS PARAMETER {
|
||||
$$ = new TextToken();
|
||||
$$ = new Buffer();
|
||||
if ( number_of_args < 1 ||
|
||||
number_of_args > 9)
|
||||
printErrorMessage( NParamRangeError);
|
||||
|
|
@ -222,7 +224,7 @@ string_token: STRING { $$ = new TextToken( $1); }
|
|||
set_old_state = 1;
|
||||
}
|
||||
| DEFWITHUNKNOWNARGS PARAMETER {
|
||||
$$ = new TextToken();
|
||||
$$ = new Buffer();
|
||||
if ( ! quiet_switch) {
|
||||
cerr << endl
|
||||
<< "Unknown macro definition: "
|
||||
|
|
@ -243,15 +245,15 @@ string_token: STRING { $$ = new TextToken( $1); }
|
|||
comment_group: '{' comment_sequence '}' { $$ = $2; }
|
||||
;
|
||||
|
||||
comment_sequence: /* empty */ { $$ = new Text( managed); }
|
||||
comment_sequence: /* empty */ { $$ = new Buffer_list(); }
|
||||
| comment_sequence comment_token {
|
||||
$$ = $1;
|
||||
$$->append( * $2);
|
||||
$$->insert($$->end(), $2->begin(),$2->end());
|
||||
delete $2;
|
||||
}
|
||||
;
|
||||
|
||||
comment_token: string_token { $$ = new Text( * $1, managed); }
|
||||
comment_token: string_token { $$ = new Buffer_list( 1, $1); }
|
||||
| comment_group { $$ = $1; }
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ static int next_class_link_last = 0;
|
|||
|
||||
string chapter_title;
|
||||
|
||||
void handleChapter( const Text& T) {
|
||||
void handleChapter( const Buffer_list& T) {
|
||||
next_class_link_last = 0;
|
||||
//string new_main_filename = macroX( "\\lciInputPath")
|
||||
// + macroX( "\\lciChapterPrefix")
|
||||
|
|
@ -218,7 +218,7 @@ void handleChapter( const Text& T) {
|
|||
<< "\">" << chapter_title << "</A>" << endl;
|
||||
}
|
||||
|
||||
void handleBiblio( const Text& T) {
|
||||
void handleBiblio( const Buffer_list& T) {
|
||||
ostream* out = open_file_for_write( tmp_path + macroX("\\lciBibFilename"));
|
||||
istream* in = open_config_file( macroX( "\\lciBiblioHeader"));
|
||||
filter_config_file( *in, *out);
|
||||
|
|
@ -326,7 +326,7 @@ void handleClassEnd( void) {
|
|||
handleClassFileEnd();
|
||||
}
|
||||
|
||||
void handleHtmlClassFile( const string& filename, const Text& T) {
|
||||
void handleHtmlClassFile( const string& filename, const Buffer_list& T) {
|
||||
char* s = text_block_to_string( T);
|
||||
string p = string("<A HREF=\"") + filename + "\">" + s + "</A>";
|
||||
handleClassFile( filename, p);
|
||||
|
|
@ -395,18 +395,6 @@ undef( const string&, string param[], size_t n, size_t opt) {
|
|||
return string();
|
||||
}
|
||||
|
||||
string
|
||||
optional_param_at_end( const string&, string param[], size_t n, size_t opt) {
|
||||
NParamCheck( 2, 0);
|
||||
string macroname( param[0]);
|
||||
crop_string( macroname);
|
||||
remove_separator( macroname);
|
||||
string s( param[1]);
|
||||
crop_string( s);
|
||||
setMacroOptEnd( macroname, atoi(s.c_str()));
|
||||
return string();
|
||||
}
|
||||
|
||||
string
|
||||
begin_scope( const string&, string param[], size_t n, size_t opt) {
|
||||
NParamCheck( 0, 0);
|
||||
|
|
@ -700,8 +688,6 @@ void init_internal_macros() {
|
|||
insertInternalGlobalMacro( "\\def", newcommand, 2);
|
||||
insertInternalGlobalMacro( "\\gdef", global_newcommand, 2);
|
||||
insertInternalGlobalMacro( "\\lciUndef", undef, 1);
|
||||
insertInternalGlobalMacro( "\\lciOptionalParameterAtEnd",
|
||||
optional_param_at_end, 2);
|
||||
insertInternalGlobalMacro( "\\lciBeginScope", begin_scope, 0);
|
||||
insertInternalGlobalMacro( "\\lciEndScope", end_scope, 0);
|
||||
insertInternalGlobalMacro( "\\lciIfDefined", if_defined, 1);
|
||||
|
|
@ -719,10 +705,8 @@ void init_internal_macros() {
|
|||
insertInternalGlobalMacro( "\\lciStyle", cc_style, 1);
|
||||
insertInternalGlobalMacro( "\\lciCCParameter", cc_parameter, 0);
|
||||
|
||||
insertInternalGlobalMacro( "\\lciTwoColumnLayout",
|
||||
two_column_layout, 1);
|
||||
insertInternalGlobalMacro( "\\lciThreeColumnLayout",
|
||||
three_column_layout, 2);
|
||||
insertInternalGlobalMacro( "\\lciTwoColumnLayout", two_column_layout, 1);
|
||||
insertInternalGlobalMacro( "\\lciThreeColumnLayout",three_column_layout,2);
|
||||
|
||||
insertInternalGlobalMacro( "\\lciHtmlIndex", html_index, 2);
|
||||
insertInternalGlobalMacro( "\\lciHtmlIndexC", html_index_C, 1);
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <mstring.h>
|
||||
#include <database.h>
|
||||
#include <buffer.h>
|
||||
|
||||
void init_internal_macros();
|
||||
|
||||
void handleChapter( const Text& T);
|
||||
void handleBiblio( const Text& T);
|
||||
void handleChapter( const Buffer_list& T);
|
||||
void handleBiblio( const Buffer_list& T);
|
||||
|
||||
void handleClassEnvironment();
|
||||
void handleClassEnd();
|
||||
|
|
@ -29,7 +29,7 @@ void handleClassEnd();
|
|||
void handleClassNameEnd( void);
|
||||
void handleClassFileEnd( void);
|
||||
|
||||
void handleHtmlClassFile( const string& filename, const Text& T);
|
||||
void handleHtmlClassFile( const string& filename, const Buffer_list& T);
|
||||
|
||||
string handleHtmlIndexC( const string& category, const string& item);
|
||||
string handleHtmlIndex( const string& category, const string& item);
|
||||
|
|
|
|||
|
|
@ -394,7 +394,6 @@
|
|||
\gdef{\lciIfHtmlRefLinks}{\lcTrue}%
|
||||
\gdef{\lciIfHtmlRefIndex}{\lcTrue}%
|
||||
}
|
||||
\lciOptionalParameterAtEnd{\begin@ccRefDeclaration}{1}
|
||||
\newcommand{\begin@ccRefDeclaration@mo}{%
|
||||
\def\ccRefCategory{#C1}%
|
||||
\def\ccPureRefScope{#C2}%
|
||||
|
|
@ -676,7 +675,6 @@
|
|||
|
||||
\newcommand{\ccHtmlIndexC}{%
|
||||
\newcommand{\lciLocalIndexCategory}{class}\lciParseCC{\lciIndexCParsed}}
|
||||
\lciOptionalParameterAtEnd{\ccHtmlIndexC}{1}
|
||||
\newcommand{\ccHtmlIndexC@o}{%
|
||||
\newcommand{\lciLocalIndexCategory}{#C1}\lciParseCC{\lciIndexCParsed}}
|
||||
\newcommand{\lciIndexCParsed}{\lciIndexCParsedX{\lciLocalIndexCategory}}
|
||||
|
|
|
|||
|
|
@ -135,8 +135,6 @@
|
|||
%% newlines, except for tabbing and tabular environments.
|
||||
\newcommand{\\}{\lcRawHtml{<BR>}}
|
||||
\newcommand{\\*}{\lcRawHtml{<BR>}}
|
||||
\lciOptionalParameterAtEnd{\\}{1}
|
||||
\lciOptionalParameterAtEnd{\\*}{1}
|
||||
\newcommand{\\@o}{\lcRawHtml{<BR>}}
|
||||
\newcommand{\\*@o}{\lcRawHtml{<BR>}}
|
||||
|
||||
|
|
@ -239,7 +237,6 @@
|
|||
\newcommand{\footnotemark}{%
|
||||
\addtocounter{footnote}{1}%
|
||||
\footnotemark[\thefootnote]}
|
||||
\lciOptionalParameterAtEnd{\footnotemark}{1}
|
||||
\newcommand{\footnotemark@o}{%
|
||||
\lcRawHtml{<A HREF="##Footnote_#XC1"><SUP>#XC1</SUP></A>}}
|
||||
\newcommand{\footnotetext}[1]{%
|
||||
|
|
@ -1020,7 +1017,6 @@
|
|||
\newcommand{\pagenumbering}[1]{}
|
||||
|
||||
\newcommand{\twocolumn}{}
|
||||
\lciOptionalParameterAtEnd{\twocolumn}{1}
|
||||
\newcommand{\twocolumn@o}{#1}
|
||||
\newcommand{\onecolumn}{}
|
||||
|
||||
|
|
@ -1057,7 +1053,6 @@
|
|||
\newenvironment{enumerate}{\lcRawHtml{<OL>}}{\lcRawHtml{</OL>}}
|
||||
\newenvironment{description}{\lcRawHtml{<DL>}}{\lcRawHtml{</DL>}}
|
||||
\newcommand{\item}{\lcRawHtml{<LI>}}
|
||||
\lciOptionalParameterAtEnd{\item}{1}
|
||||
\newcommand{\item@o}{\lcRawHtml{<DT><B>}#1\lcRawHtml{</B><DD>}}
|
||||
|
||||
\newcommand{\lciLocalVerbatim}[1]{%
|
||||
|
|
@ -1143,14 +1138,12 @@
|
|||
|
||||
\newcommand{\newtheorem}[2]{%
|
||||
\gdef{\begin@#C1}{{\bf #2}~~\lcRawHtml{<EM>}}%
|
||||
\lciOptionalParameterAtEnd{\begin@#C1}{1}%
|
||||
\gdef{\begin@#C1@o}{{\bf #2 (##1)}~~\lcRawHtml{<EM>}}%
|
||||
\gdef{\end#C1}{\lcRawHtml{</EM>}}%
|
||||
}
|
||||
\newcommand{\newcounter}[1]{%
|
||||
\gdef{\the#C1}{0}%
|
||||
\gdef{\lciDependantCounter#C1}{}}
|
||||
\lciOptionalParameterAtEnd{\newcounter}{1}
|
||||
\newcommand{\newcounter@mo}{
|
||||
\gdef{\the#C1}{0}%
|
||||
\gdef{\lciDependantCounter#C1}{}%
|
||||
|
|
@ -1177,15 +1170,11 @@
|
|||
|
||||
\newenvironment{figure}{\newcommand{\lciLabelTitle}{{\bf Figure:~~}}}{}
|
||||
\newenvironment{figure*}{\begin{figure}}{\end{figure}}
|
||||
\lciOptionalParameterAtEnd{\begin@figure}{1}
|
||||
\lciOptionalParameterAtEnd{\begin@figure*}{1}
|
||||
\newenvironment{figure@o}{\begin{figure}}{\end{figure}}
|
||||
\newenvironment{figure*@o}{\begin{figure}}{\end{figure}}
|
||||
|
||||
\newenvironment{table}{\newcommand{\lciLabelTitle}{{\bf Table:~~}}}{}
|
||||
\newenvironment{table*}{\begin{table}}{\end{table}}
|
||||
\lciOptionalParameterAtEnd{\begin@table}{1}
|
||||
\lciOptionalParameterAtEnd{\begin@table*}{1}
|
||||
\newenvironment{table@o}{\begin{table}}{\end{table}}
|
||||
\newenvironment{table*@o}{\begin{table}}{\end{table}}
|
||||
|
||||
|
|
@ -1193,7 +1182,6 @@
|
|||
\newcommand{\caption@om}{\lciLabelTitle #1}
|
||||
|
||||
\newcommand{\suppressfloats}{}
|
||||
\lciOptionalParameterAtEnd{\suppressfloats}{1}
|
||||
\newcommand{\suppressfloats@o}{}
|
||||
|
||||
\newcommand{\marginpar}[1]{%
|
||||
|
|
@ -1229,8 +1217,6 @@
|
|||
\newcommand{\>}{\lciTabbingSkip}%
|
||||
\renewcommand{\\}{\lciTabbingNL}%
|
||||
\renewcommand{\\*}{\lciTabbingNL}%
|
||||
\lciOptionalParameterAtEnd{\\}{1}%
|
||||
\lciOptionalParameterAtEnd{\\*}{1}%
|
||||
\renewcommand{\\@o}{\lciTabbingNL}%
|
||||
\renewcommand{\\*@o}{\lciTabbingNL}%
|
||||
}
|
||||
|
|
@ -1270,8 +1256,6 @@
|
|||
\newcommand{&}{\lciTabularSkip}%
|
||||
\renewcommand{\\}{\lciTabularNL}%
|
||||
\renewcommand{\\*}{\lciTabularNL}%
|
||||
\lciOptionalParameterAtEnd{\\}{1}%
|
||||
\lciOptionalParameterAtEnd{\\*}{1}%
|
||||
\renewcommand{\\@o}{\lciTabularNL}%
|
||||
\renewcommand{\\*@o}{\lciTabularNL}%
|
||||
\lciTabularCountColumns #1\*%
|
||||
|
|
@ -1438,10 +1422,8 @@
|
|||
% ###########################################################################
|
||||
|
||||
\newcommand{\linebreak}{}
|
||||
\lciOptionalParameterAtEnd{\linebreak}{1}
|
||||
\newcommand{\linebreak@o}{}
|
||||
\newcommand{\nolinebreak}{}
|
||||
\lciOptionalParameterAtEnd{\nolinebreak}{1}
|
||||
\newcommand{\nolinebreak@o}{}
|
||||
|
||||
\newcommand{\newline}{\\}
|
||||
|
|
@ -1453,10 +1435,8 @@
|
|||
\newenvironment{sloppypar}{}{}
|
||||
|
||||
\newcommand{\pagebreak}{}
|
||||
\lciOptionalParameterAtEnd{\pagebreak}{1}
|
||||
\newcommand{\pagebreak@o}{}
|
||||
\newcommand{\nopagebreak}{}
|
||||
\lciOptionalParameterAtEnd{\nopagebreak}{1}
|
||||
\newcommand{\nopagebreak@o}{}
|
||||
|
||||
\newcommand{\samepage}{}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
include(CONFIG_PATH/header.tex)
|
||||
\begin{ccRefClass}SCOPE{PREFIX`'ITEM} %% add template arg's if necessary
|
||||
|
||||
%% \ccHtmlCrossLink{} %% add further rules for cross referencing links
|
||||
%% \ccHtmlIndexC[class]{} %% add further `index' entries
|
||||
|
||||
\ccDefinition
|
||||
|
||||
The class \ccRefName\ does this and that.
|
||||
|
||||
\ccInclude{SUBDIR`'ITEM.h}
|
||||
|
||||
\ccIsModel
|
||||
|
||||
\ccc{Concept}
|
||||
|
||||
\ccTypes
|
||||
|
||||
\ccNestedType{TYPE}{some nested types}
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{a} %% choose variable name
|
||||
|
||||
\ccConstructor{PREFIX`'ITEM`'();}{default constructor.}
|
||||
|
||||
\ccOperations
|
||||
|
||||
\ccMethod{void foo();}{some member functions}
|
||||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccc{Some_other_class},
|
||||
\ccc{some_other_function}.
|
||||
|
||||
\ccExample
|
||||
|
||||
A short example program.
|
||||
Instead of a short program fragment, a full running program can be
|
||||
included using the
|
||||
\verb|\ccIncludeExampleCode{examples/PACKAGE/ITEM`'_prog.C}|
|
||||
macro. The program example would be part of the source code distribution and
|
||||
also part of the automatic test suite.
|
||||
|
||||
\begin{ccExampleCode}
|
||||
void your_example_code() {
|
||||
}
|
||||
\end{ccExampleCode}
|
||||
|
||||
%% \ccIncludeExampleCode{examples/PACKAGE/ITEM`'_prog.C}
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
include(CONFIG_PATH/footer.tex)
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
include(CONFIG_PATH/header.tex)
|
||||
\begin{ccRefConcept}{ITEM}
|
||||
|
||||
%% \ccHtmlCrossLink{} %% add further rules for cross referencing links
|
||||
%% \ccHtmlIndexC[concept]{} %% add further `index' entries
|
||||
|
||||
\ccDefinition
|
||||
|
||||
The concept \ccRefName\ does this and that.
|
||||
|
||||
\ccTypes
|
||||
|
||||
\ccNestedType{TYPE}{some nested types}
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{a} %% choose variable name
|
||||
|
||||
\ccConstructor{ITEM`'();}{default constructor.}
|
||||
|
||||
\ccOperations
|
||||
|
||||
\ccMethod{void foo();}{some member functions}
|
||||
|
||||
\ccHasModels
|
||||
|
||||
\ccc{Some_class},
|
||||
\ccc{Some_other_class}.
|
||||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccc{Some_other_concept},
|
||||
\ccc{some_other_function}.
|
||||
|
||||
\ccExample
|
||||
|
||||
A short example program.
|
||||
Instead of a short program fragment, a full running program can be
|
||||
included using the
|
||||
\verb|\ccIncludeExampleCode{examples/PACKAGE/ITEM`'_prog.C}|
|
||||
macro. The program example would be part of the source code distribution and
|
||||
also part of the automatic test suite.
|
||||
|
||||
\begin{ccExampleCode}
|
||||
void your_example_code() {
|
||||
}
|
||||
\end{ccExampleCode}
|
||||
|
||||
%% \ccIncludeExampleCode{examples/PACKAGE/ITEM`'_prog.C}
|
||||
|
||||
\end{ccRefConcept}
|
||||
|
||||
include(CONFIG_PATH/footer.tex)
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
include(CONFIG_PATH/header.tex)
|
||||
\begin{ccRefEnum}SCOPE{PREFIX`'ITEM} %% add template arg's if necessary
|
||||
|
||||
%% \ccHtmlCrossLink{} %% add further rules for cross referencing links
|
||||
%% \ccHtmlIndexC[enum]{} %% add further `index' entries
|
||||
|
||||
\ccDefinition
|
||||
|
||||
The enum \ccRefName\ does this and that.
|
||||
|
||||
\ccInclude{SUBDIR`'ITEM.h}
|
||||
|
||||
\ccGlobalEnum{enum PREFIX`'ITEM { tag1, tag2 };}
|
||||
|
||||
\ccIsModel
|
||||
|
||||
\ccc{Concept}
|
||||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccc{Some_other_enum},
|
||||
\ccc{some_other_function}.
|
||||
|
||||
\ccExample
|
||||
|
||||
A short example program.
|
||||
Instead of a short program fragment, a full running program can be
|
||||
included using the
|
||||
\verb|\ccIncludeExampleCode{examples/PACKAGE/ITEM`'_prog.C}|
|
||||
macro. The program example would be part of the source code distribution and
|
||||
also part of the automatic test suite.
|
||||
|
||||
\begin{ccExampleCode}
|
||||
void your_example_code() {
|
||||
}
|
||||
\end{ccExampleCode}
|
||||
|
||||
%% \ccIncludeExampleCode{examples/PACKAGE/ITEM`'_prog.C}
|
||||
|
||||
\end{ccRefEnum}
|
||||
|
||||
include(CONFIG_PATH/footer.tex)
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
include(CONFIG_PATH/header.tex)
|
||||
\begin{ccRefFunction}SCOPE{PREFIX`'ITEM} %% add template arg's if necessary
|
||||
|
||||
%% \ccHtmlCrossLink{} %% add further rules for cross referencing links
|
||||
%% \ccHtmlIndexC[function]{} %% add further `index' entries
|
||||
|
||||
\ccDefinition
|
||||
|
||||
The function \ccRefName\ does this and that.
|
||||
|
||||
\ccInclude{SUBDIR`'ITEM.h}
|
||||
|
||||
\ccGlobalFunction{void PREFIX`'ITEM`'();}
|
||||
|
||||
\ccIsModel
|
||||
|
||||
\ccc{Concept}
|
||||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccc{Some_other_class},
|
||||
\ccc{some_other_function}.
|
||||
|
||||
\ccExample
|
||||
|
||||
A short example program.
|
||||
Instead of a short program fragment, a full running program can be
|
||||
included using the
|
||||
\verb|\ccIncludeExampleCode{examples/PACKAGE/ITEM`'_prog.C}|
|
||||
macro. The program example would be part of the source code distribution and
|
||||
also part of the automatic test suite.
|
||||
|
||||
\begin{ccExampleCode}
|
||||
void your_example_code() {
|
||||
}
|
||||
\end{ccExampleCode}
|
||||
|
||||
%% \ccIncludeExampleCode{examples/PACKAGE/ITEM`'_prog.C}
|
||||
|
||||
\end{ccRefFunction}
|
||||
|
||||
include(CONFIG_PATH/footer.tex)
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
include(CONFIG_PATH/header.tex)
|
||||
\begin{ccRefMacro}{PREFIX`'ITEM} %% add template arg's if necessary
|
||||
|
||||
%% \ccHtmlCrossLink{} %% add further rules for cross referencing links
|
||||
%% \ccHtmlIndexC[macro]{} %% add further `index' entries
|
||||
|
||||
\ccDefinition
|
||||
|
||||
The macro \ccRefName\ does this and that.
|
||||
|
||||
\ccInclude{SUBDIR`'ITEM.h}
|
||||
|
||||
\ccc{PREFIX`'ITEM}
|
||||
|
||||
\ccIsModel
|
||||
|
||||
\ccc{Concept}
|
||||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccc{Some_other_macro},
|
||||
\ccc{some_other_function}.
|
||||
|
||||
\ccExample
|
||||
|
||||
A short example program.
|
||||
Instead of a short program fragment, a full running program can be
|
||||
included using the
|
||||
\verb|\ccIncludeExampleCode{examples/PACKAGE/ITEM`'_prog.C}|
|
||||
macro. The program example would be part of the source code distribution and
|
||||
also part of the automatic test suite.
|
||||
|
||||
\begin{ccExampleCode}
|
||||
void your_example_code() {
|
||||
}
|
||||
\end{ccExampleCode}
|
||||
|
||||
%% \ccIncludeExampleCode{examples/PACKAGE/ITEM`'_prog.C}
|
||||
|
||||
\end{ccRefMacro}
|
||||
|
||||
include(CONFIG_PATH/footer.tex)
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
include(CONFIG_PATH/header.tex)
|
||||
\begin{ccRefVariable}SCOPE{PREFIX`'ITEM} %% add template arg's if necessary
|
||||
|
||||
%% \ccHtmlCrossLink{} %% add further rules for cross referencing links
|
||||
%% \ccHtmlIndexC[variable]{} %% add further `index' entries
|
||||
|
||||
\ccDefinition
|
||||
|
||||
The variable \ccRefName\ does this and that.
|
||||
|
||||
\ccInclude{SUBDIR`'ITEM.h}
|
||||
|
||||
\ccGlobalVariable{type PREFIX`'ITEM = init_value;}
|
||||
|
||||
\ccIsModel
|
||||
|
||||
\ccc{Concept}
|
||||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccc{Some_other_variable},
|
||||
\ccc{some_other_function}.
|
||||
|
||||
\ccExample
|
||||
|
||||
A short example program.
|
||||
Instead of a short program fragment, a full running program can be
|
||||
included using the
|
||||
\verb|\ccIncludeExampleCode{examples/PACKAGE/ITEM`'_prog.C}|
|
||||
macro. The program example would be part of the source code distribution and
|
||||
also part of the automatic test suite.
|
||||
|
||||
\begin{ccExampleCode}
|
||||
void your_example_code() {
|
||||
}
|
||||
\end{ccExampleCode}
|
||||
|
||||
%% \ccIncludeExampleCode{examples/PACKAGE/ITEM`'_prog.C}
|
||||
|
||||
\end{ccRefVariable}
|
||||
|
||||
include(CONFIG_PATH/footer.tex)
|
||||
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <mstring.h>
|
||||
#include <list.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -84,46 +84,46 @@ void insertMacro( const string& macro,
|
|||
const string& filename,
|
||||
size_t line,
|
||||
const string& body,
|
||||
size_t n_param,
|
||||
size_t n_opt) {
|
||||
size_t n_param) {
|
||||
if ( macro_def_switch) {
|
||||
cerr << "Macro definition: macro `" << macro << "' = `"
|
||||
<< body << "'." << endl;
|
||||
}
|
||||
assert( macro_dictionary.size() > 0);
|
||||
CC_Assert( macro_dictionary.size() > 0);
|
||||
if ( macro[0] != '\0' && macro[1] == '\0')
|
||||
set_active_char( macro[0], true);
|
||||
checkMacroOptEnd( macro);
|
||||
macro_dictionary.front()[ macro] =
|
||||
Macro_item( filename, line, body, n_param, n_opt);
|
||||
Macro_item( filename, line, body, n_param);
|
||||
}
|
||||
|
||||
void insertInternalMacro( const string& macro,
|
||||
ExpandFunction fct,
|
||||
size_t n_param,
|
||||
size_t n_opt) {
|
||||
size_t n_param) {
|
||||
if ( macro_def_switch) {
|
||||
cerr << "Internal def. : macro `" << macro << "'." << endl;
|
||||
}
|
||||
assert( macro_dictionary.size() > 0);
|
||||
CC_Assert( macro_dictionary.size() > 0);
|
||||
if ( macro[0] != '\0' && macro[1] == '\0')
|
||||
set_active_char( macro[0], true);
|
||||
checkMacroOptEnd( macro);
|
||||
macro_dictionary.front()[ macro] =
|
||||
Macro_item( "<internal macro>", 0, fct, n_param, n_opt);
|
||||
Macro_item( "<internal macro>", 0, fct, n_param);
|
||||
}
|
||||
|
||||
void insertInternalMacro( const string& macro,
|
||||
const string& body,
|
||||
size_t n_param ,
|
||||
size_t n_opt) {
|
||||
size_t n_param ) {
|
||||
if ( macro_def_switch) {
|
||||
cerr << "Internal def. : macro `" << macro << "' = `"
|
||||
<< body << "'." << endl;
|
||||
}
|
||||
assert( macro_dictionary.size() > 0);
|
||||
CC_Assert( macro_dictionary.size() > 0);
|
||||
if ( macro[0] != '\0' && macro[1] == '\0')
|
||||
set_active_char( macro[0], true);
|
||||
checkMacroOptEnd( macro);
|
||||
macro_dictionary.front()[ macro] =
|
||||
Macro_item( "<internal macro>", 0, body, n_param, n_opt);
|
||||
Macro_item( "<internal macro>", 0, body, n_param);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -131,49 +131,49 @@ void insertGlobalMacro( const string& macro,
|
|||
const string& filename,
|
||||
size_t line,
|
||||
const string& body,
|
||||
size_t n_param,
|
||||
size_t n_opt) {
|
||||
size_t n_param) {
|
||||
if ( macro_def_switch) {
|
||||
cerr << "Macro global def: macro `" << macro << "' = `"
|
||||
<< body << "'." << endl;
|
||||
}
|
||||
assert( macro_dictionary.size() > 0);
|
||||
CC_Assert( macro_dictionary.size() > 0);
|
||||
localEraseMacro( macro);
|
||||
if ( macro[0] != '\0' && macro[1] == '\0')
|
||||
set_all_active_char( macro[0], true);
|
||||
checkMacroOptEnd( macro);
|
||||
macro_dictionary.back()[ macro] =
|
||||
Macro_item( filename, line, body, n_param, n_opt);
|
||||
Macro_item( filename, line, body, n_param);
|
||||
}
|
||||
|
||||
void insertInternalGlobalMacro( const string& macro,
|
||||
ExpandFunction fct,
|
||||
size_t n_param,
|
||||
size_t n_opt) {
|
||||
size_t n_param) {
|
||||
if ( macro_def_switch) {
|
||||
cerr << "Internal gdef. : macro `" << macro << "'." << endl;
|
||||
}
|
||||
assert( macro_dictionary.size() > 0);
|
||||
CC_Assert( macro_dictionary.size() > 0);
|
||||
localEraseMacro( macro);
|
||||
if ( macro[0] != '\0' && macro[1] == '\0')
|
||||
set_all_active_char( macro[0], true);
|
||||
checkMacroOptEnd( macro);
|
||||
macro_dictionary.back()[ macro] =
|
||||
Macro_item( "<internal macro>", 0, fct, n_param, n_opt);
|
||||
Macro_item( "<internal macro>", 0, fct, n_param);
|
||||
}
|
||||
|
||||
void insertInternalGlobalMacro( const string& macro,
|
||||
const string& body,
|
||||
size_t n_param,
|
||||
size_t n_opt) {
|
||||
size_t n_param) {
|
||||
if ( macro_def_switch) {
|
||||
cerr << "Internal gdef. : macro `" << macro << "' = `"
|
||||
<< body << "'." << endl;
|
||||
}
|
||||
assert( macro_dictionary.size() > 0);
|
||||
CC_Assert( macro_dictionary.size() > 0);
|
||||
localEraseMacro( macro);
|
||||
if ( macro[0] != '\0' && macro[1] == '\0')
|
||||
set_all_active_char( macro[0], true);
|
||||
checkMacroOptEnd( macro);
|
||||
macro_dictionary.back()[ macro] =
|
||||
Macro_item( "<internal macro>", 0, body, n_param, n_opt);
|
||||
Macro_item( "<internal macro>", 0, body, n_param);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -214,19 +214,6 @@ bool macroIsTrue( const string& macro) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void setMacroOptEnd( const string& macro, int n_opt) {
|
||||
Macro_dictionary_scope::iterator j;
|
||||
if ( queryMacro( macro, j)) {
|
||||
(*j).second.n_opt_at_end = n_opt;
|
||||
} else {
|
||||
cerr << endl << "Unknown macro " << macro
|
||||
<< " in `" << in_string->name()
|
||||
<< " in line " << in_string->line() << "'.";
|
||||
if ( stack_trace_switch)
|
||||
printErrorMessage( MacroUndefinedError);
|
||||
}
|
||||
}
|
||||
|
||||
void eraseMacro( const string& macro) {
|
||||
if ( macro_def_switch) {
|
||||
cerr << "Macro erasion: macro `" << macro << "'." << endl;
|
||||
|
|
@ -393,5 +380,35 @@ string expandMacro( const string& macro,
|
|||
return s;
|
||||
}
|
||||
|
||||
void checkMacroOptEnd( const string& macro) {
|
||||
if ( macro.size() > 2) {
|
||||
int cnt = 0;
|
||||
string::const_iterator i = macro.end();
|
||||
-- i;
|
||||
while ( i != macro.begin() && *i == 'o') {
|
||||
-- i;
|
||||
++ cnt;
|
||||
}
|
||||
while ( i != macro.begin() && (*i == 'o' || *i == 'm'))
|
||||
--i;
|
||||
if ( *i != '@' || cnt == 0)
|
||||
return;
|
||||
string basename( macro.begin(), i);
|
||||
Macro_dictionary_scope::iterator j;
|
||||
if ( queryMacro( basename, j)) {
|
||||
if ( cnt > int((*j).second.n_opt_at_end))
|
||||
(*j).second.n_opt_at_end = cnt;
|
||||
} else {
|
||||
cerr << endl << "Error: Define macro " << basename
|
||||
<< " before defining optional arguments " << macro
|
||||
<< " in `" << in_string->name()
|
||||
<< " in line " << in_string->line() << "'.";
|
||||
if ( stack_trace_switch)
|
||||
printErrorMessage( MacroUndefinedError);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// EOF //
|
||||
|
|
|
|||
|
|
@ -30,22 +30,20 @@ struct Macro_item {
|
|||
size_t n_param;
|
||||
size_t n_opt_at_end;
|
||||
ExpandFunction fct;
|
||||
Macro_item() : n_param(0), n_opt_at_end(false) {}
|
||||
|
||||
Macro_item() : n_param(0), n_opt_at_end(0) {}
|
||||
Macro_item( const string& file,
|
||||
size_t ln,
|
||||
const string& bdy,
|
||||
size_t n_par = 0,
|
||||
size_t n_opt = 0)
|
||||
size_t n_par = 0)
|
||||
: filename(file), line(ln), body(bdy), n_param(n_par),
|
||||
n_opt_at_end(n_opt), fct(0)
|
||||
n_opt_at_end(0), fct(0)
|
||||
{}
|
||||
Macro_item( const string& file,
|
||||
size_t ln,
|
||||
ExpandFunction f,
|
||||
size_t n_par = 0,
|
||||
size_t n_opt = 0)
|
||||
: filename(file), line(ln), n_param(n_par),
|
||||
n_opt_at_end(n_opt), fct(f)
|
||||
size_t n_par = 0)
|
||||
: filename(file), line(ln), n_param(n_par), n_opt_at_end(0), fct(f)
|
||||
{}
|
||||
};
|
||||
|
||||
|
|
@ -56,35 +54,29 @@ void insertMacro( const string& macro,
|
|||
const string& filename,
|
||||
size_t line,
|
||||
const string& body,
|
||||
size_t n_param = 0,
|
||||
size_t n_opt = 0);
|
||||
size_t n_param = 0);
|
||||
|
||||
void insertInternalMacro( const string& macro,
|
||||
ExpandFunction fct,
|
||||
size_t n_param = 0,
|
||||
size_t n_opt = 0);
|
||||
size_t n_param = 0);
|
||||
|
||||
void insertInternalMacro( const string& macro,
|
||||
const string& body,
|
||||
size_t n_param = 0,
|
||||
size_t n_opt = 0);
|
||||
size_t n_param = 0);
|
||||
|
||||
void insertGlobalMacro( const string& macro,
|
||||
const string& filename,
|
||||
size_t line,
|
||||
const string& body,
|
||||
size_t n_param = 0,
|
||||
size_t n_opt = 0);
|
||||
size_t n_param = 0);
|
||||
|
||||
void insertInternalGlobalMacro( const string& macro,
|
||||
ExpandFunction fct,
|
||||
size_t n_param = 0,
|
||||
size_t n_opt = 0);
|
||||
size_t n_param = 0);
|
||||
|
||||
void insertInternalGlobalMacro( const string& macro,
|
||||
const string& body,
|
||||
size_t n_param = 0,
|
||||
size_t n_opt = 0);
|
||||
size_t n_param = 0);
|
||||
|
||||
const Macro_item& fetchMacro( const string& macro);
|
||||
|
||||
|
|
@ -113,8 +105,7 @@ bool definedMacro( const string& macro);
|
|||
|
||||
bool macroIsTrue( const string& macro);
|
||||
|
||||
void setMacroOptEnd( const string& macro, int n_opt);
|
||||
|
||||
void checkMacroOptEnd( const string& macro);
|
||||
|
||||
#endif // MACRO_DICTIONARY_H //
|
||||
// EOF //
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@
|
|||
#define MY_STRING_H 1
|
||||
|
||||
#include <string>
|
||||
|
||||
// comment this for SGI 7.2
|
||||
using namespace std;
|
||||
|
||||
// provide hash function for string class of egcs 1.1.1
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include <iostream.h>
|
||||
#include <mstring.h>
|
||||
#include <basic.h>
|
||||
|
||||
#define OUT(x) if ( m_out) *m_out << x; return *this
|
||||
|
||||
|
|
@ -31,7 +32,7 @@ public:
|
|||
Output_file( ostream* out, const string& name)
|
||||
: m_out(out), m_name(name) {}
|
||||
bool is_valid() const { return m_out != 0;}
|
||||
ostream& stream() const { assert( m_out != 0); return *m_out;}
|
||||
ostream& stream() const { CC_Assert( m_out != 0); return *m_out;}
|
||||
ostream* stream_ptr() const { return m_out;}
|
||||
const string& name() const { return m_name;}
|
||||
Output_file& operator<<( char c) { OUT(c);}
|
||||
|
|
|
|||
|
|
@ -527,8 +527,8 @@ const int max_tag_size = 20;
|
|||
char font_tag_buffer[max_tag_size];
|
||||
|
||||
const char* font_changing_tags( Font old_font, Font new_font) {
|
||||
assert( old_font > unknown_font && old_font < end_font_array);
|
||||
assert( new_font > unknown_font && new_font < end_font_array);
|
||||
CC_Assert( old_font > unknown_font && old_font < end_font_array);
|
||||
CC_Assert( new_font > unknown_font && new_font < end_font_array);
|
||||
if ( old_font == new_font)
|
||||
*font_tag_buffer = '\0';
|
||||
else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue