One Hat Cyber Team
Your IP :
216.73.216.43
Server IP :
162.240.106.28
Server :
Linux server.ganesand.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
Server Software :
Apache
PHP Version :
7.2.34
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
doc
/
python-pycparser-2.14
/
examples
/
View File Name :
rewrite_ast.py
#----------------------------------------------------------------- # pycparser: func_write.py # # Tiny example of rewriting a AST node # # Copyright (C) 2014, Akira Hayakawa # License: BSD #----------------------------------------------------------------- from __future__ import print_function import sys from pycparser import c_parser text = r""" void func(void) { x = 1; } """ parser = c_parser.CParser() ast = parser.parse(text) print("Before:") ast.show(offset=2) assign = ast.ext[0].body.block_items[0] assign.lvalue.name = "y" assign.rvalue.value = 2 print("After:") ast.show(offset=2)