Documentation ¶
Overview ¶
goparse parses Go source code. You may independently enable parser tracing, which yields a trace of parsed productions; and AST printing, which gives a lower-level view of the resultant AST. Both are ideal for programmer consumption and debugging, aiding in understanding the structure of Go programs as well as the behavior of the built-in parser library.
If a positional argument is specified, it will be used as the input file. If no positional arguments are specified, the input will be read from standard in.
There are other options as well that enable other parser functionality.
usage: goparse [-h] [options] [file] -all-errors=false: report all errors (not just the first 10 on different lines) -ast-print=false: print AST with ast.Fprint and no field filter -declaration-errors=false: report declaration errors -imports-only=false: stop parsing after import declarations -parse-comments=false: parse comments and add them to AST -trace=false: print a trace of parsed productions
If both tracing and AST printing are enabled, the trace will precede AST output.
Click to show internal directories.
Click to hide internal directories.