Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Does xbase work?
Does xbase work? [message #514799] Tue, 16 February 2010 06:50 Go to next message
Eclipse UserFriend
I found xbase in the cvs repository.

I wonder if that is a good example or if it is just
dead code. There is a file called
org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/example. xbase_example
which has some errors in the xbase editor.

What's going wrong here?

Michael
--
Michael Scharf
Wind River Systems GmbH
http://www.WindRiver.com
http://MichaelScharf.blogspot.com/
Re: Does xbase work? [message #514820 is a reply to message #514799] Tue, 16 February 2010 08:12 Go to previous messageGo to next message
Eclipse UserFriend
Hi Michael,

Xbase is currently under development and subject to frequent changes.
The example file does not reflect the latest version - it is used to
discuss different syntax variants internally and may be not in sync with
the actual code.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 16.02.10 17:43, schrieb Michael Scharf:
> I found xbase in the cvs repository.
>
> I wonder if that is a good example or if it is just
> dead code. There is a file called
> org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/example. xbase_example
> which has some errors in the xbase editor.
>
> What's going wrong here?
>
> Michael
Re: Does xbase work? [message #514871 is a reply to message #514820] Tue, 16 February 2010 18:25 Go to previous messageGo to next message
Eclipse UserFriend
On 2010-02-16 18:44, Sebastian Zarnekow wrote:
> Hi Michael,
>
> Xbase is currently under development and subject to frequent changes.
> The example file does not reflect the latest version - it is used to
> discuss different syntax variants internally and may be not in sync with
> the actual code.

One of the problems we found with xbase.Xpression is:
XFeatureCall returns XExpression :
XPrimaryExpression
({XFeatureCall.target=current} "." name=ID ('('(params+=XExpression (','params+=XExpression )*)?')')?)*
;

if you have
a.b.c.d.e
the expression tree is reversed (you can see this in the outline)
e
d
c
b
a

This makes it quite hard to write a scope provider.

Maybe there is a trick to use this tree to provide
a scope provider. But we could not figure out how
to create a scope provider for this and since
xbase has no scope providers at all we are still looking
for a solution.....

we rewrote the grammar to something like
XFeatureCall returns XExpression :
{XFeature} target=XPrimaryExpression members+=XMember*
;

XMember returns XExpression:
{XMember} "." name=ID
| {XFunctionCall} "." name=ID '('(params+=XExpression (','params+=XExpression )*)?')'
| {XIndex} '[' params+=XExpression (','params+=XExpression )* ']'
;

It does not give us a tree but it puts the a.b.c.d.e in a list in
the right order....

Michael

--
Michael Scharf
Wind River Systems GmbH
http://www.WindRiver.com
http://MichaelScharf.blogspot.com/
Re: Does xbase work? [message #515047 is a reply to message #514871] Wed, 17 February 2010 04:56 Go to previous messageGo to next message
Eclipse UserFriend
Michael Scharf schrieb:
> On 2010-02-16 18:44, Sebastian Zarnekow wrote:
>> Hi Michael,
>>
>> Xbase is currently under development and subject to frequent changes.
>> The example file does not reflect the latest version - it is used to
>> discuss different syntax variants internally and may be not in sync with
>> the actual code.
>
> One of the problems we found with xbase.Xpression is:
> XFeatureCall returns XExpression :
> XPrimaryExpression
> ({XFeatureCall.target=current} "." name=ID
> ('('(params+=XExpression (','params+=XExpression )*)?')')?)*
> ;
>
> if you have
> a.b.c.d.e
> the expression tree is reversed (you can see this in the outline)
> e
> d
> c
> b
> a
>
> This makes it quite hard to write a scope provider.

Why is it hard?
In order to link e, I'll have to find out about the type of the target
expression (which is a.b.c.d).

Cheers,
Sven


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: Does xbase work? [message #649279 is a reply to message #514799] Tue, 18 January 2011 09:46 Go to previous messageGo to next message
Eclipse UserFriend
I m trying to get Xbase running by checking out xtext.xbase and xtext.common.types form the cvs repository. But if i run the xbase mw2, i get rule errors ...


7689 [main] INFO  ipse.xtext.generator.LanguageConfig  - generating infrastructure for org.eclipse.xtext.xbase.Xpression with fragments : ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment, ParseTreeConstructorFragment, XtextAntlrGeneratorFragment, JavaBasedContentAssistFragment
error(211): ../org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/parser/antlr/internal/InternalXpression.g:92:1: [fatal] rule ruleXExpression has non-LL(*) decision due to recursive rule invocations reachable from alts 1,2,6.  Resolve by left-factoring or using syntactic predicates or using backtrack=true option.
warning(200): ../org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/parser/antlr/internal/InternalXpression.g:92:1: Decision can match input such as "'('" using multiple alternatives: 1, 2, 6
As a result, alternative(s) 2,6 were disabled for that input
warning(200): ../org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/parser/antlr/internal/InternalXpression.g:1864:2: Decision can match input such as "'else'" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
error(211): ../org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/parser/antlr/internal/InternalXpression.g:3025:1: [fatal] rule ruleXExpressionInRichString has non-LL(*) decision due to recursive rule invocations reachable from alts 1,2,5.  Resolve by left-factoring or using syntactic predicates or using backtrack=true option.
warning(200): ../org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/parser/antlr/internal/InternalXpression.g:3025:1: Decision can match input such as "'('" using multiple alternatives: 1, 2, 5
As a result, alternative(s) 2,5 were disabled for that input



How did you get the editor running? Can you give me a hint?

Best,
Dan


Re: Does xbase work? [message #649424 is a reply to message #649279] Wed, 19 January 2011 03:19 Go to previous message
Eclipse UserFriend
Hi Dan,

are you sure that your meant the CVS repo? It's frozen since June 2010
because we migrated to git.
Please note that Xbase is still subject to change and clients should
currently use only with a good connection to the developers of Xtext ;-)

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 18.01.11 15:46, schrieb Daniel S:
> I m trying to get Xbase running by checking out xtext.xbase and
> xtext.common.types form the cvs repository. But if i run the xbase mw2,
> i get rule errors ...
>
>
> 7689 [main] INFO ipse.xtext.generator.LanguageConfig - generating
> infrastructure for org.eclipse.xtext.xbase.Xpression with fragments :
> ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment,
> ParseTreeConstructorFragment, XtextAntlrGeneratorFragment,
> JavaBasedContentAssistFragment
> error(211):
> ../org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/p arser/antlr/internal/InternalXpression.g:92:1:
> [fatal] rule ruleXExpression has non-LL(*) decision due to recursive
> rule invocations reachable from alts 1,2,6. Resolve by left-factoring or
> using syntactic predicates or using backtrack=true option.
> warning(200):
> ../org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/p arser/antlr/internal/InternalXpression.g:92:1:
> Decision can match input such as "'('" using multiple alternatives: 1, 2, 6
> As a result, alternative(s) 2,6 were disabled for that input
> warning(200):
> ../org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/p arser/antlr/internal/InternalXpression.g:1864:2:
> Decision can match input such as "'else'" using multiple alternatives: 1, 2
> As a result, alternative(s) 2 were disabled for that input
> error(211):
> ../org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/p arser/antlr/internal/InternalXpression.g:3025:1:
> [fatal] rule ruleXExpressionInRichString has non-LL(*) decision due to
> recursive rule invocations reachable from alts 1,2,5. Resolve by
> left-factoring or using syntactic predicates or using backtrack=true
> option.
> warning(200):
> ../org.eclipse.xtext.xbase/src-gen/org/eclipse/xtext/xbase/p arser/antlr/internal/InternalXpression.g:3025:1:
> Decision can match input such as "'('" using multiple alternatives: 1, 2, 5
> As a result, alternative(s) 2,5 were disabled for that input
>
>
> How did you get the editor running? Can you give me a hint?
>
> Best,
> Dan
>
>
>
Previous Topic:Toggle comment and empty lines
Next Topic:How to get the string for the statement, not the classname for the implemenation
Goto Forum:
  


Current Time: Tue Jul 15 16:26:46 EDT 2025

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

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

Back to the top