d-u-d-e / c-compiler

GNU General Public License v3.0
3 stars 0 forks source link

Create a basic formal grammar #11

Closed albertoursino closed 1 hour ago

albertoursino commented 5 days ago

From page 15:

[...] in addition to an AST description, you need a set of rules defining how to build a language construct from a list of tokens. This ruleset is called a formal grammar, and it corresponds closely to the AST description.

Which data structure should we use for this ruleset?

d-u-d-e commented 5 days ago

No need to use a data structure to represent a grammar. The author says that we need a set of rules, not a DS.