Documentation
¶
Overview ¶
The resolver package should not be used independently from the parser. It is not a complete Visitor itself, but is rather used to resolve single Nodes while parsing to ensure correct parsing of function-calls etc.
Because of this you will find many r.visit(x) calls to be commented out.
Index ¶
- type Resolver
- func (*Resolver) BaseVisitor()
- func (r *Resolver) ResolveNode(node ast.Node)
- func (r *Resolver) VisitAssignStmt(stmt *ast.AssignStmt)
- func (r *Resolver) VisitBadDecl(decl *ast.BadDecl)
- func (r *Resolver) VisitBadExpr(expr *ast.BadExpr)
- func (r *Resolver) VisitBadStmt(stmt *ast.BadStmt)
- func (r *Resolver) VisitBinaryExpr(expr *ast.BinaryExpr)
- func (r *Resolver) VisitBlockStmt(stmt *ast.BlockStmt)
- func (r *Resolver) VisitBoolLit(expr *ast.BoolLit)
- func (r *Resolver) VisitCastExpr(expr *ast.CastExpr)
- func (r *Resolver) VisitCharLit(expr *ast.CharLit)
- func (r *Resolver) VisitDeclStmt(stmt *ast.DeclStmt)
- func (r *Resolver) VisitExprStmt(stmt *ast.ExprStmt)
- func (r *Resolver) VisitFloatLit(expr *ast.FloatLit)
- func (r *Resolver) VisitForRangeStmt(stmt *ast.ForRangeStmt)
- func (r *Resolver) VisitForStmt(stmt *ast.ForStmt)
- func (r *Resolver) VisitFuncCall(expr *ast.FuncCall)
- func (r *Resolver) VisitFuncDecl(decl *ast.FuncDecl)
- func (r *Resolver) VisitGrouping(expr *ast.Grouping)
- func (r *Resolver) VisitIdent(expr *ast.Ident)
- func (r *Resolver) VisitIfStmt(stmt *ast.IfStmt)
- func (r *Resolver) VisitImportStmt(stmt *ast.ImportStmt)
- func (r *Resolver) VisitIndexing(expr *ast.Indexing)
- func (r *Resolver) VisitIntLit(expr *ast.IntLit)
- func (r *Resolver) VisitListLit(expr *ast.ListLit)
- func (r *Resolver) VisitReturnStmt(stmt *ast.ReturnStmt)
- func (r *Resolver) VisitStringLit(expr *ast.StringLit)
- func (r *Resolver) VisitTernaryExpr(expr *ast.TernaryExpr)
- func (r *Resolver) VisitUnaryExpr(expr *ast.UnaryExpr)
- func (r *Resolver) VisitVarDecl(decl *ast.VarDecl)
- func (r *Resolver) VisitWhileStmt(stmt *ast.WhileStmt)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resolver ¶
type Resolver struct {
ErrorHandler ddperror.Handler // function to which errors are passed
CurrentTable *ast.SymbolTable // needed state, public for the parser
Module *ast.Module // the module that is being resolved
}
holds state to resolve the symbols of an AST and its nodes and checking if they are valid fills the ASTs SymbolTable while doing so
func (*Resolver) BaseVisitor ¶
func (*Resolver) BaseVisitor()
func (*Resolver) VisitAssignStmt ¶
func (r *Resolver) VisitAssignStmt(stmt *ast.AssignStmt)
func (*Resolver) VisitBadDecl ¶
if a BadDecl exists the AST is faulty
func (*Resolver) VisitBadExpr ¶
if a BadExpr exists the AST is faulty
func (*Resolver) VisitBadStmt ¶
if a BadStmt exists the AST is faulty
func (*Resolver) VisitBinaryExpr ¶
func (r *Resolver) VisitBinaryExpr(expr *ast.BinaryExpr)
func (*Resolver) VisitBlockStmt ¶
func (*Resolver) VisitBoolLit ¶
func (*Resolver) VisitCastExpr ¶
func (*Resolver) VisitCharLit ¶
func (*Resolver) VisitDeclStmt ¶
func (*Resolver) VisitExprStmt ¶
func (*Resolver) VisitFloatLit ¶
func (*Resolver) VisitForRangeStmt ¶
func (r *Resolver) VisitForRangeStmt(stmt *ast.ForRangeStmt)
func (*Resolver) VisitForStmt ¶
func (*Resolver) VisitFuncCall ¶
func (*Resolver) VisitFuncDecl ¶
func (*Resolver) VisitGrouping ¶
func (*Resolver) VisitIdent ¶
func (*Resolver) VisitIfStmt ¶
func (*Resolver) VisitImportStmt ¶
func (r *Resolver) VisitImportStmt(stmt *ast.ImportStmt)
func (*Resolver) VisitIndexing ¶
func (*Resolver) VisitIntLit ¶
nothing to do for literals
func (*Resolver) VisitListLit ¶
func (*Resolver) VisitReturnStmt ¶
func (r *Resolver) VisitReturnStmt(stmt *ast.ReturnStmt)
func (*Resolver) VisitStringLit ¶
func (*Resolver) VisitTernaryExpr ¶
func (r *Resolver) VisitTernaryExpr(expr *ast.TernaryExpr)
func (*Resolver) VisitUnaryExpr ¶
func (*Resolver) VisitVarDecl ¶
func (*Resolver) VisitWhileStmt ¶
Click to show internal directories.
Click to hide internal directories.