正規表現の限界?

昨日の続き。簡単に終わるかと思ったが、駄目だ。括弧が入れ子構造になった場合に同じ階層の括弧同士をうまく正規表現で取れない。。
やっぱ構文解析を真面目にやらないといけないのかな。夜に構文解析ツールであるlex & yaccの本を探しに行ったがどこにも書籍が無い。当面Webで勉強しよう。

I analyzed about regular expression in the script and found that it was too hard to parse the HDL code completely with regular expression. I think it is better to use the syntax analysis tools lile lex & yacc. So I went to buy the book about lex & yacc but I couldn't find any such book at several bookstores.