Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Xtext: How to active hyperlink?(Xtext: How to active hyperlink?)
Xtext: How to active hyperlink? [message #1741010] Mon, 22 August 2016 07:25 Go to next message
Eclipse UserFriend
Hi,

Can anybody tell me how to activate hyperlink for mydsl editor?
Re: Xtext: How to active hyperlink? [message #1741012 is a reply to message #1741010] Mon, 22 August 2016 07:28 Go to previous messageGo to next message
Eclipse UserFriend
dont get this question. hyperlinking is on by default (crtl+click / f3)
Re: Xtext: How to active hyperlink? [message #1741014 is a reply to message #1741012] Mon, 22 August 2016 07:31 Go to previous messageGo to next message
Eclipse UserFriend
Yes. (crtl+click / f3) or ctrl+mouseclick. I read the document but I could not understand. Could you please provide any help?
Re: Xtext: How to active hyperlink? [message #1741018 is a reply to message #1741014] Mon, 22 August 2016 07:42 Go to previous messageGo to next message
Eclipse UserFriend
please describe your problem
Re: Xtext: How to active hyperlink? [message #1741019 is a reply to message #1741010] Mon, 22 August 2016 07:47 Go to previous messageGo to next message
Eclipse UserFriend
Hyperlinking is only active for cross-references. Maybe a stupid question, but does your DSL have cross-references?
Re: Xtext: How to active hyperlink? [message #1741028 is a reply to message #1741019] Mon, 22 August 2016 08:56 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I am new to xtext. I have cross-references in my grammar. But in my editor if I do ctrl+mouse click it is not going to that method.
Re: Xtext: How to active hyperlink? [message #1741029 is a reply to message #1741028] Mon, 22 August 2016 08:57 Go to previous messageGo to next message
Eclipse UserFriend
If possible can you please provide an example for cross referencing?
Re: Xtext: How to active hyperlink? [message #1741033 is a reply to message #1741029] Mon, 22 August 2016 09:21 Go to previous messageGo to next message
Eclipse UserFriend
https://www.eclipse.org/Xtext/documentation/102_domainmodelwalkthrough.html
Re: Xtext: How to active hyperlink? [message #1741039 is a reply to message #1741033] Mon, 22 August 2016 09:55 Go to previous messageGo to next message
Eclipse UserFriend
Hi Christian,

I have written below code:

class JPLLinkHelper extends HyperlinkHelper {

override public void createHyperlinksByOffset(XtextResource resource, int offset,IHyperlinkAcceptor acceptor) {

val INode node = NodeModelUtils.findLeafNodeAtOffset(resource.getParseResult().getRootNode(), offset);
val EObjectAtOffsetHelper eObjectAtOffsetHelper = new EObjectAtOffsetHelper();
val EObject eObject = eObjectAtOffsetHelper.resolveElementAt(resource, offset);

if (eObject instanceof JPLIDImpl) {

val JPLIDImpl variableName = eObject as JPLIDImpl;
val CompositeNode adapter = NodeModelUtils.getNode(variableName) as CompositeNode;

val Region region = new Region(adapter.getOffset(), adapter.getLength());

val URIConverter uriConverter = resource.getResourceSet().getURIConverter();
val String hyperlinkText = "ID";
val JPLIDImpl iimport = node.getSemanticElement() as JPLIDImpl;
val String uriString = iimport.getImportURI();
val URI uri = EcoreUtil.getURI(uriString);
val URI normalized = uri.isPlatformResource() ? uri : uriConverter.normalize(uri);

val XtextHyperlink result = new XtextHyperlink(); // Does not show link with getHyperlinkProvider().get()
result.setHyperlinkRegion(region);
result.setURI(normalized);
result.setHyperlinkText(hyperlinkText);
acceptor.accept(result);
}
}
}

How can I get target uri?
Re: Xtext: How to active hyperlink? [message #1741040 is a reply to message #1741039] Mon, 22 August 2016 09:58 Go to previous messageGo to next message
Eclipse UserFriend
EcoreUtil.getUri(object)

i have no idea what and why you need to do anything at all.

val EObject eObject = eObjectAtOffsetHelper.resolveElementAt(resource, offset); should already done everything (in the default impl)
Re: Xtext: How to active hyperlink? [message #1741068 is a reply to message #1741040] Mon, 22 August 2016 12:03 Go to previous messageGo to next message
Eclipse UserFriend
I just copied it from google.

Now all after I am getting error when I clicking on hyperlink
java.lang.NullPointerException
at org.eclipse.xtext.ui.editor.hyperlinking.XtextHyperlink.open(XtextHyperlink.java:27)
at org.eclipse.jface.text.hyperlink.HyperlinkManager.mouseUp(HyperlinkManager.java:436)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:140)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:611)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)

why this error?

[Updated on: Mon, 22 August 2016 12:03] by Moderator

Re: Xtext: How to active hyperlink? [message #1741069 is a reply to message #1741068] Mon, 22 August 2016 12:11 Go to previous messageGo to next message
Eclipse UserFriend
you should create the hyperlink not with new. otherwise injection will not work.
here is what the default impl does

@Inject
private Provider<XtextHyperlink> hyperlinkProvider;

.....

XtextHyperlink result = hyperlinkProvider.get();
Re: Xtext: How to active hyperlink? [message #1741127 is a reply to message #1741069] Tue, 23 August 2016 05:02 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Christian. It is working.
Re: Xtext: How to active hyperlink? [message #1741463 is a reply to message #1741127] Thu, 25 August 2016 07:12 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Why this code is not going to its reference?

class JPLLinkHelper extends HyperlinkHelper {
@Inject
private Provider<XtextHyperlink> hyperlinkProvider;
override public void createHyperlinksByOffset(XtextResource resource, int offset,IHyperlinkAcceptor acceptor) {

val EObjectAtOffsetHelper eObjectAtOffsetHelper = new EObjectAtOffsetHelper()
val EObject eObject = eObjectAtOffsetHelper.resolveElementAt(resource, offset)
if (eObject instanceof JPLIDImpl) {

val JPLIDImpl variableName = eObject as JPLIDImpl;

val CompositeNode adapter = NodeModelUtils.getNode(variableName) as CompositeNode;

val Region region = new Region(adapter.getOffset(), adapter.getLength());

val URIConverter uriConverter = resource.getResourceSet().getURIConverter();

val String hyperlinkText = "ID";

val URI uri = EcoreUtil.getURI(eObject)
var URI normalized
if(uri.isPlatformResource()) {
normalized = uri
} else {
normalized = uriConverter.normalize(uri)
}

val XtextHyperlink result = hyperlinkProvider.get();
result.setHyperlinkRegion(region);
result.setURI(normalized);
result.setHyperlinkText(hyperlinkText);
acceptor.accept(result);
}
}
}

It is showing hyperlinks but not moving to its reference.

[Updated on: Thu, 25 August 2016 07:15] by Moderator

Re: Xtext: How to active hyperlink? [message #1741466 is a reply to message #1741463] Thu, 25 August 2016 07:53 Go to previous messageGo to next message
Eclipse UserFriend
first i still do not understand why you do that at all. this should work out of the box if you dont have wired stuff in your grammar.
then how does the uri look like you calculate? are you sure it points to the target you wish? hoiw does the grammar potion for that look like?
Re: Xtext: How to active hyperlink? [message #1741469 is a reply to message #1741466] Thu, 25 August 2016 08:27 Go to previous messageGo to next message
Eclipse UserFriend
Yes it is pointing the target.
It showed me offset: 109, and reference. But not moving to the reference

[Updated on: Thu, 25 August 2016 08:28] by Moderator

Re: Xtext: How to active hyperlink? [message #1741472 is a reply to message #1741469] Thu, 25 August 2016 09:04 Go to previous messageGo to next message
Eclipse UserFriend
please give me more context.
Re: Xtext: How to active hyperlink? [message #1741474 is a reply to message #1741472] Thu, 25 August 2016 09:08 Go to previous messageGo to next message
Eclipse UserFriend
More context means?
Re: Xtext: How to active hyperlink? [message #1741476 is a reply to message #1741474] Thu, 25 August 2016 09:14 Go to previous messageGo to next message
Eclipse UserFriend
grammar at the place com completions.
how does the uri look like?
Re: Xtext: How to active hyperlink? [message #1741477 is a reply to message #1741476] Thu, 25 August 2016 09:21 Go to previous messageGo to next message
Eclipse UserFriend
URI ::::::::::: platform:/resource/Panther/Sample.lib/src/s1111b.jpl#//@statements.1/@exp.0/@JPLID

Grammar:

Variables: name=('vars'|'global') ((exp+=Expression) (','? ('vars'|'global')? (exp+=Expression))*) ','?;

Expression:
LogicalOr
;
LogicalOr returns Expression:
BitwiseOr ({LogicalOr.left=current} '||' right=BitwiseOr)*
;
BitwiseOr returns Expression:
LogicalAnd ({BitwiseOr.left=current} '|' right=LogicalAnd)*
;
LogicalAnd returns Expression:
BitwiseAnd ({LogicalAnd.left=current} '&&' right=BitwiseAnd)*
;
BitwiseAnd returns Expression:
Equivalency ({BitwiseAnd.left=current} '&' right=Equivalency)*
;
Equivalency returns Expression:
Relational ({Equivalency.left=current} ('=='|'!='|'=') right=Relational)*
;
Relational returns Expression:
PlusMinus ({Relational.left=current} ('>='|'<='|'>'|'<') right=PlusMinus)*
;
PlusMinus returns Expression:
//DivMult ({PlusMinus.left=current} ('+'|'-') right=DivMult)*
DivMult | ({PlusMinus} ('-'|'+') expr=DivMult)
;
DivMult returns Expression:
LogicalNot ({DivMult.left=current} ('/'|'*') right=LogicalNot)*
;
LogicalNot returns Expression:
OnesComplement | ({LogicalNot} '!' expr=OnesComplement)
;
OnesComplement returns Expression:
Exponentiation ({OnesComplement.left=current} ('~') right=Exponentiation)*
;
Exponentiation returns Expression:
ColonOperator ({Exponentialtion.left=current} '^' right=ColonOperator)*
;
ColonOperator returns Expression:
PercentOperator | ({ColonOperator} (':'('+')?) expr=PercentOperator)
;
PercentOperator returns Expression:
ArrowExpression | ({PercentOperator} ('%'|'%t'|'%.'|'%:') expr=ArrowExpression)
;
ArrowExpression returns Expression:
Concatenation | ({ArrowExpression} ('->') expr=Concatenation)
;
//SignedNumber returns Expression:
// Concatenation | ({SignedNumber} ('-'|'+') expr=Concatenation)
//;
Concatenation returns Expression:
Primary ({Concatenation.left=current} '##' right=Primary)*
;
Primary returns Expression: {Expression}
Annotation=Annotation| Widget=Widget | lengthNew=lengthNew | Date=Date | ScreenNum=ScreenNum | FieldNum=FieldNum | JPLID=JPLID | Sm_library=Sm_library|Dm_library=Dm_library|
NUMBER=NUMBER | STRING=STRING | RANGE=RANGE | Sum=Sum | Ldb=Ldb | IdObject=IdObject | TpReq=TpReq |
('[' LogicalOr+=LogicalOr (','? LogicalOr+=LogicalOr)* ']') |
('(' (LogicalOr+=LogicalOr (','? LogicalOr+=LogicalOr)*)? ')') |
('{' LogicalOr+=LogicalOr (','? LogicalOr+=LogicalOr)* '}')
;
Re: Xtext: How to active hyperlink? [message #1741478 is a reply to message #1741477] Thu, 25 August 2016 09:29 Go to previous messageGo to next message
Eclipse UserFriend
and how does the model look like you do the hyperlinking at

from the grammar JPLID does not look like a cross reference (grammar not complete)
Re: Xtext: How to active hyperlink? [message #1741492 is a reply to message #1741478] Thu, 25 August 2016 10:14 Go to previous messageGo to next message
Eclipse UserFriend
JPLID is part of expression right? It is not cross reference?
Re: Xtext: How to active hyperlink? [message #1741493 is a reply to message #1741492] Thu, 25 August 2016 10:20 Go to previous messageGo to next message
Eclipse UserFriend
You did not post that part of the grammar.
What is the specific grammar element you execute the hyperlink at
Re: Xtext: How to active hyperlink? [message #1741497 is a reply to message #1741493] Thu, 25 August 2016 10:23 Go to previous messageGo to next message
Eclipse UserFriend
My complete grammar is attached.

My code seems ambiguous but syntax of my language is of that kind. I tried many ways o sharpen my grammar but no luck

[Updated on: Thu, 25 August 2016 10:25] by Moderator

Re: Xtext: How to active hyperlink? [message #1741499 is a reply to message #1741497] Thu, 25 August 2016 10:28 Go to previous messageGo to next message
Eclipse UserFriend
sad to tell, but you have exactly ZERO 0 .... cross references
Re: Xtext: How to active hyperlink? [message #1741508 is a reply to message #1741499] Thu, 25 August 2016 10:41 Go to previous messageGo to next message
Eclipse UserFriend
Can you please provide an example?
Re: Xtext: How to active hyperlink? [message #1741511 is a reply to message #1741508] Thu, 25 August 2016 10:45 Go to previous messageGo to next message
Eclipse UserFriend
myref=[ReferencedType|RuleToParseAtThatPlace]

e.g. entityRef=[Entity|ID] or short entityRef=[Entity]
Re: Xtext: How to active hyperlink? [message #1741522 is a reply to message #1741511] Thu, 25 August 2016 11:03 Go to previous messageGo to next message
Eclipse UserFriend
Is cross reference is correct for below?

Statement:
Variables|Expression|JPLID
;
Variables: name='vars' refName=[JPLID];

JPLID: (name=ID);

Expression:
LogicalOr
;
LogicalOr returns Expression:
BitwiseOr ({LogicalOr.left=current} '||' right=BitwiseOr)*
;
BitwiseOr returns Expression:
LogicalAnd ({BitwiseOr.left=current} '|' right=LogicalAnd)*
;
LogicalAnd returns Expression:
BitwiseAnd ({LogicalAnd.left=current} '&&' right=BitwiseAnd)*
;
BitwiseAnd returns Expression:
Equivalency ({BitwiseAnd.left=current} '&' right=Equivalency)*
;
Equivalency returns Expression:
Relational ({Equivalency.left=current} ('=='|'!='|'=') right=Relational)*
;
Relational returns Expression:
PlusMinus ({Relational.left=current} ('>='|'<='|'>'|'<') right=PlusMinus)*
;
PlusMinus returns Expression:
//DivMult ({PlusMinus.left=current} ('+'|'-') right=DivMult)*
DivMult | ({PlusMinus} ('-'|'+') expr=DivMult)
;
DivMult returns Expression:
LogicalNot ({DivMult.left=current} ('/'|'*') right=LogicalNot)*
;
LogicalNot returns Expression:
OnesComplement | ({LogicalNot} '!' expr=OnesComplement)
;
OnesComplement returns Expression:
Exponentiation ({OnesComplement.left=current} ('~') right=Exponentiation)*
;
Exponentiation returns Expression:
ColonOperator ({Exponentialtion.left=current} '^' right=ColonOperator)*
;
ColonOperator returns Expression:
PercentOperator | ({ColonOperator} (':'('+')?) expr=PercentOperator)
;
PercentOperator returns Expression:
ArrowExpression | ({PercentOperator} ('%'|'%t'|'%.'|'%:') expr=ArrowExpression)
;
ArrowExpression returns Expression:
Concatenation | ({ArrowExpression} ('->') expr=Concatenation)
;
//SignedNumber returns Expression:
// Concatenation | ({SignedNumber} ('-'|'+') expr=Concatenation)
//;
Concatenation returns Expression:
Primary ({Concatenation.left=current} '##' right=Primary)*
;
Primary returns Expression: {Expression}
NUMBER=NUMBER | STRING=STRING
;

//GSD returns Expression: JPLID {GSD.left=current} ('[' occurence=(NUMBER|STRING) ']')?('(' m=NUMBER (',' (n=NUMBER))? ')')? '->' right=JPLID;

terminal DBMS: ('DBMS'|'Dbms'|'dbms') (('\\'((' '|'\t')* '\r'? '\n')) | !('\n' | '\r'))*;

terminal ID : ('a'..'z'|'A'..'Z'|'$'|'.'|'@'|'_')('a'..'z'|'A'..'Z'|'$'|'.'|'0'..'9'|'@'|'*'|'_')*;

terminal STRING : '"' ( '\\'('"'|('\r'? '\n')) | !('\n'|'"') )* '"' |
"'" ( '\\'("'"|('\r'? '\n')) | !('\n'|"'") )* "'";

terminal SL_COMMENT: '//' !('\n' | '\r')*;

terminal HASH_COMMENT : ('#'('\r'? '\n')?) | ('#' !('#'|'\n'|'\r')+ ('\r'? '\n')?) | (('#''#''#') !('\n'|'\r')* ('\r'? '\n')?);

terminal WS : (' '|'\t'| ('\\'((' '|'\t')* '\r'? '\n')))+;

//terminal NL : ('\r'? '\n')+;

terminal NUMBER: (OCTAL|FLOAT|INT|BINARY|HEX);

terminal OCTAL returns ecore::EInt: ('0') ('0'..'7')+;

terminal FLOAT returns ecore::EFloat: ('0'..'9' ('0'..'9')*) '.' ('0'..'9')*;

terminal INT returns ecore::EInt: '0'..'9' ('0'..'9')*;

terminal RANGE: '0'..'9' '..' ('0'..'9')*;

terminal BINARY returns ecore::EInt: ('0b'|'0B') ('0'|'1')+;

terminal HEX returns ecore::EInt:('0x'|'0X')('0'..'9'|'a'..'f'|'A'..'F')+;
Re: Xtext: How to active hyperlink? [message #1741534 is a reply to message #1741522] Thu, 25 August 2016 12:47 Go to previous messageGo to next message
Eclipse UserFriend
on a first sight yes
Re: Xtext: How to active hyperlink? [message #1741540 is a reply to message #1741534] Thu, 25 August 2016 13:36 Go to previous messageGo to next message
Eclipse UserFriend
Ok but

when I ckick on variable name it is not going to location.

My code in editor is

vars myvalue=null

myvalue = "test"

When I click on F3 at myvalue it is not taking me to vars myvalue.

My code in Hyperlink helper is:

class JPLLinkHelper extends HyperlinkHelper {
@Inject
private Provider<XtextHyperlink> hyperlinkProvider;
override public void createHyperlinksByOffset(XtextResource resource, int offset,IHyperlinkAcceptor acceptor) {

val EObjectAtOffsetHelper eObjectAtOffsetHelper = new EObjectAtOffsetHelper()
val EObject eObject = eObjectAtOffsetHelper.resolveElementAt(resource, offset)
if (eObject instanceof JPLIDImpl) {

val JPLIDImpl variableName = eObject as JPLIDImpl;

val CompositeNode adapter = NodeModelUtils.getNode(variableName) as CompositeNode;

val Region region = new Region(adapter.getOffset(), adapter.getLength());
println("Region ::::::: "+region)
val URIConverter uriConverter = resource.getResourceSet().getURIConverter();

val String hyperlinkText = "ID";

val URI uri = EcoreUtil.getURI(eObject)
println("URI ::::::::::: "+uri)
var URI normalized
if(uri.isPlatformResource()) {
normalized = uri
} else {
normalized = uriConverter.normalize(uri)
}

val XtextHyperlink result = hyperlinkProvider.get(); // Does not show link with getHyperlinkProvider().get()
result.setHyperlinkRegion(region);
result.setURI(normalized);
result.setHyperlinkText(hyperlinkText);
acceptor.accept(result);
}
}
}

Could you please tell me is there any thing wrong in my code?
Re: Xtext: How to active hyperlink? [message #1741545 is a reply to message #1741540] Thu, 25 August 2016 13:54 Go to previous messageGo to next message
Eclipse UserFriend
I don't see in your big grammar how that model fits to the grammar.
This is once more caused by you always posting that big grammar instead of creating a small example reproducing the Problem
This helps neither me Nor you to Unterstand and solve the Problem


I would inspect a grammar like

Thing: "vars" name=ID "=" value=Expression;

Assignment : left=[Thing] "=" right=Expression

What does happen if you simply use the default impl?

Re: Xtext: How to active hyperlink? [message #1741607 is a reply to message #1741545] Fri, 26 August 2016 05:38 Go to previous messageGo to next message
Eclipse UserFriend
Yes, I got the solution.

My grammar:

Model:
greetings+=Statements*;

Statements:
Greeting|Definition|Usage
;

Greeting:
'Hello' name=ID '!';

Definition:
"define" name=ID
;

Usage:
"use" usage=[Definition]
;

class MyDslUiModule extends AbstractMyDslUiModule {

def Class<? extends DefaultHyperlinkDetector> bindDefaultHyperlinkDetector() {
return JPLLinkDetector;
}

def Class<? extends IHyperlinkHelper> bindIHyperlinkHelper() {
return JPLLinkHelper;
}
}

public class JPLLinkDetector extends DefaultHyperlinkDetector {
override public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultiplehyperlinks) {
//this.setHelper(new MyDslLinkHelper());
return super.detectHyperlinks(textViewer, region, canShowMultiplehyperlinks);
}
}

class JPLLinkHelper extends HyperlinkHelper {

}

But When I am using in editor like :

defintion test

use test

working fine but when I am using

definition test

use mytest

it is showing error like index.php/fa/26884/0/
Re: Xtext: How to active hyperlink? [message #1741608 is a reply to message #1741607] Fri, 26 August 2016 05:44 Go to previous messageGo to next message
Eclipse UserFriend
that is an actual feature. you cannot use (reference) something that is not there.
this is why you get an error about an "unresolved" cross reference.
Re: Xtext: How to active hyperlink? [message #1741609 is a reply to message #1741608] Fri, 26 August 2016 05:48 Go to previous messageGo to next message
Eclipse UserFriend
how to solve this kind of issue?
Re: Xtext: How to active hyperlink? [message #1741611 is a reply to message #1741609] Fri, 26 August 2016 06:03 Go to previous messageGo to next message
Eclipse UserFriend
what is your semantic

if you have

definition test

use mytest

where should mytest point to ?!?
Re: Xtext: How to active hyperlink? [message #1741613 is a reply to message #1741611] Fri, 26 August 2016 06:20 Go to previous messageGo to next message
Eclipse UserFriend
yes yes I understood. I am trying to call a method actually it is not defined. That is how reference works.
Re: Xtext: How to active hyperlink? [message #1741620 is a reply to message #1741613] Fri, 26 August 2016 07:04 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
I have written grammar like:

Call: 'call' ref=[Proc];

Proc: ('string'|'double')? ('proc') name=ID('('exp+=Expression (','? exp+=Expression)')'*)?;

In editor:
I have code like

proc test(a+1,b+2,c+3)

call test(a+1,b+2,c+3) is throwing an error extraneous input '(' expecting RULE_ID

but

call test

is working fine. Could you please tell me what's the problem?
Re: Xtext: How to active hyperlink? [message #1741622 is a reply to message #1741620] Fri, 26 August 2016 07:07 Go to previous messageGo to next message
Eclipse UserFriend
Call: 'call' ref=[Proc]('('exp+=Expression (','? exp+=Expression)')'*)?; solved the problem
Re: Xtext: How to active hyperlink? [message #1741623 is a reply to message #1741620] Fri, 26 August 2016 07:07 Go to previous messageGo to next message
Eclipse UserFriend
from a parser point of view your grammar looks like

Call: 'call' nameOfTheProc=ID;

mabye you want to have

Call: 'call' ref=[Proc] '(' (params+=Expression (","params+=Expression )*)? ')'
or something like that?
Re: Xtext: How to active hyperlink? [message #1741631 is a reply to message #1741623] Fri, 26 August 2016 08:42 Go to previous message
Eclipse UserFriend
yes I did
Previous Topic:ProposalProvider in IDEA
Next Topic:xtext cross-reference from another location
Goto Forum:
  


Current Time: Wed Jul 23 15:45:48 EDT 2025

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

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

Back to the top