Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Formatting Scientific Notation (Formatting Scientific Notation Across Files)
Formatting Scientific Notation [message #1791673] Tue, 03 July 2018 18:52 Go to next message
Eclipse UserFriend
Grammar A:
import "http://www.eclipse.org/emf/2002/Ecore" as ecore

Hold:
name=ID
scinots+=(SCIENTIFICNOTATION)
tests+=test;

SCIENTIFICNOTATION returns ecore::EDouble:
DOUBLE (('e'|'E') ('+'|'-')? INT)?;

DOUBLE returns ecore::EDouble:
('-')? INT ('.' INT)?;

Grammar B

RuleA:
'number' value=SCIENTIFICNOTATION;


when I write a formatter for File b: how would I format value if it was entered as number 1. 5 e-5
and I wanted it to be number 1.5 e-5

It is difficult to see or notice above, but what I want is no space around the period, if a decimal is used

[Updated on: Tue, 03 July 2018 19:13] by Moderator

Re: Formatting Scientific Notation [message #1791678 is a reply to message #1791673] Wed, 04 July 2018 00:17 Go to previous messageGo to next message
Eclipse UserFriend
Hi what is your actual question? parsing? formatting?

https://stackoverflow.com/questions/50904789/formatting-string-content-xtext-2-14/50912579#50912579

[Updated on: Wed, 04 July 2018 00:46] by Moderator

Re: Formatting Scientific Notation [message #1791909 is a reply to message #1791678] Fri, 06 July 2018 13:28 Go to previous message
Eclipse UserFriend
It is formatting, the link you posted is very helpful, thanks!
Previous Topic:Problems using AbstractLanguageServerTest
Next Topic:RPGLE - String Literal Parsing
Goto Forum:
  


Current Time: Thu Jun 19 11:23:21 EDT 2025

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

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

Back to the top