rui314 / 8cc

A Small C Compiler
MIT License
6.13k stars 740 forks source link

terminology seems incorrect. #37

Closed andrewchambers closed 9 years ago

andrewchambers commented 9 years ago

nitpick, but for educational value it may be worth changing.

"A declarator is the part of a declaration that specifies the name that is to be introduced into the program. It can include modifiers such as * (pointer-to)" [1]

A direct declarator does not include the prefix *'s . An abstract declarator is a declarator without an identifier.

read_direct_declarator1 is not just reading a direct declarator, but a declarator and and abstract declarator as well, the function could be renamed, and maybe the reading of '*' could be shifted to read_declarator.

[1] https://msdn.microsoft.com/en-us/library/e5ace6tf.aspx

Tbh, those microsoft pages finally helped me understand some of this C spec terminology after reading a bunch of C parsers and not understanding. I could be wrong though.

I understand if you can't be bothered making this change yet.

andrewchambers commented 9 years ago

c712a72ad9b8a08ae46aea63c060327ab95fd668 fixes this.