Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Does xbase work?
Does xbase work? [message #514799] Tue, 16 February 2010 11:50 Go to next message
Michael Scharf is currently offline Michael ScharfFriend
Messages: 301
Registered: July 2009
Senior Member
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 13:12 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
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 23:25 Go to previous messageGo to next message
Michael Scharf is currently offline Michael ScharfFriend
Messages: 301
Registered: July 2009
Senior Member
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 09:56 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
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 14:46 Go to previous messageGo to next message
Daniel Stieger is currently offline Daniel StiegerFriend
Messages: 24
Registered: April 2010
Junior Member
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 08:19 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
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: Sat Apr 20 03:34:54 GMT 2024

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

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

Back to the top