summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Trader/Interpreter.h
blob: 08dee14637a01010eef28a479f38b27efd738efd (plain)
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
// ============================================================================
// $Id$
//
// = LIBRARY
//    orbsvcs
// 
// = FILENAME
//    Interpreter.h
//
// = AUTHOR
//    Seth Widoff <sbw1@cs.wustl.edu>
// 
// ============================================================================


#ifndef TAO_INTERPRETER_H
#define TAO_INTERPRETER_H

#include "Constraint.h"
#include "Constraint_Nodes.h"

class TAO_Interpreter
// = TITLE
//      TAO_Interpreter is the superclass for all interpreters. It's
//      build tree method invoke the yacc parser to parse a constraint 
//      or preference string. 
{   
protected:

  TAO_Interpreter (void) : root_ (0) {}

  ~TAO_Interpreter (void);
  
  int build_tree (const char* preferences);
  // Using the Yacc generated parser, construct an expression
  // tree representing <constraints> from the tokens returned by it.

  static int is_empty_string (const char* str);
  
  TAO_Constraint* root_;
  // The root of the expression tree, not equal to null if build_tree
  // successfully builds a tree from the constraints.
};

#endif /* TAO_Interpreter */