runaway action
Manfred_Nowak
svv1... at hotmail.com
Sat Aug 2 18:52:30 UTC 2008
On 2 Aug., 13:01, Manfred_Nowak <svv1... at hotmail.com> wrote:
> How to fix this?
For this the source might be helpful. The host language is D.
-manfred
%%{
machine sink;
write data;
}%%
import std.stdio;
void main( char[][] argv){
assert( argv.length>1);
int cs;
char* eof;
char* p=&(argv[1][0]);
char* pe=&(argv[1][argv[1].length-1]);
pe++;
eof= pe;
%%{
action clr {
writefln( "clr");
}
action a1 {}
all= start: ( '' -> l1),
l1:
(
'b' -> l2
| 'd' -> l7
| any -> l1
)
,
l2: (
'c' -> l3
| any -> l1
)
,
l3: (
'd' -> l4
| any -> l1
)
,
l4: (
'a' -> l5
| any -> l1
)
,
l5: (
'b' -> l6
| any -> l1
)
,
l6: (
'b' -> l12
| 'c' -> l3
| any -> l1
)
,
l7: (
'a' -> l8
| any -> l1
)
,
l8: (
'b' -> l9
| any -> l1
)
,
l9: (
'c' -> l10
| any -> l1
)
,
l10: (
'd' -> l11
| any -> l1
)
,
l11: (
'a' -> l8
| 'd' -> l12
| any -> l1
)
,
l12: (
any -> l12
| '' -> final
)
;
main:= all ;
write init;
write exec;
}%%
if( cs >= sink_first_final ){
writefln("accepted.");
} else {
writefln( "sorry.");
}
}
More information about the ragel-users
mailing list