Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

Attr Class Reference

#include <Attr.h>

Inheritance diagram for Attr:

Inheritance graph
[legend]
Collaboration diagram for Attr:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Attr (attr_tag t, Expr *e=0)
 ~Attr ()
attr_tag Tag () const
ExprAttrExpr () const
int RedundantAttrOkay () const
void Describe (ODesc *d) const
 Attr (AttrType arg_type)
AttrType Type () const

Protected Member Functions

void AddTag (ODesc *d) const

Protected Attributes

attr_tag tag
Exprexpr
AttrType type

Constructor & Destructor Documentation

Attr::Attr attr_tag  t,
Expr e = 0
 

Definition at line 42 of file Attr.cc.

References end_location, expr, BroObj::SetLocationInfo(), start_location, and tag.

00043         {
00044         tag = t;
00045         expr = e;
00046         SetLocationInfo(&start_location, &end_location);
00047         }

Attr::~Attr  ) 
 

Definition at line 49 of file Attr.cc.

References expr, and BroObj::Unref.

00050         {
00051         Unref(expr);
00052         }

Attr::Attr AttrType  arg_type  )  [inline]
 

Definition at line 865 of file pac.h.

00866                 : type(arg_type) {}


Member Function Documentation

void Attr::AddTag ODesc d  )  const [protected]
 

Definition at line 67 of file Attr.cc.

References ODesc::Add(), attr_name(), bro_int_t, ODesc::IsBinary(), and Tag().

Referenced by Describe().

00068         {
00069         if ( d->IsBinary() )
00070                 d->Add(bro_int_t(Tag()));
00071         else
00072                 d->Add(attr_name(Tag()));
00073         }

Expr* Attr::AttrExpr  )  const [inline]
 

Definition at line 59 of file Attr.h.

References expr.

Referenced by Attributes::CheckAttr(), TableVal::CheckExpireAttr(), FlattenExpr::Fold(), FieldExpr::Fold(), TableVal::Lookup(), RecordVal::RecordVal(), TableVal::SetAttrs(), BroFile::SetAttrs(), and ID::SetVal().

00059 { return expr; }

void Attr::Describe ODesc d  )  const [virtual]
 

Implements BroObj.

Definition at line 54 of file Attr.cc.

References ODesc::Add(), AddTag(), Expr::Describe(), expr, and ODesc::IsBinary().

00055         {
00056         AddTag(d);
00057 
00058         if ( expr )
00059                 {
00060                 if ( ! d->IsBinary() )
00061                         d->Add("=");
00062 
00063                 expr->Describe(d);
00064                 }
00065         }

int Attr::RedundantAttrOkay  )  const [inline]
 

Definition at line 61 of file Attr.h.

References ATTR_OPTIONAL, ATTR_REDEF, and tag.

Referenced by Attributes::AddAttr().

00062                 { return tag == ATTR_REDEF || tag == ATTR_OPTIONAL; }

attr_tag Attr::Tag  )  const [inline]
 

Definition at line 58 of file Attr.h.

References attr_tag, and tag.

Referenced by Attributes::AddAttr(), AddTag(), Attributes::CheckAttr(), and Attributes::FindAttr().

00058 { return tag; }

AttrType Attr::Type  )  const [inline]
 

Definition at line 868 of file pac.h.

References AttrType, and type.

Referenced by RecordField::genParseCode(), and TypeDecl::ProcessAttr().

00868 { return type; }


Member Data Documentation

Expr* Attr::expr [protected]
 

Reimplemented in AttrCheck.

Definition at line 70 of file Attr.h.

Referenced by Attr(), AttrExpr(), Describe(), and ~Attr().

attr_tag Attr::tag [protected]
 

Definition at line 69 of file Attr.h.

Referenced by Attr(), RedundantAttrOkay(), and Tag().

AttrType Attr::type [protected]
 

Definition at line 871 of file pac.h.

Referenced by Type().


The documentation for this class was generated from the following files:
Generated on Wed Sep 14 03:07:42 2005 for bro_docs by doxygen 1.3.5