Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Getting rid of syntactic predicates
Getting rid of syntactic predicates [message #553950] Thu, 19 August 2010 14:02
Frederic Beister is currently offline Frederic BeisterFriend
Messages: 4
Registered: August 2010
Junior Member
Hi!

I wrote an ANTLR-Parser for a language that resembles FunnelWeb (Literate Programming language). It's about embedding code snippets that can reference each other into a Documentation file and create documentation and code out of it. Small example:

This is documentation ... now we start a macro:
@{(m1) this is the text for the macro called m1 @}

now we want to have the at-sign in the documentation, so we change the special symbol
@=~ now we can start macros with that new special character
~{(m2) this is macro m2 calling macro m1 ~&(m1) - here we need the tilde so we change the special character back ~=@ @}


one could now ask for m2 and get
this is macro m2 calling macro m1  this is the text for the macro called m1 - here we need the tilde so we change the special character back


I already wrote an ANTLR3-lexer that can handle the changing of special characters through predicates. Is there any way to accomplish this functionality directly in XText without replacing the lexer (which I already tried - seems to pass the lexing and parsing correctly, but the UI-behavior is a bit unstable after that).

btw: I added dummy-literals to the .xtext file and replaced the literal rules in InternalLexer.g after the MWE2 run. Is that the way to do it?

I can still change the language to my needs - already thought about XML-like syntax but that would require escaping of unwanted special characters which I don't really want.

Thanks in advance
Frederic
Previous Topic:Comparison of back references from external elements fail
Next Topic:Processing Xtext Models?
Goto Forum:
  


Current Time: Thu Apr 25 13:25:01 GMT 2024

Powered by FUDForum. Page generated in 0.03259 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top