Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Modify the STRING Terminal
Modify the STRING Terminal [message #1097131] Thu, 29 August 2013 05:15 Go to next message
Eclipse UserFriend
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 05:18] by Moderator

Re: Modify the STRING Terminal [message #1098341 is a reply to message #1097131] Fri, 30 August 2013 20:31 Go to previous message
Eclipse UserFriend
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: Mon Jul 07 21:39:34 EDT 2025

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

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

Back to the top