Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 286724 - Add support for comment exploitation
Summary: Add support for comment exploitation
Status: CLOSED FIXED
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: 1.3.0   Edit
Hardware: PC Windows Vista
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: OCL Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-16 06:19 EDT by Ed Willink CLA
Modified: 2011-05-27 02:47 EDT (History)
2 users (show)

See Also:


Attachments
Patch to support comment lexing (959 bytes, patch)
2009-08-16 06:20 EDT, Ed Willink CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2009-08-16 06:19:18 EDT
Comments look better when distinctively colored in an editor.

LPG provides support for this, provided the comments are parsed as adjuncts (an auxiliary style of token adjoining real tokens).

OCLLexer.g suppresses this support by invoking skipToken() for parsed comments.

The attached patch creates adjuncts for comments allowing any tool that exploits the parser stream representation to locate the comments as Adjunct objects.

Impact: no functional change to existing use, a small execution time/memory cost proportionate to usage with comments. Existing small snippet usage is unlikely to use comments at all. Full scale document usage may welcome comments and should not find the cost significant.

Derived applications can use a derived OCLLexer that reimplements makeComment as skipToken.
Comment 1 Ed Willink CLA 2009-08-16 06:20:53 EDT
Created attachment 144624 [details]
Patch to support comment lexing

Another try at attaching the patch.
Comment 2 Adolfo Sanchez-Barbudo Herrera CLA 2009-08-28 11:49:14 EDT
Simple and useful change for the editor, why no +1ing ? ;P

Cheers,
Adolfo.

Comment 3 Laurent Goubet CLA 2009-08-28 11:55:20 EDT
'cause I didn't see this one ^^ +1 :)
Comment 4 Adolfo Sanchez-Barbudo Herrera CLA 2009-08-28 12:43:28 EDT
Ed,

One more thing, shouldn't the generated Lexer's classes also be included ?.

Cheers,
Adolfo.

Comment 5 Ed Willink CLA 2009-08-28 14:01:43 EDT
The patch is so trivial, it's probably easier to deliver it with bug 242153.
Comment 6 Ed Willink CLA 2009-08-28 16:41:19 EDT
Committed to HEAD.
Comment 7 Ed Willink CLA 2011-05-27 02:47:08 EDT
Closing after over 18 months in resolved state.