mirror of
https://github.com/cwbaker/lalr.git
synced 2026-09-26 16:33:18 +03:00
30 lines
612 B
C++
30 lines
612 B
C++
//
|
|
// RegexNodeLess.cpp
|
|
// Copyright (c) Charles Baker. All rights reserved.
|
|
//
|
|
|
|
#include "RegexNodeLess.hpp"
|
|
#include "RegexNode.hpp"
|
|
#include "assert.hpp"
|
|
|
|
using namespace lalr;
|
|
|
|
/**
|
|
// Compare two RegexNodes.
|
|
//
|
|
// @param lhs
|
|
// The first RegexNode to compare.
|
|
//
|
|
// @param rhs
|
|
// The second RegexNode to compare.
|
|
//
|
|
// @return
|
|
// True if the index of \e lhs is less than the index of \e rhs otherwise
|
|
// false.
|
|
*/
|
|
bool RegexNodeLess::operator()( const RegexNode* lhs, const RegexNode* rhs ) const
|
|
{
|
|
LALR_ASSERT( lhs );
|
|
LALR_ASSERT( rhs );
|
|
return *lhs < *rhs;
|
|
}
|