vbscanner

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package vbscanner implements a VBScript scanner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mode

type Mode int

Mode describes whether we are scanning HTML or VBS code

const (
	HTML_MODE Mode = iota // when reading the HTML part of ASP
	VBS_MODE              // when reading the VBScript part of ASP
)

Mode types

func (Mode) String

func (i Mode) String() string

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

Scanner reads a stream and provides VBS tokens scanned from it

func (*Scanner) Init

func (s *Scanner) Init(src io.Reader, initialMode Mode)

Init sets up the scanner with the given reader

func (*Scanner) Scan

func (s *Scanner) Scan() (TokenType, string)

Scan returns the next token type and its value.

type TokenType

type TokenType int

TokenType describes the type of token read by the scanner

const (
	EOF     TokenType = iota // end of file
	EOL                      // end of line - needed for vb
	Ident                    // identifiers
	String                   // string literals
	Integer                  // integer literals
	Float                    // float literals
	Date                     // date literals
	Comment                  // comments
	Html                     // the HTML fragments in the ASP
	Char                     // random characters like parens
	Op                       // operators
)

Token types

func (TokenType) String

func (i TokenType) String() string

Jump to

Keyboard shortcuts

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