PERFORCE change 100908 for review
Spencer Whitman
swhitman at FreeBSD.org
Fri Jul 7 17:54:34 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=100908
Change 100908 by swhitman at swhitman_joethecat on 2006/07/07 17:53:55
Added hooks for other preprocessor # functions
Affected files ...
.. //depot/projects/soc2006/swhitman-K_Kernel_Meta-Language/k/cpp.c#9 edit
.. //depot/projects/soc2006/swhitman-K_Kernel_Meta-Language/k/lexer.c#7 edit
.. //depot/projects/soc2006/swhitman-K_Kernel_Meta-Language/k/test.h#2 edit
Differences ...
==== //depot/projects/soc2006/swhitman-K_Kernel_Meta-Language/k/cpp.c#9 (text+ko) ====
@@ -226,6 +226,11 @@
cppfile(cfs->h, r);
}
+/*
+ * Define statment should be of the form:
+ * #define NAME(vars) value
+ * If value continues along more than one line, it should end with a \\n
+ */
static void
cpp_define(CPP_ARGS)
{
@@ -235,6 +240,14 @@
}
static void
+cpp_undef(CPP_ARGS)
+{
+ /* struct cppfilestate *cfs __unused, const char *h __unused,
+ const char *b __unused, const char *e __unused */
+ printf("#undef of %V\n",String(b,e));
+}
+
+static void
cppchunk(struct cppfilestate *cfs, const char *s, const char *e)
{
/* NOTE: cfs-> is uninitalized for first call to cppchunk */
@@ -255,7 +268,13 @@
cpp_func *func;
} cpp_kw[] = {
{ "define", 0, cpp_define },
- { "ifdef", 0, NULL },
+ { "undef", 0, cpp_undef },
+ /* { "ifdef", 0, NULL }, */
+ /* { "ifndef", 0, NULL }, */
+ /* { "endif", 0, NULL }, */
+ /* { "if defined", 0, NULL }, */
+ /* { "else", 0, NULL }, */
+ /* { "elif", 0, NULL }, */
{ "error", 0, cpp_error },
{ "include", 0, cpp_include },
{ "pragma", 0, cpp_pragma },
==== //depot/projects/soc2006/swhitman-K_Kernel_Meta-Language/k/lexer.c#7 (text+ko) ====
==== //depot/projects/soc2006/swhitman-K_Kernel_Meta-Language/k/test.h#2 (text+ko) ====
@@ -1,5 +1,5 @@
#define HI 10
-#define '
+char * bla = "one" # "two"
typedef void * void_star;
More information about the p4-projects
mailing list