Documentation
¶
Index ¶
- Constants
- type ABuffer
- type PBReadType
- func (pb *PBReadType) Dump01(fo io.Writer)
- func (pb *PBReadType) FileSeen(fn string) bool
- func (pb *PBReadType) GetPos() (LineNo int, ColNo int, FileName string)
- func (pb *PBReadType) NextRune() (rn rune, done bool)
- func (pb *PBReadType) OpenFile(fn string) (err error)
- func (pb *PBReadType) PbByteArray(s []byte)
- func (pb *PBReadType) PbFile(fn string) (err error)
- func (pb *PBReadType) PbRune(rn rune)
- func (pb *PBReadType) PbRuneArray(rns []rune)
- func (pb *PBReadType) PbString(s string)
- func (pb *PBReadType) PeekRune() (rn rune, done bool)
- func (pb *PBReadType) SetPos(LineNo int, ColNo int, FileName string)
Constants ¶
const (
MaxAFew = 512
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ABuffer ¶
type ABuffer struct { Buffer []rune FileName string AbsFileName string LineNo int ColNo int Pos int // # of chars since start of this file EofOnFile bool // End of buffer is EOF on this file. }
Data from file or push back save in a buffer
type PBReadType ¶
type PBReadType struct { FileName string // AbsFileName string // FilesOpened map[string]bool // Set of files that have been opened PbBuffer []*ABuffer // PbAFew []rune // PbTop int // }
The read type to track file position and collect push backs.
func (*PBReadType) FileSeen ¶
func (pb *PBReadType) FileSeen(fn string) bool
Have we already seen the specified file. Useful for require(fn)
func (*PBReadType) GetPos ¶
func (pb *PBReadType) GetPos() (LineNo int, ColNo int, FileName string)
Get the current line/col no and file name
func (*PBReadType) NextRune ¶
func (pb *PBReadType) NextRune() (rn rune, done bool)
Return the next rune. If runes have been pushed back then use those first.
func (*PBReadType) OpenFile ¶
func (pb *PBReadType) OpenFile(fn string) (err error)
Open a file - this puts the file at the end of the input. This is used on the command line for a list of files in order. Each opened and added to the end of the list.
func (*PBReadType) PbByteArray ¶
func (pb *PBReadType) PbByteArray(s []byte)
Push back a string. Will be converted from an array of byte to an array of runes.
func (*PBReadType) PbFile ¶
func (pb *PBReadType) PbFile(fn string) (err error)
Place the contents of a file in buffers at the head so NextRune will pull from this next.
func (*PBReadType) PbRune ¶
func (pb *PBReadType) PbRune(rn rune)
Push back a single rune onto input. You can call this more than one time.
func (*PBReadType) PbRuneArray ¶
func (pb *PBReadType) PbRuneArray(rns []rune)
Push back a slice of runes
func (*PBReadType) PbString ¶
func (pb *PBReadType) PbString(s string)
Push back a string - will be converted form string to array of runes
func (*PBReadType) PeekRune ¶
func (pb *PBReadType) PeekRune() (rn rune, done bool)
Take a peek at what is out there - return the next rune without advancing forward.