-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathocSubroutine.h
More file actions
38 lines (30 loc) · 1.08 KB
/
Copy pathocSubroutine.h
File metadata and controls
38 lines (30 loc) · 1.08 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
// Filename: ocSubroutine.h
// Created by: frang (03June04)
//
////////////////////////////////////////////////////////////////////
#ifndef OCSUBROUTINE_H
#define OCSUBROUTINE_H
#include "oconfig.h"
#include <vector>
#include <map>
///////////////////////////////////////////////////////////////////
// Class : OCSubroutine
// Description : This represents a named subroutine defined via the
// #defsub .. #end sequence that may be invoked at any
// time via #call. All subroutine definitions are
// global.
////////////////////////////////////////////////////////////////////
class OCSubroutine {
public:
vector<string> _formals;
vector<string> _lines;
public:
static void define_sub(const string &name, OCSubroutine *sub);
static const OCSubroutine *get_sub(const string &name);
static void define_func(const string &name, OCSubroutine *sub);
static const OCSubroutine *get_func(const string &name);
typedef map<string, OCSubroutine *> Subroutines;
static Subroutines _subroutines;
static Subroutines _functions;
};
#endif