Bug 508869 - DOT Editor - Ensure DOT grammar properly handles quoted string concatenation and C specific syntax
Summary: DOT Editor - Ensure DOT grammar properly handles quoted string concatenation ...
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF DOT (show other bugs)
Version: 1.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 508830 507413
Blocks:
  Show dependency tree
 
Reported: 2016-12-08 01:59 EST by Alexander Nyßen CLA
Modified: 2018-11-14 03:46 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Nyßen CLA 2016-12-08 01:59:55 EST
The DOT grammar specifies the following for quoted strings:

-"As another aid for readability, dot allows double-quoted strings to span multiple physical lines using the standard C convention of a backslash immediately preceding a newline character. In addition, double-quoted strings can be concatenated using a '+' operator."

For html strings that does not hold:
-"As HTML strings can contain newline characters, which are used solely for formatting, the language does not allow escaped newlines or concatenation operators to be used within them."

Further, C preprocessor directives are allowed:
-"In addition, a line beginning with a '#' character is considered a line output from a C preprocessor (e.g., # 34 to indicate line 34 ) and discarded."

We need to ensure the DOT grammar follows these conventions properly.
Comment 1 Alexander Nyßen CLA 2016-12-08 02:10:10 EST
I opened bug #508870 to handle the html string property (not containing escaped newlines) mentioned in comment #1, so we can deal with quoted strings here alone.
Comment 2 Matthias Wienand CLA 2016-12-09 05:57:53 EST
Currently, escaped newlines are handled within DotExecutableUtils#read(InputStream) which is unsufficient for the parsing of attributes (e.g. a "pos" containing a backslash cannot be parsed). To properly handle escaped newlines, removal of the backslash and the newline should be performed within ID#decode(String, Type) when decoding a quoted string.
Comment 3 Alexander Nyßen CLA 2017-01-02 02:27:35 EST
Moved newline concatenation from DotExecutableUtils to ID, where it seems to be more appropriate. What remains to be done here is support for concatenation of quoted strings (using '+') as well as c-preprocessor comments ('#').