cpp

Coverage Report

Created: 2022-09-21 22:22

/home/andy/git/oilshell/oil/cpp/leaky_frontend_tdop.h
Line
Count
Source
1
// Replacement for osh/arith_parse
2
3
#ifndef FRONTEND_TDOP_H
4
#define FRONTEND_TDOP_H
5
6
#include "_gen/frontend/id_kind.asdl.h"
7
#include "_gen/frontend/syntax.asdl.h"
8
9
using id_kind_asdl::Id_t;
10
using syntax_asdl::arith_expr_t;
11
using syntax_asdl::word_t;
12
13
namespace tdop {
14
15
class TdopParser;  // forward declaration
16
17
typedef arith_expr_t* (*LeftFunc)(TdopParser*, word_t*, arith_expr_t*, int);
18
typedef arith_expr_t* (*NullFunc)(TdopParser*, word_t*, int);
19
20
struct LeftInfo {
21
  LeftFunc led;
22
  int lbp;
23
  int rbp;
24
25
  DISALLOW_COPY_AND_ASSIGN(LeftInfo)
26
};
27
28
struct NullInfo {
29
  NullFunc nud;
30
  int bp;
31
32
  DISALLOW_COPY_AND_ASSIGN(NullInfo)
33
};
34
35
class ParserSpec {
36
 public:
37
1
  ParserSpec() {
38
1
  }
39
  LeftInfo* LookupLed(Id_t id);
40
  NullInfo* LookupNud(Id_t id);
41
42
  DISALLOW_COPY_AND_ASSIGN(ParserSpec)
43
};
44
45
}  // namespace tdop
46
47
#endif  // FRONTEND_TDOP_H