This file is indexed.

/usr/include/BALL/KERNEL/expression.h is in libball1.4-dev 1.4.3~beta1-4.

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
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//

#ifndef BALL_KERNEL_EXPRESSION_H
#define BALL_KERNEL_EXPRESSION_H

#ifndef BALL_DATATYPE_STRINGHASHMAP_H
#	include <BALL/DATATYPE/stringHashMap.h>
#endif

#ifndef BALL_KERNEL_EXPRESSIONPARSER_H
#	include <BALL/KERNEL/expressionParser.h>
#endif

namespace BALL
{
	class Atom;
	class ExpressionTree;

	/**
	 * The class \ref Expression provides a frontend to \ref ExpressionTree.
	 * \par
	 * Expressions may be built from the following modules:
	 * <ul>
	 *   <li><tt>AND</tt> a conjunction
	 *   <li><tt>OR</tt>  a disjunction
	 *   <li><tt>!</tt>   a negation
	 *   <li><tt>predicate(argument) </tt> a predicate class that is derived from
	 *       \ref ExpressionPredicate and provides <tt>operator()(const \ref Atom& atom) const</tt>.
	 * </ul>
	 * Additionally brackets can be used for grouping. At least one bracket
	 * pair must exist which encloses the argument of a predicate.
	 * Empty arguments are allowed.
	 * \par
	 * <b>Example:</b>
	 * \code
	 * !residueID(12) AND (element(N) OR element(C))
	 * \endcode
	 * \par
	 * BALL offers various predefined ExpressionPredicates. These are:
	 * \par
	 * <table>
	 *   <tr><th>Syntax</th><th>Description</th></tr>
	 *   <tr><td><b> true()                  </b></td><td> always true </td></tr>
	 *   <tr><td><b> false()                 </b></td><td> always false </td></tr>
	 *   <tr><td><b> SMARTS(string)          </b></td><td> use a <a href="http://www.daylight.com/dayhtml/doc/theory/theory.smarts.html">SMARTS</a> expression </td></tr>
	 *   <tr><td><b> selected()              </b></td><td> true for already selected atoms </td></tr>
	 *   <tr><td><b> name(string)            </b></td><td> the name of an atom </td></tr>
	 *   <tr><td><b> type(string)            </b></td><td> type name of an atom </td></tr>
	 *   <tr><td><b> element(char)           </b></td><td> element (abbreviated by its symbol) </td></tr>
	 *   <tr><td><b> residue(string)         </b></td><td> name of a residue </td></tr>
	 *   <tr><td><b> residueID(string)       </b></td><td> PDB ID of the residue (usually a number) </td></tr>
	 *   <tr><td><b> protein(string)         </b></td><td> name of protein, the atom is contained in </td></tr>
	 *   <tr><td><b> secondaryStruct(string) </b></td><td> name of the secondary structure, the atom is contained in </td></tr>
	 *   <tr><td><b> chain(string)           </b></td><td> name of the chain, the atom is contained in </td></tr>
	 *   <tr><td><b> nucleotide(string)      </b></td><td> name of the nucleotide the atom is contained in</td></tr>
	 *   <tr><td><b> solvent()               </b></td><td> the atom is a solvent atom added by BALL </td></tr>
	 *   <tr><td><b> backbone()              </b></td><td> backbone atoms </td></tr>
	 *   <tr><td><b> inRing()                </b></td><td> part of a ring</td></tr>
	 *   <tr><td><b> doubleBonds()           </b></td><td> atoms with double bonds </td></tr>
	 *   <tr><td><b> tripleBonds()           </b></td><td> atoms with triple bonds </td></tr>
	 *   <tr><td><b> numberOfBonds(int)      </b></td><td> atoms with a given number of bonds </td></tr>
	 *   <tr><td><b> aromaticBonds()         </b></td><td> atoms with aromatic bonds </td></tr>
	 *   <tr><td><b> connectedTo(char)       </b></td><td> atoms which are connected to an atom (see \ref ConnectedToPredicate)</td></tr>
	 *   <tr><td><b> charge([op][number])    </b></td><td> select by charge, Possible operators are '&lt;'&nbsp; '&lt;='&nbsp; '='&nbsp; '&gt;='&nbsp; '&gt;'  </td></tr>
	 *   <tr><td><b> spHybridized()          </b></td><td> &nbsp; </td></tr>
	 *   <tr><td><b> sp2Hybridized()         </b></td><td> &nbsp; </td></tr>
	 *   <tr><td><b> sp3Hybridized()         </b></td><td> &nbsp; </td></tr>
	 *   <tr><td><b> charge(float)           </b></td><td> atoms with given charge </td></tr>
	 *   <tr><td><b> isAxial()               </b></td><td> &nbsp; </td></tr>
	 *   <tr><td><b> is4C1()                 </b></td><td> &nbsp; </td></tr>
	 * </table>
	 * \par
	 * \see ExpressionTree
	 *
   * \ingroup  Predicates
	 */
	class BALL_EXPORT Expression
	{
		public:

		BALL_CREATE(Expression)

		/**	@name	Type Definitions
		*/
		//@{

		/**	A creation method for predicates.
		*/
		typedef void * (*CreationMethod) ();

		//@}
		/**	@name	Constructors and Destructor
		*/
		//@{

		/** Default Constructor.
		*/
		Expression();

		/** Copy Constructor.
		*/
		Expression(const Expression& expression);

		/** Construct an Expression with a string
		 *  @throw Exception::ParseError if a syntax error was encountered
		 */
		Expression(const String& expression_string);

		/** Destructor.
		 */
		virtual ~Expression();

		//@}
		/**	@name	Predicates
		*/
		//@{

		/**
		*/
		bool hasPredicate(const String& name) const;

		/** Equality operator 
		 */
		bool operator == (const Expression& expression) const;

		//@}
		/**	@name	Accessors
		*/
		//@{

		/** Evaluate the expression of <tt>atom</tt>
				@param atom
		*/
		virtual bool operator () (const Atom& atom) const;

		/**	Create a new predicate according to the name.
				If the predicate is not known, return 0.
				@param name the name of the predicate
				@param args the optional argument of the predicate
		*/
		ExpressionPredicate* getPredicate(const String& name,
		                                  const String& args = "") const;

		/**	Register a new predicate class.
		*/
		void registerPredicate(const String& name, CreationMethod creation_method);

		/** Set the expression and build a tree for it.
		 *  @throw Exception::ParseError if a syntax error was encountered
		 */
		void setExpression(const String& expression);

		/** Get the expression string.
		*/
		const String& getExpressionString() const;

		/** Get the expression tree.
		*/
		const ExpressionTree* getExpressionTree() const;

		/** Get the creation methods.
		*/
		const StringHashMap<CreationMethod>& getCreationMethods() const;

		//@}
		/** @name Assignment 
		 */
		//@{ 

		/** Assignment operator 
		 */
		Expression& operator = (const Expression& expression);

		/** Clear method 
		 */
		virtual void clear();

		//@}

		protected:

		/*_ @name Protected methods
		*/
		//@{

		/*_ Construct the expression tree from the SyntaxTree
		 *  @throw Exception::ParseError if a syntax error was encountered
		 */
		ExpressionTree*	constructExpressionTree_(const ExpressionParser::SyntaxTree& tree);

		/*_ Register the predicates defined by default.
				See also: BALL/KERNEL/standardPredicates.h
		*/
		void registerStandardPredicates_();

		//@}
		/*_ @name Protected attributes
		*/
		//@{

		/*_ The methods to create the ExpressionPredicate instances
		*/
		StringHashMap<CreationMethod> create_methods_;

		/*_	The ExpressionTree constructed from the string.
				This tree contains the instances of the predicates.
		*/
		ExpressionTree*								expression_tree_;

		/*_ The string describing the expression.
		*/
		String												expression_string_;

		//@}
	};
}

#endif // BALL_KERNEL_EXPRESSION_H