Exemple #1
0
Symbol *AddSymbol(SourceLoc *loc, Scope *fScope, int atom, symbolkind kind)
{
    Symbol *lSymb;

    if (!fScope)
        fScope = CurrentScope;
    lSymb = NewSymbol(loc, fScope, atom, kind);
    lAddToTree(&fScope->symbols, lSymb);
    return lSymb;
} // AddSymbol
Exemple #2
0
Symbol *AddSymbol( CgContext *cg, SourceLoc *loc, Scope *fScope, Atom atom, Type *fType, SymbolKind kind)
{
  Symbol *lSymb;
	
  if (!fScope)
    fScope = cg->currentScope;
  lSymb = NewSymbol( cg, loc, fScope, atom, fType, kind);
  lAddToTree( cg, &fScope->symbols, lSymb, fType);
  return lSymb;
} // AddSymbol
Exemple #3
0
Symbol *AddTag( CgContext *cg, SourceLoc *loc, Scope *fScope, Atom atom, TypeCategory category)
{
  Symbol *lSymb;
  Type *pType;
  
  if (!fScope)
    fScope = cg->currentScope;
  pType = NewType( cg,atom, TB_NoType, category, TD_Unknown, TQ_None, false, 0, 0);
  static_cast< TypeStruct * >( pType )->unqualifiedtype = pType;
  lSymb = NewSymbol( cg, loc, fScope, atom, pType, SK_Tag);
  lAddToTree( cg, &fScope->tags, lSymb, pType);
  return lSymb;
} // AddTag
Exemple #4
0
Symbol *AddTag(SourceLoc *loc, Scope *fScope, int atom, int category)
{
    Symbol *lSymb;
    Type *pType;

    if (!fScope)
        fScope = CurrentScope;
    pType = NewType(category, 0);
    pType->str.unqualifiedtype = pType;
    lSymb = NewSymbol(loc, fScope, atom, pType, TAG_S);
    lAddToTree(&fScope->tags, lSymb, pType);
    return lSymb;
} // AddTag