- The tool consumes a single preprocessed C++ source file, the following syntax is collected for this purpose.
- The syntax has less restrictions than the real C++ language specification, because the tool assumes the input is correct.
- Add exception messages so that the final application won't crash leaving nothing.
-
Built-in types and functions can be found here
__is_*
and__has_*
return null, arguments could be expressions or types, create a new Expr subclass.- This should be handled since arguments are not expressions
- When more built-in things are found, list below:
- Types
__make_integer_seq<A, B, Size>
->A<B>
__underlying_type
->int
// should be enum's integral type
- Functions (by default: ADL searching found nothing and evaluate to no type)
__builtin_addressof(EXPR)
->&EXPR
without calling overloaded operators__builtin_huge_valf(...)
-> float__builtin_nanf(...)
-> float__builtin_nansf(...)
-> float
- Types
-
DocGen.ps1
-
DocGen.ps1 build-website
buildsWebsiteSource
and download websites. -
DocGen.ps1 copy
copies files fromwebsite
,website-doc1
, code index HTML files,Cpp.js
,Cpp.css
.favicon.ico
tovczh-libraries.github.io
. - Fix signature for Curry.
-
- Refine document comment
- Generate
C++ name -> <symbols>
file, so that<article>
could have hyper-links to document pages - VlppParser
- Fix document for
ParsingTable
- Add
header:
in codegen so that generated files have license comment - Enable writing XML documents for AST
- Regenerate XML and JSON parser
- Fix document for
- Workflow
- Mark license on source files, generated files and codegen tools
- Add header and comments to generated file
- Syntax
- GacUI
- Mark license on source files, generated files and codegen tools
- Add header and comments to generated file
- XML Syntax
- XML virtual class list
- XML class to C++ class mapping
- Generate
- Improve
WebsiteSource
- Convert
<seealso cref="CREF"/>
to<seealsos><symbol/>...</seealsos>
. -
FileIndex.xml
: file tree view -
SymbolIndex.xml
: symbol tree view, fragments will be generated inWebsiteSource
-
Sources/Source.html
: HTML fragment for source files, hyper links are converted to numbers -
Sources/Source.js
: hyper link information forSource.html
- generate a completed list of article pages to a text file for
npm run download
.
- Convert
- Connect reflection symbols to C++ symbols
-
this
used in field initializer.
- When
ParseIdExpr
is called forNAME::
, it needs to tellResolveSymbolInContext
to always ignore value symbols. - Create symbol for
friend class X;
. - Fix memory leaks.
- STL Demo
- Remove special handling for
common_type_t<...>
- Remove special handling for
- TypePrinter Demo
- Ensure that
X<T>
intemplate<typename T> void X<T>::F(){}
points to the correct partial specializations.
- Ensure that
- Move
__forceinline
before declarator name to declaration.- Along with
virtual
and everything that could happen before a name.
- Along with
- Core
-
GenericExpr
allows to be partially applied only whenGenericExpr
is directly in aFuncAccessExpr::expr
. - Consider about default values when matching partial specializations (both in GenericType and SpecializationSpec).
-
IFT_InferTemplateArgument.cpp
Visit(GenericType* self)
able to process multiple primary instances. -
MatchPSArgument
ondecltype(EXPR)
, success when the type to match is notdecltype(EXPR)
, or two expression match. -
IsSameResolvedExprVisitor
on lambda expressions. -
std::initialization_list
. - Converting lambda expression to a struct instead of
any_t
. -
auto
parameters on lambda expression. - Pass variadic template argument to placement new expression.
- Create multiple instances if
T<THIS>
is evaluated to multiple type. -
GenerateMembers
onDeclInstance
.- Generate
ClassMemberCache
for generated special members. - Generate special members for declarations with
specializationSpec
.
- Generate
-
- Render
- Add link to
#include "File"
and#include <File>
. - Attach document content to declarations.
- Enable markdown inside xml elements in comment.
- Resolve symbols in markdown in comment.
- Enable
<example>
with predefined project types, extract all example, compile and index them. - Refactor the HTML generation part to becomes a library.
- Extract
<div>
token rendering functions.
- Extract
- Add link to
Consumable UTF-32 code points:
- Punctuators:
_ { } [ ] # ( ) < > % : ; . ? * + - / ^ & | ~ ! = , \ " '
- Legal characters in identifiers:
00A8, 00AA, 00AD, 00AF, 00B2-00B5, 00B7-00BA, 00BC-00BE, 00C0-00D6, 00D8-00F6, 00F8-00FF, 0100-02FF, 0370-167F, 1681-180D, 180F-1DBF, 1E00-1FFF, 200B-200D, 202A-202E, 203F-2040, 2054, 2060-206F, 2070-20CF, 2100-218F, 2460-24FF, 2776-2793, 2C00-2DFF, 2E80-2FFF, 3004-3007, 3021-302F, 3031-303F, 3040-D7FF, F900-FD3D, FD40-FDCF, FDF0-FE1F, FE30-FE44, FE47-FFFD, 10000-1FFFD, 20000-2FFFD, 30000-3FFFD, 40000-4FFFD, 50000-5FFFD, 60000-6FFFD, 70000-7FFFD, 80000-8FFFD, 90000-9FFFD, A0000-AFFFD, B0000-BFFFD, C0000-CFFFD, D0000-DFFFD, E0000-EFFFD
- Legal characters in identifiers except the first:
0300-036F, 1DC0-1DFF, 20D0-20FF, FE20-FE2F
- Keywords: Keywords
- Integers:
(\d+('?\d+)*|0x[0-9a-fA-F]+)[uU]?[lL]?[lL]?
- Floating:
(\d+\.|\.\d+|\d+.\d+)([eE][+-]?\d+)?[fFlL]?
- Binaries:
0[bB]\d+
- Strings:
(u|U|L|u8)?"([^\"]|\\.)*"
- Raw Strings:
(u|U|L|u8)?R"<name>([anything that is not ')<name>"']*)<name>"
- Characters:
(u|U|L|u8)?'([^\']|\\.)'
- User-Defined Literals: Integer, character, float-point, boolean and string literals followed by an identifier without any delimiter.
- Comment:
//[^/\r\n]?[^\r\n]*\r?\n
/\*([^*]|\*+[^*/])*\*/
///[^\r\n]*\r?\n
: It can be put before any declaration for documentation
[ X ]
: optional{ X }
: repeating 0+ times{ X }+
:X {X}
{ X Y ... }
:[X {Y X}]
{ X Y ... }+
:X {Y X}
( X )
: priorityX | Y
: alternation
- Type parser function: parse a type, with zero, optional or more declarator.
- zero declarator: still need a declarator, but it cannot have an identity name. e.g. type in generic type
- optional declarator: the declarator has optional identity name. e.g. function parameter
- else: each declarator should have an identity name. e.g. variable declaration
- Declarator parser function: parse a type, with (maybe) optional identity name.
Specifiers can be put before any declaration, it will be ignored by the tool
- attributes: e.g.
[[noreturn]]
__declspec( ... )
- {
constexpr
|const
|volatile
|&
|&&
}+
__cdecl
__clrcall
__stdcall
__fastcall
__thiscall
__vectorcall
noexcept
throw
(
{TYPE,
...})
=
EXPR{
{EXPR,
...}}
(
{EXPR,
...})
- When this initializer is ambiguous a function declaration, the initializer wins.
(
{TYPE-OPTIONAL [INITIALIZER],
...})
{QUALIFIERS | EXCEPTION-SPEC |->
TYPE |override
)}
operator
OPERATOR- IDENTIFIER [SPECIALIZATION-SPEC]: Only allowed for functions
- SPECIFIERS DECLARATOR
- CALL DECLARATOR
alignas
(
EXPR)
DECLARATOR- TYPE
::
DECLARATOR (
DECLARATOR)
- (
*
[__ptr32
|__ptr64
] |&
|&&
) DECLARATOR - (
constexpr
|const
|volatile
) DECLARATOR - DECLARATOR
[
[EXPR]]
- DECLARATOR FUNCTION-TAIL
template
<
{TEMPLATE-SPEC-ITEM,
...}>
- TEMPLATE-SPEC-ITEM:
- TYPE-OPTIONAL-INITIALIZER
- (
template
|class
) [...
] [IDENTIFIER] [=
TYPE] - TEMPLATE-SPEC
class
[IDENTIFIER] [=
TYPE]
<
{TYPE | EXPR}>
- [TEMPLATE-SPEC] {
static
|virtual
|explicit
|inline
|__forceinline
} TYPE-SINGLE (;
| STAT) [ = (0
|default
|delete
)- TEMPLATE-SPEC
- SPECIALIZATION-SPEC
- [TEMPLATE-SPEC] {
static
|virtual
|explicit
|inline
|__forceinline
}operator
TYPE-ZERO (;
| STAT) [ = (0
|default
|delete
)- TEMPLATE-SPEC
- [TEMPLATE-SPEC] (
class
|struct
) [[SPECIFIERS] IDENTIFIER [SPECIALIZATION-SPEC]] [abstract
] [:
{TYPE,
...}+] [{
{DECL}}
- TEMPLATE-SPEC: Not allowed when the class is defined after
typedef
, or is anonymous followed by variable declaration. - SPECIALIZATION-SPEC
- TEMPLATE-SPEC: Not allowed when the class is defined after
enum
[class
|struct
] [[SPECIFIERS]IDENTIFIER] [:
TYPE] [{
{IDENTIFIER [=
EXPR],
...} [,
]}
- [TEMPLATE-SPEC]
union
[[SPECIFIERS]IDENTIFIER [SPECIALIZATION-SPEC]] [{
{DECL}}
- TEMPLATE-SPEC: Not allowed when the class is defined after
typedef
, or is anonymous followed by variable declaration. - SPECIALIZATION-SPEC
- TEMPLATE-SPEC: Not allowed when the class is defined after
- Friend:
friend
DECL;
- Extern"
extern
[STRING] (DECL;
|{
{DECLARATION ...}}
) - Type definition: (CLASS_STRUCT | ENUM | UNION) {DECLARATOR [INITIALIZER]
,
...}+;
- Type alias:
typedef
(CLASS_STRUCT | ENUM | UNION) {DECLARATOR,
...}+;
(no template)typedef
TYPE-MULTIPLE-INITIALIZER;
(no template)- TEMPLATE-SPEC and SPECIALIZATION-SPEC are disallowed here
- Type definition: [TEMPLATE-SPEC]
using
IDENTIFIER=
TYPE;
(no specialization)- TEMPLATE-SPEC
- Import:
using
{ [typename
] [TYPE::
IDENTIFIER],
...};
- Variable: {
register
|static
|thread_local
|mutable
} TYPE-MULTIPLE-INITIALIZER;
- TEMPLATE-SPEC: for value aliases
- Namespace
namespace
{IDENTIFIER::
...}+{
{DECLARATION}}
- Ctor, Dtor: [
~
] IDENTIFIER ({TYPE [DECLARATOR] [INITIALIZER],
...}) [EXCEPTION-SPEC] STAT - FUNCTION
auto
decltype
(
(EXPR))
- (
constexpr
|const
|volatile
) TYPE - TYPE (
constexpr
|const
|volatile
) void
|bool
char
|wchar_t
|char16_t
|char32_t
- [
signed
|unsigned
] (__int8
|__int16
|__int32
|__int64
|__m64
|__m128
|__m128d
|__m128i
) - [TYPE
::
[typename
]] IDENTIFIER - TYPE
<
{(TYPE | EXPR),
...}+>
- TYPE
...
- IDENTIFIER
:
STAT default
:
STATcase
EXPR:
STAT;
{
{STAT ...}}
- {EXPR
,
...}+;
- DECL
break
;
continue
;
while
(
EXPR)
STATdo
STATwhile
(
EXPR)
;
for
([TYPE {[DECLARATOR] [INITIALIZER],
...}];
[EXPR];
[EXPR]) STATfor
(TYPE-SINGLE-DECLARATOR:
EXPR) STATif
[constexpr
](
[STAT;
] [TYPE IDENTIFIER=
] EXPR)
STAT [else
STAT]switch
(
{STAT} EXPR)
{
STAT}
try
STATcatch
(
TYPE-OPTIONAL-DECLARATOR)
STATreturn
EXPR;
goto
IDENTIFIER;
__try
STAT__except
(
EXPR)
STAT__try
STAT__finally
STAT__leave
;
- (
__if_exists
|__if_not_exists
)(
EXPR)
STAT
- LITERAL
{
...}
this
nullptr
- IDENTIFIER
::
IDENTIFIER- TYPE
::
IDENTIFIER (
EXPR-WITH-COMMA)
- OPERATOR EXPR
- predefined operators
- EXPR OPERATOR
- EXPR
(
{EXPR,
...})
- EXPR
[
EXPR]
- EXPR
<
{TYPE,
...}>
- predefined operators
- EXPR
- EXPR OPERATOR EXPR
- EXPR (
.
|->
) IDENTIFIER - EXPR (
.*
|->*
) EXPR - predefined operators
- EXPR (
- EXPR
?
EXPR:
EXPR - (
dynamic_cast
|static_cast
|const_cast
|reinterpret_cast
|safe_cast
)<
TYPE>
(
EXPR)
typeid
(
(TYPE | EXPR))
sizeof
[...
] EXPR...
sizeof
[...
](
TYPE)
...
(
TYPE)
EXPRnew
[(
{EXPR,
...}+)
] TYPE [(
{EXPR,
... })
| [{
{EXPR,
... }}
]]delete
[[
]
] EXPRthrow
EXPR- EXPR
...
::new
::delete
[
{&
|=
| [IDENTIFIER=
] EXPR | }]
FUNCTION-TAIL STAT
Built-in Operators, Precedence and Associativity
- : primitive
- :
::
- :
.
->
[]
()
x++
x--
- (<-):
sizeof
new
delete
++x
--x
~
!
-x
+x
&x
*x
(T)E
- :
.*
->*
- :
*
/
%
- :
+
-
- :
<<
>>
- :
<
>
<=
>=
- :
==
!=
- :
&
- :
^
- :
|
- :
&&
- :
||
- (<-):
a?b:c
- (<-):
=
*=
/=
%=
+=
-=
<<=
>>=
&=
|=
^=
- (<-):
throw
- :
,