diff options
| author | Marc Vertes <marc.vertes@tendermint.com> | 2023-07-24 14:19:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-24 14:19:42 +0200 |
| commit | bf32256ff3014543ef5dda69c4ee1e94d01361fe (patch) | |
| tree | 7ed1080462ed45864704a276eabaefa1fc299d8d /vm1/vm.go | |
| parent | aa4cc2b45ebadf4cea16d1e27149e13669f3a5fc (diff) | |
parser: define all node kinds to make the parser multi-language (#3)
* parser: define all node kinds to make the parser multi-language
Defining all AST node kinds in the parser is necessary to make the
parser really multi-language. If a language requires a node kind not
already present in parser/kind.go, it will be necessary to add it first
here.
Note that as long as a node kind subtree is structurally identical
between languages, even if there are lexical and/or syntaxic
differences, it can (and must) be shared amongst multiple language
definitions.
For example, an "if" statememt in shell script or in C code should give
the same `IfStmt` at AST level.
In order to let the parser deal with the various language syntaxes,
and produce the right node kind and subtree, parser flags will be set
in language definitions (see `Flags` field in `NodeSpec` struct).
* lang/golang: use parser node kinds
* vm0: remode dependency on language definition.
Diffstat (limited to 'vm1/vm.go')
0 files changed, 0 insertions, 0 deletions
