Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Rule to ignore a whole line of text(I need a rule that detects a line beginning with a word that I haven't specified and ignore it.)
Rule to ignore a whole line of text [message #1780256] Fri, 19 January 2018 11:02 Go to next message
James Hayes is currently offline James HayesFriend
Messages: 1
Registered: January 2018
Junior Member
I have the following grammar:


Model:
entities+=Entity*
;

Entity:

'.title=' Title=STRING ';'
entries+=Entry*
;

Entry:

(A | B |C| D)
;

A:
'.a=' name=STRING ';'
;

B:
'.b=' name=STRING ';'
;

C:
'.c=' name=STRING ';'
;

D:
'.d=' name=STRING ';'
;


What I want is to detect any lines that do not begin with those strings and ignore the entire line up until the line ending ';'.


Thanks very much.
Re: Rule to ignore a whole line of text [message #1780936 is a reply to message #1780256] Tue, 30 January 2018 08:06 Go to previous message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
You could try to define your own terminal rules that include the linebreaks.
You don't want to inherit from "Terminals".
You may want to use "hidden".



---
Get professional support from the Xtext committers at www.typefox.io
Previous Topic:Crossreferencing graphiti resources from xtext grammar
Next Topic:Xtext DSL evolution
Goto Forum:
  


Current Time: Thu Apr 25 12:52:12 GMT 2024

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

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

Back to the top