mirror of
https://github.com/cwbaker/lalr.git
synced 2026-09-26 16:33:18 +03:00
Remove unused GrammarSymbolLess
This commit is contained in:
parent
faaafdcef6
commit
a5db5713da
7 changed files with 0 additions and 52 deletions
|
|
@ -2,7 +2,6 @@
|
|||
#define LALR_GRAMMARGENERATOR_HPP_INCLUDED
|
||||
|
||||
#include "RegexToken.hpp"
|
||||
#include "GrammarSymbolLess.hpp"
|
||||
#include "GrammarStateLess.hpp"
|
||||
#include "GrammarProductionLess.hpp"
|
||||
#include "GrammarSymbolSet.hpp"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include "GrammarItem.hpp"
|
||||
#include "GrammarTransition.hpp"
|
||||
#include "GrammarSymbolLess.hpp"
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
//
|
||||
// GrammarSymbolLess.hpp
|
||||
// Copyright (c) Charles Baker. All rights reserved.
|
||||
//
|
||||
|
||||
#include "GrammarSymbolLess.hpp"
|
||||
#include "GrammarSymbol.hpp"
|
||||
#include "assert.hpp"
|
||||
|
||||
using namespace lalr;
|
||||
|
||||
bool GrammarSymbolLess::operator()( const GrammarSymbol* lhs, const GrammarSymbol* rhs ) const
|
||||
{
|
||||
LALR_ASSERT( lhs->index() >= 0 );
|
||||
LALR_ASSERT( rhs->index() >= 0 );
|
||||
return lhs->index() < rhs->index();
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
#ifndef LALR_GRAMMARSYMBOLLESS_HPP_INCLUDED
|
||||
#define LALR_GRAMMARSYMBOLLESS_HPP_INCLUDED
|
||||
|
||||
namespace lalr
|
||||
{
|
||||
|
||||
class GrammarSymbol;
|
||||
|
||||
/**
|
||||
// Indirectly compare objects through two raw pointers.
|
||||
*/
|
||||
class GrammarSymbolLess
|
||||
{
|
||||
public:
|
||||
bool operator()( const GrammarSymbol* lhs, const GrammarSymbol* rhs ) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -95,16 +95,6 @@ bool GrammarSymbolSet::insert( const GrammarSymbol* symbol )
|
|||
return false;
|
||||
}
|
||||
|
||||
int GrammarSymbolSet::insert( std::set<const GrammarSymbol*, GrammarSymbolLess>::const_iterator begin, std::set<const GrammarSymbol*, GrammarSymbolLess>::const_iterator end )
|
||||
{
|
||||
int added = 0;
|
||||
for ( auto i = begin; i != end; ++i )
|
||||
{
|
||||
added += insert( *i ) ? 1 : 0;
|
||||
}
|
||||
return added;
|
||||
}
|
||||
|
||||
int GrammarSymbolSet::insert( const GrammarSymbolSet& set )
|
||||
{
|
||||
int added = 0;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include "GrammarSymbolLess.hpp"
|
||||
#include <stddef.h>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
|
@ -28,7 +27,6 @@ public:
|
|||
std::vector<const GrammarSymbol*>::const_iterator end() const;
|
||||
const std::vector<const GrammarSymbol*>& symbols() const;
|
||||
bool insert( const GrammarSymbol* symbol );
|
||||
int insert( std::set<const GrammarSymbol*, GrammarSymbolLess>::const_iterator begin, std::set<const GrammarSymbol*, GrammarSymbolLess>::const_iterator end );
|
||||
int insert( const GrammarSymbolSet& set );
|
||||
void swap( GrammarSymbolSet&& set );
|
||||
};
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ for _, cc in toolsets('^cc.*') do
|
|||
'GrammarState.cpp',
|
||||
'GrammarStateLess.cpp',
|
||||
'GrammarSymbol.cpp',
|
||||
'GrammarSymbolLess.cpp',
|
||||
'GrammarSymbolSet.cpp',
|
||||
'GrammarTransition.cpp'
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue