typescript

package
v0.0.0-...-d2a39d3 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsModifier

func IsModifier(token *Token) bool

Types

type AccessModifier

type AccessModifier string
const (
	PrivateAccess   AccessModifier = "private"
	ProtectedAccess AccessModifier = "protected"
	PublicAccess    AccessModifier = "public"
	ReadOnlyAccess  AccessModifier = "readonly"
)

func IsAccessModifier

func IsAccessModifier(token *Token) (AccessModifier, bool)

type AccessorModifier

type AccessorModifier string
const (
	AccessorAccessorModifier AccessorModifier = "get"
	MutatorAccessorModifier  AccessorModifier = "set"
)

func IsAccessorModifier

func IsAccessorModifier(token *Token) (AccessorModifier, bool)

type Argument

type Argument struct {
	Name string
	Type string
}

type Class

type Class struct {
	Name       string
	Extends    string
	Implements []string
	Fields     []Field
	Methods    []Method
}

func Parse

func Parse(lexer *Lexer) []*Class

func (*Class) String

func (c *Class) String() string

type ClassObjectModifier

type ClassObjectModifier string
const (
	StaticModifier ClassObjectModifier = "static"
)

func IsClassObjectModifier

func IsClassObjectModifier(token *Token) (ClassObjectModifier, bool)

type Field

type Field struct {
	Modifiers []*Token
	Name      string
	Type      string
}

type Lexer

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

func NewLexer

func NewLexer(bytes []byte) *Lexer

func (*Lexer) Peek

func (l *Lexer) Peek() (byte, bool)

func (*Lexer) Pop

func (l *Lexer) Pop() (byte, bool)

func (*Lexer) Position

func (l *Lexer) Position() (row, column int)

func (*Lexer) Push

func (l *Lexer) Push(b byte)

func (*Lexer) Special

func (l *Lexer) Special() map[byte]bool

func (*Lexer) Token

func (l *Lexer) Token() *Token

func (*Lexer) Whitespace

func (l *Lexer) Whitespace() map[byte]bool

type Method

type Method struct {
	Modifiers []*Token
	Name      string
	Arguments []Argument
	Type      string
}

type MutabilityModifier

type MutabilityModifier string
const (
	ReadOnlyMutability  MutabilityModifier = "readonly"
	ReadWriteMutability MutabilityModifier = "readwrite"
)

func IsMutabilityModifier

func IsMutabilityModifier(token *Token) (MutabilityModifier, bool)

type Parser

type Parser struct {
	Lexer   *Lexer
	Classes []*Class
}

func (*Parser) ClassBlock

func (p *Parser) ClassBlock(class *Class)

func (*Parser) ClassDefinition

func (p *Parser) ClassDefinition(token *Token) *Token

func (*Parser) ClassSearch

func (p *Parser) ClassSearch()

func (*Parser) MethodArguments

func (p *Parser) MethodArguments() []Argument

func (*Parser) SkipBlock

func (p *Parser) SkipBlock()

func (*Parser) SkipBlockComment

func (p *Parser) SkipBlockComment(token *Token) *Token

func (*Parser) SkipComment

func (p *Parser) SkipComment(token *Token) *Token

func (*Parser) SkipGeneric

func (p *Parser) SkipGeneric(token *Token) *Token

func (*Parser) SkipLineComment

func (p *Parser) SkipLineComment(token *Token) *Token

func (*Parser) SkipMethodLambdaType

func (p *Parser) SkipMethodLambdaType() *Token

func (*Parser) Token

func (p *Parser) Token() *Token

type Token

type Token struct {
	Row, Column int
	Bytes       []byte
	EOL         bool
	EOF         bool
}

func (Token) String

func (t Token) String() string

Jump to

Keyboard shortcuts

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