-
Notifications
You must be signed in to change notification settings - Fork 0
/
itokcollection.h
executable file
·47 lines (43 loc) · 1.79 KB
/
itokcollection.h
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
40
41
42
43
44
45
46
47
#ifndef ITOKCOLLECTION_H
#define ITOKCOLLECTION_H
/////////////////////////////////////////////////////////////////////
// ITokCollection.h - package for the ITokCollection interface //
// ver 1.0 //
// Language: Visual C++ 2008, SP1 //
// Platform: Dell Precision T7400, Vista Ultimate SP1 //
// Application: Prototype for CSE687 Pr1, Sp09 //
// Author: Jim Fawcett, CST 4-187, Syracuse University //
// (315) 443-3948, jfawcett@twcny.rr.com //
/////////////////////////////////////////////////////////////////////
/*
Module Purpose:
===============
ITokCollection is an interface that supports substitution of different
types of scanners for parsing. In this solution, we illustrate that
by binding two different types of collections, SemiExp and XmlParts,
to this interface. This is illustrated in the test stubs for the
SemiExpression and XmlElementParts modules.
Note that we only use the SemiExpression collector in the parser and
all of the higher level executives. We certainly could bind the
XmlParts class to parser's ITokCollector pointer, but didn't due to
lack of time.
Maintenance History:
====================
ver 1.0 : 17 Jan 09
- first release
*/
struct ITokCollection
{
virtual bool get()=0;
virtual int length()=0;
virtual std::string& operator[](int n)=0;
virtual int find(const std::string& tok)=0;
virtual void push_back(const std::string& tok)=0;
virtual bool remove(const std::string& tok)=0;
virtual void toLower()=0;
virtual void trimFront()=0;
virtual void clear()=0;
virtual std::string show()=0;
virtual ~ITokCollection() {};
};
#endif