repositories
/
TP_AL_C.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Syntactic analysis fully working implementation.
[TP_AL_C.git]
/
lexer
/
print_helper.c
diff --git
a/lexer/print_helper.c
b/lexer/print_helper.c
index d5ca8f0da8705e4865663718ce215a9fd3ea5bcd..23684d5e22e6785fdd30fc7925b82bbb5e26cac0 100644
(file)
--- a/
lexer/print_helper.c
+++ b/
lexer/print_helper.c
@@
-2,7
+2,9
@@
#include <stdio.h>
#include <wchar.h>
#include <stdio.h>
#include <wchar.h>
-void pr_warning(const char *format, ...) {
+#include "global_vars.h"
+
+void pr_warning(const char* format, ...) {
va_list args;
va_start(args, format);
va_list args;
va_start(args, format);
@@
-18,6
+20,18
@@
void pr_error(const char *format, ...) {
va_end(args);
}
va_end(args);
}
+#if DEBUG
+void pr_debug(const char *format, ...) {
+ va_list args;
+
+ va_start(args, format);
+ fprintf(stderr, format, args);
+ va_end(args);
+}
+#else
+void pr_debug(const char *format, ...);
+#endif /* DEBUG */
+
void wpr_warning(const wchar_t *format, ...) {
va_list args;
void wpr_warning(const wchar_t *format, ...) {
va_list args;
@@
-33,3
+47,11
@@
void wpr_error(const wchar_t *format, ...) {
fwprintf(stderr, format, args);
va_end(args);
}
fwprintf(stderr, format, args);
va_end(args);
}
+
+void wprint_token() {
+ if (tokenType == MOT || tokenType == MOTCLE) {
+ fwprintf(target, L"%20s: %ls\n", tokenTypestr[tokenType], token[tokenFound].value);
+ } else {
+ fwprintf(target, L"%20s\n", tokenTypestr[tokenType]);
+ }
+}