To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 21640
21639  |  21641
Subject: 
Re: Are there GOTO statements in NQC?
Newsgroups: 
lugnet.robotics
Date: 
Thu, 20 Nov 2003 15:45:59 GMT
Original-From: 
T. Alexander Popiel <popiel@#NoSpam#wolfskeep.com>
Viewed: 
941 times
  
In message:  <Pine.SOL.4.44.0311200005330.12580-100000@y.glue.umd.edu>
             Vadim Iosifovich Vaynerman <dimav@Glue.umd.edu> writes:
Hello all,
I REALLY need to use a goto statement in the NQC programming project I'm
doing for the RCX. Dows anybody know if such a statement extsts, and if
so, what the syntax is? I know gotos are bad programming practice, but its
really hard to make a workaround here. All ideas are appreciated.

No, NQC does not support goto.  I at one point started to add goto to
the language, but abandoned the effort when I installed legOS on my
brick.  It's not really all that hard to add goto to the NQC language;
it's a couple minor changes to the grammar (to allow labels and the
goto statement), adding a lookup table for the labels, adding another
case to insert code for the goto along with a call to the existing
target-fixup code, and adding a bit of error handling.  I made it
quite a bit harder on myself by wanting to be able to pass labels
as function parameters (which is doable since all functions are
inlined in NQC), and hence never finished the project.

Basically, if you've had any experience mucking around in a compiler,
adding goto to NQC is quite doable.  But you'll have to add it.

- Alex



Message has 1 Reply:
  Re: Are there GOTO statements in NQC?
 
(...) NQC has supported the goto statement since version 2.5a3 (which was released a long time ago). (...) Nope. It's already there. John Hansen (21 years ago, 20-Nov-03, to lugnet.robotics)

Message is in Reply To:
  Are there GOTO statements in NQC?
 
Hello all, I REALLY need to use a goto statement in the NQC programming project I'm doing for the RCX. Dows anybody know if such a statement extsts, and if so, what the syntax is? I know gotos are bad programming practice, but its really hard to (...) (21 years ago, 20-Nov-03, to lugnet.robotics)

19 Messages in This Thread:









Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR