Skip to main content



      Home
Home » Newcomers » Newcomers » TMF (Xtext)(how to ignore string in xtext grammar)
TMF (Xtext) [message #1855507] Tue, 18 October 2022 22:27 Go to next message
Eclipse UserFriend
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: Tue, 18 October 2022 22:30] by Moderator

Re: TMF (Xtext) [message #1855509 is a reply to message #1855507] Wed, 19 October 2022 02:05 Go to previous message
Eclipse UserFriend
Best to ask on the Xtext forum:

https://www.eclipse.org/forums/index.php?t=thread&frm_id=27
Previous Topic:Can't install Eclipse
Next Topic:High CPU power after creating a C# project.
Goto Forum:
  


Current Time: Sun Aug 31 12:25:46 EDT 2025

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

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

Back to the top