~ubuntu-branches/ubuntu/jaunty/aspectc++/jaunty

« back to all changes in this revision

Viewing changes to Puma/src/parser/ccparser/CCSemVisitor.cc

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-07-07 14:41:02 UTC
  • mfrom: (1.1.3 upstream) (6.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080707144102-lzml7t07f3sl00r5
Tags: 1.0pre4~svn.20080711-1
* new upstream snapshot.
* include all upstream documentation. Clarifying emails regarding
  licensing has been included into debian/copyright.
* reformat description following recomendations of
  http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description
  (Closes: #480316)

Show diffs side-by-side

added added

removed removed

Lines of Context:
367
367
 
368
368
 
369
369
void CCSemVisitor::pre_action (CT_GotoStmt *node) {
 
370
  if (! current_scope->LocalScope ())
 
371
    SEM_ERROR (node, "`goto' outside of function");
 
372
  else
 
373
    check_goto_label (node->Label ());
 
374
}
 
375
 
 
376
void CCSemVisitor::check_goto_label (CTree *tree) {
370
377
  CFunctionInfo *finfo;
371
378
  const char *name;
372
379
  
373
 
  if (! current_scope->LocalScope ())
374
 
    SEM_ERROR (node, "`goto' outside of function");
375
 
  else {
376
 
    finfo = current_scope->LocalScope ()->Function ();
377
 
    if (finfo) {
378
 
      name = node->Label ()->Text ();
379
 
      if (! finfo->Label (name))
380
 
        SEM_ERROR (node, "label `" << name << "' used but not defined");
381
 
    }
 
380
  finfo = current_scope->LocalScope ()->Function ();
 
381
  if (finfo) {
 
382
    CT_SimpleName *label = (CT_SimpleName *)tree;
 
383
    name = label->Text ();
 
384
    if (! finfo->Label (name))
 
385
      SEM_ERROR (label, "label `" << name << "' used but not defined");
382
386
  }
383
387
}
384
388
 
385
 
 
386
389
void CCSemVisitor::pre_action (CT_ReturnStmt *node) {
387
390
  CFunctionInfo *finfo = 0;
388
391
  CTypeInfo *t2 = 0, *t1 = 0;