goparse

command module
v0.0.0-...-c6541bb Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2015 License: MIT Imports: 9 Imported by: 0

README

Debugging command-line interface for the built-in Go library parser.

Documentation

Installation

go get github.com/crunchyroll/goparse

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.

Jump to

Keyboard shortcuts

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