parser

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const AND = 57379
View Source
const ANDEQ = 57355
View Source
const AS = 57380
View Source
const ASSERT = 57381
View Source
const BREAK = 57382
View Source
const CLASS = 57383
View Source
const CONTINUE = 57384
View Source
const DEDENT = 57350
View Source
const DEF = 57385
View Source
const DEL = 57386
View Source
const DIVDIV = 57363
View Source
const DIVDIVEQ = 57364
View Source
const DIVEQ = 57365
View Source
const ELIF = 57387
View Source
const ELIPSIS = 57362
View Source
const ELSE = 57388
View Source
const ENDMARKER = 57347
View Source
const EQEQ = 57370
View Source
const EVAL_INPUT = 57411
View Source
const EXCEPT = 57389
View Source
const FALSE = 57376
View Source
const FILE_INPUT = 57410
View Source
const FINALLY = 57390
View Source
const FOR = 57391
View Source
const FROM = 57392
View Source
const GLOBAL = 57393
View Source
const GTEQ = 57371
View Source
const GTGT = 57372
View Source
const GTGTEQ = 57373
View Source
const HATEQ = 57374
View Source
const IF = 57394
View Source
const IMPORT = 57395
View Source
const IN = 57396
View Source
const INDENT = 57349
View Source
const IS = 57397
View Source
const LAMBDA = 57398
View Source
const LTEQ = 57368
View Source
const LTGT = 57369
View Source
const LTLT = 57366
View Source
const LTLTEQ = 57367
View Source
const MINUSEQ = 57360
View Source
const MINUSGT = 57361
View Source
const NAME = 57348
View Source
const NEWLINE = 57346
View Source
const NONE = 57377
View Source
const NONLOCAL = 57399
View Source
const NOT = 57400
View Source
const NUMBER = 57352
View Source
const OR = 57401
View Source
const PASS = 57402
View Source
const PERCEQ = 57354
View Source
const PIPEEQ = 57375
View Source
const PLINGEQ = 57353
View Source
const PLUSEQ = 57359
View Source
const RAISE = 57403
View Source
const RETURN = 57404
View Source
const SINGLE_INPUT = 57409
View Source
const STAREQ = 57358
View Source
const STARSTAR = 57356
View Source
const STARSTAREQ = 57357
View Source
const STRING = 57351
View Source
const TRUE = 57378
View Source
const TRY = 57405
View Source
const WHILE = 57406
View Source
const WITH = 57407
View Source
const YIELD = 57408

Variables

This section is empty.

Functions

func DecodeEscape

func DecodeEscape(in *bytes.Buffer, byteMode bool) (out *bytes.Buffer, err error)

DecodeEscape unescapes a backslash-escaped buffer

byteMode indicates whether we are creating a unicode string or a bytes output

func NewLex

func NewLex(r io.Reader, filename string, mode py.CompileMode) (*yyLex, error)

Create a new lexer

The mode argument specifies what kind of code must be compiled; it can be 'exec' if source consists of a sequence of statements, 'eval' if it consists of a single expression, or 'single' if it consists of a single interactive statement

func Parse

func Parse(in io.Reader, filename string, mode py.CompileMode) (mod ast.Mod, err error)

Parse a file

func ParseString

func ParseString(in string, mode py.CompileMode) (ast.Ast, error)

Parse a string

func SetDebug

func SetDebug(level int)

Set the debug level 0 = off, 4 = max

Types

type LexToken

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

A Token with value

func (*LexToken) String

func (lt *LexToken) String() string

String a LexToken

type LexTokens

type LexTokens []LexToken

An slice of LexToken~s

func Lex

func Lex(in io.Reader, filename string, mode py.CompileMode) (lts LexTokens, err error)

Lex a file only, returning a sequence of tokens

func LexString

func LexString(in string, mode py.CompileMode) (lts LexTokens, err error)

Lex a string

func (LexTokens) Eq

func (as LexTokens) Eq(bs []LexToken) bool

Compare two LexTokens

func (LexTokens) String

func (lts LexTokens) String() string

String a LexTokens

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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