- Timestamp:
- 09/17/08 13:27:13 (3 months ago)
- Location:
- v6/smop
- Files:
-
- 1 removed
- 2 modified
- 1 moved
-
CMakeLists.txt (modified) (1 diff)
-
src/smop_s1p_io.c (deleted)
-
src/smop_s1p_io.ri (moved) (moved from v6/smop/misc/ri/smop_s1p_io.ri) (2 diffs)
-
tools/ri (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
v6/smop/CMakeLists.txt
r22268 r22270 101 101 102 102 foreach (ri_file 103 # src/smop_s1p_itemcontext.ri 104 # src/smop_s1p_itemrwcontext.ri 103 src/smop_s1p_io.ri 105 104 ) 106 105 compile_ri (${ri_file}) -
v6/smop/src/smop_s1p_io.ri
r22261 r22270 3 3 %prefix smop_s1p_io 4 4 %include <stdlib.h>,<stdio.h> 5 6 %{ 7 typedef struct smop_s1p_io_struct { 8 SMOP__Object__BASE 9 } smop_s1p_io_struct; 10 11 SMOP__Object* SMOP__S1P__IO_create(SMOP__Object* interpreter) { 12 SMOP_REFERENCE(interpreter,RI); 13 SMOP__Object* ret = smop_lowlevel_alloc(sizeof(smop_s1p_io_struct)); 14 ret->RI = (SMOP__ResponderInterface*)RI; 15 return ret; 16 } 17 %} 18 5 19 %method print 6 20 int pc = SMOP__NATIVE__capture_positional_count(interpreter,capture); … … 23 37 } 24 38 %method DESTROYALL 39 SMOP_RELEASE(interpreter,RI); 40 %method new 41 ret = SMOP__S1P__IO_create(interpreter); -
v6/smop/tools/ri
r22263 r22270 5 5 sub mangle { 6 6 my $id = shift; 7 return ' SMOP__ID__'.$id;7 return 'ID__'.$id; 8 8 } 9 9 10 my @properties = qw(RI RI.id prefix include );10 my @properties = qw(RI RI.id prefix include prototype); 11 11 my %properties; 12 12 … … 14 14 my $method; 15 15 16 # FIX convoluted 17 LINE: while (my $line = <>) { 18 if ($method) { 16 my $raw = ''; 17 18 sub debug { 19 } 20 while (my $line = <>) { 21 if ($line =~ /^\%\{\s*/) { 22 debug "raw start\n"; 23 until((my $raw_line = <>) =~ /^\%}\s*$/) { 24 debug "raw $raw_line"; 25 $raw .= $raw_line; 26 } 27 debug "raw stop\n"; 28 } elsif ($method) { 19 29 if ($line =~ /^%/) { 20 30 undef $method; 31 redo; 21 32 } else { 33 debug "in method $line"; 22 34 $methods{$method} .= $line; 23 35 next; 24 36 } 25 } 26 if ($line =~ /^%method\s*(.*)$/) { 37 } elsif ($line =~ /^%method\s*(.*)$/) { 27 38 $method = $1; 28 next; 29 } 30 for my $property (@properties) { 31 if ($line =~ /^% \s* \Q$property\E \s+ (.*)$/x) { 32 $properties{$property} = $1; 33 next LINE; 39 debug "method start:$method\n"; 40 } elsif ($line =~ / ^\s*$ | ^\# | ^\/\/ /x) { 41 debug "ws/comment:$line"; 42 } else { 43 for my $property (@properties) { 44 if ($line =~ /^% \s* \Q$property\E \s+ (.*)$/x) { 45 $properties{$property} = $1; 46 debug "prop $property = $1\n"; 47 goto FOUND; 48 } 34 49 } 35 } 50 die "unrecognised line: $line"; 51 FOUND: ; 52 } 36 53 } 37 54 … … 57 74 print 'static SMOP__Object* ',mangle($_),";\n"; 58 75 } 76 77 print $raw; 78 59 79 print q[ 60 80 static SMOP__Object* message(SMOP__Object* interpreter,
