INT terminal rule for negative values [message #907988] |
Tue, 04 September 2012 10:00  |
Eclipse User |
|
|
|
Hi,
is there a way to use negative values with the builtin terminal rule 'INT'? It only seems to accept numbers without a leading minus.
I can build something like this:
SignedInt:
sign=('-')? value=INT
;
But this does not behave very intuitively in ContentAssist, and the sign has to be parsed manually.
So, is there a better way to do that?
|
|
|
|
Re: INT terminal rule for negative values [message #909036 is a reply to message #908859] |
Thu, 06 September 2012 08:52  |
Eclipse User |
|
|
|
That works fine. Thank you.
To get the contentAssist to propose something one needs to add this to ProposalProvider:
public void complete_SignedInt(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
complete_INT(model, ruleCall, context, acceptor);
}
|
|
|
Powered by
FUDForum. Page generated in 0.04538 seconds