2008-07-10 18:21:23 -06:00
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package Object
|
|
|
|
|
|
|
|
import Globals "globals"
|
|
|
|
|
|
|
|
|
|
|
|
export BAD, CONST, TYPE, VAR, FUNC, PACKAGE
|
|
|
|
const /* kind */ (
|
|
|
|
BAD = iota; // error handling
|
|
|
|
CONST; TYPE; VAR; FUNC; PACKAGE;
|
|
|
|
PTYPE; // primary type (import/export only)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2008-07-11 21:15:12 -06:00
|
|
|
export Object
|
2008-07-10 18:21:23 -06:00
|
|
|
type Object Globals.Object
|
|
|
|
|
|
|
|
|
2008-07-11 21:15:12 -06:00
|
|
|
export NewObject
|
2008-07-10 18:21:23 -06:00
|
|
|
func NewObject(kind int, name string) *Object {
|
|
|
|
obj := new(Object);
|
|
|
|
obj.mark = false;
|
|
|
|
obj.kind = kind;
|
|
|
|
obj.name = name;
|
|
|
|
obj.type_ = nil; // Universe::undef_t;
|
|
|
|
obj.pnolev = 0;
|
|
|
|
return obj;
|
|
|
|
}
|