Created basic data structures for analyzer
This commit is contained in:
		
							parent
							
								
									7f42ccac48
								
							
						
					
					
						commit
						f6aeae1d55
					
				
							
								
								
									
										6
									
								
								analyzer/analyzer.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								analyzer/analyzer.go
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,6 @@ | ||||
| package analyzer | ||||
| 
 | ||||
| // AnalysisOperation holds information about an ongoing analysis operation. | ||||
| type AnalysisOperation struct { | ||||
| 	sectionTable SectionTable | ||||
| } | ||||
							
								
								
									
										29
									
								
								analyzer/table.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								analyzer/table.go
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,29 @@ | ||||
| package analyzer | ||||
| 
 | ||||
| // locator uniquely identifies a section in the section table. | ||||
| type locator struct { | ||||
| 	modulePath string | ||||
| 	name string | ||||
| } | ||||
| 
 | ||||
| // SectionTable stores a list of semantically analized sections from one module, | ||||
| // and all sections that it requires from other modules. | ||||
| type SectionTable map[locator] Section | ||||
| 
 | ||||
| // SectionKind differentiates Section interfaces. | ||||
| type SectionKind int | ||||
| 
 | ||||
| const ( | ||||
| 	SectionKindType = iota | ||||
| 	SectionKindObjt | ||||
| 	SectionKindEnum | ||||
| 	SectionKindFace | ||||
| 	SectionKindData | ||||
| 	SectionKindFunc | ||||
| ) | ||||
| 
 | ||||
| // Section is a semantically analyzed section. | ||||
| type Section interface { | ||||
| 	Kind () (kind SectionKind) | ||||
| 	Name () (name string) | ||||
| } | ||||
		Reference in New Issue
	
	Block a user