-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProductionSet.H
More file actions
36 lines (32 loc) · 1.02 KB
/
ProductionSet.H
File metadata and controls
36 lines (32 loc) · 1.02 KB
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
/****************************************************************
ProductionSet.H
Copyright (C)2013 William H. Majoros (martiandna@gmail.com).
This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
License (GPL) version 3, as described at www.opensource.org.
****************************************************************/
#ifndef INCL_ProductionSet_H
#define INCL_ProductionSet_H
#include <iostream>
#include "BOOM/Vector.H"
#include "BOOM/HashTable.H"
#include "GrammarSymbol.H"
#include "GrammarAlphabet.H"
#include "Production.H"
using namespace std;
using namespace BOOM;
class ProductionSet {
Vector<Production*> productions;
HashMap<GrammarSymbol,Vector<Production*> > index;
public:
ProductionSet();
void add(Production *);
void reindex();
int size() const;
Production *operator[](int);
void removeProduction(int);
Vector<Production*> &lookup(GrammarSymbol *);
void printOn(ostream &) const;
void normalize(GrammarAlphabet &);
};
ostream &operator<<(ostream &,const ProductionSet &);
#endif