Skip to main content



      Home
Home » Modeling » TMF (Xtext) » DSL with a free text
DSL with a free text [message #1769897] Fri, 04 August 2017 14:35 Go to next message
Eclipse UserFriend
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 14:50] by Moderator

Re: DSL with a free text [message #1769953 is a reply to message #1769897] Sun, 06 August 2017 23:49 Go to previous message
Eclipse UserFriend
Hi,

the super naive approach does not work for you?

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

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


Previous Topic:Content Assistant in a Xtext custom language
Next Topic:How to override Error Messages
Goto Forum:
  


Current Time: Fri Jul 25 01:28:51 EDT 2025

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

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

Back to the top