/
Op.h
53 lines (48 loc) · 1.94 KB
/
Op.h
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
/* Script2™
@link https://github.com/KabukiStarship/Script2.git
@file /Op.h
@author Cale McCollough <https://cookingwithcale.org>
@license Copyright Kabuki Starship™ <kabukistarship.com>;
This Source Code Form is subject to the terms of the Mozilla Public License,
v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain
one at <https://mozilla.org/MPL/2.0/>. */
#pragma once
#ifndef INCLUDED_SCRIPT2_OP_DECL
#define INCLUDED_SCRIPT2_OP_DECL
#include <_Config.h>
#if SEAM >= SCRIPT2_CRABS
#include "String.hpp"
namespace _ {
// enum {
// cOpPush = 0, //< Operation Type 0: Stack push .
// cOpOperation = 1, //< Operation Type 1: Abstract Operation.
// cOpOperationPush = 2, //< Operation Type 2: Operation with stack push.
//};
struct BOut;
/* An expression Operation with name key, multiple input params,
result, and optional description of a data set.
@code
static const Op cThis = { "Key",
Params<1, 2>::Header, Params<1, 2>::Header,
"Description", '}', ';', ' ', nullptr, "-", nullptr };
static const Op kOpExample = { "Key2",
NumOps (0), FirstOp ('A'),
"Description", '}', ';', ' ', true, nullptr, "-", nullptr };
@endcode */
struct LIB_MEMBER Op {
const CHA* name; //< Op name.
const ISC* in, //< Input cBSQ params or OpFirst.
* out; //< Output cBSQ params or OpLast.
const CHA* description; //< Op description.
CHC pop, //< Index of the Pop Operation.
close, //< Index of the Close Operation.
default_op; //< Index of the Default Operation.
BOL using_numbers; //< Flag for if tokens may use numbers.
const CHA* ignore_chars, //< String of chars to ignore.
* allowed_chars; //< String of allowed symbols.
const BOut* evaluation; //< Evaluated expression Slot.
};
inline const Op* OpError(Error error) { return TPtr<const Op>(error); }
} //< namespace _
#endif
#endif