[apparmor] [PATCH 06/20] Add a leafnode class to clearly indicate what node types are leaf nodes
John Johansen
john.johansen at canonical.com
Fri Nov 5 05:51:02 GMT 2010
Signed-off-by: John Johansen <john.johansen at canonical.com>
---
parser/libapparmor_re/regexp.y | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/parser/libapparmor_re/regexp.y b/parser/libapparmor_re/regexp.y
index 35068ea..ac52903 100644
--- a/parser/libapparmor_re/regexp.y
+++ b/parser/libapparmor_re/regexp.y
@@ -132,10 +132,16 @@
TwoChildNode(Node *left, Node *right) : InnerNode(left, right) { };
};
+ class LeafNode : public Node {
+ public:
+ LeafNode() : Node() { };
+
+ };
+
/* Match nothing (//). */
- class EpsNode : public Node {
+ class EpsNode : public LeafNode {
public:
- EpsNode()
+ EpsNode() : LeafNode()
{
nullable = true;
label = 0;
@@ -169,9 +175,9 @@
* characters that the regular expression matches. We also consider
* AcceptNodes import: they indicate when a regular expression matches.
*/
- class ImportantNode : public Node {
+ class ImportantNode : public LeafNode {
public:
- ImportantNode() { }
+ ImportantNode() : LeafNode() { }
void compute_firstpos()
{
firstpos.insert(this);
--
1.7.1
More information about the AppArmor
mailing list