OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
Parser.h
Go to the documentation of this file.
1#ifndef OPALX_Parser_HH
2#define OPALX_Parser_HH
3
4// ------------------------------------------------------------------------
5// $RCSfile: Parser.h,v $
6// ------------------------------------------------------------------------
7// $Revision: 1.1.1.1 $
8// ------------------------------------------------------------------------
9// Copyright: see Copyright.readme
10// ------------------------------------------------------------------------
11//
12// Class: Parser
13//
14// ------------------------------------------------------------------------
15// Class category: Parser
16// ------------------------------------------------------------------------
17//
18// $Date: 2000/03/27 09:32:37 $
19// $Author: fci $
20//
21// ------------------------------------------------------------------------
22
23class Statement;
24class TokenStream;
25
26// Class Parser
27// ------------------------------------------------------------------------
29
30class Parser {
31public:
32 Parser();
33 virtual ~Parser();
34
36 virtual void parse(Statement& stat) const = 0;
37
39 virtual Statement* readStatement(TokenStream* ts) const = 0;
40
42 // Read one statement at a time on token stream, parse it, and execute it.
43 virtual void run(TokenStream* ts) const = 0;
44
45private:
46 // Not implemented.
47 Parser(const Parser&);
48 void operator=(const Parser&);
49};
50
51inline Parser::Parser() {}
52
53inline Parser::~Parser() {}
54
55#endif // OPALX_Parser_HH
Interface for abstract language parser.
Definition Parser.h:30
virtual void parse(Statement &stat) const =0
Parse and execute the statement.
Parser()
Definition Parser.h:51
virtual ~Parser()
Definition Parser.h:53
virtual Statement * readStatement(TokenStream *ts) const =0
Read complete statement from token stream.
virtual void run(TokenStream *ts) const =0
Read statements and parse.
Parser(const Parser &)
void operator=(const Parser &)
Interface for statements.
Definition Statement.h:37
Abstract interface for a stream of input tokens.
Definition TokenStream.h:30