YSTest: NPLA1.h 源文件

YSTest PreAlpha_b800_20170810 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

NPLA1.h
浏览该文件的文档.
1 /*
2 © 2014-2017 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
28 #ifndef NPL_INC_NPLA1_h_
29 #define NPL_INC_NPLA1_h_ 1
30
31 #include "YModules.h"
32 #include YFM_NPL_NPLA // for NPLATag, ValueNode, TermNode, LoggedEvent,
33 // NPL::AccessTerm, ystdex::equality_comparable, ystdex::exclude_self_t,
34 // YSLib::AreEqualHeld, YSLib::GHEvent, ystdex::make_function_type_t,
35 // ystdex::make_parameter_tuple_t, ystdex::make_expanded,
36 // ystdex::invoke_nonvoid, ystdex::make_transform, std::accumulate,
37 // ystdex::bind1, std::placeholders::_2, ystdex::examiners::equal_examiner;
38
39 namespace NPL
40 {
41
43 namespace A1
44 {
45
51 struct YF_API NPLA1Tag : NPLATag
52 {};
53
54
59 enum class ValueToken
60 {
61 Null,
66 Undefined,
71 Unspecified,
72 GroupingAnchor,
73 OrderedAnchor
74 };
75
83 YF_API string
84 to_string(ValueToken);
85
86
88
89
91
97 YF_API void
98 InsertChild(TermNode&&, TermNode::Container&);
99
105 YF_API void
106 InsertSequenceChild(TermNode&&, NodeSequence&);
108
127 YF_API ValueNode
128 TransformNode(const TermNode&, NodeMapper = {}, NodeMapper = MapNPLALeafNode,
129 NodeToString = ParseNPLANodeString, NodeInserter = InsertChild);
130
140 YF_API ValueNode
141 TransformNodeSequence(const TermNode&, NodeMapper = {},
142 NodeMapper = MapNPLALeafNode, NodeToString = ParseNPLANodeString,
143 NodeSequenceInserter = InsertSequenceChild);
145
146
152 template<typename _type, typename... _tParams>
153 ValueNode
154 LoadNode(_type&& tree, _tParams&&... args)
155 {
156 TryRet(A1::TransformNode(std::forward<TermNode&&>(tree),
157 yforward(args)...))
158 CatchThrow(ystdex::bad_any_cast& e, LoggedEvent(YSLib::sfmt(
159 "Bad NPLA1 tree found: cast failed from [%s] to [%s] .", e.from(),
160 e.to()), YSLib::Warning))
161 }
162
163 template<typename _type, typename... _tParams>
164 ValueNode
165 LoadNodeSequence(_type&& tree, _tParams&&... args)
166 {
167 TryRet(A1::TransformNodeSequence(std::forward<TermNode&&>(tree),
168 yforward(args)...))
169 CatchThrow(ystdex::bad_any_cast& e, LoggedEvent(YSLib::sfmt(
170 "Bad NPLA1 tree found: cast failed from [%s] to [%s] .", e.from(),
171 e.to()), YSLib::Warning))
172 }
174
175
177
178 YF_API GuardPasses&
180 AccessGuardPassesRef(ContextNode&);
181
183 YF_API EvaluationPasses&
184 AccessLeafPassesRef(ContextNode&);
185
187 YF_API EvaluationPasses&
188 AccessListPassesRef(ContextNode&);
190
195 YF_API LiteralPasses&
196 AccessLiteralPassesRef(ContextNode&);
197
199
200
205 YF_API Guard
206 InvokeGuard(TermNode& term, ContextNode&);
207
213 YF_API ReductionStatus
215 InvokeLeaf(TermNode& term, ContextNode&);
216
218 YF_API ReductionStatus
219 InvokeList(TermNode& term, ContextNode&);
221
228 YF_API ReductionStatus
229 InvokeLiteral(TermNode&, ContextNode&, string_view);
231
232
262 YF_API ReductionStatus
263 Reduce(TermNode&, ContextNode&);
264
282 YF_API void
283 ReduceArguments(TNIter, TNIter, ContextNode&);
285 inline PDefH(void, ReduceArguments, TermNode::Container& con, ContextNode& ctx)
286 ImplRet(ReduceArguments(con.begin(), con.end(), ctx))
287 inline PDefH(void, ReduceArguments, TermNode& term, ContextNode& ctx)
288 ImplRet(ReduceArguments(term.GetContainerRef(), ctx))
290
301 YF_API void
302 ReduceChecked(TermNode&, ContextNode&);
303
313 YF_API void
314 ReduceCheckedClosure(TermNode&, ContextNode&, bool, TermNode&);
316
322 YF_API void
323 ReduceChildren(TNIter, TNIter, ContextNode&);
324 inline PDefH(void, ReduceChildren, TermNode::Container& con, ContextNode& ctx)
325 ImplExpr(ReduceChildren(con.begin(), con.end(), ctx))
326 inline PDefH(void, ReduceChildren, TermNode& term, ContextNode& ctx)
327 ImplExpr(ReduceChildren(term.GetContainerRef(), ctx))
329
330
337 YF_API ReductionStatus
338 ReduceChildrenOrdered(TNIter, TNIter, ContextNode&);
339 inline PDefH(ReductionStatus, ReduceChildrenOrdered, TermNode::Container& con,
340 ContextNode& ctx)
341 ImplRet(ReduceChildrenOrdered(con.begin(), con.end(), ctx))
342 inline PDefH(ReductionStatus, ReduceChildrenOrdered, TermNode& term,
343 ContextNode& ctx)
344 ImplRet(ReduceChildrenOrdered(term.GetContainerRef(), ctx))
346
357 YF_API ReductionStatus
358 ReduceFirst(TermNode&, ContextNode&);
359
371 YF_API ReductionStatus
372 ReduceOrdered(TermNode&, ContextNode&);
373
379 YF_API ReductionStatus
380 ReduceTail(TermNode&, ContextNode&, TNIter);
382
383
390 YF_API void
391 SetupTraceDepth(ContextNode& ctx, const string& name = yimpl("$__depth"));
392
393
395
396
405 YF_API TermNode
407 TransformForSeparator(const TermNode&, const ValueObject&, const ValueObject&,
408 const TokenValue& = {});
409
411 YF_API TermNode
412 TransformForSeparatorRecursive(const TermNode&, const ValueObject&,
413 const ValueObject&, const TokenValue& = {});
415
423 YF_API ReductionStatus
424 ReplaceSeparatedChildren(TermNode&, const ValueObject&, const ValueObject&);
426
427
429
430
435 template<typename _func>
436 struct WrappedContextHandler
437 : private ystdex::equality_comparable<WrappedContextHandler<_func>>
438 {
439 _func Handler;
440
442
443 template<typename _tParam, yimpl(typename
444 = ystdex::exclude_self_t<WrappedContextHandler, _tParam>)>
445 WrappedContextHandler(_tParam&& arg)
446 : Handler(yforward(arg))
447 {}
448 template<typename _tParam1, typename _tParam2, typename... _tParams>
449 WrappedContextHandler(_tParam1&& arg1, _tParam2&& arg2, _tParams&&... args)
450 : Handler(yforward(arg1), yforward(arg2), yforward(args)...)
451 {}
452
453 DefDeCopyMoveCtorAssignment(WrappedContextHandler)
455
456 template<typename... _tParams>
457 ReductionStatus
458 operator()(_tParams&&... args) const
459 {
460 Handler(yforward(args)...);
461 return ReductionStatus::Clean;
462 }
463
469 friend PDefHOp(bool, ==, const WrappedContextHandler& x,
470 const WrappedContextHandler& y)
471 ImplRet(YSLib::AreEqualHeld(x.Handler, y.Handler))
472 };
473
474 template<class _tDst, typename _func>
475 inline _tDst
476 WrapContextHandler(_func&& h, ystdex::false_)
477 {
478 return WrappedContextHandler<YSLib::GHEvent<ystdex::make_function_type_t<
479 void, ystdex::make_parameter_tuple_t<typename _tDst::BaseType>>>>(
480 yforward(h));
481 }
482 template<class, typename _func>
483 inline _func
484 WrapContextHandler(_func&& h, ystdex::true_)
485 {
486 return yforward(h);
487 }
488 template<class _tDst, typename _func>
489 inline _tDst
490 WrapContextHandler(_func&& h)
491 {
492 using BaseType = typename _tDst::BaseType;
493
494 // XXX: It is a hack to adjust the convertible result for the expanded
495 // caller here. It should have been implemented in %GHEvent, however types
496 // those cannot convert to expanded caller cannot be SFINAE'd out,
497 // otherwise it would cause G++ 5.4 crash with internal compiler error:
498 // "error reporting routines re-entered".
499 return A1::WrapContextHandler<_tDst>(yforward(h), ystdex::or_<
500 std::is_constructible<BaseType, _func&&>,
501 std::is_constructible<BaseType, ystdex::expanded_caller<
502 typename _tDst::FuncType, ystdex::decay_t<_func>>>>());
503 }
505
506
508
509
515 class YF_API FormContextHandler
516 : private ystdex::equality_comparable<FormContextHandler>
517 {
518 public:
519 ContextHandler Handler;
524 std::function<bool(const TermNode&)> Check{IsBranch};
525
527 template<typename _func,
528 yimpl(typename = ystdex::exclude_self_t<FormContextHandler, _func>)>
529 FormContextHandler(_func&& f)
530 : Handler(A1::WrapContextHandler<ContextHandler>(yforward(f)))
531 {}
533 template<typename _func, typename _fCheck>
534 FormContextHandler(_func&& f, _fCheck c)
535 : Handler(A1::WrapContextHandler<ContextHandler>(yforward(f))), Check(c)
536 {}
538 DefDeCopyMoveCtorAssignment(FormContextHandler)
539
540
545 friend PDefHOp(bool, ==, const FormContextHandler& x,
546 const FormContextHandler& y)
547 ImplRet(x.Handler == y.Handler)
548
563 ReductionStatus
564 operator()(TermNode&, ContextNode&) const;
565 };
566
567
574 class YF_API StrictContextHandler
575 : private ystdex::equality_comparable<StrictContextHandler>
576 {
577 public:
579 FormContextHandler Handler;
580
582 template<typename _func,
583 yimpl(typename = ystdex::exclude_self_t<StrictContextHandler, _func>)>
584 StrictContextHandler(_func&& f)
585 : Handler(yforward(f))
586 {}
588 template<typename _func, typename _fCheck>
589 StrictContextHandler(_func&& f, _fCheck c)
590 : Handler(yforward(f), c)
591 {}
593 DefDeCopyMoveCtorAssignment(StrictContextHandler)
594
595
596 friend PDefHOp(bool, ==, const StrictContextHandler& x,
597 const StrictContextHandler& y)
598 ImplRet(x.Handler == y.Handler)
599
609 ReductionStatus
610 operator()(TermNode&, ContextNode&) const;
611 };
613
614
616
617 template<typename... _tParams>
618 inline void
619 RegisterForm(ContextNode& ctx, const string& name, _tParams&&... args)
620 {
621 NPL::RegisterContextHandler(ctx, name,
622 FormContextHandler(yforward(args)...));
623 }
624
626 template<typename... _tParams>
627 inline ContextHandler
628 ToContextHandler(_tParams&&... args)
629 {
630 return StrictContextHandler(yforward(args)...);
631 }
632
638 template<typename... _tParams>
639 inline void
640 RegisterStrict(ContextNode& ctx, const string& name, _tParams&&... args)
641 {
642 NPL::RegisterContextHandler(ctx, name, ToContextHandler(yforward(args)...));
643 }
645
659 YF_API void
660 RegisterSequenceContextTransformer(EvaluationPasses&, ContextNode&,
661 const TokenValue&, const ValueObject&, bool = {});
662
663
669 inline PDefH(void, AssertBranch, const TermNode& term,
670 const char* msg = "Invalid term found.") ynothrowv
671 ImplExpr(yunused(msg), YAssert(IsBranch(term), msg))
672
679 inline PDefH(size_t, FetchArgumentN, const TermNode& term) ynothrowv
680 ImplRet(AssertBranch(term), term.size() - 1)
681
682
684
685
687
694 YF_API ReductionStatus
695 EvaluateDelayed(TermNode&);
703 YF_API ReductionStatus
704 EvaluateDelayed(TermNode&, DelayedTerm&);
706
738 YF_API ReductionStatus
739 EvaluateIdentifier(TermNode&, const ContextNode&, string_view);
740
757 YF_API ReductionStatus
758 EvaluateLeafToken(TermNode&, ContextNode&, string_view);
760
774 YF_API ReductionStatus
775 ReduceCombined(TermNode&, ContextNode&);
776
784 YF_API ReductionStatus
785 ReduceLeafToken(TermNode&, ContextNode&);
787
788
798 YF_API observer_ptr<ValueNode>
799 ResolveName(const ContextNode&, string_view);
800
808 YF_API pair<shared_ptr<Environment>, bool>
809 ResolveEnvironment(ValueObject&);
811 inline PDefH(pair<shared_ptr<Environment> YPP_Comma bool>, ResolveEnvironment,
812 TermNode& term)
813 ImplRet(ResolveEnvironment(ReferenceTerm(term).Value))
815
816
826 YF_API void
827 SetupDefaultInterpretation(ContextNode&, EvaluationPasses);
828
829
830 /*
831 \brief REPL 上下文。
832 \warning 非虚析构。
833 \since build 740
834
835 REPL 表示读取-求值-输出循环。
836 每个循环包括一次翻译。
837 这只是一个基本的可扩展实现。功能通过操作数据成员控制。
838 */
839 class YF_API REPLContext
840 {
841 public:
843 ContextNode Root{};
845 TermPasses Preprocess{};
847 EvaluationPasses ListTermPreprocess{};
848
856 REPLContext(bool = {});
857
864 void
866 LoadFrom(std::istream&);
867 void
868 LoadFrom(std::streambuf&);
870
877 TermNode
878 Perform(string_view);
879
889 void
890 Process(TermNode&);
891 TermNode
892 Process(const TokenList&);
893 TermNode
894 Process(const Session&);
896 };
897
898
903 namespace Forms
904 {
905
913 YF_API bool
914 IsSymbol(const string&) ynothrow;
915
917
918
922 YF_API TokenValue
923 StringToSymbol(const string&);
924
926 YF_API const string&
927 SymbolToString(const TokenValue&) ynothrow;
929
930
945 inline PDefH(ReductionStatus, Retain, const TermNode& term) ynothrowv
947 ImplRet(AssertBranch(term), ReductionStatus::Retained)
948
949
955 YF_API size_t
956 RetainN(const TermNode&, size_t = 1);
958
959
961
962
967 template<typename _func>
969 auto
970 CheckSymbol(string_view n, _func f) -> decltype(f())
971 {
972 if(!n.empty() && IsNPLASymbol(n))
973 return f();
974 else
975 throw ParameterMismatch(
976 "Invalid token found for symbol parameter.");
977 }
978
980 template<typename _func>
981 auto
982 CheckParameterLeafToken(string_view n, _func f) -> decltype(f())
983 {
984 if(n != "#ignore")
985 CheckSymbol(n, f);
986 }
988
1018 YF_API void
1019 BindParameter(ContextNode&, const TermNode&, TermNode&);
1020
1037 YF_API void
1038 MatchParameter(const TermNode&, TermNode&,
1039 std::function<void(TNIter, TNIter, const TokenValue&)>,
1040 std::function<void(const TokenValue&, TermNode&&)>);
1042
1043
1044
1045
1057 template<typename _func, typename... _tParams>
1058 void
1059 CallUnary(_func&& f, TermNode& term, _tParams&&... args)
1060 {
1061 RetainN(term);
1062 YSLib::EmplaceCallResult(term.Value, ystdex::invoke_nonvoid(
1063 ystdex::make_expanded<void(TermNode&, _tParams&&...)>(yforward(f)),
1064 YSLib::Deref(std::next(term.begin())), yforward(args)...));
1065 }
1066
1067 template<typename _type, typename _func, typename... _tParams>
1068 void
1069 CallUnaryAs(_func&& f, TermNode& term, _tParams&&... args)
1070 {
1071 Forms::CallUnary([&](TermNode& node){
1072 // XXX: Blocked. 'yforward' cause G++ 5.3 crash: internal compiler
1073 // error: Segmentation fault.
1074 return ystdex::make_expanded<void(_type&, _tParams&&...)>(yforward(f))(
1075 NPL::AccessTerm<_type>(node), std::forward<_tParams&&>(args)...);
1076 }, term);
1077 }
1079
1085 template<typename _func, typename... _tParams>
1086 void
1087 CallBinary(_func&& f, TermNode& term, _tParams&&... args)
1088 {
1089 RetainN(term, 2);
1090
1091 auto i(term.begin());
1092 auto& x(YSLib::Deref(++i));
1093
1094 YSLib::EmplaceCallResult(term.Value, ystdex::invoke_nonvoid(
1095 ystdex::make_expanded<void(TermNode&, TermNode&, _tParams&&...)>(
1096 yforward(f)), x, YSLib::Deref(++i), yforward(args)...));
1097 }
1098
1099 template<typename _type, typename _func, typename... _tParams>
1100 void
1101 CallBinaryAs(_func&& f, TermNode& term, _tParams&&... args)
1102 {
1103 RetainN(term, 2);
1104
1105 auto i(term.begin());
1106 auto& x(NPL::AccessTerm<_type>(YSLib::Deref(++i)));
1107
1108 YSLib::EmplaceCallResult(term.Value, ystdex::invoke_nonvoid(
1109 ystdex::make_expanded<void(_type&, _type&, _tParams&&...)>(yforward(f)),
1110 x, NPL::AccessTerm<_type>(YSLib::Deref(++i)), yforward(args)...));
1111 }
1113
1119 template<typename _type, typename _func, typename... _tParams>
1120 void
1121 CallBinaryFold(_func f, _type val, TermNode& term, _tParams&&... args)
1122 {
1123 const auto n(FetchArgumentN(term));
1124 auto i(term.begin());
1125 const auto j(ystdex::make_transform(++i, [](TNIter it){
1126 return NPL::AccessTerm<_type>(YSLib::Deref(it));
1127 }));
1128
1129 YSLib::EmplaceCallResult(term.Value, std::accumulate(j, std::next(j,
1130 typename std::iterator_traits<decltype(j)>::difference_type(n)), val,
1131 ystdex::bind1(f, std::placeholders::_2, yforward(args)...)));
1132 }
1133
1134
1145
1147 template<typename _func>
1149 struct UnaryExpansion
1150 : private ystdex::equality_comparable<UnaryExpansion<_func>>
1151 {
1152 _func Function;
1153
1155 UnaryExpansion(_func f)
1156 : Function(f)
1157 {}
1158
1163 friend PDefHOp(bool, ==, const UnaryExpansion& x, const UnaryExpansion& y)
1164 ImplRet(ystdex::examiners::equal_examiner::are_equal(x.Function,
1165 y.Function))
1166
1167
1168 template<typename... _tParams>
1169 inline void
1170 operator()(_tParams&&... args) const
1171 {
1172 Forms::CallUnary(Function, yforward(args)...);
1173 }
1174 };
1175
1176
1178 template<typename _type, typename _func>
1179 struct UnaryAsExpansion
1180 : private ystdex::equality_comparable<UnaryAsExpansion<_type, _func>>
1181 {
1182 _func Function;
1183
1185 UnaryAsExpansion(_func f)
1186 : Function(f)
1187 {}
1188
1193 friend PDefHOp(bool, ==, const UnaryAsExpansion& x,
1194 const UnaryAsExpansion& y)
1195 ImplRet(ystdex::examiners::equal_examiner::are_equal(x.Function,
1196 y.Function))
1197
1198
1199 template<typename... _tParams>
1200 inline void
1201 operator()(_tParams&&... args) const
1202 {
1203 Forms::CallUnaryAs<_type>(Function, yforward(args)...);
1204 }
1205 };
1207
1208
1210
1211 template<typename _func>
1213 struct BinaryExpansion
1214 : private ystdex::equality_comparable<BinaryExpansion<_func>>
1215 {
1216 _func Function;
1217
1219 BinaryExpansion(_func f)
1220 : Function(f)
1221 {}
1222
1227 friend PDefHOp(bool, ==, const BinaryExpansion& x, const BinaryExpansion& y)
1228 ImplRet(ystdex::examiners::equal_examiner::are_equal(x.Function,
1229 y.Function))
1230
1231 template<typename... _tParams>
1232 inline void
1233 operator()(_tParams&&... args) const
1234 {
1235 Forms::CallBinary(Function, yforward(args)...);
1236 }
1237 };
1238
1239
1241 template<typename _type, typename _func>
1242 struct BinaryAsExpansion
1243 : private ystdex::equality_comparable<BinaryAsExpansion<_type, _func>>
1244 {
1245 _func Function;
1246
1248 BinaryAsExpansion(_func f)
1249 : Function(f)
1250 {}
1251
1256 friend PDefHOp(bool, ==, const BinaryAsExpansion& x,
1257 const BinaryAsExpansion& y)
1258 ImplRet(ystdex::examiners::equal_examiner::are_equal(x.Function,
1259 y.Function))
1260
1261 template<typename... _tParams>
1262 inline void
1263 operator()(_tParams&&... args) const
1264 {
1265 Forms::CallBinaryAs<_type>(Function, yforward(args)...);
1266 }
1267 };
1269
1270
1271
1277 template<typename _func>
1278 void
1279 RegisterStrictUnary(ContextNode& ctx, const string& name, _func f)
1280 {
1281 RegisterStrict(ctx, name, UnaryExpansion<_func>(f));
1282 }
1283 template<typename _type, typename _func>
1284 void
1285 RegisterStrictUnary(ContextNode& ctx, const string& name, _func f)
1286 {
1287 RegisterStrict(ctx, name, UnaryAsExpansion<_type, _func>(f));
1288 }
1290
1296 template<typename _func>
1297 void
1298 RegisterStrictBinary(ContextNode& ctx, const string& name, _func f)
1299 {
1300 RegisterStrict(ctx, name, BinaryExpansion<_func>(f));
1301 }
1302 template<typename _type, typename _func>
1303 void
1304 RegisterStrictBinary(ContextNode& ctx, const string& name, _func f)
1305 {
1306 RegisterStrict(ctx, name, BinaryAsExpansion<_type, _func>(f));
1307 }
1309
1310
1312
1313 /*
1314 \note 实现特殊形式。
1315 \throw InvalidSyntax 语法错误。
1316 */
1318
1340 YF_API void
1341 DefineLazy(TermNode&, ContextNode&);
1342
1350 YF_API void
1351 DefineWithNoRecursion(TermNode&, ContextNode&);
1352
1359 YF_API void
1360 DefineWithRecursion(TermNode&, ContextNode&);
1362
1377 YF_API void
1378 Undefine(TermNode&, ContextNode&, bool);
1379
1380
1391 YF_API ReductionStatus
1392 If(TermNode&, ContextNode&);
1393
1418 YF_API void
1419 Lambda(TermNode&, ContextNode&);
1420
1439 YF_API void
1440 Vau(TermNode&, ContextNode&);
1441
1452 YF_API void
1453 VauWithEnvironment(TermNode&, ContextNode&);
1455
1456
1457
1472 YF_API ReductionStatus
1473 And(TermNode&, ContextNode&);
1474
1484 YF_API ReductionStatus
1485 Or(TermNode&, ContextNode&);
1487
1488
1489
1498 YF_API void
1499 CallSystem(TermNode&);
1500
1511 YF_API ReductionStatus
1512 Cons(TermNode&);
1513
1515
1516
1523 YF_API void
1524 EqualReference(TermNode&);
1525
1533 YF_API void
1534 EqualValue(TermNode&);
1536
1538
1548 YF_API ReductionStatus
1549 Eval(TermNode&, ContextNode&);
1550
1555 YF_API void
1556 EvaluateUnit(TermNode&, const REPLContext&);
1558
1571 YF_API void
1572 MakeEnvironment(TermNode&);
1573
1583 YF_API void
1584 GetCurrentEnvironment(TermNode&, ContextNode&);
1585
1596 YF_API ReductionStatus
1597 ValueOf(TermNode&, const ContextNode&);
1599
1600
1602
1603
1609 YF_API ContextHandler
1610 Wrap(const ContextHandler&);
1611
1613
1614
1620 YF_API ContextHandler
1621 WrapOnce(const ContextHandler&);
1622
1629 YF_API ContextHandler
1630 Unwrap(const ContextHandler&);
1632
1633
1634 } // namespace Forms;
1635
1636 } // namesapce A1;
1637
1638 } // namespace NPL;
1639
1640 #endif
1641
NPL::A1::EvaluateIdentifier
YF_API ReductionStatus EvaluateIdentifier(TermNode &, const ContextNode &, string_view)
求值标识符。
Definition: NPLA1.cpp:817
ystdex::bind1
auto bind1(_func &&f, _tParams &&...args) -> decltype(std::bind(std::forward< decltype(f)>(f), std::placeholders::_1, std::forward< decltype(args)>(args)...))
复合调用 std::bind 和 std::placeholders::_1 。
Definition: functional.hpp:623
ystdex::derived_entity
派生类实体。
Definition: base.h:177
NPL::ReferenceTerm
YF_API TermNode & ReferenceTerm(TermNode &)
访问项并取解析 TermReference 间接值后的引用。
Definition: NPLA.cpp:424
NPL::A1::Forms::Undefine
YF_API void Undefine(TermNode &, ContextNode &, bool)
移除名称绑定。 非强制时移除不存在的名称。
Definition: NPLA1.cpp:1216
NPL::A1::RegisterForm
void RegisterForm(ContextNode &ctx, const string &name, _tParams &&...args)
Definition: NPLA1.h:619
NPL::A1::EvaluateDelayed
YF_API ReductionStatus EvaluateDelayed(TermNode &, DelayedTerm &)
求值指定的延迟求值项。
Definition: NPLA1.cpp:807
ystdex::expanded_caller
接受冗余参数的可调用对象。
Definition: functional.hpp:1171
NPL::A1::Forms::CallUnary
void CallUnary(_func &&f, TermNode &term, _tParams &&...args)
访问节点并调用一元函数。
Definition: NPLA1.h:1059
platform::msg
const string & msg
Definition: Debug.h:464
NPL::A1::InvokeLiteral
YF_API ReductionStatus InvokeLiteral(TermNode &, ContextNode &, string_view)
调用字面量遍。
Definition: NPLA1.cpp:544
NPL::A1::ValueToken::Unspecified
未指定值。
ystdex::true_
bool_< true > true_
Definition: type_traits.hpp:391
CatchThrow
#define CatchThrow(_ex,...)
指定抛出指定异常作为异常处理器。
Definition: YBaseMacro.h:141
NPL::A1::ReduceCheckedClosure
YF_API void ReduceCheckedClosure(TermNode &, ContextNode &, bool, TermNode &)
规约闭包。
Definition: NPLA1.cpp:600
NPL::A1::FormContextHandler
形式上下文处理器。
Definition: NPLA1.h:515
NPL::A1::Forms::EqualValue
YF_API void EqualValue(TermNode &)
比较两个子项的值相等。
Definition: NPLA1.cpp:1378
YSLib::GEvent
事件模板。
Definition: YEvent.hpp:306
NPL::A1::EvaluateLeafToken
YF_API ReductionStatus EvaluateLeafToken(TermNode &, ContextNode &, string_view)
求值叶节点记号。
Definition: NPLA1.cpp:854
ystdex::bad_any_cast
动态泛型转换失败异常。
Definition: any.h:628
NPL::A1::TransformNode
YF_API ValueNode TransformNode(const TermNode &, NodeMapper={}, NodeMapper=MapNPLALeafNode, NodeToString=ParseNPLANodeString, NodeInserter=InsertChild)
变换 NPLA1 节点 S 表达式抽象语法树为 NPLA1 语义结构。 第三至五参数为空。
Definition: NPLA1.cpp:76
NPL::A1::Forms::CallBinary
void CallBinary(_func &&f, TermNode &term, _tParams &&...args)
访问节点并调用二元函数。
Definition: NPLA1.h:1087
NPL::A1::Forms::CallBinaryFold
void CallBinaryFold(_func f, _type val, TermNode &term, _tParams &&...args)
访问节点并以指定的初始值为基础逐项调用二元函数。
Definition: NPLA1.h:1121
NPL::A1::Forms::CheckParameterLeafToken
auto CheckParameterLeafToken(string_view n, _func f) -> decltype(f())
检查记号值是符合匹配条件的参数符号。
Definition: NPLA1.h:982
NPL::A1::ReduceTail
YF_API ReductionStatus ReduceTail(TermNode &, ContextNode &, TNIter)
移除容器第一个子项到指定迭代器的项后规约。
Definition: NPLA1.cpp:678
NPL::A1::ValueToken::Null
NPL::ContextNode
上下文节点。
Definition: NPLA.h:1174
NPL::A1::InsertChild
YF_API void InsertChild(TermNode &&, TermNode::Container &)
插入 NPLA1 子节点。
Definition: NPLA1.cpp:63
NPL::A1::InsertSequenceChild
YF_API void InsertSequenceChild(TermNode &&, NodeSequence &)
Definition: NPLA1.cpp:70
platform::Deref
yconstfn auto Deref(_type &&p) -> decltype(*p)
断言并解引用非空指针。
Definition: Debug.h:451
YSLib::UI::y
SPos SPos y
Definition: YWidget.cpp:44
NPL::x
const TermNode &term ynothrow const TermNode &term ynothrow const TermNode &term ynothrow TermNode &term const TermNode &term ValueNode &node const ValueNode &node const _type & x
Definition: SContext.h:94
NPL::A1::Forms::StringToSymbol
YF_API TokenValue StringToSymbol(const string &)
创建等于指定字符串值的记号值。
Definition: NPLA1.cpp:1045
NPL::A1::Forms::EvaluateUnit
YF_API void EvaluateUnit(TermNode &, const REPLContext &)
创建参数指定的 REPL 的副本并在其中对翻译单元规约以求值。
Definition: NPLA1.cpp:1397
NPL::A1::NPLA1Tag
NPLA1 元标签。
Definition: NPLA1.h:51
NPL::NodeToString
std::function< string(const ValueNode &)> NodeToString
Definition: NPLA.h:114
NPL::NodeMapper
std::function< ValueNode(const TermNode &)> NodeMapper
节点映射操作类型：变换节点为另一个节点。
Definition: NPLA.h:110
ystdex::false_
bool_< false > false_
Definition: type_traits.hpp:392
NPL::A1::WrappedContextHandler::WrappedContextHandler
WrappedContextHandler(_tParam &&arg)
Definition: NPLA1.h:445
NPL::A1::Forms::Wrap
YF_API ContextHandler Wrap(const ContextHandler &)
包装合并子为应用子。
Definition: NPLA1.cpp:1447
YModules.h
CHRLib::f
f(d, s)
NPL::A1::Forms::BinaryExpansion::BinaryExpansion
BinaryExpansion(_func f)
Definition: NPLA1.h:1219
YSLib::AreEqualHeld
yconstfn bool AreEqualHeld(const _type1 &x, const _type2 &y)
判断动态泛型的持有值是否相等。
Definition: YObject.h:228
NPL::A1::Forms::CallBinaryAs
void CallBinaryAs(_func &&f, TermNode &term, _tParams &&...args)
Definition: NPLA1.h:1101
ystdex::or_
Definition: type_traits.hpp:438
NPL::A1::ImplRet
const TermNode &term ynothrowv ImplRet(AssertBranch(term), term.size()-1) YF_API ReductionStatus EvaluateDelayed(TermNode &)
求值以节点数据结构间接表示的项。
NPL::A1::RegisterStrict
void RegisterStrict(ContextNode &ctx, const string &name, _tParams &&...args)
注册严格上下文处理器。
Definition: NPLA1.h:640
NPL::A1::RegisterSequenceContextTransformer
YF_API void RegisterSequenceContextTransformer(EvaluationPasses &, ContextNode &, const TokenValue &, const ValueObject &, bool={})
注册分隔符转换变换和处理例程。
Definition: NPLA1.cpp:787
NPL::A1::Forms::Cons
YF_API ReductionStatus Cons(TermNode &)
接受两个参数，返回以第一个参数作为首项插入第二个参数创建的新的列表。
Definition: NPLA1.cpp:1332
NPL::Session
会话：分析指定 NPL 代码。
Definition: SContext.h:103
yimpl
#define yimpl(...)
实现标签。
Definition: ydef.h:262
NPL::A1::Forms::CallSystem
YF_API void CallSystem(TermNode &)
调用 UTF-8 字符串的系统命令，并保存 int 类型的结果到项的值中。
Definition: NPLA1.cpp:1325
NPL::A1::Forms::If
YF_API ReductionStatus If(TermNode &, ContextNode &)
条件判断：根据求值的条件取表达式。
Definition: NPLA1.cpp:1236
NPL::ReductionStatus
ReductionStatus
规约状态：一遍规约可能的中间结果。
Definition: NPLA.h:633
YSLib::LoggedEvent
记录日志的异常事件类。
Definition: YException.h:50
NPL::A1::to_string
string to_string(ValueToken vt)
Definition: NPLA1.cpp:44
TryRet
#define TryRet(...)
指定表达式在 try 块中求值并返回。
Definition: YBaseMacro.h:124
NPL::A1::ValueToken::GroupingAnchor
DefDeCopyMoveCtorAssignment
#define DefDeCopyMoveCtorAssignment(_t)
Definition: YBaseMacro.h:202
CHRLib::args
_tParams && args
Definition: CharacterProcessing.h:538
NPL::A1::Forms::MakeEnvironment
YF_API void MakeEnvironment(TermNode &)
创建以参数指定的环境列表作为父环境的新环境。 异常中立：由 Environment 的构造函数抛出。 ...
Definition: NPLA1.cpp:1405
NPL::A1::SetupDefaultInterpretation
void SetupDefaultInterpretation(ContextNode &root, EvaluationPasses passes)
Definition: NPLA1.cpp:958
NPL::A1::REPLContext
Definition: NPLA1.h:839
ystdex::invoke_nonvoid
nonvoid_result_t< result_of_t< _fCallable &&(_tParams &&...)> > invoke_nonvoid(_fCallable &&f, _tParams &&...args)
调用可调用对象，保证返回值非空。
Definition: functional.hpp:372
NPL::A1::AccessListPassesRef
YF_API EvaluationPasses & AccessListPassesRef(ContextNode &)
访问列表遍。
Definition: NPLA1.cpp:514
NPL::A1::Forms::CheckSymbol
auto CheckSymbol(string_view n, _func f) -> decltype(f())
检查记号值是符合匹配条件的符号。
Definition: NPLA1.h:970
NPL::A1::Forms::SymbolToString
YF_API const string & SymbolToString(const TokenValue &) ynothrow
取符号对应的名称字符串。
Definition: NPLA1.cpp:1051
NPL::A1::YAssert
YAssert(IsBranch(term), msg)) inline PDefH(size_t
取项的参数个数：子项数减 1 。
NPL::A1::Forms::Lambda
YF_API void Lambda(TermNode &, ContextNode &)
λ 抽象：求值为一个捕获当前上下文的严格求值的函数。
Definition: NPLA1.cpp:1261
NPL::ContextHandler
YSLib::GHEvent< ReductionStatus(TermNode &, ContextNode &)> ContextHandler
上下文处理器类型。
Definition: NPLA.h:1230
NPL::A1::ReduceFirst
con ctx ctx YF_API ReductionStatus ReduceFirst(TermNode &, ContextNode &)
规约第一个子项。
Definition: NPLA1.cpp:656
NPL::A1::LoadNode
ValueNode LoadNode(_type &&tree, _tParams &&...args)
加载 NPLA1 翻译单元。
Definition: NPLA1.h:154
NPL::A1::ReduceCombined
YF_API ReductionStatus ReduceCombined(TermNode &, ContextNode &)
规约合并项：检查项的第一个子项尝试作为操作符进行函数应用，并规范化。
Definition: NPLA1.cpp:895
NPL::A1::ValueToken
ValueToken
值记号：节点中的值的占位符。
Definition: NPLA1.h:59
NPL::A1::Forms::DefineWithRecursion
YF_API void DefineWithRecursion(TermNode &, ContextNode &)
Definition: NPLA1.cpp:1204
NPL::A1::Forms::ValueOf
YF_API ReductionStatus ValueOf(TermNode &, const ContextNode &)
求值标识符得到指称的实体。
Definition: NPLA1.cpp:1434
ystdex::any
基于类型擦除的动态泛型对象。
Definition: any.h:845
NPL::A1::Forms::UnaryExpansion::UnaryExpansion
UnaryExpansion(_func f)
Definition: NPLA1.h:1155
ystdex::dep_ops::equality_comparable
_t< details::ops_seq< _type, _type2, _tOpt, cond_t< is_same< _type, _type2 >, index_sequence< 7 >, index_sequence< 6, 7, 8 >>>> equality_comparable
Definition: operators.hpp:243
YSLib::ValueObject
值类型对象类。
Definition: YObject.h:539
NPL::A1::ReduceOrdered
YF_API ReductionStatus ReduceOrdered(TermNode &, ContextNode &)
规约有序序列：顺序规约子项，结果为最后一个子项的规约结果。
Definition: NPLA1.cpp:663
NPL::A1::Forms::UnaryAsExpansion
Definition: NPLA1.h:1179
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:766
NPL::A1::Forms::RegisterStrictBinary
void RegisterStrictBinary(ContextNode &ctx, const string &name, _func f)
Definition: NPLA1.h:1304
NPL::NodeInserter
GNodeInserter< TermNode::Container & > NodeInserter
Definition: NPLA.h:119
NPL::A1::StrictContextHandler::Handler
FormContextHandler Handler
Definition: NPLA1.h:579
NPL::A1::Forms::MatchParameter
YF_API void MatchParameter(const TermNode &, TermNode &, std::function< void(TNIter, TNIter, const TokenValue &)>, std::function< void(const TokenValue &, TermNode &&)>)
匹配参数。 异常中立：参数指定的处理器为空。
Definition: NPLA1.cpp:1114
ystdex::sfmt
auto sfmt(const _tChar *fmt,...) -> decltype(vsfmt(fmt, std::declval< std::va_list >()))
以 C 标准输出格式的输出 std::basic_string 实例的对象。
Definition: string.hpp:1200
ystdex
特性测试宏。
Definition: ydef.h:822
NPL::Environment
环境。
Definition: NPLA.h:982
NPL::ParseNPLANodeString
YF_API string ParseNPLANodeString(const ValueNode &)
解析 NPLA 节点字符串。
Definition: NPLA.cpp:80
ystdex::make_parameter_tuple_t
_t< make_parameter_tuple< _fCallable >> make_parameter_tuple_t
Definition: functional.hpp:425
NPL::TermNode
yimpl(ValueNode) TermNode
项节点：存储语法分析结果的值类型节点。
Definition: SContext.h:51
YSLib::i
return i
Definition: YCoreUtilities.h:176
NPL::A1::WrappedContextHandler::DefDeCopyMoveCtorAssignment
DefDeCopyMoveCtorAssignment(WrappedContextHandler) template< typename..._tParams > ReductionStatus operator()(_tParams &&...args) const
Definition: NPLA1.h:453
NPL::A1::InvokeLeaf
YF_API ReductionStatus InvokeLeaf(TermNode &term, ContextNode &)
调用叶遍。
Definition: NPLA1.cpp:532
NPL::A1::ReplaceSeparatedChildren
YF_API ReductionStatus ReplaceSeparatedChildren(TermNode &, const ValueObject &, const ValueObject &)
查找项中的指定分隔符，若找到则替换项为去除分隔符并添加替换前缀的形式。
Definition: NPLA1.cpp:736
NPL::A1::StrictContextHandler::StrictContextHandler
StrictContextHandler(_func &&f)
Definition: NPLA1.h:584
ystdex::examiners::equal::are_equal
static auto are_equal(_type1 &&x, _type2 &&y) -> decltype(bool(x==y))
Definition: examiner.hpp:53
YF_API
#define YF_API
Definition: Platform.h:56
NPL::A1::ReduceChildrenOrdered
con ctx ctx YF_API ReductionStatus ReduceChildrenOrdered(TNIter, TNIter, ContextNode &)
有序规约子项。
Definition: NPLA1.cpp:643
NPL::ImplExpr
YF_API const char src const string const char const char *src ImplExpr(InstallDirectory(string(dst), string(src))) YF_API YB_NONNULL(1
安装硬链接：创建硬链接，失败则安装文件。
NPL::A1::AccessLeafPassesRef
YF_API EvaluationPasses & AccessLeafPassesRef(ContextNode &)
访问叶遍。
Definition: NPLA1.cpp:508
NPL::A1::Forms::Vau
YF_API void Vau(TermNode &, ContextNode &)
vau 抽象：求值为一个捕获当前上下文的非严格求值的函数。
Definition: NPLA1.cpp:1277
NPL::A1::WrappedContextHandler::Handler
_func Handler
Definition: NPLA1.h:439
NPL::A1::Forms::BinaryAsExpansion
Definition: NPLA1.h:1242
NPL::A1::FormContextHandler::FormContextHandler
FormContextHandler(_func &&f, _fCheck c)
Definition: NPLA1.h:534
NPL::A1::Forms::BinaryAsExpansion::BinaryAsExpansion
BinaryAsExpansion(_func f)
Definition: NPLA1.h:1248
yunused
#define yunused(...)
标记未使用的表达式。
Definition: ydef.h:968
NPL::A1::Forms::CallUnaryAs
void CallUnaryAs(_func &&f, TermNode &term, _tParams &&...args)
Definition: NPLA1.h:1069
NPL::A1::Forms::IsSymbol
YF_API bool IsSymbol(const string &) ynothrow
判断字符串值是否可构成符号。
Definition: NPLA1.cpp:1039
NPL::A1::Forms::Unwrap
YF_API ContextHandler Unwrap(const ContextHandler &)
从应用子中取操作子。
Definition: NPLA1.cpp:1462
NPL::A1::ReduceChecked
con ctx ctx YF_API void ReduceChecked(TermNode &, ContextNode &)
规约并检查成功：调用 Reduce 并检查结果。
Definition: NPLA1.cpp:594
ynothrowv
#define ynothrowv
YSLib 无异常抛出保证验证：有条件地使用无异常抛出规范。
Definition: ydef.h:786
ystdex::bad_any_cast::from
const char * from() const
Definition: any.cpp:44
CHRLib::e
const char const char * e
Definition: CharacterProcessing.h:109
NPL::A1::Forms::UnaryAsExpansion::UnaryAsExpansion
UnaryAsExpansion(_func f)
Definition: NPLA1.h:1185
NPL::A1::Reduce
YF_API ReductionStatus Reduce(TermNode &, ContextNode &)
NPLA1 表达式节点规约：调用至少一次求值例程规约子表达式。
Definition: NPLA1.cpp:552
YSLib::ValueNode
值类型节点。
Definition: ValueNode.h:58
NPL::A1::Forms::RegisterStrictUnary
void RegisterStrictUnary(ContextNode &ctx, const string &name, _func f)
Definition: NPLA1.h:1285
ystdex::exclude_self_t
enable_if_t<!is_same< _tClass &, decay_t< _tParam > & >::value, _type > exclude_self_t
移除选择类类型的特定重载避免构造模板和复制/转移特殊成员函数冲突。
Definition: type_traits.hpp:748
NPL::TokenList
list< string > TokenList
Definition: SContext.h:42
NPL::A1::TransformForSeparator
YF_API TermNode TransformForSeparator(const TermNode &, const ValueObject &, const ValueObject &, const TokenValue &={})
变换分隔符中缀表达式为前缀表达式。
Definition: NPLA1.cpp:708
NPL::A1::WrappedContextHandler
包装上下文处理器。
Definition: NPLA1.h:436
NPL::A1::Forms::UnaryAsExpansion::Function
_func Function
Definition: NPLA1.h:1182
NPL::A1::ValueToken::OrderedAnchor
NPL::A1::ResolveName
YF_API observer_ptr< ValueNode > ResolveName(const ContextNode &, string_view)
解析名称：处理保留名称并查找名称。
Definition: NPLA1.cpp:939
NPL::MapNPLALeafNode
YF_API ValueNode MapNPLALeafNode(const TermNode &)
映射 NPLA 叶节点。
Definition: NPLA.cpp:38
YSLib::NodeSequence
yimpl(YSLib::vector)< ValueNode > NodeSequence
节点序列容器。
Definition: ValueNode.h:1239
NPL::A1::Forms::BinaryAsExpansion::Function
_func Function
Definition: NPLA1.h:1245
NPL::A1::Forms::DefineWithNoRecursion
YF_API void DefineWithNoRecursion(TermNode &, ContextNode &)
Definition: NPLA1.cpp:1195
NPL
Definition: NPL/Configuration.h:34
NPL::ReductionStatus::Clean
规约成功终止且不需要保留子项。
NPL::A1::StrictContextHandler
严格上下文处理器。
Definition: NPLA1.h:574
NPL::NPLATag
NPLA 元标签。
Definition: NPLA.h:77
platform::Descriptions::Warning
Definition: YCommon.h:167
NPL::A1::Forms::RetainN
ReductionStatus::Retained YF_API size_t RetainN(const TermNode &, size_t=1)
保留经检查确保具有指定个数参数的项：保留求值。
Definition: NPLA1.cpp:1058
NPL::A1::Forms::UnaryExpansion::Function
_func Function
Definition: NPLA1.h:1152
NPL::A1::WrapContextHandler
_tDst WrapContextHandler(_func &&h, ystdex::false_)
Definition: NPLA1.h:476
NPL::A1::TransformForSeparatorRecursive
YF_API TermNode TransformForSeparatorRecursive(const TermNode &, const ValueObject &, const ValueObject &, const TokenValue &={})
Definition: NPLA1.cpp:725
NPL::TNIter
TermNode::iterator TNIter
Definition: SContext.h:53
NPL::A1::Forms::BindParameter
YF_API void BindParameter(ContextNode &, const TermNode &, TermNode &)
使用操作数结构化匹配并绑定参数。
Definition: NPLA1.cpp:1069
YSLib::UI::name
yconstfn const string & name
Definition: Loader.h:130
NPL::A1::PDefH
PDefH(void, ReduceArguments, TermNode::Container &con, ContextNode &ctx) ImplRet(ReduceArguments(con.begin()
CHRLib::c
c
Definition: CharacterProcessing.h:81
yforward
#define yforward(_expr)
根据参数类型使用 std::forward 传递对应参数。
Definition: ydef.h:995
NPL::A1::Forms::WrapOnce
YF_API ContextHandler WrapOnce(const ContextHandler &)
类型不符合要求。
Definition: NPLA1.cpp:1453
NPL::A1::Forms::VauWithEnvironment
YF_API void VauWithEnvironment(TermNode &, ContextNode &)
带环境的 vau 抽象：求值为一个捕获当前上下文的非严格求值的函数。
Definition: NPLA1.cpp:1292
YPP_Comma
#define YPP_Comma
替换为逗号的预处理记号。
Definition: ydef.h:225
NPL::A1::ToContextHandler
ContextHandler ToContextHandler(_tParams &&...args)
转换上下文处理器。
Definition: NPLA1.h:628
NPL::A1::Forms::And
YF_API ReductionStatus And(TermNode &, ContextNode &)
逻辑与。
Definition: NPLA1.cpp:1312
NPL::A1::ReduceArguments
YF_API void ReduceArguments(TNIter, TNIter, ContextNode &)
对范围内的第二项开始逐项规约。
Definition: NPLA1.cpp:583
NPL::NodeSequenceInserter
GNodeInserter< NodeSequence > NodeSequenceInserter
Definition: NPLA.h:121
NPL::A1::TransformNodeSequence
YF_API ValueNode TransformNodeSequence(const TermNode &, NodeMapper={}, NodeMapper=MapNPLALeafNode, NodeToString=ParseNPLANodeString, NodeSequenceInserter=InsertSequenceChild)
变换 NPLA1 节点 S 表达式抽象语法树为 NPLA1 序列语义结构。 第三至五参数为空。
Definition: NPLA1.cpp:113
NPL::A1::Forms::UnaryExpansion
保存函数展开调用的函数对象。
Definition: NPLA1.h:1149
NPL::A1::InvokeGuard
YF_API Guard InvokeGuard(TermNode &term, ContextNode &)
调用守护遍。
Definition: NPLA1.cpp:526
NPL::A1::Forms::Or
YF_API ReductionStatus Or(TermNode &, ContextNode &)
逻辑或。
Definition: NPLA1.cpp:1318
NPL::A1::SetupTraceDepth
YF_API void SetupTraceDepth(ContextNode &ctx, const string &name=yimpl("$__depth"))
设置跟踪深度节点：调用规约时显示深度和上下文等信息。
Definition: NPLA1.cpp:688
NPL::A1::FetchArgumentN
FetchArgumentN
Definition: NPLA1.h:679
NPL::ParameterMismatch
参数匹配失败。
Definition: NPLA.h:459
NPL::A1::FormContextHandler::Handler
ContextHandler Handler
Definition: NPLA1.h:519
ystdex::size
auto size(const _tRange &c) -> decltype(c.size())
类容器访问。
Definition: range.hpp:233
NPL::A1::InvokeList
YF_API ReductionStatus InvokeList(TermNode &term, ContextNode &)
调用列表遍。
Definition: NPLA1.cpp:538
NPL::A1::ReduceChildren
YF_API void ReduceChildren(TNIter, TNIter, ContextNode &)
规约子项。
Definition: NPLA1.cpp:633
NPL::A1::AccessGuardPassesRef
YF_API GuardPasses & AccessGuardPassesRef(ContextNode &)
访问守护遍。
Definition: NPLA1.cpp:502
ystdex::bad_any_cast::to
const char * to() const
Definition: any.cpp:51
NPL::A1::Forms::Eval
YF_API ReductionStatus Eval(TermNode &, ContextNode &)
对指定项按指定的环境求值。
Definition: NPLA1.cpp:1384
NPL::A1::LoadNodeSequence
ValueNode LoadNodeSequence(_type &&tree, _tParams &&...args)
Definition: NPLA1.h:165
NPL::A1::WrappedContextHandler::WrappedContextHandler
WrappedContextHandler(_tParam1 &&arg1, _tParam2 &&arg2, _tParams &&...args)
Definition: NPLA1.h:449
NPL::A1::Forms::DefineLazy
YF_API void DefineLazy(TermNode &, ContextNode &)
定义。 绑定匹配失败。
Definition: NPLA1.cpp:1187
NPL::A1::Forms::EqualReference
YF_API void EqualReference(TermNode &)
比较两个子项的值相等。
Definition: NPLA1.cpp:1372
NPL::A1::ReduceLeafToken
YF_API ReductionStatus ReduceLeafToken(TermNode &, ContextNode &)
规约提取名称的叶节点记号。 标识符未声明。
Definition: NPLA1.cpp:929
NPL::A1::AccessLiteralPassesRef
YF_API LiteralPasses & AccessLiteralPassesRef(ContextNode &)
访问字面量遍。
Definition: NPLA1.cpp:520
NPL::A1::ValueToken::Undefined
未定义值。
ystdex::make_function_type_t
_t< make_function_type< _tRet, _tTuple >> make_function_type_t
Definition: functional.hpp:581
NPL::A1::FormContextHandler::FormContextHandler
FormContextHandler(_func &&f)
Definition: NPLA1.h:529
NPL::A1::Forms::BinaryExpansion
Definition: NPLA1.h:1213
NPL::A1::Forms::GetCurrentEnvironment
YF_API void GetCurrentEnvironment(TermNode &, ContextNode &)
取包含当前环境的上下文引用。
Definition: NPLA1.cpp:1427
NPL::ReductionStatus::Retained
规约成功但需要保留子项。
ystdex::string_view
basic_string_view< char > string_view
Definition: string_view.hpp:415
NPL::A1::Forms::BinaryExpansion::Function
_func Function
Definition: NPLA1.h:1216
platform::KeyCategory::Function
表示功能键。
Definition: Keys.h:119
NPL::A1::StrictContextHandler::StrictContextHandler
StrictContextHandler(_func &&f, _fCheck c)
Definition: NPLA1.h:589
NPL::A1::ResolveEnvironment
YF_API pair< shared_ptr< Environment >, bool > ResolveEnvironment(ValueObject &)
解析环境。
Definition: NPLA1.cpp:946