Slide 22
Slide 22 text
コンパイラの流れ: 2. 構造化されたソースコードからASTを⽣成
File
構造体の declList
に格納されていた importDecl
, funcDecl
, constDecl
,
varDecl
を、それぞれASTのノードを表す構造体 Node
へ変換する
type Node struct {
// Tree structure.
// Generic recursive walks should follow these fields.
Left *Node
Right *Node
Ninit Nodes
Nbody Nodes
List Nodes
Rlist Nodes
// ...