GraphParserException from Grappa

hello, I have had this problem. It looks like an enoding problem for some characters. Any idea how to fix it? Thank you.

WARNING: Lexer[5(12)]: Unrecognized character '.'(46) -- ignored
ERROR: Parser[5(16)]: Syntax error
Exception: at [5(16)]: Syntax error
att.grappa.GraphParserException: at [5(16)]: Syntax error
at att.grappa.Parser.report_error(Parser.java:372)
at java_cup.runtime.lr_parser.syntax_error(lr_parser.java:395)
at java_cup.runtime.lr_parser.parse(lr_parser.java:594)

GraphParserException from Grappa

Hello,

I've got the same problem but it is unfortunately not the missing quotes resulting in the parsing error. The following graph is correcty parsed by dot but results in a problem in grappa under Windows (not under Linux where it is correctly displayed). Does anyone have an idea why this happens under Windows (seems like encoding issues).

Thanks!

Graph parsed by dot but not by grappa:

digraph dp_graph {
  node [
    inthreshold = 100,
    outthreshold = 100
  ];

  1 [
    fontsize = 16
  ];
  0 [
    color = lightblue2,
    style = filled,
    fontsize = 16,
    peripheries = 2
  ];
  0 -> 1 [
    label = "q?p(ack)"
  ];
  1 -> 0 [
    label = "q?p(ack)"
  ];
  0 -> 1 [
    label = "p!q(ack)"
  ];
  1 -> 1 [
    label = "p!q(ack)"
  ];
}

You're probably going to have

You're probably going to have to provide more information, such as Graphviz version,  any error message, what you are doing, etc., because I was able to use Grappa on windows to view your graph (once I handled the parsing errors.)

It would be helpful if you

It would be helpful if you could post your input, or at least the part that causes the exception. Thanks.

Grappa Exception

The problem occurs here where 'outFileName' is the valid dot file I tested on command line dot.

           fin = new FileInputStream(outFileName);
            Parser program = new Parser(fin, System.err);
            try {
                program.parse();
            }
            catch (Exception ex) {
                System.err.println("Exception: " + ex.getMessage());
                ex.printStackTrace(System.err);
            }

The dot file works fine, when

The dot file works fine, when I tested on Windows command line with "dot" command. The problem occurs when I used it in a Java GUI panel, and here is the code:

The 'outFileName' is the generated dot file,which is valid. As said above, I tested with command line dot and it gets no prolem. I am working on Windows 7 with JDK 6.

            fin = new FileInputStream(outFileName);
            Parser program = new Parser(fin, System.err);
            try {
                program.parse();
            }
            catch (Exception ex) {
                System.err.println("Exception: " + ex.getMessage());
                ex.printStackTrace(System.err);
            }

Any idear? It seems to be a common problem? Thank you.

 

I need an example of a dot

I need an example of a dot file that causes the problem, like the one you ran dot on successfully, but which caused problems for grappa. It is possible the grappa parse  may need to be updated. Thanks.

I will give you an exmaple

I will give you an exmaple dot file. Thanks.

digraph E {     graph

digraph E {
    graph [bb="0,0,234,233",
        fontsize=18,
        label=Events,
        lheight=0.28,
        lp="117,14",
        lwidth=0.69,
        rankdir=LR
    ];
    node [color=green,
        label="\N",
        shape=box,
        style=filled
    ];
    Benefitipod_4     [color=red,
        height=0.5,
        label=ipod,
        pos="204,100",
        shape="",
        style="",
        width=0.75827];
    Positivesgood_12     [color=red,
        height=0.5,
        label=good,
        pos="204,161",
        shape="",
        style="",
        width=0.83048];
    Benefitgood_12     [color=red,
        height=0.5,
        label=good,
        pos="204,46",
        shape="",
        style="",
        width=0.83048];
    Positivesipod_4     [color=red,
        height=0.5,
        label=ipod,
        pos="204,215",
        shape="",
        style="",
        width=0.75827];
    Positives     [height=0.5,
        label=Positives,
        pos="34,174",
        tip="Positives.Object_Is_Good_period",
        width=0.93056];
    Positives -> Positivesipod_4     [color=blue,
        label=Object,
        lp="121,211.5",
        pos="e,177.82,209.5 67.596,183.16 73.7,184.82 80.035,186.49 86,188 113.47,194.94 144.74,202.12 168.04,207.33"];
    Positives -> Positivesgood_12     [color=blue,
        label=SubjQuality,
        lp="121,176.5",
        pos="e,174.21,163.23 67.791,171.46 95.346,169.33 134.79,166.28 163.97,164.02"];
    Benefit     [height=0.5,
        label=Benefit,
        pos="34,93",
        tip="Benefit.A_is_good_positive",
        width=0.77778];
    Benefit -> Benefitipod_4     [color=blue,
        label=Instrument,
        lp="121,105.5",
        pos="e,176.48,98.895 62.366,94.14 90.684,95.32 135.08,97.17 166.4,98.475"];
    Benefit -> Benefitgood_12     [color=blue,
        label=ProModifier,
        lp="121,84.5",
        pos="e,175.95,52.799 62.193,84.22 69.87,81.809 78.244,79.243 86,77 112.73,69.271 143.11,61.244 166.21,55.295"];
}

 

WARNING: Lexer[6(12)]: Unrecognized character '.'(46)

Hi, everybody,

I think I have the same problem.

WARNING: Lexer[6(12)]: Unrecognized character '.'(46) -- ignored
ERROR: Parser[6(16)]: Syntax error
Exception: at [6(16)]: Syntax error
att.grappa.GraphParserException: at [6(16)]: Syntax error
    at att.grappa.Parser.report_error(Parser.java:372)
    at java_cup.runtime.lr_parser.syntax_error(lr_parser.java:396)
    at java_cup.runtime.lr_parser.parse(lr_parser.java:595)

Does anyone knows the answer?

The problem is that the

The problem is that the grappa lexer defines an ID as a quoted string or an alphanumeric sequence. But the DOT language accepts these and floating-point numbers of the form abc.def. Hence, the grappa lexer rejects 0.28. The simple workaround is the use a quoted string "0.28".

The problem is that the

The problem is that the grappa lexer defines an ID as a quoted string or an alphanumeric sequence. But the DOT language accepts these and floating-point numbers of the form abc.def. Hence, the grappa lexer rejects 0.28. The simple workaround is the use a quoted string "0.28".

same problem in owls tab in protege

I have the same problem when using graphviz 2.3 in owls editor with protege

att.grappa.GraphParserException: at [15(23)]: Syntax error
    at att.grappa.Parser.report_error(Parser.java:373)
    at java_cup.runtime.lr_parser.syntax_error(lr_parser.java:395)
    at java_cup.runtime.lr_parser.parse(lr_parser.java:594)
    at att.grappa.GrappaSupport.filterGraph(GrappaSupport.java:796)
    at att.grappa.GrappaSupport.filterGraph(GrappaSupport.java:676)
    at com.sri.owlseditor.cmp.graph.GraphPanel.displayGraph(GraphPanel.java:500)
    at com.sri.owlseditor.cmp.graph.GraphPanel$1View.run(GraphPanel.java:443)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

 

Can someone help me, thanks

Please note the earlier note

Please note the earlier note about a workaround. Just put double quotes around the various attribute values.

GraphParserException from Grappa still not solved

Hi all,

I am experiencing this very same problem in Protégé with the valuable Ontoviz plugin since I changed laptops.

My old laptop was (and still is...) running on Windows XP 32 bit, my new laptop runs on Windows 7 64 bit.

The problem boils down to quoting decimal numbers.

On the new laptop I get in the dot file: width=0.90278 (which causes a parse error in Grappa)

On the old laptop I get in the dot file: width="0.90278" (which works perfectly)

I use the same version of the dot.exe program on both laptops, as far as I can see I use the same system locale settings.

The suggested solution "Just put double quotes around the various attribute values." does not work as there is no possibility for manual intervention.

My question to you, Graphviz experts, is: what setting influences dot.exe to generate quoted decimal values?

Best, Rob.

Recent comments