Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » DSL with a free text
DSL with a free text [message #1769897] Fri, 04 August 2017 18:35 Go to next message
Serge Lamikhov is currently offline Serge LamikhovFriend
Messages: 26
Registered: May 2016
Junior Member
Hi,
I am trying to implement a parser for not very formalized DSL that already exists and cannot be modified.
It looks like the following:

~Instruction name: 
VABS16

~Instruction Description:
Vector Absolute 16-bit Word Parts
Other multi line input

~More structured section
Number1 Name1 Args1
Number2 Name2 Args2


Would you please advise how my parser and terminals should be implemented for free text multi line input where tilde starts a new section?
I think that state dependent lexer is required for this purpose. Is it possible to accomplish this within Xtext?

Thank you

[Updated on: Fri, 04 August 2017 18:50]

Report message to a moderator

Re: DSL with a free text [message #1769953 is a reply to message #1769897] Mon, 07 August 2017 03:49 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14075
Registered: July 2009
Senior Member
Hi,

the super naive approach does not work for you?

Model:
	sections+=Section*;
	
Section:
	value=SECTION_VALUE
;

terminal SECTION_VALUE 	:
	'~' !('~')*
;




Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Content Assistant in a Xtext custom language
Next Topic:How to override Error Messages
Goto Forum:
  


Current Time: Sat Oct 16 19:25:37 GMT 2021

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

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

Back to the top