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

Detailed Description

Third-party compiler support.

Functions

bool select_parser_by_name (str name)
 
bool select_parser_by_srclang ('srclang_t' lang)
 
int set_parser_argv (str parser_name, str argv)
 
int parse_decls_for_srclang ('srclang_t' lang, 'til_t' til, str input, bool is_path)
 
int parse_decls_with_parser (str parser_name, 'til_t' til, str input, bool is_path)
 

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,
str input,
bool is_path )
Parse type declarations in the specified language 
    
@param lang: the source language(s) expected in the input
@param til: type library to store the types
@param input: input source. can be a file path or decl string
@param is_path: true if input parameter is a path to a source file, false if the input is an in-memory source snippet
@retval -1: no parser was found that supports the given source language(s)
@retval else: the number of errors encountered in the input source

◆ parse_decls_with_parser()

int parse_decls_with_parser ( str parser_name,
'til_t' til,
str input,
bool is_path )
Parse type declarations using the parser with the specified name 
    
@param parser_name: name of the target parser
@param til: type library to store the types
@param input: input source. can be a file path or decl string
@param is_path: true if input parameter is a path to a source file, false if the input is an in-memory source snippet
@retval -1: no parser was found with the given name
@retval else: the number of errors encountered in the input source

◆ select_parser_by_name()

bool select_parser_by_name ( str name)
Set the parser with the given name as the current parser. Pass nullptr or an empty string to select the default parser. 
    
@returns false if no parser was found with the given name

◆ select_parser_by_srclang()

bool select_parser_by_srclang ( 'srclang_t' lang)
Set the parser that supports the given language(s) as the current parser. The selected parser must support all languages specified by the given srclang_t. 
    
@returns false if no such parser was found

◆ set_parser_argv()

int set_parser_argv ( str parser_name,
str argv )
Set the command-line args to use for invocations of the parser with the given name 
    
@param parser_name: name of the target parser
@param argv: argument list
@retval -1: no parser was found with the given name
@retval -2: the operation is not supported by the given parser
@retval 0: success

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