idlast.h

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

H
1,254
字号
  void accept(AstVisitor& visitor) { visitor.visitUnionForward(this); }  void setDefinition(Union* defn);private:  Union*        definition_;  UnionForward* firstForward_;  IdlType*      thisType_;};// Enumeratorclass Enum;class Enumerator : public Decl, public DeclRepoId {public:  Enumerator(const char* file, int line, IDL_Boolean mainFile,	     const char* identifier);  virtual ~Enumerator();  const char* kindAsString() const { return "enumerator"; }  // Queries  Enum*       container()  const { return container_; }  IDL_ULong   value()      const { return value_; }  void accept(AstVisitor& visitor) { visitor.visitEnumerator(this); }  void finishConstruction(Enum* container, IDL_ULong value);private:  const char* identifier_;  Enum*       container_;  IDL_ULong   value_;};// Enumclass Enum : public Decl, public DeclRepoId {public:  Enum(const char* file, int line, IDL_Boolean mainFile,       const char* identifier);  virtual ~Enum();  const char* kindAsString() const { return "enum"; }  // Queries  Enumerator* enumerators() const { return enumerators_; }  IdlType*    thisType()    const { return thisType_; }  void accept(AstVisitor& visitor) { visitor.visitEnum(this); }  void finishConstruction(Enumerator* enumerators);private:  Enumerator* enumerators_;  IdlType*    thisType_;};// Attributeclass Attribute : public Decl {public:  Attribute(const char* file, int line, IDL_Boolean mainFile,	    IDL_Boolean readonly, IdlType* attrType,	    Declarator* declarators);  virtual ~Attribute();  const char* kindAsString() const { return "attribute"; }  // Queries  IDL_Boolean    readonly()    const { return readonly_; }  IdlType*       attrType()    const { return attrType_; }  Declarator*    declarators() const { return declarators_; }  void accept(AstVisitor& visitor) { visitor.visitAttribute(this); }private:  IDL_Boolean    readonly_;  IdlType*       attrType_;  IDL_Boolean    delType_;  Declarator*    declarators_;};// Parameterclass Parameter : public Decl {public:  Parameter(const char* file, int line, IDL_Boolean mainFile,	    int direction, IdlType* paramType, const char* identifier);  virtual ~Parameter();  const char* kindAsString() const { return "parameter"; }  // Queries  int         direction()  const { return direction_; }				// 0: in, 1: out, 2: inout  IdlType*    paramType()  const { return paramType_; }  const char* identifier() const { return identifier_; }  void accept(AstVisitor& visitor) { visitor.visitParameter(this); }private:  int            direction_;  IdlType*       paramType_;  IDL_Boolean    delType_;  char*          identifier_;};// List of exceptionsclass RaisesSpec {public:  RaisesSpec(const ScopedName* sn, const char* file, int line);  ~RaisesSpec();  Exception*  exception() const { return exception_; }  RaisesSpec* next()      const { return next_; }  void append(RaisesSpec* rs) {    if (rs) {      last_->next_ = rs;      last_ = rs;    }  }private:  Exception*  exception_;protected:  RaisesSpec* next_;  RaisesSpec* last_;};// List of contextsclass ContextSpec {public:  ContextSpec(const char* c, const char* file, int line);  ~ContextSpec();  const char*  context() const { return context_; }  ContextSpec* next()    const { return next_; }  void append(ContextSpec* rs) {    last_->next_ = rs;    last_ = rs;  }private:  char*  context_;protected:  ContextSpec* next_;  ContextSpec* last_;};// Operationclass Operation : public Decl, public DeclRepoId {public:  Operation(const char* file, int line, IDL_Boolean mainFile,	    IDL_Boolean oneway, IdlType* return_type,	    const char* identifier);  virtual ~Operation();  const char* kindAsString() const { return "operation"; }  // Queries  IDL_Boolean    oneway()     const { return oneway_; }  IdlType*       returnType() const { return returnType_; }  Parameter*     parameters() const { return parameters_; }  RaisesSpec*    raises()     const { return raises_; }  ContextSpec*   contexts()   const { return contexts_; }  void accept(AstVisitor& visitor) { visitor.visitOperation(this); }  void closeParens();  void finishConstruction(Parameter* parameters, RaisesSpec* raises,			  ContextSpec* contexts);private:  IDL_Boolean    oneway_;  IdlType*       returnType_;  IDL_Boolean    delType_;  Parameter*     parameters_;  RaisesSpec*    raises_;  ContextSpec*   contexts_;};// Nativeclass Native : public Decl, public DeclRepoId {public:  Native(const char* file, int line, IDL_Boolean mainFile,	 const char* identifier);  virtual ~Native();  const char* kindAsString() const { return "native"; }  void accept(AstVisitor& visitor) { visitor.visitNative(this); }};// Things for valuetypeclass StateMember : public Decl {public:  StateMember(const char* file, int line, IDL_Boolean mainFile,	      int memberAccess, IdlType* memberType,	      IDL_Boolean constrType, Declarator* declarators);  virtual ~StateMember();  const char* kindAsString() const { return "state member"; }  // Queries  int            memberAccess() const { return memberAccess_; }				// 0: public, 1: private  IdlType*       memberType()   const { return memberType_; }  IDL_Boolean    constrType()   const { return constrType_; }  Declarator*    declarators()  const { return declarators_; }  void accept(AstVisitor& visitor) { visitor.visitStateMember(this); }private:  int            memberAccess_;  IdlType*       memberType_;  IDL_Boolean    delType_;  IDL_Boolean    constrType_;  Declarator*    declarators_;};class Factory : public Decl {public:  Factory(const char* file, int line, IDL_Boolean mainFile,	  const char* identifier);  ~Factory();  const char* kindAsString() const { return "initializer"; }  // Queries  const char* identifier() const { return identifier_; }  Parameter*  parameters() const { return parameters_; }  void accept(AstVisitor& visitor) { visitor.visitFactory(this); }  void closeParens();  void finishConstruction(Parameter* parameters);private:  char*       identifier_;  Parameter*  parameters_;};// Base class for all the multifarious value typesclass ValueBase : public Decl, public DeclRepoId {public:  ValueBase(Decl::Kind k, const char* file, int line, IDL_Boolean mainFile,	    const char* identifier);  virtual ~ValueBase();};// Forward declared valueclass ValueForward : public ValueBase {public:  ValueForward(const char* file, int line, IDL_Boolean mainFile,	       IDL_Boolean abstract, const char* identifier);  virtual ~ValueForward();  const char* kindAsString() const { return "forward value"; }  // Queries  IDL_Boolean    abstract()   const { return abstract_; }  ValueBase*     definition() const;  IDL_Boolean    isFirst()    const { return !firstForward_; }  IdlType*       thisType()   const { return thisType_; }  void accept(AstVisitor& visitor) { visitor.visitValueForward(this); }  void setDefinition(ValueBase* defn);private:  IDL_Boolean    abstract_;  ValueBase*     definition_;  ValueForward*  firstForward_;  IdlType*       thisType_;};class ValueBox : public ValueBase {public:  ValueBox(const char* file, int line, IDL_Boolean mainFile,	   const char* identifier, IdlType* boxedType,	   IDL_Boolean constrType);  virtual ~ValueBox();  const char* kindAsString() const { return "value box"; }  // Queries  IdlType*       boxedType()  const { return boxedType_; }  IDL_Boolean    constrType() const { return constrType_; }  IdlType*       thisType()   const { return thisType_; }  void accept(AstVisitor& visitor) { visitor.visitValueBox(this); }private:  IdlType*       boxedType_;  IDL_Boolean    constrType_;  IdlType*       thisType_;};class ValueInheritSpec {public:  ValueInheritSpec(ScopedName* sn, const char* file, int line);  virtual ~ValueInheritSpec() { if (next_) delete next_; }  ValueBase*        value()       const { return value_; }  Decl*             decl()        const { return decl_; }  const Scope*      scope()       const { return scope_; }  ValueInheritSpec* next()        const { return next_; }  IDL_Boolean       truncatable() const { return truncatable_; }  void append(ValueInheritSpec* is, const char* file, int line);  void setTruncatable() { truncatable_ = 1; }private:  ValueBase*   value_;  Decl*        decl_;  const Scope* scope_;protected:  ValueInheritSpec* next_;  IDL_Boolean       truncatable_;};class ValueInheritSupportSpec {public:  ValueInheritSupportSpec(ValueInheritSpec* inherits,			  InheritSpec*      supports) :    inherits_(inherits), supports_(supports) {}  ~ValueInheritSupportSpec() {}  ValueInheritSpec* inherits() const { return inherits_; }  InheritSpec*      supports() const { return supports_; }private:  ValueInheritSpec* inherits_;  InheritSpec*      supports_;};class ValueAbs : public ValueBase {public:  ValueAbs(const char* file, int line, IDL_Boolean mainFile,	   const char* identifier, ValueInheritSpec* inherits,	   InheritSpec* supports);  virtual ~ValueAbs();  const char* kindAsString() const { return "abstract valuetype"; }  // Queries  ValueInheritSpec* inherits() const { return inherits_; }  InheritSpec*      supports() const { return supports_; }  Decl*             contents() const { return contents_; }  Scope*            scope()    const { return scope_;    }  IdlType*          thisType() const { return thisType_; }  void accept(AstVisitor& visitor) { visitor.visitValueAbs(this); }  void finishConstruction(Decl* contents);private:  ValueInheritSpec* inherits_;  InheritSpec*      supports_;  Decl*             contents_;  Scope*            scope_;  IdlType*          thisType_;};class Value : public ValueBase {public:  Value(const char* file, int line, IDL_Boolean mainFile,	IDL_Boolean custom, const char* identifier,	ValueInheritSpec* inherits, InheritSpec* supports);  virtual ~Value();  const char* kindAsString() const { return "valuetype"; }  // Queries  IDL_Boolean       custom()   const { return custom_; }  ValueInheritSpec* inherits() const { return inherits_; }  InheritSpec*      supports() const { return supports_; }  Decl*             contents() const { return contents_; }  Scope*            scope()    const { return scope_;    }  IdlType*          thisType() const { return thisType_; }  void accept(AstVisitor& visitor) { visitor.visitValue(this); }  void finishConstruction(Decl* contents);private:  IDL_Boolean       custom_;  ValueInheritSpec* inherits_;  InheritSpec*      supports_;  Decl*             contents_;  Scope*            scope_;  IdlType*          thisType_;};#endif // _idlast_h_

⌨️ 快捷键说明

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