Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Modify the STRING Terminal
Modify the STRING Terminal [message #1097131] Thu, 29 August 2013 09:15 Go to next message
georges.chaudyskyscanner.net Georges is currently offline georges.chaudyskyscanner.net GeorgesFriend
Messages: 5
Registered: August 2013
Junior Member
Hello

I am trying to write a grammar allowing :
"hello <TAG> world"
<TAG> could be anything

I was planning to start by updating the STRING terminal like that:
terminal STRING : '"' !('"'|'<') )* '"' ;

Generation of the XText artifacts works fine,
but I am getting the following error in "parser.antlr.internal.internalMyDSLexer.java"

The code of method specialStateTransition(int, IntStream) is exceeding the 65535 bytes limit.

Any idea?

[Updated on: Thu, 29 August 2013 09:18]

Report message to a moderator

Re: Modify the STRING Terminal [message #1098341 is a reply to message #1097131] Sat, 31 August 2013 00:31 Go to previous message
Ian McDevitt is currently offline Ian McDevittFriend
Messages: 70
Registered: December 2012
Location: Belfast
Member
Do you mean <TAG> could be anything except '<' or anything except double quotes? A normal STRING can already match almost anything in quotes.

Correcting the unmatched ( in your example,
terminal STRING	: '"' (!('"'|'<') )* '"' ;

you're asking it to match double quotes, then any chars which are not double quotes or '<'. So when it finds '<' it ends the optional ( )* sequence but then you expect it to see a double quote - but of course it has the '<' so it will never match properly.

Previous Topic:Inferred enum issue
Next Topic:Injecting an IParser (yes, again...)
Goto Forum:
  


Current Time: Fri Apr 26 03:45:27 GMT 2024

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

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

Back to the top