scanner

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package scanner transforms an input string into a stream of PHP tokens.

Index

Constants

View Source
const (
	INITIAL = iota
	PHP
	STRING
	STRING_VAR
	STRING_VAR_INDEX
	STRING_VAR_NAME
	PROPERTY
	HEREDOC_END
	NOWDOC
	HEREDOC
	BACKQUOTE
)
View Source
const T_ABSTRACT = 57441

T_ABSTRACT token

View Source
const T_AND_EQUAL = 57465

T_AND_EQUAL token

View Source
const T_ARRAY = 57402

T_ARRAY token

View Source
const T_ARRAY_CAST = 57452

T_ARRAY_CAST token

View Source
const T_AS = 57371

T_AS token

View Source
const T_BAD_CHARACTER = 57358

T_BAD_CHARACTER token

View Source
const T_BOOLEAN_AND = 57472

T_BOOLEAN_AND token

View Source
const T_BOOLEAN_OR = 57471

T_BOOLEAN_OR token

View Source
const T_BOOL_CAST = 57454

T_BOOL_CAST token

View Source
const T_BREAK = 57376

T_BREAK token

View Source
const T_CALLABLE = 57403

T_CALLABLE token

View Source
const T_CASE = 57374

T_CASE token

View Source
const T_CATCH = 57383

T_CATCH token

View Source
const T_CHARACTER = 57357

T_CHARACTER token

View Source
const T_CLASS = 57394

T_CLASS token

View Source
const T_CLASS_C = 57404

T_CLASS_C token

View Source
const T_CLONE = 57434

T_CLONE token

View Source
const T_CLOSE_TAG = 57414

T_CLOSE_TAG token

View Source
const T_COALESCE = 57456

T_COALESCE token

View Source
const T_COMMENT = 57410

T_COMMENT token

View Source
const T_CONCAT_EQUAL = 57463

T_CONCAT_EQUAL token

View Source
const T_CONST = 57380

T_CONST token

View Source
const T_CONSTANT_ENCAPSED_STRING = 57360

T_CONSTANT_ENCAPSED_STRING token

View Source
const T_CONTINUE = 57377

T_CONTINUE token

View Source
const T_CURLY_OPEN = 57419

T_CURLY_OPEN token

View Source
const T_DEC = 57447

T_DEC token

View Source
const T_DECLARE = 57369

T_DECLARE token

View Source
const T_DEFAULT = 57375

T_DEFAULT token

View Source
const T_DIR = 57423

T_DIR token

View Source
const T_DIV_EQUAL = 57462

T_DIV_EQUAL token

View Source
const T_DNUMBER = 57351

T_DNUMBER token

View Source
const T_DO = 57362

T_DO token

View Source
const T_DOC_COMMENT = 57411

T_DOC_COMMENT token

View Source
const T_DOLLAR_OPEN_CURLY_BRACES = 57418

T_DOLLAR_OPEN_CURLY_BRACES token

View Source
const T_DOUBLE_ARROW = 57400

T_DOUBLE_ARROW token

View Source
const T_DOUBLE_CAST = 57450

T_DOUBLE_CAST token

View Source
const T_ECHO = 57361

T_ECHO token

View Source
const T_ELLIPSIS = 57425

T_ELLIPSIS token

View Source
const T_ELSE = 57436

T_ELSE token

View Source
const T_ELSEIF = 57435

T_ELSEIF token

View Source
const T_EMPTY = 57392

T_EMPTY token

View Source
const T_ENCAPSED_AND_WHITESPACE = 57359

T_ENCAPSED_AND_WHITESPACE token

View Source
const T_ENDDECLARE = 57370

T_ENDDECLARE token

View Source
const T_ENDFOR = 57366

T_ENDFOR token

View Source
const T_ENDFOREACH = 57368

T_ENDFOREACH token

View Source
const T_ENDIF = 57437

T_ENDIF token

View Source
const T_ENDSWITCH = 57373

T_ENDSWITCH token

View Source
const T_ENDWHILE = 57364

T_ENDWHILE token

View Source
const T_END_HEREDOC = 57417

T_END_HEREDOC token

View Source
const T_EVAL = 57426

T_EVAL token

View Source
const T_EXIT = 57348

T_EXIT token

View Source
const T_EXTENDS = 57397

T_EXTENDS token

View Source
const T_FILE = 57409

T_FILE token

View Source
const T_FINAL = 57442

T_FINAL token

View Source
const T_FINALLY = 57384

T_FINALLY token

View Source
const T_FOR = 57365

T_FOR token

View Source
const T_FOREACH = 57367

T_FOREACH token

View Source
const T_FUNCTION = 57379

T_FUNCTION token

View Source
const T_FUNC_C = 57407

T_FUNC_C token

View Source
const T_GLOBAL = 57388

T_GLOBAL token

View Source
const T_GOTO = 57378

T_GOTO token

View Source
const T_HALT_COMPILER = 57393

T_HALT_COMPILER token

View Source
const T_IF = 57349

T_IF token

View Source
const T_IMPLEMENTS = 57398

T_IMPLEMENTS token

View Source
const T_INC = 57446

T_INC token

View Source
const T_INCLUDE = 57346

T_INCLUDE token

View Source
const T_INCLUDE_ONCE = 57347

T_INCLUDE_ONCE token

View Source
const T_INLINE_HTML = 57356

T_INLINE_HTML token

View Source
const T_INSTANCEOF = 57432

T_INSTANCEOF token

View Source
const T_INSTEADOF = 57387

T_INSTEADOF token

View Source
const T_INTERFACE = 57396

T_INTERFACE token

View Source
const T_INT_CAST = 57449

T_INT_CAST token

View Source
const T_ISSET = 57391

T_ISSET token

View Source
const T_IS_EQUAL = 57473

T_IS_EQUAL token

View Source
const T_IS_GREATER_OR_EQUAL = 57478

T_IS_GREATER_OR_EQUAL token

View Source
const T_IS_IDENTICAL = 57475

T_IS_IDENTICAL token

View Source
const T_IS_NOT_EQUAL = 57474

T_IS_NOT_EQUAL token

View Source
const T_IS_NOT_IDENTICAL = 57476

T_IS_NOT_IDENTICAL token

View Source
const T_IS_SMALLER_OR_EQUAL = 57477

T_IS_SMALLER_OR_EQUAL token

View Source
const T_LINE = 57408

T_LINE token

View Source
const T_LIST = 57401

T_LIST token

View Source
const T_LNUMBER = 57350

T_LNUMBER token

View Source
const T_LOGICAL_AND = 57431

T_LOGICAL_AND token

View Source
const T_LOGICAL_OR = 57429

T_LOGICAL_OR token

View Source
const T_LOGICAL_XOR = 57430

T_LOGICAL_XOR token

View Source
const T_METHOD_C = 57406

T_METHOD_C token

View Source
const T_MINUS_EQUAL = 57460

T_MINUS_EQUAL token

View Source
const T_MOD_EQUAL = 57464

T_MOD_EQUAL token

View Source
const T_MUL_EQUAL = 57461

T_MUL_EQUAL token

View Source
const T_NAMESPACE = 57421

T_NAMESPACE token

View Source
const T_NEW = 57433

T_NEW token

View Source
const T_NOELSE = 57458

T_NOELSE token

View Source
const T_NS_C = 57422

T_NS_C token

View Source
const T_NS_SEPARATOR = 57424

T_NS_SEPARATOR token

View Source
const T_NUM_STRING = 57355

T_NUM_STRING token

View Source
const T_OBJECT_CAST = 57453

T_OBJECT_CAST token

View Source
const T_OBJECT_OPERATOR = 57399

T_OBJECT_OPERATOR token

View Source
const T_OPEN_TAG = 57412

T_OPEN_TAG token

View Source
const T_OPEN_TAG_WITH_ECHO = 57413

T_OPEN_TAG_WITH_ECHO token

View Source
const T_OR_EQUAL = 57466

T_OR_EQUAL token

View Source
const T_PAAMAYIM_NEKUDOTAYIM = 57420

T_PAAMAYIM_NEKUDOTAYIM token

View Source
const T_PLUS_EQUAL = 57459

T_PLUS_EQUAL token

View Source
const T_POW = 57481

T_POW token

View Source
const T_POW_EQUAL = 57470

T_POW_EQUAL token

View Source
const T_PRINT = 57438

T_PRINT token

View Source
const T_PRIVATE = 57443

T_PRIVATE token

View Source
const T_PROTECTED = 57444

T_PROTECTED token

View Source
const T_PUBLIC = 57445

T_PUBLIC token

View Source
const T_REQUIRE = 57427

T_REQUIRE token

View Source
const T_REQUIRE_ONCE = 57428

T_REQUIRE_ONCE token

View Source
const T_RETURN = 57381

T_RETURN token

View Source
const T_SL = 57479

T_SL token

View Source
const T_SL_EQUAL = 57468

T_SL_EQUAL token

View Source
const T_SPACESHIP = 57457

T_SPACESHIP token

View Source
const T_SR = 57480

T_SR token

View Source
const T_SR_EQUAL = 57469

T_SR_EQUAL token

View Source
const T_START_HEREDOC = 57416

T_START_HEREDOC token

View Source
const T_STATIC = 57440

T_STATIC token

View Source
const T_STRING = 57352

T_STRING token

View Source
const T_STRING_CAST = 57451

T_STRING_CAST token

View Source
const T_STRING_VARNAME = 57353

T_STRING_VARNAME token

View Source
const T_SWITCH = 57372

T_SWITCH token

View Source
const T_THROW = 57385

T_THROW token

View Source
const T_TRAIT = 57395

T_TRAIT token

View Source
const T_TRAIT_C = 57405

T_TRAIT_C token

View Source
const T_TRY = 57382

T_TRY token

View Source
const T_UNSET = 57390

T_UNSET token

View Source
const T_UNSET_CAST = 57455

T_UNSET_CAST token

View Source
const T_USE = 57386

T_USE token

View Source
const T_VAR = 57389

T_VAR token

View Source
const T_VARIABLE = 57354

T_VARIABLE token

View Source
const T_WHILE = 57363

T_WHILE token

View Source
const T_WHITESPACE = 57415

T_WHITESPACE token

View Source
const T_XOR_EQUAL = 57467

T_XOR_EQUAL token

View Source
const T_YIELD = 57439

T_YIELD token

View Source
const T_YIELD_FROM = 57448

T_YIELD_FROM token

Variables

This section is empty.

Functions

func Rune2Class

func Rune2Class(r rune) int

Rune2Class returns the rune integer id

Types

type Lexer

type Lexer struct {
	*lex.Lexer
	StateStack    []int
	PhpDocComment string
	Comments      []comment.Comment
}

Lexer php lexer

func NewLexer

func NewLexer(src io.Reader, fName string) *Lexer

NewLexer the Lexer constructor

func (*Lexer) Lex

func (l *Lexer) Lex(lval Lval) int

type Lval

type Lval interface {
	Token(tkn t.Token)
}

Lval parsers yySymType must implement this interface

Jump to

Keyboard shortcuts

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