Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 521158

Summary: Add DOT Attribute support for shape=""
Product: [Tools] GEF Reporter: Tamas Miklossy <miklossy>
Component: GEF DOTAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: 5.0.1 (Oxygen.1) RC1   
Hardware: PC   
OS: Windows NT   
Whiteboard:

Description Tamas Miklossy CLA 2017-08-20 04:03:07 EDT
Given is the following dot file taken from http://www.graphviz.org/Documentation/dotguide.pdf (Figure 3: Fancy graph Page5):

digraph G {
    size ="4,4";
    main [shape=box];   /* this is a comment */
    main -> parse [weight=8];
    parse -> execute;
    main -> init [style=dotted];
    main -> cleanup;
    execute -> { make_string; printf}
    init -> make_string;
    edge [color=red];   // so is this
    main -> printf [style=bold,label="100 times"];
    make_string [label="make a\nstring"];
    node [shape=box,style=filled,color=".7 .3 1.0"];
    execute -> compare;
}

Rendering it within the DOT Graph view results in the following error message:  Could not import DOT: Cannot set node attribute 'shape' to ''. The value '' is not a syntactically correct shape.

Although this is not documented explicitly, empty shape attribute seems to be used/supported by the dot language, especially if the dot file is generated by Graphviz.

Similar issues:
DOT fixedsize="" attribute: https://bugs.eclipse.org/bugs/show_bug.cgi?id=521149
DOT color="" attribute:  https://bugs.eclipse.org/bugs/show_bug.cgi?id=520919
DOT style="" attribute: https://github.com/eclipse/gef/commit/c060eafdae6cdb97adb4d3b6c973b20e099de30c
Comment 1 Tamas Miklossy CLA 2017-08-20 04:11:22 EDT
The following changes are published on the origin/R5_0_0_maintenance and origin/master branches:

[521158] Ensure that Dot Files with shape="" are properly rendered.

- Modify the DotShape.xtext grammar to accept an empty shape value.
- Add fancy_graph.dot example file to demonstrate the corresponding use
case.
- Implement corresponding DotParserTests test case.
- Adapt the DotAttributesTests and DotValidatorTests test cases.