YSTest: Lexical.h 源文件

YSTest PreAlpha_b900_20201012 The YSLib Test Project

Lexical.h
浏览该文件的文档.
1 /*
2 © 2012-2020 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 YF_INC_NPL_Lexical_h_
29 #define YF_INC_NPL_Lexical_h_ 1
30
31 #include "YModules.h"
32 #include YFM_NPL_NPL // for byte, CHAR_MIN, ystdex::unwrap_ref_decay_t,
33 // ystdex::remove_reference_t, ystdex::detected_or_t, YSLib::lref, YSLib::pair;
34 #include YFM_YSLib_Core_YFunc // for YSLib::function;
35 #include YFM_YSLib_Adaptor_YTextBase // for YSLib::pmr, YSLib::begin,
36 // YSLib::end, YSLib::function, YSLib::list, YSLib::set, YSLib::shared_ptr,
37 // YSLib::string, YSLib::string_view, YSLib::vector;
38 #include <cctype> // for std::isgraph;
39
40 namespace NPL
41 {
42
44 namespace pmr = YSLib::pmr;
46 using YSLib::begin;
48 using YSLib::end;
50 using YSLib::function;
52 using YSLib::list;
54 using YSLib::lref;
56 using YSLib::pair;
58 using YSLib::set;
60 using YSLib::shared_ptr;
62 using YSLib::string;
64 using YSLib::string_view;
66 using YSLib::vector;
67
75 using LexemeList = list<string>;
76
78
79 using SourceName = shared_ptr<string>;
81
82
86 struct YF_API SourceLocation final
87 {
88 size_t Line = 0;
89 size_t Column = 0;
90
91 DefDeCtor(SourceLocation)
92 SourceLocation(size_t line, size_t col)
93 : Line(line), Column(col)
94 {}
96 DefDeCopyCtor(SourceLocation)
97
98 DefDeCopyAssignment(SourceLocation)
99
100 PDefH(void, Newline, ) ynothrow
101 ImplUnseq(++Line, Column = 0)
102
103 PDefH(void, Step, ) ynothrow
104 ImplExpr(++Column)
105 };
106
107
109 using SourceInformation = pair<SourceName, SourceLocation>;
111
112
118 class YF_API UnescapeContext
119 {
120 public:
131 size_t Start = size_t(-1);
133 size_t Length = 0;
135
137 DefDeCtor(UnescapeContext)
138 DefDeCopyMoveCtorAssignment(UnescapeContext)
139
140 DefPred(const ynothrow, Handling, Length != 0)
141
143 PDefH(void, Clear, ) ynothrow
144 ImplExpr(Length = 0)
145
147 PDefH(void, VerifyBufferLength, size_t len) const
148 ImplExpr(yunused(len), YAssert(Length == 0 || Start + Length <= len,
149 "Invalid unescaping state found."))
150 };
151
152
154
155
160 YB_ATTR_nodiscard YF_API bool
162 HandleBackslashPrefix(string_view, UnescapeContext&);
163
165 YB_ATTR_nodiscard YB_PURE yconstfn
166 PDefH(bool, IgnorePrefix, string_view buf, UnescapeContext&) ynothrow
167 ImplRet(yunused(buf), YAssert(!buf.empty(), "Invalid buffer found."), false)
169
185 YB_ATTR_nodiscard YF_API bool
186 NPLUnescape(string&, char, UnescapeContext&, char);
188
189
209 class YF_API LexicalAnalyzer
210 {
211 private:
217 UnescapeContext unescape_context{};
222 char ld = {};
223
224 public:
226 DefDeCtor(LexicalAnalyzer)
228 DefDeCopyMoveCtorAssignment(LexicalAnalyzer)
229
230
231 DefGetter(const ynothrow, char, Delimiter, ld)
233 DefGetter(const ynothrow, const UnescapeContext&, UnescapeContext,
234 unescape_context)
235
269 template<class _tCharBuffer,
270 typename _fUnescape = decltype(NPLUnescape),
271 typename _fPrefixHandler = decltype(HandleBackslashPrefix)>
272 YB_ATTR_nodiscard bool
273 FilterChar(char c, _tCharBuffer& cbuf, _fUnescape unescape = NPLUnescape,
274 _fPrefixHandler handle_prefix = HandleBackslashPrefix)
275 {
276 // XXX: Incomplete escape sequence at end is ignored at current.
277 // XXX: Null characters are consistently unhandled here.
278 if(!unescape_context.IsHandling())
279 {
280 cbuf += c;
281 return !handle_prefix(cbuf, unescape_context);
282 }
283 unescape(cbuf, c, unescape_context, ld);
284 return {};
285 }
286
293 template<typename... _tParams>
294 inline void
295 ParseQuoted(char c, _tParams&&... args)
296 {
297 yunused(FilterChar(c, yforward(args)...));
298 }
299
308 bool
309 UpdateBack(char&, char);
310 };
311
312
322 YB_ATTR_nodiscard YF_API YB_PURE char
323 CheckLiteral(string_view) ynothrowv;
324
331 YB_ATTR_nodiscard YB_PURE inline
333 PDefH(string_view, DeliteralizeUnchecked, string_view sv) ynothrowv
334 ImplRet(YAssertNonnull(sv.data()), ystdex::get_mid(sv))
335
336 YB_ATTR_nodiscard YB_PURE inline
338 PDefH(string_view, Deliteralize, string_view sv) ynothrowv
339 ImplRet(CheckLiteral(sv) != char() ? DeliteralizeUnchecked(sv) : sv)
341
346 YB_ATTR_nodiscard YF_API YB_PURE string
347 Escape(string_view);
348
356 YB_ATTR_nodiscard YF_API YB_PURE string
357 EscapeLiteral(string_view);
358
366 YB_ATTR_nodiscard YF_API YB_PURE string
367 EscapeXML(string_view);
368
375 YB_ATTR_nodiscard YF_API YB_PURE string
376 Literalize(string_view, char = '"');
378
379
381
382 YB_ATTR_nodiscard YB_STATELESS yconstfn
384 PDefH(bool, IsGraphicalDelimiter, char c) ynothrow
385 ImplRet(c == '(' || c == ')' || c == ',' || c == ';')
386
387 YB_ATTR_nodiscard YB_PURE inline PDefH(bool, IsDelimiter, char c) ynothrow
389 #if CHAR_MIN < 0
390 ImplRet(c >= 0 && (!std::isgraph(c) || IsGraphicalDelimiter(c)))
391 #else
392 ImplRet(!std::isgraph(c) || IsGraphicalDelimiter(c))
393 #endif
394
395
396
403 YB_ATTR_nodiscard YF_API YB_PURE LexemeList
404 Decompose(string_view, LexemeList::allocator_type = {});
405
406
428 template<class _tParser>
430 using MemberParseResult = typename _tParser::ParseResult;
431
437 template<typename _fParse>
438 using ParserClassOf
439 = ystdex::remove_reference_t<ystdex::unwrap_ref_decay_t<_fParse>>;
440
447 template<typename _fParse>
448 using ParseResultOf = ystdex::detected_or_t<LexemeList, MemberParseResult,
449 ParserClassOf<_fParse>>;
450
456 template<typename _fParse>
457 using GParserResult = const ParseResultOf<_fParse>&;
459
460
462
463
467 class BufferedByteParserBase
468 {
469 private:
470 lref<LexicalAnalyzer> lexer_ref;
472 string buffer{};
473
474 public:
475 BufferedByteParserBase(LexicalAnalyzer& lexer,
476 pmr::polymorphic_allocator<yimpl(byte)> a = {})
477 : lexer_ref(lexer), buffer(a)
478 {}
479
480 DefDeCopyMoveCtorAssignment(BufferedByteParserBase)
481
482 DefGetter(const ynothrow, const string&, Buffer, buffer)
483 DefGetter(ynothrow, string&, BufferRef, buffer)
484 DefGetter(const ynothrow, LexicalAnalyzer&, LexerRef, lexer_ref)
485 DefGetter(ynothrow, char&, BackRef, buffer.back())
486
494 PDefH(size_t, QueryLastDelimited, char ld) const ynothrow
495 ImplRet(buffer.length() - (ld != char() ? 1 : 0))
496
501 PDefH(void, reserve, size_t n)
502 ImplExpr(buffer.reserve(n))
503
504 friend DefSwap(ynothrow, BufferedByteParserBase,
505 std::swap(_x.lexer_ref, _y.lexer_ref), std::swap(_x.buffer, _y.buffer))
506 };
507
508
519 class YF_API ByteParser : private BufferedByteParserBase
520 {
521 public:
523 using ParseResult = vector<string>;
524
525 private:
527
528 mutable ParseResult lexemes{};
531 bool update_current = {};
533
534 public:
535 ByteParser(LexicalAnalyzer& lexer,
536 pmr::polymorphic_allocator<yimpl(byte)> a = {})
537 : BufferedByteParserBase(lexer, a), lexemes(a)
538 {}
540
541 ByteParser(const ByteParser& parse)
542 : BufferedByteParserBase(parse),
543 lexemes(parse.lexemes, parse.lexemes.get_allocator()),
544 update_current(parse.update_current)
545 {}
546 DefDeMoveCtor(ByteParser)
547
548
549 PDefHOp(ByteParser&, =, const ByteParser& parse)
550 ImplRet(ystdex::copy_and_swap(*this, parse))
551 DefDeMoveAssignment(ByteParser)
553
560 template<typename... _tParams>
561 inline void
562 operator()(char c, _tParams&&... args)
563 {
564 auto& lexer(GetLexerRef());
565
566 Update(lexer.FilterChar(c, GetBufferRef(), yforward(args)...)
567 && lexer.UpdateBack(GetBackRef(), c));
568 }
569
571 DefPred(const ynothrow, Updating, update_current)
572
573
574
575 using BufferedByteParserBase::GetBuffer;
576 using BufferedByteParserBase::GetBufferRef;
577 using BufferedByteParserBase::GetLexerRef;
579
585 DefGetter(const ynothrow, const ParseResult&, Result, lexemes)
586
587 private:
589
590 YB_FLATTEN void
591 Update(bool);
592
593 public:
594 using BufferedByteParserBase::reserve;
595
596 friend DefSwap(ynothrow, ByteParser,
597 swap(static_cast< BufferedByteParserBase&>(_x),
598 static_cast< BufferedByteParserBase&>(_y)), swap(_x.lexemes, _y.lexemes),
599 std::swap(_x.update_current, _y.update_current))
601 };
602
603
611 class YF_API SourcedByteParser : private BufferedByteParserBase
612 {
613 public:
614 using ParseResult = vector<pair<SourceLocation, string>>;
615
616 private:
618
619 mutable ParseResult lexemes{};
620 bool update_current = {};
622 SourceLocation source_location{0, 0};
623
624 public:
625 SourcedByteParser(LexicalAnalyzer& lexer,
626 pmr::polymorphic_allocator<yimpl(byte)> a = {})
627 : BufferedByteParserBase(lexer, a), lexemes(a)
628 {}
629 SourcedByteParser(const SourcedByteParser& parse)
630 : BufferedByteParserBase(parse),
631 lexemes(parse.lexemes, parse.lexemes.get_allocator()),
632 update_current(parse.update_current),
633 source_location(parse.source_location)
634 {}
635 DefDeMoveCtor(SourcedByteParser)
636
637 PDefHOp(SourcedByteParser&, =, const SourcedByteParser& parse)
638 ImplRet(ystdex::copy_and_swap(*this, parse))
639 DefDeMoveAssignment(SourcedByteParser)
640
641 template<typename... _tParams>
642 inline void
643 operator()(char c, _tParams&&... args)
644 {
645 auto& lexer(GetLexerRef());
646
647 Update(lexer.FilterChar(c, GetBufferRef(), yforward(args)...)
648 && lexer.UpdateBack(GetBackRef(), c));
649 if(c != '\n')
650 source_location.Step();
651 else
652 source_location.Newline();
653 }
654
656 DefPred(const ynothrow, Updating, update_current)
657
658 using BufferedByteParserBase::GetBuffer;
659 using BufferedByteParserBase::GetBufferRef;
660 using BufferedByteParserBase::GetLexerRef;
661 DefGetter(const ynothrow, const ParseResult&, Result, lexemes)
662 DefGetter(const ynothrow, const SourceLocation&, SourceLocation,
663 source_location)
664
665 private:
666 YB_FLATTEN void
667 Update(bool);
668
669 public:
670 using BufferedByteParserBase::reserve;
671
672 friend DefSwap(ynothrow, SourcedByteParser,
673 swap(static_cast<BufferedByteParserBase&>(_x),
674 static_cast<BufferedByteParserBase&>(_y)), swap(_x.lexemes, _y.lexemes),
675 std::swap(_x.update_current, _y.update_current),
676 std::swap(_x.source_location, _y.source_location))
677 };
678
679
689 class YF_API DelimitedByteParser : private BufferedByteParserBase
690 {
691 private:
693 vector<size_t> qlist{};
694
695 public:
696 DelimitedByteParser(LexicalAnalyzer& lexer,
697 pmr::polymorphic_allocator<yimpl(byte)> a)
698 : BufferedByteParserBase(lexer, a), qlist(a)
699 {}
700 DelimitedByteParser(const DelimitedByteParser& parse)
701 : BufferedByteParserBase(parse),
702 qlist(parse.qlist, parse.qlist.get_allocator())
703 {}
704
705 DefDeMoveCtor(DelimitedByteParser)
706
707
708 PDefHOp(DelimitedByteParser&, =, const DelimitedByteParser& parse)
709 ImplRet(ystdex::copy_and_swap(*this, parse))
710 DefDeMoveAssignment(DelimitedByteParser)
711
718 template<typename... _tParams>
719 inline void
720 operator()(char c, _tParams&&... args)
721 {
722 auto& lexer(GetLexerRef());
723
724 if(lexer.FilterChar(c, GetBufferRef(), yforward(args)...))
725 {
726 if(lexer.UpdateBack(GetBackRef(), c))
727 qlist.push_back(QueryLastDelimited(lexer.GetDelimiter()));
728 }
729 }
730
731 using BufferedByteParserBase::GetBuffer;
732 using BufferedByteParserBase::GetBufferRef;
733 using BufferedByteParserBase::GetLexerRef;
734 DefGetter(const ynothrow, const vector<size_t>&, Quotes, qlist)
740 LexemeList
741 GetResult() const;
742
749 static void
751 DecomposeString(LexemeList&, bool, string_view);
753 static PDefH(void, DecomposeString, LexemeList& lst, string_view sv)
754 ImplExpr(DecomposeString(lst, sv.front() != '\'' && sv.front() != '"',
755 sv))
757
758 using BufferedByteParserBase::reserve;
759
760 friend DefSwap(ynothrow, DelimitedByteParser,
761 swap(static_cast<BufferedByteParserBase&>(_x),
762 static_cast<BufferedByteParserBase&>(_y)),
763 swap(_x.qlist, _y.qlist))
764 };
766
767 } // namespace NPL;
768
769 #endif
770
NPL::SourceLocation
源代码位置。
Definition: Lexical.h:87
YSLib::Drawing::buffer
The boundary is out of the buffer
Definition: YDraw.h:118
NPL::EscapeLiteral
YB_ATTR_nodiscard YF_API YB_PURE string EscapeLiteral(string_view)
编码转义字符串字面量。
Definition: Lexical.cpp:234
NPL::DelimitedByteParser::DefGetter
DefGetter(const ynothrow, const vector< size_t > &, Quotes, qlist) LexemeList GetResult() const
取解析结果。
YB_ATTR_nodiscard
#define YB_ATTR_nodiscard
标记返回值不被忽略的属性。
Definition: ydef.h:715
DefPred
#define DefPred(_q, _n,...)
Definition: YBaseMacro.h:232
ystdex::fseq::front
identity< _type > front(empty_base< _type, _types... >)
Definition: variadic.hpp:74
NPL::SourcedByteParser
记录源代码位置的字节解析器。
Definition: Lexical.h:612
ystdex::cpp2017::swap
void swap(optional< _type > &x, optional< _type > &y)
Definition: optional.h:888
NPL::YAssert
YB_ATTR_nodiscard YB_PURE yconstfn YAssert(!buf.empty(), "Invalid buffer found.")
NPL::ByteParser::DefDeMoveCtor
DefDeMoveCtor(ByteParser) PDefHOp(ByteParser &
复制赋值：使用参数的分配器构造的副本和交换操作。
CHRLib::c
c
Definition: CharacterProcessing.h:84
ystdex::lref
左值引用包装。
Definition: ref.hpp:61
NPL::Decompose
LexemeList Decompose(string_view src, LexemeList::allocator_type a)
Definition: Lexical.cpp:299
YB_PURE
#define YB_PURE
指示函数或函数模板实例为纯函数。
Definition: ydef.h:919
ystdex::detected_or_t
_t< detected_or< _tDefault, _gOp, _tParams... > > detected_or_t
Definition: meta.hpp:407
platform::containers::list
ystdex::list< _type, _tAlloc > list
Definition: Container.h:99
ystdex::get_mid
_tString get_mid(const _tString &str, typename _tString::size_type l=1)
取删除前缀和后缀的子字符串。
Definition: string.hpp:1608
NPL::LexicalAnalyzer
词法分析器。
Definition: Lexical.h:210
NPL::SourcedByteParser::SourcedByteParser
SourcedByteParser(const SourcedByteParser &parse)
Definition: Lexical.h:629
NPL::BufferedByteParserBase::DefDeCopyMoveCtorAssignment
DefDeCopyMoveCtorAssignment(BufferedByteParserBase) DefGetter(const ynothrow
ystdex::cpp2017::string_view
basic_string_view< char > string_view
Definition: string_view.hpp:437
NPL::HandleBackslashPrefix
YB_ATTR_nodiscard YF_API bool HandleBackslashPrefix(string_view, UnescapeContext &)
设置反斜杠转义前缀：当输入 '\' 时设置前缀为 "\\" 。
Definition: Lexical.cpp:36
NPL::string_view
YB_ATTR_nodiscard ctx string_view
Definition: NPLA.h:3020
YB_FLATTEN
#define YB_FLATTEN
标记函数尽可能内联定义内的调用。
Definition: ydef.h:843
platform::size_t
YB_ATTR_nodiscard YF_API size_t
Definition: FileIO.h:1345
NPL::ByteParser::ParseResult
vector< string > ParseResult
Definition: Lexical.h:523
YF_API
#define YF_API
Definition: Platform.h:56
ystdex::copy_and_swap
_type & copy_and_swap(_type &obj, const _type2 &new_val)
复制对象并交换。
Definition: swap.hpp:514
NPL::CheckLiteral
YB_ATTR_nodiscard YF_API YB_PURE char CheckLiteral(string_view) ynothrowv
检查指定字符串是否为字面量。
Definition: Lexical.cpp:147
NPL::DelimitedByteParser::DefDeMoveCtor
DefDeMoveCtor(DelimitedByteParser) PDefHOp(DelimitedByteParser &
复制赋值：使用参数的分配器构造的副本和交换操作。
platform_ex::Windows::Invalid
@ Invalid
Definition: Win32/include/YCLib/MinGW32.h:485
NPL::Deliteralize
YB_ATTR_nodiscard YB_PURE Deliteralize
Definition: Lexical.h:338
ImplUnseq
#define ImplUnseq(...)
Definition: YBaseMacro.h:110
NPL::yunused
yunused(msg)
CHRLib::args
YB_ATTR_nodiscard _tParams && args
Definition: CharacterProcessing.h:649
NPL::SourcedByteParser::Update
Update(lexer.FilterChar(c, GetBufferRef(), yforward(args)...) &&lexer.UpdateBack(GetBackRef(), c))
NPL::Escape
string Escape(string_view sv)
Definition: Lexical.cpp:160
NPL::NPLUnescape
YB_ATTR_nodiscard YB_PURE yconstfn false YB_ATTR_nodiscard YF_API bool NPLUnescape(string &, char, UnescapeContext &, char)
NPL 转义匹配算法。
Definition: Lexical.cpp:48
ystdex::list::allocator_type
_tAlloc allocator_type
Definition: list.hpp:1064
DefDeCopyMoveCtorAssignment
#define DefDeCopyMoveCtorAssignment(_t)
Definition: YBaseMacro.h:202
yforward
#define yforward(_expr)
根据参数类型使用 std::forward 转发对应参数。
Definition: ydef.h:1508
NPL::ByteParser::ByteParser
ByteParser(LexicalAnalyzer &lexer, pmr::polymorphic_allocator< yimpl(byte)> a={})
Definition: Lexical.h:535
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
安装硬链接：创建硬链接，失败则安装文件。
DefSwap
#define DefSwap(_q, _t,...)
定义交换函数。
Definition: YBaseMacro.h:302
NPL::BufferedByteParserBase::lexer_ref
lref< LexicalAnalyzer > lexer_ref
Definition: Lexical.h:470
NPL::ByteParser
字节解析器。
Definition: Lexical.h:520
NPL::SourceLocation::DefDeCtor
DefDeCtor(SourceLocation) SourceLocation(size_t line
YB_STATELESS
#define YB_STATELESS
指示函数或函数模板实例为无状态函数。
Definition: ydef.h:941
NPL::DelimitedByteParser::PDefH
static PDefH(void, DecomposeString, LexemeList &lst, string_view sv) ImplExpr(DecomposeString(lst
ystdex::cpp2017::end
auto end(_tRange &c) -> decltype(c.end())
Definition: range.hpp:345
NPL::GParserResult
const ParseResultOf< _fParse > & GParserResult
泛型解析器结果返回类型。
Definition: Lexical.h:457
std
Definition: optional.h:982
YAssertNonnull
#define YAssertNonnull(_expr)
Definition: cassert.h:165
NPL::ParserClassOf
ystdex::remove_reference_t< ystdex::unwrap_ref_decay_t< _fParse > > ParserClassOf
取参数类型对应的解析器类类型。
Definition: Lexical.h:439
NPL::PDefH
PDefH(void, LiftTermRef, TermNode &term, const TermNode &tm) ImplExpr(NPL PDefH(void, LiftMoved, TermNode &term, const TermReference &ref, bool move) ImplExpr(LiftTermOrCopy(term
提升项引用：使用第二参数指定的项的内容引用替换第一个项的内容。
Definition: NPLA.h:1735
NPL::BufferedByteParserBase::BufferedByteParserBase
BufferedByteParserBase(LexicalAnalyzer &lexer, pmr::polymorphic_allocator< yimpl(byte)> a={})
Definition: Lexical.h:475
NPL::UnescapeContext
反转义上下文。
Definition: Lexical.h:119
NPL::DelimitedByteParser
保存分隔符中间结果字节解析器。
Definition: Lexical.h:690
NPL::EscapeXML
YB_ATTR_nodiscard YF_API YB_PURE string EscapeXML(string_view)
编码 XML 字符串。
Definition: Lexical.cpp:246
platform::containers::set
std::set< _tKey, _fComp, _tAlloc > set
Definition: Container.h:126
platform::containers::vector
std::vector< _type, _tAlloc > vector
Definition: Container.h:102
NPL
Definition: NPL/Configuration.h:35
DefDeCopyAssignment
#define DefDeCopyAssignment(_t)
Definition: YBaseMacro.h:186
NPL::SourcedByteParser::SourcedByteParser
SourcedByteParser(LexicalAnalyzer &lexer, pmr::polymorphic_allocator< yimpl(byte)> a={})
Definition: Lexical.h:625
NPL::ByteParser::ByteParser
ByteParser(const ByteParser &parse)
Definition: Lexical.h:541
YModules.h
YSLib 用户界面模块配置文件。
NPL::ParseResultOf
ystdex::detected_or_t< LexemeList, MemberParseResult, ParserClassOf< _fParse > > ParseResultOf
取解析器结果类型。
Definition: Lexical.h:449
NPL::DelimitedByteParser::DelimitedByteParser
DelimitedByteParser(const DelimitedByteParser &parse)
Definition: Lexical.h:700
NPL::BufferedByteParserBase
具有字符缓冲的字符解析器基类。
Definition: Lexical.h:468
NPL::LexicalAnalyzer::DefDeCtor
DefDeCtor(LexicalAnalyzer) DefDeCopyMoveCtorAssignment(LexicalAnalyzer) DefGetter(const ynothrow
NPL::BufferedByteParserBase::reserve
const string buffer LexicalAnalyzer lexer_ref char ld const ynothrow reserve
Definition: Lexical.h:501
NPL::UnescapeContext::DefDeCtor
DefDeCtor(UnescapeContext) DefDeCopyMoveCtorAssignment(UnescapeContext) DefPred(const ynothrow
ynothrowv
#define ynothrowv
YSLib 无异常抛出保证验证：有条件地使用无异常抛出规范。
Definition: ydef.h:1219
YSLib::Text::buf
YB_ATTR_nodiscard YB_PURE const char * buf
Definition: TextFile.h:83
ystdex
<memory> 特性测试宏。
Definition: ydef.h:1262
YSLib::_tParams
YB_ATTR_nodiscard YB_PURE typename _tParams
Definition: ValueNode.h:1294
NPL::SourceLocation::DefDeCopyCtor
DefDeCopyCtor(SourceLocation) DefDeCopyAssignment(SourceLocation) PDefH(void
NPL::SourcedByteParser::ParseResult
vector< pair< SourceLocation, string > > ParseResult
Definition: Lexical.h:614
platform::KeyCodes::DS::Start
@ Start
Definition: Keys.h:219
NPL::Literalize
YB_ATTR_nodiscard YF_API YB_PURE string Literalize(string_view, char='"')
修饰字符串为字面量。
Definition: Lexical.cpp:291
DefGetter
#define DefGetter(_q, _t, _n,...)
Definition: YBaseMacro.h:241
NPL::MemberParseResult
typename _tParser::ParseResult MemberParseResult
成员 ParseResult 类型。
Definition: Lexical.h:430
ystdex::cpp2014::remove_reference_t
typename remove_reference< _type >::type remove_reference_t
Definition: meta.hpp:155
NPL::swap
void swap(ContextNode &x, ContextNode &y) ynothrow
Definition: NPLA.cpp:1188
NPL::DelimitedByteParser::DelimitedByteParser
DelimitedByteParser(LexicalAnalyzer &lexer, pmr::polymorphic_allocator< yimpl(byte)> a)
Definition: Lexical.h:696
ystdex::function
function_base< function_traits< _fSig, empty_function_policy::throwing >, _fSig > function
函数包装类模板。
Definition: function.hpp:900
const
const Decapsulate const Decapsulate &y ynothrow ContextNode &ctx const
Definition: NPLA1Forms.cpp:1629
DefDeMoveAssignment
#define DefDeMoveAssignment(_t)
Definition: YBaseMacro.h:191
NPL::SourceInformation
pair< SourceName, SourceLocation > SourceInformation
源代码信息。
Definition: Lexical.h:109
ystdex::cpp2017::string
basic_string< char > string
Definition: string.hpp:772
ynothrow
#define ynothrow
YSLib 无异常抛出保证：若支持 noexcept 关键字， 指定特定的 noexcept 异常规范。
Definition: ydef.h:1199
NPL::SourcedByteParser::DefGetter
DefGetter(const ynothrow, const ParseResult &, Result, lexemes) DefGetter(const ynothrow
NPL::LexemeList
list< string > LexemeList
词素列表：待被处理为记号短字符串列表。
Definition: Lexical.h:75
NPL::yimpl
yimpl(using) Reducer
规约器：和绑定上下文以外参数的求值遍的处理器具有等价签名的多态函数。
ystdex::list
列表容器。
Definition: list.hpp:1051
yconstfn
#define yconstfn
指定编译时常量函数。
Definition: ydef.h:1073
ystdex::cpp2017::begin
auto begin(_tRange &c) -> decltype(c.begin())
Definition: range.hpp:323
YSLib::a
YB_PURE const _type * a
Definition: YCoreUtilities.h:168
NPL::SourceName
shared_ptr< string > SourceName
可选的源代码名称。
Definition: Lexical.h:80
NPL::SourcedByteParser::DefDeMoveCtor
DefDeMoveCtor(SourcedByteParser) PDefHOp(SourcedByteParser &
NPL::ImplRet
YB_ATTR_nodiscard YB_PURE PDefH(TermNode &, ReferenceTerm, TermNode &term) ynoexcept_spec(std YB_ATTR_nodiscard YB_PURE yconstfn const TermReference &ref ynothrow ImplRet(ref.IsMovable()) template< typename _tPointer > YB_ATTR_nodiscard YB_PURE inline auto IsMovable(_tPointer p) ynothrow -> decltype(!bool(p)||NPL::IsMovable(*p))
Definition: NPLA.h:1296