-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSCFG.H
More file actions
40 lines (35 loc) · 1.06 KB
/
Copy pathSCFG.H
File metadata and controls
40 lines (35 loc) · 1.06 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
36
37
38
39
/****************************************************************
SCFG.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_SCFG_H
#define INCL_SCFG_H
#include <iostream>
#include "BOOM/Vector.H"
#include "GrammarAlphabet.H"
#include "Production.H"
#include "ProductionSet.H"
using namespace std;
using namespace BOOM;
class SCFG {
GrammarAlphabet terminals, nonterminals;
GrammarSymbol *start;
Vector<Production*> productions;
public:
SCFG();
SCFG(const String &filename);
void deleteAll();
void load(const String &filename);
GrammarAlphabet &getTerminals();
GrammarAlphabet &getNonterminals();
Vector<Production*> &getProductions();
GrammarSymbol *getStart();
void setStart(GrammarSymbol *);
void printOn(ostream &) const;
ProductionSet *getProductionSet();
void normalize();
};
ostream &operator<<(ostream &,const SCFG &);
#endif