func NewBuilder(fnames ...string) (*Builder, error) {
	var err error

	b := &Builder{
		fset:  token.NewFileSet(),
		files: make(map[string]*file, len(fnames)),
		funcs: make([]string, 0),
		Usage: `Usage: %[1]s [options] <input> <output>

ex:
 $ %[1]s -l=INFO -evtmax=-1 input.dat output.dat

options:
`,
	}

	for _, fname := range fnames {
		fi, err := os.Stat(fname)
		if err != nil {
			return nil, fmt.Errorf("builder: could not stat %q: %w", fname, err)
		}
		fm := fi.Mode()
		if fm.IsRegular() {
			src, err := ioutil.ReadFile(fname)
			if err != nil {
				return nil, fmt.Errorf("builder: could not read %q: %w", fname, err)
			}
			f, err := parser.ParseFile(b.fset, fname, src, parser.ParseComments)
			if err != nil {
				return nil, fmt.Errorf("builder: could not parse file %q: %w", fname, err)
			}
			b.files[fname] = &file{
				app:  b,
				f:    f,
				fset: b.fset,
				src:  src,
				name: fname,
			}
		}
		if fm.IsDir() {
			return nil, fmt.Errorf("directories not (yet) handled (got=%q)", fname)
		}
	}
	return b, err
}
// NewBuilder creates a Builder from a list of file names or directories
NewBuilder creates a Builder from a list of file names or directories
// NewBuilder creates a Builder from a list of file names or directories
func NewBuilder(fnames ...string) (*Builder, error) {
	var err error
	b := &Builder{
		fset:  token.NewFileSet(),
		files: make(map[string]*file, len(fnames)),
		funcs: make([]string, 0),
		Usage: `Usage: %[1]s [options] <input> <output>
ex:
 $ %[1]s -l=INFO -evtmax=-1 input.dat output.dat
options:
`,
	}
	for _, fname := range fnames {
		fi, err := os.Stat(fname)
		if err != nil {
			return nil, fmt.Errorf("builder: could not stat %q: %w", fname, err)
		}
		fm := fi.Mode()
		if fm.IsRegular() {
			src, err := ioutil.ReadFile(fname)
			if err != nil {
				return nil, fmt.Errorf("builder: could not read %q: %w", fname, err)
			}
			f, err := parser.ParseFile(b.fset, fname, src, parser.ParseComments)
			if err != nil {
				return nil, fmt.Errorf("builder: could not parse file %q: %w", fname, err)
			}
			b.files[fname] = &file{
				app:  b,
				f:    f,
				fset: b.fset,
				src:  src,
				name: fname,
			}
		}
		if fm.IsDir() {
			return nil, fmt.Errorf("directories not (yet) handled (got=%q)", fname)
		}
	}
	return b, err
}
func NewBuilder ( fnames ... string ) ( * Builder , error ) { var err error b := & Builder { fset : token . NewFileSet ( ) , files : make ( map [ string ] * file , len ( fnames ) ) , funcs : make ( [ ] string , 0 ) , Usage : `Usage: %[1]s [options] <input> <output>

ex:
 $ %[1]s -l=INFO -evtmax=-1 input.dat output.dat

options:
` , } for _ , fname := range fnames { fi , err := os . Stat ( fname ) if err != nil { return nil , fmt . Errorf ( " " , fname , err ) } fm := fi . Mode ( ) if fm . IsRegular ( ) { src , err := ioutil . ReadFile ( fname ) if err != nil { return nil , fmt . Errorf ( " " , fname , err ) } f , err := parser . ParseFile ( b . fset , fname , src , parser . ParseComments ) if err != nil { return nil , fmt . Errorf ( " " , fname , err ) } b . files [ fname ] = & file { app : b , f : f , fset : b . fset , src : src , name : fname , } } if fm . IsDir ( ) { return nil , fmt . Errorf ( " " , fname ) } } return b , err }
NewBuilder creates a Builder from a list of file names or directories
NewBuilder creates a Builder from a list of file names or directories