`

add log for c language

    博客分类:
  • Java
 
阅读更多
?: //not capture during parsing
import java.io.File;

import org.apache.commons.io.FileUtils;

public class AddlogForC {

	/**
	 * @param args
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {
		File f = new File(
				"test.c");
		String content = FileUtils.readFileToString(f);
		String regex = "((?:static\\s+)?[\\w*]+\\s+([\\w+]+)\\s*\\([^)]*\\)\\s*\\s\\{)"; // [^)]*\\)\\s*\\{
		System.out
				.println(content.replaceAll(regex, "$1\n    printf(\"$2\");"));
		FileUtils.write(f, content);
	}

}

分享到:
评论

相关推荐

    SQL中的ALTER LOGFILE组语句、ALTER程序声明语句和ALTER SERVER语句.pdf

    ### SQL中的ALTER LOGFILE组语句、ALTER程序声明语句和ALTER SERVER语句 #### 一、ALTER LOGFILE组语句 **ALTER LOGFILE GROUP** 语句主要用于修改数据库的日志文件组,尤其是在NDB Cluster环境中,允许管理员对...

    simple-tags

    Add some tools for taxonomies : Terms suggestion, Mass Edit Terms, Auto link Terms, Ajax Autocompletion, Click Terms, Auto terms, Advanced manage terms, Advanced Post Terms, Related Posts by Terms, ...

    Qemu-1.0.1 for windows

    -k language use keyboard layout (for example 'fr' for French) -audio-help print list of audio drivers and their options -soundhw c1,... enable audio support and only specified sound cards (comma ...

    Driver Package Installer (dpinst) 使用说明

    Usage: DPInst.exe [/U INF-file][/S | /Q][/LM][/P][/F][/SH][/SA][/A][/PATH Path][/EL][/L LanguageID][/C][/D][/LogTitle Title][/SW][/? | /h | /help] 用法:DPInst.exe [/U INF-file][/S | /Q][/LM][/P][/F]...

    FastReport.v4.15 for.Delphi.BCB.Full.Source企业版含ClientServer中文修正版支持D4-XE5

    + [enterprise] added logs for scheduler (add info in scheduler.log) + [enterprise] added property "Reports" - "Scripts" in server configuration - set the path for "uses" directive in report script + ...

    如何使用log miner分析oracle日志

    Log Miner是Oracle数据库提供的一种强大的日志分析工具,它允许管理员查看redo log文件中的事务历史,包括DDL(Data Definition Language)和DML(Data Manipulation Language)操作。在本文中,我们将深入探讨如何...

    WinMenc 0.81

    Added: preset values for subtitle font and subtitle font language extension Fixed: priority not set for all jobs, except the first one Removed: video filter “telecine” 0.80 (2009-04-04) ...

    EurekaLog_7.5.0.0_Enterprise

    23)..Fixed: NT service may not log all exceptions 24)..Fixed: SSL port number for Bugzilla 25)..Fixed: Disabling "Activate Exception Filters" option was ignored 26)..Fixed: Missing FTP proxy settings ...

    Very spicy additions to the Java programming language..zip

    "Very spicy additions to the Java programming language"这个压缩包,很可能是包含了一些增强Java编程体验的工具或库,例如"Lombok"。 Lombok是一个非常实用的Java库,它的目标是通过注解(Annotations)来简化...

    UE(官方下载)

    Add a language definition to your wordfile for use with UltraEdit and UEStudio's powerful syntax highlighting Syntax highlighting and code folding Explanation of highlighting and folding definitions ...

    pl/sql学习文档

    在深入探讨《pl/sql学习文档》的精粹之前,我们先来明确一下PL/SQL(Procedural Language for SQL)的定义与重要性。PL/SQL是Oracle数据库为提升SQL的功能性和灵活性而开发的一种过程化语言。它允许开发者在数据库...

    eac3to V3.17

    * fixed: log output "remaining delay [...]" was sometimes wrong for AC3 tracks * fixed: silent frame creation was tried for E-AC3 although it can't work v3.05 * warning is shown if h264 video ...

    端口查看工具

    o Added 'Add Header Line To CSV/Tab-Delimited File' option. When this option is turned on, the column names are added as the first line when you export to csv or tab-delimited file. * Version 1.82...

    WinMenc 0.81 Beta

    Added: preset values for subtitle font and subtitle font language extension Fixed: priority not set for all jobs, except the first one Removed: video filter “telecine” 0.80 (2009-04-04) Changed: ...

    SQL语句大全

    在IT领域,SQL(Structured Query Language)是一种用于管理和操作关系型数据库的标准语言。这篇文档主要涵盖了SQL语句在创建、修改、删除数据库以及数据库备份和还原等基础操作方面的知识。 首先,我们来看如何...

    qemu-0.13.0(编译过全处理器支持)

    -k language use keyboard layout (for example 'fr' for French) -audio-help print list of audio drivers and their options -soundhw c1,... enable audio support and only specified sound cards (comma ...

    C# webservice操作技术记录.doc

    - 对于Client端,可以使用`Add Web Reference`或`Add Service Reference`(在较新的Visual Studio版本中)功能,自动从WSDL生成客户端代理类,简化与Web Service的通信。 5. **安全性与优化**: - Web Service的...

    connect-1.3.0-all-in-one

    # Window->Preferences->Maven->installations->Add 把 Maven 的路径添加上 # 用 SVN 把项目迁出 http://open-qq.googlecode.com/svn/trunk/demo # 右键项目,选择Configure --> Convert to Maven Project # ...

    Beginning T-SQL with Microsoft SQL Server 2005 and 2008

    Transact-SQL, or T-SQL, is Microsoft Corporation’s powerful implementation of the ANSI standard SQL database query language, which was designed to retrieve, manipulate, and add data to relational ...

Global site tag (gtag.js) - Google Analytics