CS代考计算机代写 package sexpr

package sexpr

import “errors”

// ErrParser is the error value returned by the Parser if the string is not a
// valid term.
// See also https://golang.org/pkg/errors/#New
// and // https://golang.org/pkg/builtin/#error
var ErrParser = errors.New(“parser error”)

//
// ::= | | QUOTE
// ::= NUMBER | SYMBOL
// ::= LPAR RPAR | LPAR RPAR
// ::= DOT
// ::= | \epsilon
//
type Parser interface {
Parse(string) (*SExpr, error)
}

func NewParser() Parser {
panic(“TODO: implement NewParser”)
}