mirror of https://github.com/CGAL/cgal
Major extensions for the HTML support.
This commit is contained in:
parent
c7c5db9b84
commit
ed69838c0e
|
|
@ -21,6 +21,18 @@
|
||||||
|
|
||||||
// Substitute old style malloc, realloc, strdup ...
|
// Substitute old style malloc, realloc, strdup ...
|
||||||
// ================================================
|
// ================================================
|
||||||
|
char* renew( char* old, size_t old_size, size_t new_size) {
|
||||||
|
ADT_Assert( old);
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
char* newstr( const char* src) {
|
char* newstr( const char* src) {
|
||||||
ADT_Assert( src);
|
ADT_Assert( src);
|
||||||
if ( ! src)
|
if ( ! src)
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
#define LK_RestrictedOverloading 0
|
#define LK_RestrictedOverloading 0
|
||||||
#include <ADT/list.h>
|
#include <ADT/list.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
// Class declarations:
|
// Class declarations:
|
||||||
// ==============================================
|
// ==============================================
|
||||||
|
|
@ -40,23 +41,8 @@ class TextToken;
|
||||||
|
|
||||||
// Substitute old style malloc, realloc, strdup ...
|
// Substitute old style malloc, realloc, strdup ...
|
||||||
// ================================================
|
// ================================================
|
||||||
template < class T, class I>
|
|
||||||
T* renew( T* old, I old_size, I new_size);
|
|
||||||
|
|
||||||
template < class T, class I>
|
|
||||||
T* renew( T* old, I old_size, I new_size) {
|
|
||||||
ADT_Assert( old);
|
|
||||||
ADT_Assert( strlen( old) == size_t(old_size - 1));
|
|
||||||
ADT_Assert( new_size > old_size);
|
|
||||||
T* cpy = new T[ size_t(new_size)];
|
|
||||||
if ( old && old_size > 0) {
|
|
||||||
size_t min = ( old_size < new_size ? old_size : new_size);
|
|
||||||
memcpy( cpy, old, min * sizeof( T));
|
|
||||||
delete[] old;
|
|
||||||
}
|
|
||||||
return cpy;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
char* renew( char* old, size_t old_size, size_t new_size);
|
||||||
char* newstr( const char* src);
|
char* newstr( const char* src);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -235,6 +221,10 @@ public:
|
||||||
len = 0;
|
len = 0;
|
||||||
*data = '\0';
|
*data = '\0';
|
||||||
}
|
}
|
||||||
|
void capitalize() {
|
||||||
|
for ( int i = 0; i < len; i++)
|
||||||
|
data[i] = toupper( data[i]);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class TextToken : public ListLink{
|
class TextToken : public ListLink{
|
||||||
|
|
|
||||||
|
|
@ -747,6 +747,7 @@ void handleClass( const char* classname) {
|
||||||
void handleClassEnd( void) {
|
void handleClassEnd( void) {
|
||||||
if ( global_classname)
|
if ( global_classname)
|
||||||
free( global_classname);
|
free( global_classname);
|
||||||
|
global_classname = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -821,6 +822,7 @@ void handleClassTemplateEnd( void) {
|
||||||
global_template_params = 0;
|
global_template_params = 0;
|
||||||
if ( global_classname)
|
if ( global_classname)
|
||||||
free( global_classname);
|
free( global_classname);
|
||||||
|
global_classname = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,7 @@ void handleClass( const char* classname) {
|
||||||
void handleClassEnd( void) {
|
void handleClassEnd( void) {
|
||||||
if ( global_classname)
|
if ( global_classname)
|
||||||
free( global_classname);
|
free( global_classname);
|
||||||
|
global_classname = NULL;
|
||||||
cout << outdent;
|
cout << outdent;
|
||||||
cout << indNewline;
|
cout << indNewline;
|
||||||
cout << "};" << indNewline;
|
cout << "};" << indNewline;
|
||||||
|
|
@ -149,6 +150,7 @@ void handleClassTemplateEnd( void) {
|
||||||
global_template_params = 0;
|
global_template_params = 0;
|
||||||
if ( global_classname)
|
if ( global_classname)
|
||||||
free( global_classname);
|
free( global_classname);
|
||||||
|
global_classname = 0;
|
||||||
cout << outdent;
|
cout << outdent;
|
||||||
cout << indNewline;
|
cout << indNewline;
|
||||||
cout << "};" << indNewline;
|
cout << "};" << indNewline;
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -43,6 +43,14 @@ set DEFAULT_DATE = `date +"%a, %B %e, %Y"`
|
||||||
set DEFAULT_AUTHOR = "The <A HREF="http://www.cs.ruu.nl/CGAL/"><TT>CGAL</TT> Project</A>"
|
set DEFAULT_AUTHOR = "The <A HREF="http://www.cs.ruu.nl/CGAL/"><TT>CGAL</TT> Project</A>"
|
||||||
set DEFAULT_TITLE = "The CGAL Kernel Manual"
|
set DEFAULT_TITLE = "The CGAL Kernel Manual"
|
||||||
|
|
||||||
|
# The header files within the \ccInclude macro can be linked to the original
|
||||||
|
# header files if the -cgal_dir option is given to the cc_extract_html program.
|
||||||
|
# The environment variable CGAL_INCL_DIR is used as default. If it is not
|
||||||
|
# set, the default setting is empty and include files are not linked.
|
||||||
|
set cgal_dir = ""
|
||||||
|
if ($?CGAL_INCL_DIR) set cgal_dir = "-cgal_dir ${CGAL_INCL_DIR}/"
|
||||||
|
|
||||||
|
|
||||||
# =======================================================
|
# =======================================================
|
||||||
# Installation: Nothing else below this line.
|
# Installation: Nothing else below this line.
|
||||||
# =======================================================
|
# =======================================================
|
||||||
|
|
@ -60,13 +68,17 @@ if ($?TMP) then
|
||||||
if (-d ${TMP}) set tmp_path = $TMP
|
if (-d ${TMP}) set tmp_path = $TMP
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
set aux_file = ""
|
||||||
|
set bbl_file = ""
|
||||||
|
|
||||||
set out_path = "."
|
set out_path = "."
|
||||||
set config_path = ${HTML_DEFAULT_PATH}
|
set config_path = ${HTML_DEFAULT_PATH}
|
||||||
|
|
||||||
set DEFAULT_RELEASE =
|
set DEFAULT_RELEASE =
|
||||||
|
|
||||||
set default_switch = 0
|
set default_switch = 0
|
||||||
set show_main_switch = 0
|
set show_main_switch = 0
|
||||||
|
set extended_switch = 0
|
||||||
|
|
||||||
# Parse command line parameters
|
# Parse command line parameters
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
|
|
@ -85,6 +97,12 @@ while ($#argv > 0)
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if ( "$1" == "-extended") then
|
||||||
|
set extended_switch = 1
|
||||||
|
shift
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
|
||||||
if ( "$1" == "-show_main") then
|
if ( "$1" == "-show_main") then
|
||||||
set show_main_switch = 1;
|
set show_main_switch = 1;
|
||||||
shift
|
shift
|
||||||
|
|
@ -132,6 +150,20 @@ while ($#argv > 0)
|
||||||
shift
|
shift
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
if ( "$1" == "-cgal_dir") then
|
||||||
|
shift
|
||||||
|
if ( $#argv < 1) then
|
||||||
|
echo "error: switch -cgal_dir needs an additional parameter."
|
||||||
|
goto usage
|
||||||
|
endif
|
||||||
|
if ( ! -d $1) then
|
||||||
|
echo "error: switch -cgal_dir needs a valid directory as parameter."
|
||||||
|
goto usage
|
||||||
|
endif
|
||||||
|
set cgal_dir = "-cgal_dir $1"
|
||||||
|
shift
|
||||||
|
continue
|
||||||
|
endif
|
||||||
if ( "$1" == "-date") then
|
if ( "$1" == "-date") then
|
||||||
shift
|
shift
|
||||||
if ( $#argv < 1) then
|
if ( $#argv < 1) then
|
||||||
|
|
@ -173,6 +205,29 @@ while ($#argv > 0)
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if ( "$1" == "-aux") then
|
||||||
|
shift
|
||||||
|
if ( $#argv < 1 || ! -r $1) then
|
||||||
|
echo "error: switch -aux needs a filename as additional parameter."
|
||||||
|
goto usage
|
||||||
|
endif
|
||||||
|
set aux_file = "${tmp_path}/aux_tmp_file.`date +%M%S`.tex"
|
||||||
|
grep "\\bibcite[{]" $1 > $aux_file
|
||||||
|
shift
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
|
||||||
|
if ( "$1" == "-bbl") then
|
||||||
|
shift
|
||||||
|
if ( $#argv < 1 || ! -r $1) then
|
||||||
|
echo "error: switch -bbl needs a filename as additional parameter."
|
||||||
|
goto usage
|
||||||
|
endif
|
||||||
|
set bbl_file = "$1"
|
||||||
|
shift
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
|
||||||
set in_files = "$in_files $1"
|
set in_files = "$in_files $1"
|
||||||
shift
|
shift
|
||||||
end
|
end
|
||||||
|
|
@ -186,8 +241,11 @@ if ( $?DEBUG || $default_switch == 1) then
|
||||||
echo " DEFAULT_RELEASE = ${DEFAULT_RELEASE}"
|
echo " DEFAULT_RELEASE = ${DEFAULT_RELEASE}"
|
||||||
echo " tmp_path = ${tmp_path}"
|
echo " tmp_path = ${tmp_path}"
|
||||||
echo " out_path = ${out_path}"
|
echo " out_path = ${out_path}"
|
||||||
|
echo " cgal_dir = ${cgal_dir}"
|
||||||
echo " config_path = ${config_path}"
|
echo " config_path = ${config_path}"
|
||||||
echo " input_files = ${in_files}"
|
echo " input_files = ${in_files}"
|
||||||
|
echo " aux_file = ${aux_file}"
|
||||||
|
echo " bbl_file = ${bbl_file}"
|
||||||
echo ""
|
echo ""
|
||||||
endif
|
endif
|
||||||
if ( $default_switch) goto end_of_script
|
if ( $default_switch) goto end_of_script
|
||||||
|
|
@ -208,15 +266,19 @@ endif
|
||||||
mkdir ${new_tmp_path}
|
mkdir ${new_tmp_path}
|
||||||
|
|
||||||
|
|
||||||
|
if ( $extended_switch) goto extended_conversion
|
||||||
|
|
||||||
# Step 1: convert each LaTeX file into an HTML file.
|
# Step 1: convert each LaTeX file into an HTML file.
|
||||||
# --------------------------------------------------
|
# --------------------------------------------------
|
||||||
|
set options = "${cgal_dir} -config ${config_path}/ -tmp ${new_tmp_path}/ ${aux_file} ${bbl_file}"
|
||||||
|
|
||||||
if ( $?DEBUG) echo "# Step 1: convert each LaTeX file into an HTML file."
|
if ( $?DEBUG) echo "# Step 1: convert each LaTeX file into an HTML file."
|
||||||
if ($show_main_switch) then
|
if ($show_main_switch) then
|
||||||
if ( $?DEBUG) echo "cc_extract_html -date "'"'"${DEFAULT_DATE}"'"'" -release "'"'"${DEFAULT_RELEASE}"'"'" -title "'"'"${DEFAULT_TITLE}"'"'" -author "'"'"${DEFAULT_AUTHOR}"'"'" -config ${config_path}/ -tmp ${new_tmp_path}/ ${in_files}"
|
if ( $?DEBUG) echo "cc_extract_html -date "${DEFAULT_DATE}" -release "${DEFAULT_RELEASE}" -title "${DEFAULT_TITLE}" -author "${DEFAULT_AUTHOR}" ${options} ${in_files}"
|
||||||
cc_extract_html -date "${DEFAULT_DATE}" -release "${DEFAULT_RELEASE}" -title "${DEFAULT_TITLE}" -author "${DEFAULT_AUTHOR}" -config ${config_path}/ -tmp ${new_tmp_path}/ ${in_files}
|
cc_extract_html -date "${DEFAULT_DATE}" -release "${DEFAULT_RELEASE}" -title "${DEFAULT_TITLE}" -author "${DEFAULT_AUTHOR}" ${options} ${in_files}
|
||||||
else
|
else
|
||||||
if ( $?DEBUG) echo "cc_extract_html -date "'"'"${DEFAULT_DATE}"'"'" -release "'"'"${DEFAULT_RELEASE}"'"'" -title "'"'"${DEFAULT_TITLE}"'"'" -author "'"'"${DEFAULT_AUTHOR}"'"'" -config ${config_path}/ -tmp ${new_tmp_path}/ ${in_files} >/dev/null"
|
if ( $?DEBUG) echo "cc_extract_html -date "${DEFAULT_DATE}" -release "${DEFAULT_RELEASE}" -title "${DEFAULT_TITLE}" -author "${DEFAULT_AUTHOR}" ${options} ${in_files} >/dev/null"
|
||||||
cc_extract_html -date "${DEFAULT_DATE}" -release "${DEFAULT_RELEASE}" -title "${DEFAULT_TITLE}" -author "${DEFAULT_AUTHOR}" -config ${config_path}/ -tmp ${new_tmp_path}/ ${in_files} >/dev/null
|
cc_extract_html -date "${DEFAULT_DATE}" -release "${DEFAULT_RELEASE}" -title "${DEFAULT_TITLE}" -author "${DEFAULT_AUTHOR}" ${options} ${in_files} >/dev/null
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Step 2: generate the hyperlinks. The anchor filter.
|
# Step 2: generate the hyperlinks. The anchor filter.
|
||||||
|
|
@ -254,16 +316,16 @@ cat ${new_tmp_path}/cc_index_header ${new_tmp_path}/cc_index_sorted ${new_tmp_pa
|
||||||
if ( $?DEBUG) echo "${new_tmp_path}/cc_anchor_filter < ${new_tmp_path}/cc_index > ${out_path}/manual_index.html"
|
if ( $?DEBUG) echo "${new_tmp_path}/cc_anchor_filter < ${new_tmp_path}/cc_index > ${out_path}/manual_index.html"
|
||||||
${new_tmp_path}/cc_anchor_filter < ${new_tmp_path}/cc_index > ${out_path}/manual_index.html
|
${new_tmp_path}/cc_anchor_filter < ${new_tmp_path}/cc_index > ${out_path}/manual_index.html
|
||||||
|
|
||||||
|
|
||||||
|
conversion_done:
|
||||||
# Copy the images for the advanced section to the manual.
|
# Copy the images for the advanced section to the manual.
|
||||||
# -------------------------------------------------------
|
# -------------------------------------------------------
|
||||||
if ( -r ${HTML_DEFAULT_PATH}/cc_advanced_begin.gif) then
|
foreach f (${HTML_DEFAULT_PATH}/*.gif)
|
||||||
cp ${HTML_DEFAULT_PATH}/cc_advanced_begin.gif ${out_path}
|
if ( -r $f ) then
|
||||||
if ( $?DEBUG) echo "cp ${HTML_DEFAULT_PATH}/cc_advanced_begin.gif ${out_path}"
|
cp $f ${out_path}
|
||||||
endif
|
if ( $?DEBUG) echo "cp $f ${out_path}"
|
||||||
if ( -r ${HTML_DEFAULT_PATH}/cc_advanced_end.gif) then
|
endif
|
||||||
cp ${HTML_DEFAULT_PATH}/cc_advanced_end.gif ${out_path}
|
end
|
||||||
if ( $?DEBUG) echo "cp ${HTML_DEFAULT_PATH}/cc_advanced_end.gif ${out_path}"
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
# -------
|
# -------
|
||||||
|
|
@ -277,18 +339,168 @@ endif
|
||||||
end_of_script:
|
end_of_script:
|
||||||
exit
|
exit
|
||||||
|
|
||||||
|
# Extended Conversion of multiple manual parts
|
||||||
|
# --------------------------------------------
|
||||||
|
extended_conversion:
|
||||||
|
|
||||||
|
# Step 0: create subdirectories.
|
||||||
|
# ------------------------------
|
||||||
|
if ( $?DEBUG) echo "# Step 0: create subdirectories."
|
||||||
|
foreach f ($in_files)
|
||||||
|
if ( $?DEBUG) echo "mkdir ${new_tmp_path}/$f:h"
|
||||||
|
mkdir ${new_tmp_path}/$f:h
|
||||||
|
if ( ! -d ${out_path}/$f:h) then
|
||||||
|
if ( $?DEBUG) echo "mkdir ${out_path}/$f:h"
|
||||||
|
mkdir ${out_path}/$f:h
|
||||||
|
endif
|
||||||
|
end
|
||||||
|
|
||||||
|
# Step 1: convert each LaTeX file into an HTML file.
|
||||||
|
# --------------------------------------------------
|
||||||
|
if ( $?DEBUG) echo "# Step 1: convert each LaTeX file into an HTML file."
|
||||||
|
foreach f ($in_files)
|
||||||
|
set options = "${cgal_dir} -config ${config_path}/ -tmp ${new_tmp_path}/$f:h/ -noheader"
|
||||||
|
if ( $?DEBUG) echo "cd $f:h"
|
||||||
|
cd $f:h
|
||||||
|
if ( $?DEBUG) echo "cc_extract_html -date "${DEFAULT_DATE}" -release "${DEFAULT_RELEASE}" -title "${DEFAULT_TITLE}" -author "${DEFAULT_AUTHOR}" ${options} $f:t >/dev/null"
|
||||||
|
cc_extract_html -date "${DEFAULT_DATE}" -release "${DEFAULT_RELEASE}" -title "${DEFAULT_TITLE}" -author "${DEFAULT_AUTHOR}" ${options} $f:t >/dev/null
|
||||||
|
if ( $?DEBUG) echo "cd .."
|
||||||
|
cd ..
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
# Step 2: generate the local hyperlinks. The anchor filter.
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
if ( $?DEBUG) echo "# Step 2: generate the hyperlinks. The anchor filter"
|
||||||
|
foreach f ($in_files)
|
||||||
|
if ( $?DEBUG) echo "cat ${config_path}/cc_anchor_header ${new_tmp_path}/$f:h/cc_anchor_rules ${config_path}/cc_anchor_footer > ${new_tmp_path}/cc_anchor_filter.yy"
|
||||||
|
cat ${config_path}/cc_anchor_header ${new_tmp_path}/$f:h/cc_anchor_rules ${config_path}/cc_anchor_footer > ${new_tmp_path}/cc_anchor_filter.yy
|
||||||
|
|
||||||
|
if ( $?DEBUG) echo "flex -t -8 ${new_tmp_path}/cc_anchor_filter.yy > ${new_tmp_path}/cc_anchor_filter.c"
|
||||||
|
flex -t -8 ${new_tmp_path}/cc_anchor_filter.yy > ${new_tmp_path}/cc_anchor_filter.c
|
||||||
|
|
||||||
|
if ( $?DEBUG) echo "${CC} -o ${new_tmp_path}/cc_anchor_filter ${new_tmp_path}/cc_anchor_filter.c"
|
||||||
|
${CC} -o ${new_tmp_path}/cc_anchor_filter ${new_tmp_path}/cc_anchor_filter.c
|
||||||
|
if (-r cc_anchor_filter.o) rm cc_anchor_filter.o
|
||||||
|
|
||||||
|
# Filtering all HTML files locally.
|
||||||
|
# ---------------------------------
|
||||||
|
if ( $?DEBUG) echo "# Filtering all HTML files locally."
|
||||||
|
mv ${new_tmp_path}/$f:h/cc_index_body ${new_tmp_path}/$f:h/cc_index_body.bak
|
||||||
|
${new_tmp_path}/cc_anchor_filter < ${new_tmp_path}/$f:h/cc_index_body.bak > ${new_tmp_path}/$f:h/cc_index_body
|
||||||
|
rm ${new_tmp_path}/$f:h/cc_index_body.bak
|
||||||
|
foreach ff (${new_tmp_path}/$f:h/*.html)
|
||||||
|
mv $ff $ff.bak
|
||||||
|
${new_tmp_path}/cc_anchor_filter < $ff.bak > $ff
|
||||||
|
rm $ff.bak
|
||||||
|
end
|
||||||
|
setenv CC__LOC_F "$f:h/"
|
||||||
|
if ( $?DEBUG) echo "cc_patch_anchor_toc_index ${new_tmp_path}/$f:h/cc_index_body ${new_tmp_path}/$f:h/contents.html"
|
||||||
|
cc_patch_anchor_toc_index ${new_tmp_path}/$f:h/cc_index_body ${new_tmp_path}/$f:h/contents.html
|
||||||
|
setenv CC__LOC_F ../$f:h/
|
||||||
|
if ( $?DEBUG) echo "cc_patch_anchor_filter ${new_tmp_path}/$f:h/cc_anchor_rules"
|
||||||
|
cc_patch_anchor_filter ${new_tmp_path}/$f:h/cc_anchor_rules
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
# Step 3: convert bibliography (if any) and .aux file.
|
||||||
|
# -----------------------------------------------------------
|
||||||
|
if ( $?DEBUG) echo "# Step 3: convert bibliography (if any) and .aux file."
|
||||||
|
set options = "${cgal_dir} -config ${config_path}/ -tmp ${new_tmp_path}/ -noheader ${aux_file} ${bbl_file}"
|
||||||
|
touch ${new_tmp_path}/cc_index_body
|
||||||
|
if ( "${aux_file}" == "" && "${bbl_file}" == "") then
|
||||||
|
if ( $?DEBUG) echo "touch ${new_tmp_path}/cc_anchor_rules"
|
||||||
|
touch ${new_tmp_path}/cc_anchor_rules
|
||||||
|
else
|
||||||
|
if ( $?DEBUG) echo "cc_extract_html -date "${DEFAULT_DATE}" -release "${DEFAULT_RELEASE}" -title "${DEFAULT_TITLE}" -author "${DEFAULT_AUTHOR}" ${options} >/dev/null"
|
||||||
|
cc_extract_html -date "${DEFAULT_DATE}" -release "${DEFAULT_RELEASE}" -title "${DEFAULT_TITLE}" -author "${DEFAULT_AUTHOR}" ${options} >/dev/null
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
# Step 4: generate the global hyperlinks. The anchor filter.
|
||||||
|
# -----------------------------------------------------------
|
||||||
|
if ( $?DEBUG) echo "# Step 4: generate the global hyperlinks. The anchor filter"
|
||||||
|
if ( $?DEBUG) echo "cat ${config_path}/cc_anchor_header ${new_tmp_path}/cc_anchor_rules > ${new_tmp_path}/cc_anchor_filter.yy"
|
||||||
|
cat ${config_path}/cc_anchor_header ${new_tmp_path}/cc_anchor_rules > ${new_tmp_path}/cc_anchor_filter.yy
|
||||||
|
foreach f ($in_files)
|
||||||
|
if ( $?DEBUG) echo "cat ${new_tmp_path}/$f:h/cc_anchor_rules >> ${new_tmp_path}/cc_anchor_filter.yy"
|
||||||
|
cat ${new_tmp_path}/$f:h/cc_anchor_rules >> ${new_tmp_path}/cc_anchor_filter.yy
|
||||||
|
end
|
||||||
|
if ( $?DEBUG) echo "cat ${config_path}/cc_anchor_footer >> ${new_tmp_path}/cc_anchor_filter.yy"
|
||||||
|
cat ${config_path}/cc_anchor_footer >> ${new_tmp_path}/cc_anchor_filter.yy
|
||||||
|
|
||||||
|
if ( $?DEBUG) echo "flex -t -8 ${new_tmp_path}/cc_anchor_filter.yy > ${new_tmp_path}/cc_anchor_filter.c"
|
||||||
|
flex -t -8 ${new_tmp_path}/cc_anchor_filter.yy > ${new_tmp_path}/cc_anchor_filter.c
|
||||||
|
|
||||||
|
if ( $?DEBUG) echo "${CC} -o ${new_tmp_path}/cc_anchor_filter ${new_tmp_path}/cc_anchor_filter.c"
|
||||||
|
${CC} -o ${new_tmp_path}/cc_anchor_filter ${new_tmp_path}/cc_anchor_filter.c
|
||||||
|
|
||||||
|
if (-r cc_anchor_filter.o) rm cc_anchor_filter.o
|
||||||
|
|
||||||
|
foreach f ($in_files)
|
||||||
|
# Filtering all HTML files globally.
|
||||||
|
# ----------------------------------
|
||||||
|
if ( $?DEBUG) echo "# Filtering all HTML files globally."
|
||||||
|
foreach ff (${new_tmp_path}/$f:h/*.html)
|
||||||
|
${new_tmp_path}/cc_anchor_filter < $ff > ${out_path}/$f:h/$ff:t
|
||||||
|
cc_patch_anchor_pages ${out_path}/$f:h/$ff:t
|
||||||
|
end
|
||||||
|
rm ${out_path}/$f:h/contents.html
|
||||||
|
end
|
||||||
|
|
||||||
|
# Converting the index, table of contents, and the bibliography.
|
||||||
|
# --------------------------------------------------------------
|
||||||
|
|
||||||
|
if ( $?DEBUG) echo "${new_tmp_path}/cc_anchor_filter < ${new_tmp_path}/biblio.html > ${out_path}/biblio.html"
|
||||||
|
${new_tmp_path}/cc_anchor_filter < ${new_tmp_path}/biblio.html > ${out_path}/biblio.html
|
||||||
|
|
||||||
|
if ( $?DEBUG) echo "# Converting the index."
|
||||||
|
mv ${new_tmp_path}/cc_index_body ${new_tmp_path}/cc_index_body.bak
|
||||||
|
set options = "${cgal_dir} -config ${config_path}/ -tmp ${new_tmp_path}/ -onlyheader cc_toc_footer cc_toc_header cc_index_footer cc_index_header"
|
||||||
|
if ( $?DEBUG) echo "cc_extract_html -date "${DEFAULT_DATE}" -release "${DEFAULT_RELEASE}" -title "${DEFAULT_TITLE}" -author "${DEFAULT_AUTHOR}" ${options} >/dev/null"
|
||||||
|
cc_extract_html -date "${DEFAULT_DATE}" -release "${DEFAULT_RELEASE}" -title "${DEFAULT_TITLE}" -author "${DEFAULT_AUTHOR}" ${options} >/dev/null
|
||||||
|
if ( $?DEBUG) echo "cat ${new_tmp_path}/cc_toc_header > ${new_tmp_path}/contents.html"
|
||||||
|
cat ${new_tmp_path}/cc_toc_header > ${new_tmp_path}/contents.html
|
||||||
|
cat ${new_tmp_path}/cc_index_body.bak >> ${new_tmp_path}/cc_index_body
|
||||||
|
|
||||||
|
foreach f ($in_files)
|
||||||
|
if ( $?DEBUG) echo "cat ${new_tmp_path}/$f:h/cc_index_body >> ${new_tmp_path}/cc_index_body"
|
||||||
|
cat ${new_tmp_path}/$f:h/cc_index_body >> ${new_tmp_path}/cc_index_body
|
||||||
|
if ( $?DEBUG) echo "cat ${new_tmp_path}/$f:h/contents.html >> ${new_tmp_path}/contents.html"
|
||||||
|
cat ${new_tmp_path}/$f:h/contents.html >> ${new_tmp_path}/contents.html
|
||||||
|
end
|
||||||
|
|
||||||
|
if ( $?DEBUG) echo "cat ${new_tmp_path}/cc_toc_footer >> ${new_tmp_path}/contents.html"
|
||||||
|
cat ${new_tmp_path}/cc_toc_footer >> ${new_tmp_path}/contents.html
|
||||||
|
if ( $?DEBUG) echo "cc_index_sort -ger ${new_tmp_path}/cc_index_body | sed 's/[<][\!]sort[^\!]*[\!][>]//' > ${new_tmp_path}/cc_index_sorted"
|
||||||
|
cc_index_sort -ger ${new_tmp_path}/cc_index_body | sed 's/[<][\!]sort[^\!]*[\!][>]//' > ${new_tmp_path}/cc_index_sorted
|
||||||
|
|
||||||
|
if ( $?DEBUG) echo "cat ${new_tmp_path}/cc_index_header ${new_tmp_path}/cc_index_sorted ${new_tmp_path}/cc_index_footer > ${new_tmp_path}/cc_index"
|
||||||
|
cat ${new_tmp_path}/cc_index_header ${new_tmp_path}/cc_index_sorted ${new_tmp_path}/cc_index_footer > ${new_tmp_path}/cc_index
|
||||||
|
|
||||||
|
if ( $?DEBUG) echo "${new_tmp_path}/cc_anchor_filter < ${new_tmp_path}/cc_index > ${out_path}/manual_index.html"
|
||||||
|
${new_tmp_path}/cc_anchor_filter < ${new_tmp_path}/cc_index > ${out_path}/manual_index.html
|
||||||
|
if ( $?DEBUG) echo "${new_tmp_path}/cc_anchor_filter < ${new_tmp_path}/contents.html > ${out_path}/contents.html"
|
||||||
|
${new_tmp_path}/cc_anchor_filter < ${new_tmp_path}/contents.html > ${out_path}/contents.html
|
||||||
|
|
||||||
|
goto conversion_done
|
||||||
|
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
echo "$0 "'$Revision$'" (c) Lutz Kettner"
|
echo "$0 "'$Revision$'" (c) Lutz Kettner"
|
||||||
echo "Usage: $0 [<options>] <tex-files...>"
|
echo "Usage: $0 [<options>] <tex-files...>"
|
||||||
echo " -defaults show the settings of the internal variables."
|
echo " -defaults show the settings of the internal variables."
|
||||||
echo " -show_main show the translation result for the main file."
|
echo " -extended extended organization among multiple dir's."
|
||||||
echo " -date <text> set a date for the manual."
|
echo " -show_main show the translation result for the main file."
|
||||||
echo " -release <text> set a release number for the manual."
|
echo " -date <text> set a date for the manual."
|
||||||
echo " -title <text> set a title text for the manual."
|
echo " -release <text> set a release number for the manual."
|
||||||
echo " -author <text> set an author address (email) for the manual."
|
echo " -title <text> set a title text for the manual."
|
||||||
echo " -config <dir> set the path where to find the config files."
|
echo " -author <text> set an author address (email) for the manual."
|
||||||
echo " -tmp <dir> set the path where to put intermediate files."
|
echo " -config <dir> set the path where to find the config files."
|
||||||
echo " "
|
echo " -tmp <dir> set the path where to put intermediate files."
|
||||||
echo " -o <dir> output directory for the generated HTML manual"
|
echo " -cgal_dir <dir> set the path where the CGAL headers are."
|
||||||
|
echo " -o <dir> output directory for the generated HTML manual"
|
||||||
|
echo " -aux <file> auxiliary file where the \\bibcite's are in."
|
||||||
|
echo " -bbl <file> bibliography file produced by bibtex."
|
||||||
exit (1)
|
exit (1)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,8 @@ char* global_template_params = 0;
|
||||||
#define YY_SKIP_YYWRAP 1
|
#define YY_SKIP_YYWRAP 1
|
||||||
#define yywrap() 1
|
#define yywrap() 1
|
||||||
|
|
||||||
|
void skipspaces( void);
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
/* The normal scanning mode parses TeX conventions. */
|
/* The normal scanning mode parses TeX conventions. */
|
||||||
|
|
@ -281,7 +283,7 @@ blockintro [\{][\\]((tt)|(em)|(it)|(sc)|(sl))
|
||||||
yylval.string.len = strlen( global_classname);
|
yylval.string.len = strlen( global_classname);
|
||||||
} else {
|
} else {
|
||||||
printErrorMessage( ClassnameUsedError);
|
printErrorMessage( ClassnameUsedError);
|
||||||
yylval.string.text = "Unknown classname";
|
yylval.string.text = "[Unknown classname]";
|
||||||
yylval.string.len = strlen( yylval.string.text);
|
yylval.string.len = strlen( yylval.string.text);
|
||||||
}
|
}
|
||||||
return STRING;
|
return STRING;
|
||||||
|
|
@ -529,6 +531,44 @@ blockintro [\{][\\]((tt)|(em)|(it)|(sc)|(sl))
|
||||||
return ENDHTMLONLY;
|
return ENDHTMLONLY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Flexibility for HTML class files. */
|
||||||
|
/* -------------------------------------------------------------- */
|
||||||
|
<INITIAL,NestingMode>[\\]ccHtmlNoClassLinks/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
}
|
||||||
|
<INITIAL,NestingMode>[\\]ccHtmlNoClassFile/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
}
|
||||||
|
<INITIAL,NestingMode>[\\]ccHtmlNoClassIndex/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
}
|
||||||
|
[\\]begin{w}[\{]ccHtmlClassFile[\}]{w} {
|
||||||
|
return GOBBLETWOPARAMS;
|
||||||
|
}
|
||||||
|
[\\]end{w}[\{]ccHtmlClassFile[\}] {
|
||||||
|
skipspaces();
|
||||||
|
}
|
||||||
|
[\\]ccHtmlIndex/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
return GOBBLEONEPARAM;
|
||||||
|
}
|
||||||
|
[\\]ccHtmlIndex[\[][^\]][\]]/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
return GOBBLEONEPARAM;
|
||||||
|
}
|
||||||
|
[\\]ccHtmlIndexC/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
return GOBBLEONEPARAM;
|
||||||
|
}
|
||||||
|
[\\]ccHtmlIndexC[\[][^\]][\]]/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
return GOBBLEONEPARAM;
|
||||||
|
}
|
||||||
|
[\\]ccHtmlCrossLink/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
return GOBBLEONEPARAM;
|
||||||
|
}
|
||||||
|
|
||||||
/* make the $ delimiters for math mode disappear: */
|
/* make the $ delimiters for math mode disappear: */
|
||||||
/* -------------------------------------------------------------- */
|
/* -------------------------------------------------------------- */
|
||||||
[$] {}
|
[$] {}
|
||||||
|
|
@ -633,6 +673,13 @@ blockintro [\{][\\]((tt)|(em)|(it)|(sc)|(sl))
|
||||||
}
|
}
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
void skipspaces( void) {
|
||||||
|
int c = yyinput();
|
||||||
|
while( c && c <= ' ')
|
||||||
|
c = yyinput();
|
||||||
|
unput( c);
|
||||||
|
}
|
||||||
|
|
||||||
void init_scanner( FILE* in){
|
void init_scanner( FILE* in){
|
||||||
line_number = 1;
|
line_number = 1;
|
||||||
set_CCMode = 0;
|
set_CCMode = 0;
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,61 @@ extern const char* prog_name;
|
||||||
extern char* current_filename;
|
extern char* current_filename;
|
||||||
|
|
||||||
|
|
||||||
|
extern char* cgal_lib_dir;
|
||||||
|
|
||||||
|
/* An object storing the current font */
|
||||||
|
/* ================================== */
|
||||||
|
/* It is only used within CCMode at the moment */
|
||||||
|
enum Font { unknown_font = -1,
|
||||||
|
rm_font,
|
||||||
|
tt_font,
|
||||||
|
bf_font,
|
||||||
|
it_font,
|
||||||
|
sl_font,
|
||||||
|
sc_font,
|
||||||
|
sf_font,
|
||||||
|
var_font,
|
||||||
|
math_font,
|
||||||
|
end_font_array};
|
||||||
|
|
||||||
|
extern Font current_font;
|
||||||
|
const char* font_changing_tags( Font old_font, Font new_font);
|
||||||
|
const char* new_font_tags( Font new_font);
|
||||||
|
const char* lazy_new_font_tags( Font new_font);
|
||||||
|
|
||||||
|
// Index sorting.
|
||||||
|
// ==============
|
||||||
|
// sort_keys are used to sort the index according to different sections.
|
||||||
|
// A sort_key is followed by a 0 to indicate the section title.
|
||||||
|
// A sort_key is followed by a 1 to indicate a normal entry.
|
||||||
|
|
||||||
|
extern const char* sort_key_class;
|
||||||
|
extern const char* sort_key_nested_type;
|
||||||
|
extern const char* sort_key_struct;
|
||||||
|
extern const char* sort_key_enum;
|
||||||
|
extern const char* sort_key_enum_tags;
|
||||||
|
extern const char* sort_key_typedef;
|
||||||
|
extern const char* sort_key_variable;
|
||||||
|
extern const char* sort_key_function;
|
||||||
|
extern const char* sort_key_member_function;
|
||||||
|
|
||||||
|
const char* find_sort_key( const char* txt);
|
||||||
|
|
||||||
|
/* Flexibility for HTML class files. */
|
||||||
|
/* ================================= */
|
||||||
|
extern bool html_no_class_links;
|
||||||
|
extern bool html_no_class_file;
|
||||||
|
extern bool html_no_class_index;
|
||||||
|
|
||||||
|
extern bool html_inline_classes;
|
||||||
|
|
||||||
|
void handleHtmlClassFile( const char* filename, const Text& T);
|
||||||
|
void handleHtmlClassFileEnd();
|
||||||
|
|
||||||
|
const char* handleHtmlIndexC( const char* category, const char* item);
|
||||||
|
const char* handleHtmlIndex( const char* category, const char* item);
|
||||||
|
const char* handleHtmlCrossLink( const char* key, bool tmpl_class = false);
|
||||||
|
|
||||||
/* Functions to manage footnotes. */
|
/* Functions to manage footnotes. */
|
||||||
/* ============================== */
|
/* ============================== */
|
||||||
void insertFootnote( char* s);
|
void insertFootnote( char* s);
|
||||||
|
|
@ -86,7 +141,9 @@ void handleString( const char* s);
|
||||||
void handleChar( char c);
|
void handleChar( char c);
|
||||||
|
|
||||||
void handleBiblio( const Text& T);
|
void handleBiblio( const Text& T);
|
||||||
Buffer* handleCite( const char* l);
|
Buffer* handleCite( const char* cite_keys, const char* option = 0);
|
||||||
|
// Defines a mapping between cite keys and the visible item for a cite.
|
||||||
|
Buffer* handleBibCite( const char* key, const char* item);
|
||||||
// for an empty item name use the key name as item name
|
// for an empty item name use the key name as item name
|
||||||
Buffer* handleBibItem( const char* key_name, const char* item_name = 0);
|
Buffer* handleBibItem( const char* key_name, const char* item_name = 0);
|
||||||
|
|
||||||
|
|
@ -95,6 +152,9 @@ void handleClassEnd( void);
|
||||||
void handleClassTemplate( const char* classname);
|
void handleClassTemplate( const char* classname);
|
||||||
void handleClassTemplateEnd( void);
|
void handleClassTemplateEnd( void);
|
||||||
|
|
||||||
|
void handleClassNameEnd( void);
|
||||||
|
void handleClassFileEnd( void);
|
||||||
|
|
||||||
void handleDeclaration( const char* decl);
|
void handleDeclaration( const char* decl);
|
||||||
|
|
||||||
void handleMethodDeclaration( const char* decl,
|
void handleMethodDeclaration( const char* decl,
|
||||||
|
|
@ -134,7 +194,8 @@ enum ErrorNumber {
|
||||||
SemicolonMissingError,
|
SemicolonMissingError,
|
||||||
IncludeNestingTooDeepError,
|
IncludeNestingTooDeepError,
|
||||||
IncludeOpenError,
|
IncludeOpenError,
|
||||||
ChapterStructureError
|
ChapterStructureError,
|
||||||
|
UnknownIndexCategoryError
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,15 @@ int set_INITIAL = 0;
|
||||||
int set_HTMLMODE = 0;
|
int set_HTMLMODE = 0;
|
||||||
int set_MMODE = 0;
|
int set_MMODE = 0;
|
||||||
|
|
||||||
|
/* Store an old state like MMODE before treating macros like ccAnchor */
|
||||||
|
/* Some constants for this purpose. */
|
||||||
|
const int state_INITIAL = 0;
|
||||||
|
const int state_MMODE = 1;
|
||||||
|
const int state_NestingMode = 2;
|
||||||
|
|
||||||
|
int set_old_state = 0;
|
||||||
|
int old_state = state_INITIAL;
|
||||||
|
|
||||||
/* Tag to mark whenever the unchecked keyword occurs. */
|
/* Tag to mark whenever the unchecked keyword occurs. */
|
||||||
int unchecked_tag = 0;
|
int unchecked_tag = 0;
|
||||||
|
|
||||||
|
|
@ -103,7 +112,9 @@ int stack_ptr = 0;
|
||||||
/* The NestingMode parses only (){}[] nested expressions */
|
/* The NestingMode parses only (){}[] nested expressions */
|
||||||
/* The VerbMode parses LaTeX \verb"..." statements as */
|
/* The VerbMode parses LaTeX \verb"..." statements as */
|
||||||
/* a sequence of characters */
|
/* a sequence of characters */
|
||||||
|
/* ccStyleMode parses only ccStyle expressions. */
|
||||||
%x CCMode
|
%x CCMode
|
||||||
|
%x ccStyleMode
|
||||||
%x NestingMode
|
%x NestingMode
|
||||||
%x VerbMode
|
%x VerbMode
|
||||||
%x CPROGMode
|
%x CPROGMode
|
||||||
|
|
@ -121,7 +132,7 @@ CCletter [a-zA-Z_]
|
||||||
idfier {letter}+
|
idfier {letter}+
|
||||||
texmacro [\\]{idfier}
|
texmacro [\\]{idfier}
|
||||||
CCidfier ({CCletter}({CCletter}|{digit})*)
|
CCidfier ({CCletter}({CCletter}|{digit})*)
|
||||||
filename [^ \t\n/\\\{\}\[\]()]+
|
filename [^ \t\n\\\{\}\[\]()]+
|
||||||
space [\t ]
|
space [\t ]
|
||||||
w {space}*
|
w {space}*
|
||||||
ws {space}+
|
ws {space}+
|
||||||
|
|
@ -135,11 +146,14 @@ expNumber ({floatNumber}|{signNumber}){exp}{signNumber}
|
||||||
No ({signNumber}|{floatNumber}|{expNumber})
|
No ({signNumber}|{floatNumber}|{expNumber})
|
||||||
operator [^a-zA-Z_0-9\n\r\t \\]
|
operator [^a-zA-Z_0-9\n\r\t \\]
|
||||||
measure {signNumber}{letter}{letter}
|
measure {signNumber}{letter}{letter}
|
||||||
ttblockintro [\{][\\](tt)
|
rmblockintro ([\{][\\](rm))|([\\]((text)|(math))rm[\{])
|
||||||
emblockintro [\{][\\](em)
|
ttblockintro ([\{][\\](tt))|([\\]((text)|(math))tt[\{])
|
||||||
itblockintro [\{][\\]((it)|(sl))
|
emblockintro ([\{][\\](em))|([\\]emph[\{])
|
||||||
scblockintro [\{][\\](sc)
|
itblockintro ([\{][\\]((it)|(sl)))|([\\]((text)|(math))((it)|(sl))[\{])
|
||||||
bfblockintro [\{][\\](bf)
|
scblockintro ([\{][\\](sc))|([\\]textsc[\{])
|
||||||
|
sfblockintro ([\{][\\](sf))|([\\]((text)|(math))sf[\{])
|
||||||
|
bfblockintro ([\{][\\]((bf)|(mathbold)))|([\\]((text)|(math))bf[\{])
|
||||||
|
calblockintro ([\{][\\](cal))|([\\]mathcal[\{])
|
||||||
|
|
||||||
%%
|
%%
|
||||||
/* Mode switching can be triggered from the parser */
|
/* Mode switching can be triggered from the parser */
|
||||||
|
|
@ -164,16 +178,30 @@ bfblockintro [\{][\\](bf)
|
||||||
BEGIN( MMODE);
|
BEGIN( MMODE);
|
||||||
set_MMODE = 0;
|
set_MMODE = 0;
|
||||||
}
|
}
|
||||||
|
if (set_old_state) {
|
||||||
|
switch ( old_state) {
|
||||||
|
case state_INITIAL:
|
||||||
|
BEGIN( INITIAL);
|
||||||
|
break;
|
||||||
|
case state_MMODE:
|
||||||
|
BEGIN( MMODE);
|
||||||
|
break;
|
||||||
|
case state_NestingMode:
|
||||||
|
BEGIN( NestingMode);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
set_old_state = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Count line numbers in all modes for better error messages */
|
/* Count line numbers in all modes for better error messages */
|
||||||
/* --------------------------------------------------------- */
|
/* --------------------------------------------------------- */
|
||||||
<INITIAL,CCMode,NestingMode,CPROGMode,MMODE,ITEMMODE,TEXONLYMODE,HTMLMODE,HTMLGROUPMode>[\n] {
|
<INITIAL,CCMode,NestingMode,ccStyleMode,CPROGMode,MMODE,ITEMMODE,TEXONLYMODE,HTMLMODE,HTMLGROUPMode>[\n] {
|
||||||
line_number++;
|
line_number++;
|
||||||
if ( line_switch)
|
if ( line_switch)
|
||||||
cerr << "src-line " << line_number << endl;
|
cerr << "src-line " << line_number << endl;
|
||||||
return NEWLINE;
|
return NEWLINE;
|
||||||
}
|
}
|
||||||
<INITIAL,MMODE,NestingMode>[\\]"\n" {
|
<INITIAL,MMODE,NestingMode,ccStyleMode>[\\]"\n" {
|
||||||
line_number++;
|
line_number++;
|
||||||
if ( line_switch)
|
if ( line_switch)
|
||||||
cerr << "src-line " << line_number << endl;
|
cerr << "src-line " << line_number << endl;
|
||||||
|
|
@ -254,11 +282,11 @@ bfblockintro [\{][\\](bf)
|
||||||
|
|
||||||
/* Rules for TeX conventions */
|
/* Rules for TeX conventions */
|
||||||
/* ------------------------- */
|
/* ------------------------- */
|
||||||
<INITIAL,MMODE>[\\]"%" { /* Avoid the quoted comment symbol */
|
<INITIAL,MMODE>[\\]"%" { /* Avoid the quoted comment symbol */
|
||||||
yylval.character = '%';
|
yylval.character = '%';
|
||||||
return CHAR;
|
return CHAR;
|
||||||
}
|
}
|
||||||
<INITIAL,MMODE>"%".*[\n]{w} { /* Match one line TeX comments */
|
<INITIAL,MMODE>"%".*[\n]{w} { /* Match one line TeX comments */
|
||||||
/* remove spaces in next line */
|
/* remove spaces in next line */
|
||||||
unput( '\n');
|
unput( '\n');
|
||||||
}
|
}
|
||||||
|
|
@ -326,6 +354,7 @@ bfblockintro [\{][\\](bf)
|
||||||
/* ------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------ */
|
||||||
[\\]begin{w}[\{]ccClass[\}]{w} {
|
[\\]begin{w}[\{]ccClass[\}]{w} {
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
|
current_font = it_font;
|
||||||
return BEGINCLASS;
|
return BEGINCLASS;
|
||||||
}
|
}
|
||||||
[\\]end{w}[\{]ccClass[\}] {
|
[\\]end{w}[\{]ccClass[\}] {
|
||||||
|
|
@ -333,6 +362,7 @@ bfblockintro [\{][\\](bf)
|
||||||
}
|
}
|
||||||
[\\]begin{w}[\{]ccClassTemplate[\}]{w} {
|
[\\]begin{w}[\{]ccClassTemplate[\}]{w} {
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
|
current_font = it_font;
|
||||||
return BEGINCLASSTEMPLATE;
|
return BEGINCLASSTEMPLATE;
|
||||||
}
|
}
|
||||||
[\\]end{w}[\{]ccClassTemplate[\}] {
|
[\\]end{w}[\{]ccClassTemplate[\}] {
|
||||||
|
|
@ -355,98 +385,115 @@ bfblockintro [\{][\\](bf)
|
||||||
delete[] formatted_creationvariable;
|
delete[] formatted_creationvariable;
|
||||||
creationvariable = newstr( r);
|
creationvariable = newstr( r);
|
||||||
formatted_creationvariable = new char[ strlen(
|
formatted_creationvariable = new char[ strlen(
|
||||||
creationvariable) + 12];
|
creationvariable) + 8];
|
||||||
strcpy( formatted_creationvariable, "<VAR>");
|
strcpy( formatted_creationvariable, "<I>");
|
||||||
strcat( formatted_creationvariable, creationvariable);
|
strcat( formatted_creationvariable, creationvariable);
|
||||||
strcat( formatted_creationvariable, "</VAR>");
|
strcat( formatted_creationvariable, "</I>");
|
||||||
yylval.string.text = r;
|
yylval.string.text = r;
|
||||||
yylval.string.len = s - r + 1;
|
yylval.string.len = s - r + 1;
|
||||||
return CREATIONVARIABLE;
|
return CREATIONVARIABLE;
|
||||||
}
|
}
|
||||||
[\\]ccConstructor/{noletter} { /* constructor declaration: change to CCMode */
|
[\\]ccConstructor/{noletter} { /* constructor declaration: change to CCMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
|
current_font = it_font;
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
return CONSTRUCTOR;
|
return CONSTRUCTOR;
|
||||||
}
|
}
|
||||||
[\\]ccMemberFunction/{noletter} { /* method declaration: change to CCMode */
|
[\\]ccMemberFunction/{noletter} { /* method declaration: change to CCMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
|
current_font = it_font;
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
return METHOD;
|
return METHOD;
|
||||||
}
|
}
|
||||||
[\\]ccMethod/{noletter} { /* method declaration: change to CCMode */
|
[\\]ccMethod/{noletter} { /* method declaration: change to CCMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
|
current_font = it_font;
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
return METHOD;
|
return METHOD;
|
||||||
}
|
}
|
||||||
[\\]ccFunction/{noletter} { /* function declaration: change to CCMode */
|
[\\]ccFunction/{noletter} { /* function declaration: change to CCMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
|
current_font = it_font;
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
return FUNCTION;
|
return FUNCTION;
|
||||||
}
|
}
|
||||||
[\\]ccFunctionTemplate/{noletter} { /* function template declaration:
|
[\\]ccFunctionTemplate/{noletter} { /* function template declaration:
|
||||||
change to CCMode */
|
change to CCMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
|
current_font = it_font;
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
return FUNCTIONTEMPLATE;
|
return FUNCTIONTEMPLATE;
|
||||||
}
|
}
|
||||||
[\\]ccVariable/{noletter} { /* variable declaration: change to CCMode */
|
[\\]ccVariable/{noletter} { /* variable declaration: change to CCMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
|
current_font = it_font;
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
return VARIABLE;
|
return VARIABLE;
|
||||||
}
|
}
|
||||||
[\\]ccTypedef/{noletter} { /* typedef declaration: change to CCMode */
|
[\\]ccTypedef/{noletter} { /* typedef declaration: change to CCMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
|
current_font = it_font;
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
return TYPEDEF;
|
return TYPEDEF;
|
||||||
}
|
}
|
||||||
[\\]ccNestedType/{noletter} { /* nested type declaration: change to CCMode */
|
[\\]ccNestedType/{noletter} { /* nested type declaration: change to CCMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
|
current_font = it_font;
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
return NESTEDTYPE;
|
return NESTEDTYPE;
|
||||||
}
|
}
|
||||||
[\\]ccEnum/{noletter} { /* enum declaration: change to CCMode */
|
[\\]ccEnum/{noletter} { /* enum declaration: change to CCMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
|
current_font = it_font;
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
return ENUM;
|
return ENUM;
|
||||||
}
|
}
|
||||||
[\\]ccStruct/{noletter} { /* struct declaration: change to CCMode */
|
[\\]ccStruct/{noletter} { /* struct declaration: change to CCMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
|
current_font = it_font;
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
return STRUCT;
|
return STRUCT;
|
||||||
}
|
}
|
||||||
[\\]ccGlobalFunction/{noletter} { /* function declaration: change to CCMode */
|
[\\]ccGlobalFunction/{noletter} { /* function declaration: change to CCMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
|
current_font = it_font;
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
return GLOBALFUNCTION;
|
return GLOBALFUNCTION;
|
||||||
}
|
}
|
||||||
[\\]ccGlobalFunctionTemplate/{noletter} { /* function template declaration:
|
[\\]ccGlobalFunctionTemplate/{noletter} { /* function template declaration:
|
||||||
change to CCMode */
|
change to CCMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
|
current_font = it_font;
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
return GLOBALFUNCTIONTEMPLATE;
|
return GLOBALFUNCTIONTEMPLATE;
|
||||||
}
|
}
|
||||||
[\\]ccGlobalVariable/{noletter} { /* variable declaration: change to CCMode */
|
[\\]ccGlobalVariable/{noletter} { /* variable declaration: change to CCMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
|
current_font = it_font;
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
return GLOBALVARIABLE;
|
return GLOBALVARIABLE;
|
||||||
}
|
}
|
||||||
[\\]ccGlobalTypedef/{noletter} { /* typedef declaration: change to CCMode */
|
[\\]ccGlobalTypedef/{noletter} { /* typedef declaration: change to CCMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
|
current_font = it_font;
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
return GLOBALTYPEDEF;
|
return GLOBALTYPEDEF;
|
||||||
}
|
}
|
||||||
[\\]ccGlobalEnum/{noletter} { /* enum declaration: change to CCMode */
|
[\\]ccGlobalEnum/{noletter} { /* enum declaration: change to CCMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
|
current_font = it_font;
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
return GLOBALENUM;
|
return GLOBALENUM;
|
||||||
}
|
}
|
||||||
[\\]ccGlobalStruct/{noletter} { /* struct declaration: change to CCMode */
|
[\\]ccGlobalStruct/{noletter} { /* struct declaration: change to CCMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
|
current_font = it_font;
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
return GLOBALSTRUCT;
|
return GLOBALSTRUCT;
|
||||||
}
|
}
|
||||||
[\\]ccDeclaration/{noletter} { /* general declaration: change to CCMode */
|
[\\]ccDeclaration/{noletter} { /* general declaration: change to CCMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
|
current_font = it_font;
|
||||||
BEGIN( CCMode);
|
BEGIN( CCMode);
|
||||||
return DECLARATION;
|
return DECLARATION;
|
||||||
}
|
}
|
||||||
|
|
@ -480,20 +527,42 @@ bfblockintro [\{][\\](bf)
|
||||||
}
|
}
|
||||||
|
|
||||||
[\\]"begin{ccHtmlOnly}" {
|
[\\]"begin{ccHtmlOnly}" {
|
||||||
|
old_state = state_INITIAL;
|
||||||
|
BEGIN( HTMLGROUPMode);
|
||||||
|
return HTMLBEGIN;
|
||||||
|
}
|
||||||
|
<MMODE>[\\]"begin{ccHtmlOnly}" {
|
||||||
|
old_state = state_MMODE;
|
||||||
|
BEGIN( HTMLGROUPMode);
|
||||||
|
return HTMLBEGIN;
|
||||||
|
}
|
||||||
|
<NestingMode>[\\]"begin{ccHtmlOnly}" {
|
||||||
|
old_state = state_NestingMode;
|
||||||
BEGIN( HTMLGROUPMode);
|
BEGIN( HTMLGROUPMode);
|
||||||
return HTMLBEGIN;
|
return HTMLBEGIN;
|
||||||
}
|
}
|
||||||
<HTMLGROUPMode>[\\]"end{ccHtmlOnly}" {
|
<HTMLGROUPMode>[\\]"end{ccHtmlOnly}" {
|
||||||
BEGIN( INITIAL);
|
set_old_state = 1;
|
||||||
return HTMLEND;
|
return HTMLEND;
|
||||||
}
|
}
|
||||||
|
|
||||||
[\\]"begin{ccTexOnly}" {
|
[\\]"begin{ccTexOnly}" {
|
||||||
|
old_state = state_INITIAL;
|
||||||
|
BEGIN( TEXONLYMODE);
|
||||||
|
return TEXONLYBEGIN;
|
||||||
|
}
|
||||||
|
<MMODE>[\\]"begin{ccTexOnly}" {
|
||||||
|
old_state = state_MMODE;
|
||||||
|
BEGIN( TEXONLYMODE);
|
||||||
|
return TEXONLYBEGIN;
|
||||||
|
}
|
||||||
|
<NestingMode>[\\]"begin{ccTexOnly}" {
|
||||||
|
old_state = state_NestingMode;
|
||||||
BEGIN( TEXONLYMODE);
|
BEGIN( TEXONLYMODE);
|
||||||
return TEXONLYBEGIN;
|
return TEXONLYBEGIN;
|
||||||
}
|
}
|
||||||
<TEXONLYMODE>[\\]"end{ccTexOnly}" {
|
<TEXONLYMODE>[\\]"end{ccTexOnly}" {
|
||||||
BEGIN( INITIAL);
|
set_old_state = 1;
|
||||||
return TEXONLYEND;
|
return TEXONLYEND;
|
||||||
}
|
}
|
||||||
<TEXONLYMODE>. {
|
<TEXONLYMODE>. {
|
||||||
|
|
@ -501,29 +570,105 @@ bfblockintro [\{][\\](bf)
|
||||||
return CHAR;
|
return CHAR;
|
||||||
}
|
}
|
||||||
[\\]ccTexHtml{w}[\{] {
|
[\\]ccTexHtml{w}[\{] {
|
||||||
|
old_state = state_INITIAL;
|
||||||
|
return LATEXHTML;
|
||||||
|
}
|
||||||
|
<MMODE>[\\]ccTexHtml{w}[\{] {
|
||||||
|
old_state = state_MMODE;
|
||||||
|
return LATEXHTML;
|
||||||
|
}
|
||||||
|
<NestingMode>[\\]ccTexHtml{w}[\{] {
|
||||||
|
old_state = state_NestingMode;
|
||||||
return LATEXHTML;
|
return LATEXHTML;
|
||||||
}
|
}
|
||||||
[\\]ccAnchor{w}[\{] {
|
[\\]ccAnchor{w}[\{] {
|
||||||
/* The first parameter is the URL, the second is the */
|
/* The first parameter is the URL, the second is the */
|
||||||
/* message that will be highlighted */
|
/* message that will be highlighted */
|
||||||
|
old_state = state_INITIAL;
|
||||||
|
BEGIN( HTMLMODE);
|
||||||
|
return ANCHOR;
|
||||||
|
}
|
||||||
|
<MMODE>[\\]ccAnchor{w}[\{] {
|
||||||
|
old_state = state_MMODE;
|
||||||
|
BEGIN( HTMLMODE);
|
||||||
|
return ANCHOR;
|
||||||
|
}
|
||||||
|
<NestingMode>[\\]ccAnchor{w}[\{] {
|
||||||
|
old_state = state_NestingMode;
|
||||||
BEGIN( HTMLMODE);
|
BEGIN( HTMLMODE);
|
||||||
return ANCHOR;
|
return ANCHOR;
|
||||||
}
|
}
|
||||||
<HTMLMODE>[\}] {
|
<HTMLMODE>[\}] {
|
||||||
BEGIN( INITIAL);
|
set_old_state = 1;
|
||||||
return '}';
|
return '}';
|
||||||
}
|
}
|
||||||
<HTMLMODE,HTMLGROUPMode>. {
|
<HTMLMODE,HTMLGROUPMode>. {
|
||||||
yylval.character = yytext[0];
|
yylval.character = yytext[0];
|
||||||
return CHAR;
|
return CHAR;
|
||||||
}
|
}
|
||||||
|
<INITIAL,MMODE,NestingMode>[\\]path[|][^|]*[|] {
|
||||||
|
yylval.string.text = yytext + 6;
|
||||||
|
yylval.string.len = -1;
|
||||||
|
return HTMLPATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Flexibility for HTML class files. */
|
||||||
|
/* -------------------------------------------------------------- */
|
||||||
|
<INITIAL,MMODE,NestingMode>[\\]ccHtmlNoClassLinks/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
html_no_class_links = true;
|
||||||
|
}
|
||||||
|
<INITIAL,MMODE,NestingMode>[\\]ccHtmlNoClassFile/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
html_no_class_file = true;
|
||||||
|
}
|
||||||
|
<INITIAL,MMODE,NestingMode>[\\]ccHtmlNoClassIndex/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
html_no_class_index = true;
|
||||||
|
}
|
||||||
|
[\\]begin{w}[\{]ccHtmlClassFile[\}]{w} {
|
||||||
|
BEGIN( CCMode);
|
||||||
|
return HTMLBEGINCLASSFILE;
|
||||||
|
}
|
||||||
|
[\\]end{w}[\{]ccHtmlClassFile[\}] {
|
||||||
|
skipspaces();
|
||||||
|
return HTMLENDCLASSFILE;
|
||||||
|
}
|
||||||
|
[\\]ccHtmlIndex/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
yylval.string.text = sort_key_class;
|
||||||
|
return HTMLINDEX;
|
||||||
|
}
|
||||||
|
[\\]ccHtmlIndex[\[][^\]][\]]/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
yylval.string.text = find_sort_key( yytext + 13);
|
||||||
|
return HTMLINDEX;
|
||||||
|
}
|
||||||
|
[\\]ccHtmlIndexC/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
yylval.string.text = sort_key_class;
|
||||||
|
BEGIN( CCMode);
|
||||||
|
return HTMLINDEXC;
|
||||||
|
}
|
||||||
|
[\\]ccHtmlIndexC[\[][^\]][\]]/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
yylval.string.text = find_sort_key( yytext + 14);
|
||||||
|
BEGIN( CCMode);
|
||||||
|
return HTMLINDEXC;
|
||||||
|
}
|
||||||
|
[\\]ccHtmlCrossLink/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
BEGIN( CCMode);
|
||||||
|
return HTMLCROSSLINK;
|
||||||
|
}
|
||||||
|
|
||||||
/* Specialized keywords from the manual style */
|
/* Specialized keywords from the manual style */
|
||||||
/* -------------------------------------------------------------- */
|
/* -------------------------------------------------------------- */
|
||||||
[\\]cc((Style)|(c))/{noletter} {
|
[\\]cc((Style)|(c))/{noletter} {
|
||||||
/* CCstyle formatting: change to NestingMode */
|
/* CCstyle formatting: change to ccStyleMode */
|
||||||
skipspaces();
|
skipspaces();
|
||||||
BEGIN( NestingMode);
|
BEGIN( ccStyleMode);
|
||||||
|
current_font = it_font;
|
||||||
return CCSTYLE;
|
return CCSTYLE;
|
||||||
}
|
}
|
||||||
<INITIAL,MMODE,NestingMode>[\\]ccVar/{noletter} {
|
<INITIAL,MMODE,NestingMode>[\\]ccVar/{noletter} {
|
||||||
|
|
@ -772,21 +917,22 @@ bfblockintro [\{][\\](bf)
|
||||||
}
|
}
|
||||||
[\\]begin[\{]ccAdvanced[\}] {
|
[\\]begin[\{]ccAdvanced[\}] {
|
||||||
skipspaces();
|
skipspaces();
|
||||||
yylval.string.text = "<br><img border=0 src=\""
|
yylval.string.text = "<BR><IMG BORDER=0 SRC=\""
|
||||||
"./cc_advanced_begin.gif\" alt=\"begin of advanced "
|
"cc_advanced_begin.gif\" ALT=\"begin of advanced "
|
||||||
"section\"><br>";
|
"section\"><BR>";
|
||||||
yylval.string.len = -1;
|
yylval.string.len = -1;
|
||||||
return STRING;
|
return STRING;
|
||||||
}
|
}
|
||||||
[\\]end[\{]ccAdvanced[\}] {
|
[\\]end[\{]ccAdvanced[\}] {
|
||||||
skipspaces();
|
skipspaces();
|
||||||
yylval.string.text = "<br><img border=0 src=\""
|
yylval.string.text = "<BR><IMG BORDER=0 SRC=\""
|
||||||
"./cc_advanced_end.gif\" alt=\"end of advanced "
|
"cc_advanced_end.gif\" ALT=\"end of advanced "
|
||||||
"section\"><br>";
|
"section\"><BR>";
|
||||||
yylval.string.len = -1;
|
yylval.string.len = -1;
|
||||||
return STRING;
|
return STRING;
|
||||||
}
|
}
|
||||||
[\\]ccInclude/{noletter} {
|
[\\]ccInclude/{noletter} {
|
||||||
|
current_font = it_font;
|
||||||
return INCLUDE;
|
return INCLUDE;
|
||||||
}
|
}
|
||||||
[\\]ccHeading/{noletter} {
|
[\\]ccHeading/{noletter} {
|
||||||
|
|
@ -964,7 +1110,7 @@ bfblockintro [\{][\\](bf)
|
||||||
yylval.string.len = 3;
|
yylval.string.len = 3;
|
||||||
return STRING;
|
return STRING;
|
||||||
}
|
}
|
||||||
<INITIAL,MMODE,NestingMode>[\\]ldots/{noletter} {
|
<INITIAL,MMODE,NestingMode,ccStyleMode>[\\](l?)dots/{noletter} {
|
||||||
skipspaces();
|
skipspaces();
|
||||||
yylval.string.text = "...";
|
yylval.string.text = "...";
|
||||||
yylval.string.len = 3;
|
yylval.string.len = 3;
|
||||||
|
|
@ -991,17 +1137,17 @@ bfblockintro [\{][\\](bf)
|
||||||
[\\]((big)|(med))skip/{noletter} {
|
[\\]((big)|(med))skip/{noletter} {
|
||||||
return NEWLINE;
|
return NEWLINE;
|
||||||
}
|
}
|
||||||
<INITIAL,MMODE,NestingMode>[\\]"&" {
|
<INITIAL,MMODE,NestingMode,ccStyleMode>[\\]"&" {
|
||||||
yylval.string.text = "&";
|
yylval.string.text = "&";
|
||||||
yylval.string.len = 5;
|
yylval.string.len = 5;
|
||||||
return STRING;
|
return STRING;
|
||||||
}
|
}
|
||||||
<INITIAL,MMODE,NestingMode>[\\][_^#$~%] {
|
<INITIAL,MMODE,NestingMode,ccStyleMode>[\\][_^#$~%] {
|
||||||
yylval.character = yytext[1];
|
yylval.character = yytext[1];
|
||||||
return CHAR;
|
return CHAR;
|
||||||
}
|
}
|
||||||
<INITIAL,MMODE,NestingMode>[~] |
|
<INITIAL,MMODE,NestingMode>[~] |
|
||||||
<INITIAL,MMODE,NestingMode>[\\]{space} {
|
<INITIAL,MMODE,NestingMode,ccStyleMode>[\\]{space} {
|
||||||
yylval.string.text = " ";
|
yylval.string.text = " ";
|
||||||
yylval.string.len = 1;
|
yylval.string.len = 1;
|
||||||
return SPACE;
|
return SPACE;
|
||||||
|
|
@ -1057,7 +1203,6 @@ bfblockintro [\{][\\](bf)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* yet not supported characters ...
|
/* yet not supported characters ...
|
||||||
<MMODE>[\\]times/{noletter} { SET( "×"); return STRING;}
|
|
||||||
<MMODE>[\\]delta/{noletter} { SET( "δ"); return STRING;}
|
<MMODE>[\\]delta/{noletter} { SET( "δ"); return STRING;}
|
||||||
<MMODE>[\\]epsilon/{noletter} { SET( "ε"); return STRING;}
|
<MMODE>[\\]epsilon/{noletter} { SET( "ε"); return STRING;}
|
||||||
<MMODE>[\\]varepsilon/{noletter} { SET( "ε"); return STRING;}
|
<MMODE>[\\]varepsilon/{noletter} { SET( "ε"); return STRING;}
|
||||||
|
|
@ -1079,7 +1224,8 @@ bfblockintro [\{][\\](bf)
|
||||||
<INITIAL,NestingMode>[\\]"^"a { SET( "â"); return STRING;}
|
<INITIAL,NestingMode>[\\]"^"a { SET( "â"); return STRING;}
|
||||||
<INITIAL,NestingMode>[\\]"^"e { SET( "ê"); return STRING;}
|
<INITIAL,NestingMode>[\\]"^"e { SET( "ê"); return STRING;}
|
||||||
<INITIAL,NestingMode>[\\]ss[\{][\}] { SET( "ß"); return STRING;}
|
<INITIAL,NestingMode>[\\]ss[\{][\}] { SET( "ß"); return STRING;}
|
||||||
<MMODE>[\\]times/{noletter} { SET( "x"); return STRING;}
|
<MMODE>[\\]times/{noletter} { SET( "×"); return STRING;}
|
||||||
|
<MMODE>[\\]in/{noletter} { SET( " is in "); return STRING;}
|
||||||
<MMODE>[\\]alpha/{noletter} { SET( "α"); return STRING;}
|
<MMODE>[\\]alpha/{noletter} { SET( "α"); return STRING;}
|
||||||
<MMODE>[\\]beta/{noletter} { SET( "β"); return STRING;}
|
<MMODE>[\\]beta/{noletter} { SET( "β"); return STRING;}
|
||||||
<MMODE>[\\]gamma/{noletter} { SET( "γ"); return STRING;}
|
<MMODE>[\\]gamma/{noletter} { SET( "γ"); return STRING;}
|
||||||
|
|
@ -1121,6 +1267,34 @@ bfblockintro [\{][\\](bf)
|
||||||
<MMODE>[\\]Psi/{noletter} { SET( "Ψ"); return STRING;}
|
<MMODE>[\\]Psi/{noletter} { SET( "Ψ"); return STRING;}
|
||||||
<MMODE>[\\]Omega/{noletter} { SET( "Ω"); return STRING;}
|
<MMODE>[\\]Omega/{noletter} { SET( "Ω"); return STRING;}
|
||||||
|
|
||||||
|
/* math symbols */
|
||||||
|
/* ------------ */
|
||||||
|
|
||||||
|
<MMODE>[\\]((arc)?)|((tan)|(sin)|(cos))/{noletter} {
|
||||||
|
yylval.string.text = yytext+1;
|
||||||
|
yylval.string.len = yyleng-1;
|
||||||
|
return STRING;
|
||||||
|
}
|
||||||
|
<MMODE>[\\]((arg)|(cosh)|(sinh)|(cot)|(coth)|(csc)|(deg)|(det))/{noletter} {
|
||||||
|
yylval.string.text = yytext+1;
|
||||||
|
yylval.string.len = yyleng-1;
|
||||||
|
return STRING;
|
||||||
|
}
|
||||||
|
<MMODE>[\\]((dim)|(exp)|(gcd)|(hom)|(inf)|(ker)|(lg)|(lim))/{noletter} {
|
||||||
|
yylval.string.text = yytext+1;
|
||||||
|
yylval.string.len = yyleng-1;
|
||||||
|
return STRING;
|
||||||
|
}
|
||||||
|
<MMODE>[\\]((liminf)|(limsup)|(ln)|(log)|(max)|(min)|(Pr)|(sec))/{noletter} {
|
||||||
|
yylval.string.text = yytext+1;
|
||||||
|
yylval.string.len = yyleng-1;
|
||||||
|
return STRING;
|
||||||
|
}
|
||||||
|
<MMODE>[\\]((sinh)|(sup)|(tanh)|(bmod)|(pmod))/{noletter} {
|
||||||
|
yylval.string.text = yytext+1;
|
||||||
|
yylval.string.len = yyleng-1;
|
||||||
|
return STRING;
|
||||||
|
}
|
||||||
|
|
||||||
/* keywords from TeX/LaTeX that should vanish in HTML */
|
/* keywords from TeX/LaTeX that should vanish in HTML */
|
||||||
/* -------------------------------------------------------------- */
|
/* -------------------------------------------------------------- */
|
||||||
|
|
@ -1173,7 +1347,7 @@ bfblockintro [\{][\\](bf)
|
||||||
BEGIN( INITIAL);
|
BEGIN( INITIAL);
|
||||||
return MBOX;
|
return MBOX;
|
||||||
}
|
}
|
||||||
<INITIAL,MMODE,NestingMode>[\\][,;:!] {}
|
<INITIAL,MMODE,NestingMode,ccStyleMode>[\\][,;:!] {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1199,11 +1373,14 @@ bfblockintro [\{][\\](bf)
|
||||||
return ENDBIBLIO;
|
return ENDBIBLIO;
|
||||||
}
|
}
|
||||||
[\\]newblock/{noletter} {}
|
[\\]newblock/{noletter} {}
|
||||||
[\\]cite{w}([\[][^\]]*[\]])?[\{][^\}]*[\}] {
|
[\\]cite{w}/{noletter} {
|
||||||
yylval.string.text = yytext;
|
BEGIN( NestingMode);
|
||||||
yylval.string.len = yyleng;
|
|
||||||
return CITE;
|
return CITE;
|
||||||
}
|
}
|
||||||
|
[\\]bibcite{w}/{noletter} {
|
||||||
|
BEGIN( NestingMode);
|
||||||
|
return BIBCITE;
|
||||||
|
}
|
||||||
[\\]bibitem{w}/{noletter} {
|
[\\]bibitem{w}/{noletter} {
|
||||||
BEGIN( NestingMode);
|
BEGIN( NestingMode);
|
||||||
return BIBITEM;
|
return BIBITEM;
|
||||||
|
|
@ -1212,11 +1389,11 @@ bfblockintro [\{][\\](bf)
|
||||||
|
|
||||||
/* Grouping symbols */
|
/* Grouping symbols */
|
||||||
/* ---------------- */
|
/* ---------------- */
|
||||||
<INITIAL,MMODE,NestingMode>[\\][\{] {
|
<INITIAL,MMODE,NestingMode,ccStyleMode>[\\][\{] {
|
||||||
yylval.character = '{';
|
yylval.character = '{';
|
||||||
return CHAR;
|
return CHAR;
|
||||||
}
|
}
|
||||||
<INITIAL,MMODE,NestingMode>[\\][\}] {
|
<INITIAL,MMODE,NestingMode,ccStyleMode>[\\][\}] {
|
||||||
yylval.character = '}';
|
yylval.character = '}';
|
||||||
return CHAR;
|
return CHAR;
|
||||||
}
|
}
|
||||||
|
|
@ -1228,20 +1405,43 @@ bfblockintro [\{][\\](bf)
|
||||||
yylval.character = yytext[6];
|
yylval.character = yytext[6];
|
||||||
return CHAR;
|
return CHAR;
|
||||||
}
|
}
|
||||||
<INITIAL,CCMode,NestingMode>[\{] {
|
<INITIAL,CCMode,NestingMode,ccStyleMode>[\{] {
|
||||||
return '{';
|
return '{';
|
||||||
}
|
}
|
||||||
<INITIAL,CCMode,NestingMode>[\}] {
|
<INITIAL,CCMode,NestingMode,ccStyleMode>[\}] {
|
||||||
return '}';
|
return '}';
|
||||||
}
|
}
|
||||||
|
|
||||||
{ttblockintro} { /* A couple of TeX styles like {\tt ... */
|
<INITIAL,MMODE,NestingMode>{ttblockintro} { /* TeX styles like {\tt ... */
|
||||||
return TTBLOCKINTRO;
|
return TTBLOCKINTRO;
|
||||||
}
|
}
|
||||||
{emblockintro} { return EMBLOCKINTRO; }
|
<INITIAL,MMODE,NestingMode>{emblockintro} { return EMBLOCKINTRO; }
|
||||||
{itblockintro} { return ITBLOCKINTRO; }
|
<INITIAL,MMODE,NestingMode>{itblockintro} { return ITBLOCKINTRO; }
|
||||||
{scblockintro} { return SCBLOCKINTRO; }
|
<INITIAL,MMODE,NestingMode>{scblockintro} { return SCBLOCKINTRO; }
|
||||||
{bfblockintro} { return BFBLOCKINTRO; }
|
<INITIAL,MMODE,NestingMode>{bfblockintro} { return BFBLOCKINTRO; }
|
||||||
|
<INITIAL,MMODE,NestingMode>{rmblockintro} { return RMBLOCKINTRO; }
|
||||||
|
<INITIAL,MMODE,NestingMode>{sfblockintro} { return SFBLOCKINTRO; }
|
||||||
|
<INITIAL,MMODE,NestingMode>{calblockintro} { return CALBLOCKINTRO; }
|
||||||
|
|
||||||
|
<CCMode,ccStyleMode>[\\]tt/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
yylval.string.text = "\\T\\";
|
||||||
|
yylval.string.len = -1;
|
||||||
|
return STRING;
|
||||||
|
}
|
||||||
|
<CCMode,ccStyleMode>[\\]ccFont/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
yylval.string.text = "\\I\\";
|
||||||
|
yylval.string.len = -1;
|
||||||
|
return STRING;
|
||||||
|
}
|
||||||
|
<CCMode,ccStyleMode>[\\](l?)dots/{noletter} {
|
||||||
|
skipspaces();
|
||||||
|
yylval.string.text = "...";
|
||||||
|
yylval.string.len = 3;
|
||||||
|
return STRING;
|
||||||
|
}
|
||||||
|
<CCMode,ccStyleMode>[\\]ccEndFont/{noletter} {}
|
||||||
|
|
||||||
<NestingMode>[\[] {
|
<NestingMode>[\[] {
|
||||||
return '[';
|
return '[';
|
||||||
|
|
@ -1257,6 +1457,19 @@ bfblockintro [\{][\\](bf)
|
||||||
return ')';
|
return ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<INITIAL,MMODE,NestingMode>"---" {
|
||||||
|
skipspaces();
|
||||||
|
yylval.string.text = " - ";
|
||||||
|
yylval.string.len = 3;
|
||||||
|
return STRING;
|
||||||
|
}
|
||||||
|
|
||||||
|
<INITIAL,MMODE,NestingMode>"--" {
|
||||||
|
yylval.string.text = "-";
|
||||||
|
yylval.string.len = 1;
|
||||||
|
return STRING;
|
||||||
|
}
|
||||||
|
|
||||||
/* TeX macros */
|
/* TeX macros */
|
||||||
/* -------------------------------------- */
|
/* -------------------------------------- */
|
||||||
<INITIAL,MMODE,NestingMode>[\\]((ref)|(ccTrue)|(ccFalse)|(kill)|(parskip)|(parindent))/{noletter} { // copy without warning
|
<INITIAL,MMODE,NestingMode>[\\]((ref)|(ccTrue)|(ccFalse)|(kill)|(parskip)|(parindent))/{noletter} { // copy without warning
|
||||||
|
|
@ -1264,7 +1477,7 @@ bfblockintro [\{][\\](bf)
|
||||||
yylval.string.len = -1;
|
yylval.string.len = -1;
|
||||||
return STRING;
|
return STRING;
|
||||||
}
|
}
|
||||||
<INITIAL,MMODE,NestingMode>{texmacro} {
|
<INITIAL,MMODE,NestingMode,ccStyleMode>{texmacro} {
|
||||||
if (actual_defining) {
|
if (actual_defining) {
|
||||||
yylval.string.text = yytext;
|
yylval.string.text = yytext;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1298,7 +1511,7 @@ bfblockintro [\{][\\](bf)
|
||||||
}
|
}
|
||||||
return SPACE;
|
return SPACE;
|
||||||
}
|
}
|
||||||
<CCMode,NestingMode>{ws} {
|
<CCMode,NestingMode,ccStyleMode>{ws} {
|
||||||
yylval.string.text = yytext;
|
yylval.string.text = yytext;
|
||||||
yylval.string.len = yyleng;
|
yylval.string.len = yyleng;
|
||||||
return SPACE;
|
return SPACE;
|
||||||
|
|
@ -1307,7 +1520,7 @@ bfblockintro [\{][\\](bf)
|
||||||
yylval.character = yytext[0];
|
yylval.character = yytext[0];
|
||||||
return CHAR;
|
return CHAR;
|
||||||
}
|
}
|
||||||
<INITIAL,NestingMode>[\\][/] {}
|
<INITIAL,NestingMode,ccStyleMode>[\\][/] {}
|
||||||
<INITIAL,MMODE,NestingMode>[&] {
|
<INITIAL,MMODE,NestingMode>[&] {
|
||||||
if ( tab_tag) {
|
if ( tab_tag) {
|
||||||
yylval.string.text =
|
yylval.string.text =
|
||||||
|
|
@ -1320,7 +1533,7 @@ bfblockintro [\{][\\](bf)
|
||||||
return STRING;
|
return STRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
<INITIAL,NestingMode,MMODE,CPROGMode>. {
|
<INITIAL,NestingMode,MMODE,CPROGMode,ccStyleMode>. {
|
||||||
yylval.character = yytext[0];
|
yylval.character = yytext[0];
|
||||||
if ( is_html_multi_character( yylval.character)) {
|
if ( is_html_multi_character( yylval.character)) {
|
||||||
yylval.string.text = html_multi_character(
|
yylval.string.text = html_multi_character(
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ extern int set_INITIAL;
|
||||||
extern int set_HTMLMODE;
|
extern int set_HTMLMODE;
|
||||||
extern int set_MMODE;
|
extern int set_MMODE;
|
||||||
extern int line_number;
|
extern int line_number;
|
||||||
|
extern int set_old_state;
|
||||||
|
|
||||||
extern const char* in_filename;
|
extern const char* in_filename;
|
||||||
extern char* creationvariable;
|
extern char* creationvariable;
|
||||||
|
|
@ -70,6 +71,7 @@ extern bool actual_defining;
|
||||||
/* ============== */
|
/* ============== */
|
||||||
int yyerror( char *s);
|
int yyerror( char *s);
|
||||||
Text* blockintroProcessing( const char* text, int len, Text* t);
|
Text* blockintroProcessing( const char* text, int len, Text* t);
|
||||||
|
Buffer* blockintroProcessing( const char* text, int len, Buffer* t);
|
||||||
|
|
||||||
extern bool mbox_within_math;
|
extern bool mbox_within_math;
|
||||||
|
|
||||||
|
|
@ -101,7 +103,8 @@ extern bool mbox_within_math;
|
||||||
%token SUBSUBSECTION
|
%token SUBSUBSECTION
|
||||||
%token BEGINBIBLIO
|
%token BEGINBIBLIO
|
||||||
%token ENDBIBLIO
|
%token ENDBIBLIO
|
||||||
%token <string> BIBITEM
|
%token BIBCITE
|
||||||
|
%token BIBITEM
|
||||||
%token <string> CITE
|
%token <string> CITE
|
||||||
%token <string> LABEL
|
%token <string> LABEL
|
||||||
%token BEGINCLASS
|
%token BEGINCLASS
|
||||||
|
|
@ -137,8 +140,14 @@ extern bool mbox_within_math;
|
||||||
%token TEXONLYEND
|
%token TEXONLYEND
|
||||||
%token LATEXHTML
|
%token LATEXHTML
|
||||||
%token ANCHOR
|
%token ANCHOR
|
||||||
|
%token <string> HTMLPATH
|
||||||
%token HTMLBEGIN
|
%token HTMLBEGIN
|
||||||
%token HTMLEND
|
%token HTMLEND
|
||||||
|
%token HTMLBEGINCLASSFILE
|
||||||
|
%token HTMLENDCLASSFILE
|
||||||
|
%token <string> HTMLINDEX
|
||||||
|
%token <string> HTMLINDEXC
|
||||||
|
%token HTMLCROSSLINK
|
||||||
|
|
||||||
%token CCSTYLE
|
%token CCSTYLE
|
||||||
%token CCSECTION
|
%token CCSECTION
|
||||||
|
|
@ -162,6 +171,9 @@ extern bool mbox_within_math;
|
||||||
%token ITBLOCKINTRO
|
%token ITBLOCKINTRO
|
||||||
%token SCBLOCKINTRO
|
%token SCBLOCKINTRO
|
||||||
%token BFBLOCKINTRO
|
%token BFBLOCKINTRO
|
||||||
|
%token RMBLOCKINTRO
|
||||||
|
%token SFBLOCKINTRO
|
||||||
|
%token CALBLOCKINTRO
|
||||||
|
|
||||||
%token MBOX
|
%token MBOX
|
||||||
%token FOOTNOTEMARK
|
%token FOOTNOTEMARK
|
||||||
|
|
@ -223,6 +235,7 @@ stmt: string { handleBuffer( * $1);
|
||||||
}
|
}
|
||||||
| BEGINCLASS
|
| BEGINCLASS
|
||||||
classname { handleClass( $2->string());
|
classname { handleClass( $2->string());
|
||||||
|
current_font = unknown_font;
|
||||||
delete $2;
|
delete $2;
|
||||||
}
|
}
|
||||||
decl_sequence
|
decl_sequence
|
||||||
|
|
@ -234,6 +247,7 @@ stmt: string { handleBuffer( * $1);
|
||||||
}
|
}
|
||||||
| BEGINCLASSTEMPLATE
|
| BEGINCLASSTEMPLATE
|
||||||
classname { handleClassTemplate( $2->string());
|
classname { handleClassTemplate( $2->string());
|
||||||
|
current_font = unknown_font;
|
||||||
delete $2;
|
delete $2;
|
||||||
}
|
}
|
||||||
decl_sequence
|
decl_sequence
|
||||||
|
|
@ -243,18 +257,41 @@ stmt: string { handleBuffer( * $1);
|
||||||
delete[] creationvariable;
|
delete[] creationvariable;
|
||||||
creationvariable = NULL;
|
creationvariable = NULL;
|
||||||
}
|
}
|
||||||
|
| HTMLBEGINCLASSFILE
|
||||||
|
classname { set_NestingMode = 1; }
|
||||||
|
comment_group
|
||||||
|
{ handleHtmlClassFile( $2->string(),
|
||||||
|
* $4);
|
||||||
|
set_INITIAL = 1;
|
||||||
|
delete $2;
|
||||||
|
delete $4;
|
||||||
|
}
|
||||||
|
input
|
||||||
|
HTMLENDCLASSFILE {
|
||||||
|
handleHtmlClassFileEnd();
|
||||||
|
}
|
||||||
| CREATIONVARIABLE {}
|
| CREATIONVARIABLE {}
|
||||||
| CCSTYLE '{' nested_token_sequence '}' {
|
| CCSTYLE '{' nested_token_sequence '}' {
|
||||||
set_INITIAL = 1;
|
set_INITIAL = 1;
|
||||||
handleString( "<VAR>");
|
handleString( "<I>");
|
||||||
handleText( * $3);
|
handleText( * $3);
|
||||||
handleString( "</VAR>");
|
handleString( "</I>");
|
||||||
|
current_font = unknown_font;
|
||||||
delete $3;
|
delete $3;
|
||||||
}
|
}
|
||||||
| INCLUDE '{' comment_sequence '}' {
|
| INCLUDE '{' comment_sequence '}' {
|
||||||
handleString( "<EM>#include <");
|
handleString( "<I>#include <");
|
||||||
handleText( * $3);
|
if (cgal_lib_dir) {
|
||||||
handleString( "></EM>");
|
handleString( "<A HREF=\"");
|
||||||
|
handleString( cgal_lib_dir);
|
||||||
|
handleText( * $3);
|
||||||
|
handleString( "\">");
|
||||||
|
handleText( * $3);
|
||||||
|
handleString( "</A>");
|
||||||
|
} else
|
||||||
|
handleText( * $3);
|
||||||
|
handleString( "></I>");
|
||||||
|
current_font = unknown_font;
|
||||||
delete $3;
|
delete $3;
|
||||||
}
|
}
|
||||||
| HEADING '{' comment_sequence '}' {
|
| HEADING '{' comment_sequence '}' {
|
||||||
|
|
@ -302,6 +339,10 @@ blockintro: TTBLOCKINTRO { $$.text = "<TT>\0</TT>"; $$.len = 4; }
|
||||||
| ITBLOCKINTRO { $$.text = "<I>\0</I>"; $$.len = 3; }
|
| ITBLOCKINTRO { $$.text = "<I>\0</I>"; $$.len = 3; }
|
||||||
| SCBLOCKINTRO { $$.text = "<TT>\0</TT>"; $$.len = -1; }
|
| SCBLOCKINTRO { $$.text = "<TT>\0</TT>"; $$.len = -1; }
|
||||||
| BFBLOCKINTRO { $$.text = "<B>\0</B>"; $$.len = 3; }
|
| BFBLOCKINTRO { $$.text = "<B>\0</B>"; $$.len = 3; }
|
||||||
|
/* Sorry: \rm not supported. TT might be fine. */
|
||||||
|
| RMBLOCKINTRO { $$.text = "<TT>\0</TT>"; $$.len = 4; }
|
||||||
|
| SFBLOCKINTRO { $$.text = "<TT>\0</TT>"; $$.len = 4; }
|
||||||
|
| CALBLOCKINTRO { $$.text = "<TT>\0</TT>"; $$.len = 4; }
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -351,7 +392,60 @@ string_token: STRING {
|
||||||
$$->add( $1.text, $1.len);
|
$$->add( $1.text, $1.len);
|
||||||
$$->add( "\"></A>");
|
$$->add( "\"></A>");
|
||||||
}
|
}
|
||||||
| CITE { $$ = handleCite( $1.text); }
|
| HTMLINDEX '{' nested_token_sequence '}' {
|
||||||
|
char* s = text_block_to_string(* $3);
|
||||||
|
delete $3;
|
||||||
|
const char* p = handleHtmlIndex( $1.text, s);
|
||||||
|
delete[] s;
|
||||||
|
$$ = new Buffer;
|
||||||
|
$$->add( p);
|
||||||
|
}
|
||||||
|
| HTMLINDEXC '{' nested_token_sequence '}' {
|
||||||
|
set_INITIAL = 1;
|
||||||
|
char* s = text_block_to_string(* $3);
|
||||||
|
delete $3;
|
||||||
|
const char* p = handleHtmlIndexC( $1.text,s);
|
||||||
|
delete[] s;
|
||||||
|
$$ = new Buffer;
|
||||||
|
$$->add( p);
|
||||||
|
}
|
||||||
|
| HTMLCROSSLINK '{' nested_token_sequence '}' {
|
||||||
|
set_INITIAL = 1;
|
||||||
|
char* s = text_block_to_string(* $3);
|
||||||
|
delete $3;
|
||||||
|
const char* p = handleHtmlCrossLink( s);
|
||||||
|
delete[] s;
|
||||||
|
$$ = new Buffer;
|
||||||
|
$$->add( p);
|
||||||
|
}
|
||||||
|
| CITE '{' nested_token_sequence '}' {
|
||||||
|
set_INITIAL = 1;
|
||||||
|
char* s = text_block_to_string(* $3);
|
||||||
|
$$ = handleCite( s);
|
||||||
|
delete[] s;
|
||||||
|
delete $3;
|
||||||
|
}
|
||||||
|
| CITE '[' nested_token_sequence ']'
|
||||||
|
'{' nested_token_sequence '}' {
|
||||||
|
set_INITIAL = 1;
|
||||||
|
char* s = text_block_to_string(* $3);
|
||||||
|
char* p = text_block_to_string(* $6);
|
||||||
|
$$ = handleCite( p, s);
|
||||||
|
delete[] s;
|
||||||
|
delete[] p;
|
||||||
|
delete $3;
|
||||||
|
delete $6;
|
||||||
|
}
|
||||||
|
| BIBCITE '{' nested_token_sequence '}'
|
||||||
|
'{' nested_token_sequence '}' {
|
||||||
|
set_INITIAL = 1;
|
||||||
|
char* s = text_block_to_string(* $3);
|
||||||
|
char* p = text_block_to_string(* $6);
|
||||||
|
$$ = handleBibCite( s, p);
|
||||||
|
delete[] p;
|
||||||
|
delete[] s;
|
||||||
|
delete $3;
|
||||||
|
}
|
||||||
| BIBITEM '{' nested_token_sequence '}' {
|
| BIBITEM '{' nested_token_sequence '}' {
|
||||||
set_INITIAL = 1;
|
set_INITIAL = 1;
|
||||||
char* s = text_block_to_string(* $3);
|
char* s = text_block_to_string(* $3);
|
||||||
|
|
@ -757,18 +851,19 @@ compound_comment: '{' full_comment_sequence '}' {
|
||||||
set_INITIAL = 1;
|
set_INITIAL = 1;
|
||||||
if ( $$->isEmpty() ||
|
if ( $$->isEmpty() ||
|
||||||
$$->head().isSpace) // should not
|
$$->head().isSpace) // should not
|
||||||
$$->cons( *new TextToken( "<VAR>", 1));
|
$$->cons( *new TextToken( "<I>", 1));
|
||||||
else
|
else
|
||||||
$$->head().prepend( "<VAR>");
|
$$->head().prepend( "<I>");
|
||||||
InListFIter< TextToken> ix( * $$);
|
InListFIter< TextToken> ix( * $$);
|
||||||
ForAll( ix) {
|
ForAll( ix) {
|
||||||
if ( ix.isLast())
|
if ( ix.isLast())
|
||||||
if ( ix->isSpace)
|
if ( ix->isSpace)
|
||||||
$$->append( *new TextToken(
|
$$->append( *new TextToken(
|
||||||
"</VAR>", 1));
|
"</I>", 1));
|
||||||
else
|
else
|
||||||
ix->add( "</VAR>");
|
ix->add( "</I>");
|
||||||
}
|
}
|
||||||
|
current_font = unknown_font;
|
||||||
}
|
}
|
||||||
| verbatim_style {
|
| verbatim_style {
|
||||||
$$ = new Text( managed);
|
$$ = new Text( managed);
|
||||||
|
|
@ -798,10 +893,20 @@ compound_comment: '{' full_comment_sequence '}' {
|
||||||
}
|
}
|
||||||
| INCLUDE '{' comment_sequence '}' {
|
| INCLUDE '{' comment_sequence '}' {
|
||||||
$$ = $3;
|
$$ = $3;
|
||||||
|
if (cgal_lib_dir) {
|
||||||
|
char* s = text_block_to_string(* $3);
|
||||||
|
$$->cons( *new TextToken("\">"));
|
||||||
|
$$->cons( *new TextToken(s));
|
||||||
|
$$->cons( *new TextToken(cgal_lib_dir));
|
||||||
|
$$->cons( *new TextToken("<A HREF=\""));
|
||||||
|
$$->append( *new TextToken( "</A>"));
|
||||||
|
delete[] s;
|
||||||
|
}
|
||||||
$$->cons( *new TextToken( "<"));
|
$$->cons( *new TextToken( "<"));
|
||||||
$$->cons( *new TextToken( " ", 1, true));
|
$$->cons( *new TextToken( " ", 1, true));
|
||||||
$$->cons( *new TextToken( "<EM>#include"));
|
$$->cons( *new TextToken( "<I>#include"));
|
||||||
$$->append( *new TextToken( "></EM>"));
|
$$->append( *new TextToken( "></I>"));
|
||||||
|
current_font = unknown_font;
|
||||||
}
|
}
|
||||||
| HEADING '{' comment_sequence '}' {
|
| HEADING '{' comment_sequence '}' {
|
||||||
$$ = $3;
|
$$ = $3;
|
||||||
|
|
@ -897,6 +1002,7 @@ declaration: '{' {
|
||||||
'}' {
|
'}' {
|
||||||
set_INITIAL = 1;
|
set_INITIAL = 1;
|
||||||
CCMode = 0;
|
CCMode = 0;
|
||||||
|
current_font = unknown_font;
|
||||||
$$ = $3;
|
$$ = $3;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
@ -1010,6 +1116,14 @@ verbatim_style: CPROGBEGIN string_with_nl_or_mt CPROGEND {
|
||||||
delete[] s;
|
delete[] s;
|
||||||
delete $4;
|
delete $4;
|
||||||
}
|
}
|
||||||
|
| HTMLPATH {
|
||||||
|
$$ = new Buffer;
|
||||||
|
$$->add( "<A HREF=\"");
|
||||||
|
$$->add( $1.text, strlen( $1.text) - 1);
|
||||||
|
$$->add( "\">");
|
||||||
|
$$->add( $1.text, strlen( $1.text) - 1);
|
||||||
|
$$->add( "</A>");
|
||||||
|
}
|
||||||
;
|
;
|
||||||
texonly_style: TEXONLYBEGIN string_with_nl TEXONLYEND {
|
texonly_style: TEXONLYBEGIN string_with_nl TEXONLYEND {
|
||||||
delete $2;
|
delete $2;
|
||||||
|
|
@ -1040,6 +1154,11 @@ math_token:
|
||||||
{
|
{
|
||||||
$$ = $2;
|
$$ = $2;
|
||||||
}
|
}
|
||||||
|
| blockintro math_sequence '}' {
|
||||||
|
$$ = blockintroProcessing( $1.text,
|
||||||
|
$1.len,
|
||||||
|
$2);
|
||||||
|
}
|
||||||
| SINGLESUBSCRIPT
|
| SINGLESUBSCRIPT
|
||||||
{
|
{
|
||||||
$$ = new Buffer;
|
$$ = new Buffer;
|
||||||
|
|
@ -1119,6 +1238,8 @@ const char* errorMessage( ErrorNumber n) {
|
||||||
return "Cannot open include file";
|
return "Cannot open include file";
|
||||||
case ChapterStructureError:
|
case ChapterStructureError:
|
||||||
return "Malformed chapter structure: one chapter per file";
|
return "Malformed chapter structure: one chapter per file";
|
||||||
|
case UnknownIndexCategoryError:
|
||||||
|
return "Unknown index category in optional argument of \\ccHtmlIndex";
|
||||||
}
|
}
|
||||||
return "UNKNOWN ERROR MESSAGE NUMBER";
|
return "UNKNOWN ERROR MESSAGE NUMBER";
|
||||||
}
|
}
|
||||||
|
|
@ -1152,3 +1273,14 @@ Text* blockintroProcessing( const char* text, int len, Text* t) {
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Buffer* blockintroProcessing( const char* text, int len, Buffer* t) {
|
||||||
|
if ( len < 0) { /* Hack! Here we know that t has to get capitalized.*/
|
||||||
|
len = 4;
|
||||||
|
t->capitalize();
|
||||||
|
}
|
||||||
|
t->prepend( text, len);
|
||||||
|
/* Hack! ptr arithmetic points to the closing tag text */
|
||||||
|
t->add( text + len + 1);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue