~ubuntu-branches/ubuntu/trusty/openjade1.3/trusty

« back to all changes in this revision

Viewing changes to lib/ModeInfo.h

  • Committer: Bazaar Package Importer
  • Author(s): Yann Dirson
  • Date: 2002-04-09 00:01:50 UTC
  • Revision ID: james.westby@ubuntu.com-20020409000150-r9rkyalxlhvf9ba3
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) 1994 James Clark
 
2
// See the file COPYING for copying permission.
 
3
 
 
4
#ifndef ModeInfo_INCLUDED
 
5
#define ModeInfo_INCLUDED 1
 
6
#ifdef __GNUG__
 
7
#pragma interface
 
8
#endif
 
9
 
 
10
#include <stdlib.h>
 
11
#include "Boolean.h"
 
12
#include "Syntax.h"
 
13
#include "Mode.h"
 
14
#include "Priority.h"
 
15
 
 
16
#ifdef SP_NAMESPACE
 
17
namespace SP_NAMESPACE {
 
18
#endif
 
19
 
 
20
struct TokenInfo {
 
21
  enum Type {
 
22
    delimType,
 
23
    setType,
 
24
    functionType,
 
25
    delimDelimType,
 
26
    delimSetType
 
27
    };
 
28
  Type type;
 
29
  Priority::Type priority;
 
30
  Token token;
 
31
  Syntax::DelimGeneral delim1;
 
32
  union {
 
33
    Syntax::DelimGeneral delim2;
 
34
    Syntax::Set set;
 
35
    Syntax::StandardFunction function;
 
36
  };
 
37
};
 
38
 
 
39
class Sd;
 
40
struct PackedTokenInfo;
 
41
 
 
42
class ModeInfo {
 
43
public:
 
44
  ModeInfo(Mode mode, const Sd &sd);
 
45
  Boolean nextToken(TokenInfo *);
 
46
  Boolean includesShortref() const;
 
47
private:
 
48
  Mode mode_;
 
49
  const PackedTokenInfo *p_;            // points to next
 
50
  size_t count_;
 
51
  unsigned missingRequirements_;
 
52
};
 
53
 
 
54
inline Boolean ModeInfo::includesShortref() const
 
55
{
 
56
  return mode_ >= minShortrefMode;
 
57
}
 
58
 
 
59
#ifdef SP_NAMESPACE
 
60
}
 
61
#endif
 
62
 
 
63
#endif /* not ModeInfo_INCLUDED */