hex

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2022 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const StringChainingThreshold int = 200

Variables

This section is empty.

Functions

func Parse

func Parse(input io.Reader) (tokens []ast.HexToken, err error)

Parse parses an hex string in a YARA rule from the provided input source

func YYmain

func YYmain(filenames ...string) (interface{}, error)

Types

type Scanner

type Scanner struct {
	In     io.Reader
	Out    io.Writer
	Lineno int

	Filename      string
	Wrap          func(*Scanner) bool
	IsInteractive func(io.Reader) bool
	Context       YYcontext

	Interactive bool
	// contains filtered or unexported fields
}

func NewScanner

func NewScanner() *Scanner

func (*Scanner) Input

func (yy *Scanner) Input() (byte, error)

func (*Scanner) Lex

func (yy *Scanner) Lex() YYtype

The main scanner function which does all the work.

func (*Scanner) NewFile

func (yy *Scanner) NewFile()

func (*Scanner) Restart

func (yy *Scanner) Restart(input_file io.Reader)

* Immediately switch to a different input stream.

  • @param input_file A readable stream. *
  • @note This function does not reset the start condition to @c yyInitial .

func (*Scanner) Token added in v0.4.0

func (s *Scanner) Token(t int) YYtype

func (*Scanner) TokenByte added in v0.4.0

func (s *Scanner) TokenByte(t int, value, mask byte, not bool) YYtype

func (*Scanner) TokenInteger added in v0.4.0

func (s *Scanner) TokenInteger(t int, i int) YYtype

type YYcontext

type YYcontext struct{}

type YYtype

type YYtype struct {
	Token int
	Value *hexSymType
	Error gyperror.Error
}

YYtype is the structure returned by the lexer every time the scanner asks for the next token. If the lexer wants to return an error to the scanner it sets the Error field and leaves the Token empty.

func Error added in v0.2.0

func Error(c gyperror.Code, msg string) YYtype

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL