Different prefix for Special Character in RuleCall [message #1725260] |
Wed, 02 March 2016 08:10 |
pranay roy Messages: 196 Registered: January 2016 |
Senior Member |
|
|
MY Grammar has definition of string as
Model:
greetings=Query;
Query:
(key=QTypekeyWord)? (aggregation=Aggregation)?(measure=MeasureList);
QTypekeyWord:
qKeyword='plot'
;
MeasureList : names+=Measure ("and" names+=Measure)*;
EinString:ID |SPECIAL;
SPECIAL:
('/' | ';' | ',' | '!' | '§' | '%' | '&' | '(' | ')' | '?' | '*' | '+' | '.' | '-' | '|' | '[' | ']' | '#' | '@' |'{'|'}' |'$' |'^' |'~' |INT |':');
Measure:EinString+;
the value of prefix is different .
For
plot profit a --->prefix ="profit a"
for
plot profit # ----> preifix =""
For the second case ,I expect the prefix to be "profit #" and not "".Please suggest if I am missing something.
At these places I am checking prefix value.
override protected def dispatch void createProposals(Keyword keyword, ContentAssistContext context,
IIdeContentProposalAcceptor acceptor) {
if(filterKeyword(keyword, context)) {
var userTypedText= context.getRootNode.getText
var prefix=context.prefix
and
override dispatch createProposals(RuleCall ruleCall, ContentAssistContext context,
IIdeContentProposalAcceptor acceptor) {
[b] val prefix= context.prefix[/b]
[Updated on: Wed, 02 March 2016 08:12] Report message to a moderator
|
|
|
|
|
|
|
|
Re: Different prefix for Special Character in RuleCall [message #1725295 is a reply to message #1725287] |
Wed, 02 March 2016 10:10 |
|
hi i still do not get your question
please use in your code the following code and debug
class MyDslProposalProvider extends IdeContentProposalProvider {
override createProposals(Collection<ContentAssistContext> contexts, IIdeContentProposalAcceptor acceptor) {
for (c : contexts) {
for (element : c.firstSetGrammarElements) {
println("!!!!"+c.prefix+" " + element)
}
}
super.createProposals(contexts, acceptor)
}
}
you have many contexts since your grammar allows multiple stuff
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05297 seconds