Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kind ¶
type Kind int
Kind enumerates the kind of a Symbol.
type Scope ¶
Scope maintains a record of the identifiers declared in the current program scope, and a link to the parent scope.
func (*Scope) CopyFrom ¶
CopyFrom copies all the symbols from another scope object into this one. It recurses up the input scope copying all visible symbols into one.
func (*Scope) Insert ¶
Insert attempts to insert a symbol into the scope. If the scope already contains an object alt with the same name, the scope is unchanged and the function returns alt. Otherwise the symbol is inserted, and returns nil.
func (*Scope) InsertAlias ¶
InsertAlias attempts to insert a duplicate name for an existing symbol into the scope. If the scope already contains an object alt with the alias, the scope is unchanged and the function returns alt. Otherwise, the symbol is inserted and the function returns nil.
type Symbol ¶
type Symbol struct { Name string // identifier name Kind Kind // kind of program object Type types.Type // object's type Pos *position.Position // Source file position of definition Binding interface{} // binding to storage allocated in runtime Addr int // Address offset in another structure, object specific Used bool // Optional marker that this symbol is used after declaration. }
Symbol describes a named program object.