adrian-thurston / ragel

Ragel State Machine Compiler
MIT License
524 stars 46 forks source link

graphviz output is broken for backends using the intermediate file format #71

Open adrian-thurston opened 3 years ago

adrian-thurston commented 3 years ago

When using ragel-rust -V the graphviz output ends up in the intermediate file and the intermediate file parsing throws an error.

virusdefender commented 8 months ago

all tools (including ragel-c ragel-java, etc) will show parse error currently, even if it's a very simple state machine, however, it seems the generated *.ri file is a valid dot file.

➜  jsp git:(master) ✗ ~/workspace/ragel/ragel/bin/ragel-c  -V example.rl
example.ri:1:13: parse error

➜  jsp git:(master) ✗ ~/workspace/ragel/ragel/bin/ragel-c -v
Ragel State Machine Compiler version 7.0.4 February 2021
Copyright (c) 2001-2021 by Dr. Adrian D. Thurston et al.
➜  jsp git:(master) ✗ ragel -V example.rl
digraph foo {
    rankdir=LR;
        ....
}

➜  jsp git:(master) ✗ ragel -v
Ragel State Machine Compiler version 6.10 March 2017
Copyright (c) 2001-2009 by Adrian Thurston
➜  jsp git:(master) ✗ cat example.rl
#include <string.h>
#include <stdio.h>
%%{
machine foo;
main :=
( 'foo' | 'bar' )
0 @{ res = 1; };
}%%
%% write data;