mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-03 07:45:50 +00:00
Add a leafnode class to clearly indicate what node types are leaf nodes
This commit is contained in:
@@ -132,10 +132,16 @@
|
|||||||
TwoChildNode(Node *left, Node *right) : InnerNode(left, right) { };
|
TwoChildNode(Node *left, Node *right) : InnerNode(left, right) { };
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Match nothing (//). */
|
class LeafNode : public Node {
|
||||||
class EpsNode : public Node {
|
|
||||||
public:
|
public:
|
||||||
EpsNode()
|
LeafNode() : Node() { };
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Match nothing (//). */
|
||||||
|
class EpsNode : public LeafNode {
|
||||||
|
public:
|
||||||
|
EpsNode() : LeafNode()
|
||||||
{
|
{
|
||||||
nullable = true;
|
nullable = true;
|
||||||
label = 0;
|
label = 0;
|
||||||
@@ -169,9 +175,9 @@
|
|||||||
* characters that the regular expression matches. We also consider
|
* characters that the regular expression matches. We also consider
|
||||||
* AcceptNodes import: they indicate when a regular expression matches.
|
* AcceptNodes import: they indicate when a regular expression matches.
|
||||||
*/
|
*/
|
||||||
class ImportantNode : public Node {
|
class ImportantNode : public LeafNode {
|
||||||
public:
|
public:
|
||||||
ImportantNode() { }
|
ImportantNode() : LeafNode() { }
|
||||||
void compute_firstpos()
|
void compute_firstpos()
|
||||||
{
|
{
|
||||||
firstpos.insert(this);
|
firstpos.insert(this);
|
||||||
|
Reference in New Issue
Block a user