diff options
| -rw-r--r-- | parser/README.md | 12 | ||||
| -rw-r--r-- | scanner/README.md | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/parser/README.md b/parser/README.md index 19d8778..2a25fc8 100644 --- a/parser/README.md +++ b/parser/README.md @@ -5,6 +5,18 @@ returns a node representing a syntax tree. A node is an object containing a kind, the corresponding token and the ordered references to descendent nodes. +```mermaid +graph LR +s[ ] --> |source| a(scanner) +--> |tokens| b(parser) +--> |AST| c[ ] +subgraph parser + b +end +style s height:0px; +style c height:0px; +``` + A goal is to make the parser generic enough so it can generate syntax trees for most of existing programming languages (no claim of generality yet), provided a small set of generating rules per language, and a small diff --git a/scanner/README.md b/scanner/README.md index c131a9f..a51d8a7 100644 --- a/scanner/README.md +++ b/scanner/README.md @@ -2,6 +2,18 @@ A scanner takes a string in input and returns an array of tokens. +```mermaid +graph LR +s[ ] --> |source| a(scanner) +--> |tokens| b(parser) +--> |AST| c[ ] +subgraph scanner + a +end +style s height:0px; +style c height:0px; +``` + Tokens can be of the following kinds: - identifier - number |
