-
Notifications
You must be signed in to change notification settings - Fork 0
/
file.go
57 lines (46 loc) · 1002 Bytes
/
file.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package model
type FileRange struct {
constGroup *ConstGroup
macros *MacroList
structs *StructList
functions *FunctionList
}
func NewFileRange() *FileRange {
ret := &FileRange{}
ret.constGroup = NewConstGroup()
ret.macros = NewMacroList()
ret.structs = NewStructList()
ret.functions = NewFunctionList()
return ret
}
type File struct {
name string
comment string
rangePublic *FileRange
rangePrivate *FileRange
}
func NewFile() *File {
ret := &File{}
ret.rangePublic = NewFileRange()
return ret
}
func (this *File) Accept(v CodeVisitor) {
//v.VisitFile(this)
}
func (this *File) AppendConst(val ...*ConstList) *File {
this.rangePublic.constGroup.AppendConstList(val...)
return this
}
type FileList struct {
Files []*File
}
func NewFileList() *FileList {
return &FileList{}
}
func (this *FileList) Accept(v CodeVisitor) {
//v.VisitFileList(this)
}
func (this *FileList) Append(val ...*File) *FileList {
this.Files = append(this.Files, val...)
return this
}