473,326 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

control flow or abstract syntax tree

Does anyone know why this is not possible

Expand|Select|Wrap|Line Numbers
  1. int main(void)
  2. {
  3.          goto labelb;
  4.          labela:
  5.          {
  6.                   int i = c;
  7.                   goto labelc;
  8.          }
  9.          labelb:
  10.          enum { c = 0;}
  11.          goto labelb;
  12.          labelc:
  13.          ;
  14. }
and where in the c99 documentation it says this is not possible?
So does the checking only look for declarations by using abstract syntax tree and not in the control flow?
Thanks
May 16 '07 #1
1 1935
AdrianH
1,251 Expert 1GB
Does anyone know why this is not possible

Expand|Select|Wrap|Line Numbers
  1. int main(void)
  2. {
  3.          goto labelb;
  4.          labela:
  5.          {
  6.                   int i = c;
  7.                   goto labelc;
  8.          }
  9.          labelb:
  10.          enum { c = 0;}
  11.          goto labelb;
  12.          labelc:
  13.          ;
  14. }
and where in the c99 documentation it says this is not possible?
So does the checking only look for declarations by using abstract syntax tree and not in the control flow?
Thanks
Ok, first, AAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHH!

Now that that is out of my system, ;) if you ever use gotos on any of my projects without consent, I... will.... kill... you.... s...l...o...w...l...y. As slowly as it take to debug such crap. :D I'm serious. gotos are not needed except under very exceptional circumstances.

Now that my rant is out of my system. It won't work because C/C++ is a declare before use language. 'c' was not declared prior to its use on line 6.

EDIT: and before you say "it was declared before use", I mean during parsing the code, not during execution flow.


Adrian
May 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: (Pete Cresswell) | last post by:
I'm getting nodes into the thing, but when the dust settles, only the root-level nodes are visible. I know they're there because .Nodes.Count gives the right number.\ But I don't really...
6
by: Melkor Ainur | last post by:
Hello, I'm attempting to build an interpreter for a pascal-like language. Currently, I don't generate any assembly. Instead, I just build an abstract syntax tree representing what I've parsed...
4
by: Bob hotmail.com> | last post by:
Everyone I have been spending weeks looking on the web for a good tutorial on how to use regular expressions and other methods to satisfy my craving for learning how to do FAST c-style syntax...
9
by: Alvin Bruney [MVP] | last post by:
Exceptions must not be used to control program flow. I intend to show that this statement is flawed. In some instances, exceptions may be used to control program flow in ways that can lead to...
2
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
2
by: brianlum | last post by:
Hi, I have been looking for a good way to convert python code into a control flow graph. I know of Python functions that will convert an expression into an abstract syntax tree (i.e. ast =...
9
by: johan.tibell | last post by:
I'm in the process of writing an interpreter for lambda calculus (i.e. a small functional programming language) in C. I've previously written one in Haskell so I understand at least some of the...
7
by: jason | last post by:
In the microsoft starter kit Time Tracker application, the data access layer code consist of three cs files. DataAccessHelper.cs DataAcess.cs SQLDataAccessLayer.cs DataAcccessHelper appears...
6
by: Crooter | last post by:
Hello colleagues, Could anybody tell me if there are existing open-source solutions to extract the program tree using a program source code? I'm aware that GCC has program flow information and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.