I would be startled if existing legal code was sufficiently rigorously defined to be encoded into machine-readable forms. I really think it wouldn't work! Someone prove me wrong?
There already exists legal search engines. Notably to me is WestLawNext[0] which has a legal search engine, which I believe is sold to large legal firms. There also seems to be a direct competitor called LexisNexis.