Source for parsing C grammar using JavaCC
http://java.net/projects/javacc/sources/svn/
but I found that it only has syntactic and lexical actions and no real semant开发者_C百科ics for parsing C source. Is there some other source that incorporate typedef, variables, construct functions, include files?
You could go looking for a complete grammar. Will you learn much this way?
You could ask your lecturer which would impress them more: implementing some small subset of C grammar by writing your own rules, or by searching google for alternative complete rules?
I trust writing your own rules - and even your own hand-crafted parser - will be more a more useful exercise. Even if its only parsing expressions.
精彩评论