You can try a naive approach to match non-comments like this:
$ egrep -v "^(//|/\*| \*)" sourcecode
This will only reverseinverse match against prefixed comments - that is lines starting with either //, /*, * or */ - and hence it'll not leave out blocks that are commented out with the /* and */ pair.