// NewLexer the Lexer constructor
339014
func NewLexer(src io.Reader, fName string) *Lexer {
	file := t.NewFileSet().AddFile(fName, -1, 1<<31-3)
	lx, err := lex.New(file, bufio.NewReader(src), lex.RuneClass(Rune2Class))
	if err != nil {
		panic(err)
	}

	return &Lexer{
		Lexer:         lx,
		StateStack:    []int{0},
		PhpDocComment: "",
		FreeFloating:  nil,
		heredocLabel:  "",
		tokenBytesBuf: &bytes.Buffer{},
		TokenPool:     &TokenPool{},
	}
}
412770
func NewReader(r io.Reader, limiter Limiter) io.Reader {
	return &reader{r, limiter}
}
1348768
func NewReader(r io.Reader, dropper Dropper, strict, checksum bool) *Reader {
	return &Reader{
		r:        r,
		dropper:  dropper,
		strict:   strict,
		checksum: checksum,
		last:     true,
	}
}
377740
func NewParser(scanner *Scanner, ob ...Observer) (*Parser, error) {
	return NewParserWithStorage(scanner, nil, ob...)
}
542461
func NewLexer(r io.Reader) *Lexer {
	var b []byte
	if r != nil {
		if buffer, ok := r.(interface {
			Bytes() []byte
		}); ok {
			b = buffer.Bytes()
		} else {
			var err error
			b, err = ioutil.ReadAll(r)
			if err != nil {
				return &Lexer{
					buf: []byte{0},
					err: err,
				}
			}
		}
	}
	return NewLexerBytes(b)
}
91103
func NewWithParser(alg string, parser *jwt.Parser, signKey interface{}, verifyKey interface{}) *JWTAuth {
	return &JWTAuth{
		signKey:   signKey,
		verifyKey: verifyKey,
		signer:    jwt.GetSigningMethod(alg),
		parser:    parser,
	}
}
687342
func newReader(ctx context.Context, d *dispatcher, r io.ReadCloser) *reader {
	return &reader{
		ctx: ctx,
		d:   d,
		r:   r,
	}
}
593976
func NewReader(charset string, r io.Reader) (io.Reader, error) {
	tr, err := TranslatorFrom(charset)
	if err != nil {
		return nil, err
	}
	return NewTranslatingReader(r, tr), nil
}
1354862
func NewReader(r io.Reader, raw bool) *Reader {
	return &Reader{r: bufio.NewReader(r), raw: raw}
}
102152
func NewLexer(config *Config, rules Rules) (*RegexLexer, error) {
	if config == nil {
		config = &Config{}
	}
	if _, ok := rules["root"]; !ok {
		return nil, fmt.Errorf("no \"root\" state")
	}
	compiledRules := map[string][]*CompiledRule{}
	for state, rules := range rules {
		compiledRules[state] = nil
		for _, rule := range rules {
			flags := ""
			if !config.NotMultiline {
				flags += "m"
			}
			if config.CaseInsensitive {
				flags += "i"
			}
			if config.DotAll {
				flags += "s"
			}
			compiledRules[state] = append(compiledRules[state], &CompiledRule{Rule: rule, flags: flags})
		}
	}
	return &RegexLexer{
		config: config,
		rules:  compiledRules,
	}, nil
}
1224464
func NewParser() *Parser {
	fp := Parser{
		rp: &rss.Parser{},
		ap: &atom.Parser{},
	}
	return &fp
}
1037288
func NewDecoder(r io.Reader) *Decoder {
	return &Decoder{r, defaultDelimiter, defaultEscape, false, false}
}
583833
func NewStringLexer(input string, fn LexFn) *StringLexer {
	return &StringLexer{
		input:       input,
		inputLength: len(input),
		start:       0,
		pos:         0,
		line:        1,
		width:       0,
		items:       make(chan LexItem, 1),
		entryPoint:  fn,
	}
}
1233495
func lex(name, input, left, right string) *lexer {
	if left == "" {
		left = leftDelim
	}
	if right == "" {
		right = rightDelim
	}
	l := &lexer{
		name:       name,
		input:      input,
		leftDelim:  left,
		rightDelim: right,
		items:      make(chan item),
	}
	go l.run()
	return l
}
172513
func NewParser(grammar *Grammar) (*Parser, error) {
	// Check that the grammar is left factorized.
	for _, clauses := range *grammar {
		idx := 0
		for _, cls := range clauses {
			if len(cls.Elements) == 0 {
				if idx == 0 {
					idx++
					continue
				}
				return nil, fmt.Errorf("grammar.NewParser: invalid extra empty clause derivation %v", clauses)
			}
			if cls.Elements[0].isSymbol {
				return nil, fmt.Errorf("grammar.NewParser: not left factored grammar in %v", clauses)
			}
		}
	}
	return &Parser{
		grammar: grammar,
	}, nil
}
77784
func NewReader(readCloser io.ReadCloser, args *ReaderArgs) *Reader {
	d := jstream.NewDecoder(readCloser, 0).ObjectAsKVS()
	return &Reader{
		args:       args,
		decoder:    d,
		valueCh:    d.Stream(),
		readCloser: readCloser,
	}
}
1208234
func NewDecoder(r io.Reader) *Decoder {
	h := sha1.New()
	return &Decoder{
		r:         io.TeeReader(r, h),
		hash:      h,
		extReader: bufio.NewReader(nil),
	}
}