github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/asm/internal/lex/input.go (about)

     1  // Copyright 2015 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package lex
     6  
     7  // Input is the main input: a stack of readers and some macro definitions.
     8  // It also handles #include processing (by pushing onto the input stack)
     9  // and parses and instantiates macro definitions.
    10  type Input struct {
    11  	Stack
    12  	includes        []string
    13  	beginningOfLine bool
    14  	ifdefStack      []bool
    15  	macros          map[string]*Macro
    16  	text            string
    17  	peek            bool
    18  	peekToken       ScanToken
    19  	peekText        string
    20  }
    21  
    22  // NewInput returns an Input from the given path.
    23  func NewInput(name string) *Input
    24  
    25  func (in *Input) Error(args ...interface{})
    26  
    27  func (in *Input) Next() ScanToken
    28  
    29  func (in *Input) Text() string
    30  
    31  func (in *Input) Push(r TokenReader)
    32  
    33  func (in *Input) Close()