Hi everybody!
I'm a novice user of Ragel, and I need the machine to consume unimportant stuff, but I can't figure out how to to that; this is the code of the machine:

main:='O'@init
('C'$ccaOn'c'$ccaOff
|'T'$txOn't'$txOff
|'R'$rxOn'r'$rxOff
|'D'$dozeOn'A'$dozeOff
|'H'$hibOn'A'$hibOff #)
)*;

That print & execute OK, but it must cope with code out of the alphabet I define, simply by ignoring it. If I do:

main:='O'@init ((any-[CTRDH])*
('C'$ccaOn(any-'c')*'c'$ccaOff
|'T'$txOn(any-'t')*'t'$txOff
|'R'$rxOn(any-'r')*'r'$rxOff
|'D'$dozeOn(any-'A')*'A'$dozeOff
|'H'$hibOn(any-'A')*'A'$hibOff #)
)*;

What would seems to me to be case(is it right?), the graph turn to a mess, and I can't be confident about the results. The result I'm aiming could be:
digraph modem {
rankdir=LR;
node [ shape = point ];
ENTRY;
en_1;
node [ shape = ci rcle, height = 0.2 ];
node [ fixedsize = true, height = 0.65, shape = doublecircle ];
1->1[label="DEF"];
2->2[label="DEF"];
3->3[label="DEF"];
4->4[label="DEF"];
5->5[label="DEF"];
6->6[label="DEF"];
7->7[label="DEF"];
node [ shape = circle ];
1 -> 7 [ label = "'O' / init" ];
2 -> 7 [ label = "'c' / ccaOff" ];
3 -> 7 [ label = "'A' / dozeOff" ];
4 -> 7 [ label = "'A' / hibOff" ];
5 -> 7 [ label = "'r' / rxOff" ];
6 -> 7 [ label = "'t' / txOff" ];
7 -> 2 [ label = "'C' / ccaOn" ];
7 -> 3 [ label = "'D' / dozeOn" ];
7 -> 4 [ label = "'H' / hibOn" ];
7 -> 5 [ label = "'R' / rxOn" ];
7 -> 6 [ label = "'T' / txOn" ];
ENTRY -> 1 [ label = "IN" ];
en_1 -> 1 [ label = "main" ];
}

Which I "produce" base upon the output of the first machine code. Can anybody tell me how to instruc t Ragel in order I could obtain it, starting from the original machine?

Thank you everybody!

Wilson
_______________________________________________
ragel-users mailing list
[email protected]
http://www.complang.org/mailman/listinfo/ragel-users

Reply via email to