Sure. I think this is a "dotty" bug, though.

I start with this .ragel file:

%%{
    machine test;
    ws = 0x20 | 0x09 | 0x0A ;
    action ws_act { }
    main := ( ws @ws_act )+;
}%%

Which produces this .dot file:

digraph test {
        rankdir=LR;
        node [ shape = point ];
        ENTRY;
        en_1;
        node [ shape = circle, height = 0.2 ];
        node [ fixedsize = true, height = 0.65, shape = doublecircle ];
        2;
        node [ shape = circle ];
        1 -> 2 [ label = "'\\t'..'\\n', SP / ws_act" ];
        2 -> 2 [ label = "'\\t'..'\\n', SP / ws_act" ];
        ENTRY -> 1 [ label = "IN" ];
        en_1 -> 1 [ label = "main" ];
}

I was then viewing it with the "dotty" tool, part of Graphviz. I got the image captured in the attached file (ragel-dotty.png). You'll notice there are no backslashes before 't'.

Next I tried to generate the png directly with:

    dot -Tpng -o ragel-dot.png ragel.dot

But that png file, also attached (ragel-dot.png), contains backslashes. Apparently, this is a "dotty" bug, since two of their tools are producing different results. It's definitely not a ragel issue.

=Austin


On 3/27/2011 7:14 AM, Josef Göttgens wrote:
Hi Austin,

I guess your example shows part of a .dot file. Backslashes are regarded by dot and friends as escape chars, i.e. in order to print \t you need to have \\t in your dot file. Whether you surround \\t with single quotes or not doesn't matter.

I am not sure whether you need to be concerned about this because calling Ragel with the option -Vp takes care of proper escaping when needed. Could you publish you .rl file to see what you are trying to do?

jg


-----Ursprüngliche Nachricht----- From: Austin Hastings
Sent: Sunday, March 27, 2011 12:04 PM
To: [email protected]
Subject: [ragel-users] Bug? Backslash-escapes not escaped enough in .dotfiles?

Howdy,

I'm poring over some .dot files, trying to understand what's wrong with
my tokenizer. And I'm on Windows (XPpro, sp3, en-us), which means that
my stuff probably doesn't work like anyone else's.

I can see the .dot file contains labels generated like '\\t'  (that's
apos-backslash-backslash-tee-apos).

But dotty is suppressing the backslash, for some reason.

If I change them to 4 slashes:  '\\\\t' then I see one slash in the
dotty window.

Is this a ragel bug (not generating the right number of slashes) or a
dotty bug (ignoring too many slashes) ?

For example:

    2 -> 2 [ label = "'\\t', '\\f'..'\\r', SP / whitespace_act,
buffer_input" ];
2 -> 2 [ label = "'\\n' / newline_act, whitespace_act, buffer_input" ];

=Austin


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


<<attachment: ragel-dotty.png>>

<<attachment: ragel-dot.png>>

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

Reply via email to