phrase

package
v0.0.0-...-3c5faa3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

View Source
const DefaultBlockSize = 1024

Variables

This section is empty.

Functions

This section is empty.

Types

type AstNode

type AstNode interface {
	AstNode()
}

type ParseError

type ParseError struct {
	Phrase
	Unexpected *lexer.Token
	Expected   lexer.TokenType
}

func NewParseErr

func NewParseErr(
	pool *Pool,
	phraseType PhraseType,
	children []AstNode,
	unexpected *lexer.Token,
	expected lexer.TokenType) *ParseError

type Phrase

type Phrase struct {
	Type     PhraseType `json:"PhraseType"`
	Children []AstNode
}

func NewPhrase

func NewPhrase(pool *Pool, phraseType PhraseType, children []AstNode) *Phrase

func (Phrase) AstNode

func (p Phrase) AstNode()

AstNode is to extend interface

type PhraseType

type PhraseType uint8
const (
	Unknown PhraseType = iota
	AdditiveExpression
	AnonymousClassDeclaration
	AnonymousClassDeclarationHeader
	AnonymousFunctionCreationExpression
	AnonymousFunctionHeader
	AnonymousFunctionUseClause
	AnonymousFunctionUseVariable
	ArrowFunctionCreationExpression
	ArrowFunctionHeader
	ArrowFunctionUseClause
	ArrowFunctionUseVariable
	ArgumentExpressionList
	ArrayCreationExpression
	ArrayElement
	ArrayInitialiserList
	ArrayKey
	ArrayValue
	BitwiseExpression
	BreakStatement
	ByRefAssignmentExpression
	CaseStatement
	CaseStatementList
	CastExpression
	CatchClause
	CatchClauseList
	CatchNameList
	ClassBaseClause
	ClassConstantAccessExpression
	ClassConstDeclaration
	ClassConstElement
	ClassConstElementList
	ClassDeclaration
	ClassDeclarationBody
	ClassDeclarationHeader
	ClassInterfaceClause
	ClassMemberDeclarationList
	ClassModifiers
	ClassTypeDesignator
	CloneExpression
	ClosureUseList
	CoalesceExpression
	CompoundAssignmentExpression
	CompoundStatement
	TernaryExpression
	ConstantAccessExpression
	ConstDeclaration
	ConstElement
	ConstElementList
	ContinueStatement
	DeclareDirective
	DeclareStatement
	DefaultStatement
	DoStatement
	DoubleQuotedStringLiteral
	EchoIntrinsic
	ElseClause
	ElseIfClause
	ElseIfClauseList
	EmptyIntrinsic
	EncapsulatedExpression
	EncapsulatedVariable
	EncapsulatedVariableList
	EqualityExpression
	Error
	ErrorClassMemberDeclaration
	ErrorClassTypeDesignatorAtom
	ErrorControlExpression
	ErrorExpression
	ErrorScopedAccessExpression
	ErrorTraitAdaptation
	ErrorVariable
	ErrorVariableAtom
	EvalIntrinsic
	ExitIntrinsic
	ExponentiationExpression
	ExpressionList
	ExpressionStatement
	FinallyClause
	ForControl
	ForeachCollection
	ForeachKey
	ForeachStatement
	ForeachValue
	ForEndOfLoop
	ForExpressionGroup
	ForInitialiser
	ForStatement
	FullyQualifiedName
	FunctionCallExpression
	FunctionDeclaration
	FunctionDeclarationBody
	FunctionDeclarationHeader
	FunctionStaticDeclaration
	FunctionStaticInitialiser
	GlobalDeclaration
	GotoStatement
	HaltCompilerStatement
	HeredocStringLiteral
	Identifier
	IfStatement
	IncludeExpression
	IncludeOnceExpression
	InlineText
	InstanceOfExpression
	InstanceofTypeDesignator
	InterfaceBaseClause
	InterfaceDeclaration
	InterfaceDeclarationBody
	InterfaceDeclarationHeader
	InterfaceMemberDeclarationList
	IssetIntrinsic
	ListIntrinsic
	LogicalExpression
	MemberModifierList
	MemberName
	MethodCallExpression
	MethodDeclaration
	MethodDeclarationBody
	MethodDeclarationHeader
	MethodReference
	MultiplicativeExpression
	NamedLabelStatement
	NamespaceAliasingClause
	NamespaceDefinition
	NamespaceName
	NamespaceUseClause
	NamespaceUseClauseList
	NamespaceUseDeclaration
	NamespaceUseGroupClause
	NamespaceUseGroupClauseList
	NullStatement
	ObjectCreationExpression
	ParameterDeclaration
	ParameterDeclarationList
	PostfixDecrementExpression
	PostfixIncrementExpression
	PrefixDecrementExpression
	PrefixIncrementExpression
	PrintIntrinsic
	PropertyAccessExpression
	PropertyDeclaration
	PropertyElement
	PropertyElementList
	PropertyInitialiser
	QualifiedName
	QualifiedNameList
	RelationalExpression
	RelativeQualifiedName
	RelativeScope
	RequireExpression
	RequireOnceExpression
	ReturnStatement
	ReturnType
	ScopedCallExpression
	ScopedMemberName
	ScopedPropertyAccessExpression
	ShellCommandExpression
	ShiftExpression
	SimpleAssignmentExpression
	SimpleVariable
	StatementList
	StaticVariableDeclaration
	StaticVariableDeclarationList
	SubscriptExpression
	SwitchStatement
	ThrowStatement
	TraitAdaptationList
	TraitAlias
	TraitDeclaration
	TraitDeclarationBody
	TraitDeclarationHeader
	TraitMemberDeclarationList
	TraitPrecedence
	TraitUseClause
	TraitUseSpecification
	TryStatement
	TypeDeclaration
	UnaryOpExpression
	UnsetIntrinsic
	VariableList
	VariableNameList
	VariadicUnpacking
	WhileStatement
	YieldExpression
	YieldFromExpression
	DocumentComment
	DocumentCommentDescription
	DocumentCommentAuthor
	DocumentCommentEmail

	DocumentCommentTagAnchorStart
	DocumentCommentTag
	DocumentCommentAuthorTag
	DocumentCommentDeprecatedTag
	DocumentCommentGlobalTag
	DocumentCommentMethodTag
	DocumentCommentParamTag
	DocumentCommentPropertyTag
	DocumentCommentReturnTag
	DocumentCommentThrowsTag
	DocumentCommentVarTag
	DocumentCommentTagAnchorEnd

	TypeUnion
	ParameterValue
)

func (*PhraseType) MarshalJSON

func (phraseType *PhraseType) MarshalJSON() ([]byte, error)

func (PhraseType) String

func (i PhraseType) String() string

type Pool

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

func NewPool

func NewPool(blockSize int) *Pool

func (*Pool) Get

func (p *Pool) Get() *Phrase

Jump to

Keyboard shortcuts

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