Documentation ¶
Overview ¶
Package parser提供创建ast树的简便方法
parser不对代码编译的报误进行处理
如果要进行错误处理请自行使用 pkg/gitee.com/u-language/u-language/ucom/errcode.Handle
Index ¶
- Variables
- func ParserAuto(path string, thread bool, errctx *errcode.ErrCtx) (ast.GetImport, error)
- func ParserAuto2(path string, thread bool, errctx *errcode.ErrCtx) (ir2.Ir2, error)
- func ParserFile(path string, errctx *errcode.ErrCtx, IsCheck bool, ...) (*ast.Tree, error)
- func ParserFile2(path string, errctx *errcode.ErrCtx, IsCheck bool, Thread bool) (*ir2.File, error)
- func ParserPackage(dir string, thread bool, errctx *errcode.ErrCtx, sbt *ast.Sbt, ...) (*ast.Package, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Debug = false
View Source
var FileNoExt = errors.New("文件没有扩展名")
缩写 File does not have an extension 缩写成 FileNoExt
View Source
var ImportLimit = errors.New("目前import只支持相对路径导入")
View Source
var NoUFileErr = errors.New("没有U文件")
View Source
var PathNotFound = errors.New("找不到的路径")
Functions ¶
func ParserAuto ¶
ParserAuto 根据path是目录还是文件决定调用 ParserPackage 或 ParserFile
func ParserAuto2 ¶
ParserAuto2 根据path是目录还是文件决定调用 [ParserPackag2e] 或 ParserFile2
func ParserFile ¶
func ParserFile(path string, errctx *errcode.ErrCtx, IsCheck bool, ImportPackage *map[string]*ast.Package, Thread bool) (*ast.Tree, error)
ParserFile 从一个代码文件创建ast树
- path是文件路径
- errctx是错误处理上下文
- IsCheck是控制是否进行语义检查
- Thread是控制是否并发
func ParserFile2 ¶
ParserFile2 从一个代码文件创建 ir2.File 的指针
- path是文件路径
- errctx是错误处理上下文
- IsCheck是控制是否进行语义检查
- Thread是控制是否并发
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.