Introduction Projects and Files Statements Expressions Symbols Types
Attributes Labels Non-Member Functions Constructing Declarations Example Programs Index

Labels

SgLabel

Represents labels, for all languages.

class SgLabel {
public:
  PTR_LABEL thelabel;
  inline SgLabel(PTR_LABEL lab);
  inline SgLabel(SgLabel &);
  inline SgLabel(int i);
  inline SgLabel(SgLabelSymb & lab_symb);
  inline SgSymbol * symbol();
  inline SgStatement * SgLabel::statement();
  inline int id();
  inline int getLastLabelVal();
  inline ~SgLabel();
};

Member Functions

SgLabel(PTR_LABEL lab)

SgLabel(int i)

int id()

int getLastLabelVal()

SgLabel Usage

Here is how one can create labels:

     SgLabelSymb * foo = new SgLabelSymb("foo", *s);
     SgLabel * foolab = new SgLabel(*foo);
     SgLabelStmt * ls = new SgLabelStmt(*foolab, *s);

Note that s is of type SgStatement *, and is the scope of the label statement.

So here are the steps for using labels:

  1. create a symbol
  2. create a label
  3. create a label statement
  4. insert the label statement before the appropriate statement


Exit Sage++ User's Guide