the keyword such as func and make. • Modify the operator only cosmetically (e.g. != → ~=) • Modify how literals and identifiers are represented. • Add a new keyword or operator to the language to later use in the parser.
tokens and builds an abstract syntax tree (AST) that represents the source code. • The AST is retouched (“typecheck”and “walk” sub- phase) during type inference and assersion phase so it would be less verbose and contain information helpful for the later stages. • src/cmd/gc/go.y, src/cmd/gc/dcl.c src/cmd/gc/typecheck.c, src/cmd/gc/walk.c, src/cmd/gc/reflect.c
a new AST node type (e.g. OINDEXINTER) • Add a branch point in “typecheck” to handle the case where the indexed target is neither a string, array, slice nor map type. • Supply a code in “walk” to specially treat the assignment and dereference that involves that kind of node. The code synthesizes the node to invoke the special functions, then typecheck and walk over themselves in a recursive manner. • Don’t forget to take care of evaluation order corrector.