开发者

How to convert the (yytext) from small letters to capital letters (in Lex & yacc)?

开发者 https://www.devze.com 2023-01-31 21:12 出处:网络
Please, how can i convert a matched string in lex (yytext) from small letters to capital letters? If 开发者_JS百科you can provide me an example i would be grateful.

Please, how can i convert a matched string in lex (yytext) from small letters to capital letters? If 开发者_JS百科you can provide me an example i would be grateful.

Thanks in advance for your help.


The toupper function from the c standard library?

You'll have to loop over the string of course, so you probably want to wrap it up in a function of your own, or if you are already using some external utility library (glib, qt, ...) they may provide a general string case fixer.

Glib seem to provide g_string_ascii_up.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号