Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to refer to elements declared afterwards
How to refer to elements declared afterwards [message #922475] Tue, 25 September 2012 03:35 Go to next message
Tu Do is currently offline Tu DoFriend
Messages: 21
Registered: August 2012
Junior Member
I have a situation like this:

var test = true; 
If (test) goto label;

label:
     //more code here.....


The problem is, I want to refer to label declared after. I know goto is advised to not use today, but in my in-house esoteric language, it's everywhere and we have to use it pretty often.

EDIT: It works now. For some reasons, when I first try the code above, it could not resolve the reference to the labels. Sorry about this topic.

[Updated on: Tue, 25 September 2012 04:02]

Report message to a moderator

Re: How to refer to elements declared afterwards [message #923411 is a reply to message #922475] Tue, 25 September 2012 22:26 Go to previous message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
Parsing is done before linking; you can link elements independently of
where they are.
- henrik

On 2012-24-09 20:35, Tu Do wrote:
> I have a situation like this:
>
>
> var test = true; If (test) goto label;
>
> label:
> //more code here.....
>
> The problem is, I want to refer to label declared after. I know goto is
> advised to not use today, but in my in-house esoteric language, it's
> everywhere and we have to use it pretty often.
Previous Topic:Simple Xtext editor for a part of a complex grammar
Next Topic:Dynamically extend parts of the grammar
Goto Forum:
  


Current Time: Tue Sep 24 10:02:43 GMT 2024

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

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

Back to the top