IDAPython 9.0
Loading...
Searching...
No Matches
ida_srclang Namespace Reference

Functions

"bool" select_parser_by_name ("char const *" name)
 select_parser_by_name(name) -> bool Set the parser with the given name as the current parser.
 
"bool" select_parser_by_srclang ("srclang_t" lang)
 select_parser_by_srclang(lang) -> bool Set the parser that supports the given language(s) as the current parser.
 
"int" set_parser_argv ("char const *" parser_name, "char const *" argv)
 set_parser_argv(parser_name, argv) -> int Set the command-line args to use for invocations of the parser with the given name
 
"int" parse_decls_for_srclang ("srclang_t" lang, "til_t" til, "char const *" input, "bool" is_path)
 parse_decls_for_srclang(lang, til, input, is_path) -> int Parse type declarations in the specified language
 
"int" parse_decls_with_parser ("char const *" parser_name, "til_t" til, "char const *" input, "bool" is_path)
 parse_decls_with_parser(parser_name, til, input, is_path) -> int Parse type declarations using the parser with the specified name
 

Variables

 SRCLANG_C = _ida_srclang.SRCLANG_C
 
 SRCLANG_CPP = _ida_srclang.SRCLANG_CPP
 
 SRCLANG_OBJC = _ida_srclang.SRCLANG_OBJC
 
 SRCLANG_SWIFT = _ida_srclang.SRCLANG_SWIFT
 
 SRCLANG_GO = _ida_srclang.SRCLANG_GO
 

Function Documentation

◆ parse_decls_for_srclang()

"int" parse_decls_for_srclang ( "srclang_t" lang,
"til_t" til,
"char const *" input,
"bool" is_path )
Parameters
lang(C++: srclang_t) the source language(s) expected in the input
til(C++: til_t *) type library to store the types
input(C++: const char *) input source. can be a file path or decl string
is_path(C++: bool) true if input parameter is a path to a source file, false if the input is an in-memory source snippet
Return values
-1no parser was found that supports the given source language(s)
elsethe number of errors encountered in the input source

◆ parse_decls_with_parser()

"int" parse_decls_with_parser ( "char const *" parser_name,
"til_t" til,
"char const *" input,
"bool" is_path )
Parameters
parser_name(C++: const char *) name of the target parser
til(C++: til_t *) type library to store the types
input(C++: const char *) input source. can be a file path or decl string
is_path(C++: bool) true if input parameter is a path to a source file, false if the input is an in-memory source snippet
Return values
-1no parser was found with the given name
elsethe number of errors encountered in the input source

◆ select_parser_by_name()

"bool" select_parser_by_name ( "char const *" name)

Pass nullptr or an empty string to select the default parser.

Parameters
name(C++: const char *) char const *
Returns
: false if no parser was found with the given name

◆ select_parser_by_srclang()

"bool" select_parser_by_srclang ( "srclang_t" lang)

The selected parser must support all languages specified by the given srclang_t.

Parameters
lang(C++: srclang_t)
Returns
: false if no such parser was found

◆ set_parser_argv()

"int" set_parser_argv ( "char const *" parser_name,
"char const *" argv )
Parameters
parser_name(C++: const char *) name of the target parser
argv(C++: const char *) argument list
Return values
-1no parser was found with the given name
-2the operation is not supported by the given parser
0success

Variable Documentation

◆ SRCLANG_C

SRCLANG_C = _ida_srclang.SRCLANG_C

◆ SRCLANG_CPP

SRCLANG_CPP = _ida_srclang.SRCLANG_CPP

◆ SRCLANG_GO

SRCLANG_GO = _ida_srclang.SRCLANG_GO

◆ SRCLANG_OBJC

SRCLANG_OBJC = _ida_srclang.SRCLANG_OBJC

◆ SRCLANG_SWIFT

SRCLANG_SWIFT = _ida_srclang.SRCLANG_SWIFT