This file is indexed.

/usr/include/sbml/math/ASTBase.h is in libsbml5-dev 5.10.0+dfsg-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
/**
 * @cond doxygenLibsbmlInternal
 *
 * @file    ASTBase.h
 * @brief   Base Node for Abstract Syntax Tree (AST) class.
 * @author  Sarah Keating
 * 
 * <!--------------------------------------------------------------------------
 * This file is part of libSBML.  Please visit http://sbml.org for more
 * information about SBML, and the latest version of libSBML.
 *
 * Copyright (C) 2013-2014 jointly by the following organizations:
 *     1. California Institute of Technology, Pasadena, CA, USA
 *     2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK
 *     3. University of Heidelberg, Heidelberg, Germany
 *
 * Copyright (C) 2009-2012 jointly by the following organizations: 
 *     1. California Institute of Technology, Pasadena, CA, USA
 *     2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK
 *  
 * Copyright (C) 2006-2008 by the California Institute of Technology,
 *     Pasadena, CA, USA 
 *  
 * Copyright (C) 2002-2005 jointly by the following organizations: 
 *     1. California Institute of Technology, Pasadena, CA, USA
 *     2. Japan Science and Technology Agency, Japan
 * 
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation.  A copy of the license agreement is provided
 * in the file named "LICENSE.txt" included with this software distribution and
 * also available online as http://sbml.org/software/libsbml/license.html
 * ------------------------------------------------------------------------ -->
 *
 * @class ASTBase
 * @sbmlbrief{core} Base node for AST classes.
 */

#ifndef ASTBase_h
#define ASTBase_h


#include <sbml/common/extern.h>
#include <sbml/SBMLError.h>
#include <sbml/math/ASTTypes.h>
#include <sbml/xml/XMLInputStream.h>
#include <sbml/xml/XMLOutputStream.h>
#include <sbml/ExpectedAttributes.h>

#ifdef __cplusplus

#include <vector>
#include <string>

//using namespace std;

LIBSBML_CPP_NAMESPACE_BEGIN

class ASTBasePlugin;
class SBase;

class LIBSBML_EXTERN ASTBase
{
public:

  ASTBase (int type = AST_UNKNOWN);

  ASTBase (SBMLNamespaces* sbmlns, int type = AST_UNKNOWN);
 
  /**
   * Copy constructor
   */
  ASTBase (const ASTBase& orig);
  

  /**
   * Assignment operator for ASTNode.
   */
  ASTBase& operator=(const ASTBase& rhs);


  /**
   * Destroys this ASTNode, including any child nodes.
   */
  virtual ~ASTBase ();


  /**
   * Creates a copy (clone).
   */
  virtual ASTBase* deepCopy () const = 0;

  void loadASTPlugins(SBMLNamespaces* sbmlns);

  /**
   * Get the type of this ASTNode.  The value returned is one of the
   * enumeration values such as @link ASTNodeType_t#AST_LAMBDA
   * AST_LAMBDA@endlink, @link ASTNodeType_t#AST_PLUS AST_PLUS@endlink,
   * etc.
   * 
   * @return the type of this ASTNode.
   */
  virtual ASTNodeType_t getType () const;



  virtual int getExtendedType() const;
  
  
  bool isSetType(); 

  /**
   * Sets the type of this ASTNode to the given type code.  A side-effect
   * of doing this is that any numerical values previously stored in this
   * node are reset to zero.
   *
   * @param type the type to which this node should be set
   *
   * @return integer value indicating success/failure of the
   * function.  The possible values returned by this function are:
   * @li @link OperationReturnValues_t#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS @endlink
   * @li @link OperationReturnValues_t#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE @endlink
   */
  virtual int setType (ASTNodeType_t type);

  virtual int setType(int type);


  /* helper functions to establish types */
  virtual bool isAvogadro() const;
  virtual bool isBoolean() const;
  bool isBinaryFunction() const;
  virtual bool isConstant() const;
  bool isExponential() const;
  bool isCiNumber() const;
  bool isConstantNumber() const;
  bool isCSymbolFunction() const;
  bool isCSymbolNumber() const;
  virtual bool isFunction() const;
  virtual bool isInteger() const;
  virtual bool isLambda() const;
  virtual bool isLogical() const;
  virtual bool isName() const;
  bool isNaryFunction() const;
  virtual bool isNumber() const;
  virtual bool isOperator() const;
  virtual bool isPiecewise() const;
  virtual bool isQualifier() const;
  virtual bool isRational() const;
  virtual bool isReal() const;
  virtual bool isRelational() const;
  virtual bool isSemantics() const;
  bool isUnaryFunction() const;
  virtual bool isUnknown() const;
  bool isUserFunction() const;


  










  bool isNumberNode() const;
  bool isFunctionNode() const;

  bool isTopLevelMathMLFunctionNodeTag(const std::string& name) const;

  bool isTopLevelMathMLNumberNodeTag(const std::string& name) const;






  






  /* functions to read and write */
  virtual void write(XMLOutputStream& stream) const;
  
  
  virtual bool read(XMLInputStream& stream, const std::string& reqd_prefix="");


  virtual void addExpectedAttributes(ExpectedAttributes& attributes, 
                                     XMLInputStream& stream);

  virtual bool readAttributes (const XMLAttributes& attributes,
                               const ExpectedAttributes& expectedAttributes,
                               XMLInputStream& stream, const XMLToken& element);

  virtual void logError (XMLInputStream& stream, const XMLToken& element, 
    SBMLErrorCode_t code,
          const std::string& msg = ""); 
  
  //bool readAttributes(const XMLAttributes att);

  /* functions to keep note of whether this instance of an AST is a child */
  bool isChild() const;


  void setIsChildFlag(bool flag);

  // functions for MathML attributes
  std::string getClass() const;
  std::string getId() const;
  std::string getStyle() const;

  SBase* getParentSBMLObject() const;

  bool isSetClass() const;
  bool isSetId() const;
  bool isSetStyle() const;

  bool isSetParentSBMLObject() const;

  int setClass(std::string className);
  int setId(std::string id);
  int setStyle(std::string style);
  
  int setParentSBMLObject(SBase* sb);
  
  int unsetClass();
  int unsetId();
  int unsetStyle();

  int unsetParentSBMLObject();

  virtual ASTBase* getFunction() const;
  //int setCharacter(char value);
  //char getCharacter() const;

  // ------------------------------------------------------------------
  //
  // public functions for EXTENSION
  //
  // ------------------------------------------------------------------

  virtual void addPlugin(ASTBasePlugin* plugin);

  /**
   * Returns a plug-in object (extension interface) for an SBML Level&nbsp;3
   * package extension with the given package name or URI.
   *
   * @param package the name or URI of the package
   *
   * @return the plug-in object (the libSBML extension interface) of
   * a package extension with the given package name or URI.
   */
  ASTBasePlugin* getPlugin(const std::string& package);


  /**
   * Returns a plug-in object (extension interface) for an SBML Level&nbsp;3
   * package extension with the given package name or URI.
   *
   * @param package the name or URI of the package
   *
   * @return the plug-in object (the libSBML extension interface) of a
   * package extension with the given package name or URI.
   */
  const ASTBasePlugin* getPlugin(const std::string& package) const;


  /**
   * Returns the nth plug-in object (extension interface) for an SBML Level&nbsp;3
   * package extension.
   *
   * @param n the index of the plug-in to return
   *
   * @return the plug-in object (the libSBML extension interface) of
   * a package extension with the given package name or URI.
   */
  ASTBasePlugin* getPlugin(unsigned int n);


  /**
   * Returns the nth plug-in object (extension interface) for an SBML Level&nbsp;3
   * package extension.
   *
   * @param n the index of the plug-in to return
   *
   * @return the plug-in object (the libSBML extension interface) of a
   * package extension with the given package name or URI.
   */
  const ASTBasePlugin* getPlugin(unsigned int n) const;


  /**
   * Returns the number of plug-in objects (extenstion interfaces) for SBML
   * Level&nbsp;3 package extensions known.
   *
   * @return the number of plug-in objects (extension interfaces) of
   * package extensions known by this instance of libSBML.
   */
  unsigned int getNumPlugins() const;


  int getTypeFromName(const std::string& name) const;

  const char * getNameFromType(int type) const;

  int setUserData(void *userData);
  void *getUserData() const;
  bool isSetUserData() const;
  int unsetUserData();
  
  //virtual void syncMembersFrom(ASTBase* rhs);
  virtual void writeNodeOfType(XMLOutputStream& stream, int type, 
    bool inChildNode = false) const;


  virtual bool isWellFormedNode() const;

  virtual bool hasCorrectNumberArguments() const;

  virtual int getTypeCode () const;

  virtual const std::string& getPackageName() const;

  int setPackageName(const std::string& name);

  virtual bool hasCnUnits() const;
  virtual const std::string& getUnitsPrefix() const;

protected:

  void resetPackageName();


  void checkPrefix(XMLInputStream& stream, const std::string& reqd_prefix, 
    const XMLToken& element);

  void writeStartEndElement(XMLOutputStream& stream) const;

  void writeConstant(XMLOutputStream& stream, const std::string & name) const;
  void writeStartElement(XMLOutputStream& stream) const;
  
  void writeAttributes(XMLOutputStream& stream) const;

  virtual void writeENotation (  double    mantissa
                , long             exponent
                , XMLOutputStream& stream ) const;

  virtual void writeENotation (  const std::string&    mantissa
    , const std::string&    exponent
                , XMLOutputStream& stream ) const;


  void writeNegInfinity(XMLOutputStream& stream) const;

  virtual void syncMembersFrom(ASTBase* rhs);
  virtual void syncMembersAndResetParentsFrom(ASTBase* rhs);
  virtual void syncPluginsFrom(ASTBase* rhs);

  /* member variables */

  bool mIsChildFlag;

  ASTNodeType_t mType;
  int mTypeFromPackage;
  std::string mPackageName;
  
  // additional MathML attributes
  std::string mId;
  std::string mClass;
  std::string mStyle;

  SBase * mParentSBMLObject;

  void * mUserData;

  std::string mEmptyString;

  //char mChar;

  //----------------------------------------------------------------------
  //
  // Additional data members for Extension
  //
  //----------------------------------------------------------------------

  //
  // ASTBasePlugin derived classes will be stored in mPlugins.
  std::vector<ASTBasePlugin*> mPlugins;

  /* functions and friends to facilitate extensions */

  virtual double getValue() const;
  virtual unsigned int getNumChildren() const;

  friend class ASTNumber;
  friend class ASTFunction;
  friend class ASTCSymbol;
  friend class ASTNode;
};

LIBSBML_CPP_NAMESPACE_END

#endif /* __cplusplus */

#endif  /* ASTNode_h */


/** @endcond */