forked from ali-alidoust/ScriptHookW3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSignatureParser.grako
21 lines (21 loc) · 1.24 KB
/
SignatureParser.grako
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
start = function_definition ;
function_definition = [access_modifier] return_type [cdecl] full_function_name function_arg_list [function_modifier] ;
return_type = full_type_name ;
access_modifier = "public:" | "private:" | "protected:" ;
cdecl = "__cdecl" ;
full_function_name = (full_namespace function_name) | function_name ;
function_arg_list = "(" [function_arguments] ")" ;
function_modifier = "const" ;
full_type_name = type:([class_key] (full_namespace "::" type_name | type_name) {pointer_or_ref_chars} [ "__ptr64" ]);
full_namespace = (namespace "::" full_namespace) | (namespace "::") ;
namespace = namespace:full_type_name ;
function_name = identifier ;
function_arguments = (full_type_name "," function_arguments) | full_type_name ;
type_name = (identifier "<" template_args_list ">") | identifier;
template_args_list = (template_argument "," template_args_list) | template_argument ;
template_argument = ([class_key] full_type_name) | literal_int ;
identifier = nondigit /[A-Za-z0-9_]*/ ;
class_key = "class" | "struct" | "union" ;
literal_int = /[0-9]+/ ;
nondigit = /[A-Za-z_]/ ;
pointer_or_ref_chars = "*" | "&" | "&&" | "const";