[ragel-users] Bug? Backslash-escapes not escaped enough in .dotfiles?
Austin Hastings
ah08010-ragel at yahoo.com
Sun Mar 27 11:41:11 UTC 2011
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: ragel-users at complang.org
> 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
> ragel-users at complang.org
> http://www.complang.org/mailman/listinfo/ragel-users
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ragel-dotty.png
Type: image/png
Size: 13767 bytes
Desc: not available
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20110327/f033a5ad/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ragel-dot.png
Type: image/png
Size: 14523 bytes
Desc: not available
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20110327/f033a5ad/attachment-0003.png>
-------------- next part --------------
_______________________________________________
ragel-users mailing list
ragel-users at complang.org
http://www.complang.org/mailman/listinfo/ragel-users
More information about the ragel-users
mailing list