idlast.h

来自「编译工具」· C头文件 代码 · 共 1,254 行 · 第 1/3 页

H
1,254
字号
  const char* kindAsString() const { return "forward interface"; }  // Query interface  IDL_Boolean    abstract()   const { return abstract_; }  IDL_Boolean    local()      const { return local_;    }  Interface*     definition() const;  IDL_Boolean    isFirst()    const { return !firstForward_; }  IdlType*       thisType()   const { return thisType_; }  void accept(AstVisitor& visitor) { visitor.visitForward(this); }  void setDefinition(Interface* defn);private:  IDL_Boolean    abstract_;  IDL_Boolean    local_;  Interface*     definition_;  Forward*       firstForward_;  IdlType*       thisType_;};// Constantclass Const : public Decl, public DeclRepoId {public:  Const(const char* file, int line, IDL_Boolean mainFile,	IdlType* constType, const char* identifier, IdlExpr* expr);  virtual ~Const();  const char* kindAsString() const { return "constant"; }  // Queries  IdlType*      constType() const { return constType_; }  IdlType::Kind constKind() const { return constKind_; }  IDL_Short        constAsShort()      const;  IDL_Long         constAsLong()       const;  IDL_UShort       constAsUShort()     const;  IDL_ULong        constAsULong()      const;  IDL_Float        constAsFloat()      const;  IDL_Double       constAsDouble()     const;  IDL_Boolean      constAsBoolean()    const;  IDL_Char         constAsChar()       const;  IDL_Octet        constAsOctet()      const;  const char*      constAsString()     const;#ifdef HAS_LongLong  IDL_LongLong     constAsLongLong()   const;  IDL_ULongLong    constAsULongLong()  const;#endif#ifdef HAS_LongDouble  IDL_LongDouble   constAsLongDouble() const;#endif  IDL_WChar        constAsWChar()      const;  const IDL_WChar* constAsWString()    const;  IDL_Fixed*       constAsFixed()      const;  Enumerator*      constAsEnumerator() const;  void accept(AstVisitor& visitor) { visitor.visitConst(this); }private:  IdlType*       constType_;  IDL_Boolean    delType_;  IdlType::Kind  constKind_;  union {    IDL_Short        short_;    IDL_Long         long_;    IDL_UShort       ushort_;    IDL_ULong        ulong_;#ifndef __VMS    IDL_Float        float_;    IDL_Double       double_;#else    float            float_;    double           double_;#endif    IDL_Boolean      boolean_;    IDL_Char         char_;    IDL_Octet        octet_;    char*            string_;#ifdef HAS_LongLong    IDL_LongLong     longlong_;    IDL_ULongLong    ulonglong_;#endif#ifdef HAS_LongDouble    IDL_LongDouble   longdouble_;#endif    IDL_WChar        wchar_;    IDL_WChar*       wstring_;    IDL_Fixed*       fixed_;    Enumerator*      enumerator_;  } v_;};// Typedefclass ArraySize {public:  ArraySize(int size) : size_(size), next_(0), last_(0) {}  ~ArraySize() { if (next_) delete next_; }  int size()        const { return size_; }  ArraySize* next() const { return next_; }  void append(ArraySize* as) {    if (last_) last_->next_ = as;    else       next_ = as;    last_ = as;  }private:  int size_;protected:  ArraySize* next_;  ArraySize* last_;};class Typedef;class Attribute;class Declarator : public Decl, public DeclRepoId {public:  Declarator(const char* file, int line, IDL_Boolean mainFile,	     const char* identifier, ArraySize* sizes);  virtual ~Declarator();  const char* kindAsString() const;  // Queries  ArraySize* sizes()    const { return sizes_; }				// Null if a simple declarator  // Only for typedef declarators  IdlType*   thisType()  const { return thisType_; }  Typedef*   alias()     const { return alias_; }   Attribute* attribute() const { return attribute_; }  void accept(AstVisitor& visitor) { visitor.visitDeclarator(this); }  void setAlias    (Typedef*   td);  void setAttribute(Attribute* at);private:  ArraySize*  sizes_;  IdlType*    thisType_;  Typedef*    alias_;  Attribute*  attribute_;};class Typedef : public Decl {public:  Typedef(const char* file, int line, IDL_Boolean mainFile,	  IdlType* aliasType, IDL_Boolean constrType,	  Declarator* declarators);  virtual ~Typedef();  const char* kindAsString() const { return "typedef"; }  // Queries  IdlType*       aliasType()   const { return aliasType_; }  IDL_Boolean    constrType()  const { return constrType_; }  Declarator*    declarators() const { return declarators_; }  void accept(AstVisitor& visitor) { visitor.visitTypedef(this); }private:  IdlType*       aliasType_;  IDL_Boolean    delType_;  IDL_Boolean    constrType_;  Declarator*    declarators_;};// Struct memberclass Member : public Decl {public:  Member(const char* file, int line, IDL_Boolean mainFile,	 IdlType* memberType, IDL_Boolean constrType,	 Declarator* declarators);  virtual ~Member();  const char* kindAsString() const { return "member"; }  // Queries  IdlType*       memberType()  const { return memberType_; }  IDL_Boolean    constrType()  const { return constrType_; }  Declarator*    declarators() const { return declarators_; }  void accept(AstVisitor& visitor) { visitor.visitMember(this); }private:  IdlType*       memberType_;  IDL_Boolean    delType_;  IDL_Boolean    constrType_;  Declarator*    declarators_;};// Structclass Struct : public Decl, public DeclRepoId {public:  Struct(const char* file, int line, IDL_Boolean mainFile,	 const char* identifier);  virtual ~Struct();  const char* kindAsString() const { return "struct"; }  // Queries  Member*        members()   const { return members_; }  IdlType*       thisType()  const { return thisType_; }  IDL_Boolean    recursive() const { return recursive_; }  IDL_Boolean    finished()  const { return finished_; }  void accept(AstVisitor& visitor) { visitor.visitStruct(this); }  void finishConstruction(Member* members);  void setRecursive() { recursive_ = 1; }private:  Member*        members_;  IdlType*       thisType_;  IDL_Boolean    recursive_;  IDL_Boolean    finished_;};// Forward-declared structclass StructForward : public Decl, public DeclRepoId {public:  StructForward(const char* file, int line, IDL_Boolean mainFile,		const char* identifier);  virtual ~StructForward();  const char* kindAsString()  const { return "forward struct"; }  // Queries  Struct*        definition() const;  IDL_Boolean    isFirst()    const { return !firstForward_; }  IdlType*       thisType()   const { return thisType_; }  void accept(AstVisitor& visitor) { visitor.visitStructForward(this); }  void setDefinition(Struct* defn);private:  Struct*        definition_;  StructForward* firstForward_;  IdlType*       thisType_;};// Exceptionclass Exception : public Decl, public DeclRepoId {public:  Exception(const char* file, int line, IDL_Boolean mainFile,	    const char* identifier);  virtual ~Exception();  const char* kindAsString() const { return "exception"; }  // Queries  Member*        members()  const { return members_; }  IDL_Boolean    local()    const { return local_; }  void accept(AstVisitor& visitor) { visitor.visitException(this); }  void finishConstruction(Member* members);private:  Member*        members_;  IDL_Boolean    local_;};// Union case labelclass CaseLabel : public Decl {public:  CaseLabel(const char* file, int line, IDL_Boolean mainFile,	    IdlExpr* value);  virtual ~CaseLabel();  const char* kindAsString() const { return "case label"; }  IDL_Short        labelAsShort()      const;  IDL_Long         labelAsLong()       const;  IDL_UShort       labelAsUShort()     const;  IDL_ULong        labelAsULong()      const;  IDL_Boolean      labelAsBoolean()    const;  IDL_Char         labelAsChar()       const;#ifdef HAS_LongLong  IDL_LongLong     labelAsLongLong()   const;  IDL_ULongLong    labelAsULongLong()  const;#endif  IDL_WChar        labelAsWChar()      const;  Enumerator*      labelAsEnumerator() const;  inline IDL_Boolean isDefault() const { return isDefault_; }  IdlType::Kind      labelKind() const { return labelKind_; }  void accept(AstVisitor& visitor) { visitor.visitCaseLabel(this); }  void setType(IdlType* type);  void setDefaultShort     (IDL_Short     v) { v_.short_      = v; }  void setDefaultLong      (IDL_Long      v) { v_.long_       = v; }  void setDefaultUShort    (IDL_UShort    v) { v_.ushort_     = v; }  void setDefaultULong     (IDL_ULong     v) { v_.ulong_      = v; }  void setDefaultBoolean   (IDL_Boolean   v) { v_.boolean_    = v; }  void setDefaultChar      (IDL_Char      v) { v_.char_       = v; }#ifdef HAS_LongLong  void setDefaultLongLong  (IDL_LongLong  v) { v_.longlong_   = v; }  void setDefaultULongLong (IDL_ULongLong v) { v_.ulonglong_  = v; }#endif  void setDefaultWChar     (IDL_WChar     v) { v_.wchar_      = v; }  void setDefaultEnumerator(Enumerator*   v) { v_.enumerator_ = v; }private:  IdlExpr*       value_;  IDL_Boolean isDefault_;  IdlType::Kind  labelKind_;  union {    IDL_Short        short_;    IDL_Long         long_;    IDL_UShort       ushort_;    IDL_ULong        ulong_;    IDL_Boolean      boolean_;    IDL_Char         char_;#ifdef HAS_LongLong    IDL_LongLong     longlong_;    IDL_ULongLong    ulonglong_;#endif    IDL_WChar        wchar_;    Enumerator*      enumerator_;  } v_;};// Union caseclass UnionCase : public Decl {public:  UnionCase(const char* file, int line, IDL_Boolean mainFile,	    IdlType* caseType, IDL_Boolean constrType,	    Declarator* declarator);  virtual ~UnionCase();  const char* kindAsString() const { return "case"; }  // Queries  CaseLabel*     labels()     const { return labels_; }  IdlType*       caseType()   const { return caseType_; }  IDL_Boolean    constrType() const { return constrType_; }  Declarator*    declarator() const { return declarator_; }  void accept(AstVisitor& visitor) { visitor.visitUnionCase(this); }  void finishConstruction(CaseLabel* labels);private:  CaseLabel*     labels_;  IdlType*       caseType_;  IDL_Boolean    delType_;  IDL_Boolean    constrType_;  Declarator*    declarator_;};// Unionclass Union : public Decl, public DeclRepoId {public:  Union(const char* file, int line, IDL_Boolean mainFile,	const char* identifier);  virtual ~Union();  const char* kindAsString() const { return "union"; }  // Queries  IdlType*       switchType() const { return switchType_; }  IDL_Boolean    constrType() const { return constrType_; }  UnionCase*     cases()      const { return cases_; }  IdlType*       thisType()   const { return thisType_; }  IDL_Boolean    recursive()  const { return recursive_; }  IDL_Boolean    finished()   const { return finished_; }  void accept(AstVisitor& visitor) { visitor.visitUnion(this); }  void finishConstruction(IdlType* switchType, IDL_Boolean constrType,			  UnionCase* cases);  void setRecursive() { recursive_ = 1; }private:  IdlType*       switchType_;  IDL_Boolean    constrType_;  UnionCase*     cases_;  IdlType*       thisType_;  IDL_Boolean    recursive_;  IDL_Boolean    finished_;};class UnionForward : public Decl, public DeclRepoId {public:  UnionForward(const char* file, int line, IDL_Boolean mainFile,	       const char* identifier);  virtual ~UnionForward();  const char* kindAsString() const { return "forward union"; }  // Queries  Union*      definition() const;  IDL_Boolean isFirst()    const { return !firstForward_; }  IdlType*    thisType()   const { return thisType_; }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?