[Gridflow-cvs] [svn] commit: r5660 - in /trunk/src: gridflow.hxx source_filter.rb

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Wed May 12 14:42:00 EDT 2010


Author: matju
Date: Wed May 12 14:41:55 2010
New Revision: 5660

Log:
more source_filter stuff

Modified:
    trunk/src/gridflow.hxx
    trunk/src/source_filter.rb

Modified: trunk/src/gridflow.hxx
==============================================================================
--- trunk/src/gridflow.hxx (original)
+++ trunk/src/gridflow.hxx Wed May 12 14:41:55 2010
@@ -58,9 +58,9 @@
 #define sys_gui(s) sys_gui(const_cast<char *>(s))
 
 #ifdef DES_BUGS
-#define DEF_IN post("> self=%08x %s",long(self),context);
+#define DEF_IN(CONTEXT) static const char *context = CONTEXT; post("> self=%08x %s",long(self),context);
 #else
-#define DEF_IN
+#define DEF_IN(CONTEXT) static const char *context = CONTEXT;
 #endif
 #define DEF_OUT
 

Modified: trunk/src/source_filter.rb
==============================================================================
--- trunk/src/source_filter.rb (original)
+++ trunk/src/source_filter.rb Wed May 12 14:41:55 2010
@@ -178,7 +178,7 @@
 	if in_class_block then Out.print "static void " else Out.print "void #{classname}::" end
 	Out.print "#{m.selector}_wrap(#{classname} *self, VA) {"
 	if /^_(\d+)_(\w+)$/ =~ m.selector then context = "inlet #{$1} method #{$2}" else context = m.selector end
-	Out.print "static const char *context = \"method #{m.selector}\"; DEF_IN;"
+	Out.print "DEF_IN(\"method #{m.selector}\");"
 	Out.print "#{m.rettype} foo;" if m.rettype!="void"
 	check_argc m
 	Out.print "foo = " if m.rettype!="void"
@@ -197,7 +197,7 @@
 	raise "missing \\class #{where}" if not frame or not ClassDecl===frame
 	m = parse_methoddecl("void constructor"+line,"(.*)$")
 	Out.print "#{frame.name}(BFObject *bself, MESSAGE) : #{frame.supername}(bself,MESSAGE2) {"
-	Out.print "const char *context = \"constructor\"; DEF_IN;"
+	Out.print "DEF_IN(\"constructor\");"
 	check_argc m
 	Out.print "#{m.selector}(sel,argc,argv"
 	pass_args m
@@ -231,8 +231,6 @@
 def handle_grin(line)
 	fields = line.split(/\s+/)
 	i = fields[0].to_i
-	c = $stack[-1].name
-	frame = $stack[-1]
 	Out.print "GRINDECL(#{i})"
 	handle_decl "#{i} grid(GridOutlet *foo);"
 	handle_decl "#{i} list(...);"
@@ -241,13 +239,12 @@
 end
 
 def handle_end(line)
-	frame = $stack.pop
+	frame = $stack[-1]
 	fields = line.split(/\s+/)
 	n = fields.length
 	if not ClassDecl===frame then raise "\\end: frame is not a \\class" end
 	cl = frame.name
 	if fields[0]!="class" or (n>1 and not /^\{/ =~ fields[1] and fields[1]!=cl) then raise "end not matching #{where}" end
-	$stack.push frame
 	frame.grins.each {|i,v|
 		Out.print "static GridHandler #{cl}_grid_#{i}_hand = GRIN_#{v[1]||'all'}(#{cl}::grinw_#{i});"
 		check = "CHECK_GRIN(#{cl},#{i});"



More information about the Gridflow-cvs mailing list