Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » TMF (Xtext)(how to ignore string in xtext grammar)
TMF (Xtext) [message #1855507] Wed, 19 October 2022 02:27 Go to next message
vikash singh is currently offline vikash singhFriend
Messages: 6
Registered: September 2019
Junior Member
FeatureList:
        (elements+=Feature)*;
        
    Feature:
        name= NAME';' selection=BooleanConstant ';' *;
    
    BooleanConstant:
        val=BooleanValue;
    
    enum BooleanValue:
        FALSE='FALSE' | TRUE='TRUE';
        
    terminal NAME:'^'?('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')* ;


this is my grammar to parse a file where format is

ActSrv;TRUE;123;
xyz;TRUE;12av;
xyz1;TRUE;abc12;
xyz2;FALSE;123abc;34gh;
xyz3;FALSE;@cb98;xyp;
xyz4;TRUE;;


my requirement is to ignore all string after 2nd ';' or end the matcher and start from new row. but with the current code if there is anything after second column start with string getting stored in new name variable

[Updated on: Wed, 19 October 2022 02:30]

Report message to a moderator

Re: TMF (Xtext) [message #1855509 is a reply to message #1855507] Wed, 19 October 2022 06:05 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 32941
Registered: July 2009
Senior Member
Best to ask on the Xtext forum:

https://www.eclipse.org/forums/index.php?t=thread&frm_id=27


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Can't install Eclipse
Next Topic:High CPU power after creating a C# project.
Goto Forum:
  


Current Time: Mon Oct 02 01:06:43 GMT 2023

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

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

Back to the top