File Index Symbol Index

/*********************************************************************** This file is generated by: Vczh Parser Generator From parser definition:ParsingJson.parser.txt Licensed under https://github.com/vczh-libraries/License ***********************************************************************/
#ifndef VCZH_PARSING_JSON_PARSINGJSON_PARSER_PARSER
#define VCZH_PARSING_JSON_PARSINGJSON_PARSER_PARSER
#include "../Parsing.h"
#include "../ParsingDefinitions.h"
#include "../ParsingAutomaton.h"
#include "ParsingJson_Ast.h"
namespace
vl
{
namespace
parsing
{
namespace
json
{
/// <summary>Get the grammar definition for this parser.</summary>
/// <returns>The grammar definition for this parser.</returns>
extern
vl
::
WString
JsonGetParserTextBuffer
();
/// <summary>Convert parser result to a strong typed AST node. Usually you don't need to use this function, unless you are doing meta programming like error recovering or implementing intellisense for an editor.</summary>
/// <returns>Returns the strong typed AST node.</returns>
/// <param name="node">The parser result.</param>
/// <param name="tokens">Tokens for parsing. You can get the <see cref="vl::regex::RegexLexer"/> by calling <see cref="vl::parsing::tabling::ParsingTable::GetLexer"/> from <see cref="JsonLoadTable"/></param>
extern
vl
::
Ptr
<
vl
::
parsing
::
ParsingTreeCustomBase
>
JsonConvertParsingTreeNode
(
vl
::
Ptr
<
vl
::
parsing
::
ParsingTreeNode
>
node
,
const
vl
::
collections
::
List
<
vl
::
regex
::
RegexToken
>&
tokens
);
/// <summary>Create the parser table. You should cache the value if possible, for improving performance.</summary>
/// <returns>The created parser table.</returns>
extern
vl
::
Ptr
<
vl
::
parsing
::
tabling
::
ParsingTable
>
JsonLoadTable
();
/// <summary>Parse a JSON text, it could be an object or an array.</summary>
/// <returns>Returns the parsing result as a weak-typed AST node. Returns null if there is any unrecoverable error during parsing.</returns>
/// <param name="input">The input for parsing.</param>
/// <param name="table">The return value from <see cref="JsonLoadTable"/>.</param>
/// <param name="errors">All errors during parsing.</param>
/// <param name="codeIndex">(Optional): This argument will be copied to <see cref="vl::parsing::ParsingTextRange::codeIndex"/> in every AST nodes. The default value is -1.</param>
extern
vl
::
Ptr
<
vl
::
parsing
::
ParsingTreeNode
>
JsonParseAsParsingTreeNode
(
const
vl
::
WString
&
input
,
vl
::
Ptr
<
vl
::
parsing
::
tabling
::
ParsingTable
>
table
,
vl
::
collections
::
List
<
vl
::
Ptr
<
vl
::
parsing
::
ParsingError
>>&
errors
,
vl
::
vint
codeIndex
= -
1
);
/// <summary>Parse a JSON text, it could be an object or an array.</summary>
/// <returns>Returns the parsing result as a weak-typed AST node. Returns null if there is any unrecoverable error during parsing.</returns>
/// <param name="input">The input for parsing.</param>
/// <param name="table">The return value from <see cref="JsonLoadTable"/>.</param>
/// <param name="codeIndex">(Optional): This argument will be copied to <see cref="vl::parsing::ParsingTextRange::codeIndex"/> in every AST nodes. The default value is -1.</param>
extern
vl
::
Ptr
<
vl
::
parsing
::
ParsingTreeNode
>
JsonParseAsParsingTreeNode
(
const
vl
::
WString
&
input
,
vl
::
Ptr
<
vl
::
parsing
::
tabling
::
ParsingTable
>
table
,
vl
::
vint
codeIndex
= -
1
);
/// <summary>Parse a JSON text, it could be an object or an array.</summary>
/// <returns>Returns the parsing result as a strong-typed AST node. Returns null if there is any unrecoverable error during parsing.</returns>
/// <param name="input">The input for parsing.</param>
/// <param name="table">The return value from <see cref="JsonLoadTable"/>.</param>
/// <param name="errors">All errors during parsing.</param>
/// <param name="codeIndex">(Optional): This argument will be copied to <see cref="vl::parsing::ParsingTextRange::codeIndex"/> in every AST nodes. The default value is -1.</param>
extern
vl
::
Ptr
<
JsonNode
>
JsonParse
(
const
vl
::
WString
&
input
,
vl
::
Ptr
<
vl
::
parsing
::
tabling
::
ParsingTable
>
table
,
vl
::
collections
::
List
<
vl
::
Ptr
<
vl
::
parsing
::
ParsingError
>>&
errors
,
vl
::
vint
codeIndex
= -
1
);
/// <summary>Parse a JSON text, it could be an object or an array.</summary>
/// <returns>Returns the parsing result as a strong-typed AST node. Returns null if there is any unrecoverable error during parsing.</returns>
/// <param name="input">The input for parsing.</param>
/// <param name="table">The return value from <see cref="JsonLoadTable"/>.</param>
/// <param name="codeIndex">(Optional): This argument will be copied to <see cref="vl::parsing::ParsingTextRange::codeIndex"/> in every AST nodes. The default value is -1.</param>
extern
vl
::
Ptr
<
JsonNode
>
JsonParse
(
const
vl
::
WString
&
input
,
vl
::
Ptr
<
vl
::
parsing
::
tabling
::
ParsingTable
>
table
,
vl
::
vint
codeIndex
= -
1
); } } }
#endif