Skip to main content



      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 06:02 Go to next message
Eclipse UserFriend
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 03:06 Go to previous message
Eclipse UserFriend
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".

Previous Topic:Crossreferencing graphiti resources from xtext grammar
Next Topic:Xtext DSL evolution
Goto Forum:
  


Current Time: Wed Jul 02 06:30:32 EDT 2025

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

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

Back to the top