forked from RefPerSys/RefPerSys
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbispprepl_rps.yyp
More file actions
62 lines (55 loc) · 1.48 KB
/
Copy pathbispprepl_rps.yyp
File metadata and controls
62 lines (55 loc) · 1.48 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// file RefPerSys/bispprepl_rps.yyp input to bisonc++
// SPDX-License-Identifier: GPL-3.0-or-later
// see https://fbb-git.gitlab.io/bisoncpp/ and refpersys.org
// © Copyright 2025 The Reflective Persistent System Team
// team@refpersys.org
//
%default-actions warn
%baseclass-preinclude "refpersys.hh"
%error-verbose
%no-lines
%print-tokens
// parser class
%class-name RpsBisPpRepl_Parser
%filenames _bispprepl_rps
%debug
%start repl_atom
%token TOK_INT // integral numbers
%token TOK_DOUBLE
%token TOK_OID
%token TOK_STRING
%token TOK_NAME
%polymorphic TOK_INT: intptr_t;
TOK_DOUBLE: double;
TOK_OID: Rps_Id;
TOK_STRING: std::string;
TOK_NAME: std::string;
%%
/// grammar rules below
repl_atom: TOK_INT {
#pragma message "repl_atom is TOK_INT"
$$ = Rps_Value::make_tagged_int($1);
}
| TOK_DOUBLE {
#pragma message "repl_atom is TOK_DOUBLE"
$$ = Rps_DoubleValue($1);
}
| TOK_STRING {
#pragma message "repl_atom is TOK_STRING"
$$ = Rps_StringValue($1);
}
| TOK_OID {
#pragma message "repl_atom is TOK_OID"
$$ = Rps_ObjectValue(Rps_ObjectRef::really_find_object_by_oid($1));
}
| TOK_NAME {
#pragma message "repl_atom is TOK_NAME"
#warning Rps_ObjectRef::find_object_by_string needs a callframe for repl_atom as TOK_NAME
}
;
/****************
** for Emacs...
** Local Variables: ;;
** compile-command: "make _bispprepl_rps.o" ;;
** End: ;;
****************/