resolver

package
v0.0.4-pre Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2023 License: MIT Imports: 4 Imported by: 0

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

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 New

func New(Mod *ast.Module, errorHandler ddperror.Handler, file string) *Resolver

create a new resolver to resolve the passed AST

func (*Resolver) BaseVisitor

func (*Resolver) BaseVisitor()

func (*Resolver) ResolveNode

func (r *Resolver) ResolveNode(node ast.Node)

resolve a single node

func (*Resolver) VisitAssignStmt

func (r *Resolver) VisitAssignStmt(stmt *ast.AssignStmt)

func (*Resolver) VisitBadDecl

func (r *Resolver) VisitBadDecl(decl *ast.BadDecl)

if a BadDecl exists the AST is faulty

func (*Resolver) VisitBadExpr

func (r *Resolver) VisitBadExpr(expr *ast.BadExpr)

if a BadExpr exists the AST is faulty

func (*Resolver) VisitBadStmt

func (r *Resolver) VisitBadStmt(stmt *ast.BadStmt)

if a BadStmt exists the AST is faulty

func (*Resolver) VisitBinaryExpr

func (r *Resolver) VisitBinaryExpr(expr *ast.BinaryExpr)

func (*Resolver) VisitBlockStmt

func (r *Resolver) VisitBlockStmt(stmt *ast.BlockStmt)

func (*Resolver) VisitBoolLit

func (r *Resolver) VisitBoolLit(expr *ast.BoolLit)

func (*Resolver) VisitCastExpr

func (r *Resolver) VisitCastExpr(expr *ast.CastExpr)

func (*Resolver) VisitCharLit

func (r *Resolver) VisitCharLit(expr *ast.CharLit)

func (*Resolver) VisitDeclStmt

func (r *Resolver) VisitDeclStmt(stmt *ast.DeclStmt)

func (*Resolver) VisitExprStmt

func (r *Resolver) VisitExprStmt(stmt *ast.ExprStmt)

func (*Resolver) VisitFloatLit

func (r *Resolver) VisitFloatLit(expr *ast.FloatLit)

func (*Resolver) VisitForRangeStmt

func (r *Resolver) VisitForRangeStmt(stmt *ast.ForRangeStmt)

func (*Resolver) VisitForStmt

func (r *Resolver) VisitForStmt(stmt *ast.ForStmt)

func (*Resolver) VisitFuncCall

func (r *Resolver) VisitFuncCall(expr *ast.FuncCall)

func (*Resolver) VisitFuncDecl

func (r *Resolver) VisitFuncDecl(decl *ast.FuncDecl)

func (*Resolver) VisitGrouping

func (r *Resolver) VisitGrouping(expr *ast.Grouping)

func (*Resolver) VisitIdent

func (r *Resolver) VisitIdent(expr *ast.Ident)

func (*Resolver) VisitIfStmt

func (r *Resolver) VisitIfStmt(stmt *ast.IfStmt)

func (*Resolver) VisitImportStmt

func (r *Resolver) VisitImportStmt(stmt *ast.ImportStmt)

func (*Resolver) VisitIndexing

func (r *Resolver) VisitIndexing(expr *ast.Indexing)

func (*Resolver) VisitIntLit

func (r *Resolver) VisitIntLit(expr *ast.IntLit)

nothing to do for literals

func (*Resolver) VisitListLit

func (r *Resolver) VisitListLit(expr *ast.ListLit)

func (*Resolver) VisitReturnStmt

func (r *Resolver) VisitReturnStmt(stmt *ast.ReturnStmt)

func (*Resolver) VisitStringLit

func (r *Resolver) VisitStringLit(expr *ast.StringLit)

func (*Resolver) VisitTernaryExpr

func (r *Resolver) VisitTernaryExpr(expr *ast.TernaryExpr)

func (*Resolver) VisitUnaryExpr

func (r *Resolver) VisitUnaryExpr(expr *ast.UnaryExpr)

func (*Resolver) VisitVarDecl

func (r *Resolver) VisitVarDecl(decl *ast.VarDecl)

func (*Resolver) VisitWhileStmt

func (r *Resolver) VisitWhileStmt(stmt *ast.WhileStmt)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL