Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AliasSpecType = SpecKind.NewBranch("@aliasspec", TypeSpecType)
AliasSpecType is the type of type declaration specification nodes corresponding to alias declarations
var ArithmeticBinaryExpr = NewUnionType("@arithmeticbinaryexpr", BinaryExpr, ArithmeticExpr)
ArithmeticBinaryExpr is the type of arithmetic binary operator expression AST nodes
var ArithmeticExpr = NewUnionType("@arithmeticexpr", OperatorExpr)
ArithmeticExpr is the type of arithmetic operator expression AST nodes
var ArithmeticUnaryExpr = NewUnionType("@arithmeticunaryexpr", UnaryExpr, ArithmeticExpr)
ArithmeticUnaryExpr is the type of arithmetic unary operator expression AST nodes
var ArrayLengthTable = NewTable("array_length", EntityColumn(ArrayType, "tp").Unique(), StringColumn("len"), )
ArrayLengthTable is the table associating array types with their length (represented as a string since Go array lengths are 64-bit and hence do not always fit into a QL integer)
var ArrayType = TypeKind.NewBranch("@arraytype", ElementContainerType)
ArrayType is the type of array types
var ArrayTypeExpr = ExprKind.NewBranch("@arraytypeexpr")
ArrayTypeExpr is the type of array type AST nodes
var AssignStmtTypes = map[token.Token]*BranchType{ token.ASSIGN: StmtKind.NewBranch("@assignstmt", SimpleAssignStmtType), token.DEFINE: StmtKind.NewBranch("@definestmt", SimpleAssignStmtType), token.ADD_ASSIGN: StmtKind.NewBranch("@addassignstmt", CompoundAssignStmtType), token.SUB_ASSIGN: StmtKind.NewBranch("@subassignstmt", CompoundAssignStmtType), token.MUL_ASSIGN: StmtKind.NewBranch("@mulassignstmt", CompoundAssignStmtType), token.QUO_ASSIGN: StmtKind.NewBranch("@quoassignstmt", CompoundAssignStmtType), token.REM_ASSIGN: StmtKind.NewBranch("@remassignstmt", CompoundAssignStmtType), token.AND_ASSIGN: StmtKind.NewBranch("@andassignstmt", CompoundAssignStmtType), token.OR_ASSIGN: StmtKind.NewBranch("@orassignstmt", CompoundAssignStmtType), token.XOR_ASSIGN: StmtKind.NewBranch("@xorassignstmt", CompoundAssignStmtType), token.SHL_ASSIGN: StmtKind.NewBranch("@shlassignstmt", CompoundAssignStmtType), token.SHR_ASSIGN: StmtKind.NewBranch("@shrassignstmt", CompoundAssignStmtType), token.AND_NOT_ASSIGN: StmtKind.NewBranch("@andnotassignstmt", CompoundAssignStmtType), }
AssignStmtTypes is a map from assignmnt operator tokens to corresponding AST node types
var AssignmentType = NewUnionType("@assignment")
AssignmentType is the type of assignment statement AST nodes
var BadDeclType = DeclKind.NewBranch("@baddecl")
BadDeclType is the type of bad (that is, unparseable) declaration AST nodes
var BadExpr = ExprKind.NewBranch("@badexpr")
BadExpr is type of bad (that is, unparseable) expression AST nodes
var BadStmtType = StmtKind.NewBranch("@badstmt")
BadStmtType is the type of bad (that is, unparseable) statement AST nodes
var BaseTypeTable = NewTable("base_type", EntityColumn(PointerType, "ptr").Unique(), EntityColumn(TypeType, "tp"), )
BaseTypeTable is the table associating pointer types with their base type
var BasicLitExpr = NewUnionType("@basiclit")
BasicLitExpr is the type of basic (that is, primitive) literal expression AST nodes
var BasicType = NewUnionType("@basictype")
BasicType is the union of all basic types
var BasicTypes = map[gotypes.BasicKind]*BranchType{ gotypes.Invalid: TypeKind.NewBranch("@invalidtype", BasicType), gotypes.Bool: TypeKind.NewBranch("@boolexprtype", BoolType), gotypes.Int: TypeKind.NewBranch("@inttype", SignedIntegerType), gotypes.Int8: TypeKind.NewBranch("@int8type", SignedIntegerType), gotypes.Int16: TypeKind.NewBranch("@int16type", SignedIntegerType), gotypes.Int32: TypeKind.NewBranch("@int32type", SignedIntegerType), gotypes.Int64: TypeKind.NewBranch("@int64type", SignedIntegerType), gotypes.Uint: TypeKind.NewBranch("@uinttype", UnsignedIntegerType), gotypes.Uint8: TypeKind.NewBranch("@uint8type", UnsignedIntegerType), gotypes.Uint16: TypeKind.NewBranch("@uint16type", UnsignedIntegerType), gotypes.Uint32: TypeKind.NewBranch("@uint32type", UnsignedIntegerType), gotypes.Uint64: TypeKind.NewBranch("@uint64type", UnsignedIntegerType), gotypes.Uintptr: TypeKind.NewBranch("@uintptrtype", UnsignedIntegerType), gotypes.Float32: TypeKind.NewBranch("@float32type", FloatType), gotypes.Float64: TypeKind.NewBranch("@float64type", FloatType), gotypes.Complex64: TypeKind.NewBranch("@complex64type", ComplexType), gotypes.Complex128: TypeKind.NewBranch("@complex128type", ComplexType), gotypes.String: TypeKind.NewBranch("@stringexprtype", StringType), gotypes.UnsafePointer: TypeKind.NewBranch("@unsafepointertype", BasicType), gotypes.UntypedBool: TypeKind.NewBranch("@boolliteraltype", LiteralType, BoolType), gotypes.UntypedInt: TypeKind.NewBranch("@intliteraltype", LiteralType, SignedIntegerType), gotypes.UntypedRune: TypeKind.NewBranch("@runeliteraltype", LiteralType, SignedIntegerType), gotypes.UntypedFloat: TypeKind.NewBranch("@floatliteraltype", LiteralType, FloatType), gotypes.UntypedComplex: TypeKind.NewBranch("@complexliteraltype", LiteralType, ComplexType), gotypes.UntypedString: TypeKind.NewBranch("@stringliteraltype", LiteralType, StringType), gotypes.UntypedNil: TypeKind.NewBranch("@nilliteraltype", LiteralType), }
BasicTypes is a map from basic type kinds to the corresponding entity types
var BinaryExpr = NewUnionType("@binaryexpr", OperatorExpr)
BinaryExpr is the type of binary operator expression AST nodes
var BinaryExprs = map[token.Token]*BranchType{ token.LOR: ExprKind.NewBranch("@lorexpr", LogicalBinaryExpr), token.LAND: ExprKind.NewBranch("@landexpr", LogicalBinaryExpr), token.EQL: ExprKind.NewBranch("@eqlexpr", EqualityTest), token.NEQ: ExprKind.NewBranch("@neqexpr", EqualityTest), token.LSS: ExprKind.NewBranch("@lssexpr", RelationalComparison), token.LEQ: ExprKind.NewBranch("@leqexpr", RelationalComparison), token.GTR: ExprKind.NewBranch("@gtrexpr", RelationalComparison), token.GEQ: ExprKind.NewBranch("@geqexpr", RelationalComparison), token.ADD: ExprKind.NewBranch("@addexpr", ArithmeticBinaryExpr), token.SUB: ExprKind.NewBranch("@subexpr", ArithmeticBinaryExpr), token.OR: ExprKind.NewBranch("@orexpr", BitwiseBinaryExpr), token.XOR: ExprKind.NewBranch("@xorexpr", BitwiseBinaryExpr), token.MUL: ExprKind.NewBranch("@mulexpr", ArithmeticBinaryExpr), token.QUO: ExprKind.NewBranch("@quoexpr", ArithmeticBinaryExpr), token.REM: ExprKind.NewBranch("@remexpr", ArithmeticBinaryExpr), token.SHL: ExprKind.NewBranch("@shlexpr", ShiftExpr), token.SHR: ExprKind.NewBranch("@shrexpr", ShiftExpr), token.AND: ExprKind.NewBranch("@andexpr", BitwiseBinaryExpr), token.AND_NOT: ExprKind.NewBranch("@andnotexpr", BitwiseBinaryExpr), }
BinaryExprs is a map from binary operator tokens to the corresponding AST node type
var BitwiseBinaryExpr = NewUnionType("@bitwisebinaryexpr", BinaryExpr, BitwiseExpr)
BitwiseBinaryExpr is the type of bitwise binary operator expression AST nodes
var BitwiseExpr = NewUnionType("@bitwiseexpr", OperatorExpr)
BitwiseExpr is the type of bitwise operator expression AST nodes
var BitwiseUnaryExpr = NewUnionType("@bitwiseunaryexpr", UnaryExpr, BitwiseExpr)
BitwiseUnaryExpr is the type of bitwise unary operator expression AST nodes
var BlockStmtType = StmtKind.NewBranch("@blockstmt", ScopeNodeType)
BlockStmtType is the type of block statement AST nodes
var BoolType = NewUnionType("@booltype", BasicType)
BoolType is the union of the normal and literal bool types
var BranchStmtType = NewUnionType("@branchstmt")
BranchStmtType is the type of branch statement AST nodes
var BreakStmtType = StmtKind.NewBranch("@breakstmt", BranchStmtType)
BreakStmtType is the type of break statement AST nodes
var BuiltinConstObjectType = ObjectKind.NewBranch("@builtinconstobject", ConstObjectType, BuiltinObjectType)
BuiltinConstObjectType is the type of built-in constants
var BuiltinFuncObjectType = ObjectKind.NewBranch("@builtinfunctionobject", FunctionObjectType, BuiltinObjectType)
BuiltinFuncObjectType is the type of built-in functions
var BuiltinObjectType = NewUnionType("@builtinobject")
BuiltinObjectType is the type of built-in objects
var BuiltinTypeObjectType = ObjectKind.NewBranch("@builtintypeobject", TypeObjectType, BuiltinObjectType)
BuiltinTypeObjectType is the type of built-in named types
var CallOrConversionExpr = ExprKind.NewBranch("@callorconversionexpr")
CallOrConversionExpr is the type of call and conversion expression AST nodes (which cannot be distinguished by purely syntactic criteria)
var CaseClauseType = StmtKind.NewBranch("@caseclause", ScopeNodeType)
CaseClauseType is the type of case clause AST nodes
var ChanType = NewUnionType("@chantype", ElementContainerType)
ChanType is the type of channel types
var ChanTypeExpr = NewUnionType("@chantypeexpr")
ChanTypeExpr is the type of channel type AST nodes
var ChanTypeExprs = map[ast.ChanDir]*BranchType{ ast.SEND: ExprKind.NewBranch("@sendchantypeexpr", ChanTypeExpr), ast.RECV: ExprKind.NewBranch("@recvchantypeexpr", ChanTypeExpr), ast.SEND | ast.RECV: ExprKind.NewBranch("@sendrcvchantypeexpr", ChanTypeExpr), }
ChanTypeExprs is a map from channel type expressions to the corresponding AST node type
var ChanTypes = map[gotypes.ChanDir]*BranchType{ gotypes.SendOnly: TypeKind.NewBranch("@sendchantype", ChanType), gotypes.RecvOnly: TypeKind.NewBranch("@recvchantype", ChanType), gotypes.SendRecv: TypeKind.NewBranch("@sendrcvchantype", ChanType), }
ChanTypes is a map from channel type directions to the corresponding type
var CharLitExpr = ExprKind.NewBranch("@charlit", BasicLitExpr)
CharLitExpr is the type of character literal expression AST nodes
var CommClauseType = StmtKind.NewBranch("@commclause", ScopeNodeType)
CommClauseType is the type of comm clause AST ndoes
var CommentGroupType = NewPrimaryKeyType("@comment_group", NodeType)
CommentGroupType is the type of comment groups
var CommentGroupsTable = NewTable("comment_groups", EntityColumn(CommentGroupType, "id").Key(), EntityColumn(FileType, "parent"), IntColumn("idx"), ).KeySet("parent", "idx")
CommentGroupsTable is the table defining comment group entities
var CommentKind = NewCaseType(CommentType, "kind")
CommentKind is a case type for distinguishing different kinds of comments
var CommentType = NewPrimaryKeyType("@comment", NodeType)
CommentType is the type of comments
var CommentsTable = NewTable("comments", EntityColumn(CommentType, "id").Key(), IntColumn("kind"), EntityColumn(CommentGroupType, "parent"), IntColumn("idx"), StringColumn("text"), )
CommentsTable is the table defining comment entities
var Comparison = NewUnionType("@comparison", BinaryExpr)
Comparison is the type of comparison operator expression AST nodes
var ComplexType = NewUnionType("@complextype", NumericType)
ComplexType is the union of complex types
var ComponentTypesTable = NewTable("component_types", EntityColumn(CompositeType, "parent"), IntColumn("index"), StringColumn("name"), EntityColumn(TypeType, "tp"), ).KeySet("parent", "index")
ComponentTypesTable is the table associating composite types with their component types
var CompositeLitExpr = ExprKind.NewBranch("@compositelit")
CompositeLitExpr is the type of composite literal expression AST nodes
var CompositeType = NewUnionType("@compositetype")
CompositeType is the type of all composite (that is, non-basic) types
var CompoundAssignStmtType = NewUnionType("@compoundassignstmt", AssignmentType)
CompoundAssignStmtType is the type of compound assignment statement AST nodes
var ConstDeclType = DeclKind.NewBranch("@constdecl", GenDeclType)
ConstDeclType is the type of constant declaration AST nodes
var ConstObjectType = NewUnionType("@constobject", ValueObjectType)
ConstObjectType is the type of declared or built-in constants
var ConstValuesTable = NewTable("constvalues", EntityColumn(ExprType, "expr").Unique(), StringColumn("value"), StringColumn("exact"), )
ConstValuesTable is the table associating constant expressions with their values
var ContainerParentTable = NewTable("containerparent", EntityColumn(ContainerType, "parent"), EntityColumn(ContainerType, "child").Unique(), )
ContainerParentTable is the table defining the parent-child relation among container entities
var ContainerType = NewUnionType("@container")
ContainerType is the type of files and folders
var ContinueStmtType = StmtKind.NewBranch("@continuestmt", BranchStmtType)
ContinueStmtType is the type of continue statement AST nodes
var DecStmtType = StmtKind.NewBranch("@decstmt", IncDecStmtType)
DecStmtType is the type of decrement statement AST nodes
var DeclConstObjectType = ObjectKind.NewBranch("@declconstobject", ConstObjectType, DeclObjectType)
DeclConstObjectType is the type of declared constants
var DeclFuncObjectType = ObjectKind.NewBranch("@declfunctionobject", FunctionObjectType, DeclObjectType)
DeclFuncObjectType is the type of declared functions, including (abstract and concrete) methods
var DeclKind = NewCaseType(DeclType, "kind")
DeclKind is a case type for distinguishing different kinds of declaration AST nodes
var DeclObjectType = NewUnionType("@declobject")
DeclObjectType is the type of declared objects
var DeclParentType = NewUnionType("@declparent", NodeType)
DeclParentType is the type of AST nodes that can have declarations as children
var DeclStmtType = StmtKind.NewBranch("@declstmt", DeclParentType)
DeclStmtType is the type of declaration statement AST nodes
var DeclType = NewPrimaryKeyType("@decl", ExprParentType, StmtParentType, FieldParentType)
DeclType is the type of declaration AST nodes
var DeclTypeObjectType = ObjectKind.NewBranch("@decltypeobject", TypeObjectType, DeclObjectType)
DeclTypeObjectType is the type of declared named types
var DeclVarObjectType = ObjectKind.NewBranch("@declvarobject", VarObjectType, DeclObjectType)
DeclVarObjectType is the type of declared variables including function parameters, results and struct fields
var DeclsTable = NewTable("decls", EntityColumn(DeclType, "id").Key(), IntColumn("kind"), EntityColumn(DeclParentType, "parent"), IntColumn("idx"), ).KeySet("parent", "idx")
DeclsTable is the table defining declaration AST nodes
var DeferStmtType = StmtKind.NewBranch("@deferstmt")
DeferStmtType is the type of defer statement AST nodes
var DefsTable = NewTable("defs", EntityColumn(IdentExpr, "ident"), EntityColumn(ObjectType, "object"), )
DefsTable maps identifiers to the objects they define
var DocCommentsTable = NewTable("doc_comments", EntityColumn(DocumentableType, "node").Unique(), EntityColumn(CommentGroupType, "comment"), )
DocCommentsTable is the table associating doc comments with the nodes they document
var DocumentableType = NewUnionType("@documentable", NodeType)
DocumentableType is the type of AST nodes to which documentation can be attached
var ElementContainerType = NewUnionType("@containertype", CompositeType)
ElementContainerType is the type of types that have elements, such as arrays and channels
var ElementTypeTable = NewTable("element_type", EntityColumn(ElementContainerType, "container").Unique(), EntityColumn(TypeType, "tp"), )
ElementTypeTable is the table associating container types with their element type
var EllipsisExpr = ExprKind.NewBranch("@ellipsis")
EllipsisExpr is the type of ellipsis expression AST nodes
var EmptyStmtType = StmtKind.NewBranch("@emptystmt")
EmptyStmtType is the type of empty statement AST nodes
var EqualityTest = NewUnionType("@equalitytest", Comparison)
EqualityTest is the type of equality operator expression AST nodes
var ErrorKind = NewCaseType(ErrorType, "kind")
ErrorKind is a case type for distinguishing different kinds of frontend errors
var ErrorType = NewPrimaryKeyType("@error")
ErrorType is the type of frontend errors
var ErrorTypes = map[packages.ErrorKind]*BranchType{ packages.UnknownError: ErrorKind.NewBranch("@unknownerror"), packages.ListError: ErrorKind.NewBranch("@listerror"), packages.ParseError: ErrorKind.NewBranch("@parseerror"), packages.TypeError: ErrorKind.NewBranch("@typeerror"), }
ErrorTypes is a map from error kinds to the corresponding type
var ErrorsTable = NewTable("errors", EntityColumn(ErrorType, "id").Key(), IntColumn("kind"), StringColumn("msg"), StringColumn("rawpos"), StringColumn("file"), IntColumn("line"), IntColumn("col"), EntityColumn(PackageType, "package"), IntColumn("idx"), ).KeySet("package", "idx")
ErrorsTable is the table describing frontend errors
var ExprKind = NewCaseType(ExprType, "kind")
ExprKind is a case type for distinguishing different kinds of expression AST nodes
var ExprParentType = NewUnionType("@exprparent", NodeType)
ExprParentType is the type of AST nodes that can have expressions as children
var ExprStmtType = StmtKind.NewBranch("@exprstmt")
ExprStmtType is the type of expressio statemement AST nodes
var ExprSwitchStmtType = StmtKind.NewBranch("@exprswitchstmt", SwitchStmtType)
ExprSwitchStmtType is the type of expression-switch statement AST nodes
var ExprType = NewPrimaryKeyType("@expr", ExprParentType)
ExprType is the type of expression AST nodes
var ExprsTable = NewTable("exprs", EntityColumn(ExprType, "id").Key(), IntColumn("kind"), EntityColumn(ExprParentType, "parent"), IntColumn("idx"), ).KeySet("parent", "idx")
ExprsTable is the table defining expression AST nodes
var FallthroughStmtType = StmtKind.NewBranch("@fallthroughstmt", BranchStmtType)
FallthroughStmtType is the type of fallthrough statement AST nodes
var FieldParentType = NewUnionType("@fieldparent", NodeType)
FieldParentType is the type of AST nodes that can have fields as children
var FieldStructsTable = NewTable("fieldstructs", EntityColumn(ObjectType, "field").Unique(), EntityColumn(StructType, "struct"), )
FieldStructsTable maps fields to the structs they are in
var FieldType = NewPrimaryKeyType("@field", DocumentableType, ExprParentType)
FieldType is the type of field AST nodes
var FieldsTable = NewTable("fields", EntityColumn(FieldType, "id").Key(), EntityColumn(FieldParentType, "parent"), IntColumn("idx"), )
FieldsTable is the table defining field AST nodes
var FileType = NewPrimaryKeyType("@file", ContainerType, DocumentableType, ExprParentType, ModExprParentType, DeclParentType, ScopeNodeType)
FileType is the type of file AST nodes
var FilesTable = NewTable("files", EntityColumn(FileType, "id").Key(), StringColumn("name"), StringColumn("simple"), StringColumn("ext"), IntColumn("fromSource"), )
FilesTable is the table defining file nodes
var FloatLitExpr = ExprKind.NewBranch("@floatlit", BasicLitExpr)
FloatLitExpr is the type of floating-point literal expression AST nodes
var FloatType = NewUnionType("@floattype", NumericType)
FloatType is the union of floating-point types
var FolderType = NewPrimaryKeyType("@folder", ContainerType)
FolderType is the type of folders
var FoldersTable = NewTable("folders", EntityColumn(FolderType, "id").Key(), StringColumn("name"), StringColumn("simple"), )
FoldersTable is the table defining folder entities
var ForStmtType = StmtKind.NewBranch("@forstmt", LoopStmtType)
ForStmtType is the type of for statement AST nodes
var FuncDeclType = DeclKind.NewBranch("@funcdecl", DocumentableType, FuncDefType)
FuncDeclType is the type of function declaration AST nodes
var FuncDefType = NewUnionType("@funcdef", StmtParentType, ExprParentType)
FuncDefType is the type of AST nodes that define functions, that is, function declarations and function literals
var FuncLitExpr = ExprKind.NewBranch("@funclit", FuncDefType)
FuncLitExpr is the type of function literal expression AST nodes
var FuncTypeExpr = ExprKind.NewBranch("@functypeexpr", FieldParentType, ScopeNodeType)
FuncTypeExpr is the type of function type AST nodes
var FunctionObjectType = NewUnionType("@functionobject", ValueObjectType)
FunctionObjectType is the type of declared or built-in functions
var GenDeclType = NewUnionType("@gendecl", DocumentableType)
GenDeclType is the type of generic declaration AST nodes
var GoStmtType = StmtKind.NewBranch("@gostmt")
GoStmtType is the type of go statement AST nodes
var GotoStmtType = StmtKind.NewBranch("@gotostmt", BranchStmtType)
GotoStmtType is the type of goto statement AST nodes
var HasEllipsisTable = NewTable("has_ellipsis", EntityColumn(CallOrConversionExpr, "id"), )
var HasLocationTable = NewTable("has_location", EntityColumn(LocatableType, "locatable").Unique(), EntityColumn(LocationType, "location"), )
HasLocationTable is the table associating entities with their locations
var IdentExpr = ExprKind.NewBranch("@ident")
IdentExpr is the type of identifier expression AST nodes
var IfStmtType = StmtKind.NewBranch("@ifstmt", ScopeNodeType)
IfStmtType is the type of if statement AST nodes
var ImagLitExpr = ExprKind.NewBranch("@imaglit", BasicLitExpr)
ImagLitExpr is the type of imaginary literal expression AST nodes
var ImportDeclType = DeclKind.NewBranch("@importdecl", GenDeclType)
ImportDeclType is the type of import declaration AST nodes
var ImportSpecType = SpecKind.NewBranch("@importspec")
ImportSpecType is the type of import declaration specification nodes
var IncDecStmtType = NewUnionType("@incdecstmt")
IncDecStmtType is the type of increment/decrement statement AST nodes
var IncStmtType = StmtKind.NewBranch("@incstmt", IncDecStmtType)
IncStmtType is the type of increment statement AST nodes
var IndexExpr = ExprKind.NewBranch("@indexexpr")
IndexExpr is the type of index expression AST nodes
var IntLitExpr = ExprKind.NewBranch("@intlit", BasicLitExpr)
IntLitExpr is a case type for dishinguishing different kinds of literal expression AST nodes
var IntegerType = NewUnionType("@integertype", NumericType)
IntegerType is the union of integer types
var InterfaceType = TypeKind.NewBranch("@interfacetype", CompositeType)
InterfaceType is the type of interface types
var InterfaceTypeExpr = ExprKind.NewBranch("@interfacetypeexpr", FieldParentType)
InterfaceTypeExpr is the type of interface type AST nodes
var KeyTypeTable = NewTable("key_type", EntityColumn(MapType, "map").Unique(), EntityColumn(TypeType, "tp"), )
KeyTypeTable is the table associating maps with their key type
var KeyValueExpr = ExprKind.NewBranch("@keyvalueexpr")
KeyValueExpr is the type of key-value expression AST nodes
var LabelObjectType = ObjectKind.NewBranch("@labelobject")
LabelObjectType is the type of statement labels
var LabeledStmtType = StmtKind.NewBranch("@labeledstmt")
LabeledStmtType is the type of labeled statement AST nodes
var LiteralType = NewUnionType("@literaltype", BasicType)
LiteralType is the union of literal types
var LiteralsTable = NewTable("literals", EntityColumn(ExprType, "expr").Unique(), StringColumn("value"), StringColumn("raw"), )
LiteralsTable is the table associating literal expression AST nodes with their values
var LocalScopeType = ScopeKind.NewBranch("@localscope", LocatableType)
LocalScopeType is the type of local (that is, non-universe, non-package) scopes
var LocatableType = NewUnionType("@locatable")
LocatableType is the type of program entities that have locations
var LocationDefaultType = NewPrimaryKeyType("@location_default")
LocationDefaultType is the type of source locations
var LocationType = NewAliasType("@location", LocationDefaultType)
LocationType is an alias for LocationDefaultType
var LocationsDefaultTable = NewTable("locations_default", EntityColumn(LocationDefaultType, "id").Key(), EntityColumn(FileType, "file"), IntColumn("beginLine"), IntColumn("beginColumn"), IntColumn("endLine"), IntColumn("endColumn"), )
LocationsDefaultTable is the table defining location objects
var LogicalBinaryExpr = NewUnionType("@logicalbinaryexpr", BinaryExpr, LogicalExpr)
LogicalBinaryExpr is the type of logical binary operator expression AST nodes
var LogicalExpr = NewUnionType("@logicalexpr", OperatorExpr)
LogicalExpr is the type of logical operator expression AST nodes
var LogicalUnaryExpr = NewUnionType("@logicalunaryexpr", UnaryExpr, LogicalExpr)
LogicalUnaryExpr is the type of logical unary operator expression AST nodes
var LoopStmtType = NewUnionType("@loopstmt", ScopeNodeType)
LoopStmtType is the type of loop statement AST nodes (including for statements and range statements)
var MapType = TypeKind.NewBranch("@maptype", ElementContainerType)
MapType is the type of map types
var MapTypeExpr = ExprKind.NewBranch("@maptypeexpr")
MapTypeExpr is the type of map type AST nodes
var MethodHostsTable = NewTable("methodhosts", EntityColumn(ObjectType, "method"), EntityColumn(NamedType, "host"), )
MethodHostsTable maps interface methods to the named type they belong to
var MethodReceiversTable = NewTable("methodreceivers", EntityColumn(ObjectType, "method").Unique(), EntityColumn(ObjectType, "receiver"), )
MethodReceiversTable maps methods to their receiver
var ModCommentBlockType = ModExprKind.NewBranch("@modcommentblock")
ModCommentBlockType is the type of go.mod comment block AST nodes
var ModExprKind = NewCaseType(ModExprType, "kind")
ModExprKind is a case type for distinguishing different kinds of go.mod expression nodes
var ModExprParentType = NewUnionType("@modexprparent", NodeType)
ModExprParentType is the type of go.mod nodes that can have go.mod expressions as children
var ModExprType = NewPrimaryKeyType("@modexpr", ModExprParentType, DocumentableType)
ModExprType is the type of go.mod expression nodes
var ModExprsTable = NewTable("modexprs", EntityColumn(ModExprType, "id").Key(), IntColumn("kind"), EntityColumn(ModExprParentType, "parent"), IntColumn("idx"), ).KeySet("parent", "idx")
ModExprsTable is the table defining expression AST nodes for go.mod files
var ModLParenType = ModExprKind.NewBranch("@modlparen")
ModLParenType is the type of go.mod line block start AST nodes
var ModLineBlockType = ModExprKind.NewBranch("@modlineblock")
ModLineBlockType is the type of go.mod line block AST nodes
var ModLineType = ModExprKind.NewBranch("@modline")
ModLineType is the type of go.mod line AST nodes
var ModRParenType = ModExprKind.NewBranch("@modrparen")
ModRParenType is the type of go.mod line block end AST nodes
var ModTokensTable = NewTable("modtokens", StringColumn("token"), EntityColumn(ModExprType, "parent"), IntColumn("idx"), ).KeySet("parent", "idx")
ModTokensTable is the table associating go.mod tokens with their Line or LineBlock
var NamedType = TypeKind.NewBranch("@namedtype", CompositeType)
NamedType is the type of named types
var NodeType = NewUnionType("@node", LocatableType)
NodeType is the type of AST nodes
var NumericType = NewUnionType("@numerictype", BasicType)
NumericType is the union of numeric types
var NumlinesTable = NewTable("numlines", EntityColumn(SourceLineType, "element_id"), IntColumn("num_lines"), IntColumn("num_code"), IntColumn("num_comment"), )
NumlinesTable is the table containing LoC information
var ObjectKind = NewCaseType(ObjectType, "kind")
ObjectKind is a case type for distinguishing different kinds of built-in and declared objects
var ObjectScopesTable = NewTable("objectscopes", EntityColumn(ObjectType, "object").Unique(), EntityColumn(ScopeType, "scope"), )
ObjectScopesTable is the table describing the scope to which an object belongs (if any)
var ObjectType = NewPrimaryKeyType("@object")
ObjectType is the type of objects (that is, declared entities)
var ObjectTypesTable = NewTable("objecttypes", EntityColumn(ObjectType, "object").Unique(), EntityColumn(TypeType, "tp"), )
ObjectTypesTable is the table describing the type of an object (if any)
var ObjectsTable = NewTable("objects", EntityColumn(ObjectType, "id").Key(), IntColumn("kind"), StringColumn("name"), )
ObjectsTable is the table describing objects (that is, declared entities)
var OperatorExpr = NewUnionType("@operatorexpr")
OperatorExpr is the type of operator expression AST nodes
var PackageScopeType = ScopeKind.NewBranch("@packagescope")
PackageScopeType is the type of package scopes
var PackageType = NewPrimaryKeyType("@package")
PackageType is the type of packages
var PackagesTable = NewTable("packages", EntityColumn(PackageType, "id").Key(), StringColumn("name"), StringColumn("path"), EntityColumn(PackageScopeType, "scope"), )
PackagesTable is the table describing packages
var ParenExpr = ExprKind.NewBranch("@parenexpr")
ParenExpr is the type of parenthesis expression AST nodes
var PkgObjectType = ObjectKind.NewBranch("@pkgobject")
PkgObjectType is the type of imported packages
var PointerType = TypeKind.NewBranch("@pointertype", CompositeType)
PointerType is the type of pointer types
var RangeStmtType = StmtKind.NewBranch("@rangestmt", LoopStmtType)
RangeStmtType is the type of range statement AST nodes
var RelationalComparison = NewUnionType("@relationalcomparison", Comparison)
RelationalComparison is the type of relational operator expression AST nodes
var ReturnStmtType = StmtKind.NewBranch("@returnstmt")
ReturnStmtType is the type of return statement AST nodes
var ScopeKind = NewCaseType(ScopeType, "kind")
ScopeKind is a case type for distinguishing different kinds of scopes
var ScopeNestingTable = NewTable("scopenesting", EntityColumn(ScopeType, "inner").Unique(), EntityColumn(ScopeType, "outer"), )
ScopeNestingTable is the table describing scope nesting
var ScopeNodeType = NewUnionType("@scopenode", NodeType)
ScopeNodeType is the type of AST nodes that may have a scope attached to them
var ScopeNodesTable = NewTable("scopenodes", EntityColumn(ScopeNodeType, "node").Unique(), EntityColumn(LocalScopeType, "scope"), )
ScopeNodesTable is the table associating local scopes with the AST nodes that induce them
var ScopeType = NewPrimaryKeyType("@scope")
ScopeType is the type of scopes
var ScopesTable = NewTable("scopes", EntityColumn(ScopeType, "id").Key(), IntColumn("kind"), )
ScopesTable is the table defining scopes
var SelectStmtType = StmtKind.NewBranch("@selectstmt")
SelectStmtType is the type of select statement AST nodes
var SelectorExpr = ExprKind.NewBranch("@selectorexpr")
SelectorExpr is the type of selector expression AST nodes
var SendStmtType = StmtKind.NewBranch("@sendstmt")
SendStmtType is the type of send statement AST nodes
var ShiftExpr = NewUnionType("@shiftexpr", BitwiseBinaryExpr)
ShiftExpr is the type of shift operator expression AST nodes
var SignatureType = TypeKind.NewBranch("@signaturetype", CompositeType)
SignatureType is the type of signature types
var SignedIntegerType = NewUnionType("@signedintegertype", IntegerType)
SignedIntegerType is the union of signed integer types
var SimpleAssignStmtType = NewUnionType("@simpleassignstmt", AssignmentType)
SimpleAssignStmtType is the type of simple (i.e., non-compound) assignment statement AST nodes
var SlashSlashComment = CommentKind.NewBranch("@slashslashcomment")
SlashSlashComment is the type of single-line comments starting with a double slash
var SlashStarComment = CommentKind.NewBranch("@slashstarcomment")
SlashStarComment is the type of block comments delimited by stars and slashes
var SliceExpr = ExprKind.NewBranch("@sliceexpr")
SliceExpr is the type of slice expression AST nodes
var SliceType = TypeKind.NewBranch("@slicetype", ElementContainerType)
SliceType is the type of slice types
var SourceLineType = NewAliasType("@sourceline", LocatableType)
SourceLineType is an alias for LocatableType
var SpecKind = NewCaseType(SpecType, "kind")
SpecKind is a case type for distinguishing different kinds of declaration specification nodes
var SpecType = NewPrimaryKeyType("@spec", ExprParentType, DocumentableType)
SpecType is the type of spec AST nodes
var SpecsTable = NewTable("specs", EntityColumn(SpecType, "id").Key(), IntColumn("kind"), EntityColumn(GenDeclType, "parent"), IntColumn("idx"), ).KeySet("parent", "idx")
SpecsTable is the table defining declaration specification AST nodes
var StarExpr = ExprKind.NewBranch("@starexpr")
StarExpr is the type of star expression AST nodes
var StmtKind = NewCaseType(StmtType, "kind")
StmtKind is a case type for distinguishing different kinds of statement AST nodes
var StmtParentType = NewUnionType("@stmtparent", NodeType)
StmtParentType is the type of AST nodes that can have statements as children
var StmtType = NewPrimaryKeyType("@stmt", ExprParentType, StmtParentType)
StmtType is the type of statement AST nodes
var StmtsTable = NewTable("stmts", EntityColumn(StmtType, "id").Key(), IntColumn("kind"), EntityColumn(StmtParentType, "parent"), IntColumn("idx"), ).KeySet("parent", "idx")
StmtsTable is the table defining statement AST nodes
var StringLitExpr = ExprKind.NewBranch("@stringlit", BasicLitExpr)
StringLitExpr is the type of string literal expression AST nodes
var StringType = NewUnionType("@stringtype", BasicType)
StringType is the union of the normal and literal string types
var StructType = TypeKind.NewBranch("@structtype", CompositeType)
StructType is the type of struct types
var StructTypeExpr = ExprKind.NewBranch("@structtypeexpr", FieldParentType)
StructTypeExpr is the type of struct type AST nodes
var SwitchStmtType = NewUnionType("@switchstmt", ScopeNodeType)
SwitchStmtType is the type of switch statement AST nodes, covering both expression switch and type switch
var TupleType = TypeKind.NewBranch("@tupletype", CompositeType)
TupleType is the type of tuple types
var TypeAssertExpr = ExprKind.NewBranch("@typeassertexpr")
TypeAssertExpr is the type of type assertion expression AST nodes
var TypeDeclType = DeclKind.NewBranch("@typedecl", GenDeclType)
TypeDeclType is the type of type declaration AST nodes
var TypeDefSpecType = SpecKind.NewBranch("@typedefspec", TypeSpecType)
TypeDefSpecType is the type of type declaration specification nodes corresponding to type definitions
var TypeKind = NewCaseType(TypeType, "kind")
TypeKind is a case type for distinguishing different kinds of types
var TypeNameTable = NewTable("typename", EntityColumn(TypeType, "tp").Unique(), StringColumn("name"), )
TypeNameTable is the table associating named types with their names
var TypeObjectTable = NewTable("type_objects", EntityColumn(TypeType, "tp").Unique(), EntityColumn(ObjectType, "object"), )
TypeObjectTable maps types to their corresponding objects, if any
var TypeObjectType = NewUnionType("@typeobject")
TypeObjectType is the type of declared or built-in named types
var TypeOfTable = NewTable("type_of", EntityColumn(ExprType, "expr").Unique(), EntityColumn(TypeType, "tp"), )
TypeOfTable is the table associating expressions with their types (if known)
var TypeSpecType = NewUnionType("@typespec")
TypeSpecType is the type of type declaration specification nodes
var TypeSwitchStmtType = StmtKind.NewBranch("@typeswitchstmt", SwitchStmtType)
TypeSwitchStmtType is the type of type-switch statement AST nodes
var TypeType = NewPrimaryKeyType("@type")
TypeType is the type of types
var TypesTable = NewTable("types", EntityColumn(TypeType, "id").Key(), IntColumn("kind"), )
TypesTable is the table describing types
var UnaryExpr = NewUnionType("@unaryexpr", OperatorExpr)
UnaryExpr is the type of unary operator expression AST nodes
var UnaryExprs = map[token.Token]*BranchType{ token.ADD: ExprKind.NewBranch("@plusexpr", ArithmeticUnaryExpr), token.SUB: ExprKind.NewBranch("@minusexpr", ArithmeticUnaryExpr), token.NOT: ExprKind.NewBranch("@notexpr", LogicalUnaryExpr), token.XOR: ExprKind.NewBranch("@complementexpr", BitwiseUnaryExpr), token.MUL: ExprKind.NewBranch("@derefexpr", UnaryExpr), token.AND: ExprKind.NewBranch("@addressexpr", UnaryExpr), token.ARROW: ExprKind.NewBranch("@arrowexpr", UnaryExpr), }
UnaryExprs is a map from unary operator tokens to the corresponding AST node type
var UnderlyingTypeTable = NewTable("underlying_type", EntityColumn(NamedType, "named").Unique(), EntityColumn(TypeType, "tp"), )
UnderlyingTypeTable is the table associating named types with their underlying type
var UniverseScopeType = ScopeKind.NewBranch("@universescope")
UniverseScopeType is the type of the universe scope
var UnsignedIntegerType = NewUnionType("@unsignedintegertype", IntegerType)
UnsignedIntegerType is the union of unsigned integer types
var UsesTable = NewTable("uses", EntityColumn(IdentExpr, "ident"), EntityColumn(ObjectType, "object"), )
UsesTable maps identifiers to the objects they denote
var ValueObjectType = NewUnionType("@valueobject")
ValueObjectType is the type of declared or built-in variables or constants
var ValueSpecType = SpecKind.NewBranch("@valuespec")
ValueSpecType is the type of value declaration specification nodes
var VarDeclType = DeclKind.NewBranch("@vardecl", GenDeclType)
VarDeclType is the type of variable declaration AST nodes
var VarObjectType = NewUnionType("@varobject", ValueObjectType)
VarObjectType is the type of declared or built-in variables (the latter do not currently exist)
Functions ¶
func AddDefaultSnippet ¶
AddDefaultSnippet adds the given text `snippet` to the schema of this database
func PrintDbScheme ¶
PrintDbScheme prints the schema of this database to the writer `w`
Types ¶
type AliasType ¶
type AliasType struct {
// contains filtered or unexported fields
}
An AliasType represents a database type which is an alias of another database type
func NewAliasType ¶
NewAliasType constructs a new alias type with the given `name` that aliases `underlying`
type BranchType ¶
type BranchType struct {
// contains filtered or unexported fields
}
A BranchType represents one branch of a case type
func (BranchType) Index ¶
func (bt BranchType) Index() int
Index returns the numeric index of this branch type
type CaseType ¶
type CaseType struct {
// contains filtered or unexported fields
}
A CaseType represents a database type defined by a primary key column with a supplementary kind column
func NewCaseType ¶
NewCaseType constructs a new case type on the given `base` type whose discriminator values come from `column`
type Column ¶
type Column struct {
// contains filtered or unexported fields
}
A Column represents a column in a database table
func EntityColumn ¶
EntityColumn constructs a column with name `columnName` holding entities of type `columnType`
func StringColumn ¶
StringColumn constructs a column with name `columnName` holding string values
type PrimaryKeyType ¶
type PrimaryKeyType struct {
// contains filtered or unexported fields
}
A PrimaryKeyType represents a database type defined by a primary key column
func NewPrimaryKeyType ¶
func NewPrimaryKeyType(name string, parents ...*UnionType) *PrimaryKeyType
NewPrimaryKeyType constructs a new primary key type with the given `name`, and adds it to the union types `parents` (if any)
type PrimitiveType ¶
type PrimitiveType int
A PrimitiveType represents a primitive dataase type
const ( // INT represents the primitive database type `int` INT PrimitiveType = iota // FLOAT represents the primitive database type `float` FLOAT // BOOLEAN represents the primitive database type `boolean` BOOLEAN // DATE represents the primitive database type `date` DATE // STRING represents the primitive database type `string` STRING )
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
A Table represents a database table
func (Table) Emit ¶
Emit outputs a tuple of `values` for this table using trap writer `tw` and panicks if the tuple does not have the right schema
type Type ¶
type Type interface {
// contains filtered or unexported methods
}
A Type represents a database type
type UnionType ¶
type UnionType struct {
// contains filtered or unexported fields
}
A UnionType represents a database type defined as the union of other database types
func NewUnionType ¶
NewUnionType constructs a new union type with the given `name`, and adds it to the union types `parents` (if any)