INVALID = 0,
STILL_CANDIDATE = 1, // the text may or may not be the program doctext
ALREADY_PROCESSED = 2, // doctext has been used and is no longer available
- ABSOLUTELY_SURE = 3 // this is the program doctext
+ ABSOLUTELY_SURE = 3, // this is the program doctext
+ NO_PROGRAM_DOCTEXT = 4 // there is no program doctext
};
--- /dev/null
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef T_LOGGING_H
+#define T_LOGGING_H
+
+#include <string>
+
+/**
+ * Parse debugging output, used to print helpful info
+ */
+void pdebug(const char* fmt, ...);
+
+/**
+ * Parser warning
+ */
+void pwarning(int level, const char* fmt, ...);
+
+/**
+ * Print verbose output message
+ */
+void pverbose(const char* fmt, ...);
+
+/**
+ * Failure!
+ */
+void failure(const char* fmt, ...);
+
+
+#endif
}
g_program_doctext_lineno = 0;
g_program_doctext_status = INVALID;
+ pdebug("%s","program doctext set to INVALID");
}
/**
void declare_valid_program_doctext() {
if((g_program_doctext_candidate != NULL) && (g_program_doctext_status == STILL_CANDIDATE)) {
g_program_doctext_status = ABSOLUTELY_SURE;
+ pdebug("%s","program doctext set to ABSOLUTELY_SURE");
+ } else {
+ g_program_doctext_status = NO_PROGRAM_DOCTEXT;
+ pdebug("%s","program doctext set to NO_PROGRAM_DOCTEXT");
}
}
#define T_MAIN_H
#include <string>
+#include "logging.h"
#include "parse/t_const.h"
#include "parse/t_field.h"
*/
void yyerror(const char* fmt, ...);
-/**
- * Parse debugging output, used to print helpful info
- */
-void pdebug(const char* fmt, ...);
-
-/**
- * Parser warning
- */
-void pwarning(int level, const char* fmt, ...);
-
-/**
- * Print verbose output message
- */
-void pverbose(const char* fmt, ...);
-
-/**
- * Failure!
- */
-void failure(const char* fmt, ...);
-
/**
* Check simple identifier names
*/
#define T_DOC_H
#include "globals.h"
+#include "logging.h"
/**
* Documentation stubs
has_doc_ = true;
if( (g_program_doctext_lineno == g_doctext_lineno) && (g_program_doctext_status == STILL_CANDIDATE)) {
g_program_doctext_status = ALREADY_PROCESSED;
+ pdebug("%s","program doctext set to ALREADY_PROCESSED");
}
}
g_doctext[strlen(g_doctext) - 1] = '\0';
g_doctext = clean_up_doctext(g_doctext);
g_doctext_lineno = yylineno;
- if(g_program_doctext_candidate == NULL){
+ if( (g_program_doctext_candidate == NULL) && (g_program_doctext_status == INVALID)){
g_program_doctext_candidate = strdup(g_doctext);
g_program_doctext_lineno = g_doctext_lineno;
g_program_doctext_status = STILL_CANDIDATE;
+ pdebug("%s","program doctext set to STILL_CANDIDATE");
}
}
}