mewmew / uc

A compiler for the µC language.
57 stars 5 forks source link

parser: Evaluate merging TopLevelDecl with Decl to simplify grammar #38

Closed mewmew closed 8 years ago

mewmew commented 8 years ago

From ast.go:

// TODO: Evaluate whether TopLevelDecl should be merged with Decl, to simplify
// the structure of the AST; in which case a semantic analysis pass would be
// added to ensure that function declarations are not nested (even if this would
// be an interesting extension to C).
mewmew commented 8 years ago

After discussions, we've decided to remove the TopLevelDecl special case and make function declarations behave like any other declaration. This should simplify the grammar and the AST, while semantic checks should be added to ensure that declarations within functions are not function declarations (unless the GNU extension of nested functions is enabled; see issue #43).

mewmew commented 8 years ago

TopLevelDecl and Decl were merged in commit 3db3068. Closing this issue.